@zipify/wysiwyg 4.6.0-0 → 4.7.0
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/.husky/pre-commit +0 -3
- package/dist/cli.js +47 -49
- package/dist/node.js +29 -31
- package/dist/types/Wysiwyg.vue.d.ts +14 -16
- package/dist/types/components/base/Button.vue.d.ts +15 -8
- package/dist/types/components/base/ButtonToggle.vue.d.ts +19 -12
- package/dist/types/components/base/Checkbox.vue.d.ts +1 -1
- package/dist/types/components/base/FieldLabel.vue.d.ts +15 -8
- package/dist/types/components/base/Icon.vue.d.ts +1 -1
- package/dist/types/components/base/Modal.vue.d.ts +17 -8
- package/dist/types/components/base/ModalFloating.vue.d.ts +17 -8
- package/dist/types/components/base/NumberField.vue.d.ts +1 -1
- package/dist/types/components/base/Range.vue.d.ts +1 -1
- package/dist/types/components/base/ScrollView.vue.d.ts +12 -3
- package/dist/types/components/base/TextField.vue.d.ts +1 -1
- package/dist/types/components/base/colorPicker/ColorPicker.vue.d.ts +22 -13
- package/dist/types/components/base/composables/useModalToggler.d.ts +1 -4
- package/dist/types/components/base/composables/useNumberValue.d.ts +1 -1
- package/dist/types/components/base/composables/useScrollView.d.ts +1 -3
- package/dist/types/components/base/composables/useTempValue.d.ts +1 -1
- package/dist/types/components/base/composables/useValidator.d.ts +1 -1
- package/dist/types/components/base/dropdown/Dropdown.vue.d.ts +18 -9
- package/dist/types/components/base/dropdown/DropdownActivator.vue.d.ts +18 -11
- package/dist/types/components/base/dropdown/DropdownDivider.vue.d.ts +1 -1
- package/dist/types/components/base/dropdown/DropdownGroup.vue.d.ts +17 -10
- package/dist/types/components/base/dropdown/DropdownMenu.vue.d.ts +18 -10
- package/dist/types/components/base/dropdown/DropdownOption.vue.d.ts +17 -8
- package/dist/types/components/base/dropdown/composables/useActiveOptionManager.d.ts +2 -4
- package/dist/types/components/toolbar/Toolbar.vue.d.ts +1 -1
- package/dist/types/components/toolbar/ToolbarFloating.vue.d.ts +19 -20
- package/dist/types/components/toolbar/base/ToolbarDivider.vue.d.ts +5 -5
- package/dist/types/components/toolbar/base/ToolbarGroup.vue.d.ts +1 -1
- package/dist/types/components/toolbar/base/ToolbarRow.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/AlignmentControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/BackgroundColorControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/CaseStyleControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/FontColorControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/FontFamilyControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/FontSizeControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/FontWeightControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/ItalicControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/LineHeightControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/ListControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/RemoveFormatControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/StrikeThroughControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/SuperscriptControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/UnderlineControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/composables/useRecentFonts.d.ts +1 -1
- package/dist/types/components/toolbar/controls/link/LinkControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/link/LinkControlHeader.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/link/composables/useLink.d.ts +18 -0
- package/dist/types/components/toolbar/controls/link/destination/LinkControlDestination.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/link/destination/LinkControlPageBlock.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/link/destination/LinkControlUrl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/stylePreset/StylePresetControl.vue.d.ts +1 -1
- package/dist/types/components/toolbar/controls/stylePreset/StylePresetOption.vue.d.ts +6 -4
- package/dist/types/components/toolbar/layouts/ToolbarDesktop.vue.d.ts +1 -1
- package/dist/types/components/toolbar/layouts/ToolbarMobile.vue.d.ts +1 -1
- package/dist/types/components/toolbar/layouts/ToolbarPopup.vue.d.ts +1 -1
- package/dist/types/extensions/core/index.d.ts +1 -1
- package/dist/types/services/NodeFactory.d.ts +3 -3
- package/dist/wysiwyg.mjs +117 -87
- package/lib/components/toolbar/ToolbarFloating.vue +16 -21
- package/package.json +36 -36
package/dist/cli.js
CHANGED
|
@@ -1,61 +1,59 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`).replace(/^/gm," ".repeat(
|
|
3
|
-
`)}padWidth(
|
|
1
|
+
"use strict";var Ix=require("node:events"),Nx=require("node:child_process"),Rx=require("node:path"),Lx=require("node:fs"),Px=require("node:process"),hp=require("path"),dp=require("jsdom"),Ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dx(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Et={},Lo={},Po={},pp;function Do(){if(pp)return Po;pp=1;class n extends Error{constructor(r,i,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=r,this.nestedError=void 0}}class e extends n{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}return Po.CommanderError=n,Po.InvalidArgumentError=e,Po}var mp;function Eu(){if(mp)return Lo;mp=1;const{InvalidArgumentError:n}=Do();class e{constructor(i,o){switch(this.description=o||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(i,o){return o===this.defaultValue||!Array.isArray(o)?[i]:o.concat(i)}default(i,o){return this.defaultValue=i,this.defaultValueDescription=o,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(o,l)=>{if(!this.argChoices.includes(o))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(o,l):o},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function t(r){const i=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+i+">":"["+i+"]"}return Lo.Argument=e,Lo.humanReadableArgName=t,Lo}var ku={},Cu={},gp;function yp(){if(gp)return Cu;gp=1;const{humanReadableArgName:n}=Eu();class e{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(r){const i=r.commands.filter(l=>!l._hidden),o=r._getHelpCommand();return o&&!o._hidden&&i.push(o),this.sortSubcommands&&i.sort((l,u)=>l.name().localeCompare(u.name())),i}compareOptions(r,i){const o=l=>l.short?l.short.replace(/^-/,""):l.long.replace(/^--/,"");return o(r).localeCompare(o(i))}visibleOptions(r){const i=r.options.filter(l=>!l.hidden),o=r._getHelpOption();if(o&&!o.hidden){const l=o.short&&r._findOption(o.short),u=o.long&&r._findOption(o.long);!l&&!u?i.push(o):o.long&&!u?i.push(r.createOption(o.long,o.description)):o.short&&!l&&i.push(r.createOption(o.short,o.description))}return this.sortOptions&&i.sort(this.compareOptions),i}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];const i=[];for(let o=r.parent;o;o=o.parent){const l=o.options.filter(u=>!u.hidden);i.push(...l)}return this.sortOptions&&i.sort(this.compareOptions),i}visibleArguments(r){return r._argsDescription&&r.registeredArguments.forEach(i=>{i.description=i.description||r._argsDescription[i.name()]||""}),r.registeredArguments.find(i=>i.description)?r.registeredArguments:[]}subcommandTerm(r){const i=r.registeredArguments.map(o=>n(o)).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,i){return i.visibleCommands(r).reduce((o,l)=>Math.max(o,i.subcommandTerm(l).length),0)}longestOptionTermLength(r,i){return i.visibleOptions(r).reduce((o,l)=>Math.max(o,i.optionTerm(l).length),0)}longestGlobalOptionTermLength(r,i){return i.visibleGlobalOptions(r).reduce((o,l)=>Math.max(o,i.optionTerm(l).length),0)}longestArgumentTermLength(r,i){return i.visibleArguments(r).reduce((o,l)=>Math.max(o,i.argumentTerm(l).length),0)}commandUsage(r){let i=r._name;r._aliases[0]&&(i=i+"|"+r._aliases[0]);let o="";for(let l=r.parent;l;l=l.parent)o=l.name()+" "+o;return o+i+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){const i=[];return r.argChoices&&i.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&(r.required||r.optional||r.isBoolean()&&typeof r.defaultValue=="boolean")&&i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),r.presetArg!==void 0&&r.optional&&i.push(`preset: ${JSON.stringify(r.presetArg)}`),r.envVar!==void 0&&i.push(`env: ${r.envVar}`),i.length>0?`${r.description} (${i.join(", ")})`:r.description}argumentDescription(r){const i=[];if(r.argChoices&&i.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),i.length>0){const o=`(${i.join(", ")})`;return r.description?`${r.description} ${o}`:o}return r.description}formatHelp(r,i){const o=i.padWidth(r,i),l=i.helpWidth||80,u=2,f=2;function d(b,x){if(x){const A=`${b.padEnd(o+f)}${x}`;return i.wrap(A,l-u,o+f)}return b}function g(b){return b.join(`
|
|
2
|
+
`).replace(/^/gm," ".repeat(u))}let p=[`Usage: ${i.commandUsage(r)}`,""];const _=i.commandDescription(r);_.length>0&&(p=p.concat([i.wrap(_,l,0),""]));const S=i.visibleArguments(r).map(b=>d(i.argumentTerm(b),i.argumentDescription(b)));S.length>0&&(p=p.concat(["Arguments:",g(S),""]));const k=i.visibleOptions(r).map(b=>d(i.optionTerm(b),i.optionDescription(b)));if(k.length>0&&(p=p.concat(["Options:",g(k),""])),this.showGlobalOptions){const b=i.visibleGlobalOptions(r).map(x=>d(i.optionTerm(x),i.optionDescription(x)));b.length>0&&(p=p.concat(["Global Options:",g(b),""]))}const m=i.visibleCommands(r).map(b=>d(i.subcommandTerm(b),i.subcommandDescription(b)));return m.length>0&&(p=p.concat(["Commands:",g(m),""])),p.join(`
|
|
3
|
+
`)}padWidth(r,i){return Math.max(i.longestOptionTermLength(r,i),i.longestGlobalOptionTermLength(r,i),i.longestSubcommandTermLength(r,i),i.longestArgumentTermLength(r,i))}wrap(r,i,o,l=40){const u=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",f=new RegExp(`[\\n][${u}]+`);if(r.match(f))return r;const d=i-o;if(d<l)return r;const g=r.slice(0,o),p=r.slice(o).replace(`\r
|
|
4
4
|
`,`
|
|
5
|
-
`),
|
|
6
|
-
|.{1,${
|
|
7
|
-
`?"":(
|
|
8
|
-
`)}}
|
|
9
|
-
(Did you mean one of ${
|
|
10
|
-
(Did you mean ${
|
|
11
|
-
- specify the name in Command constructor or using .name()`);return
|
|
12
|
-
Expecting one of '${
|
|
13
|
-
- already used by option '${
|
|
14
|
-
- if '${
|
|
5
|
+
`),_=" ".repeat(o),k="\\s\u200B",m=new RegExp(`
|
|
6
|
+
|.{1,${d-1}}([${k}]|$)|[^${k}]+?([${k}]|$)`,"g"),b=p.match(m)||[];return g+b.map((x,A)=>x===`
|
|
7
|
+
`?"":(A>0?_:"")+x.trimEnd()).join(`
|
|
8
|
+
`)}}return Cu.Help=e,Cu}var Fo={},bp;function _p(){if(bp)return Fo;bp=1;const{InvalidArgumentError:n}=Do();class e{constructor(l,u){this.flags=l,this.description=u||"",this.required=l.includes("<"),this.optional=l.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(l),this.mandatory=!1;const f=i(l);this.short=f.shortFlag,this.long=f.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(l,u){return this.defaultValue=l,this.defaultValueDescription=u,this}preset(l){return this.presetArg=l,this}conflicts(l){return this.conflictsWith=this.conflictsWith.concat(l),this}implies(l){let u=l;return typeof l=="string"&&(u={[l]:!0}),this.implied=Object.assign(this.implied||{},u),this}env(l){return this.envVar=l,this}argParser(l){return this.parseArg=l,this}makeOptionMandatory(l=!0){return this.mandatory=!!l,this}hideHelp(l=!0){return this.hidden=!!l,this}_concatValue(l,u){return u===this.defaultValue||!Array.isArray(u)?[l]:u.concat(l)}choices(l){return this.argChoices=l.slice(),this.parseArg=(u,f)=>{if(!this.argChoices.includes(u))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(u,f):u},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return r(this.name().replace(/^no-/,""))}is(l){return this.short===l||this.long===l}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class t{constructor(l){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,l.forEach(u=>{u.negate?this.negativeOptions.set(u.attributeName(),u):this.positiveOptions.set(u.attributeName(),u)}),this.negativeOptions.forEach((u,f)=>{this.positiveOptions.has(f)&&this.dualOptions.add(f)})}valueFromOption(l,u){const f=u.attributeName();if(!this.dualOptions.has(f))return!0;const d=this.negativeOptions.get(f).presetArg,g=d!==void 0?d:!1;return u.negate===(g===l)}}function r(o){return o.split("-").reduce((l,u)=>l+u[0].toUpperCase()+u.slice(1))}function i(o){let l,u;const f=o.split(/[ |,]+/);return f.length>1&&!/^[[<]/.test(f[1])&&(l=f.shift()),u=f.shift(),!l&&/^-[^-]$/.test(u)&&(l=u,u=void 0),{shortFlag:l,longFlag:u}}return Fo.Option=e,Fo.DualOptions=t,Fo}var Au={},vp;function Fx(){if(vp)return Au;vp=1;const n=3;function e(r,i){if(Math.abs(r.length-i.length)>n)return Math.max(r.length,i.length);const o=[];for(let l=0;l<=r.length;l++)o[l]=[l];for(let l=0;l<=i.length;l++)o[0][l]=l;for(let l=1;l<=i.length;l++)for(let u=1;u<=r.length;u++){let f=1;r[u-1]===i[l-1]?f=0:f=1,o[u][l]=Math.min(o[u-1][l]+1,o[u][l-1]+1,o[u-1][l-1]+f),u>1&&l>1&&r[u-1]===i[l-2]&&r[u-2]===i[l-1]&&(o[u][l]=Math.min(o[u][l],o[u-2][l-2]+1))}return o[r.length][i.length]}function t(r,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));const o=r.startsWith("--");o&&(r=r.slice(2),i=i.map(d=>d.slice(2)));let l=[],u=n;const f=.4;return i.forEach(d=>{if(d.length<=1)return;const g=e(r,d),p=Math.max(r.length,d.length);(p-g)/p>f&&(g<u?(u=g,l=[d]):g===u&&l.push(d))}),l.sort((d,g)=>d.localeCompare(g)),o&&(l=l.map(d=>`--${d}`)),l.length>1?`
|
|
9
|
+
(Did you mean one of ${l.join(", ")}?)`:l.length===1?`
|
|
10
|
+
(Did you mean ${l[0]}?)`:""}return Au.suggestSimilar=t,Au}var wp;function Bx(){if(wp)return ku;wp=1;const n=Ix.EventEmitter,e=Nx,t=Rx,r=Lx,i=Px,{Argument:o,humanReadableArgName:l}=Eu(),{CommanderError:u}=Do(),{Help:f}=yp(),{Option:d,DualOptions:g}=_p(),{suggestSimilar:p}=Fx();class _ extends n{constructor(m){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=m||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:b=>i.stdout.write(b),writeErr:b=>i.stderr.write(b),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,outputError:(b,x)=>x(b)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(m){return this._outputConfiguration=m._outputConfiguration,this._helpOption=m._helpOption,this._helpCommand=m._helpCommand,this._helpConfiguration=m._helpConfiguration,this._exitCallback=m._exitCallback,this._storeOptionsAsProperties=m._storeOptionsAsProperties,this._combineFlagAndOptionalValue=m._combineFlagAndOptionalValue,this._allowExcessArguments=m._allowExcessArguments,this._enablePositionalOptions=m._enablePositionalOptions,this._showHelpAfterError=m._showHelpAfterError,this._showSuggestionAfterError=m._showSuggestionAfterError,this}_getCommandAndAncestors(){const m=[];for(let b=this;b;b=b.parent)m.push(b);return m}command(m,b,x){let A=b,O=x;typeof A=="object"&&A!==null&&(O=A,A=null),O=O||{};const[,R,W]=m.match(/([^ ]+) *(.*)/),D=this.createCommand(R);return A&&(D.description(A),D._executableHandler=!0),O.isDefault&&(this._defaultCommandName=D._name),D._hidden=!!(O.noHelp||O.hidden),D._executableFile=O.executableFile||null,W&&D.arguments(W),this._registerCommand(D),D.parent=this,D.copyInheritedSettings(this),A?this:D}createCommand(m){return new _(m)}createHelp(){return Object.assign(new f,this.configureHelp())}configureHelp(m){return m===void 0?this._helpConfiguration:(this._helpConfiguration=m,this)}configureOutput(m){return m===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,m),this)}showHelpAfterError(m=!0){return typeof m!="string"&&(m=!!m),this._showHelpAfterError=m,this}showSuggestionAfterError(m=!0){return this._showSuggestionAfterError=!!m,this}addCommand(m,b){if(!m._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
11
|
+
- specify the name in Command constructor or using .name()`);return b=b||{},b.isDefault&&(this._defaultCommandName=m._name),(b.noHelp||b.hidden)&&(m._hidden=!0),this._registerCommand(m),m.parent=this,m._checkForBrokenPassThrough(),this}createArgument(m,b){return new o(m,b)}argument(m,b,x,A){const O=this.createArgument(m,b);return typeof x=="function"?O.default(A).argParser(x):O.default(x),this.addArgument(O),this}arguments(m){return m.trim().split(/ +/).forEach(b=>{this.argument(b)}),this}addArgument(m){const b=this.registeredArguments.slice(-1)[0];if(b&&b.variadic)throw new Error(`only the last argument can be variadic '${b.name()}'`);if(m.required&&m.defaultValue!==void 0&&m.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${m.name()}'`);return this.registeredArguments.push(m),this}helpCommand(m,b){if(typeof m=="boolean")return this._addImplicitHelpCommand=m,this;m=m??"help [command]";const[,x,A]=m.match(/([^ ]+) *(.*)/),O=b??"display help for command",R=this.createCommand(x);return R.helpOption(!1),A&&R.arguments(A),O&&R.description(O),this._addImplicitHelpCommand=!0,this._helpCommand=R,this}addHelpCommand(m,b){return typeof m!="object"?(this.helpCommand(m,b),this):(this._addImplicitHelpCommand=!0,this._helpCommand=m,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(m,b){const x=["preSubcommand","preAction","postAction"];if(!x.includes(m))throw new Error(`Unexpected value for event passed to hook : '${m}'.
|
|
12
|
+
Expecting one of '${x.join("', '")}'`);return this._lifeCycleHooks[m]?this._lifeCycleHooks[m].push(b):this._lifeCycleHooks[m]=[b],this}exitOverride(m){return m?this._exitCallback=m:this._exitCallback=b=>{if(b.code!=="commander.executeSubCommandAsync")throw b},this}_exit(m,b,x){this._exitCallback&&this._exitCallback(new u(m,b,x)),i.exit(m)}action(m){const b=x=>{const A=this.registeredArguments.length,O=x.slice(0,A);return this._storeOptionsAsProperties?O[A]=this:O[A]=this.opts(),O.push(this),m.apply(this,O)};return this._actionHandler=b,this}createOption(m,b){return new d(m,b)}_callParseArg(m,b,x,A){try{return m.parseArg(b,x)}catch(O){if(O.code==="commander.invalidArgument"){const R=`${A} ${O.message}`;this.error(R,{exitCode:O.exitCode,code:O.code})}throw O}}_registerOption(m){const b=m.short&&this._findOption(m.short)||m.long&&this._findOption(m.long);if(b){const x=m.long&&this._findOption(m.long)?m.long:m.short;throw new Error(`Cannot add option '${m.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${x}'
|
|
13
|
+
- already used by option '${b.flags}'`)}this.options.push(m)}_registerCommand(m){const b=A=>[A.name()].concat(A.aliases()),x=b(m).find(A=>this._findCommand(A));if(x){const A=b(this._findCommand(x)).join("|"),O=b(m).join("|");throw new Error(`cannot add command '${O}' as already have command '${A}'`)}this.commands.push(m)}addOption(m){this._registerOption(m);const b=m.name(),x=m.attributeName();if(m.negate){const O=m.long.replace(/^--no-/,"--");this._findOption(O)||this.setOptionValueWithSource(x,m.defaultValue===void 0?!0:m.defaultValue,"default")}else m.defaultValue!==void 0&&this.setOptionValueWithSource(x,m.defaultValue,"default");const A=(O,R,W)=>{O==null&&m.presetArg!==void 0&&(O=m.presetArg);const D=this.getOptionValue(x);O!==null&&m.parseArg?O=this._callParseArg(m,O,D,R):O!==null&&m.variadic&&(O=m._concatValue(O,D)),O==null&&(m.negate?O=!1:m.isBoolean()||m.optional?O=!0:O=""),this.setOptionValueWithSource(x,O,W)};return this.on("option:"+b,O=>{const R=`error: option '${m.flags}' argument '${O}' is invalid.`;A(O,R,"cli")}),m.envVar&&this.on("optionEnv:"+b,O=>{const R=`error: option '${m.flags}' value '${O}' from env '${m.envVar}' is invalid.`;A(O,R,"env")}),this}_optionEx(m,b,x,A,O){if(typeof b=="object"&&b instanceof d)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const R=this.createOption(b,x);if(R.makeOptionMandatory(!!m.mandatory),typeof A=="function")R.default(O).argParser(A);else if(A instanceof RegExp){const W=A;A=(D,U)=>{const Q=W.exec(D);return Q?Q[0]:U},R.default(O).argParser(A)}else R.default(A);return this.addOption(R)}option(m,b,x,A){return this._optionEx({},m,b,x,A)}requiredOption(m,b,x,A){return this._optionEx({mandatory:!0},m,b,x,A)}combineFlagAndOptionalValue(m=!0){return this._combineFlagAndOptionalValue=!!m,this}allowUnknownOption(m=!0){return this._allowUnknownOption=!!m,this}allowExcessArguments(m=!0){return this._allowExcessArguments=!!m,this}enablePositionalOptions(m=!0){return this._enablePositionalOptions=!!m,this}passThroughOptions(m=!0){return this._passThroughOptions=!!m,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(m=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!m,this}getOptionValue(m){return this._storeOptionsAsProperties?this[m]:this._optionValues[m]}setOptionValue(m,b){return this.setOptionValueWithSource(m,b,void 0)}setOptionValueWithSource(m,b,x){return this._storeOptionsAsProperties?this[m]=b:this._optionValues[m]=b,this._optionValueSources[m]=x,this}getOptionValueSource(m){return this._optionValueSources[m]}getOptionValueSourceWithGlobals(m){let b;return this._getCommandAndAncestors().forEach(x=>{x.getOptionValueSource(m)!==void 0&&(b=x.getOptionValueSource(m))}),b}_prepareUserArgs(m,b){if(m!==void 0&&!Array.isArray(m))throw new Error("first parameter to parse must be array or undefined");if(b=b||{},m===void 0&&b.from===void 0){i.versions?.electron&&(b.from="electron");const A=i.execArgv??[];(A.includes("-e")||A.includes("--eval")||A.includes("-p")||A.includes("--print"))&&(b.from="eval")}m===void 0&&(m=i.argv),this.rawArgs=m.slice();let x;switch(b.from){case void 0:case"node":this._scriptPath=m[1],x=m.slice(2);break;case"electron":i.defaultApp?(this._scriptPath=m[1],x=m.slice(2)):x=m.slice(1);break;case"user":x=m.slice(0);break;case"eval":x=m.slice(1);break;default:throw new Error(`unexpected parse option { from: '${b.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",x}parse(m,b){const x=this._prepareUserArgs(m,b);return this._parseCommand([],x),this}async parseAsync(m,b){const x=this._prepareUserArgs(m,b);return await this._parseCommand([],x),this}_executeSubCommand(m,b){b=b.slice();let x=!1;const A=[".js",".ts",".tsx",".mjs",".cjs"];function O(Q,we){const rn=t.resolve(Q,we);if(r.existsSync(rn))return rn;if(A.includes(t.extname(we)))return;const Fn=A.find(_n=>r.existsSync(`${rn}${_n}`));if(Fn)return`${rn}${Fn}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let R=m._executableFile||`${this._name}-${m._name}`,W=this._executableDir||"";if(this._scriptPath){let Q;try{Q=r.realpathSync(this._scriptPath)}catch{Q=this._scriptPath}W=t.resolve(t.dirname(Q),W)}if(W){let Q=O(W,R);if(!Q&&!m._executableFile&&this._scriptPath){const we=t.basename(this._scriptPath,t.extname(this._scriptPath));we!==this._name&&(Q=O(W,`${we}-${m._name}`))}R=Q||R}x=A.includes(t.extname(R));let D;i.platform!=="win32"?x?(b.unshift(R),b=S(i.execArgv).concat(b),D=e.spawn(i.argv[0],b,{stdio:"inherit"})):D=e.spawn(R,b,{stdio:"inherit"}):(b.unshift(R),b=S(i.execArgv).concat(b),D=e.spawn(i.execPath,b,{stdio:"inherit"})),D.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(we=>{i.on(we,()=>{D.killed===!1&&D.exitCode===null&&D.kill(we)})});const U=this._exitCallback;D.on("close",Q=>{Q=Q??1,U?U(new u(Q,"commander.executeSubCommandAsync","(close)")):i.exit(Q)}),D.on("error",Q=>{if(Q.code==="ENOENT"){const we=W?`searched for local subcommand relative to directory '${W}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",rn=`'${R}' does not exist
|
|
14
|
+
- if '${m._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
15
15
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
16
|
-
- ${
|
|
16
|
+
- ${we}`;throw new Error(rn)}else if(Q.code==="EACCES")throw new Error(`'${R}' not executable`);if(!U)i.exit(1);else{const we=new u(1,"commander.executeSubCommandAsync","(error)");we.nestedError=Q,U(we)}}),this.runningCommand=D}_dispatchSubcommand(m,b,x){const A=this._findCommand(m);A||this.help({error:!0});let O;return O=this._chainOrCallSubCommandHook(O,A,"preSubcommand"),O=this._chainOrCall(O,()=>{if(A._executableHandler)this._executeSubCommand(A,b.concat(x));else return A._parseCommand(b,x)}),O}_dispatchHelpCommand(m){m||this.help();const b=this._findCommand(m);return b&&!b._executableHandler&&b.help(),this._dispatchSubcommand(m,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((m,b)=>{m.required&&this.args[b]==null&&this.missingArgument(m.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const m=(x,A,O)=>{let R=A;if(A!==null&&x.parseArg){const W=`error: command-argument value '${A}' is invalid for argument '${x.name()}'.`;R=this._callParseArg(x,A,O,W)}return R};this._checkNumberOfArguments();const b=[];this.registeredArguments.forEach((x,A)=>{let O=x.defaultValue;x.variadic?A<this.args.length?(O=this.args.slice(A),x.parseArg&&(O=O.reduce((R,W)=>m(x,W,R),x.defaultValue))):O===void 0&&(O=[]):A<this.args.length&&(O=this.args[A],x.parseArg&&(O=m(x,O,x.defaultValue))),b[A]=O}),this.processedArgs=b}_chainOrCall(m,b){return m&&m.then&&typeof m.then=="function"?m.then(()=>b()):b()}_chainOrCallHooks(m,b){let x=m;const A=[];return this._getCommandAndAncestors().reverse().filter(O=>O._lifeCycleHooks[b]!==void 0).forEach(O=>{O._lifeCycleHooks[b].forEach(R=>{A.push({hookedCommand:O,callback:R})})}),b==="postAction"&&A.reverse(),A.forEach(O=>{x=this._chainOrCall(x,()=>O.callback(O.hookedCommand,this))}),x}_chainOrCallSubCommandHook(m,b,x){let A=m;return this._lifeCycleHooks[x]!==void 0&&this._lifeCycleHooks[x].forEach(O=>{A=this._chainOrCall(A,()=>O(this,b))}),A}_parseCommand(m,b){const x=this.parseOptions(b);if(this._parseOptionsEnv(),this._parseOptionsImplied(),m=m.concat(x.operands),b=x.unknown,this.args=m.concat(b),m&&this._findCommand(m[0]))return this._dispatchSubcommand(m[0],m.slice(1),b);if(this._getHelpCommand()&&m[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(m[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(b),this._dispatchSubcommand(this._defaultCommandName,m,b);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(x.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const A=()=>{x.unknown.length>0&&this.unknownOption(x.unknown[0])},O=`command:${this.name()}`;if(this._actionHandler){A(),this._processArguments();let R;return R=this._chainOrCallHooks(R,"preAction"),R=this._chainOrCall(R,()=>this._actionHandler(this.processedArgs)),this.parent&&(R=this._chainOrCall(R,()=>{this.parent.emit(O,m,b)})),R=this._chainOrCallHooks(R,"postAction"),R}if(this.parent&&this.parent.listenerCount(O))A(),this._processArguments(),this.parent.emit(O,m,b);else if(m.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",m,b);this.listenerCount("command:*")?this.emit("command:*",m,b):this.commands.length?this.unknownCommand():(A(),this._processArguments())}else this.commands.length?(A(),this.help({error:!0})):(A(),this._processArguments())}_findCommand(m){if(m)return this.commands.find(b=>b._name===m||b._aliases.includes(m))}_findOption(m){return this.options.find(b=>b.is(m))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(m=>{m.options.forEach(b=>{b.mandatory&&m.getOptionValue(b.attributeName())===void 0&&m.missingMandatoryOptionValue(b)})})}_checkForConflictingLocalOptions(){const m=this.options.filter(x=>{const A=x.attributeName();return this.getOptionValue(A)===void 0?!1:this.getOptionValueSource(A)!=="default"});m.filter(x=>x.conflictsWith.length>0).forEach(x=>{const A=m.find(O=>x.conflictsWith.includes(O.attributeName()));A&&this._conflictingOption(x,A)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(m=>{m._checkForConflictingLocalOptions()})}parseOptions(m){const b=[],x=[];let A=b;const O=m.slice();function R(D){return D.length>1&&D[0]==="-"}let W=null;for(;O.length;){const D=O.shift();if(D==="--"){A===x&&A.push(D),A.push(...O);break}if(W&&!R(D)){this.emit(`option:${W.name()}`,D);continue}if(W=null,R(D)){const U=this._findOption(D);if(U){if(U.required){const Q=O.shift();Q===void 0&&this.optionMissingArgument(U),this.emit(`option:${U.name()}`,Q)}else if(U.optional){let Q=null;O.length>0&&!R(O[0])&&(Q=O.shift()),this.emit(`option:${U.name()}`,Q)}else this.emit(`option:${U.name()}`);W=U.variadic?U:null;continue}}if(D.length>2&&D[0]==="-"&&D[1]!=="-"){const U=this._findOption(`-${D[1]}`);if(U){U.required||U.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${U.name()}`,D.slice(2)):(this.emit(`option:${U.name()}`),O.unshift(`-${D.slice(2)}`));continue}}if(/^--[^=]+=/.test(D)){const U=D.indexOf("="),Q=this._findOption(D.slice(0,U));if(Q&&(Q.required||Q.optional)){this.emit(`option:${Q.name()}`,D.slice(U+1));continue}}if(R(D)&&(A=x),(this._enablePositionalOptions||this._passThroughOptions)&&b.length===0&&x.length===0){if(this._findCommand(D)){b.push(D),O.length>0&&x.push(...O);break}else if(this._getHelpCommand()&&D===this._getHelpCommand().name()){b.push(D),O.length>0&&b.push(...O);break}else if(this._defaultCommandName){x.push(D),O.length>0&&x.push(...O);break}}if(this._passThroughOptions){A.push(D),O.length>0&&A.push(...O);break}A.push(D)}return{operands:b,unknown:x}}opts(){if(this._storeOptionsAsProperties){const m={},b=this.options.length;for(let x=0;x<b;x++){const A=this.options[x].attributeName();m[A]=A===this._versionOptionName?this._version:this[A]}return m}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((m,b)=>Object.assign(m,b.opts()),{})}error(m,b){this._outputConfiguration.outputError(`${m}
|
|
17
17
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
18
18
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
19
|
-
`),this.outputHelp({error:!0}));const
|
|
20
|
-
`),this._exit(0,"commander.version",
|
|
21
|
-
Expecting one of '${
|
|
22
|
-
`)}),this}_outputHelpIfRequested(e){const t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function mp(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?t=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=o[1],/^\d+$/.test(o[3])?i=o[3]:r=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=o[1],r=o[3],i=o[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}cp.Command=nE;const{Argument:gp}=fs,{Command:Eu}=cp,{CommanderError:rE,InvalidArgumentError:yp}=ci,{Help:iE}=vu,{Option:bp}=Io;Nt.program=new Eu,Nt.createCommand=n=>new Eu(n),Nt.createOption=(n,e)=>new bp(n,e),Nt.createArgument=(n,e)=>new gp(n,e),Nt.Command=Eu,Nt.Option=bp,Nt.Argument=gp,Nt.Help=iE,Nt.CommanderError=rE,Nt.InvalidArgumentError=yp,Nt.InvalidOptionArgumentError=yp;const{program:BI,createCommand:HI,createArgument:zI,createOption:VI,CommanderError:WI,InvalidArgumentError:UI,InvalidOptionArgumentError:KI,Command:sE,Argument:qI,Option:GI,Help:jI}=Nt;function oE(n,e){const t=new Set(n.split(","));return r=>t.has(r)}const nn=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Bn=()=>{},lE=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Ut=Object.assign,aE=Object.prototype.hasOwnProperty,Ie=(n,e)=>aE.call(n,e),xe=Array.isArray,fi=n=>Ro(n)==="[object Map]",uE=n=>Ro(n)==="[object Set]",Ne=n=>typeof n=="function",Kt=n=>typeof n=="string",No=n=>typeof n=="symbol",it=n=>n!==null&&typeof n=="object",cE=n=>(it(n)||Ne(n))&&Ne(n.then)&&Ne(n.catch),fE=Object.prototype.toString,Ro=n=>fE.call(n),_p=n=>Ro(n).slice(8,-1),hE=n=>Ro(n)==="[object Object]",ku=n=>Kt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,dE=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},pE=dE(n=>n.charAt(0).toUpperCase()+n.slice(1)),Hn=(n,e)=>!Object.is(n,e),mE=(n,e,t)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value:t})};let vp;const wp=()=>vp||(vp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Cu(n){if(xe(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Kt(r)?_E(r):Cu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Kt(n)||it(n))return n}const gE=/;(?![^(]*\))/g,yE=/:([^]+)/,bE=/\/\*[^]*?\*\//g;function _E(n){const e={};return n.replace(bE,"").split(gE).forEach(t=>{if(t){const r=t.split(yE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Au(n){let e="";if(Kt(n))e=n;else if(xe(n))for(let t=0;t<n.length;t++){const r=Au(n[t]);r&&(e+=r+" ")}else if(it(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function _r(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let vE;function wE(n,e=vE){e&&e.active&&e.effects.push(n)}let vr;class Sp{constructor(e,t,r,i){this.fn=e,this.trigger=t,this.scheduler=r,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,wE(this,i)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,Tu();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(SE(t.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),Mu()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=zn,t=vr;try{return zn=!0,vr=this,this._runnings++,xp(this),this.fn()}finally{Ep(this),this._runnings--,vr=t,zn=e}}stop(){var e;this.active&&(xp(this),Ep(this),(e=this.onStop)==null||e.call(this),this.active=!1)}}function SE(n){return n.value}function xp(n){n._trackId++,n._depsLength=0}function Ep(n){if(n.deps.length>n._depsLength){for(let e=n._depsLength;e<n.deps.length;e++)kp(n.deps[e],n);n.deps.length=n._depsLength}}function kp(n,e){const t=n.get(e);t!==void 0&&e._trackId!==t&&(n.delete(e),n.size===0&&n.cleanup())}let zn=!0,Ou=0;const Cp=[];function Tu(){Cp.push(zn),zn=!1}function Mu(){const n=Cp.pop();zn=n===void 0?!0:n}function Iu(){Ou++}function Nu(){for(Ou--;!Ou&&Ru.length;)Ru.shift()()}function Ap(n,e,t){var r;if(e.get(n)!==n._trackId){e.set(n,n._trackId);const i=n.deps[n._depsLength];i!==e?(i&&kp(i,n),n.deps[n._depsLength++]=e):n._depsLength++,process.env.NODE_ENV!=="production"&&((r=n.onTrack)==null||r.call(n,Ut({effect:n},t)))}}const Ru=[];function Op(n,e,t){var r;Iu();for(const i of n.keys()){let o;i._dirtyLevel<e&&(o??(o=n.get(i)===i._trackId))&&(i._shouldSchedule||(i._shouldSchedule=i._dirtyLevel===0),i._dirtyLevel=e),i._shouldSchedule&&(o??(o=n.get(i)===i._trackId))&&(process.env.NODE_ENV!=="production"&&((r=i.onTrigger)==null||r.call(i,Ut({effect:i},t))),i.trigger(),(!i._runnings||i.allowRecurse)&&i._dirtyLevel!==2&&(i._shouldSchedule=!1,i.scheduler&&Ru.push(i.scheduler)))}Nu()}const Tp=(n,e)=>{const t=new Map;return t.cleanup=n,t.computed=e,t},Lo=new WeakMap,wr=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Lu=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function dt(n,e,t){if(zn&&vr){let r=Lo.get(n);r||Lo.set(n,r=new Map);let i=r.get(t);i||r.set(t,i=Tp(()=>r.delete(t))),Ap(vr,i,process.env.NODE_ENV!=="production"?{target:n,type:e,key:t}:void 0)}}function Vn(n,e,t,r,i,o){const a=Lo.get(n);if(!a)return;let u=[];if(e==="clear")u=[...a.values()];else if(t==="length"&&xe(n)){const f=Number(r);a.forEach((d,p)=>{(p==="length"||!No(p)&&p>=f)&&u.push(d)})}else switch(t!==void 0&&u.push(a.get(t)),e){case"add":xe(n)?ku(t)&&u.push(a.get("length")):(u.push(a.get(wr)),fi(n)&&u.push(a.get(Lu)));break;case"delete":xe(n)||(u.push(a.get(wr)),fi(n)&&u.push(a.get(Lu)));break;case"set":fi(n)&&u.push(a.get(wr));break}Iu();for(const f of u)f&&Op(f,4,process.env.NODE_ENV!=="production"?{target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}:void 0);Nu()}function xE(n,e){var t;return(t=Lo.get(n))==null?void 0:t.get(e)}const EE=oE("__proto__,__v_isRef,__isVue"),Mp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(No)),Ip=kE();function kE(){const n={};return["includes","indexOf","lastIndexOf"].forEach(e=>{n[e]=function(...t){const r=ie(this);for(let o=0,a=this.length;o<a;o++)dt(r,"get",o+"");const i=r[e](...t);return i===-1||i===!1?r[e](...t.map(ie)):i}}),["push","pop","shift","unshift","splice"].forEach(e=>{n[e]=function(...t){Tu(),Iu();const r=ie(this)[e].apply(this,t);return Nu(),Mu(),r}}),n}function CE(n){const e=ie(this);return dt(e,"has",n),e.hasOwnProperty(n)}class Np{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){const i=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return o;if(t==="__v_raw")return r===(i?o?zp:Hp:o?BE:Bp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=xe(e);if(!i){if(a&&Ie(Ip,t))return Reflect.get(Ip,t,r);if(t==="hasOwnProperty")return CE}const u=Reflect.get(e,t,r);return(No(t)?Mp.has(t):EE(t))||(i||dt(e,"get",t),o)?u:st(u)?a&&ku(t)?u:u.value:it(u)?i?Vp(u):Fu(u):u}}class AE extends Np{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Un(o);if(!xr(r)&&!Un(r)&&(o=ie(o),r=ie(r)),!xe(e)&&st(o)&&!st(r))return f?!1:(o.value=r,!0)}const a=xe(e)&&ku(t)?Number(t)<e.length:Ie(e,t),u=Reflect.set(e,t,r,i);return e===ie(i)&&(a?Hn(r,o)&&Vn(e,"set",t,r,o):Vn(e,"add",t,r)),u}deleteProperty(e,t){const r=Ie(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&Vn(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!No(t)||!Mp.has(t))&&dt(e,"has",t),r}ownKeys(e){return dt(e,"iterate",xe(e)?"length":wr),Reflect.ownKeys(e)}}class Rp extends Np{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&_r(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&_r(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const OE=new AE,TE=new Rp,ME=new Rp(!0),Pu=n=>n,Po=n=>Reflect.getPrototypeOf(n);function Do(n,e,t=!1,r=!1){n=n.__v_raw;const i=ie(n),o=ie(e);t||(Hn(e,o)&&dt(i,"get",e),dt(i,"get",o));const{has:a}=Po(i),u=r?Pu:t?Hu:hs;if(a.call(i,e))return u(n.get(e));if(a.call(i,o))return u(n.get(o));n!==i&&n.get(e)}function Fo(n,e=!1){const t=this.__v_raw,r=ie(t),i=ie(n);return e||(Hn(n,i)&&dt(r,"has",n),dt(r,"has",i)),n===i?t.has(n):t.has(n)||t.has(i)}function $o(n,e=!1){return n=n.__v_raw,!e&&dt(ie(n),"iterate",wr),Reflect.get(n,"size",n)}function Lp(n){n=ie(n);const e=ie(this);return Po(e).has.call(e,n)||(e.add(n),Vn(e,"add",n,n)),this}function Pp(n,e){e=ie(e);const t=ie(this),{has:r,get:i}=Po(t);let o=r.call(t,n);o?process.env.NODE_ENV!=="production"&&$p(t,r,n):(n=ie(n),o=r.call(t,n));const a=i.call(t,n);return t.set(n,e),o?Hn(e,a)&&Vn(t,"set",n,e,a):Vn(t,"add",n,e),this}function Dp(n){const e=ie(this),{has:t,get:r}=Po(e);let i=t.call(e,n);i?process.env.NODE_ENV!=="production"&&$p(e,t,n):(n=ie(n),i=t.call(e,n));const o=r?r.call(e,n):void 0,a=e.delete(n);return i&&Vn(e,"delete",n,void 0,o),a}function Fp(){const n=ie(this),e=n.size!==0,t=process.env.NODE_ENV!=="production"?fi(n)?new Map(n):new Set(n):void 0,r=n.clear();return e&&Vn(n,"clear",void 0,void 0,t),r}function Bo(n,e){return function(r,i){const o=this,a=o.__v_raw,u=ie(a),f=e?Pu:n?Hu:hs;return!n&&dt(u,"iterate",wr),a.forEach((d,p)=>r.call(i,f(d),f(p),o))}}function Ho(n,e,t){return function(...r){const i=this.__v_raw,o=ie(i),a=fi(o),u=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,d=i[n](...r),p=t?Pu:e?Hu:hs;return!e&&dt(o,"iterate",f?Lu:wr),{next(){const{value:m,done:y}=d.next();return y?{value:m,done:y}:{value:u?[p(m[0]),p(m[1])]:p(m),done:y}},[Symbol.iterator](){return this}}}}function Wn(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";_r(`${pE(n)} operation ${t}failed: target is readonly.`,ie(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function IE(){const n={get(o){return Do(this,o)},get size(){return $o(this)},has:Fo,add:Lp,set:Pp,delete:Dp,clear:Fp,forEach:Bo(!1,!1)},e={get(o){return Do(this,o,!1,!0)},get size(){return $o(this)},has:Fo,add:Lp,set:Pp,delete:Dp,clear:Fp,forEach:Bo(!1,!0)},t={get(o){return Do(this,o,!0)},get size(){return $o(this,!0)},has(o){return Fo.call(this,o,!0)},add:Wn("add"),set:Wn("set"),delete:Wn("delete"),clear:Wn("clear"),forEach:Bo(!0,!1)},r={get(o){return Do(this,o,!0,!0)},get size(){return $o(this,!0)},has(o){return Fo.call(this,o,!0)},add:Wn("add"),set:Wn("set"),delete:Wn("delete"),clear:Wn("clear"),forEach:Bo(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Ho(o,!1,!1),t[o]=Ho(o,!0,!1),e[o]=Ho(o,!1,!0),r[o]=Ho(o,!0,!0)}),[n,t,e,r]}const[NE,RE,LE,PE]=IE();function Du(n,e){const t=e?n?PE:LE:n?RE:NE;return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Ie(t,i)&&i in r?t:r,i,o)}const DE={get:Du(!1,!1)},FE={get:Du(!0,!1)},$E={get:Du(!0,!0)};function $p(n,e,t){const r=ie(t);if(r!==t&&e.call(n,r)){const i=_p(n);_r(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Bp=new WeakMap,BE=new WeakMap,Hp=new WeakMap,zp=new WeakMap;function HE(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function zE(n){return n.__v_skip||!Object.isExtensible(n)?0:HE(_p(n))}function Fu(n){return Un(n)?n:$u(n,!1,OE,DE,Bp)}function Vp(n){return $u(n,!0,TE,FE,Hp)}function zo(n){return $u(n,!0,ME,$E,zp)}function $u(n,e,t,r,i){if(!it(n))return process.env.NODE_ENV!=="production"&&_r(`value cannot be made reactive: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=i.get(n);if(o)return o;const a=zE(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function Sr(n){return Un(n)?Sr(n.__v_raw):!!(n&&n.__v_isReactive)}function Un(n){return!!(n&&n.__v_isReadonly)}function xr(n){return!!(n&&n.__v_isShallow)}function Bu(n){return Sr(n)||Un(n)}function ie(n){const e=n&&n.__v_raw;return e?ie(e):n}function VE(n){return Object.isExtensible(n)&&mE(n,"__v_skip",!0),n}const hs=n=>it(n)?Fu(n):n,Hu=n=>it(n)?Vp(n):n,WE="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class Wp{constructor(e,t,r,i){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Sp(()=>e(this._value),()=>Vo(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const e=ie(this);return(!e._cacheable||e.effect.dirty)&&Hn(e._value,e._value=e.effect.run())&&Vo(e,4),Up(e),e.effect._dirtyLevel>=2&&(process.env.NODE_ENV!=="production"&&this._warnRecursive&&_r(WE,`
|
|
23
|
-
|
|
24
|
-
getter: `,this.getter),Vo(e,2)),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function UE(n,e,t=!1){let r,i;const o=Ne(n);o?(r=n,i=process.env.NODE_ENV!=="production"?()=>{_r("Write operation failed: computed value is readonly")}:Bn):(r=n.get,i=n.set);const a=new Wp(r,i,o||!i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(a.effect.onTrack=e.onTrack,a.effect.onTrigger=e.onTrigger),a}function Up(n){var e;zn&&vr&&(n=ie(n),Ap(vr,(e=n.dep)!=null?e:n.dep=Tp(()=>n.dep=void 0,n instanceof Wp?n:void 0),process.env.NODE_ENV!=="production"?{target:n,type:"get",key:"value"}:void 0))}function Vo(n,e=4,t){n=ie(n);const r=n.dep;r&&Op(r,e,process.env.NODE_ENV!=="production"?{target:n,type:"set",key:"value",newValue:t}:void 0)}function st(n){return!!(n&&n.__v_isRef===!0)}function Wo(n){return KE(n,!1)}function KE(n,e){return st(n)?n:new qE(n,e)}class qE{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:ie(e),this._value=t?e:hs(e)}get value(){return Up(this),this._value}set value(e){const t=this.__v_isShallow||xr(e)||Un(e);e=t?e:ie(e),Hn(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:hs(e),Vo(this,4,e))}}function F(n){return st(n)?n.value:n}const GE={get:(n,e,t)=>F(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return st(i)&&!st(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function jE(n){return Sr(n)?n:new Proxy(n,GE)}class JE{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return xE(ie(this._object),this._key)}}class YE{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function hi(n,e,t){return st(n)?n:Ne(n)?new YE(n):it(n)&&arguments.length>1?XE(n,e,t):Wo(n)}function XE(n,e,t){const r=n[e];return st(r)?r:new JE(n,e,t)}const Er=[];function ZE(n){Er.push(n)}function QE(){Er.pop()}function Me(n,...e){Tu();const t=Er.length?Er[Er.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=ek();if(r)kr(r,t,11,[n+e.map(o=>{var a,u;return(u=(a=o.toString)==null?void 0:a.call(o))!=null?u:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${dm(t,o.type)}>`).join(`
|
|
19
|
+
`),this.outputHelp({error:!0}));const x=b||{},A=x.exitCode||1,O=x.code||"commander.error";this._exit(A,O,m)}_parseOptionsEnv(){this.options.forEach(m=>{if(m.envVar&&m.envVar in i.env){const b=m.attributeName();(this.getOptionValue(b)===void 0||["default","config","env"].includes(this.getOptionValueSource(b)))&&(m.required||m.optional?this.emit(`optionEnv:${m.name()}`,i.env[m.envVar]):this.emit(`optionEnv:${m.name()}`))}})}_parseOptionsImplied(){const m=new g(this.options),b=x=>this.getOptionValue(x)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(x));this.options.filter(x=>x.implied!==void 0&&b(x.attributeName())&&m.valueFromOption(this.getOptionValue(x.attributeName()),x)).forEach(x=>{Object.keys(x.implied).filter(A=>!b(A)).forEach(A=>{this.setOptionValueWithSource(A,x.implied[A],"implied")})})}missingArgument(m){const b=`error: missing required argument '${m}'`;this.error(b,{code:"commander.missingArgument"})}optionMissingArgument(m){const b=`error: option '${m.flags}' argument missing`;this.error(b,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(m){const b=`error: required option '${m.flags}' not specified`;this.error(b,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(m,b){const x=R=>{const W=R.attributeName(),D=this.getOptionValue(W),U=this.options.find(we=>we.negate&&W===we.attributeName()),Q=this.options.find(we=>!we.negate&&W===we.attributeName());return U&&(U.presetArg===void 0&&D===!1||U.presetArg!==void 0&&D===U.presetArg)?U:Q||R},A=R=>{const W=x(R),D=W.attributeName();return this.getOptionValueSource(D)==="env"?`environment variable '${W.envVar}'`:`option '${W.flags}'`},O=`error: ${A(m)} cannot be used with ${A(b)}`;this.error(O,{code:"commander.conflictingOption"})}unknownOption(m){if(this._allowUnknownOption)return;let b="";if(m.startsWith("--")&&this._showSuggestionAfterError){let A=[],O=this;do{const R=O.createHelp().visibleOptions(O).filter(W=>W.long).map(W=>W.long);A=A.concat(R),O=O.parent}while(O&&!O._enablePositionalOptions);b=p(m,A)}const x=`error: unknown option '${m}'${b}`;this.error(x,{code:"commander.unknownOption"})}_excessArguments(m){if(this._allowExcessArguments)return;const b=this.registeredArguments.length,x=b===1?"":"s",O=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${b} argument${x} but got ${m.length}.`;this.error(O,{code:"commander.excessArguments"})}unknownCommand(){const m=this.args[0];let b="";if(this._showSuggestionAfterError){const A=[];this.createHelp().visibleCommands(this).forEach(O=>{A.push(O.name()),O.alias()&&A.push(O.alias())}),b=p(m,A)}const x=`error: unknown command '${m}'${b}`;this.error(x,{code:"commander.unknownCommand"})}version(m,b,x){if(m===void 0)return this._version;this._version=m,b=b||"-V, --version",x=x||"output the version number";const A=this.createOption(b,x);return this._versionOptionName=A.attributeName(),this._registerOption(A),this.on("option:"+A.name(),()=>{this._outputConfiguration.writeOut(`${m}
|
|
20
|
+
`),this._exit(0,"commander.version",m)}),this}description(m,b){return m===void 0&&b===void 0?this._description:(this._description=m,b&&(this._argsDescription=b),this)}summary(m){return m===void 0?this._summary:(this._summary=m,this)}alias(m){if(m===void 0)return this._aliases[0];let b=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(b=this.commands[this.commands.length-1]),m===b._name)throw new Error("Command alias can't be the same as its name");const x=this.parent?._findCommand(m);if(x){const A=[x.name()].concat(x.aliases()).join("|");throw new Error(`cannot add alias '${m}' to command '${this.name()}' as already have command '${A}'`)}return b._aliases.push(m),this}aliases(m){return m===void 0?this._aliases:(m.forEach(b=>this.alias(b)),this)}usage(m){if(m===void 0){if(this._usage)return this._usage;const b=this.registeredArguments.map(x=>l(x));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?b:[]).join(" ")}return this._usage=m,this}name(m){return m===void 0?this._name:(this._name=m,this)}nameFromFilename(m){return this._name=t.basename(m,t.extname(m)),this}executableDir(m){return m===void 0?this._executableDir:(this._executableDir=m,this)}helpInformation(m){const b=this.createHelp();return b.helpWidth===void 0&&(b.helpWidth=m&&m.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),b.formatHelp(this,b)}_getHelpContext(m){m=m||{};const b={error:!!m.error};let x;return b.error?x=A=>this._outputConfiguration.writeErr(A):x=A=>this._outputConfiguration.writeOut(A),b.write=m.write||x,b.command=this,b}outputHelp(m){let b;typeof m=="function"&&(b=m,m=void 0);const x=this._getHelpContext(m);this._getCommandAndAncestors().reverse().forEach(O=>O.emit("beforeAllHelp",x)),this.emit("beforeHelp",x);let A=this.helpInformation(x);if(b&&(A=b(A),typeof A!="string"&&!Buffer.isBuffer(A)))throw new Error("outputHelp callback must return a string or a Buffer");x.write(A),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",x),this._getCommandAndAncestors().forEach(O=>O.emit("afterAllHelp",x))}helpOption(m,b){return typeof m=="boolean"?(m?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(m=m??"-h, --help",b=b??"display help for command",this._helpOption=this.createOption(m,b),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(m){return this._helpOption=m,this}help(m){this.outputHelp(m);let b=i.exitCode||0;b===0&&m&&typeof m!="function"&&m.error&&(b=1),this._exit(b,"commander.help","(outputHelp)")}addHelpText(m,b){const x=["beforeAll","before","after","afterAll"];if(!x.includes(m))throw new Error(`Unexpected value for position to addHelpText.
|
|
21
|
+
Expecting one of '${x.join("', '")}'`);const A=`${m}Help`;return this.on(A,O=>{let R;typeof b=="function"?R=b({error:O.error,command:O.command}):R=b,R&&O.write(`${R}
|
|
22
|
+
`)}),this}_outputHelpIfRequested(m){const b=this._getHelpOption();b&&m.find(A=>b.is(A))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function S(k){return k.map(m=>{if(!m.startsWith("--inspect"))return m;let b,x="127.0.0.1",A="9229",O;return(O=m.match(/^(--inspect(-brk)?)$/))!==null?b=O[1]:(O=m.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(b=O[1],/^\d+$/.test(O[3])?A=O[3]:x=O[3]):(O=m.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(b=O[1],x=O[3],A=O[4]),b&&A!=="0"?`${b}=${x}:${parseInt(A)+1}`:m})}return ku.Command=_,ku}var Sp;function Hx(){if(Sp)return Et;Sp=1;const{Argument:n}=Eu(),{Command:e}=Bx(),{CommanderError:t,InvalidArgumentError:r}=Do(),{Help:i}=yp(),{Option:o}=_p();return Et.program=new e,Et.createCommand=l=>new e(l),Et.createOption=(l,u)=>new o(l,u),Et.createArgument=(l,u)=>new n(l,u),Et.Command=e,Et.Option=o,Et.Argument=n,Et.Help=i,Et.CommanderError=t,Et.InvalidArgumentError=r,Et.InvalidOptionArgumentError=r,Et}var $x=Hx(),zx=Dx($x);const{program:vI,createCommand:wI,createArgument:SI,createOption:xI,CommanderError:EI,InvalidArgumentError:kI,InvalidOptionArgumentError:CI,Command:Vx,Argument:AI,Option:OI,Help:TI}=zx;function Wx(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Ft=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const xr=()=>{},Ux=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),kt=Object.assign,qx=Object.prototype.hasOwnProperty,Re=(n,e)=>qx.call(n,e),Ce=Array.isArray,fi=n=>Bo(n)==="[object Map]",Kx=n=>Bo(n)==="[object Set]",Le=n=>typeof n=="function",Yt=n=>typeof n=="string",cs=n=>typeof n=="symbol",lt=n=>n!==null&&typeof n=="object",Gx=n=>(lt(n)||Le(n))&&Le(n.then)&&Le(n.catch),jx=Object.prototype.toString,Bo=n=>jx.call(n),xp=n=>Bo(n).slice(8,-1),Jx=n=>Bo(n)==="[object Object]",Ou=n=>Yt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Yx=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Xx=Yx(n=>n.charAt(0).toUpperCase()+n.slice(1)),jn=(n,e)=>!Object.is(n,e),Zx=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})};let Ep;const Ho=()=>Ep||(Ep=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Tu(n){if(Ce(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Yt(r)?nE(r):Tu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Yt(n)||lt(n))return n}const Qx=/;(?![^(]*\))/g,eE=/:([^]+)/,tE=/\/\*[^]*?\*\//g;function nE(n){const e={};return n.replace(tE,"").split(Qx).forEach(t=>{if(t){const r=t.split(eE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Mu(n){let e="";if(Yt(n))e=n;else if(Ce(n))for(let t=0;t<n.length;t++){const r=Mu(n[t]);r&&(e+=r+" ")}else if(lt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function In(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let be;const Iu=new WeakSet;class rE{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Iu.has(this)&&(Iu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Cp(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ip(this),Ap(this);const e=be,t=Xt;be=this,Xt=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&be!==this&&In("Active effect was not restored correctly - this is likely a Vue internal bug."),Op(this),be=e,Xt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Pu(e);this.deps=this.depsTail=void 0,Ip(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Iu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Lu(this)&&this.run()}get dirty(){return Lu(this)}}let kp=0,fs,hs;function Cp(n,e=!1){if(n.flags|=8,e){n.next=hs,hs=n;return}n.next=fs,fs=n}function Nu(){kp++}function Ru(){if(--kp>0)return;if(hs){let e=hs;for(hs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;fs;){let e=fs;for(fs=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function Ap(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Op(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),Pu(r),iE(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Lu(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Tp(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Tp(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ds))return;n.globalVersion=ds;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Lu(n)){n.flags&=-3;return}const t=be,r=Xt;be=n,Xt=!0;try{Ap(n);const i=n.fn(n._value);(e.version===0||jn(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{be=t,Xt=r,Op(n),n.flags&=-3}}function Pu(n,e=!1){const{dep:t,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),process.env.NODE_ENV!=="production"&&t.subsHead===n&&(t.subsHead=i),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)Pu(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function iE(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Xt=!0;const Mp=[];function $o(){Mp.push(Xt),Xt=!1}function zo(){const n=Mp.pop();Xt=n===void 0?!0:n}function Ip(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=be;be=void 0;try{e()}finally{be=t}}}let ds=0,sE=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class Du{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!be||!Xt||be===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==be)t=this.activeLink=new sE(be,this),be.deps?(t.prevDep=be.depsTail,be.depsTail.nextDep=t,be.depsTail=t):be.deps=be.depsTail=t,Np(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=be.depsTail,t.nextDep=void 0,be.depsTail.nextDep=t,be.depsTail=t,be.deps===t&&(be.deps=r)}return process.env.NODE_ENV!=="production"&&be.onTrack&&be.onTrack(kt({effect:be},e)),t}trigger(e){this.version++,ds++,this.notify(e)}notify(e){Nu();try{if(process.env.NODE_ENV!=="production")for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(kt({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Ru()}}}function Np(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)Np(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),process.env.NODE_ENV!=="production"&&n.dep.subsHead===void 0&&(n.dep.subsHead=n),n.dep.subs=n}}const Vo=new WeakMap,Er=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Fu=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ps=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function $e(n,e,t){if(Xt&&be){let r=Vo.get(n);r||Vo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Du),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function Jn(n,e,t,r,i,o){const l=Vo.get(n);if(!l){ds++;return}const u=f=>{f&&(process.env.NODE_ENV!=="production"?f.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}):f.trigger())};if(Nu(),e==="clear")l.forEach(u);else{const f=Ce(n),d=f&&Ou(t);if(f&&t==="length"){const g=Number(r);l.forEach((p,_)=>{(_==="length"||_===ps||!cs(_)&&_>=g)&&u(p)})}else switch((t!==void 0||l.has(void 0))&&u(l.get(t)),d&&u(l.get(ps)),e){case"add":f?d&&u(l.get("length")):(u(l.get(Er)),fi(n)&&u(l.get(Fu)));break;case"delete":f||(u(l.get(Er)),fi(n)&&u(l.get(Fu)));break;case"set":fi(n)&&u(l.get(Er));break}}Ru()}function oE(n,e){const t=Vo.get(n);return t&&t.get(e)}function hi(n){const e=ce(n);return e===n?e:($e(e,"iterate",ps),gt(n)?e:e.map(ut))}function Bu(n){return $e(n=ce(n),"iterate",ps),n}const aE={__proto__:null,[Symbol.iterator](){return Hu(this,Symbol.iterator,ut)},concat(...n){return hi(this).concat(...n.map(e=>Ce(e)?hi(e):e))},entries(){return Hu(this,"entries",n=>(n[1]=ut(n[1]),n))},every(n,e){return Nn(this,"every",n,e,void 0,arguments)},filter(n,e){return Nn(this,"filter",n,e,t=>t.map(ut),arguments)},find(n,e){return Nn(this,"find",n,e,ut,arguments)},findIndex(n,e){return Nn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Nn(this,"findLast",n,e,ut,arguments)},findLastIndex(n,e){return Nn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Nn(this,"forEach",n,e,void 0,arguments)},includes(...n){return $u(this,"includes",n)},indexOf(...n){return $u(this,"indexOf",n)},join(n){return hi(this).join(n)},lastIndexOf(...n){return $u(this,"lastIndexOf",n)},map(n,e){return Nn(this,"map",n,e,void 0,arguments)},pop(){return ms(this,"pop")},push(...n){return ms(this,"push",n)},reduce(n,...e){return Rp(this,"reduce",n,e)},reduceRight(n,...e){return Rp(this,"reduceRight",n,e)},shift(){return ms(this,"shift")},some(n,e){return Nn(this,"some",n,e,void 0,arguments)},splice(...n){return ms(this,"splice",n)},toReversed(){return hi(this).toReversed()},toSorted(n){return hi(this).toSorted(n)},toSpliced(...n){return hi(this).toSpliced(...n)},unshift(...n){return ms(this,"unshift",n)},values(){return Hu(this,"values",ut)}};function Hu(n,e,t){const r=Bu(n),i=r[e]();return r!==n&&!gt(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const lE=Array.prototype;function Nn(n,e,t,r,i,o){const l=Bu(n),u=l!==n&&!gt(n),f=l[e];if(f!==lE[e]){const p=f.apply(n,o);return u?ut(p):p}let d=t;l!==n&&(u?d=function(p,_){return t.call(this,ut(p),_,n)}:t.length>2&&(d=function(p,_){return t.call(this,p,_,n)}));const g=f.call(l,d,r);return u&&i?i(g):g}function Rp(n,e,t,r){const i=Bu(n);let o=t;return i!==n&&(gt(n)?t.length>3&&(o=function(l,u,f){return t.call(this,l,u,f,n)}):o=function(l,u,f){return t.call(this,l,ut(u),f,n)}),i[e](o,...r)}function $u(n,e,t){const r=ce(n);$e(r,"iterate",ps);const i=r[e](...t);return(i===-1||i===!1)&&Ko(t[0])?(t[0]=ce(t[0]),r[e](...t)):i}function ms(n,e,t=[]){$o(),Nu();const r=ce(n)[e].apply(n,t);return Ru(),zo(),r}const uE=Wx("__proto__,__v_isRef,__isVue"),Lp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(cs));function cE(n){cs(n)||(n=String(n));const e=ce(this);return $e(e,"has",n),e.hasOwnProperty(n)}class Pp{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){const i=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return o;if(t==="__v_raw")return r===(i?o?$p:Hp:o?vE:Bp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const l=Ce(e);if(!i){let f;if(l&&(f=aE[t]))return f;if(t==="hasOwnProperty")return cE}const u=Reflect.get(e,t,Ge(e)?e:r);return(cs(t)?Lp.has(t):uE(t))||(i||$e(e,"get",t),o)?u:Ge(u)?l&&Ou(t)?u:u.value:lt(u)?i?zp(u):Wu(u):u}}class fE extends Pp{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Rn(o);if(!gt(r)&&!Rn(r)&&(o=ce(o),r=ce(r)),!Ce(e)&&Ge(o)&&!Ge(r))return f?!1:(o.value=r,!0)}const l=Ce(e)&&Ou(t)?Number(t)<e.length:Re(e,t),u=Reflect.set(e,t,r,Ge(e)?e:i);return e===ce(i)&&(l?jn(r,o)&&Jn(e,"set",t,r,o):Jn(e,"add",t,r)),u}deleteProperty(e,t){const r=Re(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&Jn(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!cs(t)||!Lp.has(t))&&$e(e,"has",t),r}ownKeys(e){return $e(e,"iterate",Ce(e)?"length":Er),Reflect.ownKeys(e)}}class Dp extends Pp{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&In(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&In(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const hE=new fE,dE=new Dp,pE=new Dp(!0),zu=n=>n,Wo=n=>Reflect.getPrototypeOf(n);function mE(n,e,t){return function(...r){const i=this.__v_raw,o=ce(i),l=fi(o),u=n==="entries"||n===Symbol.iterator&&l,f=n==="keys"&&l,d=i[n](...r),g=t?zu:e?qu:ut;return!e&&$e(o,"iterate",f?Fu:Er),{next(){const{value:p,done:_}=d.next();return _?{value:p,done:_}:{value:u?[g(p[0]),g(p[1])]:g(p),done:_}},[Symbol.iterator](){return this}}}}function Uo(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";In(`${Xx(n)} operation ${t}failed: target is readonly.`,ce(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function gE(n,e){const t={get(i){const o=this.__v_raw,l=ce(o),u=ce(i);n||(jn(i,u)&&$e(l,"get",i),$e(l,"get",u));const{has:f}=Wo(l),d=e?zu:n?qu:ut;if(f.call(l,i))return d(o.get(i));if(f.call(l,u))return d(o.get(u));o!==l&&o.get(i)},get size(){const i=this.__v_raw;return!n&&$e(ce(i),"iterate",Er),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,l=ce(o),u=ce(i);return n||(jn(i,u)&&$e(l,"has",i),$e(l,"has",u)),i===u?o.has(i):o.has(i)||o.has(u)},forEach(i,o){const l=this,u=l.__v_raw,f=ce(u),d=e?zu:n?qu:ut;return!n&&$e(f,"iterate",Er),u.forEach((g,p)=>i.call(o,d(g),d(p),l))}};return kt(t,n?{add:Uo("add"),set:Uo("set"),delete:Uo("delete"),clear:Uo("clear")}:{add(i){!e&&!gt(i)&&!Rn(i)&&(i=ce(i));const o=ce(this);return Wo(o).has.call(o,i)||(o.add(i),Jn(o,"add",i,i)),this},set(i,o){!e&&!gt(o)&&!Rn(o)&&(o=ce(o));const l=ce(this),{has:u,get:f}=Wo(l);let d=u.call(l,i);d?process.env.NODE_ENV!=="production"&&Fp(l,u,i):(i=ce(i),d=u.call(l,i));const g=f.call(l,i);return l.set(i,o),d?jn(o,g)&&Jn(l,"set",i,o,g):Jn(l,"add",i,o),this},delete(i){const o=ce(this),{has:l,get:u}=Wo(o);let f=l.call(o,i);f?process.env.NODE_ENV!=="production"&&Fp(o,l,i):(i=ce(i),f=l.call(o,i));const d=u?u.call(o,i):void 0,g=o.delete(i);return f&&Jn(o,"delete",i,void 0,d),g},clear(){const i=ce(this),o=i.size!==0,l=process.env.NODE_ENV!=="production"?fi(i)?new Map(i):new Set(i):void 0,u=i.clear();return o&&Jn(i,"clear",void 0,void 0,l),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=mE(i,n,e)}),t}function Vu(n,e){const t=gE(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Re(t,i)&&i in r?t:r,i,o)}const yE={get:Vu(!1,!1)},bE={get:Vu(!0,!1)},_E={get:Vu(!0,!0)};function Fp(n,e,t){const r=ce(t);if(r!==t&&e.call(n,r)){const i=xp(n);In(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Bp=new WeakMap,vE=new WeakMap,Hp=new WeakMap,$p=new WeakMap;function wE(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function SE(n){return n.__v_skip||!Object.isExtensible(n)?0:wE(xp(n))}function Wu(n){return Rn(n)?n:Uu(n,!1,hE,yE,Bp)}function zp(n){return Uu(n,!0,dE,bE,Hp)}function qo(n){return Uu(n,!0,pE,_E,$p)}function Uu(n,e,t,r,i){if(!lt(n))return process.env.NODE_ENV!=="production"&&In(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=i.get(n);if(o)return o;const l=SE(n);if(l===0)return n;const u=new Proxy(n,l===2?r:t);return i.set(n,u),u}function di(n){return Rn(n)?di(n.__v_raw):!!(n&&n.__v_isReactive)}function Rn(n){return!!(n&&n.__v_isReadonly)}function gt(n){return!!(n&&n.__v_isShallow)}function Ko(n){return n?!!n.__v_raw:!1}function ce(n){const e=n&&n.__v_raw;return e?ce(e):n}function xE(n){return!Re(n,"__v_skip")&&Object.isExtensible(n)&&Zx(n,"__v_skip",!0),n}const ut=n=>lt(n)?Wu(n):n,qu=n=>lt(n)?zp(n):n;function Ge(n){return n?n.__v_isRef===!0:!1}function Go(n){return EE(n,!1)}function EE(n,e){return Ge(n)?n:new kE(n,e)}class kE{constructor(e,t){this.dep=new Du,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ce(e),this._value=t?e:ut(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||gt(e)||Rn(e);e=r?e:ce(e),jn(e,t)&&(this._rawValue=e,this._value=r?e:ut(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function z(n){return Ge(n)?n.value:n}const CE={get:(n,e,t)=>e==="__v_raw"?n:z(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return Ge(i)&&!Ge(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function AE(n){return di(n)?n:new Proxy(n,CE)}class OE{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return oE(ce(this._object),this._key)}}class TE{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function pi(n,e,t){return Ge(n)?n:Le(n)?new TE(n):lt(n)&&arguments.length>1?ME(n,e,t):Go(n)}function ME(n,e,t){const r=n[e];return Ge(r)?r:new OE(n,e,t)}class IE{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Du(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ds-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&be!==this)return Cp(this,!0),!0;process.env.NODE_ENV}get value(){const e=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return Tp(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&In("Write operation failed: computed value is readonly")}}function NE(n,e,t=!1){let r,i;Le(n)?r=n:(r=n.get,i=n.set);const o=new IE(r,i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(o.onTrack=e.onTrack,o.onTrigger=e.onTrigger),o}const jo={},Jo=new WeakMap;let kr;function RE(n,e=!1,t=kr){if(t){let r=Jo.get(t);r||Jo.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&In("onWatcherCleanup() was called when there was no active watcher to associate with.")}function LE(n,e,t=Ft){const{immediate:r,deep:i,once:o,scheduler:l,augmentJob:u,call:f}=t,d=R=>{(t.onWarn||In)("Invalid watch source: ",R,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},g=R=>i?R:gt(R)||i===!1||i===0?Yn(R,1):Yn(R);let p,_,S,k,m=!1,b=!1;if(Ge(n)?(_=()=>n.value,m=gt(n)):di(n)?(_=()=>g(n),m=!0):Ce(n)?(b=!0,m=n.some(R=>di(R)||gt(R)),_=()=>n.map(R=>{if(Ge(R))return R.value;if(di(R))return g(R);if(Le(R))return f?f(R,2):R();process.env.NODE_ENV!=="production"&&d(R)})):Le(n)?e?_=f?()=>f(n,2):n:_=()=>{if(S){$o();try{S()}finally{zo()}}const R=kr;kr=p;try{return f?f(n,3,[k]):n(k)}finally{kr=R}}:(_=xr,process.env.NODE_ENV!=="production"&&d(n)),e&&i){const R=_,W=i===!0?1/0:i;_=()=>Yn(R(),W)}const x=()=>{p.stop()};if(o&&e){const R=e;e=(...W)=>{R(...W),x()}}let A=b?new Array(n.length).fill(jo):jo;const O=R=>{if(!(!(p.flags&1)||!p.dirty&&!R))if(e){const W=p.run();if(i||m||(b?W.some((D,U)=>jn(D,A[U])):jn(W,A))){S&&S();const D=kr;kr=p;try{const U=[W,A===jo?void 0:b&&A[0]===jo?[]:A,k];f?f(e,3,U):e(...U),A=W}finally{kr=D}}}else p.run()};return u&&u(O),p=new rE(_),p.scheduler=l?()=>l(O,!1):O,k=R=>RE(R,!1,p),S=p.onStop=()=>{const R=Jo.get(p);if(R){if(f)f(R,4);else for(const W of R)W();Jo.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?O(!0):A=p.run():l?l(O.bind(null,!0),!0):p.run(),x.pause=p.pause.bind(p),x.resume=p.resume.bind(p),x.stop=x,x}function Yn(n,e=1/0,t){if(e<=0||!lt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Ge(n))Yn(n.value,e,t);else if(Ce(n))for(let r=0;r<n.length;r++)Yn(n[r],e,t);else if(Kx(n)||fi(n))n.forEach(r=>{Yn(r,e,t)});else if(Jx(n)){for(const r in n)Yn(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Yn(n[r],e,t)}return n}const Cr=[];function PE(n){Cr.push(n)}function DE(){Cr.pop()}let Ku=!1;function Oe(n,...e){if(Ku)return;Ku=!0,$o();const t=Cr.length?Cr[Cr.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=FE();if(r)Yo(r,t,11,[n+e.map(o=>{var l,u;return(u=(l=o.toString)==null?void 0:l.call(o))!=null?u:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${cm(t,o.type)}>`).join(`
|
|
25
23
|
`),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
|
|
26
|
-
`,...
|
|
27
|
-
`],...nk(t))}),e}function nk({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${dm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...rk(n.props),o]:[i+o]}function rk(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Kp(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Kp(n,e,t){return Kt(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:st(e)?(e=Kp(n,ie(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Ne(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ie(e),t?e:[`${n}=`,e])}const qp={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function kr(n,e,t,r){try{return r?n(...r):n()}catch(i){zu(i,e,t)}}function Uo(n,e,t,r){if(Ne(n)){const o=kr(n,e,t,r);return o&&cE(o)&&o.catch(a=>{zu(a,e,t)}),o}const i=[];for(let o=0;o<n.length;o++)i.push(Uo(n[o],e,t,r));return i}function zu(n,e,t,r=!0){const i=e?e.vnode:null;if(e){let o=e.parent;const a=e.proxy,u=process.env.NODE_ENV!=="production"?qp[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;o;){const d=o.ec;if(d){for(let p=0;p<d.length;p++)if(d[p](n,a,u)===!1)return}o=o.parent}const f=e.appContext.config.errorHandler;if(f){kr(f,null,10,[n,a,u]);return}}ik(n,t,i,r)}function ik(n,e,t,r=!0){if(process.env.NODE_ENV!=="production"){const i=qp[e];if(t&&ZE(t),Me(`Unhandled error${i?` during execution of ${i}`:""}`),t&&QE(),r)throw n;console.error(n)}else console.error(n)}let Ko=!1,Vu=!1;const qt=[];let Kn=0;const di=[];let Cn=null,qn=0;const Gp=Promise.resolve();let Wu=null;const sk=100;function ok(n){const e=Wu||Gp;return n?e.then(this?n.bind(this):n):e}function lk(n){let e=Kn+1,t=qt.length;for(;e<t;){const r=e+t>>>1,i=qt[r],o=ds(i);o<n||o===n&&i.pre?e=r+1:t=r}return e}function Uu(n){(!qt.length||!qt.includes(n,Ko&&n.allowRecurse?Kn+1:Kn))&&(n.id==null?qt.push(n):qt.splice(lk(n.id),0,n),jp())}function jp(){!Ko&&!Vu&&(Vu=!0,Wu=Gp.then(Yp))}function Jp(n){xe(n)?di.push(...n):(!Cn||!Cn.includes(n,n.allowRecurse?qn+1:qn))&&di.push(n),jp()}function ak(n){if(di.length){const e=[...new Set(di)].sort((t,r)=>ds(t)-ds(r));if(di.length=0,Cn){Cn.push(...e);return}for(Cn=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),qn=0;qn<Cn.length;qn++)process.env.NODE_ENV!=="production"&&Xp(n,Cn[qn])||Cn[qn]();Cn=null,qn=0}}const ds=n=>n.id==null?1/0:n.id,uk=(n,e)=>{const t=ds(n)-ds(e);if(t===0){if(n.pre&&!e.pre)return-1;if(e.pre&&!n.pre)return 1}return t};function Yp(n){Vu=!1,Ko=!0,process.env.NODE_ENV!=="production"&&(n=n||new Map),qt.sort(uk);const e=process.env.NODE_ENV!=="production"?t=>Xp(n,t):Bn;try{for(Kn=0;Kn<qt.length;Kn++){const t=qt[Kn];if(t&&t.active!==!1){if(process.env.NODE_ENV!=="production"&&e(t))continue;kr(t,null,14)}}}finally{Kn=0,qt.length=0,ak(n),Ko=!1,Wu=null,(qt.length||di.length)&&Yp(n)}}function Xp(n,e){if(!n.has(e))n.set(e,1);else{const t=n.get(e);if(t>sk){const r=e.ownerInstance,i=r&&hm(r.type);return zu(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else n.set(e,t+1)}}const ps=new Set;process.env.NODE_ENV!=="production"&&(wp().__VUE_HMR_RUNTIME__={createRecord:Ku(ck),rerender:Ku(fk),reload:Ku(hk)});const qo=new Map;function ck(n,e){return qo.has(n)?!1:(qo.set(n,{initialDef:ms(e),instances:new Set}),!0)}function ms(n){return pm(n)?n.__vccOpts:n}function fk(n,e){const t=qo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,ms(r.type).render=e),r.renderCache=[],r.effect.dirty=!0,r.update()}))}function hk(n,e){const t=qo.get(n);if(!t)return;e=ms(e),Zp(t.initialDef,e);const r=[...t.instances];for(const i of r){const o=ms(i.type);ps.has(o)||(o!==t.initialDef&&Zp(o,e),ps.add(o)),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(ps.add(o),i.ceReload(e.styles),ps.delete(o)):i.parent?(i.parent.effect.dirty=!0,Uu(i.parent.update)):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Jp(()=>{for(const i of r)ps.delete(ms(i.type))})}function Zp(n,e){Ut(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Ku(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let pi,Go=[];function Qp(n,e){var t,r;pi=n,pi?(pi.enabled=!0,Go.forEach(({event:i,args:o})=>pi.emit(i,...o)),Go=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{Qp(o,e)}),setTimeout(()=>{pi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Go=[])},3e3)):Go=[]}let rn=null,dk=null;function JI(){}const pk=Symbol.for("v-ndc"),mk=n=>n.__isSuspense;function gk(n,e){e&&e.pendingBranch?xe(n)?e.effects.push(...n):e.effects.push(n):Jp(n)}const yk=Symbol.for("v-scx"),bk=()=>{{const n=Tk(yk);return n||process.env.NODE_ENV!=="production"&&Me("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}},jo={};function _k(n,e,t){return process.env.NODE_ENV!=="production"&&!Ne(e)&&Me("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),em(n,e,t)}function em(n,e,{immediate:t,deep:r,flush:i,once:o,onTrack:a,onTrigger:u}=nn){if(e&&o){const $=e;e=(...ue)=>{$(...ue),pe()}}process.env.NODE_ENV!=="production"&&r!==void 0&&typeof r=="number"&&Me('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!e&&(t!==void 0&&Me('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),r!==void 0&&Me('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&Me('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const f=$=>{Me("Invalid watch source: ",$,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=bs,p=$=>r===!0?$:mi($,r===!1?1:void 0);let m,y=!1,v=!1;if(st(n)?(m=()=>n.value,y=xr(n)):Sr(n)?(m=()=>p(n),y=!0):xe(n)?(v=!0,y=n.some($=>Sr($)||xr($)),m=()=>n.map($=>{if(st($))return $.value;if(Sr($))return p($);if(Ne($))return kr($,d,2);process.env.NODE_ENV!=="production"&&f($)})):Ne(n)?e?m=()=>kr(n,d,2):m=()=>(S&&S(),Uo(n,d,3,[C])):(m=Bn,process.env.NODE_ENV!=="production"&&f(n)),e&&r){const $=m;m=()=>mi($())}let S,C=$=>{S=oe.onStop=()=>{kr($,d,4),S=oe.onStop=void 0}},O;if(Yu)if(C=Bn,e?t&&Uo(e,d,3,[m(),v?[]:void 0,C]):m(),i==="sync"){const $=bk();O=$.__watcherHandles||($.__watcherHandles=[])}else return Bn;let N=v?new Array(n.length).fill(jo):jo;const q=()=>{if(!(!oe.active||!oe.dirty))if(e){const $=oe.run();(r||y||(v?$.some((ue,at)=>Hn(ue,N[at])):Hn($,N)))&&(S&&S(),Uo(e,d,3,[$,N===jo?void 0:v&&N[0]===jo?[]:N,C]),N=$)}else oe.run()};q.allowRecurse=!!e;let K;i==="sync"?K=q:i==="post"?K=()=>om(q,d&&d.suspense):(q.pre=!0,d&&(q.id=d.uid),K=()=>Uu(q));const oe=new Sp(m,Bn,K),pe=()=>{oe.stop()};return process.env.NODE_ENV!=="production"&&(oe.onTrack=a,oe.onTrigger=u),e?t?q():N=oe.run():i==="post"?om(oe.run.bind(oe),d&&d.suspense):oe.run(),O&&O.push(pe),pe}function vk(n,e,t){const r=this.proxy,i=Kt(n)?n.includes(".")?wk(r,n):()=>r[n]:n.bind(r,r);let o;Ne(e)?o=e:(o=e.handler,t=e);const a=zk(this),u=em(i,o.bind(r),t);return a(),u}function wk(n,e){const t=e.split(".");return()=>{let r=n;for(let i=0;i<t.length&&r;i++)r=r[t[i]];return r}}function mi(n,e,t=0,r){if(!it(n)||n.__v_skip)return n;if(e&&e>0){if(t>=e)return n;t++}if(r=r||new Set,r.has(n))return n;if(r.add(n),st(n))mi(n.value,e,t,r);else if(xe(n))for(let i=0;i<n.length;i++)mi(n[i],e,t,r);else if(uE(n)||fi(n))n.forEach(i=>{mi(i,e,t,r)});else if(hE(n))for(const i in n)mi(n[i],e,t,r);return n}const qu=n=>n?Vk(n)?Wk(n)||n.proxy:qu(n.parent):null,gs=Ut(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?zo(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?zo(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?zo(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?zo(n.refs):n.refs,$parent:n=>qu(n.parent),$root:n=>qu(n.root),$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?kk(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{n.effect.dirty=!0,Uu(n.update)}),$nextTick:n=>n.n||(n.n=ok.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?vk.bind(n):Bn}),Sk=n=>n==="_"||n==="$",Gu=(n,e)=>n!==nn&&!n.__isScriptSetup&&Ie(n,e),xk={get({_:n},e){const{ctx:t,setupState:r,data:i,props:o,accessCache:a,type:u,appContext:f}=n;if(process.env.NODE_ENV!=="production"&&e==="__isVue")return!0;let d;if(e[0]!=="$"){const v=a[e];if(v!==void 0)switch(v){case 1:return r[e];case 2:return i[e];case 4:return t[e];case 3:return o[e]}else{if(Gu(r,e))return a[e]=1,r[e];if(i!==nn&&Ie(i,e))return a[e]=2,i[e];if((d=n.propsOptions[0])&&Ie(d,e))return a[e]=3,o[e];if(t!==nn&&Ie(t,e))return a[e]=4,t[e];(!__VUE_OPTIONS_API__||Ek)&&(a[e]=0)}}const p=gs[e];let m,y;if(p)return e==="$attrs"?(dt(n,"get",e),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&dt(n,"get",e),p(n);if((m=u.__cssModules)&&(m=m[e]))return m;if(t!==nn&&Ie(t,e))return a[e]=4,t[e];if(y=f.config.globalProperties,Ie(y,e))return y[e];process.env.NODE_ENV!=="production"&&rn&&(!Kt(e)||e.indexOf("__v")!==0)&&(i!==nn&&Sk(e[0])&&Ie(i,e)?Me(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):n===rn&&Me(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:n},e,t){const{data:r,setupState:i,ctx:o}=n;return Gu(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Ie(i,e)?(Me(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==nn&&Ie(r,e)?(r[e]=t,!0):Ie(n.props,e)?(process.env.NODE_ENV!=="production"&&Me(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Me(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&e in n.appContext.config.globalProperties?Object.defineProperty(o,e,{enumerable:!0,configurable:!0,value:t}):o[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:r,appContext:i,propsOptions:o}},a){let u;return!!t[a]||n!==nn&&Ie(n,a)||Gu(e,a)||(u=o[0])&&Ie(u,a)||Ie(r,a)||Ie(gs,a)||Ie(i.config.globalProperties,a)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Ie(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(xk.ownKeys=n=>(Me("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));function tm(n){return xe(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let Ek=!0;function kk(n){const e=n.type,{mixins:t,extends:r}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=n.appContext,u=o.get(e);let f;return u?f=u:!i.length&&!t&&!r?f=e:(f={},i.length&&i.forEach(d=>Jo(f,d,a,!0)),Jo(f,e,a)),it(e)&&o.set(e,f),f}function Jo(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&Jo(n,o,t,!0),i&&i.forEach(a=>Jo(n,a,t,!0));for(const a in e)if(r&&a==="expose")process.env.NODE_ENV!=="production"&&Me('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=Ck[a]||t&&t[a];n[a]=u?u(n[a],e[a]):e[a]}return n}const Ck={data:nm,props:im,emits:im,methods:ys,computed:ys,beforeCreate:ot,created:ot,beforeMount:ot,mounted:ot,beforeUpdate:ot,updated:ot,beforeDestroy:ot,beforeUnmount:ot,destroyed:ot,unmounted:ot,activated:ot,deactivated:ot,errorCaptured:ot,serverPrefetch:ot,components:ys,directives:ys,watch:Ok,provide:nm,inject:Ak};function nm(n,e){return e?n?function(){return Ut(Ne(n)?n.call(this,this):n,Ne(e)?e.call(this,this):e)}:e:n}function Ak(n,e){return ys(rm(n),rm(e))}function rm(n){if(xe(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function ot(n,e){return n?[...new Set([].concat(n,e))]:e}function ys(n,e){return n?Ut(Object.create(null),n,e):e}function im(n,e){return n?xe(n)&&xe(e)?[...new Set([...n,...e])]:Ut(Object.create(null),tm(n),tm(e??{})):e}function Ok(n,e){if(!n)return e;if(!e)return n;const t=Ut(Object.create(null),n);for(const r in e)t[r]=ot(n[r],e[r]);return t}let sm=null;function Tk(n,e,t=!1){const r=bs||rn;if(r||sm){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:sm._context.provides;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Ne(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Me(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Me("inject() can only be used inside setup() or functional components.")}const om=gk,Mk=n=>n.__isTeleport,lm=Symbol.for("v-fgt"),Ik=Symbol.for("v-txt"),Nk=Symbol.for("v-cmt");let gi=null;function Rk(n){return n?n.__v_isVNode===!0:!1}const Lk=(...n)=>cm(...n),am="__vInternal",um=({key:n})=>n??null,Yo=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Kt(n)||st(n)||Ne(n)?{i:rn,r:n,k:e,f:!!t}:n:null);function Pk(n,e=null,t=null,r=0,i=null,o=n===lm?0:1,a=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&um(e),ref:e&&Yo(e),scopeId:dk,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:rn};return u?(ju(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Kt(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Me("VNode created with invalid key (NaN). VNode type:",f.type),!a&&gi&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&gi.push(f),f}const Dk=process.env.NODE_ENV!=="production"?Lk:cm;function cm(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===pk)&&(process.env.NODE_ENV!=="production"&&!n&&Me(`Invalid vnode type when creating vnode: ${n}.`),n=Nk),Rk(n)){const u=Xo(n,e,!0);return t&&ju(u,t),!o&&gi&&(u.shapeFlag&6?gi[gi.indexOf(n)]=u:gi.push(u)),u.patchFlag|=-2,u}if(pm(n)&&(n=n.__vccOpts),e){e=Fk(e);let{class:u,style:f}=e;u&&!Kt(u)&&(e.class=Au(u)),it(f)&&(Bu(f)&&!xe(f)&&(f=Ut({},f)),e.style=Cu(f))}const a=Kt(n)?1:mk(n)?128:Mk(n)?64:it(n)?4:Ne(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&Bu(n)&&(n=ie(n),Me("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
28
|
-
Component that was made reactive: `,n)),Pk(n,e,t,r,i,a,o,!0)}function Fk(n){return n?Bu(n)||am in n?Ut({},n):n:null}function Xo(n,e,t=!1){const{props:r,ref:i,patchFlag:o,children:a}=n,u=e?Bk(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:n.type,props:u,key:u&&um(u),ref:e&&e.ref?t&&i?xe(i)?i.concat(Yo(e)):[i,Yo(e)]:Yo(e):i,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&xe(a)?a.map(fm):a,target:n.target,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==lm?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:n.transition,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Xo(n.ssContent),ssFallback:n.ssFallback&&Xo(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce}}function fm(n){const e=Xo(n);return xe(n.children)&&(e.children=n.children.map(fm)),e}function $k(n=" ",e=0){return Dk(Ik,null,n,e)}function ju(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(xe(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),ju(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!(am in e)?e._ctx=rn:i===3&&rn&&(rn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ne(e)?(e={default:e,_ctx:rn},t=32):(e=String(e),r&64?(t=16,e=[$k(e)]):t=8);n.children=e,n.shapeFlag|=t}function Bk(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=Au([e.class,r.class]));else if(i==="style")e.style=Cu([e.style,r.style]);else if(lE(i)){const o=e[i],a=r[i];a&&o!==a&&!(xe(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}let bs=null;const Hk=()=>bs||rn;let Ju;{const n=wp(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Ju=e("__VUE_INSTANCE_SETTERS__",t=>bs=t),e("__VUE_SSR_SETTERS__",t=>Yu=t)}const zk=n=>{const e=bs;return Ju(n),n.scope.on(),()=>{n.scope.off(),Ju(e)}};function Vk(n){return n.vnode.shapeFlag&4}let Yu=!1;function Wk(n){if(n.exposed)return n.exposeProxy||(n.exposeProxy=new Proxy(jE(VE(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in gs)return gs[t](n)},has(e,t){return t in e||t in gs}}))}const Uk=/(?:^|[-_])(\w)/g,Kk=n=>n.replace(Uk,e=>e.toUpperCase()).replace(/[-_]/g,"");function hm(n,e=!0){return Ne(n)?n.displayName||n.name:n.name||e&&n.__name}function dm(n,e,t=!1){let r=hm(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=o=>{for(const a in o)if(o[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?Kk(r):t?"App":"Anonymous"}function pm(n){return Ne(n)&&"__vccOpts"in n}const fe=(n,e)=>{const t=UE(n,e,Yu);if(process.env.NODE_ENV!=="production"){const r=Hk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function qk(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={header(m){return it(m)?m.__isVue?["div",n,"VueInstance"]:st(m)?["div",{},["span",n,p(m)],"<",u(m.value),">"]:Sr(m)?["div",{},["span",n,xr(m)?"ShallowReactive":"Reactive"],"<",u(m),`>${Un(m)?" (readonly)":""}`]:Un(m)?["div",{},["span",n,xr(m)?"ShallowReadonly":"Readonly"],"<",u(m),">"]:null:null},hasBody(m){return m&&m.__isVue},body(m){if(m&&m.__isVue)return["div",{},...o(m.$)]}};function o(m){const y=[];m.type.props&&m.props&&y.push(a("props",ie(m.props))),m.setupState!==nn&&y.push(a("setup",m.setupState)),m.data!==nn&&y.push(a("data",ie(m.data)));const v=f(m,"computed");v&&y.push(a("computed",v));const S=f(m,"inject");return S&&y.push(a("injected",S)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:m}]]),y}function a(m,y){return y=Ut({},y),Object.keys(y).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},m],["div",{style:"padding-left:1.25em"},...Object.keys(y).map(v=>["div",{},["span",r,v+": "],u(y[v],!1)])]]:["span",{}]}function u(m,y=!0){return typeof m=="number"?["span",e,m]:typeof m=="string"?["span",t,JSON.stringify(m)]:typeof m=="boolean"?["span",r,m]:it(m)?["object",{object:y?ie(m):m}]:["span",t,String(m)]}function f(m,y){const v=m.type;if(Ne(v))return;const S={};for(const C in m.ctx)d(v,C,y)&&(S[C]=m.ctx[C]);return S}function d(m,y,v){const S=m[v];if(xe(S)&&S.includes(y)||it(S)&&y in S||m.extends&&d(m.extends,y,v)||m.mixins&&m.mixins.some(C=>d(C,y,v)))return!0}function p(m){return xr(m)?"ShallowRef":m.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Gk(){qk()}process.env.NODE_ENV!=="production"&&Gk();function Ue(n){this.content=n}Ue.prototype={constructor:Ue,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Ue(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ue(t)},addToStart:function(n,e){return new Ue([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ue(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Ue(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Ue.from(n),n.size?new Ue(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Ue.from(n),n.size?new Ue(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ue.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},get size(){return this.content.length>>1}},Ue.from=function(n){if(n instanceof Ue)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ue(e)};function mm(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=mm(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function gm(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),u=e.child(--o),f=a.nodeSize;if(a==u){t-=f,r-=f;continue}if(!a.sameMarkup(u))return{a:t,b:r};if(a.isText&&a.text!=u.text){let d=0,p=Math.min(a.text.length,u.text.length);for(;d<p&&a.text[a.text.length-d-1]==u.text[u.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(a.content.size||u.content.size){let d=gm(a.content,u.content,t-1,r-1);if(d)return d}t-=f,r-=f}}class L{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,u=0;u<t;a++){let f=this.content[a],d=u+f.nodeSize;if(d>e&&r(f,i+u,o||null,a)!==!1&&f.content.size){let p=u+1;f.nodesBetween(Math.max(0,e-p),Math.min(f.content.size,t-p),r,i+p)}u=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(u,f)=>{u.isText?(o+=u.text.slice(Math.max(e,f)-f,t-f),a=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new L(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let u=this.content[o],f=a+u.nodeSize;f>e&&((a<e||f>t)&&(u.isText?u=u.cut(Math.max(0,e-a),Math.min(u.text.length,t-a)):u=u.cut(Math.max(0,e-a-1),Math.min(u.content.size,t-a-1))),r.push(u),i+=u.nodeSize),a=f}return new L(r,i)}cutByIndex(e,t){return e==t?L.empty:e==0&&t==this.content.length?this:new L(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new L(i,o)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return mm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return gm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Zo(0,e);if(e==this.size)return Zo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?Zo(r+1,a):Zo(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return L.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new L(t||e,r)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const Xu={index:0,offset:0};function Zo(n,e){return Xu.index=n,Xu.offset=e,Xu}function Qo(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qo(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qo(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let we=class xf{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return xf.none;if(e instanceof xf)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};we.none=[];class el extends Error{}class z{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=bm(this.content,e+this.openStart,t);return r&&new z(r,this.openStart,this.openEnd)}removeBetween(e,t){return new z(ym(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return z.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new z(L.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new z(e,r,i)}}z.empty=new z(L.empty,0,0);function ym(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:u}=n.findIndex(t);if(i==e||o.isText){if(u!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(ym(o.content,e-i-1,t-i-1)))}function bm(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=bm(a.content,e-o-1,t);return u&&n.replaceChild(i,a.copy(u))}function jk(n,e,t){if(t.openStart>n.depth)throw new el("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new el("Inconsistent open depths");return _m(n,e,t,0)}function _m(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=_m(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,u=a.content;return Ar(a,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=Jk(t,n);return Ar(o,wm(n,a,u,e,r))}else return Ar(o,tl(n,e,r))}function vm(n,e){if(!e.type.compatibleContent(n.type))throw new el("Cannot join "+e.type.name+" onto "+n.type.name)}function Zu(n,e,t){let r=n.node(t);return vm(r,e.node(t)),r}function Cr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function _s(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Cr(n.nodeAfter,r),o++));for(let u=o;u<a;u++)Cr(i.child(u),r);e&&e.depth==t&&e.textOffset&&Cr(e.nodeBefore,r)}function Ar(n,e){return n.type.checkContent(e),n.copy(e)}function wm(n,e,t,r,i){let o=n.depth>i&&Zu(n,e,i+1),a=r.depth>i&&Zu(t,r,i+1),u=[];return _s(null,n,i,u),o&&a&&e.index(i)==t.index(i)?(vm(o,a),Cr(Ar(o,wm(n,e,t,r,i+1)),u)):(o&&Cr(Ar(o,tl(n,e,i+1)),u),_s(e,t,i,u),a&&Cr(Ar(a,tl(t,r,i+1)),u)),_s(r,null,i,u),new L(u)}function tl(n,e,t){let r=[];if(_s(null,n,t,r),n.depth>t){let i=Zu(n,e,t+1);Cr(Ar(i,tl(n,e,t+1)),r)}return _s(e,null,t,r),new L(r)}function Jk(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(L.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Ds{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return we.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new nl(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:u,offset:f}=a.content.findIndex(o),d=o-f;if(r.push(a,u,i+f),!d||(a=a.child(u),a.isText))break;o=d-1,i+=f+1}return new Ds(t,r,o)}static resolveCached(e,t){for(let i=0;i<Qu.length;i++){let o=Qu[i];if(o.pos==t&&o.doc==e)return o}let r=Qu[ec]=Ds.resolve(e,t);return ec=(ec+1)%Yk,r}}let Qu=[],ec=0,Yk=12;class nl{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Xk=Object.create(null);let Or=class Ef{constructor(e,t,r,i=we.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||L.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qo(this.attrs,t||e.defaultAttrs||Xk)&&we.sameSet(this.marks,r||we.none)}copy(e=null){return e==this.content?this:new Ef(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ef(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return z.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),d=i.node(a).content.cut(i.pos-u,o.pos-u);return new z(d,i.depth-a,o.depth-a)}replace(e,t,r){return jk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Ds.resolveCached(this,e)}resolveNoCache(e){return Ds.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Sm(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=L.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,t);if(!u||!u.validEnd)return!1;for(let f=i;f<o;f++)if(!this.type.allowsMarks(r.child(f).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=we.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!we.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=L.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Or.prototype.text=void 0;class Gl extends Or{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Sm(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Gl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Gl(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Sm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class zr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Zk(e,t);if(r.next==null)return zr.empty;let i=xm(r);r.next&&r.err("Unexpected trailing text");let o=sC(iC(i));return oC(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,u){let f=a.matchFragment(e,r);if(f&&(!t||f.validEnd))return L.from(u.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:p,next:m}=a.next[d];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(m)==-1){i.push(m);let y=o(m,u.concat(p));if(y)return y}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:u,next:f}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in t)&&(!i.type||f.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),t[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
|
|
29
|
-
`)}}zr.empty=new zr(!0);class Zk{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function xm(n){let e=[];do e.push(Qk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Qk(n){let e=[];do e.push(eC(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function eC(n){let e=rC(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=tC(n,e);else break;return e}function Em(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function tC(n,e){let t=Em(n),r=t;return n.eat(",")&&(n.next!="}"?r=Em(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function nC(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function rC(n){if(n.eat("(")){let e=xm(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=nC(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function iC(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,f){let d={term:f,to:u};return e[a].push(d),d}function i(a,u){a.forEach(f=>f.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((f,d)=>f.concat(o(d,u)),[]);if(a.type=="seq")for(let f=0;;f++){let d=o(a.exprs[f],u);if(f==a.exprs.length-1)return d;i(d,u=t())}else if(a.type=="star"){let f=t();return r(u,f),i(o(a.expr,f),f),[r(f)]}else if(a.type=="plus"){let f=t();return i(o(a.expr,u),f),i(o(a.expr,f),f),[r(f)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let f=u;for(let d=0;d<a.min;d++){let p=t();i(o(a.expr,f),p),f=p}if(a.max==-1)i(o(a.expr,f),f);else for(let d=a.min;d<a.max;d++){let p=t();r(f,p),i(o(a.expr,f),p),f=p}return[r(f)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function km(n,e){return e-n}function Cm(n,e){let t=[];return r(e),t.sort(km);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:u,to:f}=o[a];!u&&t.indexOf(f)==-1&&r(f)}}}function sC(n){let e=Object.create(null);return t(Cm(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:f})=>{if(!u)return;let d;for(let p=0;p<i.length;p++)i[p][0]==u&&(d=i[p][1]);Cm(n,f).forEach(p=>{d||i.push([u,d=[]]),d.indexOf(p)==-1&&d.push(p)})})});let o=e[r.join(",")]=new zr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(km);o.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return o}}function oC(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:f,next:d}=i.next[u];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Am(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Om(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Tm(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new lC(n[t]);return e}let Mm=class G0{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Tm(r.attrs),this.defaultAttrs=Am(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==zr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Om(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Or(this,this.computeAttrs(e),L.from(t),we.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new Or(this,this.computeAttrs(e),t,we.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=L.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(L.empty,!0);return o?new Or(this,e,t.append(o),we.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:we.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new G0(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class lC{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class jl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Tm(i.attrs),this.excluded=null;let o=Am(this.attrs);this.instance=o?new we(this,o):null}create(e=null){return!e&&this.instance?this.instance:new we(this,Om(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new jl(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class aC{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ue.from(e.nodes),t.marks=Ue.from(e.marks||{}),this.nodes=Mm.compile(this.spec.nodes,this),this.marks=jl.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=zr.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?Im(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Im(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Mm){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Gl(r,r.defaultAttrs,e,we.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Or.fromJSON(this,e)}markFromJSON(e){return we.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Im(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let u in n.marks){let f=n.marks[u];(i=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=f)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let tc=class kf{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Pm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Pm(this,t,!0);return r.addAll(e,t.from,t.to),z.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(fC(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(u.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(a.getAttrs){let f=a.getAttrs(t);if(f===!1)continue;a.attrs=f||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let u=t[a];if((u.priority==null?50:u.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Dm(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Dm(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new kf(e,kf.schemaRules(e)))}};const Nm={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},uC={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Rm={ol:!0,ul:!0},rl=1,il=2,vs=4;function Lm(n,e,t){return e!=null?(e?rl:0)|(e==="full"?il:0):n&&n.whitespace=="pre"?rl|il:t&~vs}class sl{constructor(e,t,r,i,o,a,u){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=we.none,this.stashMarks=[],this.match=a||(u&vs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&rl)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):dC(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Nm.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Pm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=Lm(null,t.preserveWhitespace,0)|(r?vs:0);i?o=new sl(i.type,i.attrs,we.none,we.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new sl(null,null,we.none,we.none,!0,null,a):o=new sl(e.schema.topNodeType,null,we.none,we.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let t=e.getAttribute("style");if(!t)this.addElement(e);else{let r=this.readStyles(hC(t));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(e);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&il||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&rl)r.options&il?t=t.replace(/\r\n?/g,`
|
|
30
|
-
`):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;
|
|
31
|
-
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=we.none,r=we.none;e:for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(e[i],e[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)o=a;else break}return[t,r]}addElementByRule(e,t,r){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f));else{let f=e;typeof t.contentElement=="string"?f=e.querySelector(t.contentElement):typeof t.contentElement=="function"?f=t.contentElement(e):t.contentElement&&(f=t.contentElement),this.findAround(e,f,!0),this.addAll(f)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=r==null?null:e.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,r=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=Lm(e,i,o.options);o.options&vs&&o.content.length==0&&(a|=vs),this.nodes.push(new sl(e,t,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(u,f)=>{for(;u>=0;u--){let d=t[u];if(d==""){if(u==t.length-1||u==0)continue;for(;f>=o;f--)if(a(u-1,f))return!0;return!1}else{let p=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!p||p.name!=d&&p.groups.indexOf(d)==-1)return!1;f--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=pC(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}}function cC(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Rm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function fC(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function hC(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function Dm(n){let e={};for(let t in n)e[t]=n[t];return e}function dC(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=u=>{o.push(u);for(let f=0;f<u.edgeCount;f++){let{type:d,next:p}=u.edge(f);if(d==e||o.indexOf(p)<0&&a(p))return!0}};if(a(i.contentMatch))return!0}}function pC(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class Wr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=nc(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let u=0,f=0;for(;u<o.length&&f<a.marks.length;){let d=a.marks[f];if(!this.marks[d.type.name]){f++;continue}if(!d.eq(o[u][0])||d.type.spec.spanning===!1)break;u++,f++}for(;u<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let d=a.marks[f++],p=this.serializeMark(d,a.isInline,t);p&&(o.push([d,i]),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Wr.renderSpec(nc(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Wr.renderSpec(nc(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?e.createElementNS(r,i):e.createElement(i),f=t[1],d=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){d=2;for(let p in f)if(f[p]!=null){let m=p.indexOf(" ");m>0?u.setAttributeNS(p.slice(0,m),p.slice(m+1),f[p]):u.setAttribute(p,f[p])}}for(let p=d;p<t.length;p++){let m=t[p];if(m===0){if(p<t.length-1||p>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:y,contentDOM:v}=Wr.renderSpec(e,m,r);if(u.appendChild(y),v){if(a)throw new RangeError("Multiple content holes");a=v}}}return{dom:u,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Wr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Fm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Fm(e.marks)}}function Fm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function nc(n){return n.document||window.document}const $m=65535,Bm=Math.pow(2,16);function mC(n,e){return n+e*Bm}function Hm(n){return n&$m}function gC(n){return(n-(n&$m))/Bm}const zm=1,Vm=2,ol=4,Wm=8;class rc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Wm)>0}get deletedBefore(){return(this.delInfo&(zm|ol))>0}get deletedAfter(){return(this.delInfo&(Vm|ol))>0}get deletedAcross(){return(this.delInfo&ol)>0}}class Ft{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ft.empty)return Ft.empty}recover(e){let t=0,r=Hm(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+gC(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?i:0);if(f>e)break;let d=this.ranges[u+o],p=this.ranges[u+a],m=f+d;if(e<=m){let y=d?e==f?-1:e==m?1:t:t,v=f+i+(y<0?0:p);if(r)return v;let S=e==(t<0?f:m)?null:mC(u/3,e-f),C=e==f?Vm:e==m?zm:ol;return(t<0?e!=f:e!=m)&&(C|=Wm),new rc(v,C,S)}i+=p-d}return r?e+i:new rc(e+i,0,null)}touches(e,t){let r=0,i=Hm(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?r:0);if(f>e)break;let d=this.ranges[u+o],p=f+d;if(e<=p&&u==i*3)return!0;r+=this.ranges[u+a]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),f=a+(this.inverted?0:o),d=this.ranges[i+t],p=this.ranges[i+r];e(u,u+d,f,f+p),o+=p-d}}invert(){return new Ft(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ft.empty:new Ft(e<0?[0,-e,0]:[0,0,e])}}Ft.empty=new Ft([]);class Di{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Di(this.maps,this.mirror,e,t)}copy(){return new Di(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Di;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],u=a.mapResult(e,t);if(u.recover!=null){let f=this.getMirror(o);if(f!=null&&f>o&&f<this.to){o=f,e=this.maps[f].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new rc(e,i,null)}}const ic=Object.create(null);class Xe{getMap(){return Ft.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ic[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ic)throw new RangeError("Duplicate use of step JSON ID "+e);return ic[e]=t,t.prototype.jsonID=e,t}}class Le{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Le(e,null)}static fail(e){return new Le(null,e)}static fromReplace(e,t,r,i){try{return Le.ok(e.replace(t,r,i))}catch(o){if(o instanceof el)return Le.fail(o.message);throw o}}}function sc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(sc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class or extends Xe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new z(sc(t.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return Le.fromReplace(e,this.from,this.to,o)}invert(){return new hn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new or(t.pos,r.pos,this.mark)}merge(e){return e instanceof or&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new or(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new or(t.from,t.to,e.markFromJSON(t.mark))}}Xe.jsonID("addMark",or);class hn extends Xe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new z(sc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Le.fromReplace(e,this.from,this.to,r)}invert(){return new or(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new hn(t.pos,r.pos,this.mark)}merge(e){return e instanceof hn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new hn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new hn(t.from,t.to,e.markFromJSON(t.mark))}}Xe.jsonID("removeMark",hn);class lr extends Xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Le.fromReplace(e,this.pos,this.pos+1,new z(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new lr(this.pos,t.marks[i]);return new lr(this.pos,this.mark)}}return new Fi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new lr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new lr(t.pos,e.markFromJSON(t.mark))}}Xe.jsonID("addNodeMark",lr);class Fi extends Xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Le.fromReplace(e,this.pos,this.pos+1,new z(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new lr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Fi(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Fi(t.pos,e.markFromJSON(t.mark))}}Xe.jsonID("removeNodeMark",Fi);class Ze extends Xe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&oc(e,this.from,this.to)?Le.fail("Structure replace would overwrite content"):Le.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ft([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ze(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Ze(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ze)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?z.empty:new z(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ze(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?z.empty:new z(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ze(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ze(t.from,t.to,z.fromJSON(e,t.slice),!!t.structure)}}Xe.jsonID("replace",Ze);class He extends Xe{constructor(e,t,r,i,o,a,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=u}apply(e){if(this.structure&&(oc(e,this.from,this.gapFrom)||oc(e,this.gapTo,this.to)))return Le.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Le.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Le.fromReplace(e,this.from,this.to,r):Le.fail("Content does not fit in gap")}getMap(){return new Ft([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new He(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new He(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new He(t.from,t.to,t.gapFrom,t.gapTo,z.fromJSON(e,t.slice),t.insert,!!t.structure)}}Xe.jsonID("replaceAround",He);function oc(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function yC(n,e,t,r){let i=[],o=[],a,u;n.doc.nodesBetween(e,t,(f,d,p)=>{if(!f.isInline)return;let m=f.marks;if(!r.isInSet(m)&&p.type.allowsMarkType(r.type)){let y=Math.max(d,e),v=Math.min(d+f.nodeSize,t),S=r.addToSet(m);for(let C=0;C<m.length;C++)m[C].isInSet(S)||(a&&a.to==y&&a.mark.eq(m[C])?a.to=v:i.push(a=new hn(y,v,m[C])));u&&u.to==y?u.to=v:o.push(u=new or(y,v,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function bC(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,u)=>{if(!a.isInline)return;o++;let f=null;if(r instanceof jl){let d=a.marks,p;for(;p=r.isInSet(d);)(f||(f=[])).push(p),d=p.removeFromSet(d)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let d=Math.min(u+a.nodeSize,t);for(let p=0;p<f.length;p++){let m=f[p],y;for(let v=0;v<i.length;v++){let S=i[v];S.step==o-1&&m.eq(i[v].style)&&(y=S)}y?(y.to=d,y.step=o):i.push({style:m,from:Math.max(u,e),to:d,step:o})}}}),i.forEach(a=>n.step(new hn(a.from,a.to,a.style)))}function _C(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],a=e+1;for(let u=0;u<i.childCount;u++){let f=i.child(u),d=a+f.nodeSize,p=r.matchType(f.type);if(!p)o.push(new Ze(a,d,z.empty));else{r=p;for(let m=0;m<f.marks.length;m++)t.allowsMarkType(f.marks[m].type)||n.step(new hn(a,d,f.marks[m]))}a=d}if(!r.validEnd){let u=r.fillBefore(L.empty,!0);n.replace(a,a,new z(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function vC(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function yi(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!vC(i,o,a))break}return null}function wC(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),u=i.after(o+1),f=a,d=u,p=L.empty,m=0;for(let S=o,C=!1;S>t;S--)C||r.index(S)>0?(C=!0,p=L.from(r.node(S).copy(p)),m++):f--;let y=L.empty,v=0;for(let S=o,C=!1;S>t;S--)C||i.after(S+1)<i.end(S)?(C=!0,y=L.from(i.node(S).copy(y)),v++):d++;n.step(new He(f,d,a,u,new z(p.append(y),m,v),p.size-m,!0))}function lc(n,e,t=null,r=n){let i=SC(n,e),o=i&&xC(r,e);return o?i.map(Um).concat({type:e,attrs:t}).concat(o.map(Um)):null}function Um(n){return{type:n,attrs:null}}function SC(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function xC(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let f=(a.length?a[a.length-1]:e).contentMatch;for(let d=r;f&&d<i;d++)f=f.matchType(t.child(d).type);return!f||!f.validEnd?null:a}function EC(n,e,t){let r=L.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let u=t[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=L.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new He(i,o,i,o,new z(r,0,0),t.length,!0))}function kC(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&CC(n.doc,n.mapping.slice(o).map(u),r)){n.clearIncompatible(n.mapping.slice(o).map(u,1),r);let f=n.mapping.slice(o),d=f.map(u,1),p=f.map(u+a.nodeSize,1);return n.step(new He(d,p,d+1,p-1,new z(L.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function CC(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function AC(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new He(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new z(L.from(a),0,0),1,!0))}function bi(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,p=t-2;d>o;d--,p--){let m=i.node(d),y=i.index(d);if(m.type.spec.isolating)return!1;let v=m.content.cutByIndex(y,m.childCount),S=r&&r[p]||m;if(S!=m&&(v=v.replaceChild(0,S.type.create(S.attrs))),!m.canReplace(y+1,m.childCount)||!S.type.validContent(v))return!1}let u=i.indexAfter(o),f=r&&r[0];return i.node(o).canReplaceWith(u,u,f?f.type:i.node(o+1).type)}function OC(n,e,t=1,r){let i=n.doc.resolve(e),o=L.empty,a=L.empty;for(let u=i.depth,f=i.depth-t,d=t-1;u>f;u--,d--){o=L.from(i.node(u).copy(o));let p=r&&r[d];a=L.from(p?p.type.create(p.attrs,a):i.node(u).copy(a))}n.step(new Ze(e,e,new z(o.append(a),t,t),!0))}function Gn(n,e){let t=n.resolve(e),r=t.index();return Km(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Km(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function ll(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&Km(o,a)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function TC(n,e,t){let r=new Ze(e-t,e+t,z.empty,!0);n.step(r)}function MC(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function IC(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,f=r.index(a)+(u>0?1:0),d=r.node(a),p=!1;if(o==1)p=d.canReplace(f,f,i);else{let m=d.contentMatchAt(f).findWrapping(i.firstChild.type);p=m&&d.canReplaceWith(f,f,m[0])}if(p)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function ac(n,e,t=e,r=z.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return qm(i,o,r)?new Ze(e,t,r):new NC(i,o,r).fit()}function qm(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class NC{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=L.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=L.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let f=new z(o,a,u);return e>-1?new He(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new Ze(r.pos,i.pos,f):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=uc(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:f}=this.frontier[a],d,p=null;if(e==1&&(o?f.matchType(o.type)||(p=f.fillBefore(L.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:a,parent:i,inject:p};if(e==2&&o&&(d=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:a,parent:i,wrap:d};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=uc(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new z(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=uc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new z(ws(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new z(ws(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let C=0;C<o.length;C++)this.openFrontierNode(o[C]);let a=this.unplaced,u=r?r.content:a.content,f=a.openStart-e,d=0,p=[],{match:m,type:y}=this.frontier[t];if(i){for(let C=0;C<i.childCount;C++)p.push(i.child(C));m=m.matchFragment(i)}let v=u.size+e-(a.content.size-a.openEnd);for(;d<u.childCount;){let C=u.child(d),O=m.matchType(C.type);if(!O)break;d++,(d>1||f==0||C.content.size)&&(m=O,p.push(Gm(C.mark(y.allowedMarks(C.marks)),d==1?f:0,d==u.childCount?v:-1)))}let S=d==u.childCount;S||(v=-1),this.placed=Ss(this.placed,t,L.from(p)),this.frontier[t].match=m,S&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let C=0,O=u;C<v;C++){let N=O.lastChild;this.frontier.push({type:N.type,match:N.contentMatchAt(N.childCount)}),O=N.content}this.unplaced=S?e==0?z.empty:new z(ws(a.content,e-1,1),e-1,v<0?a.openEnd:e-1):new z(ws(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!cc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=cc(e,t,i,r,o);if(a){for(let u=t-1;u>=0;u--){let{match:f,type:d}=this.frontier[u],p=cc(e,u,d,f,!0);if(!p||p.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ss(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ss(this.placed,this.depth,L.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(L.empty,!0);t.childCount&&(this.placed=Ss(this.placed,this.frontier.length,t))}}function ws(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(ws(n.firstChild.content,e-1,t)))}function Ss(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ss(n.lastChild.content,e-1,t)))}function uc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Gm(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Gm(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(L.empty,!0)))),n.copy(r)}function cc(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!RC(t,o.content,a)?u:null}function RC(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function LC(n){return n.spec.defining||n.spec.definingForContent}function PC(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(qm(i,o,r))return n.step(new Ze(e,t,r));let a=Jm(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let y=i.depth,v=i.pos-1;y>0;y--,v--){let S=i.node(y).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(y)>-1?u=y:i.before(y)==v&&a.splice(1,0,-y)}let f=a.indexOf(u),d=[],p=r.openStart;for(let y=r.content,v=0;;v++){let S=y.firstChild;if(d.push(S),v==r.openStart)break;y=S.content}for(let y=p-1;y>=0;y--){let v=d[y].type,S=LC(v);if(S&&i.node(f).type!=v)p=y;else if(S||!v.isTextblock)break}for(let y=r.openStart;y>=0;y--){let v=(y+p+1)%(r.openStart+1),S=d[v];if(S)for(let C=0;C<a.length;C++){let O=a[(C+f)%a.length],N=!0;O<0&&(N=!1,O=-O);let q=i.node(O-1),K=i.index(O-1);if(q.canReplaceWith(K,K,S.type,S.marks))return n.replace(i.before(O),N?o.after(O):t,new z(jm(r.content,0,r.openStart,v),v,r.openEnd))}}let m=n.steps.length;for(let y=a.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>m));y--){let v=a[y];v<0||(e=i.before(v),t=o.after(v))}}function jm(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(jm(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(L.empty,!0))}return n}function DC(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=MC(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new z(L.from(r),0,0))}function FC(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Jm(r,i);for(let a=0;a<o.length;a++){let u=o[a],f=a==o.length-1;if(f&&u==0||r.node(u).type.contentMatch.validEnd)return n.delete(r.start(u),i.end(u));if(u>0&&(f||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return n.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a)return n.delete(r.before(a),t);n.delete(e,t)}function Jm(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class $i extends Xe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Le.fromReplace(e,this.pos,this.pos+1,new z(L.from(i),0,t.isLeaf?0:1))}getMap(){return Ft.empty}invert(e){return new $i(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $i(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $i(t.pos,t.attr,t.value)}}Xe.jsonID("attr",$i);let _i=class extends Error{};_i=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},_i.prototype=Object.create(Error.prototype),_i.prototype.constructor=_i,_i.prototype.name="TransformError";class $C{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Di}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new _i(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=z.empty){let i=ac(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new z(L.from(r),0,0))}delete(e,t){return this.replace(e,t,z.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return PC(this,e,t,r),this}replaceRangeWith(e,t,r){return DC(this,e,t,r),this}deleteRange(e,t){return FC(this,e,t),this}lift(e,t){return wC(this,e,t),this}join(e,t=1){return TC(this,e,t),this}wrap(e,t){return EC(this,e,t),this}setBlockType(e,t=e,r,i=null){return kC(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return AC(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new $i(e,t,r)),this}addNodeMark(e,t){return this.step(new lr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof we)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Fi(e,t)),this}split(e,t=1,r){return OC(this,e,t,r),this}addMark(e,t,r){return yC(this,e,t,r),this}removeMark(e,t,r){return bC(this,e,t,r),this}clearIncompatible(e,t,r){return _C(this,e,t,r),this}}const fc=Object.create(null);class he{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new BC(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=z.empty){let r=t.content.lastChild,i=null;for(let u=0;u<t.openEnd;u++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:f,$to:d}=a[u],p=e.mapping.slice(o);e.replaceRange(p.map(f.pos),p.map(d.pos),u?z.empty:t),u==0&&Zm(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],f=e.mapping.slice(r),d=f.map(a.pos),p=f.map(u.pos);o?e.deleteRange(d,p):(e.replaceRangeWith(d,p,t),Zm(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new de(e):vi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?vi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):vi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Yt(e.node(0))}static atStart(e){return vi(e,e,0,0,1)||new Yt(e)}static atEnd(e){return vi(e,e,e.content.size,e.childCount,-1)||new Yt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=fc[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in fc)throw new RangeError("Duplicate use of selection JSON ID "+e);return fc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return de.between(this.$anchor,this.$head).getBookmark()}}he.prototype.visible=!0;class BC{constructor(e,t){this.$from=e,this.$to=t}}let Ym=!1;function Xm(n){!Ym&&!n.parent.inlineContent&&(Ym=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class de extends he{constructor(e,t=e){Xm(e),Xm(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return he.near(r);let i=e.resolve(t.map(this.anchor));return new de(i.parent.inlineContent?i:r,r)}replace(e,t=z.empty){if(super.replace(e,t),t==z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof de&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Jl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new de(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=he.findFrom(t,r,!0)||he.findFrom(t,-r,!0);if(o)t=o.$head;else return he.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(he.findFrom(e,-r,!0)||he.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new de(e,t)}}he.jsonID("text",de);class Jl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Jl(e.map(this.anchor),e.map(this.head))}resolve(e){return de.between(e.resolve(this.anchor),e.resolve(this.head))}}class Y extends he{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?he.near(o):new Y(o)}content(){return new z(L.from(this.node),0,0)}eq(e){return e instanceof Y&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Cf(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Y(e.resolve(t.anchor))}static create(e,t){return new Y(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Y.prototype.visible=!1,he.jsonID("node",Y);class Cf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Jl(r,r):new Cf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Y.isSelectable(r)?new Y(t):he.near(t)}}class Yt extends he{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=z.empty){if(t==z.empty){e.delete(0,e.doc.content.size);let r=he.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Yt(e)}map(e){return new Yt(e)}eq(e){return e instanceof Yt}getBookmark(){return HC}}he.jsonID("all",Yt);const HC={map(){return this},resolve(n){return new Yt(n)}};function vi(n,e,t,r,i,o=!1){if(e.inlineContent)return de.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let u=e.child(a);if(u.isAtom){if(!o&&Y.isSelectable(u))return Y.create(n,t-(i<0?u.nodeSize:0))}else{let f=vi(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function Zm(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof Ze||i instanceof He))return;let o=n.mapping.maps[r],a;o.forEach((u,f,d,p)=>{a==null&&(a=p)}),n.setSelection(he.near(n.doc.resolve(a),t))}function Qm(n,e){return!e||!n?n:n.bind(e)}class al{constructor(e,t,r){this.name=e,this.init=Qm(t.init,r),this.apply=Qm(t.apply,r)}}new al("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new al("selection",{init(n,e){return n.selection||he.atStart(e.doc)},apply(n){return n.selection}}),new al("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new al("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function eg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=eg(i,e,{})),t[r]=i}return t}class wt{constructor(e){this.spec=e,this.props={},e.props&&eg(e.props,this,this.props),this.key=e.key?e.key.key:tg("plugin")}getState(e){return e[this.key]}}const hc=Object.create(null);function tg(n){return n in hc?n+"$"+ ++hc[n]:(hc[n]=0,n+"$")}class Gt{constructor(e="key"){this.key=tg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const xs=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},ng=function(n,e,t,r){return t&&(rg(n,e,t,r,-1)||rg(n,e,t,r,1))},zC=/^(img|br|input|textarea|hr)$/i;function rg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ul(n))){let o=n.parentNode;if(!o||o.nodeType!=1||WC(n)||zC.test(n.nodeName)||n.contentEditable=="false")return!1;e=xs(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?ul(n):0}else return!1}}function ul(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function VC(n,e,t){for(let r=e==0,i=e==ul(n);r||i;){if(n==t)return!0;let o=xs(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==ul(n)}}function WC(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ig=function(n){return n.focusNode&&ng(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function sg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const jn=typeof navigator<"u"?navigator:null,og=typeof document<"u"?document:null,Jn=jn&&jn.userAgent||"",dc=/Edge\/(\d+)/.exec(Jn),lg=/MSIE \d/.exec(Jn),pc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jn),Es=!!(lg||pc||dc),ag=lg?document.documentMode:pc?+pc[1]:dc?+dc[1]:0,cl=!Es&&/gecko\/(\d+)/i.test(Jn);cl&&+(/Firefox\/(\d+)/.exec(Jn)||[0,0])[1];const mc=!Es&&/Chrome\/(\d+)/.exec(Jn),wi=!!mc,UC=mc?+mc[1]:0,Tr=!Es&&!!jn&&/Apple Computer/.test(jn.vendor),gc=Tr&&(/Mobile\/\w+/.test(Jn)||!!jn&&jn.maxTouchPoints>2),Rt=gc||(jn?/Mac/.test(jn.platform):!1),ks=/Android \d/.test(Jn),yc=!!og&&"webkitFontSmoothing"in og.documentElement.style,KC=yc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function qC(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let u=r.resolve(a),f,d;if(ig(t)){for(f=u;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&Y.isSelectable(p)&&i.parent&&!(p.isInline&&VC(t.focusNode,t.focusOffset,i.dom))){let m=i.posBefore;d=new Y(a==m?u:r.resolve(m))}}else{let p=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(p<0)return null;f=r.resolve(p)}if(!d){let p=e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1;d=pg(n,f,u,p)}return d}function ug(n){return n.editable?n.hasFocus():YC(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function bc(n,e=!1){let t=n.state.selection;if(JC(n,t),!!ug(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&wi){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ng(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)jC(n);else{let{anchor:r,head:i}=t,o,a;cg&&!(t instanceof de)&&(t.$from.parent.inlineContent||(o=fg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=fg(n,t.to))),n.docView.setSelection(r,i,n.root,e),cg&&(o&&hg(o),a&&hg(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&GC(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const cg=Tr||wi&&UC<63;function fg(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Tr&&i&&i.contentEditable=="false")return _c(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return _c(i);if(o)return _c(o)}}function _c(n){return n.contentEditable="true",Tr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function hg(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function GC(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!ug(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function jC(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,xs(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Es&&ag<=11&&(r.disabled=!0,r.disabled=!1)}function JC(n,e){if(e instanceof Y){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(dg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else dg(n)}function dg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function pg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||de.between(e,t,r)}function YC(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function vc(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&he.findFrom(o,e)}function Mr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function mg(n,e,t){let r=n.state.selection;if(r instanceof de){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=vc(n.state,e);return i&&i instanceof Y?Mr(n,i):!1}else if(!(Rt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(u))&&!a.contentDOM?Y.isSelectable(o)?Mr(n,new Y(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):yc?Mr(n,new de(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Y&&r.node.isInline)return Mr(n,new de(e>0?r.$to:r.$from));{let i=vc(n.state,e);return i?Mr(n,i):!1}}}function fl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Cs(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function wc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(cl&&t.nodeType==1&&r<fl(t)&&Cs(t.childNodes[r])&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Cs(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(gg(t))break;{let u=t.previousSibling;for(;u&&Cs(u);)i=t.parentNode,o=xs(u),u=u.previousSibling;if(u)t=u,r=fl(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?xc(n,t,r):i&&xc(n,i,o)}function Sc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=fl(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Cs(u))o=t,a=++r;else break}else{if(gg(t))break;{let u=t.nextSibling;for(;u&&Cs(u);)o=u.parentNode,a=xs(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=fl(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&xc(n,o,a)}function gg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function xc(n,e,t){let r=n.domSelection();if(ig(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&bc(n)},50)}function yg(n,e,t){let r=n.state.selection;if(r instanceof de&&!r.empty||t.indexOf("s")>-1||Rt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=vc(n.state,e);if(a&&a instanceof Y)return Mr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,u=r instanceof Yt?he.near(a,e):he.findFrom(a,e);return u?Mr(n,u):!1}return!1}function bg(n,e){if(!(n.state.selection instanceof de))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function _g(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function XC(n){if(!Tr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;_g(n,r,"true"),setTimeout(()=>_g(n,r,"false"),20)}return!1}function ZC(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function QC(n,e){let t=e.keyCode,r=ZC(e);return t==8||Rt&&t==72&&r=="c"?bg(n,-1)||wc(n):t==46||Rt&&t==68&&r=="c"?bg(n,1)||Sc(n):t==13||t==27?!0:t==37||Rt&&t==66&&r=="c"?mg(n,-1,r)||wc(n):t==39||Rt&&t==70&&r=="c"?mg(n,1,r)||Sc(n):t==38||Rt&&t==80&&r=="c"?yg(n,-1,r)||wc(n):t==40||Rt&&t==78&&r=="c"?XC(n)||yg(n,1,r)||Sc(n):r==(Rt?"m":"c")&&(t==66||t==73||t==89||t==90)}function vg(n,e){n.someProp("transformCopied",v=>{e=v(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let v=r.firstChild;t.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),r=v.content}let a=n.someProp("clipboardSerializer")||Wr.fromSchema(n.state.schema),u=Og(),f=u.createElement("div");f.appendChild(a.serializeFragment(r,{document:u}));let d=f.firstChild,p,m=0;for(;d&&d.nodeType==1&&(p=Cg[d.nodeName.toLowerCase()]);){for(let v=p.length-1;v>=0;v--){let S=u.createElement(p[v]);for(;f.firstChild;)S.appendChild(f.firstChild);f.appendChild(S),m++}d=f.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${m?` -${m}`:""} ${JSON.stringify(t)}`);let y=n.someProp("clipboardTextSerializer",v=>v(e,n))||e.content.textBetween(0,e.content.size,`
|
|
24
|
+
`,...BE(i)),console.warn(...o)}zo(),Ku=!1}function FE(){let n=Cr[Cr.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const r=n.component&&n.component.parent;n=r&&r.vnode}return e}function BE(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
|
|
25
|
+
`],...HE(t))}),e}function HE({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${cm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...$E(n.props),o]:[i+o]}function $E(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Vp(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Vp(n,e,t){return Yt(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:Ge(e)?(e=Vp(n,ce(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Le(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ce(e),t?e:[`${n}=`,e])}const Wp={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Yo(n,e,t,r){try{return r?n(...r):n()}catch(i){Gu(i,e,t)}}function Up(n,e,t,r){if(Le(n)){const i=Yo(n,e,t,r);return i&&Gx(i)&&i.catch(o=>{Gu(o,e,t)}),i}if(Ce(n)){const i=[];for(let o=0;o<n.length;o++)i.push(Up(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&Oe(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Gu(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:l}=e&&e.appContext.config||Ft;if(e){let u=e.parent;const f=e.proxy,d=process.env.NODE_ENV!=="production"?Wp[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const g=u.ec;if(g){for(let p=0;p<g.length;p++)if(g[p](n,f,d)===!1)return}u=u.parent}if(o){$o(),Yo(o,null,10,[n,f,d]),zo();return}}zE(n,t,i,r,l)}function zE(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=Wp[e];if(t&&PE(t),Oe(`Unhandled error${o?` during execution of ${o}`:""}`),t&&DE(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Bt=[];let Ln=-1;const mi=[];let Xn=null,gi=0;const qp=Promise.resolve();let Xo=null;const VE=100;function WE(n){const e=Xo||qp;return n?e.then(this?n.bind(this):n):e}function UE(n){let e=Ln+1,t=Bt.length;for(;e<t;){const r=e+t>>>1,i=Bt[r],o=gs(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function ju(n){if(!(n.flags&1)){const e=gs(n),t=Bt[Bt.length-1];!t||!(n.flags&2)&&e>=gs(t)?Bt.push(n):Bt.splice(UE(e),0,n),n.flags|=1,Kp()}}function Kp(){Xo||(Xo=qp.then(jp))}function Gp(n){Ce(n)?mi.push(...n):Xn&&n.id===-1?Xn.splice(gi+1,0,n):n.flags&1||(mi.push(n),n.flags|=1),Kp()}function qE(n){if(mi.length){const e=[...new Set(mi)].sort((t,r)=>gs(t)-gs(r));if(mi.length=0,Xn){Xn.push(...e);return}for(Xn=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),gi=0;gi<Xn.length;gi++){const t=Xn[gi];process.env.NODE_ENV!=="production"&&Jp(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}Xn=null,gi=0}}const gs=n=>n.id==null?n.flags&2?-1:1/0:n.id;function jp(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>Jp(n,t):xr;try{for(Ln=0;Ln<Bt.length;Ln++){const t=Bt[Ln];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),Yo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Ln<Bt.length;Ln++){const t=Bt[Ln];t&&(t.flags&=-2)}Ln=-1,Bt.length=0,qE(n),Xo=null,(Bt.length||mi.length)&&jp(n)}}function Jp(n,e){const t=n.get(e)||0;if(t>VE){const r=e.i,i=r&&um(r.type);return Gu(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return n.set(e,t+1),!1}const Ju=new Map;process.env.NODE_ENV!=="production"&&(Ho().__VUE_HMR_RUNTIME__={createRecord:Yu(KE),rerender:Yu(GE),reload:Yu(jE)});const Zo=new Map;function KE(n,e){return Zo.has(n)?!1:(Zo.set(n,{initialDef:Qo(e),instances:new Set}),!0)}function Qo(n){return fm(n)?n.__vccOpts:n}function GE(n,e){const t=Zo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Qo(r.type).render=e),r.renderCache=[],r.update()}))}function jE(n,e){const t=Zo.get(n);if(!t)return;e=Qo(e),Yp(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],l=Qo(o.type);let u=Ju.get(l);u||(l!==t.initialDef&&Yp(l,e),Ju.set(l,u=new Set)),u.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(u.add(o),o.ceReload(e.styles),u.delete(o)):o.parent?ju(()=>{o.parent.update(),u.delete(o)}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(l)}Gp(()=>{Ju.clear()})}function Yp(n,e){kt(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Yu(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let yi,ea=[];function Xp(n,e){var t,r;yi=n,yi?(yi.enabled=!0,ea.forEach(({event:i,args:o})=>yi.emit(i,...o)),ea=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{Xp(o,e)}),setTimeout(()=>{yi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ea=[])},3e3)):ea=[]}let un=null,JE=null;const YE=n=>n.__isTeleport;function Zp(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Zp(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Ho().requestIdleCallback,Ho().cancelIdleCallback;const XE=Symbol.for("v-ndc"),Xu=n=>n?Ak(n)?Ok(n):Xu(n.parent):null,ys=kt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?qo(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?qo(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?qo(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?qo(n.refs):n.refs,$parent:n=>Xu(n.parent),$root:n=>Xu(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?tk(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{ju(n.update)}),$nextTick:n=>n.n||(n.n=WE.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?hk.bind(n):xr}),ZE=n=>n==="_"||n==="$",Zu=(n,e)=>n!==Ft&&!n.__isScriptSetup&&Re(n,e),QE={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:r,data:i,props:o,accessCache:l,type:u,appContext:f}=n;if(process.env.NODE_ENV!=="production"&&e==="__isVue")return!0;let d;if(e[0]!=="$"){const S=l[e];if(S!==void 0)switch(S){case 1:return r[e];case 2:return i[e];case 4:return t[e];case 3:return o[e]}else{if(Zu(r,e))return l[e]=1,r[e];if(i!==Ft&&Re(i,e))return l[e]=2,i[e];if((d=n.propsOptions[0])&&Re(d,e))return l[e]=3,o[e];if(t!==Ft&&Re(t,e))return l[e]=4,t[e];(!__VUE_OPTIONS_API__||ek)&&(l[e]=0)}}const g=ys[e];let p,_;if(g)return e==="$attrs"?($e(n.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&$e(n,"get",e),g(n);if((p=u.__cssModules)&&(p=p[e]))return p;if(t!==Ft&&Re(t,e))return l[e]=4,t[e];if(_=f.config.globalProperties,Re(_,e))return _[e];process.env.NODE_ENV!=="production"&&un&&(!Yt(e)||e.indexOf("__v")!==0)&&(i!==Ft&&ZE(e[0])&&Re(i,e)?Oe(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):n===un&&Oe(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:n},e,t){const{data:r,setupState:i,ctx:o}=n;return Zu(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Re(i,e)?(Oe(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==Ft&&Re(r,e)?(r[e]=t,!0):Re(n.props,e)?(process.env.NODE_ENV!=="production"&&Oe(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Oe(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&e in n.appContext.config.globalProperties?Object.defineProperty(o,e,{enumerable:!0,configurable:!0,value:t}):o[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:r,appContext:i,propsOptions:o}},l){let u;return!!t[l]||n!==Ft&&Re(n,l)||Zu(e,l)||(u=o[0])&&Re(u,l)||Re(r,l)||Re(ys,l)||Re(i.config.globalProperties,l)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Re(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(QE.ownKeys=n=>(Oe("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));function Qp(n){return Ce(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let ek=!0;function tk(n){const e=n.type,{mixins:t,extends:r}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:l}}=n.appContext,u=o.get(e);let f;return u?f=u:!i.length&&!t&&!r?f=e:(f={},i.length&&i.forEach(d=>ta(f,d,l,!0)),ta(f,e,l)),lt(e)&&o.set(e,f),f}function ta(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&ta(n,o,t,!0),i&&i.forEach(l=>ta(n,l,t,!0));for(const l in e)if(r&&l==="expose")process.env.NODE_ENV!=="production"&&Oe('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=nk[l]||t&&t[l];n[l]=u?u(n[l],e[l]):e[l]}return n}const nk={data:em,props:nm,emits:nm,methods:bs,computed:bs,beforeCreate:ct,created:ct,beforeMount:ct,mounted:ct,beforeUpdate:ct,updated:ct,beforeDestroy:ct,beforeUnmount:ct,destroyed:ct,unmounted:ct,activated:ct,deactivated:ct,errorCaptured:ct,serverPrefetch:ct,components:bs,directives:bs,watch:ik,provide:em,inject:rk};function em(n,e){return e?n?function(){return kt(Le(n)?n.call(this,this):n,Le(e)?e.call(this,this):e)}:e:n}function rk(n,e){return bs(tm(n),tm(e))}function tm(n){if(Ce(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function ct(n,e){return n?[...new Set([].concat(n,e))]:e}function bs(n,e){return n?kt(Object.create(null),n,e):e}function nm(n,e){return n?Ce(n)&&Ce(e)?[...new Set([...n,...e])]:kt(Object.create(null),Qp(n),Qp(e??{})):e}function ik(n,e){if(!n)return e;if(!e)return n;const t=kt(Object.create(null),n);for(const r in e)t[r]=ct(n[r],e[r]);return t}let sk=null;function ok(n,e,t=!1){const r=_s||un;if(r||sk){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Le(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Oe(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Oe("inject() can only be used inside setup() or functional components.")}const ak={},rm=n=>Object.getPrototypeOf(n)===ak,lk=mk,uk=Symbol.for("v-scx"),ck=()=>{{const n=ok(uk);return n||process.env.NODE_ENV!=="production"&&Oe("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function fk(n,e,t){return process.env.NODE_ENV!=="production"&&!Le(e)&&Oe("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),im(n,e,t)}function im(n,e,t=Ft){const{immediate:r,deep:i,flush:o,once:l}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&Oe('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&Oe('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),l!==void 0&&Oe('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=kt({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=Oe);const f=e&&r||!e&&o!=="post";let d;if(ia){if(o==="sync"){const S=ck();d=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){const S=()=>{};return S.stop=xr,S.resume=xr,S.pause=xr,S}}const g=_s;u.call=(S,k,m)=>Up(S,g,k,m);let p=!1;o==="post"?u.scheduler=S=>{lk(S,g&&g.suspense)}:o!=="sync"&&(p=!0,u.scheduler=(S,k)=>{k?S():ju(S)}),u.augmentJob=S=>{e&&(S.flags|=4),p&&(S.flags|=2,g&&(S.id=g.uid,S.i=g))};const _=LE(n,e,u);return ia&&(d?d.push(_):f&&_()),_}function hk(n,e,t){const r=this.proxy,i=Yt(n)?n.includes(".")?dk(r,n):()=>r[n]:n.bind(r,r);let o;Le(e)?o=e:(o=e.handler,t=e);const l=Ck(this),u=im(i,o.bind(r),t);return l(),u}function dk(n,e){const t=e.split(".");return()=>{let r=n;for(let i=0;i<t.length&&r;i++)r=r[t[i]];return r}}function II(){}const pk=n=>n.__isSuspense;function mk(n,e){e&&e.pendingBranch?Ce(n)?e.effects.push(...n):e.effects.push(n):Gp(n)}const sm=Symbol.for("v-fgt"),gk=Symbol.for("v-txt"),yk=Symbol.for("v-cmt");let bi=null;function bk(n){return n?n.__v_isVNode===!0:!1}const _k=(...n)=>am(...n),om=({key:n})=>n??null,na=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Yt(n)||Ge(n)||Le(n)?{i:un,r:n,k:e,f:!!t}:n:null);function vk(n,e=null,t=null,r=0,i=null,o=n===sm?0:1,l=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&om(e),ref:e&&na(e),scopeId:JE,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:un};return u?(Qu(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Yt(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Oe("VNode created with invalid key (NaN). VNode type:",f.type),!l&&bi&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&bi.push(f),f}const wk=process.env.NODE_ENV!=="production"?_k:am;function am(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===XE)&&(process.env.NODE_ENV!=="production"&&!n&&Oe(`Invalid vnode type when creating vnode: ${n}.`),n=yk),bk(n)){const u=ra(n,e,!0);return t&&Qu(u,t),!o&&bi&&(u.shapeFlag&6?bi[bi.indexOf(n)]=u:bi.push(u)),u.patchFlag=-2,u}if(fm(n)&&(n=n.__vccOpts),e){e=Sk(e);let{class:u,style:f}=e;u&&!Yt(u)&&(e.class=Mu(u)),lt(f)&&(Ko(f)&&!Ce(f)&&(f=kt({},f)),e.style=Tu(f))}const l=Yt(n)?1:pk(n)?128:YE(n)?64:lt(n)?4:Le(n)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&Ko(n)&&(n=ce(n),Oe("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
26
|
+
Component that was made reactive: `,n)),vk(n,e,t,r,i,l,o,!0)}function Sk(n){return n?Ko(n)||rm(n)?kt({},n):n:null}function ra(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:l,children:u,transition:f}=n,d=e?Ek(i||{},e):i,g={__v_isVNode:!0,__v_skip:!0,type:n.type,props:d,key:d&&om(d),ref:e&&e.ref?t&&o?Ce(o)?o.concat(na(e)):[o,na(e)]:na(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Ce(u)?u.map(lm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==sm?l===-1?16:l|16:l,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:f,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ra(n.ssContent),ssFallback:n.ssFallback&&ra(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&Zp(g,f.clone(g)),g}function lm(n){const e=ra(n);return Ce(n.children)&&(e.children=n.children.map(lm)),e}function xk(n=" ",e=0){return wk(gk,null,n,e)}function Qu(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Ce(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Qu(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!rm(e)?e._ctx=un:i===3&&un&&(un.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Le(e)?(e={default:e,_ctx:un},t=32):(e=String(e),r&64?(t=16,e=[xk(e)]):t=8);n.children=e,n.shapeFlag|=t}function Ek(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=Mu([e.class,r.class]));else if(i==="style")e.style=Tu([e.style,r.style]);else if(Ux(i)){const o=e[i],l=r[i];l&&o!==l&&!(Ce(o)&&o.includes(l))&&(e[i]=o?[].concat(o,l):l)}else i!==""&&(e[i]=r[i])}return e}let _s=null;const kk=()=>_s||un;let ec;{const n=Ho(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(l=>l(o)):i[0](o)}};ec=e("__VUE_INSTANCE_SETTERS__",t=>_s=t),e("__VUE_SSR_SETTERS__",t=>ia=t)}const Ck=n=>{const e=_s;return ec(n),n.scope.on(),()=>{n.scope.off(),ec(e)}};function Ak(n){return n.vnode.shapeFlag&4}let ia=!1;process.env.NODE_ENV;function Ok(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(AE(xE(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in ys)return ys[t](n)},has(e,t){return t in e||t in ys}})):n.proxy}const Tk=/(?:^|[-_])(\w)/g,Mk=n=>n.replace(Tk,e=>e.toUpperCase()).replace(/[-_]/g,"");function um(n,e=!0){return Le(n)?n.displayName||n.name:n.name||e&&n.__name}function cm(n,e,t=!1){let r=um(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=o=>{for(const l in o)if(o[l]===e)return l};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?Mk(r):t?"App":"Anonymous"}function fm(n){return Le(n)&&"__vccOpts"in n}const de=(n,e)=>{const t=NE(n,e,ia);if(process.env.NODE_ENV!=="production"){const r=kk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function Ik(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(p){return lt(p)?p.__isVue?["div",n,"VueInstance"]:Ge(p)?["div",{},["span",n,g(p)],"<",u("_value"in p?p._value:p),">"]:di(p)?["div",{},["span",n,gt(p)?"ShallowReactive":"Reactive"],"<",u(p),`>${Rn(p)?" (readonly)":""}`]:Rn(p)?["div",{},["span",n,gt(p)?"ShallowReadonly":"Readonly"],"<",u(p),">"]:null:null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const _=[];p.type.props&&p.props&&_.push(l("props",ce(p.props))),p.setupState!==Ft&&_.push(l("setup",p.setupState)),p.data!==Ft&&_.push(l("data",ce(p.data)));const S=f(p,"computed");S&&_.push(l("computed",S));const k=f(p,"inject");return k&&_.push(l("injected",k)),_.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),_}function l(p,_){return _=kt({},_),Object.keys(_).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(_).map(S=>["div",{},["span",r,S+": "],u(_[S],!1)])]]:["span",{}]}function u(p,_=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:lt(p)?["object",{object:_?ce(p):p}]:["span",t,String(p)]}function f(p,_){const S=p.type;if(Le(S))return;const k={};for(const m in p.ctx)d(S,m,_)&&(k[m]=p.ctx[m]);return k}function d(p,_,S){const k=p[S];if(Ce(k)&&k.includes(_)||lt(k)&&_ in k||p.extends&&d(p.extends,_,S)||p.mixins&&p.mixins.some(m=>d(m,_,S)))return!0}function g(p){return gt(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Nk(){Ik()}process.env.NODE_ENV!=="production"&&Nk();function je(n){this.content=n}je.prototype={constructor:je,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new je(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new je(t)},addToStart:function(n,e){return new je([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new je(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new je(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=je.from(n),n.size?new je(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=je.from(n),n.size?new je(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=je.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},get size(){return this.content.length>>1}},je.from=function(n){if(n instanceof je)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new je(e)};function hm(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let l=0;i.text[l]==o.text[l];l++)t++;return t}if(i.content.size||o.content.size){let l=hm(i.content,o.content,t+1);if(l!=null)return l}t+=i.nodeSize}}function dm(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let l=n.child(--i),u=e.child(--o),f=l.nodeSize;if(l==u){t-=f,r-=f;continue}if(!l.sameMarkup(u))return{a:t,b:r};if(l.isText&&l.text!=u.text){let d=0,g=Math.min(l.text.length,u.text.length);for(;d<g&&l.text[l.text.length-d-1]==u.text[u.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(l.content.size||u.content.size){let d=dm(l.content,u.content,t-1,r-1);if(d)return d}t-=f,r-=f}}class B{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let l=0,u=0;u<t;l++){let f=this.content[l],d=u+f.nodeSize;if(d>e&&r(f,i+u,o||null,l)!==!1&&f.content.size){let g=u+1;f.nodesBetween(Math.max(0,e-g),Math.min(f.content.size,t-g),r,i+g)}u=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",l=!0;return this.nodesBetween(e,t,(u,f)=>{u.isText?(o+=u.text.slice(Math.max(e,f)-f,t-f),l=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),l=!r):!l&&u.isBlock&&(o+=r,l=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new B(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,l=0;l<t;o++){let u=this.content[o],f=l+u.nodeSize;f>e&&((l<e||f>t)&&(u.isText?u=u.cut(Math.max(0,e-l),Math.min(u.text.length,t-l)):u=u.cut(Math.max(0,e-l-1),Math.min(u.content.size,t-l-1))),r.push(u),i+=u.nodeSize),l=f}return new B(r,i)}cutByIndex(e,t){return e==t?B.empty:e==0&&t==this.content.length?this:new B(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new B(i,o)}addToStart(e){return new B([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new B(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return hm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return dm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return sa(0,e);if(e==this.size)return sa(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),l=i+o.nodeSize;if(l>=e)return l==e||t>0?sa(r+1,l):sa(r,i);i=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return B.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return B.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new B(t||e,r)}static from(e){if(!e)return B.empty;if(e instanceof B)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new B([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const tc={index:0,offset:0};function sa(n,e){return tc.index=n,tc.offset=e,tc}function oa(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!oa(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!oa(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Ee=class Af{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&oa(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Af.none;if(e instanceof Af)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Ee.none=[];class aa extends Error{}class K{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=mm(this.content,e+this.openStart,t);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,t){return new K(pm(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return K.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(B.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new K(e,r,i)}}K.empty=new K(B.empty,0,0);function pm(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:l,offset:u}=n.findIndex(t);if(i==e||o.isText){if(u!=t&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(pm(o.content,e-i-1,t-i-1)))}function mm(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),l=n.maybeChild(i);if(o==e||l.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=mm(l.content,e-o-1,t);return u&&n.replaceChild(i,l.copy(u))}function Rk(n,e,t){if(t.openStart>n.depth)throw new aa("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new aa("Inconsistent open depths");return gm(n,e,t,0)}function gm(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let l=gm(n,e,t,r+1);return o.copy(o.content.replaceChild(i,l))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let l=n.parent,u=l.content;return Or(l,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:l,end:u}=Lk(t,n);return Or(o,bm(n,l,u,e,r))}else return Or(o,la(n,e,r))}function ym(n,e){if(!e.type.compatibleContent(n.type))throw new aa("Cannot join "+e.type.name+" onto "+n.type.name)}function nc(n,e,t){let r=n.node(t);return ym(r,e.node(t)),r}function Ar(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function vs(n,e,t,r){let i=(e||n).node(t),o=0,l=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Ar(n.nodeAfter,r),o++));for(let u=o;u<l;u++)Ar(i.child(u),r);e&&e.depth==t&&e.textOffset&&Ar(e.nodeBefore,r)}function Or(n,e){return n.type.checkContent(e),n.copy(e)}function bm(n,e,t,r,i){let o=n.depth>i&&nc(n,e,i+1),l=r.depth>i&&nc(t,r,i+1),u=[];return vs(null,n,i,u),o&&l&&e.index(i)==t.index(i)?(ym(o,l),Ar(Or(o,bm(n,e,t,r,i+1)),u)):(o&&Ar(Or(o,la(n,e,i+1)),u),vs(e,t,i,u),l&&Ar(Or(l,la(t,r,i+1)),u)),vs(r,null,i,u),new B(u)}function la(n,e,t){let r=[];if(vs(null,n,t,r),n.depth>t){let i=nc(n,e,t+1);Ar(Or(i,la(n,e,t+1)),r)}return vs(e,null,t,r),new B(r)}function Lk(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(B.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Bs{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Ee.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var l=0;l<o.length;l++)o[l].type.spec.inclusive===!1&&(!i||!o[l].isInSet(i.marks))&&(o=o[l--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ua(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let l=e;;){let{index:u,offset:f}=l.content.findIndex(o),d=o-f;if(r.push(l,u,i+f),!d||(l=l.child(u),l.isText))break;o=d-1,i+=f+1}return new Bs(t,r,o)}static resolveCached(e,t){for(let i=0;i<rc.length;i++){let o=rc[i];if(o.pos==t&&o.doc==e)return o}let r=rc[ic]=Bs.resolve(e,t);return ic=(ic+1)%Pk,r}}let rc=[],ic=0,Pk=12;class ua{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Dk=Object.create(null);let Tr=class Of{constructor(e,t,r,i=Ee.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||B.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&oa(this.attrs,t||e.defaultAttrs||Dk)&&Ee.sameSet(this.marks,r||Ee.none)}copy(e=null){return e==this.content?this:new Of(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Of(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return K.empty;let i=this.resolve(e),o=this.resolve(t),l=r?0:i.sharedDepth(t),u=i.start(l),d=i.node(l).content.cut(i.pos-u,o.pos-u);return new K(d,i.depth-l,o.depth-l)}replace(e,t,r){return Rk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Bs.resolveCached(this,e)}resolveNoCache(e){return Bs.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),_m(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=B.empty,i=0,o=r.childCount){let l=this.contentMatchAt(e).matchFragment(r,i,o),u=l&&l.matchFragment(this.content,t);if(!u||!u.validEnd)return!1;for(let f=i;f<o;f++)if(!this.type.allowsMarks(r.child(f).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),l=o&&o.matchFragment(this.content,t);return l?l.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Ee.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Ee.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=B.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Tr.prototype.text=void 0;class Qa extends Tr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):_m(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Qa(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Qa(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function _m(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Vr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Fk(e,t);if(r.next==null)return Vr.empty;let i=vm(r);r.next&&r.err("Unexpected trailing text");let o=Uk(Wk(i));return qk(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(l,u){let f=l.matchFragment(e,r);if(f&&(!t||f.validEnd))return B.from(u.map(d=>d.createAndFill()));for(let d=0;d<l.next.length;d++){let{type:g,next:p}=l.next[d];if(!(g.isText||g.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let _=o(p,u.concat(g));if(_)return _}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let l=[];for(let u=i;u.type;u=u.via)l.push(u.type);return l.reverse()}for(let l=0;l<o.next.length;l++){let{type:u,next:f}=o.next[l];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in t)&&(!i.type||f.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),t[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let l=0;l<r.next.length;l++)o+=(l?", ":"")+r.next[l].type.name+"->"+e.indexOf(r.next[l].next);return o}).join(`
|
|
27
|
+
`)}}Vr.empty=new Vr(!0);class Fk{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function vm(n){let e=[];do e.push(Bk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Bk(n){let e=[];do e.push(Hk(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Hk(n){let e=Vk(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=$k(n,e);else break;return e}function wm(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function $k(n,e){let t=wm(n),r=t;return n.eat(",")&&(n.next!="}"?r=wm(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function zk(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let l=t[o];l.groups.indexOf(e)>-1&&i.push(l)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Vk(n){if(n.eat("(")){let e=vm(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=zk(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Wk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(l,u,f){let d={term:f,to:u};return e[l].push(d),d}function i(l,u){l.forEach(f=>f.to=u)}function o(l,u){if(l.type=="choice")return l.exprs.reduce((f,d)=>f.concat(o(d,u)),[]);if(l.type=="seq")for(let f=0;;f++){let d=o(l.exprs[f],u);if(f==l.exprs.length-1)return d;i(d,u=t())}else if(l.type=="star"){let f=t();return r(u,f),i(o(l.expr,f),f),[r(f)]}else if(l.type=="plus"){let f=t();return i(o(l.expr,u),f),i(o(l.expr,f),f),[r(f)]}else{if(l.type=="opt")return[r(u)].concat(o(l.expr,u));if(l.type=="range"){let f=u;for(let d=0;d<l.min;d++){let g=t();i(o(l.expr,f),g),f=g}if(l.max==-1)i(o(l.expr,f),f);else for(let d=l.min;d<l.max;d++){let g=t();r(f,g),i(o(l.expr,f),g),f=g}return[r(f)]}else{if(l.type=="name")return[r(u,void 0,l.value)];throw new Error("Unknown expr type")}}}}function Sm(n,e){return e-n}function xm(n,e){let t=[];return r(e),t.sort(Sm);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let l=0;l<o.length;l++){let{term:u,to:f}=o[l];!u&&t.indexOf(f)==-1&&r(f)}}}function Uk(n){let e=Object.create(null);return t(xm(n,0));function t(r){let i=[];r.forEach(l=>{n[l].forEach(({term:u,to:f})=>{if(!u)return;let d;for(let g=0;g<i.length;g++)i[g][0]==u&&(d=i[g][1]);xm(n,f).forEach(g=>{d||i.push([u,d=[]]),d.indexOf(g)==-1&&d.push(g)})})});let o=e[r.join(",")]=new Vr(r.indexOf(n.length-1)>-1);for(let l=0;l<i.length;l++){let u=i[l][1].sort(Sm);o.next.push({type:i[l][0],next:e[u.join(",")]||t(u)})}return o}}function qk(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,l=[];for(let u=0;u<i.next.length;u++){let{type:f,next:d}=i.next[u];l.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Em(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function km(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Cm(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new Kk(n[t]);return e}let Am=class U0{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Cm(r.attrs),this.defaultAttrs=Em(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Vr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:km(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Tr(this,this.computeAttrs(e),B.from(t),Ee.setFrom(r))}createChecked(e=null,t,r){return t=B.from(t),this.checkContent(t),new Tr(this,this.computeAttrs(e),t,Ee.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=B.from(t),t.size){let l=this.contentMatch.fillBefore(t);if(!l)return null;t=l.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(B.empty,!0);return o?new Tr(this,e,t.append(o),Ee.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Ee.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,l)=>r[o]=new U0(o,t,l));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Kk{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class el{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Cm(i.attrs),this.excluded=null;let o=Em(this.attrs);this.instance=o?new Ee(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ee(this,km(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,l)=>r[o]=new el(o,i++,t,l)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Gk{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=je.from(e.nodes),t.marks=je.from(e.marks||{}),this.nodes=Am.compile(this.spec.nodes,this),this.marks=el.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],l=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[l]||(r[l]=Vr.parse(l,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?Om(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],l=o.spec.excludes;o.excluded=l==null?[o]:l==""?[]:Om(this,l.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Am){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Qa(r,r.defaultAttrs,e,Ee.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Tr.fromJSON(this,e)}markFromJSON(e){return Ee.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Om(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],l=o;if(o)t.push(o);else for(let u in n.marks){let f=n.marks[u];(i=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(i)>-1)&&t.push(l=f)}if(!l)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let sc=class Tf{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Nm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Nm(this,t,!0);return r.addAll(e,t.from,t.to),K.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(Yk(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let l=o.getAttrs(e);if(l===!1)continue;o.attrs=l||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let l=this.styles[o],u=l.style;if(!(u.indexOf(e)!=0||l.context&&!r.matchesContext(l.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(l.getAttrs){let f=l.getAttrs(t);if(f===!1)continue;l.attrs=f||void 0}return l}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,l=0;for(;l<t.length;l++){let u=t[l];if((u.priority==null?50:u.priority)<o)break}t.splice(l,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(l=>{r(l=Rm(l)),l.mark||l.ignore||l.clearMark||(l.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(l=>{r(l=Rm(l)),l.node||l.ignore||l.mark||(l.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Tf(e,Tf.schemaRules(e)))}};const Tm={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},jk={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Mm={ol:!0,ul:!0},ca=1,fa=2,ws=4;function Im(n,e,t){return e!=null?(e?ca:0)|(e==="full"?fa:0):n&&n.whitespace=="pre"?ca|fa:t&~ws}class ha{constructor(e,t,r,i,o,l,u){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=Ee.none,this.stashMarks=[],this.match=l||(u&ws?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(B.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ca)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=B.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(B.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):Zk(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Tm.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Nm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,l=Im(null,t.preserveWhitespace,0)|(r?ws:0);i?o=new ha(i.type,i.attrs,Ee.none,Ee.none,!0,t.topMatch||i.type.contentMatch,l):r?o=new ha(null,null,Ee.none,Ee.none,!0,null,l):o=new ha(e.schema.topNodeType,null,Ee.none,Ee.none,!0,null,l),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let t=e.getAttribute("style");if(!t)this.addElement(e);else{let r=this.readStyles(Xk(t));if(!r)return;let[i,o]=r,l=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],l);for(let u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(e);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],l);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&fa||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&ca)r.options&fa?t=t.replace(/\r\n?/g,`
|
|
28
|
+
`):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;Mm.hasOwnProperty(r)&&this.parser.normalizeLists&&Jk(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:jk.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let l,u=this.top,f=this.needsBlock;if(Tm.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),l=!0,u.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),l&&this.sync(u),this.needsBlock=f}else this.addElementByRule(e,o,o.consuming===!1?i:void 0)}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
29
|
+
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Ee.none,r=Ee.none;e:for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let l=this.parser.matchStyle(e[i],e[i+1],this,o);if(!l)continue e;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.forEach(u=>{l.clearMark(u)&&(r=u.addToSet(r))}):t=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(t),l.consuming===!1)o=l;else break}return[t,r]}addElementByRule(e,t,r){let i,o,l;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(l=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(l));let u=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f));else{let f=e;typeof t.contentElement=="string"?f=e.querySelector(t.contentElement):typeof t.contentElement=="function"?f=t.contentElement(e):t.contentElement&&(f=t.contentElement),this.findAround(e,f,!0),this.addAll(f)}i&&this.sync(u)&&this.open--,l&&this.removePendingMark(l,u)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,l=r==null?null:e.childNodes[r];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],l=o.findWrapping(e);if(l&&(!t||t.length>l.length)&&(t=l,r=o,!l.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let l=Im(e,i,o.options);o.options&ws&&o.content.length==0&&(l|=ws),this.nodes.push(new ha(e,t,o.activeMarks,o.pendingMarks,r,null,l)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),l=(u,f)=>{for(;u>=0;u--){let d=t[u];if(d==""){if(u==t.length-1||u==0)continue;for(;f>=o;f--)if(l(u-1,f))return!0;return!1}else{let g=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!g||g.name!=d&&g.groups.indexOf(d)==-1)return!1;f--}}return!0};return l(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=Qk(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let l=i.popFromStashMark(e);l&&i.type&&i.type.allowsMarkType(l.type)&&(i.activeMarks=l.addToSet(i.activeMarks))}if(i==t)break}}}function Jk(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Mm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Yk(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Xk(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function Rm(n){let e={};for(let t in n)e[t]=n[t];return e}function Zk(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],l=u=>{o.push(u);for(let f=0;f<u.edgeCount;f++){let{type:d,next:g}=u.edge(f);if(d==e||o.indexOf(g)<0&&l(g))return!0}};if(l(i.contentMatch))return!0}}function Qk(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class Ur{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=oc(t).createDocumentFragment());let i=r,o=[];return e.forEach(l=>{if(o.length||l.marks.length){let u=0,f=0;for(;u<o.length&&f<l.marks.length;){let d=l.marks[f];if(!this.marks[d.type.name]){f++;continue}if(!d.eq(o[u][0])||d.type.spec.spanning===!1)break;u++,f++}for(;u<o.length;)i=o.pop()[1];for(;f<l.marks.length;){let d=l.marks[f++],g=this.serializeMark(d,l.isInline,t);g&&(o.push([d,i]),i.appendChild(g.dom),i=g.contentDOM||g.dom)}}i.appendChild(this.serializeNodeInner(l,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Ur.renderSpec(oc(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Ur.renderSpec(oc(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let l,u=r?e.createElementNS(r,i):e.createElement(i),f=t[1],d=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){d=2;for(let g in f)if(f[g]!=null){let p=g.indexOf(" ");p>0?u.setAttributeNS(g.slice(0,p),g.slice(p+1),f[g]):u.setAttribute(g,f[g])}}for(let g=d;g<t.length;g++){let p=t[g];if(p===0){if(g<t.length-1||g>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:_,contentDOM:S}=Ur.renderSpec(e,p,r);if(u.appendChild(_),S){if(l)throw new RangeError("Multiple content holes");l=S}}}return{dom:u,contentDOM:l}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ur(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Lm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Lm(e.marks)}}function Lm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function oc(n){return n.document||window.document}const Pm=65535,Dm=Math.pow(2,16);function eC(n,e){return n+e*Dm}function Fm(n){return n&Pm}function tC(n){return(n-(n&Pm))/Dm}const Bm=1,Hm=2,da=4,$m=8;class ac{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&$m)>0}get deletedBefore(){return(this.delInfo&(Bm|da))>0}get deletedAfter(){return(this.delInfo&(Hm|da))>0}get deletedAcross(){return(this.delInfo&da)>0}}class Wt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Wt.empty)return Wt.empty}recover(e){let t=0,r=Fm(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+tC(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,l=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?i:0);if(f>e)break;let d=this.ranges[u+o],g=this.ranges[u+l],p=f+d;if(e<=p){let _=d?e==f?-1:e==p?1:t:t,S=f+i+(_<0?0:g);if(r)return S;let k=e==(t<0?f:p)?null:eC(u/3,e-f),m=e==f?Hm:e==p?Bm:da;return(t<0?e!=f:e!=p)&&(m|=$m),new ac(S,m,k)}i+=g-d}return r?e+i:new ac(e+i,0,null)}touches(e,t){let r=0,i=Fm(t),o=this.inverted?2:1,l=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?r:0);if(f>e)break;let d=this.ranges[u+o],g=f+d;if(e<=g&&u==i*3)return!0;r+=this.ranges[u+l]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let l=this.ranges[i],u=l-(this.inverted?o:0),f=l+(this.inverted?0:o),d=this.ranges[i+t],g=this.ranges[i+r];e(u,u+d,f,f+g),o+=g-d}}invert(){return new Wt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Wt.empty:new Wt(e<0?[0,-e,0]:[0,0,e])}}Wt.empty=new Wt([]);class Bi{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Bi(this.maps,this.mirror,e,t)}copy(){return new Bi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Bi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let l=this.maps[o],u=l.mapResult(e,t);if(u.recover!=null){let f=this.getMirror(o);if(f!=null&&f>o&&f<this.to){o=f,e=this.maps[f].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new ac(e,i,null)}}const lc=Object.create(null);class tt{getMap(){return Wt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=lc[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in lc)throw new RangeError("Duplicate use of step JSON ID "+e);return lc[e]=t,t.prototype.jsonID=e,t}}class De{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new De(e,null)}static fail(e){return new De(null,e)}static fromReplace(e,t,r,i){try{return De.ok(e.replace(t,r,i))}catch(o){if(o instanceof aa)return De.fail(o.message);throw o}}}function uc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(uc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return B.fromArray(r)}class fr extends tt{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new K(uc(t.content,(l,u)=>!l.isAtom||!u.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),i),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,o)}invert(){return new yn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new fr(t.pos,r.pos,this.mark)}merge(e){return e instanceof fr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new fr(t.from,t.to,e.markFromJSON(t.mark))}}tt.jsonID("addMark",fr);class yn extends tt{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new K(uc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,r)}invert(){return new fr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new yn(t.pos,r.pos,this.mark)}merge(e){return e instanceof yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new yn(t.from,t.to,e.markFromJSON(t.mark))}}tt.jsonID("removeMark",yn);class hr extends tt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new K(B.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new hr(this.pos,t.marks[i]);return new hr(this.pos,this.mark)}}return new Hi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new hr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new hr(t.pos,e.markFromJSON(t.mark))}}tt.jsonID("addNodeMark",hr);class Hi extends tt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new K(B.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new hr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Hi(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Hi(t.pos,e.markFromJSON(t.mark))}}tt.jsonID("removeNodeMark",Hi);class nt extends tt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&cc(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Wt([this.from,this.to-this.from,this.slice.size])}invert(e){return new nt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new nt(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof nt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new nt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new nt(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new nt(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}tt.jsonID("replace",nt);class We extends tt{constructor(e,t,r,i,o,l,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=l,this.structure=u}apply(e){if(this.structure&&(cc(e,this.from,this.gapFrom)||cc(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return De.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?De.fromReplace(e,this.from,this.to,r):De.fail("Content does not fit in gap")}getMap(){return new Wt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new We(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new We(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new We(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}tt.jsonID("replaceAround",We);function cc(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let l=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,i--}}return!1}function nC(n,e,t,r){let i=[],o=[],l,u;n.doc.nodesBetween(e,t,(f,d,g)=>{if(!f.isInline)return;let p=f.marks;if(!r.isInSet(p)&&g.type.allowsMarkType(r.type)){let _=Math.max(d,e),S=Math.min(d+f.nodeSize,t),k=r.addToSet(p);for(let m=0;m<p.length;m++)p[m].isInSet(k)||(l&&l.to==_&&l.mark.eq(p[m])?l.to=S:i.push(l=new yn(_,S,p[m])));u&&u.to==_?u.to=S:o.push(u=new fr(_,S,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function rC(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(l,u)=>{if(!l.isInline)return;o++;let f=null;if(r instanceof el){let d=l.marks,g;for(;g=r.isInSet(d);)(f||(f=[])).push(g),d=g.removeFromSet(d)}else r?r.isInSet(l.marks)&&(f=[r]):f=l.marks;if(f&&f.length){let d=Math.min(u+l.nodeSize,t);for(let g=0;g<f.length;g++){let p=f[g],_;for(let S=0;S<i.length;S++){let k=i[S];k.step==o-1&&p.eq(i[S].style)&&(_=k)}_?(_.to=d,_.step=o):i.push({style:p,from:Math.max(u,e),to:d,step:o})}}}),i.forEach(l=>n.step(new yn(l.from,l.to,l.style)))}function iC(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let u=0;u<i.childCount;u++){let f=i.child(u),d=l+f.nodeSize,g=r.matchType(f.type);if(!g)o.push(new nt(l,d,K.empty));else{r=g;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new yn(l,d,f.marks[p]))}l=d}if(!r.validEnd){let u=r.fillBefore(B.empty,!0);n.replace(l,l,new K(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function sC(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function _i(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),l=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,l,t))return r;if(r==0||i.type.spec.isolating||!sC(i,o,l))break}return null}function oC(n,e,t){let{$from:r,$to:i,depth:o}=e,l=r.before(o+1),u=i.after(o+1),f=l,d=u,g=B.empty,p=0;for(let k=o,m=!1;k>t;k--)m||r.index(k)>0?(m=!0,g=B.from(r.node(k).copy(g)),p++):f--;let _=B.empty,S=0;for(let k=o,m=!1;k>t;k--)m||i.after(k+1)<i.end(k)?(m=!0,_=B.from(i.node(k).copy(_)),S++):d++;n.step(new We(f,d,l,u,new K(g.append(_),p,S),g.size-p,!0))}function fc(n,e,t=null,r=n){let i=aC(n,e),o=i&&lC(r,e);return o?i.map(zm).concat({type:e,attrs:t}).concat(o.map(zm)):null}function zm(n){return{type:n,attrs:null}}function aC(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let l=o.length?o[0]:e;return t.canReplaceWith(r,i,l)?o:null}function lC(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),l=e.contentMatch.findWrapping(o.type);if(!l)return null;let f=(l.length?l[l.length-1]:e).contentMatch;for(let d=r;f&&d<i;d++)f=f.matchType(t.child(d).type);return!f||!f.validEnd?null:l}function uC(n,e,t){let r=B.empty;for(let l=t.length-1;l>=0;l--){if(r.size){let u=t[l].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=B.from(t[l].type.create(t[l].attrs,r))}let i=e.start,o=e.end;n.step(new We(i,o,i,o,new K(r,0,0),t.length,!0))}function cC(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(l,u)=>{if(l.isTextblock&&!l.hasMarkup(r,i)&&fC(n.doc,n.mapping.slice(o).map(u),r)){n.clearIncompatible(n.mapping.slice(o).map(u,1),r);let f=n.mapping.slice(o),d=f.map(u,1),g=f.map(u+l.nodeSize,1);return n.step(new We(d,g,d+1,g-1,new K(B.from(r.create(i,null,l.marks)),0,0),1,!0)),!1}})}function fC(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function hC(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let l=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,l);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new We(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new K(B.from(l),0,0),1,!0))}function vi(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,l=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!l.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,g=t-2;d>o;d--,g--){let p=i.node(d),_=i.index(d);if(p.type.spec.isolating)return!1;let S=p.content.cutByIndex(_,p.childCount),k=r&&r[g]||p;if(k!=p&&(S=S.replaceChild(0,k.type.create(k.attrs))),!p.canReplace(_+1,p.childCount)||!k.type.validContent(S))return!1}let u=i.indexAfter(o),f=r&&r[0];return i.node(o).canReplaceWith(u,u,f?f.type:i.node(o+1).type)}function dC(n,e,t=1,r){let i=n.doc.resolve(e),o=B.empty,l=B.empty;for(let u=i.depth,f=i.depth-t,d=t-1;u>f;u--,d--){o=B.from(i.node(u).copy(o));let g=r&&r[d];l=B.from(g?g.type.create(g.attrs,l):i.node(u).copy(l))}n.step(new nt(e,e,new K(o.append(l),t,t),!0))}function Zn(n,e){let t=n.resolve(e),r=t.index();return Vm(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Vm(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function pa(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,l,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,l=r.nodeAfter):t>0?(o=r.node(i+1),u++,l=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),l=r.node(i+1)),o&&!o.isTextblock&&Vm(o,l)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function pC(n,e,t){let r=new nt(e-t,e+t,K.empty,!0);n.step(r)}function mC(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function gC(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let l=r.depth;l>=0;l--){let u=l==r.depth?0:r.pos<=(r.start(l+1)+r.end(l+1))/2?-1:1,f=r.index(l)+(u>0?1:0),d=r.node(l),g=!1;if(o==1)g=d.canReplace(f,f,i);else{let p=d.contentMatchAt(f).findWrapping(i.firstChild.type);g=p&&d.canReplaceWith(f,f,p[0])}if(g)return u==0?r.pos:u<0?r.before(l+1):r.after(l+1)}return null}function hc(n,e,t=e,r=K.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Wm(i,o,r)?new nt(e,t,r):new yC(i,o,r).fit()}function Wm(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class yC{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=B.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=B.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,l=r.depth,u=i.depth;for(;l&&u&&o.childCount==1;)o=o.firstChild.content,l--,u--;let f=new K(o,l,u);return e>-1?new We(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new nt(r.pos,i.pos,f):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=dc(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:f}=this.frontier[l],d,g=null;if(e==1&&(o?f.matchType(o.type)||(g=f.fillBefore(B.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:l,parent:i,inject:g};if(e==2&&o&&(d=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:l,parent:i,wrap:d};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=dc(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new K(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=dc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new K(Ss(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new K(Ss(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let l=this.unplaced,u=r?r.content:l.content,f=l.openStart-e,d=0,g=[],{match:p,type:_}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)g.push(i.child(m));p=p.matchFragment(i)}let S=u.size+e-(l.content.size-l.openEnd);for(;d<u.childCount;){let m=u.child(d),b=p.matchType(m.type);if(!b)break;d++,(d>1||f==0||m.content.size)&&(p=b,g.push(Um(m.mark(_.allowedMarks(m.marks)),d==1?f:0,d==u.childCount?S:-1)))}let k=d==u.childCount;k||(S=-1),this.placed=xs(this.placed,t,B.from(g)),this.frontier[t].match=p,k&&S<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=u;m<S;m++){let x=b.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),b=x.content}this.unplaced=k?e==0?K.empty:new K(Ss(l.content,e-1,1),e-1,S<0?l.openEnd:e-1):new K(Ss(l.content,e,d),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!pc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),l=pc(e,t,i,r,o);if(l){for(let u=t-1;u>=0;u--){let{match:f,type:d}=this.frontier[u],g=pc(e,u,d,f,!0);if(!g||g.childCount)continue e}return{depth:t,fit:l,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=xs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=xs(this.placed,this.depth,B.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(B.empty,!0);t.childCount&&(this.placed=xs(this.placed,this.frontier.length,t))}}function Ss(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ss(n.firstChild.content,e-1,t)))}function xs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(xs(n.lastChild.content,e-1,t)))}function dc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Um(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Um(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(B.empty,!0)))),n.copy(r)}function pc(n,e,t,r,i){let o=n.node(e),l=i?n.indexAfter(e):n.index(e);if(l==o.childCount&&!t.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,l);return u&&!bC(t,o.content,l)?u:null}function bC(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function _C(n){return n.spec.defining||n.spec.definingForContent}function vC(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(Wm(i,o,r))return n.step(new nt(e,t,r));let l=Km(i,n.doc.resolve(t));l[l.length-1]==0&&l.pop();let u=-(i.depth+1);l.unshift(u);for(let _=i.depth,S=i.pos-1;_>0;_--,S--){let k=i.node(_).type.spec;if(k.defining||k.definingAsContext||k.isolating)break;l.indexOf(_)>-1?u=_:i.before(_)==S&&l.splice(1,0,-_)}let f=l.indexOf(u),d=[],g=r.openStart;for(let _=r.content,S=0;;S++){let k=_.firstChild;if(d.push(k),S==r.openStart)break;_=k.content}for(let _=g-1;_>=0;_--){let S=d[_].type,k=_C(S);if(k&&i.node(f).type!=S)g=_;else if(k||!S.isTextblock)break}for(let _=r.openStart;_>=0;_--){let S=(_+g+1)%(r.openStart+1),k=d[S];if(k)for(let m=0;m<l.length;m++){let b=l[(m+f)%l.length],x=!0;b<0&&(x=!1,b=-b);let A=i.node(b-1),O=i.index(b-1);if(A.canReplaceWith(O,O,k.type,k.marks))return n.replace(i.before(b),x?o.after(b):t,new K(qm(r.content,0,r.openStart,S),S,r.openEnd))}}let p=n.steps.length;for(let _=l.length-1;_>=0&&(n.replace(e,t,r),!(n.steps.length>p));_--){let S=l[_];S<0||(e=i.before(S),t=o.after(S))}}function qm(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(qm(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),l=o.fillBefore(n).append(n);n=l.append(o.matchFragment(l).fillBefore(B.empty,!0))}return n}function wC(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=mC(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new K(B.from(r),0,0))}function SC(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Km(r,i);for(let l=0;l<o.length;l++){let u=o[l],f=l==o.length-1;if(f&&u==0||r.node(u).type.contentMatch.validEnd)return n.delete(r.start(u),i.end(u));if(u>0&&(f||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return n.delete(r.before(u),i.after(u))}for(let l=1;l<=r.depth&&l<=i.depth;l++)if(e-r.start(l)==r.depth-l&&t>r.end(l)&&i.end(l)-t!=i.depth-l)return n.delete(r.before(l),t);n.delete(e,t)}function Km(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class $i extends tt{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return De.fromReplace(e,this.pos,this.pos+1,new K(B.from(i),0,t.isLeaf?0:1))}getMap(){return Wt.empty}invert(e){return new $i(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $i(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $i(t.pos,t.attr,t.value)}}tt.jsonID("attr",$i);let wi=class extends Error{};wi=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},wi.prototype=Object.create(Error.prototype),wi.prototype.constructor=wi,wi.prototype.name="TransformError";class xC{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Bi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new wi(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=K.empty){let i=hc(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new K(B.from(r),0,0))}delete(e,t){return this.replace(e,t,K.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return vC(this,e,t,r),this}replaceRangeWith(e,t,r){return wC(this,e,t,r),this}deleteRange(e,t){return SC(this,e,t),this}lift(e,t){return oC(this,e,t),this}join(e,t=1){return pC(this,e,t),this}wrap(e,t){return uC(this,e,t),this}setBlockType(e,t=e,r,i=null){return cC(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return hC(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new $i(e,t,r)),this}addNodeMark(e,t){return this.step(new hr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Ee)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Hi(e,t)),this}split(e,t=1,r){return dC(this,e,t,r),this}addMark(e,t,r){return nC(this,e,t,r),this}removeMark(e,t,r){return rC(this,e,t,r),this}clearIncompatible(e,t,r){return iC(this,e,t,r),this}}const mc=Object.create(null);class pe{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new EC(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=K.empty){let r=t.content.lastChild,i=null;for(let u=0;u<t.openEnd;u++)i=r,r=r.lastChild;let o=e.steps.length,l=this.ranges;for(let u=0;u<l.length;u++){let{$from:f,$to:d}=l[u],g=e.mapping.slice(o);e.replaceRange(g.map(f.pos),g.map(d.pos),u?K.empty:t),u==0&&Jm(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:l,$to:u}=i[o],f=e.mapping.slice(r),d=f.map(l.pos),g=f.map(u.pos);o?e.deleteRange(d,g):(e.replaceRangeWith(d,g,t),Jm(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new me(e):Si(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let l=t<0?Si(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Si(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(l)return l}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new tn(e.node(0))}static atStart(e){return Si(e,e,0,0,1)||new tn(e)}static atEnd(e){return Si(e,e,e.content.size,e.childCount,-1)||new tn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=mc[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in mc)throw new RangeError("Duplicate use of selection JSON ID "+e);return mc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return me.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class EC{constructor(e,t){this.$from=e,this.$to=t}}let Gm=!1;function jm(n){!Gm&&!n.parent.inlineContent&&(Gm=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class me extends pe{constructor(e,t=e){jm(e),jm(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return pe.near(r);let i=e.resolve(t.map(this.anchor));return new me(i.parent.inlineContent?i:r,r)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof me&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new tl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new me(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=pe.findFrom(t,r,!0)||pe.findFrom(t,-r,!0);if(o)t=o.$head;else return pe.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(pe.findFrom(e,-r,!0)||pe.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new me(e,t)}}pe.jsonID("text",me);class tl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new tl(e.map(this.anchor),e.map(this.head))}resolve(e){return me.between(e.resolve(this.anchor),e.resolve(this.head))}}class ee extends pe{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?pe.near(o):new ee(o)}content(){return new K(B.from(this.node),0,0)}eq(e){return e instanceof ee&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Mf(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ee(e.resolve(t.anchor))}static create(e,t){return new ee(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ee.prototype.visible=!1,pe.jsonID("node",ee);class Mf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new tl(r,r):new Mf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&ee.isSelectable(r)?new ee(t):pe.near(t)}}class tn extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let r=pe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new tn(e)}map(e){return new tn(e)}eq(e){return e instanceof tn}getBookmark(){return kC}}pe.jsonID("all",tn);const kC={map(){return this},resolve(n){return new tn(n)}};function Si(n,e,t,r,i,o=!1){if(e.inlineContent)return me.create(n,t);for(let l=r-(i>0?0:1);i>0?l<e.childCount:l>=0;l+=i){let u=e.child(l);if(u.isAtom){if(!o&&ee.isSelectable(u))return ee.create(n,t-(i<0?u.nodeSize:0))}else{let f=Si(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function Jm(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof nt||i instanceof We))return;let o=n.mapping.maps[r],l;o.forEach((u,f,d,g)=>{l==null&&(l=g)}),n.setSelection(pe.near(n.doc.resolve(l),t))}function Ym(n,e){return!e||!n?n:n.bind(e)}class ma{constructor(e,t,r){this.name=e,this.init=Ym(t.init,r),this.apply=Ym(t.apply,r)}}new ma("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new ma("selection",{init(n,e){return n.selection||pe.atStart(e.doc)},apply(n){return n.selection}}),new ma("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new ma("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Xm(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Xm(i,e,{})),t[r]=i}return t}class Ct{constructor(e){this.spec=e,this.props={},e.props&&Xm(e.props,this,this.props),this.key=e.key?e.key.key:Zm("plugin")}getState(e){return e[this.key]}}const gc=Object.create(null);function Zm(n){return n in gc?n+"$"+ ++gc[n]:(gc[n]=0,n+"$")}class Zt{constructor(e="key"){this.key=Zm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Es=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Qm=function(n,e,t,r){return t&&(eg(n,e,t,r,-1)||eg(n,e,t,r,1))},CC=/^(img|br|input|textarea|hr)$/i;function eg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ga(n))){let o=n.parentNode;if(!o||o.nodeType!=1||OC(n)||CC.test(n.nodeName)||n.contentEditable=="false")return!1;e=Es(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?ga(n):0}else return!1}}function ga(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function AC(n,e,t){for(let r=e==0,i=e==ga(n);r||i;){if(n==t)return!0;let o=Es(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==ga(n)}}function OC(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const tg=function(n){return n.focusNode&&Qm(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function ng(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const Qn=typeof navigator<"u"?navigator:null,rg=typeof document<"u"?document:null,er=Qn&&Qn.userAgent||"",yc=/Edge\/(\d+)/.exec(er),ig=/MSIE \d/.exec(er),bc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(er),ks=!!(ig||bc||yc),sg=ig?document.documentMode:bc?+bc[1]:yc?+yc[1]:0,ya=!ks&&/gecko\/(\d+)/i.test(er);ya&&+(/Firefox\/(\d+)/.exec(er)||[0,0])[1];const _c=!ks&&/Chrome\/(\d+)/.exec(er),xi=!!_c,TC=_c?+_c[1]:0,Mr=!ks&&!!Qn&&/Apple Computer/.test(Qn.vendor),vc=Mr&&(/Mobile\/\w+/.test(er)||!!Qn&&Qn.maxTouchPoints>2),Ht=vc||(Qn?/Mac/.test(Qn.platform):!1),Cs=/Android \d/.test(er),wc=!!rg&&"webkitFontSmoothing"in rg.documentElement.style,MC=wc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function IC(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,l=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(l<0)return null;let u=r.resolve(l),f,d;if(tg(t)){for(f=u;i&&!i.node;)i=i.parent;let g=i.node;if(i&&g.isAtom&&ee.isSelectable(g)&&i.parent&&!(g.isInline&&AC(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;d=new ee(l==p?u:r.resolve(p))}}else{let g=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(g<0)return null;f=r.resolve(g)}if(!d){let g=e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1;d=fg(n,f,u,g)}return d}function og(n){return n.editable?n.hasFocus():PC(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Sc(n,e=!1){let t=n.state.selection;if(LC(n,t),!!og(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&xi){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Qm(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)RC(n);else{let{anchor:r,head:i}=t,o,l;ag&&!(t instanceof me)&&(t.$from.parent.inlineContent||(o=lg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(l=lg(n,t.to))),n.docView.setSelection(r,i,n.root,e),ag&&(o&&ug(o),l&&ug(l)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&NC(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const ag=Mr||xi&&TC<63;function lg(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Mr&&i&&i.contentEditable=="false")return xc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return xc(i);if(o)return xc(o)}}function xc(n){return n.contentEditable="true",Mr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function ug(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function NC(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!og(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function RC(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Es(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&ks&&sg<=11&&(r.disabled=!0,r.disabled=!1)}function LC(n,e){if(e instanceof ee){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(cg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else cg(n)}function cg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function fg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||me.between(e,t,r)}function PC(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Ec(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&pe.findFrom(o,e)}function Ir(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function hg(n,e,t){let r=n.state.selection;if(r instanceof me){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=Ec(n.state,e);return i&&i instanceof ee?Ir(n,i):!1}else if(!(Ht&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,l;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(l=n.docView.descAt(u))&&!l.contentDOM?ee.isSelectable(o)?Ir(n,new ee(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):wc?Ir(n,new me(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof ee&&r.node.isInline)return Ir(n,new me(e>0?r.$to:r.$from));{let i=Ec(n.state,e);return i?Ir(n,i):!1}}}function ba(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function As(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function kc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,l=!1;for(ya&&t.nodeType==1&&r<ba(t)&&As(t.childNodes[r])&&(l=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(As(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(dg(t))break;{let u=t.previousSibling;for(;u&&As(u);)i=t.parentNode,o=Es(u),u=u.previousSibling;if(u)t=u,r=ba(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}l?Ac(n,t,r):i&&Ac(n,i,o)}function Cc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=ba(t),o,l;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(As(u))o=t,l=++r;else break}else{if(dg(t))break;{let u=t.nextSibling;for(;u&&As(u);)o=u.parentNode,l=Es(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=ba(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&Ac(n,o,l)}function dg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ac(n,e,t){let r=n.domSelection();if(tg(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Sc(n)},50)}function pg(n,e,t){let r=n.state.selection;if(r instanceof me&&!r.empty||t.indexOf("s")>-1||Ht&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let l=Ec(n.state,e);if(l&&l instanceof ee)return Ir(n,l)}if(!i.parent.inlineContent){let l=e<0?i:o,u=r instanceof tn?pe.near(l,e):pe.findFrom(l,e);return u?Ir(n,u):!1}return!1}function mg(n,e){if(!(n.state.selection instanceof me))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let l=n.state.tr;return e<0?l.delete(t.pos-o.nodeSize,t.pos):l.delete(t.pos,t.pos+o.nodeSize),n.dispatch(l),!0}return!1}function gg(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function DC(n){if(!Mr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;gg(n,r,"true"),setTimeout(()=>gg(n,r,"false"),20)}return!1}function FC(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function BC(n,e){let t=e.keyCode,r=FC(e);return t==8||Ht&&t==72&&r=="c"?mg(n,-1)||kc(n):t==46||Ht&&t==68&&r=="c"?mg(n,1)||Cc(n):t==13||t==27?!0:t==37||Ht&&t==66&&r=="c"?hg(n,-1,r)||kc(n):t==39||Ht&&t==70&&r=="c"?hg(n,1,r)||Cc(n):t==38||Ht&&t==80&&r=="c"?pg(n,-1,r)||kc(n):t==40||Ht&&t==78&&r=="c"?DC(n)||pg(n,1,r)||Cc(n):r==(Ht?"m":"c")&&(t==66||t==73||t==89||t==90)}function yg(n,e){n.someProp("transformCopied",S=>{e=S(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let S=r.firstChild;t.push(S.type.name,S.attrs!=S.type.defaultAttrs?S.attrs:null),r=S.content}let l=n.someProp("clipboardSerializer")||Ur.fromSchema(n.state.schema),u=kg(),f=u.createElement("div");f.appendChild(l.serializeFragment(r,{document:u}));let d=f.firstChild,g,p=0;for(;d&&d.nodeType==1&&(g=xg[d.nodeName.toLowerCase()]);){for(let S=g.length-1;S>=0;S--){let k=u.createElement(g[S]);for(;f.firstChild;)k.appendChild(f.firstChild);f.appendChild(k),p++}d=f.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(t)}`);let _=n.someProp("clipboardTextSerializer",S=>S(e,n))||e.content.textBetween(0,e.content.size,`
|
|
32
30
|
|
|
33
|
-
`);return{dom:f,text:
|
|
34
|
-
`))),0,0):z.empty;let m=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(m)u=m;else{let y=i.marks(),{schema:v}=n.state,S=Wr.fromSchema(v);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(C=>{let O=a.appendChild(document.createElement("p"));C&&O.appendChild(S.serializeNode(v.text(C,y)))})}}else n.someProp("transformPastedHTML",m=>{t=m(t,n)}),a=nA(t),yc&&rA(a);let d=a&&a.querySelector("[data-pm-slice]"),p=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let m=+p[3];m>0;m--){let y=a.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;a=y}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||tc.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||p),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!eA.test(y.parentNode.nodeName)?{ignore:!0}:null}})),p)u=iA(kg(u,+p[1],+p[2]),p[4]);else if(u=z.maxOpen(tA(u.content,i),!0),u.openStart||u.openEnd){let m=0,y=0;for(let v=u.content.firstChild;m<u.openStart&&!v.type.spec.isolating;m++,v=v.firstChild);for(let v=u.content.lastChild;y<u.openEnd&&!v.type.spec.isolating;y++,v=v.lastChild);u=kg(u,m,y)}return n.someProp("transformPasted",m=>{u=m(u,n)}),u}const eA=/^(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 tA(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(u=>{if(!a)return;let f=i.findWrapping(u.type),d;if(!f)return a=null;if(d=a.length&&o.length&&xg(f,o,u,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=Eg(a[a.length-1],o.length));let p=Sg(u,f);a.push(p),i=i.matchType(p.type),o=f}}),a)return L.from(a)}return n}function Sg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function xg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=xg(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(L.from(Sg(t,n,i+1))))}}function Eg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Eg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function Ec(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,u=a.content;return i<r-1&&(u=Ec(u,e,t,r,i+1,o)),i>=t&&(u=e<0?a.contentMatchAt(0).fillBefore(u,n.childCount>1||o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(L.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(u))}function kg(n,e,t){return e<n.openStart&&(n=new z(Ec(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new z(Ec(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Cg={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ag=null;function Og(){return Ag||(Ag=document.implementation.createHTMLDocument("title"))}function nA(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Og().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&Cg[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function rA(n){let e=n.querySelectorAll(wi?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function iA(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let u=r.length-2;u>=0;u-=2){let f=t.nodes[r[u]];if(!f||f.hasRequiredAttrs())break;i=L.from(f.create(r[u+1],i)),o++,a++}return new z(i,o,a)}const jt={},St={};function Yn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}St.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Mg(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ks&&wi&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),gc&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,sg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||QC(n,t)?t.preventDefault():Yn(n,"key")},St.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},St.keypress=(n,e)=>{let t=e;if(Mg(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Rt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof de)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function hl(n){return{left:n.clientX,top:n.clientY}}function sA(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function kc(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,u=>a>o.depth?u(n,t,o.nodeAfter,o.before(a),i,!0):u(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function Si(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function oA(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(Si(n,new Y(t)),!0):!1}function lA(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Y&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(Y.isSelectable(u)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(Si(n,Y.create(n.state.doc,i)),!0):!1}function aA(n,e,t,r,i){return kc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?lA(n,t):oA(n,t))}function uA(n,e,t,r){return kc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function cA(n,e,t,r){return kc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||fA(n,t,r)}function fA(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Si(n,de.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)Si(n,de.create(r,u+1,u+1+a.content.size));else if(Y.isSelectable(a))Si(n,Y.create(r,u));else continue;return!0}}function Cc(n){return dl(n)}const Tg=Rt?"metaKey":"ctrlKey";jt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Cc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&sA(t,n.input.lastClick)&&!t[Tg]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(hl(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new hA(n,a,t,!!r)):(o=="doubleClick"?uA:cA)(n,a.pos,a.inside,t)?t.preventDefault():Yn(n,"pointer"))};class hA{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Tg],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let p=e.state.doc.resolve(t.pos);o=p.parent,a=p.depth?p.before():0}const u=i?null:r.target,f=u?e.docView.nearestDesc(u,!0):null;this.target=f?f.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof Y&&d.from<=a&&d.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&cl&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Yn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>bc(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(hl(e))),this.updateAllowDefault(e),this.allowDefault||!t?Yn(this.view,"pointer"):aA(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Tr&&this.mightDrag&&!this.mightDrag.node.isAtom||wi&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Si(this.view,he.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Yn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Yn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}jt.touchstart=n=>{n.input.lastTouch=Date.now(),Cc(n),Yn(n,"pointer")},jt.touchmove=n=>{n.input.lastTouch=Date.now(),Yn(n,"pointer")},jt.contextmenu=n=>Cc(n);function Mg(n,e){return n.composing?!0:Tr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const dA=ks?5e3:-1;St.compositionstart=St.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),dl(n,!0),n.markCursor=null;else if(dl(n),cl&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){n.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}Ig(n,dA)},St.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Ig(n,20))};function Ig(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>dl(n),e))}function pA(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=mA());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function mA(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function dl(n,e=!1){if(!(ks&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),pA(n),e||n.docView&&n.docView.dirty){let t=qC(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function gA(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const xi=Es&&ag<15||gc&&KC<604;jt.copy=St.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=xi?null:t.clipboardData,a=r.content(),{dom:u,text:f}=vg(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):gA(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function yA(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function bA(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Ac(n,r.value,null,e):Ac(n,r.textContent,r.innerHTML,e)},50)}function Ac(n,e,t,r){let i=wg(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",u=>u(n,r,i||z.empty)))return!0;if(!i)return!1;let o=yA(i),a=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}St.paste=(n,e)=>{let t=e;if(n.composing&&!ks)return;let r=xi?null:t.clipboardData;r&&Ac(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():bA(n,t)};class _A{constructor(e,t){this.slice=e,this.move=t}}const Ng=Rt?"altKey":"ctrlKey";jt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(hl(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(Y.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&n.dispatch(n.state.tr.setSelection(Y.create(n.state.doc,d.posBefore)))}}let a=n.state.selection.content(),{dom:u,text:f}=vg(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(xi?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",xi||t.dataTransfer.setData("text/plain",f),n.dragging=new _A(a,!t[Ng])},jt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},St.dragover=St.dragenter=(n,e)=>e.preventDefault(),St.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(hl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",S=>{a=S(a,n)}):a=wg(n,t.dataTransfer.getData(xi?"Text":"text/plain"),xi?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[Ng]);if(n.someProp("handleDrop",S=>S(n,t,a||z.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?IC(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let d=n.state.tr;u&&d.deleteSelection();let p=d.mapping.map(f),m=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,y=d.doc;if(m?d.replaceRangeWith(p,p,a.content.firstChild):d.replaceRange(p,p,a),d.doc.eq(y))return;let v=d.doc.resolve(p);if(m&&Y.isSelectable(a.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new Y(v));else{let S=d.mapping.map(f);d.mapping.maps[d.mapping.maps.length-1].forEach((C,O,N,q)=>S=q),d.setSelection(pg(n,v,d.doc.resolve(S)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},jt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&bc(n)},20))},jt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},jt.beforeinput=(n,e)=>{if(wi&&ks&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,sg(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in St)jt[n]=St[n];function As(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Af{constructor(e,t){this.toDOM=e,this.spec=t||Ir,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new dn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Af&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&As(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class sr{constructor(e,t){this.attrs=e,this.spec=t||Ir}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new dn(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof sr&&As(this.attrs,e.attrs)&&As(this.spec,e.spec)}static is(e){return e.type instanceof sr}destroy(){}}class Of{constructor(e,t){this.attrs=e,this.spec=t||Ir}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new dn(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof Of&&As(this.attrs,e.attrs)&&As(this.spec,e.spec)}destroy(){}}class dn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new dn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new dn(e,e,new Af(t,r))}static inline(e,t,r,i){return new dn(e,t,new sr(r,i))}static node(e,t,r,i){return new dn(e,t,new Of(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof sr}}const Ei=[],Ir={};class ze{constructor(e,t){this.local=e.length?e:Ei,this.children=t.length?t:Ei}static create(e,t){return t.length?pl(t,e,0,Ir):lt}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=t&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let u=this.children[a]+1;this.children[a+2].findInner(e-u,t-u,r,i+u,o)}}map(e,t,r){return this==lt||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ir)}mapInner(e,t,r,i,o){let a;for(let u=0;u<this.local.length;u++){let f=this.local[u].map(e,r,i);f&&f.type.valid(t,f)?(a||(a=[])).push(f):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?vA(this.children,a||[],e,t,r,i,o):a?new ze(a.sort(Nr),Ei):lt}add(e,t){return t.length?this==lt?ze.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((u,f)=>{let d=f+r,p;if(p=Lg(t,u,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<f;)o+=3;i[o]==f?i[o+2]=i[o+2].addInner(u,p,d+1):i.splice(o,0,f,f+u.nodeSize,pl(p,u,d+1,Ir)),o+=3}});let a=Rg(o?Pg(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new ze(a.length?this.local.concat(a).sort(Nr):this.local,i||this.children)}remove(e){return e.length==0||this==lt?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+t,f=r[o+1]+t;for(let p=0,m;p<e.length;p++)(m=e[p])&&m.from>u&&m.to<f&&(e[p]=null,(a||(a=[])).push(m));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,u+1);d!=lt?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let u=0;u<i.length;u++)i[u].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ze(i,r):lt}forChild(e,t){if(this==lt)return this;if(t.isLeaf)return ze.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let o=e+1,a=o+t.content.size;for(let u=0;u<this.local.length;u++){let f=this.local[u];if(f.from<a&&f.to>o&&f.type instanceof sr){let d=Math.max(o,f.from)-o,p=Math.min(a,f.to)-o;d<p&&(i||(i=[])).push(f.copy(d,p))}}if(i){let u=new ze(i.sort(Nr),Ei);return r?new Vr([u,r]):u}return r||lt}eq(e){if(this==e)return!0;if(!(e instanceof ze)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Oc(this.localsInner(e))}localsInner(e){if(this==lt)return Ei;if(e.inlineContent||!this.local.some(sr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof sr||t.push(this.local[r]);return t}}ze.empty=new ze([],[]),ze.removeOverlap=Oc;const lt=ze.empty;class Vr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ir));return Vr.from(r)}forChild(e,t){if(t.isLeaf)return ze.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=lt&&(o instanceof Vr?r=r.concat(o.members):r.push(o))}return Vr.from(r)}eq(e){if(!(e instanceof Vr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?Oc(r?t:t.sort(Nr)):Ei}static from(e){switch(e.length){case 0:return lt;case 1:return e[0];default:return new Vr(e.every(t=>t instanceof ze)?e:e.reduce((t,r)=>t.concat(r instanceof ze?r:r.members),[]))}}}function vA(n,e,t,r,i,o,a){let u=n.slice();for(let d=0,p=o;d<t.maps.length;d++){let m=0;t.maps[d].forEach((y,v,S,C)=>{let O=C-S-(v-y);for(let N=0;N<u.length;N+=3){let q=u[N+1];if(q<0||y>q+p-m)continue;let K=u[N]+p-m;v>=K?u[N+1]=y<=K?-2:-1:S>=i&&O&&(u[N]+=O,u[N+1]+=O)}m+=O}),p=t.maps[d].map(p,-1)}let f=!1;for(let d=0;d<u.length;d+=3)if(u[d+1]<0){if(u[d+1]==-2){f=!0,u[d+1]=-1;continue}let p=t.map(n[d]+o),m=p-i;if(m<0||m>=r.content.size){f=!0;continue}let y=t.map(n[d+1]+o,-1),v=y-i,{index:S,offset:C}=r.content.findIndex(m),O=r.maybeChild(S);if(O&&C==m&&C+O.nodeSize==v){let N=u[d+2].mapInner(t,O,p+1,n[d]+o+1,a);N!=lt?(u[d]=m,u[d+1]=v,u[d+2]=N):(u[d+1]=-2,f=!0)}else f=!0}if(f){let d=wA(u,n,e,t,i,o,a),p=pl(d,r,0,a);e=p.local;for(let m=0;m<u.length;m+=3)u[m+1]<0&&(u.splice(m,3),m-=3);for(let m=0,y=0;m<p.children.length;m+=3){let v=p.children[m];for(;y<u.length&&u[y]<v;)y+=3;u.splice(y,0,p.children[m],p.children[m+1],p.children[m+2])}}return new ze(e.sort(Nr),u)}function Rg(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new dn(i.from+e,i.to+e,i.type))}return t}function wA(n,e,t,r,i,o,a){function u(f,d){for(let p=0;p<f.local.length;p++){let m=f.local[p].map(r,i,d);m?t.push(m):a.onRemove&&a.onRemove(f.local[p].spec)}for(let p=0;p<f.children.length;p+=3)u(f.children[p+2],f.children[p]+d+1)}for(let f=0;f<n.length;f+=3)n[f+1]==-1&&u(n[f+2],e[f]+o+1);return t}function Lg(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function Pg(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function pl(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let d=Lg(n,u,f+t);if(d){o=!0;let p=pl(d,u,t+f+1,r);p!=lt&&i.push(f,f+u.nodeSize,p)}});let a=Rg(o?Pg(n):n,-t).sort(Nr);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new ze(a,i):lt}function Nr(n,e){return n.from-e.from||n.to-e.to}function Oc(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),Dg(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),Dg(e,i,r.copy(o.from,r.to)));break}}}return e}function Dg(n,e,t){for(;e<n.length&&Nr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var Xn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ml={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Fg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),SA=typeof navigator<"u"&&/Mac/.test(navigator.platform),xA=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),EA=SA||Fg&&+Fg[1]<57,Ge=0;Ge<10;Ge++)Xn[48+Ge]=Xn[96+Ge]=String(Ge);for(var Ge=1;Ge<=24;Ge++)Xn[Ge+111]="F"+Ge;for(var Ge=65;Ge<=90;Ge++)Xn[Ge]=String.fromCharCode(Ge+32),ml[Ge]=String.fromCharCode(Ge);for(var Tc in Xn)ml.hasOwnProperty(Tc)||(ml[Tc]=Xn[Tc]);function kA(n){var e=EA&&(n.ctrlKey||n.altKey||n.metaKey)||xA&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ml:Xn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const CA=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function AA(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let u=0;u<e.length-1;u++){let f=e[u];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))CA?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function OA(n){let e=Object.create(null);for(let t in n)e[AA(t)]=n[t];return e}function Mc(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}function TA(n){return new wt({props:{handleKeyDown:MA(n)}})}function MA(n){let e=OA(n);return function(t,r){let i=kA(r),o=i.length==1&&i!=" ",a,u=e[Mc(i,r,!o)];if(u&&u(t.state,t.dispatch,t))return!0;if(o&&(r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(a=Xn[r.keyCode])&&a!=i){let f=e[Mc(a,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[Mc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const IA=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function NA(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const RA=(n,e,t)=>{let r=NA(n,t);if(!r)return!1;let i=$g(r);if(!i){let a=r.blockRange(),u=a&&yi(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&zg(n,i,e))return!0;if(r.parent.content.size==0&&(ki(o,"end")||Y.isSelectable(o))){let a=ac(n.doc,r.before(),r.after(),z.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(ki(o,"end")?he.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Y.create(u.doc,i.pos-o.nodeSize)),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function ki(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const LA=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=$g(r)}let a=o&&o.nodeBefore;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function $g(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function PA(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const DA=(n,e,t)=>{let r=PA(n,t);if(!r)return!1;let i=Bg(r);if(!i)return!1;let o=i.nodeAfter;if(zg(n,i,e))return!0;if(r.parent.content.size==0&&(ki(o,"start")||Y.isSelectable(o))){let a=ac(n.doc,r.before(),r.after(),z.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(ki(o,"start")?he.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Y.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},FA=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=Bg(r)}let a=o&&o.nodeAfter;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos)).scrollIntoView()),!0)};function Bg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const $A=(n,e)=>{let t=n.selection,r=t instanceof Y,i;if(r){if(t.node.isTextblock||!Gn(n.doc,t.from))return!1;i=t.from}else if(i=ll(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},BA=(n,e)=>{let t=n.selection,r;if(t instanceof Y){if(t.node.isTextblock||!Gn(n.doc,t.to))return!1;r=t.to}else if(r=ll(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},HA=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&yi(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},zA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
35
|
-
`).scrollIntoView()),!0)};function Hg(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const VA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=Hg(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let u=t.after(),f=n.tr.replaceWith(u,u,a.createAndFill());f.setSelection(he.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},WA=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Yt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Hg(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(a,o.createAndFill());u.setSelection(de.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},UA=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(bi(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&yi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},KA=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(Y.create(n.doc,i))),!0)};function qA(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Gn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function zg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(qA(n,e,t))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(t){let m=e.pos+i.nodeSize,y=L.empty;for(let C=o.length-1;C>=0;C--)y=L.from(o[C].create(null,y));y=L.from(r.copy(y));let v=n.tr.step(new He(e.pos-1,m,e.pos,m,new z(y,1,0),o.length,!0)),S=m+2*o.length;Gn(v.doc,S)&&v.join(S),t(v.scrollIntoView())}return!0}let f=he.findFrom(e,1),d=f&&f.$from.blockRange(f.$to),p=d&&yi(d);if(p!=null&&p>=e.depth)return t&&t(n.tr.lift(d,p).scrollIntoView()),!0;if(u&&ki(i,"start",!0)&&ki(r,"end")){let m=r,y=[];for(;y.push(m),!m.isTextblock;)m=m.lastChild;let v=i,S=1;for(;!v.isTextblock;v=v.firstChild)S++;if(m.canReplace(m.childCount,m.childCount,v.content)){if(t){let C=L.empty;for(let N=y.length-1;N>=0;N--)C=L.from(y[N].copy(C));let O=n.tr.step(new He(e.pos-y.length,e.pos+i.nodeSize,e.pos+S,e.pos+i.nodeSize-S,new z(C,y.length,0),0,!0));t(O.scrollIntoView())}return!0}}return!1}function Vg(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(de.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const GA=Vg(-1),jA=Vg(1);function JA(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),u=a&&lc(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function Wg(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=t.selection.ranges[o];t.doc.nodesBetween(a,u,(f,d)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let p=t.doc.resolve(d),m=p.index();i=p.parent.canReplaceWith(m,m+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:f}}=t.selection.ranges[a];o.setBlockType(u,f,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function YA(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),u=!1,f=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let p=t.doc.resolve(a.start-2);f=new nl(p,p,a.depth),a.endIndex<a.parent.childCount&&(a=new nl(i,t.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let d=lc(f,n,e,a);return d?(r&&r(XA(t.tr,a,d,u,n).scrollIntoView()),!0):!1}}function XA(n,e,t,r,i){let o=L.empty;for(let p=t.length-1;p>=0;p--)o=L.from(t[p].type.create(t[p].attrs,o));n.step(new He(e.start-(r?2:0),e.end,e.start,e.end,new z(o,0,0),t.length,!0));let a=0;for(let p=0;p<t.length;p++)t[p].type==i&&(a=p+1);let u=t.length-a,f=e.start+t.length-(r?2:0),d=e.parent;for(let p=e.startIndex,m=e.endIndex,y=!0;p<m;p++,y=!1)!y&&bi(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=d.child(p).nodeSize;return n}function ZA(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?QA(e,t,n,o):eO(e,t,o):!0:!1}}function QA(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new He(o-1,a,o,a,new z(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new nl(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=yi(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return Gn(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function eO(n,e,t){let r=n.tr,i=t.parent;for(let v=t.end,S=t.endIndex-1,C=t.startIndex;S>C;S--)v-=i.child(S).nodeSize,r.delete(v-1,v+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let u=t.startIndex==0,f=t.endIndex==i.childCount,d=o.node(-1),p=o.index(-1);if(!d.canReplace(p+(u?0:1),p+1,a.content.append(f?L.empty:L.from(i))))return!1;let m=o.pos,y=m+a.nodeSize;return r.step(new He(m-(u?1:0),y+(f?1:0),m+1,y-1,new z((u?L.empty:L.from(i.copy(L.empty))).append(f?L.empty:L.from(i.copy(L.empty))),u?0:1,f?0:1),u?0:1)),e(r.scrollIntoView()),!0}function tO(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,f=u.child(a-1);if(f.type!=n)return!1;if(t){let d=f.lastChild&&f.lastChild.type==u.type,p=L.from(d?n.create():null),m=new z(L.from(n.create(null,L.from(u.type.create(null,p)))),d?3:1,0),y=o.start,v=o.end;t(e.tr.step(new He(y-(d?3:1),v,y,v,m,1,!0)).scrollIntoView())}return!0}}function gl(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class Ic{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,f])=>[u,(...p)=>{const m=f(...p)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],f=!!e,d=e||o.tr,p=()=>(!f&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),u.every(y=>y===!0)),m={...Object.fromEntries(Object.entries(r).map(([y,v])=>[y,(...C)=>{const O=this.buildProps(d,t),N=v(...C)(O);return u.push(N),m}])),run:p};return m}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,d])=>[f,(...p)=>d(...p)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u={tr:e,editor:i,view:a,state:gl({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([f,d])=>[f,(...p)=>d(...p)(u)]))}};return u}}function V(n,e,t){return n.config[e]===void 0&&n.parent?V(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?V(n.parent,e,t):null}):n.config[e]}function yl(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Ug(n){const e=[],{nodeExtensions:t,markExtensions:r}=yl(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},f=V(a,"addGlobalAttributes",u);if(!f)return;f().forEach(p=>{p.types.forEach(m=>{Object.entries(p.attributes).forEach(([y,v])=>{e.push({type:m,name:y,attribute:{...o,...v}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},f=V(a,"addAttributes",u);if(!f)return;const d=f();Object.entries(d).forEach(([p,m])=>{const y={...o,...m};typeof y?.default=="function"&&(y.default=y.default()),y?.isRequired&&y?.default===void 0&&delete y.default,e.push({type:a.name,name:p,attribute:y})})}),e}function $e(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Ci(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const u=o?o.split(" "):[],f=r[i]?r[i].split(" "):[],d=u.filter(p=>!f.includes(p));r[i]=[...f,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Nc(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Ci(t,r),{})}function nO(n){return typeof n=="function"}function se(n,e=void 0,...t){return nO(n)?e?n.bind(e)(...t):n(...t):n}function rO(n={}){return Object.keys(n).length===0&&n.constructor===Object}function iO(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Kg(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(t):iO(t.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function qg(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&rO(t)?!1:t!=null))}function Gg(n,e){var t;const r=Ug(n),{nodeExtensions:i,markExtensions:o}=yl(n),a=(t=i.find(d=>V(d,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(d=>{const p=r.filter(N=>N.type===d.name),m={name:d.name,options:d.options,storage:d.storage,editor:e},y=n.reduce((N,q)=>{const K=V(q,"extendNodeSchema",m);return{...N,...K?K(d):{}}},{}),v=qg({...y,content:se(V(d,"content",m)),marks:se(V(d,"marks",m)),group:se(V(d,"group",m)),inline:se(V(d,"inline",m)),atom:se(V(d,"atom",m)),selectable:se(V(d,"selectable",m)),draggable:se(V(d,"draggable",m)),code:se(V(d,"code",m)),defining:se(V(d,"defining",m)),isolating:se(V(d,"isolating",m)),attrs:Object.fromEntries(p.map(N=>{var q;return[N.name,{default:(q=N?.attribute)===null||q===void 0?void 0:q.default}]}))}),S=se(V(d,"parseHTML",m));S&&(v.parseDOM=S.map(N=>Kg(N,p)));const C=V(d,"renderHTML",m);C&&(v.toDOM=N=>C({node:N,HTMLAttributes:Nc(N,p)}));const O=V(d,"renderText",m);return O&&(v.toText=O),[d.name,v]})),f=Object.fromEntries(o.map(d=>{const p=r.filter(O=>O.type===d.name),m={name:d.name,options:d.options,storage:d.storage,editor:e},y=n.reduce((O,N)=>{const q=V(N,"extendMarkSchema",m);return{...O,...q?q(d):{}}},{}),v=qg({...y,inclusive:se(V(d,"inclusive",m)),excludes:se(V(d,"excludes",m)),group:se(V(d,"group",m)),spanning:se(V(d,"spanning",m)),code:se(V(d,"code",m)),attrs:Object.fromEntries(p.map(O=>{var N;return[O.name,{default:(N=O?.attribute)===null||N===void 0?void 0:N.default}]}))}),S=se(V(d,"parseHTML",m));S&&(v.parseDOM=S.map(O=>Kg(O,p)));const C=V(d,"renderHTML",m);return C&&(v.toDOM=O=>C({mark:O,HTMLAttributes:Nc(O,p)})),[d.name,v]}));return new aC({topNode:a,nodes:u,marks:f})}function Rc(n,e){return e.nodes[n]||e.marks[n]||null}function jg(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const sO=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,u)=>{var f,d;const p=((d=(f=i.type.spec).toText)===null||d===void 0?void 0:d.call(f,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";t+=p.slice(0,Math.max(0,r-o))}),t};function Lc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Jg{constructor(e){this.find=e.find,this.handler=e.handler}}const oO=(n,e)=>{if(Lc(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Pc(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:u}=n,{view:f}=t;if(f.composing)return!1;const d=f.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let p=!1;const m=sO(d)+o;return a.forEach(y=>{if(p)return;const v=oO(m,y.find);if(!v)return;const S=f.state.tr,C=gl({state:f.state,transaction:S}),O={from:r-(v[0].length-o.length),to:i},{commands:N,chain:q,can:K}=new Ic({editor:t,state:C});y.handler({state:C,range:O,match:v,commands:N,chain:q,can:K})===null||!S.steps.length||(S.setMeta(u,{transform:S,from:r,to:i,text:o}),f.dispatch(S),p=!0)}),p}function lO(n){const{editor:e,rules:t}=n,r=new wt({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return Pc({editor:e,from:o,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Pc({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Pc({editor:e,from:a.pos,to:a.pos,text:`
|
|
36
|
-
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
31
|
+
`);return{dom:f,text:_}}function bg(n,e,t,r,i){let o=i.parent.type.spec.code,l,u;if(!t&&!e)return null;let f=e&&(r||o||!t);if(f){if(n.someProp("transformPastedText",_=>{e=_(e,o||r,n)}),o)return e?new K(B.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
32
|
+
`))),0,0):K.empty;let p=n.someProp("clipboardTextParser",_=>_(e,i,r,n));if(p)u=p;else{let _=i.marks(),{schema:S}=n.state,k=Ur.fromSchema(S);l=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=l.appendChild(document.createElement("p"));m&&b.appendChild(k.serializeNode(S.text(m,_)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),l=zC(t),wc&&VC(l);let d=l&&l.querySelector("[data-pm-slice]"),g=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(g&&g[3])for(let p=+g[3];p>0;p--){let _=l.firstChild;for(;_&&_.nodeType!=1;)_=_.nextSibling;if(!_)break;l=_}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||sc.fromSchema(n.state.schema)).parseSlice(l,{preserveWhitespace:!!(f||g),context:i,ruleFromNode(_){return _.nodeName=="BR"&&!_.nextSibling&&_.parentNode&&!HC.test(_.parentNode.nodeName)?{ignore:!0}:null}})),g)u=WC(Sg(u,+g[1],+g[2]),g[4]);else if(u=K.maxOpen($C(u.content,i),!0),u.openStart||u.openEnd){let p=0,_=0;for(let S=u.content.firstChild;p<u.openStart&&!S.type.spec.isolating;p++,S=S.firstChild);for(let S=u.content.lastChild;_<u.openEnd&&!S.type.spec.isolating;_++,S=S.lastChild);u=Sg(u,p,_)}return n.someProp("transformPasted",p=>{u=p(u,n)}),u}const HC=/^(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 $C(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,l=[];if(n.forEach(u=>{if(!l)return;let f=i.findWrapping(u.type),d;if(!f)return l=null;if(d=l.length&&o.length&&vg(f,o,u,l[l.length-1],0))l[l.length-1]=d;else{l.length&&(l[l.length-1]=wg(l[l.length-1],o.length));let g=_g(u,f);l.push(g),i=i.matchType(g.type),o=f}}),l)return B.from(l)}return n}function _g(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,B.from(n));return n}function vg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=vg(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(B.from(_g(t,n,i+1))))}}function wg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,wg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(B.empty,!0);return n.copy(t.append(r))}function Oc(n,e,t,r,i,o){let l=e<0?n.firstChild:n.lastChild,u=l.content;return i<r-1&&(u=Oc(u,e,t,r,i+1,o)),i>=t&&(u=e<0?l.contentMatchAt(0).fillBefore(u,n.childCount>1||o<=i).append(u):u.append(l.contentMatchAt(l.childCount).fillBefore(B.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,l.copy(u))}function Sg(n,e,t){return e<n.openStart&&(n=new K(Oc(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new K(Oc(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const xg={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Eg=null;function kg(){return Eg||(Eg=document.implementation.createHTMLDocument("title"))}function zC(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=kg().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&xg[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function VC(n){let e=n.querySelectorAll(xi?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function WC(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:l}=n;for(let u=r.length-2;u>=0;u-=2){let f=t.nodes[r[u]];if(!f||f.hasRequiredAttrs())break;i=B.from(f.create(r[u+1],i)),o++,l++}return new K(i,o,l)}const Qt={},At={};function tr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}At.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Ag(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Cs&&xi&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),vc&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,ng(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||BC(n,t)?t.preventDefault():tr(n,"key")},At.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},At.keypress=(n,e)=>{let t=e;if(Ag(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ht&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof me)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function _a(n){return{left:n.clientX,top:n.clientY}}function UC(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Tc(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let l=o.depth+1;l>0;l--)if(n.someProp(e,u=>l>o.depth?u(n,t,o.nodeAfter,o.before(l),i,!0):u(n,t,o.node(l),o.before(l),i,!1)))return!0;return!1}function Ei(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function qC(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&ee.isSelectable(r)?(Ei(n,new ee(t)),!0):!1}function KC(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof ee&&(r=t.node);let o=n.state.doc.resolve(e);for(let l=o.depth+1;l>0;l--){let u=l>o.depth?o.nodeAfter:o.node(l);if(ee.isSelectable(u)){r&&t.$from.depth>0&&l>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(l);break}}return i!=null?(Ei(n,ee.create(n.state.doc,i)),!0):!1}function GC(n,e,t,r,i){return Tc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?KC(n,t):qC(n,t))}function jC(n,e,t,r){return Tc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function JC(n,e,t,r){return Tc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||YC(n,t,r)}function YC(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ei(n,me.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(l.inlineContent)Ei(n,me.create(r,u+1,u+1+l.content.size));else if(ee.isSelectable(l))Ei(n,ee.create(r,u));else continue;return!0}}function Mc(n){return va(n)}const Cg=Ht?"metaKey":"ctrlKey";Qt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Mc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&UC(t,n.input.lastClick)&&!t[Cg]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let l=n.posAtCoords(_a(t));l&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new XC(n,l,t,!!r)):(o=="doubleClick"?jC:JC)(n,l.pos,l.inside,t)?t.preventDefault():tr(n,"pointer"))};class XC{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Cg],this.allowDefault=r.shiftKey;let o,l;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),l=t.inside;else{let g=e.state.doc.resolve(t.pos);o=g.parent,l=g.depth?g.before():0}const u=i?null:r.target,f=u?e.docView.nearestDesc(u,!0):null;this.target=f?f.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof ee&&d.from<=l&&d.to>l)&&(this.mightDrag={node:o,pos:l,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ya&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),tr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Sc(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(_a(e))),this.updateAllowDefault(e),this.allowDefault||!t?tr(this.view,"pointer"):GC(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Mr&&this.mightDrag&&!this.mightDrag.node.isAtom||xi&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ei(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):tr(this.view,"pointer")}move(e){this.updateAllowDefault(e),tr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Qt.touchstart=n=>{n.input.lastTouch=Date.now(),Mc(n),tr(n,"pointer")},Qt.touchmove=n=>{n.input.lastTouch=Date.now(),tr(n,"pointer")},Qt.contextmenu=n=>Mc(n);function Ag(n,e){return n.composing?!0:Mr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const ZC=Cs?5e3:-1;At.compositionstart=At.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),va(n,!0),n.markCursor=null;else if(va(n),ya&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let l=o<0?i.lastChild:i.childNodes[o-1];if(!l)break;if(l.nodeType==3){n.domSelection().collapse(l,l.nodeValue.length);break}else i=l,o=-1}}n.input.composing=!0}Og(n,ZC)},At.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Og(n,20))};function Og(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>va(n),e))}function QC(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=eA());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function eA(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function va(n,e=!1){if(!(Cs&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),QC(n),e||n.docView&&n.docView.dirty){let t=IC(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function tA(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const ki=ks&&sg<15||vc&&MC<604;Qt.copy=At.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=ki?null:t.clipboardData,l=r.content(),{dom:u,text:f}=yg(n,l);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):tA(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function nA(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function rA(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Ic(n,r.value,null,e):Ic(n,r.textContent,r.innerHTML,e)},50)}function Ic(n,e,t,r){let i=bg(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",u=>u(n,r,i||K.empty)))return!0;if(!i)return!1;let o=nA(i),l=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}At.paste=(n,e)=>{let t=e;if(n.composing&&!Cs)return;let r=ki?null:t.clipboardData;r&&Ic(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():rA(n,t)};class iA{constructor(e,t){this.slice=e,this.move=t}}const Tg=Ht?"altKey":"ctrlKey";Qt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(_a(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ee?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(ee.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&n.dispatch(n.state.tr.setSelection(ee.create(n.state.doc,d.posBefore)))}}let l=n.state.selection.content(),{dom:u,text:f}=yg(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(ki?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",ki||t.dataTransfer.setData("text/plain",f),n.dragging=new iA(l,!t[Tg])},Qt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},At.dragover=At.dragenter=(n,e)=>e.preventDefault(),At.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(_a(t));if(!i)return;let o=n.state.doc.resolve(i.pos),l=r&&r.slice;l?n.someProp("transformPasted",k=>{l=k(l,n)}):l=bg(n,t.dataTransfer.getData(ki?"Text":"text/plain"),ki?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[Tg]);if(n.someProp("handleDrop",k=>k(n,t,l||K.empty,u))){t.preventDefault();return}if(!l)return;t.preventDefault();let f=l?gC(n.state.doc,o.pos,l):o.pos;f==null&&(f=o.pos);let d=n.state.tr;u&&d.deleteSelection();let g=d.mapping.map(f),p=l.openStart==0&&l.openEnd==0&&l.content.childCount==1,_=d.doc;if(p?d.replaceRangeWith(g,g,l.content.firstChild):d.replaceRange(g,g,l),d.doc.eq(_))return;let S=d.doc.resolve(g);if(p&&ee.isSelectable(l.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(l.content.firstChild))d.setSelection(new ee(S));else{let k=d.mapping.map(f);d.mapping.maps[d.mapping.maps.length-1].forEach((m,b,x,A)=>k=A),d.setSelection(fg(n,S,d.doc.resolve(k)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},Qt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Sc(n)},20))},Qt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},Qt.beforeinput=(n,e)=>{if(xi&&Cs&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,ng(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in At)Qt[n]=At[n];function Os(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class If{constructor(e,t){this.toDOM=e,this.spec=t||Nr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:l}=e.mapResult(t.from+i,this.side<0?-1:1);return l?null:new bn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof If&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Os(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class cr{constructor(e,t){this.attrs=e,this.spec=t||Nr}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,l=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=l?null:new bn(o,l,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof cr&&Os(this.attrs,e.attrs)&&Os(this.spec,e.spec)}static is(e){return e.type instanceof cr}destroy(){}}class Nf{constructor(e,t){this.attrs=e,this.spec=t||Nr}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let l=e.mapResult(t.to+i,-1);return l.deleted||l.pos<=o.pos?null:new bn(o.pos-r,l.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof Nf&&Os(this.attrs,e.attrs)&&Os(this.spec,e.spec)}destroy(){}}class bn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new bn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new bn(e,e,new If(t,r))}static inline(e,t,r,i){return new bn(e,t,new cr(r,i))}static node(e,t,r,i){return new bn(e,t,new Nf(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof cr}}const Ci=[],Nr={};class Ue{constructor(e,t){this.local=e.length?e:Ci,this.children=t.length?t:Ci}static create(e,t){return t.length?wa(t,e,0,Nr):ft}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let l=0;l<this.local.length;l++){let u=this.local[l];u.from<=t&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let l=0;l<this.children.length;l+=3)if(this.children[l]<t&&this.children[l+1]>e){let u=this.children[l]+1;this.children[l+2].findInner(e-u,t-u,r,i+u,o)}}map(e,t,r){return this==ft||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Nr)}mapInner(e,t,r,i,o){let l;for(let u=0;u<this.local.length;u++){let f=this.local[u].map(e,r,i);f&&f.type.valid(t,f)?(l||(l=[])).push(f):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?sA(this.children,l||[],e,t,r,i,o):l?new Ue(l.sort(Rr),Ci):ft}add(e,t){return t.length?this==ft?Ue.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((u,f)=>{let d=f+r,g;if(g=Ig(t,u,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<f;)o+=3;i[o]==f?i[o+2]=i[o+2].addInner(u,g,d+1):i.splice(o,0,f,f+u.nodeSize,wa(g,u,d+1,Nr)),o+=3}});let l=Mg(o?Ng(t):t,-r);for(let u=0;u<l.length;u++)l[u].type.valid(e,l[u])||l.splice(u--,1);return new Ue(l.length?this.local.concat(l).sort(Rr):this.local,i||this.children)}remove(e){return e.length==0||this==ft?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let l,u=r[o]+t,f=r[o+1]+t;for(let g=0,p;g<e.length;g++)(p=e[g])&&p.from>u&&p.to<f&&(e[g]=null,(l||(l=[])).push(p));if(!l)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(l,u+1);d!=ft?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,l;o<e.length;o++)if(l=e[o])for(let u=0;u<i.length;u++)i[u].eq(l,t)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ue(i,r):ft}forChild(e,t){if(this==ft)return this;if(t.isLeaf)return Ue.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let o=e+1,l=o+t.content.size;for(let u=0;u<this.local.length;u++){let f=this.local[u];if(f.from<l&&f.to>o&&f.type instanceof cr){let d=Math.max(o,f.from)-o,g=Math.min(l,f.to)-o;d<g&&(i||(i=[])).push(f.copy(d,g))}}if(i){let u=new Ue(i.sort(Rr),Ci);return r?new Wr([u,r]):u}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof Ue)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Nc(this.localsInner(e))}localsInner(e){if(this==ft)return Ci;if(e.inlineContent||!this.local.some(cr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof cr||t.push(this.local[r]);return t}}Ue.empty=new Ue([],[]),Ue.removeOverlap=Nc;const ft=Ue.empty;class Wr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Nr));return Wr.from(r)}forChild(e,t){if(t.isLeaf)return Ue.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ft&&(o instanceof Wr?r=r.concat(o.members):r.push(o))}return Wr.from(r)}eq(e){if(!(e instanceof Wr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let l=0;l<o.length;l++)t.push(o[l])}}return t?Nc(r?t:t.sort(Rr)):Ci}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new Wr(e.every(t=>t instanceof Ue)?e:e.reduce((t,r)=>t.concat(r instanceof Ue?r:r.members),[]))}}}function sA(n,e,t,r,i,o,l){let u=n.slice();for(let d=0,g=o;d<t.maps.length;d++){let p=0;t.maps[d].forEach((_,S,k,m)=>{let b=m-k-(S-_);for(let x=0;x<u.length;x+=3){let A=u[x+1];if(A<0||_>A+g-p)continue;let O=u[x]+g-p;S>=O?u[x+1]=_<=O?-2:-1:k>=i&&b&&(u[x]+=b,u[x+1]+=b)}p+=b}),g=t.maps[d].map(g,-1)}let f=!1;for(let d=0;d<u.length;d+=3)if(u[d+1]<0){if(u[d+1]==-2){f=!0,u[d+1]=-1;continue}let g=t.map(n[d]+o),p=g-i;if(p<0||p>=r.content.size){f=!0;continue}let _=t.map(n[d+1]+o,-1),S=_-i,{index:k,offset:m}=r.content.findIndex(p),b=r.maybeChild(k);if(b&&m==p&&m+b.nodeSize==S){let x=u[d+2].mapInner(t,b,g+1,n[d]+o+1,l);x!=ft?(u[d]=p,u[d+1]=S,u[d+2]=x):(u[d+1]=-2,f=!0)}else f=!0}if(f){let d=oA(u,n,e,t,i,o,l),g=wa(d,r,0,l);e=g.local;for(let p=0;p<u.length;p+=3)u[p+1]<0&&(u.splice(p,3),p-=3);for(let p=0,_=0;p<g.children.length;p+=3){let S=g.children[p];for(;_<u.length&&u[_]<S;)_+=3;u.splice(_,0,g.children[p],g.children[p+1],g.children[p+2])}}return new Ue(e.sort(Rr),u)}function Mg(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new bn(i.from+e,i.to+e,i.type))}return t}function oA(n,e,t,r,i,o,l){function u(f,d){for(let g=0;g<f.local.length;g++){let p=f.local[g].map(r,i,d);p?t.push(p):l.onRemove&&l.onRemove(f.local[g].spec)}for(let g=0;g<f.children.length;g+=3)u(f.children[g+2],f.children[g]+d+1)}for(let f=0;f<n.length;f+=3)n[f+1]==-1&&u(n[f+2],e[f]+o+1);return t}function Ig(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,l;o<n.length;o++)(l=n[o])&&l.from>t&&l.to<r&&((i||(i=[])).push(l),n[o]=null);return i}function Ng(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function wa(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let d=Ig(n,u,f+t);if(d){o=!0;let g=wa(d,u,t+f+1,r);g!=ft&&i.push(f,f+u.nodeSize,g)}});let l=Mg(o?Ng(n):n,-t).sort(Rr);for(let u=0;u<l.length;u++)l[u].type.valid(e,l[u])||(r.onRemove&&r.onRemove(l[u].spec),l.splice(u--,1));return l.length||i.length?new Ue(l,i):ft}function Rr(n,e){return n.from-e.from||n.to-e.to}function Nc(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),Rg(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),Rg(e,i,r.copy(o.from,r.to)));break}}}return e}function Rg(n,e,t){for(;e<n.length&&Rr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var nr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Sa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),aA=typeof navigator<"u"&&/Mac/.test(navigator.platform),lA=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),uA=aA||Lg&&+Lg[1]<57,Xe=0;Xe<10;Xe++)nr[48+Xe]=nr[96+Xe]=String(Xe);for(var Xe=1;Xe<=24;Xe++)nr[Xe+111]="F"+Xe;for(var Xe=65;Xe<=90;Xe++)nr[Xe]=String.fromCharCode(Xe+32),Sa[Xe]=String.fromCharCode(Xe);for(var Rc in nr)Sa.hasOwnProperty(Rc)||(Sa[Rc]=nr[Rc]);function cA(n){var e=uA&&(n.ctrlKey||n.altKey||n.metaKey)||lA&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Sa:nr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const fA=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function hA(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,l;for(let u=0;u<e.length-1;u++){let f=e[u];if(/^(cmd|meta|m)$/i.test(f))l=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))fA?l=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),l&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function dA(n){let e=Object.create(null);for(let t in n)e[hA(t)]=n[t];return e}function Lc(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}function pA(n){return new Ct({props:{handleKeyDown:mA(n)}})}function mA(n){let e=dA(n);return function(t,r){let i=cA(r),o=i.length==1&&i!=" ",l,u=e[Lc(i,r,!o)];if(u&&u(t.state,t.dispatch,t))return!0;if(o&&(r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(l=nr[r.keyCode])&&l!=i){let f=e[Lc(l,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[Lc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const gA=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function yA(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const bA=(n,e,t)=>{let r=yA(n,t);if(!r)return!1;let i=Pg(r);if(!i){let l=r.blockRange(),u=l&&_i(l);return u==null?!1:(e&&e(n.tr.lift(l,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Bg(n,i,e))return!0;if(r.parent.content.size==0&&(Ai(o,"end")||ee.isSelectable(o))){let l=hc(n.doc,r.before(),r.after(),K.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=n.tr.step(l);u.setSelection(Ai(o,"end")?pe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ee.create(u.doc,i.pos-o.nodeSize)),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Ai(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const _A=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=Pg(r)}let l=o&&o.nodeBefore;return!l||!ee.isSelectable(l)?!1:(e&&e(n.tr.setSelection(ee.create(n.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function Pg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function vA(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const wA=(n,e,t)=>{let r=vA(n,t);if(!r)return!1;let i=Dg(r);if(!i)return!1;let o=i.nodeAfter;if(Bg(n,i,e))return!0;if(r.parent.content.size==0&&(Ai(o,"start")||ee.isSelectable(o))){let l=hc(n.doc,r.before(),r.after(),K.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=n.tr.step(l);u.setSelection(Ai(o,"start")?pe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):ee.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},SA=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=Dg(r)}let l=o&&o.nodeAfter;return!l||!ee.isSelectable(l)?!1:(e&&e(n.tr.setSelection(ee.create(n.doc,o.pos)).scrollIntoView()),!0)};function Dg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const xA=(n,e)=>{let t=n.selection,r=t instanceof ee,i;if(r){if(t.node.isTextblock||!Zn(n.doc,t.from))return!1;i=t.from}else if(i=pa(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(ee.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},EA=(n,e)=>{let t=n.selection,r;if(t instanceof ee){if(t.node.isTextblock||!Zn(n.doc,t.to))return!1;r=t.to}else if(r=pa(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},kA=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&_i(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},CA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
33
|
+
`).scrollIntoView()),!0)};function Fg(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const AA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),l=Fg(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(e){let u=t.after(),f=n.tr.replaceWith(u,u,l.createAndFill());f.setSelection(pe.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},OA=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof tn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Fg(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let l=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(l,o.createAndFill());u.setSelection(me.create(u.doc,l+1)),e(u.scrollIntoView())}return!0},TA=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(vi(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&_i(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},MA=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(ee.create(n.doc,i))),!0)};function IA(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Zn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Bg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,l;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(IA(n,e,t))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(l=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(t){let p=e.pos+i.nodeSize,_=B.empty;for(let m=o.length-1;m>=0;m--)_=B.from(o[m].create(null,_));_=B.from(r.copy(_));let S=n.tr.step(new We(e.pos-1,p,e.pos,p,new K(_,1,0),o.length,!0)),k=p+2*o.length;Zn(S.doc,k)&&S.join(k),t(S.scrollIntoView())}return!0}let f=pe.findFrom(e,1),d=f&&f.$from.blockRange(f.$to),g=d&&_i(d);if(g!=null&&g>=e.depth)return t&&t(n.tr.lift(d,g).scrollIntoView()),!0;if(u&&Ai(i,"start",!0)&&Ai(r,"end")){let p=r,_=[];for(;_.push(p),!p.isTextblock;)p=p.lastChild;let S=i,k=1;for(;!S.isTextblock;S=S.firstChild)k++;if(p.canReplace(p.childCount,p.childCount,S.content)){if(t){let m=B.empty;for(let x=_.length-1;x>=0;x--)m=B.from(_[x].copy(m));let b=n.tr.step(new We(e.pos-_.length,e.pos+i.nodeSize,e.pos+k,e.pos+i.nodeSize-k,new K(m,_.length,0),0,!0));t(b.scrollIntoView())}return!0}}return!1}function Hg(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(me.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const NA=Hg(-1),RA=Hg(1);function LA(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,l=i.blockRange(o),u=l&&fc(l,n,e);return u?(r&&r(t.tr.wrap(l,u).scrollIntoView()),!0):!1}}function $g(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:l},$to:{pos:u}}=t.selection.ranges[o];t.doc.nodesBetween(l,u,(f,d)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let g=t.doc.resolve(d),p=g.index();i=g.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let l=0;l<t.selection.ranges.length;l++){let{$from:{pos:u},$to:{pos:f}}=t.selection.ranges[l];o.setBlockType(u,f,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function PA(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,l=i.blockRange(o),u=!1,f=l;if(!l)return!1;if(l.depth>=2&&i.node(l.depth-1).type.compatibleContent(n)&&l.startIndex==0){if(i.index(l.depth-1)==0)return!1;let g=t.doc.resolve(l.start-2);f=new ua(g,g,l.depth),l.endIndex<l.parent.childCount&&(l=new ua(i,t.doc.resolve(o.end(l.depth)),l.depth)),u=!0}let d=fc(f,n,e,l);return d?(r&&r(DA(t.tr,l,d,u,n).scrollIntoView()),!0):!1}}function DA(n,e,t,r,i){let o=B.empty;for(let g=t.length-1;g>=0;g--)o=B.from(t[g].type.create(t[g].attrs,o));n.step(new We(e.start-(r?2:0),e.end,e.start,e.end,new K(o,0,0),t.length,!0));let l=0;for(let g=0;g<t.length;g++)t[g].type==i&&(l=g+1);let u=t.length-l,f=e.start+t.length-(r?2:0),d=e.parent;for(let g=e.startIndex,p=e.endIndex,_=!0;g<p;g++,_=!1)!_&&vi(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=d.child(g).nodeSize;return n}function FA(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,l=>l.childCount>0&&l.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?BA(e,t,n,o):HA(e,t,o):!0:!1}}function BA(n,e,t,r){let i=n.tr,o=r.end,l=r.$to.end(r.depth);o<l&&(i.step(new We(o-1,l,o,l,new K(B.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new ua(i.doc.resolve(r.$from.pos),i.doc.resolve(l),r.depth));const u=_i(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return Zn(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function HA(n,e,t){let r=n.tr,i=t.parent;for(let S=t.end,k=t.endIndex-1,m=t.startIndex;k>m;k--)S-=i.child(k).nodeSize,r.delete(S-1,S+1);let o=r.doc.resolve(t.start),l=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let u=t.startIndex==0,f=t.endIndex==i.childCount,d=o.node(-1),g=o.index(-1);if(!d.canReplace(g+(u?0:1),g+1,l.content.append(f?B.empty:B.from(i))))return!1;let p=o.pos,_=p+l.nodeSize;return r.step(new We(p-(u?1:0),_+(f?1:0),p+1,_-1,new K((u?B.empty:B.from(i.copy(B.empty))).append(f?B.empty:B.from(i.copy(B.empty))),u?0:1,f?0:1),u?0:1)),e(r.scrollIntoView()),!0}function $A(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!o)return!1;let l=o.startIndex;if(l==0)return!1;let u=o.parent,f=u.child(l-1);if(f.type!=n)return!1;if(t){let d=f.lastChild&&f.lastChild.type==u.type,g=B.from(d?n.create():null),p=new K(B.from(n.create(null,B.from(u.type.create(null,g)))),d?3:1,0),_=o.start,S=o.end;t(e.tr.step(new We(_-(d?3:1),S,_,S,p,1,!0)).scrollIntoView())}return!0}}function xa(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class Pc{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,l=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,f])=>[u,(...g)=>{const p=f(...g)(l);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:l}=i,u=[],f=!!e,d=e||o.tr,g=()=>(!f&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(d),u.every(_=>_===!0)),p={...Object.fromEntries(Object.entries(r).map(([_,S])=>[_,(...m)=>{const b=this.buildProps(d,t),x=S(...m)(b);return u.push(x),p}])),run:g};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,l=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,d])=>[f,(...g)=>d(...g)({...l,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:l}=i,u={tr:e,editor:i,view:l,state:xa({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([f,d])=>[f,(...g)=>d(...g)(u)]))}};return u}}function G(n,e,t){return n.config[e]===void 0&&n.parent?G(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?G(n.parent,e,t):null}):n.config[e]}function Ea(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function zg(n){const e=[],{nodeExtensions:t,markExtensions:r}=Ea(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(l=>{const u={name:l.name,options:l.options,storage:l.storage},f=G(l,"addGlobalAttributes",u);if(!f)return;f().forEach(g=>{g.types.forEach(p=>{Object.entries(g.attributes).forEach(([_,S])=>{e.push({type:p,name:_,attribute:{...o,...S}})})})})}),i.forEach(l=>{const u={name:l.name,options:l.options,storage:l.storage},f=G(l,"addAttributes",u);if(!f)return;const d=f();Object.entries(d).forEach(([g,p])=>{const _={...o,...p};typeof _?.default=="function"&&(_.default=_.default()),_?.isRequired&&_?.default===void 0&&delete _.default,e.push({type:l.name,name:g,attribute:_})})}),e}function ze(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Oi(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const u=o?o.split(" "):[],f=r[i]?r[i].split(" "):[],d=u.filter(g=>!f.includes(g));r[i]=[...f,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Dc(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Oi(t,r),{})}function zA(n){return typeof n=="function"}function le(n,e=void 0,...t){return zA(n)?e?n.bind(e)(...t):n(...t):n}function VA(n={}){return Object.keys(n).length===0&&n.constructor===Object}function WA(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Vg(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,l)=>{const u=l.attribute.parseHTML?l.attribute.parseHTML(t):WA(t.getAttribute(l.name));return u==null?o:{...o,[l.name]:u}},{});return{...r,...i}}}}function Wg(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&VA(t)?!1:t!=null))}function Ug(n,e){var t;const r=zg(n),{nodeExtensions:i,markExtensions:o}=Ea(n),l=(t=i.find(d=>G(d,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(d=>{const g=r.filter(x=>x.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},_=n.reduce((x,A)=>{const O=G(A,"extendNodeSchema",p);return{...x,...O?O(d):{}}},{}),S=Wg({..._,content:le(G(d,"content",p)),marks:le(G(d,"marks",p)),group:le(G(d,"group",p)),inline:le(G(d,"inline",p)),atom:le(G(d,"atom",p)),selectable:le(G(d,"selectable",p)),draggable:le(G(d,"draggable",p)),code:le(G(d,"code",p)),defining:le(G(d,"defining",p)),isolating:le(G(d,"isolating",p)),attrs:Object.fromEntries(g.map(x=>{var A;return[x.name,{default:(A=x?.attribute)===null||A===void 0?void 0:A.default}]}))}),k=le(G(d,"parseHTML",p));k&&(S.parseDOM=k.map(x=>Vg(x,g)));const m=G(d,"renderHTML",p);m&&(S.toDOM=x=>m({node:x,HTMLAttributes:Dc(x,g)}));const b=G(d,"renderText",p);return b&&(S.toText=b),[d.name,S]})),f=Object.fromEntries(o.map(d=>{const g=r.filter(b=>b.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},_=n.reduce((b,x)=>{const A=G(x,"extendMarkSchema",p);return{...b,...A?A(d):{}}},{}),S=Wg({..._,inclusive:le(G(d,"inclusive",p)),excludes:le(G(d,"excludes",p)),group:le(G(d,"group",p)),spanning:le(G(d,"spanning",p)),code:le(G(d,"code",p)),attrs:Object.fromEntries(g.map(b=>{var x;return[b.name,{default:(x=b?.attribute)===null||x===void 0?void 0:x.default}]}))}),k=le(G(d,"parseHTML",p));k&&(S.parseDOM=k.map(b=>Vg(b,g)));const m=G(d,"renderHTML",p);return m&&(S.toDOM=b=>m({mark:b,HTMLAttributes:Dc(b,g)})),[d.name,S]}));return new Gk({topNode:l,nodes:u,marks:f})}function Fc(n,e){return e.nodes[n]||e.marks[n]||null}function qg(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const UA=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,l,u)=>{var f,d;const g=((d=(f=i.type.spec).toText)===null||d===void 0?void 0:d.call(f,{node:i,pos:o,parent:l,index:u}))||i.textContent||"%leaf%";t+=g.slice(0,Math.max(0,r-o))}),t};function Bc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Kg{constructor(e){this.find=e.find,this.handler=e.handler}}const qA=(n,e)=>{if(Bc(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Hc(n){var e;const{editor:t,from:r,to:i,text:o,rules:l,plugin:u}=n,{view:f}=t;if(f.composing)return!1;const d=f.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(_=>_.type.spec.code))return!1;let g=!1;const p=UA(d)+o;return l.forEach(_=>{if(g)return;const S=qA(p,_.find);if(!S)return;const k=f.state.tr,m=xa({state:f.state,transaction:k}),b={from:r-(S[0].length-o.length),to:i},{commands:x,chain:A,can:O}=new Pc({editor:t,state:m});_.handler({state:m,range:b,match:S,commands:x,chain:A,can:O})===null||!k.steps.length||(k.setMeta(u,{transform:k,from:r,to:i,text:o}),f.dispatch(k),g=!0)}),g}function KA(n){const{editor:e,rules:t}=n,r=new Ct({state:{init(){return null},apply(i,o){const l=i.getMeta(r);return l||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,l,u){return Hc({editor:e,from:o,to:l,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Hc({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:l}=i.state.selection;return l?Hc({editor:e,from:l.pos,to:l.pos,text:`
|
|
34
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function GA(n){return typeof n=="number"}class jA{constructor(e){this.find=e.find,this.handler=e.handler}}const JA=(n,e)=>{if(Bc(e))return[...n.matchAll(e)];const t=e(n);return t?t.map(r=>{const i=[r.text];return i.index=r.index,i.input=n,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function YA(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:l,dropEvent:u}=n,{commands:f,chain:d,can:g}=new Pc({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(S,k)=>{if(!S.isTextblock||S.type.spec.code)return;const m=Math.max(r,k),b=Math.min(i,k+S.content.size),x=S.textBetween(m-k,b-k,void 0,"\uFFFC");JA(x,o.find).forEach(O=>{if(O.index===void 0)return;const R=m+O.index+1,W=R+O[0].length,D={from:t.tr.mapping.map(R),to:t.tr.mapping.map(W)},U=o.handler({state:t,range:D,match:O,commands:f,chain:d,can:g,pasteEvent:l,dropEvent:u});p.push(U)})}),p.every(S=>S!==null)}function XA(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,l=new ClipboardEvent("paste"),u=new DragEvent("drop");return t.map(d=>new Ct({view(g){const p=_=>{var S;r=!((S=g.dom.parentElement)===null||S===void 0)&&S.contains(_.target)?g.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(g,p)=>(o=r===g.dom.parentElement,u=p,!1),paste:(g,p)=>{var _;const S=(_=p.clipboardData)===null||_===void 0?void 0:_.getData("text/html");return l=p,i=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(g,p,_)=>{const S=g[0],k=S.getMeta("uiEvent")==="paste"&&!i,m=S.getMeta("uiEvent")==="drop"&&!o;if(!k&&!m)return;const b=p.doc.content.findDiffStart(_.doc.content),x=p.doc.content.findDiffEnd(_.doc.content);if(!GA(b)||!x||b===x.b)return;const A=_.tr,O=xa({state:_,transaction:A});if(!(!YA({editor:e,state:O,from:Math.max(b-1,0),to:x.b-1,rule:d,pasteEvent:l,dropEvent:u})||!A.steps.length))return u=new DragEvent("drop"),l=new ClipboardEvent("paste"),A}}))}function ZA(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Fi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Fi.resolve(e),this.schema=Ug(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Fc(r.name,this.schema)};r.type==="mark"&&(!((i=le(G(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const l=G(r,"onBeforeCreate",o);l&&this.editor.on("beforeCreate",l);const u=G(r,"onCreate",o);u&&this.editor.on("create",u);const f=G(r,"onUpdate",o);f&&this.editor.on("update",f);const d=G(r,"onSelectionUpdate",o);d&&this.editor.on("selectionUpdate",d);const g=G(r,"onTransaction",o);g&&this.editor.on("transaction",g);const p=G(r,"onFocus",o);p&&this.editor.on("focus",p);const _=G(r,"onBlur",o);_&&this.editor.on("blur",_);const S=G(r,"onDestroy",o);S&&this.editor.on("destroy",S)})}static resolve(e){const t=Fi.sort(Fi.flatten(e)),r=ZA(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=G(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=G(r,"priority")||100,l=G(i,"priority")||100;return o>l?-1:o<l?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Fc(t.name,this.schema)},i=G(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Fi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(l=>{const u={name:l.name,options:l.options,storage:l.storage,editor:e,type:Fc(l.name,this.schema)},f=[],d=G(l,"addKeyboardShortcuts",u);let g={};if(l.type==="mark"&&l.config.exitable&&(g.ArrowRight=()=>Ot.handleExit({editor:e,mark:l})),d){const m=Object.fromEntries(Object.entries(d()).map(([b,x])=>[b,()=>x({editor:e})]));g={...g,...m}}const p=pA(g);f.push(p);const _=G(l,"addInputRules",u);qg(l,e.options.enableInputRules)&&_&&r.push(..._());const S=G(l,"addPasteRules",u);qg(l,e.options.enablePasteRules)&&S&&i.push(...S());const k=G(l,"addProseMirrorPlugins",u);if(k){const m=k();f.push(...m)}return f}).flat();return[KA({editor:e,rules:r}),...XA({editor:e,rules:i}),...o]}get attributes(){return zg(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Ea(this.extensions);return Object.fromEntries(t.filter(r=>!!G(r,"addNodeView")).map(r=>{const i=this.attributes.filter(f=>f.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:ze(r.name,this.schema)},l=G(r,"addNodeView",o);if(!l)return[];const u=(f,d,g,p)=>{const _=Dc(f,i);return l()({editor:e,node:f,getPos:g,decorations:p,HTMLAttributes:_,extension:r})};return[r.name,u]}))}}function QA(n){return Object.prototype.toString.call(n).slice(8,-1)}function $c(n){return QA(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function ka(n,e){const t={...n};return $c(n)&&$c(e)&&Object.keys(e).forEach(r=>{$c(e[r])?r in n?t[r]=ka(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class Pe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=le(G(this,"addOptions",{name:this.name}))),this.storage=le(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pe(e)}configure(e={}){const t=this.extend();return t.options=ka(this.options,e),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Pe(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=le(G(t,"addOptions",{name:t.name})),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}}function eO(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
37
35
|
|
|
38
|
-
`,textSerializers:a={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(d,p,m,y)=>{var v;const S=a?.[d.type.name];S?(d.isBlock&&!f&&(u+=o,f=!0),m&&(u+=S({node:d,pos:p,parent:m,index:y,range:e}))):d.isText?(u+=(v=d?.text)===null||v===void 0?void 0:v.slice(Math.max(r,p)-p,i-p),f=!1):d.isBlock&&!f&&(u+=o,f=!0)}),u}function gO(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Re.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new wt({key:new Gt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(p=>p.$from.pos)),u=Math.max(...o.map(p=>p.$to.pos)),f=gO(t);return mO(r,{from:a,to:u},{textSerializers:f})}}})]}});const yO=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),bO=(n=!1)=>({commands:e})=>e.setContent("",n),_O=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(u,f)=>{if(u.type.isText)return;const{doc:d,mapping:p}=e,m=d.resolve(p.map(f)),y=d.resolve(p.map(f+u.nodeSize)),v=m.blockRange(y);if(!v)return;const S=yi(v);if(u.type.isTextblock){const{defaultType:C}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(v.start,C)}(S||S===0)&&e.lift(v,S)})}),!0},vO=n=>e=>n(e),wO=()=>({state:n,dispatch:e})=>WA(n,e),SO=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new de(r.doc.resolve(a-1))),!0},xO=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const u=i.before(o),f=i.after(o);n.delete(u,f).scrollIntoView()}return!0}return!1},EO=n=>({tr:e,state:t,dispatch:r})=>{const i=$e(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const f=o.before(a),d=o.after(a);e.delete(f,d).scrollIntoView()}return!0}return!1},kO=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},CO=()=>({state:n,dispatch:e})=>IA(n,e),AO=()=>({commands:n})=>n.keyboardShortcut("Enter"),OO=()=>({state:n,dispatch:e})=>VA(n,e);function _l(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Lc(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Fc(n,e,t={}){return n.find(r=>r.type===e&&_l(r.attrs,t))}function TO(n,e,t={}){return!!Fc(n,e,t)}function $c(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Fc([...r.node.marks],e,t);if(!i)return;let o=r.index,a=n.start()+r.offset,u=o+1,f=a+r.node.nodeSize;for(Fc([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,a-=n.parent.child(o).nodeSize;for(;u<n.parent.childCount&&TO([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:a,to:f}}function sn(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const MO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=sn(n,r.schema),{doc:a,selection:u}=t,{$from:f,from:d,to:p}=u;if(i){const m=$c(f,o,e);if(m&&m.from<=d&&m.to>=p){const y=de.create(a,m.from,m.to);t.setSelection(y)}}return!0},IO=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Yg(n){return n instanceof de}function Rr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function NO(n,e=null){if(!e)return null;const t=he.atStart(n),r=he.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?de.create(n,Rr(0,i,o),Rr(n.content.size,i,o)):de.create(n,Rr(e,i,o),Rr(e,i,o))}function Bc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const RO=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{Bc()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Yg(t.state.selection))return a(),!0;const u=NO(i.doc,n)||t.state.selection,f=t.state.selection.eq(u);return o&&(f||i.setSelection(u),f&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},LO=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),PO=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function Xg(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function vl(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?L.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),vl("",e,t)}if(typeof n=="string"){const r=tc.fromSchema(e);return t.slice?r.parseSlice(Xg(n),t.parseOptions).content:r.parse(Xg(n),t.parseOptions)}return vl("",e,t)}function DO(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof Ze||i instanceof He))return;const o=n.mapping.maps[r];let a=0;o.forEach((u,f,d,p)=>{a===0&&(a=p)}),n.setSelection(he.near(n.doc.resolve(a),t))}const FO=n=>n.toString().startsWith("<"),$O=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=vl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:f}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,p=!0;if((FO(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),u===f&&p){const{parent:y}=r.doc.resolve(u);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(u-=1,f+=1)}d?Array.isArray(e)?r.insertText(e.map(y=>y.text||"").join(""),u,f):typeof e=="object"&&e&&e.text?r.insertText(e.text,u,f):r.insertText(e,u,f):r.replaceWith(u,f,a),t.updateSelection&&DO(r,r.steps.length-1,-1)}return!0},BO=()=>({state:n,dispatch:e})=>$A(n,e),HO=()=>({state:n,dispatch:e})=>BA(n,e),zO=()=>({state:n,dispatch:e})=>RA(n,e),VO=()=>({state:n,dispatch:e})=>DA(n,e),WO=()=>({tr:n,state:e,dispatch:t})=>{try{const r=ll(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},UO=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ll(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Zg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function KO(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let u=0;u<e.length-1;u+=1){const f=e[u];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))Bc()||Zg()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const qO=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=KO(n).split(/-(?!$)/),a=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),f=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,u))});return f?.steps.forEach(d=>{const p=d.map(r.mapping);p&&i&&r.maybeStep(p)}),!0};function Hc(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?$e(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(m,y)=>{if(m.isText)return;const v=Math.max(r,y),S=Math.min(i,y+m.nodeSize);u.push({node:m,from:v,to:S})});const f=i-r,d=u.filter(m=>a?a.name===m.node.type.name:!0).filter(m=>_l(m.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((m,y)=>m+y.to-y.from,0)>=f}const GO=(n,e={})=>({state:t,dispatch:r})=>{const i=$e(n,t.schema);return Hc(t,i,e)?HA(t,r):!1},jO=()=>({state:n,dispatch:e})=>UA(n,e),JO=n=>({state:e,dispatch:t})=>{const r=$e(n,e.schema);return ZA(r)(e,t)},YO=()=>({state:n,dispatch:e})=>zA(n,e);function zc(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Qg(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const XO=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=zc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=$e(n,r.schema)),u==="mark"&&(a=sn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(d,p)=>{o&&o===d.type&&t.setNodeMarkup(p,void 0,Qg(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(m=>{a===m.type&&t.addMark(p,p+d.nodeSize,a.create(Qg(m.attrs,e)))})})}),!0):!1},ZO=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),QO=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),eT=()=>({state:n,dispatch:e})=>LA(n,e),tT=()=>({state:n,dispatch:e})=>FA(n,e),nT=()=>({state:n,dispatch:e})=>KA(n,e),rT=()=>({state:n,dispatch:e})=>jA(n,e),iT=()=>({state:n,dispatch:e})=>GA(n,e);function sT(n,e,t={}){return vl(n,e,{slice:!1,parseOptions:t})}const oT=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=sT(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!e),!0};function e0(n,e){const t=sn(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{a.push(...f.marks)});const u=a.find(f=>f.type.name===t.name);return u?{...u.attrs}:{}}function lT(n,e){const t=new $C(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function aT(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function uT(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function cT(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Vc(n){return e=>cT(e.$from,n)}function fT(n,e){const t=Pi.resolve(n);return Gg(t,e)}function hT(n,e){const t=$e(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===t.name);return a?{...a.attrs}:{}}function dT(n,e){const t=zc(typeof e=="string"?e:e.name,n.schema);return t==="node"?hT(n,e):t==="mark"?e0(n,e):{}}function pT(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function mT(n){const e=pT(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,a)=>a!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function gT(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const a=[];if(i.ranges.length)i.forEach((u,f)=>{a.push({from:u,to:f})});else{const{from:u,to:f}=t[o];if(u===void 0||f===void 0)return;a.push({from:u,to:f})}a.forEach(({from:u,to:f})=>{const d=e.slice(o).map(u,-1),p=e.slice(o).map(f),m=e.invert().map(d,-1),y=e.invert().map(p);r.push({oldRange:{from:m,to:y},newRange:{from:d,to:p}})})}),mT(r)}function t0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=$c(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function wl(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function yT(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?sn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(m=>o?o.name===m.type.name:!0).find(m=>_l(m.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:m,$to:y})=>{const v=m.pos,S=y.pos;n.doc.nodesBetween(v,S,(C,O)=>{if(!C.isText&&!C.marks.length)return;const N=Math.max(v,O),q=Math.min(S,O+C.nodeSize),K=q-N;a+=K,u.push(...C.marks.map(oe=>({mark:oe,from:N,to:q})))})}),a===0)return!1;const f=u.filter(m=>o?o.name===m.mark.type.name:!0).filter(m=>_l(m.mark.attrs,t,{strict:!1})).reduce((m,y)=>m+y.to-y.from,0),d=u.filter(m=>o?m.mark.type!==o&&m.mark.type.excludes(o):!0).reduce((m,y)=>m+y.to-y.from,0);return(f>0?f+d:f)>=a}function n0(n,e){const{nodeExtensions:t}=yl(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=se(V(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function bT(n,e,t){var r;const{selection:i}=e;let o=null;if(Yg(i)&&(o=i.$cursor),o){const u=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(u)||!u.some(f=>f.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:u,$to:f})=>{let d=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,f.pos,(p,m,y)=>{if(d)return!1;if(p.isInline){const v=!y||y.type.allowsMarkType(t),S=!!t.isInSet(p.marks)||!p.marks.some(C=>C.type.excludes(t));d=v&&S}return!d}),d})}const _T=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:u}=o,f=sn(n,r.schema);if(i)if(a){const d=e0(r,f);t.addStoredMark(f.create({...d,...e}))}else u.forEach(d=>{const p=d.$from.pos,m=d.$to.pos;r.doc.nodesBetween(p,m,(y,v)=>{const S=Math.max(v,p),C=Math.min(v+y.nodeSize,m);y.marks.find(N=>N.type===f)?y.marks.forEach(N=>{f===N.type&&t.addMark(S,C,f.create({...N.attrs,...e}))}):t.addMark(S,C,f.create(e))})});return bT(r,t,f)},vT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),wT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=$e(n,t.schema);return o.isTextblock?i().command(({commands:a})=>Wg(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>Wg(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ST=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Rr(n,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},xT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=de.atStart(r).from,u=de.atEnd(r).to,f=Rr(i,a,u),d=Rr(o,a,u),p=de.create(r,f,d);e.setSelection(p)}return!0},ET=n=>({state:e,dispatch:t})=>{const r=$e(n,e.schema);return tO(r)(e,t)};function r0(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const kT=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:u,$to:f}=o,d=i.extensionManager.attributes,p=wl(d,u.node().type.name,u.node().attrs);if(o instanceof Y&&o.node.isBlock)return!u.parentOffset||!bi(a,u.pos)?!1:(r&&(n&&r0(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const m=f.parentOffset===f.parent.content.size;o instanceof de&&e.deleteSelection();const y=u.depth===0?void 0:aT(u.node(-1).contentMatchAt(u.indexAfter(-1)));let v=m&&y?[{type:y,attrs:p}]:void 0,S=bi(e.doc,e.mapping.map(u.pos),1,v);if(!v&&!S&&bi(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(S=!0,v=y?[{type:y,attrs:p}]:void 0),S&&(e.split(e.mapping.map(u.pos),1,v),y&&!m&&!u.parentOffset&&u.parent.type!==y)){const C=e.mapping.map(u.before()),O=e.doc.resolve(C);u.node(-1).canReplaceWith(O.index(),O.index()+1,y)&&e.setNodeMarkup(e.mapping.map(u.before()),y)}n&&r0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},CT=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=$e(n,t.schema),{$from:u,$to:f}=t.selection,d=t.selection.node;if(d&&d.isBlock||u.depth<2||!u.sameParent(f))return!1;const p=u.node(-1);if(p.type!==a)return!1;const m=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let O=L.empty;const N=u.index(-1)?1:u.index(-2)?2:3;for(let ue=u.depth-N;ue>=u.depth-3;ue-=1)O=L.from(u.node(ue).copy(O));const q=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,K=wl(m,u.node().type.name,u.node().attrs),oe=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(K))||void 0;O=O.append(L.from(a.createAndFill(null,oe)||void 0));const pe=u.before(u.depth-(N-1));e.replace(pe,u.after(-q),new z(O,4-N,0));let $=-1;e.doc.nodesBetween(pe,e.doc.content.size,(ue,at)=>{if($>-1)return!1;ue.isTextblock&&ue.content.size===0&&($=at+1)}),$>-1&&e.setSelection(de.near(e.doc.resolve($))),e.scrollIntoView()}return!0}const y=f.pos===u.end()?p.contentMatchAt(0).defaultType:null,v=wl(m,p.type.name,p.attrs),S=wl(m,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const C=y?[{type:a,attrs:v},{type:y,attrs:S}]:[{type:a,attrs:v}];if(!bi(e.doc,u.pos,2))return!1;if(r){const{selection:O,storedMarks:N}=t,{splittableMarks:q}=i.extensionManager,K=N||O.$to.parentOffset&&O.$from.marks();if(e.split(u.pos,2,C).scrollIntoView(),!K||!r)return!0;const oe=K.filter(pe=>q.includes(pe.type.name));e.ensureMarks(oe)}return!0},Wc=(n,e)=>{const t=Vc(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Gn(n.doc,t.pos)&&n.join(t.pos),!0},Uc=(n,e)=>{const t=Vc(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Gn(n.doc,r)&&n.join(r),!0},AT=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:f,commands:d,can:p})=>{const{extensions:m,splittableMarks:y}=i.extensionManager,v=$e(n,a.schema),S=$e(e,a.schema),{selection:C,storedMarks:O}=a,{$from:N,$to:q}=C,K=N.blockRange(q),oe=O||C.$to.parentOffset&&C.$from.marks();if(!K)return!1;const pe=Vc($=>n0($.type.name,m))(C);if(K.depth>=1&&pe&&K.depth-pe.depth<=1){if(pe.node.type===v)return d.liftListItem(S);if(n0(pe.node.type.name,m)&&v.validContent(pe.node.content)&&u)return f().command(()=>(o.setNodeMarkup(pe.pos,v),!0)).command(()=>Wc(o,v)).command(()=>Uc(o,v)).run()}return!t||!oe||!u?f().command(()=>p().wrapInList(v,r)?!0:d.clearNodes()).wrapInList(v,r).command(()=>Wc(o,v)).command(()=>Uc(o,v)).run():f().command(()=>{const $=p().wrapInList(v,r),ue=oe.filter(at=>y.includes(at.type.name));return o.ensureMarks(ue),$?!0:d.clearNodes()}).wrapInList(v,r).command(()=>Wc(o,v)).command(()=>Uc(o,v)).run()},OT=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=sn(n,r.schema);return yT(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},TT=(n,e,t={})=>({state:r,commands:i})=>{const o=$e(n,r.schema),a=$e(e,r.schema);return Hc(r,o,t)?i.setNode(a):i.setNode(o,t)},MT=(n,e={})=>({state:t,commands:r})=>{const i=$e(n,t.schema);return Hc(t,i,e)?r.lift(i):r.wrapIn(i,e)},IT=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,u=o.transform;for(let f=u.steps.length-1;f>=0;f-=1)a.step(u.steps[f].invert(u.docs[f]));if(o.text){const f=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else a.delete(o.from,o.to)}return!0}}return!1},NT=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},RT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,f=sn(n,r.schema),{$from:d,empty:p,ranges:m}=u;if(!i)return!0;if(p&&a){let{from:y,to:v}=u;const S=(o=d.marks().find(O=>O.type===f))===null||o===void 0?void 0:o.attrs,C=$c(d,f,S);C&&(y=C.from,v=C.to),t.removeMark(y,v,f)}else m.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,f)});return t.removeStoredMark(f),!0},LT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=zc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=$e(n,r.schema)),u==="mark"&&(a=sn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const d=f.$from.pos,p=f.$to.pos;r.doc.nodesBetween(d,p,(m,y)=>{o&&o===m.type&&t.setNodeMarkup(y,void 0,{...m.attrs,...e}),a&&m.marks.length&&m.marks.forEach(v=>{if(a===v.type){const S=Math.max(y,d),C=Math.min(y+m.nodeSize,p);t.addMark(S,C,a.create({...v.attrs,...e}))}})})}),!0):!1},PT=(n,e={})=>({state:t,dispatch:r})=>{const i=$e(n,t.schema);return JA(i,e)(t,r)},DT=(n,e={})=>({state:t,dispatch:r})=>{const i=$e(n,t.schema);return YA(i,e)(t,r)};var FT=Object.freeze({__proto__:null,blur:yO,clearContent:bO,clearNodes:_O,command:vO,createParagraphNear:wO,cut:SO,deleteCurrentNode:xO,deleteNode:EO,deleteRange:kO,deleteSelection:CO,enter:AO,exitCode:OO,extendMarkRange:MO,first:IO,focus:RO,forEach:LO,insertContent:PO,insertContentAt:$O,joinUp:BO,joinDown:HO,joinBackward:zO,joinForward:VO,joinItemBackward:WO,joinItemForward:UO,keyboardShortcut:qO,lift:GO,liftEmptyBlock:jO,liftListItem:JO,newlineInCode:YO,resetAttributes:XO,scrollIntoView:ZO,selectAll:QO,selectNodeBackward:eT,selectNodeForward:tT,selectParentNode:nT,selectTextblockEnd:rT,selectTextblockStart:iT,setContent:oT,setMark:_T,setMeta:vT,setNode:wT,setNodeSelection:ST,setTextSelection:xT,sinkListItem:ET,splitBlock:kT,splitListItem:CT,toggleList:AT,toggleMark:OT,toggleNode:TT,toggleWrap:MT,undoInputRule:IT,unsetAllMarks:NT,unsetMark:RT,updateAttributes:LT,wrapIn:PT,wrapInList:DT});Re.create({name:"commands",addCommands(){return{...FT}}}),Re.create({name:"editable",addProseMirrorPlugins(){return[new wt({key:new Gt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new wt({key:new Gt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Re.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:f,doc:d}=u,{empty:p,$anchor:m}=f,{pos:y,parent:v}=m,S=m.parent.isTextblock?u.doc.resolve(y-1):m,C=S.parent.type.spec.isolating,O=m.pos-m.parentOffset,N=C&&S.parent.childCount===1?O===m.pos:he.atStart(d).from===y;return!p||!N||!v.type.isTextblock||v.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Bc()||Zg()?o:i},addProseMirrorPlugins(){return[new wt({key:new Gt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(S=>S.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,u=he.atStart(e.doc).from,f=he.atEnd(e.doc).to;if(i||!(o===u&&a===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const m=t.tr,y=gl({state:t,transaction:m}),{commands:v}=new Ic({editor:this.editor,state:y});if(v.clearNodes(),!!m.steps.length)return m}})]}}),Re.create({name:"tabindex",addProseMirrorPlugins(){return[new wt({key:new Gt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function $T(n){return new Jg({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=se(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function BT(n){return new Jg({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=se(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),d=f&&lc(f,n.type,o);if(!d)return null;if(a.wrap(f,d),n.keepMarks&&n.editor){const{selection:m,storedMarks:y}=e,{splittableMarks:v}=n.editor.extensionManager,S=y||m.$to.parentOffset&&m.$from.marks();if(S){const C=S.filter(O=>v.includes(O.type.name));a.ensureMarks(C)}}if(n.keepAttributes){const m=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(m,o).run()}const p=a.doc.resolve(t.from-1).nodeBefore;p&&p.type===n.type&&Gn(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,p))&&a.join(t.from-1)}})}class xt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(V(this,"addOptions",{name:this.name}))),this.storage=se(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new xt(e)}configure(e={}){const t=this.extend();return t.options=bl(this.options,e),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new xt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=se(V(t,"addOptions",{name:t.name})),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(d=>d?.type.name===t.name))return!1;const f=a.find(d=>d?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class On{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(V(this,"addOptions",{name:this.name}))),this.storage=se(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new On(e)}configure(e={}){const t=this.extend();return t.options=bl(this.options,e),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new On(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=se(V(t,"addOptions",{name:t.name})),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}}function HT(n){return new uO({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=se(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,u=r[r.length-1],f=r[0];let d=t.to;if(u){const p=f.search(/\S/),m=t.from+f.indexOf(u),y=m+u.length;if(t0(t.from,t.to,e.doc).filter(S=>S.mark.type.excluded.find(O=>O===n.type&&O!==S.mark.type)).filter(S=>S.to>m).length)return null;y<t.to&&a.delete(y,t.to),m>t.from&&a.delete(t.from+p,m),d=t.from+p+u.length,a.addMark(t.from+p,d,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const zT=On.create({name:"text",group:"inline"});var Sl=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length<Sl&&this.leafAppend(e)||this.length<Sl&&e.leafPrepend(this)||this.appendInner(e)):this},Ke.prototype.prepend=function(e){return e.length?Ke.from(e).append(this):this},Ke.prototype.appendInner=function(e){return new VT(this,e)},Ke.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ke.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ke.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new i0(e):Ke.empty};var i0=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,u){for(var f=o;f<a;f++)if(i(this.values[f],u+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,u){for(var f=o-1;f>=a;f--)if(i(this.values[f],u+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Sl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Sl)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ke);Ke.empty=new i0([]);var VT=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),a)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,a+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ke),s0=Ke;const WT=500;class Xt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,u,f,d=[],p=[];return this.items.forEach((m,y)=>{if(!m.step){i||(i=this.remapping(r,y+1),o=i.maps.length),o--,p.push(m);return}if(i){p.push(new cn(m.map));let v=m.step.map(i.slice(o)),S;v&&a.maybeStep(v).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],d.push(new cn(S,void 0,void 0,d.length+p.length))),o--,S&&i.appendMap(S,o)}else a.maybeStep(m.step);if(m.selection)return u=i?m.selection.map(i.slice(o)):m.selection,f=new Xt(this.items.slice(0,r).append(p.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:a,selection:u}}addTransform(e,t,r,i){let o=[],a=this.eventCount,u=this.items,f=!i&&u.length?u.get(u.length-1):null;for(let p=0;p<e.steps.length;p++){let m=e.steps[p].invert(e.docs[p]),y=new cn(e.mapping.maps[p],m,t),v;(v=f&&f.merge(y))&&(y=v,p?o.pop():u=u.slice(0,u.length-1)),o.push(y),t&&(a++,t=void 0),i||(f=y)}let d=a-r.depth;return d>KT&&(u=UT(u,d),a-=d),new Xt(u.append(o),a)}remapping(e,t){let r=new Di;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new Xt(this.items.append(e.map(t=>new cn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,u=this.eventCount;this.items.forEach(y=>{y.selection&&u--},i);let f=t;this.items.forEach(y=>{let v=o.getMirror(--f);if(v==null)return;a=Math.min(a,v);let S=o.maps[v];if(y.step){let C=e.steps[v].invert(e.docs[v]),O=y.selection&&y.selection.map(o.slice(f+1,v));O&&u++,r.push(new cn(S,C,O))}else r.push(new cn(S))},i);let d=[];for(let y=t;y<a;y++)d.push(new cn(o.maps[y]));let p=this.items.slice(0,i).append(d).append(r),m=new Xt(p,u);return m.emptyItemCount()>WT&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=e)i.push(a),a.selection&&o++;else if(a.step){let f=a.step.map(t.slice(r)),d=f&&f.getMap();if(r--,d&&t.appendMap(d,r),f){let p=a.selection&&a.selection.map(t.slice(r));p&&o++;let m=new cn(d.invert(),f,p),y,v=i.length-1;(y=i.length&&i[v].merge(m))?i[v]=y:i.push(m)}}else a.map&&r--},this.items.length,0),new Xt(s0.from(i.reverse()),o)}}Xt.empty=new Xt(s0.empty,0);function UT(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class cn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new cn(t.getMap().invert(),t,this.selection)}}}class Zn{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const KT=20;function qT(n,e,t,r){let i=t.getMeta(Qn),o;if(i)return i.historyState;t.getMeta(jT)&&(n=new Zn(n.done,n.undone,null,0));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Qn))return a.getMeta(Qn).redo?new Zn(n.done.addTransform(t,void 0,r,xl(e)),n.undone,o0(t.mapping.maps[t.steps.length-1]),n.prevTime):new Zn(n.done,n.undone.addTransform(t,void 0,r,xl(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=n.prevTime==0||!a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!GT(t,n.prevRanges)),f=a?Kc(n.prevRanges,t.mapping):o0(t.mapping.maps[t.steps.length-1]);return new Zn(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,xl(e)),Xt.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new Zn(n.done.rebased(t,o),n.undone.rebased(t,o),Kc(n.prevRanges,t.mapping),n.prevTime):new Zn(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Kc(n.prevRanges,t.mapping),n.prevTime)}function GT(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function o0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function Kc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function l0(n,e,t,r){let i=xl(e),o=Qn.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let u=a.selection.resolve(a.transform.doc),f=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),d=new Zn(r?f:a.remaining,r?a.remaining:f,null,0);t(a.transform.setSelection(u).setMeta(Qn,{redo:r,historyState:d}).scrollIntoView())}let qc=!1,a0=null;function xl(n){let e=n.plugins;if(a0!=e){qc=!1,a0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){qc=!0;break}}return qc}const Qn=new Gt("history"),jT=new Gt("closeHistory");function JT(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new wt({key:Qn,state:{init(){return new Zn(Xt.empty,Xt.empty,null,0)},apply(e,t,r){return qT(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?u0:r=="historyRedo"?c0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const u0=(n,e)=>{let t=Qn.getState(n);return!t||t.done.eventCount==0?!1:(e&&l0(t,n,e,!1),!0)},c0=(n,e)=>{let t=Qn.getState(n);return!t||t.undone.eventCount==0?!1:(e&&l0(t,n,e,!0),!0)},YT=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>u0(n,e),redo:()=>({state:n,dispatch:e})=>c0(n,e)}},addProseMirrorPlugins(){return[JT(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Gc=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),jc=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),er=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),ee=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Lt=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),ce=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),Jt=Object.freeze({SETTINGS:"settings",ALL:"_"}),f0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Os=Object.freeze({URL:"url",BLOCK:"block"});class Jc{static create(e,t){const r=new this(e,t||{});return new wt({key:new Gt(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class XT extends Jc{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=Yl.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(o,a,u)=>{u.type.name===ee.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class ZT extends Jc{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const o=dn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),ze.create(e,t)}}const QT="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",eM="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u062A\u0635\u0627\u0644\u0627\u062A6\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Ai=(n,e)=>{for(const t in e)n[t]=e[t];return n},Yc="numeric",Xc="ascii",Zc="alpha",El="asciinumeric",kl="alphanumeric",Qc="domain",h0="emoji",tM="scheme",nM="slashscheme",d0="whitespace";function rM(n,e){return n in e||(e[n]=[]),e[n]}function Lr(n,e,t){e[Yc]&&(e[El]=!0,e[kl]=!0),e[Xc]&&(e[El]=!0,e[Zc]=!0),e[El]&&(e[kl]=!0),e[Zc]&&(e[kl]=!0),e[kl]&&(e[Qc]=!0),e[h0]&&(e[Qc]=!0);for(const r in e){const i=rM(r,t);i.indexOf(n)<0&&i.push(n)}}function iM(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function pt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}pt.groups={},pt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e){return e===void 0&&(e=!1),e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||pt.groups;let i;return e&&e.j?i=e:(i=new pt(e),t&&r&&Lr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let a=0;a<o-1;a++)i=i.tt(n[a]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||pt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let a,u=i.go(n);if(u?(a=new pt,Ai(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new pt,o){if(r)if(a.t&&typeof a.t=="string"){const f=Ai(iM(a.t,r),t);Lr(o,f,r)}else t&&Lr(o,t,r);a.t=o}return i.j[n]=a,a}};const U=(n,e,t,r,i)=>n.ta(e,t,r,i),Pt=(n,e,t,r,i)=>n.tr(e,t,r,i),p0=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),An="WORD",ef="UWORD",Ts="LOCALHOST",tf="TLD",nf="UTLD",Cl="SCHEME",Oi="SLASH_SCHEME",rf="NUM",m0="WS",sf="NL",Ti="OPENBRACE",Ms="OPENBRACKET",Is="OPENANGLEBRACKET",Ns="OPENPAREN",Pr="CLOSEBRACE",Mi="CLOSEBRACKET",Ii="CLOSEANGLEBRACKET",Dr="CLOSEPAREN",Al="AMPERSAND",Ol="APOSTROPHE",Tl="ASTERISK",tr="AT",Ml="BACKSLASH",Il="BACKTICK",Nl="CARET",nr="COLON",of="COMMA",Rl="DOLLAR",on="DOT",Ll="EQUALS",lf="EXCLAMATION",ln="HYPHEN",Pl="PERCENT",Dl="PIPE",Fl="PLUS",$l="POUND",Bl="QUERY",af="QUOTE",uf="SEMI",an="SLASH",Rs="TILDE",Hl="UNDERSCORE",g0="EMOJI",zl="SYM";var y0=Object.freeze({__proto__:null,WORD:An,UWORD:ef,LOCALHOST:Ts,TLD:tf,UTLD:nf,SCHEME:Cl,SLASH_SCHEME:Oi,NUM:rf,WS:m0,NL:sf,OPENBRACE:Ti,OPENBRACKET:Ms,OPENANGLEBRACKET:Is,OPENPAREN:Ns,CLOSEBRACE:Pr,CLOSEBRACKET:Mi,CLOSEANGLEBRACKET:Ii,CLOSEPAREN:Dr,AMPERSAND:Al,APOSTROPHE:Ol,ASTERISK:Tl,AT:tr,BACKSLASH:Ml,BACKTICK:Il,CARET:Nl,COLON:nr,COMMA:of,DOLLAR:Rl,DOT:on,EQUALS:Ll,EXCLAMATION:lf,HYPHEN:ln,PERCENT:Pl,PIPE:Dl,PLUS:Fl,POUND:$l,QUERY:Bl,QUOTE:af,SEMI:uf,SLASH:an,TILDE:Rs,UNDERSCORE:Hl,EMOJI:g0,SYM:zl});const Ni=/[a-z]/,cf=/\p{L}/u,ff=/\p{Emoji}/u,hf=/\d/,b0=/\s/,_0=`
|
|
39
|
-
`,
|
|
36
|
+
`,textSerializers:l={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(d,g,p,_)=>{var S;const k=l?.[d.type.name];k?(d.isBlock&&!f&&(u+=o,f=!0),p&&(u+=k({node:d,pos:g,parent:p,index:_,range:e}))):d.isText?(u+=(S=d?.text)===null||S===void 0?void 0:S.slice(Math.max(r,g)-g,i-g),f=!1):d.isBlock&&!f&&(u+=o,f=!0)}),u}function tO(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Pe.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ct({key:new Zt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,l=Math.min(...o.map(g=>g.$from.pos)),u=Math.max(...o.map(g=>g.$to.pos)),f=tO(t);return eO(r,{from:l,to:u},{textSerializers:f})}}})]}});const nO=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),rO=(n=!1)=>({commands:e})=>e.setContent("",n),iO=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:l})=>{n.doc.nodesBetween(o.pos,l.pos,(u,f)=>{if(u.type.isText)return;const{doc:d,mapping:g}=e,p=d.resolve(g.map(f)),_=d.resolve(g.map(f+u.nodeSize)),S=p.blockRange(_);if(!S)return;const k=_i(S);if(u.type.isTextblock){const{defaultType:m}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(S.start,m)}(k||k===0)&&e.lift(S,k)})}),!0},sO=n=>e=>n(e),oO=()=>({state:n,dispatch:e})=>OA(n,e),aO=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const l=r.mapping.map(e);return r.insert(l,o.content),r.setSelection(new me(r.doc.resolve(l-1))),!0},lO=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const u=i.before(o),f=i.after(o);n.delete(u,f).scrollIntoView()}return!0}return!1},uO=n=>({tr:e,state:t,dispatch:r})=>{const i=ze(n,t.schema),o=e.selection.$anchor;for(let l=o.depth;l>0;l-=1)if(o.node(l).type===i){if(r){const f=o.before(l),d=o.after(l);e.delete(f,d).scrollIntoView()}return!0}return!1},cO=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},fO=()=>({state:n,dispatch:e})=>gA(n,e),hO=()=>({commands:n})=>n.keyboardShortcut("Enter"),dO=()=>({state:n,dispatch:e})=>AA(n,e);function Ca(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Bc(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function zc(n,e,t={}){return n.find(r=>r.type===e&&Ca(r.attrs,t))}function pO(n,e,t={}){return!!zc(n,e,t)}function Vc(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=zc([...r.node.marks],e,t);if(!i)return;let o=r.index,l=n.start()+r.offset,u=o+1,f=l+r.node.nodeSize;for(zc([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,l-=n.parent.child(o).nodeSize;for(;u<n.parent.childCount&&pO([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:l,to:f}}function cn(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const mO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=cn(n,r.schema),{doc:l,selection:u}=t,{$from:f,from:d,to:g}=u;if(i){const p=Vc(f,o,e);if(p&&p.from<=d&&p.to>=g){const _=me.create(l,p.from,p.to);t.setSelection(_)}}return!0},gO=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Gg(n){return n instanceof me}function Lr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function yO(n,e=null){if(!e)return null;const t=pe.atStart(n),r=pe.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?me.create(n,Lr(0,i,o),Lr(n.content.size,i,o)):me.create(n,Lr(e,i,o),Lr(e,i,o))}function Wc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const bO=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const l=()=>{Wc()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Gg(t.state.selection))return l(),!0;const u=yO(i.doc,n)||t.state.selection,f=t.state.selection.eq(u);return o&&(f||i.setSelection(u),f&&i.storedMarks&&i.setStoredMarks(i.storedMarks),l()),!0},_O=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),vO=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function jg(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Aa(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?B.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Aa("",e,t)}if(typeof n=="string"){const r=sc.fromSchema(e);return t.slice?r.parseSlice(jg(n),t.parseOptions).content:r.parse(jg(n),t.parseOptions)}return Aa("",e,t)}function wO(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof nt||i instanceof We))return;const o=n.mapping.maps[r];let l=0;o.forEach((u,f,d,g)=>{l===0&&(l=g)}),n.setSelection(pe.near(n.doc.resolve(l),t))}const SO=n=>n.toString().startsWith("<"),xO=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const l=Aa(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(l.toString()==="<>")return!0;let{from:u,to:f}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,g=!0;if((SO(l)?l:[l]).forEach(_=>{_.check(),d=d?_.isText&&_.marks.length===0:!1,g=g?_.isBlock:!1}),u===f&&g){const{parent:_}=r.doc.resolve(u);_.isTextblock&&!_.type.spec.code&&!_.childCount&&(u-=1,f+=1)}d?Array.isArray(e)?r.insertText(e.map(_=>_.text||"").join(""),u,f):typeof e=="object"&&e&&e.text?r.insertText(e.text,u,f):r.insertText(e,u,f):r.replaceWith(u,f,l),t.updateSelection&&wO(r,r.steps.length-1,-1)}return!0},EO=()=>({state:n,dispatch:e})=>xA(n,e),kO=()=>({state:n,dispatch:e})=>EA(n,e),CO=()=>({state:n,dispatch:e})=>bA(n,e),AO=()=>({state:n,dispatch:e})=>wA(n,e),OO=()=>({tr:n,state:e,dispatch:t})=>{try{const r=pa(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},TO=()=>({state:n,dispatch:e,tr:t})=>{try{const r=pa(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Jg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function MO(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,l;for(let u=0;u<e.length-1;u+=1){const f=e[u];if(/^(cmd|meta|m)$/i.test(f))l=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))Wc()||Jg()?l=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),l&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const IO=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=MO(n).split(/-(?!$)/),l=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),u=new KeyboardEvent("keydown",{key:l==="Space"?" ":l,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),f=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,u))});return f?.steps.forEach(d=>{const g=d.map(r.mapping);g&&i&&r.maybeStep(g)}),!0};function Uc(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,l=e?ze(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(p,_)=>{if(p.isText)return;const S=Math.max(r,_),k=Math.min(i,_+p.nodeSize);u.push({node:p,from:S,to:k})});const f=i-r,d=u.filter(p=>l?l.name===p.node.type.name:!0).filter(p=>Ca(p.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((p,_)=>p+_.to-_.from,0)>=f}const NO=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return Uc(t,i,e)?kA(t,r):!1},RO=()=>({state:n,dispatch:e})=>TA(n,e),LO=n=>({state:e,dispatch:t})=>{const r=ze(n,e.schema);return FA(r)(e,t)},PO=()=>({state:n,dispatch:e})=>CA(n,e);function qc(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Yg(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const DO=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,l=null;const u=qc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=ze(n,r.schema)),u==="mark"&&(l=cn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(d,g)=>{o&&o===d.type&&t.setNodeMarkup(g,void 0,Yg(d.attrs,e)),l&&d.marks.length&&d.marks.forEach(p=>{l===p.type&&t.addMark(g,g+d.nodeSize,l.create(Yg(p.attrs,e)))})})}),!0):!1},FO=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),BO=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),HO=()=>({state:n,dispatch:e})=>_A(n,e),$O=()=>({state:n,dispatch:e})=>SA(n,e),zO=()=>({state:n,dispatch:e})=>MA(n,e),VO=()=>({state:n,dispatch:e})=>RA(n,e),WO=()=>({state:n,dispatch:e})=>NA(n,e);function UO(n,e,t={}){return Aa(n,e,{slice:!1,parseOptions:t})}const qO=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:l}=r,u=UO(n,i.schema,t);return o&&r.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!e),!0};function Xg(n,e){const t=cn(e,n.schema),{from:r,to:i,empty:o}=n.selection,l=[];o?(n.storedMarks&&l.push(...n.storedMarks),l.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{l.push(...f.marks)});const u=l.find(f=>f.type.name===t.name);return u?{...u.attrs}:{}}function KO(n,e){const t=new xC(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function GO(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function jO(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function JO(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Kc(n){return e=>JO(e.$from,n)}function YO(n,e){const t=Fi.resolve(n);return Ug(t,e)}function XO(n,e){const t=ze(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,u=>{o.push(u)});const l=o.reverse().find(u=>u.type.name===t.name);return l?{...l.attrs}:{}}function ZO(n,e){const t=qc(typeof e=="string"?e:e.name,n.schema);return t==="node"?XO(n,e):t==="mark"?Xg(n,e):{}}function QO(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function eT(n){const e=QO(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,l)=>l!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function tT(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const l=[];if(i.ranges.length)i.forEach((u,f)=>{l.push({from:u,to:f})});else{const{from:u,to:f}=t[o];if(u===void 0||f===void 0)return;l.push({from:u,to:f})}l.forEach(({from:u,to:f})=>{const d=e.slice(o).map(u,-1),g=e.slice(o).map(f),p=e.invert().map(d,-1),_=e.invert().map(g);r.push({oldRange:{from:p,to:_},newRange:{from:d,to:g}})})}),eT(r)}function Zg(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),l=Vc(o,i.type);l&&r.push({mark:i,...l})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(l=>({from:o,to:o+i.nodeSize,mark:l})))}),r}function Oa(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function nT(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?cn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>Ca(p.attrs,t,{strict:!1}));let l=0;const u=[];if(i.forEach(({$from:p,$to:_})=>{const S=p.pos,k=_.pos;n.doc.nodesBetween(S,k,(m,b)=>{if(!m.isText&&!m.marks.length)return;const x=Math.max(S,b),A=Math.min(k,b+m.nodeSize),O=A-x;l+=O,u.push(...m.marks.map(R=>({mark:R,from:x,to:A})))})}),l===0)return!1;const f=u.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>Ca(p.mark.attrs,t,{strict:!1})).reduce((p,_)=>p+_.to-_.from,0),d=u.filter(p=>o?p.mark.type!==o&&p.mark.type.excludes(o):!0).reduce((p,_)=>p+_.to-_.from,0);return(f>0?f+d:f)>=l}function Qg(n,e){const{nodeExtensions:t}=Ea(e),r=t.find(l=>l.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=le(G(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function rT(n,e,t){var r;const{selection:i}=e;let o=null;if(Gg(i)&&(o=i.$cursor),o){const u=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(u)||!u.some(f=>f.type.excludes(t))}const{ranges:l}=i;return l.some(({$from:u,$to:f})=>{let d=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,f.pos,(g,p,_)=>{if(d)return!1;if(g.isInline){const S=!_||_.type.allowsMarkType(t),k=!!t.isInSet(g.marks)||!g.marks.some(m=>m.type.excludes(t));d=S&&k}return!d}),d})}const iT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:l,ranges:u}=o,f=cn(n,r.schema);if(i)if(l){const d=Xg(r,f);t.addStoredMark(f.create({...d,...e}))}else u.forEach(d=>{const g=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(g,p,(_,S)=>{const k=Math.max(S,g),m=Math.min(S+_.nodeSize,p);_.marks.find(x=>x.type===f)?_.marks.forEach(x=>{f===x.type&&t.addMark(k,m,f.create({...x.attrs,...e}))}):t.addMark(k,m,f.create(e))})});return rT(r,t,f)},sT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),oT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=ze(n,t.schema);return o.isTextblock?i().command(({commands:l})=>$g(o,e)(t)?!0:l.clearNodes()).command(({state:l})=>$g(o,e)(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},aT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Lr(n,0,r.content.size),o=ee.create(r,i);e.setSelection(o)}return!0},lT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,l=me.atStart(r).from,u=me.atEnd(r).to,f=Lr(i,l,u),d=Lr(o,l,u),g=me.create(r,f,d);e.setSelection(g)}return!0},uT=n=>({state:e,dispatch:t})=>{const r=ze(n,e.schema);return $A(r)(e,t)};function e0(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const cT=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:l}=e,{$from:u,$to:f}=o,d=i.extensionManager.attributes,g=Oa(d,u.node().type.name,u.node().attrs);if(o instanceof ee&&o.node.isBlock)return!u.parentOffset||!vi(l,u.pos)?!1:(r&&(n&&e0(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const p=f.parentOffset===f.parent.content.size;o instanceof me&&e.deleteSelection();const _=u.depth===0?void 0:GO(u.node(-1).contentMatchAt(u.indexAfter(-1)));let S=p&&_?[{type:_,attrs:g}]:void 0,k=vi(e.doc,e.mapping.map(u.pos),1,S);if(!S&&!k&&vi(e.doc,e.mapping.map(u.pos),1,_?[{type:_}]:void 0)&&(k=!0,S=_?[{type:_,attrs:g}]:void 0),k&&(e.split(e.mapping.map(u.pos),1,S),_&&!p&&!u.parentOffset&&u.parent.type!==_)){const m=e.mapping.map(u.before()),b=e.doc.resolve(m);u.node(-1).canReplaceWith(b.index(),b.index()+1,_)&&e.setNodeMarkup(e.mapping.map(u.before()),_)}n&&e0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},fT=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const l=ze(n,t.schema),{$from:u,$to:f}=t.selection,d=t.selection.node;if(d&&d.isBlock||u.depth<2||!u.sameParent(f))return!1;const g=u.node(-1);if(g.type!==l)return!1;const p=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let b=B.empty;const x=u.index(-1)?1:u.index(-2)?2:3;for(let U=u.depth-x;U>=u.depth-3;U-=1)b=B.from(u.node(U).copy(b));const A=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,O=Oa(p,u.node().type.name,u.node().attrs),R=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(O))||void 0;b=b.append(B.from(l.createAndFill(null,R)||void 0));const W=u.before(u.depth-(x-1));e.replace(W,u.after(-A),new K(b,4-x,0));let D=-1;e.doc.nodesBetween(W,e.doc.content.size,(U,Q)=>{if(D>-1)return!1;U.isTextblock&&U.content.size===0&&(D=Q+1)}),D>-1&&e.setSelection(me.near(e.doc.resolve(D))),e.scrollIntoView()}return!0}const _=f.pos===u.end()?g.contentMatchAt(0).defaultType:null,S=Oa(p,g.type.name,g.attrs),k=Oa(p,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const m=_?[{type:l,attrs:S},{type:_,attrs:k}]:[{type:l,attrs:S}];if(!vi(e.doc,u.pos,2))return!1;if(r){const{selection:b,storedMarks:x}=t,{splittableMarks:A}=i.extensionManager,O=x||b.$to.parentOffset&&b.$from.marks();if(e.split(u.pos,2,m).scrollIntoView(),!O||!r)return!0;const R=O.filter(W=>A.includes(W.type.name));e.ensureMarks(R)}return!0},Gc=(n,e)=>{const t=Kc(l=>l.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Zn(n.doc,t.pos)&&n.join(t.pos),!0},jc=(n,e)=>{const t=Kc(l=>l.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Zn(n.doc,r)&&n.join(r),!0},hT=(n,e,t,r={})=>({editor:i,tr:o,state:l,dispatch:u,chain:f,commands:d,can:g})=>{const{extensions:p,splittableMarks:_}=i.extensionManager,S=ze(n,l.schema),k=ze(e,l.schema),{selection:m,storedMarks:b}=l,{$from:x,$to:A}=m,O=x.blockRange(A),R=b||m.$to.parentOffset&&m.$from.marks();if(!O)return!1;const W=Kc(D=>Qg(D.type.name,p))(m);if(O.depth>=1&&W&&O.depth-W.depth<=1){if(W.node.type===S)return d.liftListItem(k);if(Qg(W.node.type.name,p)&&S.validContent(W.node.content)&&u)return f().command(()=>(o.setNodeMarkup(W.pos,S),!0)).command(()=>Gc(o,S)).command(()=>jc(o,S)).run()}return!t||!R||!u?f().command(()=>g().wrapInList(S,r)?!0:d.clearNodes()).wrapInList(S,r).command(()=>Gc(o,S)).command(()=>jc(o,S)).run():f().command(()=>{const D=g().wrapInList(S,r),U=R.filter(Q=>_.includes(Q.type.name));return o.ensureMarks(U),D?!0:d.clearNodes()}).wrapInList(S,r).command(()=>Gc(o,S)).command(()=>jc(o,S)).run()},dT=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,l=cn(n,r.schema);return nT(r,l,e)?i.unsetMark(l,{extendEmptyMarkRange:o}):i.setMark(l,e)},pT=(n,e,t={})=>({state:r,commands:i})=>{const o=ze(n,r.schema),l=ze(e,r.schema);return Uc(r,o,t)?i.setNode(l):i.setNode(o,t)},mT=(n,e={})=>({state:t,commands:r})=>{const i=ze(n,t.schema);return Uc(t,i,e)?r.lift(i):r.wrapIn(i,e)},gT=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const l=n.tr,u=o.transform;for(let f=u.steps.length-1;f>=0;f-=1)l.step(u.steps[f].invert(u.docs[f]));if(o.text){const f=l.doc.resolve(o.from).marks();l.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else l.delete(o.from,o.to)}return!0}}return!1},yT=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},bT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:l=!1}=e,{selection:u}=t,f=cn(n,r.schema),{$from:d,empty:g,ranges:p}=u;if(!i)return!0;if(g&&l){let{from:_,to:S}=u;const k=(o=d.marks().find(b=>b.type===f))===null||o===void 0?void 0:o.attrs,m=Vc(d,f,k);m&&(_=m.from,S=m.to),t.removeMark(_,S,f)}else p.forEach(_=>{t.removeMark(_.$from.pos,_.$to.pos,f)});return t.removeStoredMark(f),!0},_T=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,l=null;const u=qc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=ze(n,r.schema)),u==="mark"&&(l=cn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const d=f.$from.pos,g=f.$to.pos;r.doc.nodesBetween(d,g,(p,_)=>{o&&o===p.type&&t.setNodeMarkup(_,void 0,{...p.attrs,...e}),l&&p.marks.length&&p.marks.forEach(S=>{if(l===S.type){const k=Math.max(_,d),m=Math.min(_+p.nodeSize,g);t.addMark(k,m,l.create({...S.attrs,...e}))}})})}),!0):!1},vT=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return LA(i,e)(t,r)},wT=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return PA(i,e)(t,r)};var ST=Object.freeze({__proto__:null,blur:nO,clearContent:rO,clearNodes:iO,command:sO,createParagraphNear:oO,cut:aO,deleteCurrentNode:lO,deleteNode:uO,deleteRange:cO,deleteSelection:fO,enter:hO,exitCode:dO,extendMarkRange:mO,first:gO,focus:bO,forEach:_O,insertContent:vO,insertContentAt:xO,joinUp:EO,joinDown:kO,joinBackward:CO,joinForward:AO,joinItemBackward:OO,joinItemForward:TO,keyboardShortcut:IO,lift:NO,liftEmptyBlock:RO,liftListItem:LO,newlineInCode:PO,resetAttributes:DO,scrollIntoView:FO,selectAll:BO,selectNodeBackward:HO,selectNodeForward:$O,selectParentNode:zO,selectTextblockEnd:VO,selectTextblockStart:WO,setContent:qO,setMark:iT,setMeta:sT,setNode:oT,setNodeSelection:aT,setTextSelection:lT,sinkListItem:uT,splitBlock:cT,splitListItem:fT,toggleList:hT,toggleMark:dT,toggleNode:pT,toggleWrap:mT,undoInputRule:gT,unsetAllMarks:yT,unsetMark:bT,updateAttributes:_T,wrapIn:vT,wrapInList:wT});Pe.create({name:"commands",addCommands(){return{...ST}}}),Pe.create({name:"editable",addProseMirrorPlugins(){return[new Ct({key:new Zt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Pe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ct({key:new Zt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Pe.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:l})=>[()=>l.undoInputRule(),()=>l.command(({tr:u})=>{const{selection:f,doc:d}=u,{empty:g,$anchor:p}=f,{pos:_,parent:S}=p,k=p.parent.isTextblock?u.doc.resolve(_-1):p,m=k.parent.type.spec.isolating,b=p.pos-p.parentOffset,x=m&&k.parent.childCount===1?b===p.pos:pe.atStart(d).from===_;return!g||!x||!S.type.isTextblock||S.textContent.length?!1:l.clearNodes()}),()=>l.deleteSelection(),()=>l.joinBackward(),()=>l.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:l})=>[()=>l.deleteSelection(),()=>l.deleteCurrentNode(),()=>l.joinForward(),()=>l.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:l})=>[()=>l.newlineInCode(),()=>l.createParagraphNear(),()=>l.liftEmptyBlock(),()=>l.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Wc()||Jg()?o:i},addProseMirrorPlugins(){return[new Ct({key:new Zt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(k=>k.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:l}=e.selection,u=pe.atStart(e.doc).from,f=pe.atEnd(e.doc).to;if(i||!(o===u&&l===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const p=t.tr,_=xa({state:t,transaction:p}),{commands:S}=new Pc({editor:this.editor,state:_});if(S.clearNodes(),!!p.steps.length)return p}})]}}),Pe.create({name:"tabindex",addProseMirrorPlugins(){return[new Ct({key:new Zt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function xT(n){return new Kg({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=le(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function ET(n){return new Kg({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=le(n.getAttributes,void 0,r)||{},l=e.tr.delete(t.from,t.to),f=l.doc.resolve(t.from).blockRange(),d=f&&fc(f,n.type,o);if(!d)return null;if(l.wrap(f,d),n.keepMarks&&n.editor){const{selection:p,storedMarks:_}=e,{splittableMarks:S}=n.editor.extensionManager,k=_||p.$to.parentOffset&&p.$from.marks();if(k){const m=k.filter(b=>S.includes(b.type.name));l.ensureMarks(m)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const g=l.doc.resolve(t.from-1).nodeBefore;g&&g.type===n.type&&Zn(l.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,g))&&l.join(t.from-1)}})}class Ot{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=le(G(this,"addOptions",{name:this.name}))),this.storage=le(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ot(e)}configure(e={}){const t=this.extend();return t.options=ka(this.options,e),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ot(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=le(G(t,"addOptions",{name:t.name})),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const l=i.marks();if(!!!l.find(d=>d?.type.name===t.name))return!1;const f=l.find(d=>d?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Dn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=le(G(this,"addOptions",{name:this.name}))),this.storage=le(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Dn(e)}configure(e={}){const t=this.extend();return t.options=ka(this.options,e),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Dn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=le(G(t,"addOptions",{name:t.name})),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}}function kT(n){return new jA({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=le(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:l}=e,u=r[r.length-1],f=r[0];let d=t.to;if(u){const g=f.search(/\S/),p=t.from+f.indexOf(u),_=p+u.length;if(Zg(t.from,t.to,e.doc).filter(k=>k.mark.type.excluded.find(b=>b===n.type&&b!==k.mark.type)).filter(k=>k.to>p).length)return null;_<t.to&&l.delete(_,t.to),p>t.from&&l.delete(t.from+g,p),d=t.from+g+u.length,l.addMark(t.from+g,d,n.type.create(o||{})),l.removeStoredMark(n.type)}}})}const CT=Dn.create({name:"text",group:"inline"});var Ta=200,Je=function(){};Je.prototype.append=function(e){return e.length?(e=Je.from(e),!this.length&&e||e.length<Ta&&this.leafAppend(e)||this.length<Ta&&e.leafPrepend(this)||this.appendInner(e)):this},Je.prototype.prepend=function(e){return e.length?Je.from(e).append(this):this},Je.prototype.appendInner=function(e){return new AT(this,e)},Je.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Je.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Je.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Je.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Je.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,l){return i.push(e(o,l))},t,r),i},Je.from=function(e){return e instanceof Je?e:e&&e.length?new t0(e):Je.empty};var t0=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,l,u){for(var f=o;f<l;f++)if(i(this.values[f],u+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,l,u){for(var f=o-1;f>=l;f--)if(i(this.values[f],u+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ta)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ta)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Je);Je.empty=new t0([]);var AT=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,l){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),l)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,l){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,l+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,l)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Je),n0=Je;const OT=500;class nn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let l=e.tr,u,f,d=[],g=[];return this.items.forEach((p,_)=>{if(!p.step){i||(i=this.remapping(r,_+1),o=i.maps.length),o--,g.push(p);return}if(i){g.push(new mn(p.map));let S=p.step.map(i.slice(o)),k;S&&l.maybeStep(S).doc&&(k=l.mapping.maps[l.mapping.maps.length-1],d.push(new mn(k,void 0,void 0,d.length+g.length))),o--,k&&i.appendMap(k,o)}else l.maybeStep(p.step);if(p.selection)return u=i?p.selection.map(i.slice(o)):p.selection,f=new nn(this.items.slice(0,r).append(g.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:l,selection:u}}addTransform(e,t,r,i){let o=[],l=this.eventCount,u=this.items,f=!i&&u.length?u.get(u.length-1):null;for(let g=0;g<e.steps.length;g++){let p=e.steps[g].invert(e.docs[g]),_=new mn(e.mapping.maps[g],p,t),S;(S=f&&f.merge(_))&&(_=S,g?o.pop():u=u.slice(0,u.length-1)),o.push(_),t&&(l++,t=void 0),i||(f=_)}let d=l-r.depth;return d>MT&&(u=TT(u,d),l-=d),new nn(u.append(o),l)}remapping(e,t){let r=new Bi;return this.items.forEach((i,o)=>{let l=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,l)},e,t),r}addMaps(e){return this.eventCount==0?this:new nn(this.items.append(e.map(t=>new mn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,l=e.steps.length,u=this.eventCount;this.items.forEach(_=>{_.selection&&u--},i);let f=t;this.items.forEach(_=>{let S=o.getMirror(--f);if(S==null)return;l=Math.min(l,S);let k=o.maps[S];if(_.step){let m=e.steps[S].invert(e.docs[S]),b=_.selection&&_.selection.map(o.slice(f+1,S));b&&u++,r.push(new mn(k,m,b))}else r.push(new mn(k))},i);let d=[];for(let _=t;_<l;_++)d.push(new mn(o.maps[_]));let g=this.items.slice(0,i).append(d).append(r),p=new nn(g,u);return p.emptyItemCount()>OT&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((l,u)=>{if(u>=e)i.push(l),l.selection&&o++;else if(l.step){let f=l.step.map(t.slice(r)),d=f&&f.getMap();if(r--,d&&t.appendMap(d,r),f){let g=l.selection&&l.selection.map(t.slice(r));g&&o++;let p=new mn(d.invert(),f,g),_,S=i.length-1;(_=i.length&&i[S].merge(p))?i[S]=_:i.push(p)}}else l.map&&r--},this.items.length,0),new nn(n0.from(i.reverse()),o)}}nn.empty=new nn(n0.empty,0);function TT(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class mn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new mn(t.getMap().invert(),t,this.selection)}}}class rr{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const MT=20;function IT(n,e,t,r){let i=t.getMeta(ir),o;if(i)return i.historyState;t.getMeta(RT)&&(n=new rr(n.done,n.undone,null,0));let l=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(l&&l.getMeta(ir))return l.getMeta(ir).redo?new rr(n.done.addTransform(t,void 0,r,Ma(e)),n.undone,r0(t.mapping.maps[t.steps.length-1]),n.prevTime):new rr(n.done,n.undone.addTransform(t,void 0,r,Ma(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let u=n.prevTime==0||!l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!NT(t,n.prevRanges)),f=l?Jc(n.prevRanges,t.mapping):r0(t.mapping.maps[t.steps.length-1]);return new rr(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,Ma(e)),nn.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new rr(n.done.rebased(t,o),n.undone.rebased(t,o),Jc(n.prevRanges,t.mapping),n.prevTime):new rr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Jc(n.prevRanges,t.mapping),n.prevTime)}function NT(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function r0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function Jc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function i0(n,e,t,r){let i=Ma(e),o=ir.get(e).spec.config,l=(r?n.undone:n.done).popEvent(e,i);if(!l)return;let u=l.selection.resolve(l.transform.doc),f=(r?n.done:n.undone).addTransform(l.transform,e.selection.getBookmark(),o,i),d=new rr(r?f:l.remaining,r?l.remaining:f,null,0);t(l.transform.setSelection(u).setMeta(ir,{redo:r,historyState:d}).scrollIntoView())}let Yc=!1,s0=null;function Ma(n){let e=n.plugins;if(s0!=e){Yc=!1,s0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Yc=!0;break}}return Yc}const ir=new Zt("history"),RT=new Zt("closeHistory");function LT(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Ct({key:ir,state:{init(){return new rr(nn.empty,nn.empty,null,0)},apply(e,t,r){return IT(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?o0:r=="historyRedo"?a0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const o0=(n,e)=>{let t=ir.getState(n);return!t||t.done.eventCount==0?!1:(e&&i0(t,n,e,!1),!0)},a0=(n,e)=>{let t=ir.getState(n);return!t||t.undone.eventCount==0?!1:(e&&i0(t,n,e,!0),!0)},PT=Pe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>o0(n,e),redo:()=>({state:n,dispatch:e})=>a0(n,e)}},addProseMirrorPlugins(){return[LT(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Xc=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),Zc=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),sr=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),ie=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),$t=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),he=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),en=Object.freeze({SETTINGS:"settings",ALL:"_"}),l0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Ts=Object.freeze({URL:"url",BLOCK:"block"});class Qc{static create(e,t){const r=new this(e,t||{});return new Ct({key:new Zt(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class DT extends Qc{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=nl.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(o,l,u)=>{u.type.name===ie.DOCUMENT&&(r=Math.min(r,l+1),i=Math.max(i,l+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class FT extends Qc{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const o=bn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),Ue.create(e,t)}}const BT="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",HT="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u062A\u0635\u0627\u0644\u0627\u062A6\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Ti=(n,e)=>{for(const t in e)n[t]=e[t];return n},ef="numeric",tf="ascii",nf="alpha",Ia="asciinumeric",Na="alphanumeric",rf="domain",u0="emoji",$T="scheme",zT="slashscheme",c0="whitespace";function VT(n,e){return n in e||(e[n]=[]),e[n]}function Pr(n,e,t){e[ef]&&(e[Ia]=!0,e[Na]=!0),e[tf]&&(e[Ia]=!0,e[nf]=!0),e[Ia]&&(e[Na]=!0),e[nf]&&(e[Na]=!0),e[Na]&&(e[rf]=!0),e[u0]&&(e[rf]=!0);for(const r in e){const i=VT(r,t);i.indexOf(n)<0&&i.push(n)}}function WT(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function yt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}yt.groups={},yt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e){return e===void 0&&(e=!1),e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||yt.groups;let i;return e&&e.j?i=e:(i=new yt(e),t&&r&&Pr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let l=0;l<o-1;l++)i=i.tt(n[l]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||yt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let l,u=i.go(n);if(u?(l=new yt,Ti(l.j,u.j),l.jr.push.apply(l.jr,u.jr),l.jd=u.jd,l.t=u.t):l=new yt,o){if(r)if(l.t&&typeof l.t=="string"){const f=Ti(WT(l.t,r),t);Pr(o,f,r)}else t&&Pr(o,t,r);l.t=o}return i.j[n]=l,l}};const J=(n,e,t,r,i)=>n.ta(e,t,r,i),zt=(n,e,t,r,i)=>n.tr(e,t,r,i),f0=(n,e,t,r,i)=>n.ts(e,t,r,i),$=(n,e,t,r,i)=>n.tt(e,t,r,i),Pn="WORD",sf="UWORD",Ms="LOCALHOST",of="TLD",af="UTLD",Ra="SCHEME",Mi="SLASH_SCHEME",lf="NUM",h0="WS",uf="NL",Ii="OPENBRACE",Is="OPENBRACKET",Ns="OPENANGLEBRACKET",Rs="OPENPAREN",Dr="CLOSEBRACE",Ni="CLOSEBRACKET",Ri="CLOSEANGLEBRACKET",Fr="CLOSEPAREN",La="AMPERSAND",Pa="APOSTROPHE",Da="ASTERISK",or="AT",Fa="BACKSLASH",Ba="BACKTICK",Ha="CARET",ar="COLON",cf="COMMA",$a="DOLLAR",fn="DOT",za="EQUALS",ff="EXCLAMATION",hn="HYPHEN",Va="PERCENT",Wa="PIPE",Ua="PLUS",qa="POUND",Ka="QUERY",hf="QUOTE",df="SEMI",dn="SLASH",Ls="TILDE",Ga="UNDERSCORE",d0="EMOJI",ja="SYM";var p0=Object.freeze({__proto__:null,WORD:Pn,UWORD:sf,LOCALHOST:Ms,TLD:of,UTLD:af,SCHEME:Ra,SLASH_SCHEME:Mi,NUM:lf,WS:h0,NL:uf,OPENBRACE:Ii,OPENBRACKET:Is,OPENANGLEBRACKET:Ns,OPENPAREN:Rs,CLOSEBRACE:Dr,CLOSEBRACKET:Ni,CLOSEANGLEBRACKET:Ri,CLOSEPAREN:Fr,AMPERSAND:La,APOSTROPHE:Pa,ASTERISK:Da,AT:or,BACKSLASH:Fa,BACKTICK:Ba,CARET:Ha,COLON:ar,COMMA:cf,DOLLAR:$a,DOT:fn,EQUALS:za,EXCLAMATION:ff,HYPHEN:hn,PERCENT:Va,PIPE:Wa,PLUS:Ua,POUND:qa,QUERY:Ka,QUOTE:hf,SEMI:df,SLASH:dn,TILDE:Ls,UNDERSCORE:Ga,EMOJI:d0,SYM:ja});const Li=/[a-z]/,pf=/\p{L}/u,mf=/\p{Emoji}/u,gf=/\d/,m0=/\s/,g0=`
|
|
37
|
+
`,UT="\uFE0F",qT="\u200D";let Ja=null,Ya=null;function KT(n){n===void 0&&(n=[]);const e={};yt.groups=e;const t=new yt;Ja==null&&(Ja=y0(BT)),Ya==null&&(Ya=y0(HT)),$(t,"'",Pa),$(t,"{",Ii),$(t,"[",Is),$(t,"<",Ns),$(t,"(",Rs),$(t,"}",Dr),$(t,"]",Ni),$(t,">",Ri),$(t,")",Fr),$(t,"&",La),$(t,"*",Da),$(t,"@",or),$(t,"`",Ba),$(t,"^",Ha),$(t,":",ar),$(t,",",cf),$(t,"$",$a),$(t,".",fn),$(t,"=",za),$(t,"!",ff),$(t,"-",hn),$(t,"%",Va),$(t,"|",Wa),$(t,"+",Ua),$(t,"#",qa),$(t,"?",Ka),$(t,'"',hf),$(t,"/",dn),$(t,";",df),$(t,"~",Ls),$(t,"_",Ga),$(t,"\\",Fa);const r=zt(t,gf,lf,{[ef]:!0});zt(r,gf,r);const i=zt(t,Li,Pn,{[tf]:!0});zt(i,Li,i);const o=zt(t,pf,sf,{[nf]:!0});zt(o,Li),zt(o,pf,o);const l=zt(t,m0,h0,{[c0]:!0});$(t,g0,uf,{[c0]:!0}),$(l,g0),zt(l,m0,l);const u=zt(t,mf,d0,{[u0]:!0});zt(u,mf,u),$(u,UT,u);const f=$(u,qT);zt(f,mf,u);const d=[[Li,i]],g=[[Li,null],[pf,o]];for(let p=0;p<Ja.length;p++)lr(t,Ja[p],of,Pn,d);for(let p=0;p<Ya.length;p++)lr(t,Ya[p],af,sf,g);Pr(of,{tld:!0,ascii:!0},e),Pr(af,{utld:!0,alpha:!0},e),lr(t,"file",Ra,Pn,d),lr(t,"mailto",Ra,Pn,d),lr(t,"http",Mi,Pn,d),lr(t,"https",Mi,Pn,d),lr(t,"ftp",Mi,Pn,d),lr(t,"ftps",Mi,Pn,d),Pr(Ra,{scheme:!0,ascii:!0},e),Pr(Mi,{slashscheme:!0,ascii:!0},e),n=n.sort((p,_)=>p[0]>_[0]?1:-1);for(let p=0;p<n.length;p++){const _=n[p][0],k=n[p][1]?{[$T]:!0}:{[zT]:!0};_.indexOf("-")>=0?k[rf]=!0:Li.test(_)?gf.test(_)?k[Ia]=!0:k[tf]=!0:k[ef]=!0,f0(t,_,_,k)}return f0(t,"localhost",Ms,{ascii:!0}),t.jd=new yt(ja),{start:t,tokens:Ti({groups:e},p0)}}function GT(n,e){const t=jT(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=t.length,i=[];let o=0,l=0;for(;l<r;){let u=n,f=null,d=0,g=null,p=-1,_=-1;for(;l<r&&(f=u.go(t[l]));)u=f,u.accepts()?(p=0,_=0,g=u):p>=0&&(p+=t[l].length,_++),d+=t[l].length,o+=t[l].length,l++;o-=p,l-=_,d-=p,i.push({t:g.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function jT(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,l=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(l),r+=l.length}return e}function lr(n,e,t,r,i){let o;const l=e.length;for(let u=0;u<l-1;u++){const f=e[u];n.j[f]?o=n.j[f]:(o=new yt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new yt(t),o.jr=i.slice(),n.j[e[l-1]]=o,o}function y0(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let o=0;for(;i.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let l=parseInt(n.substring(r,r+o),10);l>0;l--)t.pop();r+=o}else t.push(n[r]),r++}return e}const Ps={defaultProtocol:"http",events:null,format:b0,formatHref:b0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function yf(n,e){e===void 0&&(e=null);let t=Ti({},Ps);n&&(t=Ti(t,n instanceof yf?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}yf.prototype={o:Ps,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:Ps[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function b0(n){return n}function _0(n,e){this.t="token",this.v=n,this.tk=e}_0.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=Ps.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),l={},u=n.get("className",t,e),f=n.get("target",t,e),d=n.get("rel",t,e),g=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return l.href=r,u&&(l.class=u),f&&(l.target=f),d&&(l.rel=d),g&&Ti(l,g),{tagName:i,attributes:l,content:o,eventListeners:p}}};function Xa(n,e){class t extends _0{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const v0=Xa("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),w0=Xa("text"),JT=Xa("nl"),Br=Xa("url",{isLink:!0,toHref(n){return n===void 0&&(n=Ps.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Ms&&n[1].t===ar}}),Ve=n=>new yt(n);function YT(n){let{groups:e}=n;const t=e.domain.concat([La,Da,or,Fa,Ba,Ha,$a,za,hn,lf,Va,Wa,Ua,qa,dn,ja,Ls,Ga]),r=[Pa,Ri,Dr,Ni,Fr,ar,cf,fn,ff,Ns,Ii,Is,Rs,Ka,hf,df],i=[La,Pa,Da,Fa,Ba,Ha,Dr,$a,za,hn,Ii,Va,Wa,Ua,qa,Ka,dn,ja,Ls,Ga],o=Ve(),l=$(o,Ls);J(l,i,l),J(l,e.domain,l);const u=Ve(),f=Ve(),d=Ve();J(o,e.domain,u),J(o,e.scheme,f),J(o,e.slashscheme,d),J(u,i,l),J(u,e.domain,u);const g=$(u,or);$(l,or,g),$(f,or,g),$(d,or,g);const p=$(l,fn);J(p,i,l),J(p,e.domain,l);const _=Ve();J(g,e.domain,_),J(_,e.domain,_);const S=$(_,fn);J(S,e.domain,_);const k=Ve(v0);J(S,e.tld,k),J(S,e.utld,k),$(g,Ms,k);const m=$(_,hn);J(m,e.domain,_),J(k,e.domain,_),$(k,fn,S),$(k,hn,m);const b=$(k,ar);J(b,e.numeric,v0);const x=$(u,hn),A=$(u,fn);J(x,e.domain,u),J(A,i,l),J(A,e.domain,u);const O=Ve(Br);J(A,e.tld,O),J(A,e.utld,O),J(O,e.domain,u),J(O,i,l),$(O,fn,A),$(O,hn,x),$(O,or,g);const R=$(O,ar),W=Ve(Br);J(R,e.numeric,W);const D=Ve(Br),U=Ve();J(D,t,D),J(D,r,U),J(U,t,D),J(U,r,U),$(O,dn,D),$(W,dn,D);const Q=$(f,ar),we=$(d,ar),rn=$(we,dn),Fn=$(rn,dn);J(f,e.domain,u),$(f,fn,A),$(f,hn,x),J(d,e.domain,u),$(d,fn,A),$(d,hn,x),J(Q,e.domain,D),$(Q,dn,D),J(Fn,e.domain,D),J(Fn,t,D),$(Fn,dn,D);const _n=$(D,Ii),qr=$(D,Is),dr=$(D,Ns),Kr=$(D,Rs);$(U,Ii,_n),$(U,Is,qr),$(U,Ns,dr),$(U,Rs,Kr),$(_n,Dr,D),$(qr,Ni,D),$(dr,Ri,D),$(Kr,Fr,D),$(_n,Dr,D);const Bn=Ve(Br),rt=Ve(Br),Ze=Ve(Br),vn=Ve(Br);J(_n,t,Bn),J(qr,t,rt),J(dr,t,Ze),J(Kr,t,vn);const sn=Ve(),it=Ve(),Gr=Ve(),jr=Ve();return J(_n,r),J(qr,r),J(dr,r),J(Kr,r),J(Bn,t,Bn),J(rt,t,rt),J(Ze,t,Ze),J(vn,t,vn),J(Bn,r,Bn),J(rt,r,rt),J(Ze,r,Ze),J(vn,r,vn),J(sn,t,sn),J(it,t,rt),J(Gr,t,Ze),J(jr,t,vn),J(sn,r,sn),J(it,r,it),J(Gr,r,Gr),J(jr,r,jr),$(rt,Ni,D),$(Ze,Ri,D),$(vn,Fr,D),$(Bn,Dr,D),$(it,Ni,D),$(Gr,Ri,D),$(jr,Fr,D),$(sn,Fr,D),$(o,Ms,O),$(o,uf,JT),{start:o,tokens:p0}}function XT(n,e,t){let r=t.length,i=0,o=[],l=[];for(;i<r;){let u=n,f=null,d=null,g=0,p=null,_=-1;for(;i<r&&!(f=u.go(t[i].t));)l.push(t[i++]);for(;i<r&&(d=f||u.go(t[i].t));)f=null,u=d,u.accepts()?(_=0,p=u):_>=0&&_++,i++,g++;if(_<0)i-=g,i<r&&(l.push(t[i]),i++);else{l.length>0&&(o.push(bf(w0,e,l)),l=[]),i-=_,g-=_;const S=p.t,k=t.slice(i-g,i);o.push(bf(S,e,k))}}return l.length>0&&o.push(bf(w0,e,l)),o}function bf(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const ZT=typeof console<"u"&&console&&console.warn||(()=>{}),QT="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Te={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function eM(){yt.groups={},Te.scanner=null,Te.parser=null,Te.tokenQueue=[],Te.pluginQueue=[],Te.customSchemes=[],Te.initialized=!1}function S0(n,e){if(e===void 0&&(e=!1),Te.initialized&&ZT(`linkifyjs: already initialized - will not register custom scheme "${n}" ${QT}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
40
38
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
41
39
|
2. Cannot start or end with "-"
|
|
42
|
-
3. "-" cannot repeat`);ke.customSchemes.push([n,e])}function gM(){ke.scanner=lM(ke.customSchemes);for(let n=0;n<ke.tokenQueue.length;n++)ke.tokenQueue[n][1]({scanner:ke.scanner});ke.parser=fM(ke.scanner.tokens);for(let n=0;n<ke.pluginQueue.length;n++)ke.pluginQueue[n][1]({scanner:ke.scanner,parser:ke.parser});ke.initialized=!0}function C0(n){return ke.initialized||gM(),hM(ke.parser.start,n,aM(ke.scanner.start,n))}function mf(n,e,t){if(e===void 0&&(e=null),t===void 0&&(t=null),e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new df(t),i=C0(n),o=[];for(let a=0;a<i.length;a++){const u=i[a];u.isLink&&(!e||u.t===e)&&o.push(u.toFormattedObject(r))}return o}function yM(n,e){e===void 0&&(e=null);const t=C0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class bM extends Jc{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),o=yM(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return Mf.query(t,{typeName:ee.TEXT,mark:{typeName:ce.LINK},getMark:{typeName:ce.LINK}})?.attrs||{href:e}}}function P(n){return(...e)=>t=>n(t,...e)}function Kl(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const o=r.replace(/_/g,"-");return`${t}--zw-${o}:${i};`},"");return e?{style:e}:null}function $r(n){const e=Kl(n);return["span",e?{...e,class:"zw-style"}:{},0]}function _M(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Dt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var vM=Object.defineProperty,wM=(n,e,t)=>e in n?vM(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ps=(n,e,t)=>(wM(n,typeof e!="symbol"?e+"":e,t),t);const A0=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),SM=n=>n in A0,xM="[-\\+]?\\d+%?",EM="[-\\+]?\\d*\\.\\d+%?",ir=`(?:${EM})|(?:${xM})`,gf=`[\\s|\\(]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})\\s*\\)?`,yf=`[\\s|\\(]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})\\s*\\)?`,un=Object.freeze({CSS_UNIT:new RegExp(ir),RGB:new RegExp(`rgb${gf}`),RGBA:new RegExp(`rgba${yf}`),HSL:new RegExp(`hsl${gf}`),HSLA:new RegExp(`hsla${yf}`),HSV:new RegExp(`hsv${gf}`),HSVA:new RegExp(`hsva${yf}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),bf=Object.freeze({WINDOW:Symbol("window")});function _f(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function O0(n,e){let t=!1;return function(){t||(n.apply(this,arguments),t=!0,setTimeout(function(){t=!1},e))}}function Br(n){return n>1||n<-1?n/100:n}const Hr=8,kM="#fff",CM="#e6e6e6";function AM(){const n=document.createElement("canvas");n.width=n.height=Hr*2;const e=n.getContext("2d");return e?(e.fillStyle=kM,e.fillRect(0,0,n.width,n.height),e.fillStyle=CM,e.fillRect(0,0,Hr,Hr),e.translate(Hr,Hr),e.fillRect(0,0,Hr,Hr),n.toDataURL()):null}const T0=3;function Ri(n){return Number.parseFloat(n.toFixed(T0+2).substr(0,T0+2))}function OM(n,e=1){const t=[];let r=0;for(;r<n.length;)t.push(n.substr(r,e)),r+=e;return t}function M0(n){const e=OM(n.slice(1),2).map(r=>parseInt(r,16)),t=e[3]!==void 0?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:t}}function I0({h:n,s:e,v:t,a:r}){const i=a=>{const u=(a+n/60)%6;return t-t*e*Math.max(Math.min(u,4-u,1),0)},o=[i(5),i(3),i(1)].map(a=>Math.round(a*255));return{r:o[0],g:o[1],b:o[2],a:r}}function TM({h:n,s:e,l:t,a:r}){const i=t+e*Math.min(t,1-t),o=i===0?0:2-2*t/i,a=Ri(o),u=Ri(i);return{h:n,s:a,v:u,a:r}}function MM(n){const e=r=>{const i=Math.round(r).toString(16);return("00".substr(0,2-i.length)+i).toUpperCase()};return`#${[e(n.r),e(n.g),e(n.b)].join("")}`}function N0(n){if(!n)return{h:0,s:1,v:1,a:1};const e=n.r/255,t=n.g/255,r=n.b/255,i=Math.max(e,t,r),o=Math.min(e,t,r);let a=0;i!==o&&(i===e?a=60*(0+(t-r)/(i-o)):i===t?a=60*(2+(r-e)/(i-o)):i===r&&(a=60*(4+(e-t)/(i-o)))),a<0&&(a=a+360);const u=i===0?0:(i-o)/i,f=[a,u,i],d=Ri(f[1]),p=Ri(f[2]);return{h:Math.floor(f[0]),s:d,v:p,a:n.a}}function IM(n){return N0(M0(n))}function NM({h:n,s:e,v:t,a:r}){const i=t-t*e/2,o=i===1||i===0?0:(t-i)/Math.min(i,1-i),a=Ri(o),u=Ri(i);return{h:n,s:a,l:u,a:r}}function RM(n){const e=IM(n),t=NM(e),r=M0(n);return{alpha:e.a,hex:n.substr(0,7),hexa:n,hsla:t,hsva:e,hue:e.h,rgba:r}}function vf(n,e,t="0"){return n+t.repeat(Math.max(0,e-n.length))}function LM(n){let e=n;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length===6?e=vf(e,8,"F"):e=vf(vf(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}function PM(n){return RM(LM(n))}const wf=class qe{constructor(e){Ps(this,"rgba"),Ps(this,"hsva"),Ps(this,"alpha"),this.rgba=e,this.hsva=this.calcHsva(),this.alpha=e.a}static create(e){if(!e)return qe.fromBlack();let t=e.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(SM(t))t=A0[t];else if(t===this.TRANSPARENT)return qe.fromTransparent();const r=un.RGB.exec(t)||un.RGBA.exec(t);if(r){const u=r[4]===void 0?1:r[4];return qe.fromRgba({r:Number.parseInt(r[1]),g:Number.parseInt(r[2]),b:Number.parseInt(r[3]),a:Number.parseFloat(u.toString())})}const i=un.HSL.exec(t)||un.HSLA.exec(t);if(i){const u=i[4]===void 0?1:i[4];return qe.fromHsla({h:Number.parseInt(i[1]),s:Number.parseFloat(i[2]),l:Number.parseFloat(i[3]),a:Number.parseFloat(u.toString())})}const o=un.HSV.exec(t)||un.HSVA.exec(t);if(o){const u=o[4]===void 0?1:o[4];return qe.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(u.toString())})}return un.HEX8.exec(t)||un.HEX6.exec(t)||un.HEX4.exec(t)||un.HEX3.exec(t)?qe.fromHex(t):qe.fromBlack()}static fromHex(e){const{rgba:t}=PM(e);return new qe(t)}static fromRgba({r:e,g:t,b:r,a:i}){const o=Br(i);return new qe({r:e,g:t,b:r,a:o})}static fromHsla({h:e,s:t,l:r,a:i}){const o=Br(t),a=Br(r),u=Br(i);return qe.fromHsva(TM({h:e,s:o,l:a,a:u}))}static fromHsva({h:e,s:t,v:r,a:i}){const o=Br(t),a=Br(r),u=Br(i),f=I0({h:e,s:o,v:a,a:u});return new qe(f)}static fromTransparent(){return new qe({r:0,g:0,b:0,a:0})}static fromWhite(){return new qe({r:255,g:255,b:255,a:1})}static fromBlack(){return new qe({r:0,g:0,b:0,a:1})}static isTransparent(e){return qe.create(e).isTransparent()}static isDark(e){return qe.create(e).isDark()}get hex(){return this.toHexString()}get r(){return this.rgba.r}get b(){return this.rgba.b}get g(){return this.rgba.g}get h(){return this.hsva.h}get s(){return this.hsva.s}get v(){return this.hsva.v}setAlpha(e){return this.alpha=e,this}toHexString(){return MM({r:this.r,g:this.g,b:this.b})}toRgbaString(){const e=`${Math.floor(this.alpha*100)}%`;return`rgba(${[this.r,this.g,this.b,e].join(", ")})`}updateRgb(e){this.rgba={...this.rgba,...e},this.hsva=this.calcHsva()}updateHsv(e){this.hsva={...this.hsva,...e},this.rgba=this.calcRgba()}isTransparent(){return this.alpha===0}isDark(){return this.getBrightness()<128}getBrightness(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3}calcHsva(){return N0(this.rgba)}calcRgba(){return I0(this.hsva)}};Ps(wf,"TRANSPARENT","transparent"),Ps(wf,"NONE","none");let DM=wf;bf.WINDOW;const R0=3,FM=n=>Number.parseFloat(n.toFixed(R0+2).substr(0,R0+2));bf.WINDOW,bf.WINDOW,O0((n,e)=>{n(e)},20);function L0(n){const e=DM.create(n);return e.alpha===1?e.toHexString():e.toRgbaString()}function P0(n,e){if(!n.includes("em"))return parseInt(n);const t=Li.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function $M(n,e){return(n.firstElementChild||n).style.fontSize||Li.getComputedStyle(e).fontSize}function BM(n,e,t){if(!n.includes("px"))return n;const r=$M(e,t),i=P0(r,t);return i?(parseInt(n)/i).toFixed(2):null}const HM={start:er.LEFT,end:er.RIGHT};function zM(n){const e=HM[n]||n;return er.values.includes(e)?e:null}const D0=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function F0(n,e){return n.resolve(e).depth+1}function VM(n,e,t,r){const i=F0(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const WM=(n,e)=>n.eq(e);function UM(n,e,t,r=WM){const i=n.resolve(e).path.reverse();for(const o of i)if(typeof o!="number"){for(const a of o.marks)if(r(a,t))return!0}return!1}function KM(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var ql={exports:{}};ql.exports,function(n,e){(function(){var t,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",d=500,p="__lodash_placeholder__",m=1,y=2,v=4,S=1,C=2,O=1,N=2,q=4,K=8,oe=16,pe=32,$=64,ue=128,at=256,Bi=512,Xl=30,Hi="...",ar=800,Ur=16,ur=1,Kr=2,Tn=3,Qe=1/0,je=9007199254740991,pn=17976931348623157e292,Zt=NaN,et=4294967295,qr=et-1,Gr=et>>>1,j0=[["ary",ue],["bind",O],["bindKey",N],["curry",K],["curryRight",oe],["flip",Bi],["partial",pe],["partialRight",$],["rearg",at]],jr="[object Arguments]",$s="[object Array]",J0="[object AsyncFunction]",zi="[object Boolean]",Vi="[object Date]",Y0="[object DOMException]",Bs="[object Error]",Hs="[object Function]",If="[object GeneratorFunction]",$t="[object Map]",Wi="[object Number]",X0="[object Null]",mn="[object Object]",Nf="[object Promise]",Z0="[object Proxy]",Ui="[object RegExp]",Bt="[object Set]",Ki="[object String]",zs="[object Symbol]",Q0="[object Undefined]",qi="[object WeakMap]",ey="[object WeakSet]",Gi="[object ArrayBuffer]",Jr="[object DataView]",Zl="[object Float32Array]",Ql="[object Float64Array]",ea="[object Int8Array]",ta="[object Int16Array]",na="[object Int32Array]",ra="[object Uint8Array]",ia="[object Uint8ClampedArray]",sa="[object Uint16Array]",oa="[object Uint32Array]",ty=/\b__p \+= '';/g,ny=/\b(__p \+=) '' \+/g,ry=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rf=/&(?:amp|lt|gt|quot|#39);/g,Lf=/[&<>"']/g,iy=RegExp(Rf.source),sy=RegExp(Lf.source),oy=/<%-([\s\S]+?)%>/g,ly=/<%([\s\S]+?)%>/g,Pf=/<%=([\s\S]+?)%>/g,ay=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uy=/^\w*$/,cy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,la=/[\\^$.*+?()[\]{}|]/g,fy=RegExp(la.source),aa=/^\s+/,hy=/\s/,dy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,py=/\{\n\/\* \[wrapped with (.+)\] \*/,my=/,? & /,gy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yy=/[()=,{}\[\]\/\s]/,by=/\\(\\)?/g,_y=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Df=/\w*$/,vy=/^[-+]0x[0-9a-f]+$/i,wy=/^0b[01]+$/i,Sy=/^\[object .+?Constructor\]$/,xy=/^0o[0-7]+$/i,Ey=/^(?:0|[1-9]\d*)$/,ky=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vs=/($^)/,Cy=/['\n\r\u2028\u2029\\]/g,Ws="\\ud800-\\udfff",Ay="\\u0300-\\u036f",Oy="\\ufe20-\\ufe2f",Ty="\\u20d0-\\u20ff",Ff=Ay+Oy+Ty,$f="\\u2700-\\u27bf",Bf="a-z\\xdf-\\xf6\\xf8-\\xff",My="\\xac\\xb1\\xd7\\xf7",Iy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ny="\\u2000-\\u206f",Ry=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Hf="A-Z\\xc0-\\xd6\\xd8-\\xde",zf="\\ufe0e\\ufe0f",Vf=My+Iy+Ny+Ry,ua="['\u2019]",Ly="["+Ws+"]",Wf="["+Vf+"]",Us="["+Ff+"]",Uf="\\d+",Py="["+$f+"]",Kf="["+Bf+"]",qf="[^"+Ws+Vf+Uf+$f+Bf+Hf+"]",ca="\\ud83c[\\udffb-\\udfff]",Dy="(?:"+Us+"|"+ca+")",Gf="[^"+Ws+"]",fa="(?:\\ud83c[\\udde6-\\uddff]){2}",ha="[\\ud800-\\udbff][\\udc00-\\udfff]",Yr="["+Hf+"]",jf="\\u200d",Jf="(?:"+Kf+"|"+qf+")",Fy="(?:"+Yr+"|"+qf+")",Yf="(?:"+ua+"(?:d|ll|m|re|s|t|ve))?",Xf="(?:"+ua+"(?:D|LL|M|RE|S|T|VE))?",Zf=Dy+"?",Qf="["+zf+"]?",$y="(?:"+jf+"(?:"+[Gf,fa,ha].join("|")+")"+Qf+Zf+")*",By="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",eh=Qf+Zf+$y,zy="(?:"+[Py,fa,ha].join("|")+")"+eh,Vy="(?:"+[Gf+Us+"?",Us,fa,ha,Ly].join("|")+")",Wy=RegExp(ua,"g"),Uy=RegExp(Us,"g"),da=RegExp(ca+"(?="+ca+")|"+Vy+eh,"g"),Ky=RegExp([Yr+"?"+Kf+"+"+Yf+"(?="+[Wf,Yr,"$"].join("|")+")",Fy+"+"+Xf+"(?="+[Wf,Yr+Jf,"$"].join("|")+")",Yr+"?"+Jf+"+"+Yf,Yr+"+"+Xf,Hy,By,Uf,zy].join("|"),"g"),qy=RegExp("["+jf+Ws+Ff+zf+"]"),Gy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,jy=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Jy=-1,ve={};ve[Zl]=ve[Ql]=ve[ea]=ve[ta]=ve[na]=ve[ra]=ve[ia]=ve[sa]=ve[oa]=!0,ve[jr]=ve[$s]=ve[Gi]=ve[zi]=ve[Jr]=ve[Vi]=ve[Bs]=ve[Hs]=ve[$t]=ve[Wi]=ve[mn]=ve[Ui]=ve[Bt]=ve[Ki]=ve[qi]=!1;var _e={};_e[jr]=_e[$s]=_e[Gi]=_e[Jr]=_e[zi]=_e[Vi]=_e[Zl]=_e[Ql]=_e[ea]=_e[ta]=_e[na]=_e[$t]=_e[Wi]=_e[mn]=_e[Ui]=_e[Bt]=_e[Ki]=_e[zs]=_e[ra]=_e[ia]=_e[sa]=_e[oa]=!0,_e[Bs]=_e[Hs]=_e[qi]=!1;var Yy={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Xy={"&":"&","<":"<",">":">",'"':""","'":"'"},Zy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Qy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e1=parseFloat,t1=parseInt,th=typeof cs=="object"&&cs&&cs.Object===Object&&cs,n1=typeof self=="object"&&self&&self.Object===Object&&self,Ve=th||n1||Function("return this")(),pa=e&&!e.nodeType&&e,cr=pa&&!0&&n&&!n.nodeType&&n,nh=cr&&cr.exports===pa,ma=nh&&th.process,Et=function(){try{var E=cr&&cr.require&&cr.require("util").types;return E||ma&&ma.binding&&ma.binding("util")}catch{}}(),rh=Et&&Et.isArrayBuffer,ih=Et&&Et.isDate,sh=Et&&Et.isMap,oh=Et&&Et.isRegExp,lh=Et&&Et.isSet,ah=Et&&Et.isTypedArray;function mt(E,T,A){switch(A.length){case 0:return E.call(T);case 1:return E.call(T,A[0]);case 2:return E.call(T,A[0],A[1]);case 3:return E.call(T,A[0],A[1],A[2])}return E.apply(T,A)}function r1(E,T,A,H){for(var X=-1,me=E==null?0:E.length;++X<me;){var Pe=E[X];T(H,Pe,A(Pe),E)}return H}function kt(E,T){for(var A=-1,H=E==null?0:E.length;++A<H&&T(E[A],A,E)!==!1;);return E}function i1(E,T){for(var A=E==null?0:E.length;A--&&T(E[A],A,E)!==!1;);return E}function uh(E,T){for(var A=-1,H=E==null?0:E.length;++A<H;)if(!T(E[A],A,E))return!1;return!0}function Mn(E,T){for(var A=-1,H=E==null?0:E.length,X=0,me=[];++A<H;){var Pe=E[A];T(Pe,A,E)&&(me[X++]=Pe)}return me}function Ks(E,T){var A=E==null?0:E.length;return!!A&&Xr(E,T,0)>-1}function ga(E,T,A){for(var H=-1,X=E==null?0:E.length;++H<X;)if(A(T,E[H]))return!0;return!1}function Se(E,T){for(var A=-1,H=E==null?0:E.length,X=Array(H);++A<H;)X[A]=T(E[A],A,E);return X}function In(E,T){for(var A=-1,H=T.length,X=E.length;++A<H;)E[X+A]=T[A];return E}function ya(E,T,A,H){var X=-1,me=E==null?0:E.length;for(H&&me&&(A=E[++X]);++X<me;)A=T(A,E[X],X,E);return A}function s1(E,T,A,H){var X=E==null?0:E.length;for(H&&X&&(A=E[--X]);X--;)A=T(A,E[X],X,E);return A}function ba(E,T){for(var A=-1,H=E==null?0:E.length;++A<H;)if(T(E[A],A,E))return!0;return!1}var o1=_a("length");function l1(E){return E.split("")}function a1(E){return E.match(gy)||[]}function ch(E,T,A){var H;return A(E,function(X,me,Pe){if(T(X,me,Pe))return H=me,!1}),H}function qs(E,T,A,H){for(var X=E.length,me=A+(H?1:-1);H?me--:++me<X;)if(T(E[me],me,E))return me;return-1}function Xr(E,T,A){return T===T?v1(E,T,A):qs(E,fh,A)}function u1(E,T,A,H){for(var X=A-1,me=E.length;++X<me;)if(H(E[X],T))return X;return-1}function fh(E){return E!==E}function hh(E,T){var A=E==null?0:E.length;return A?wa(E,T)/A:Zt}function _a(E){return function(T){return T==null?t:T[E]}}function va(E){return function(T){return E==null?t:E[T]}}function dh(E,T,A,H,X){return X(E,function(me,Pe,be){A=H?(H=!1,me):T(A,me,Pe,be)}),A}function c1(E,T){var A=E.length;for(E.sort(T);A--;)E[A]=E[A].value;return E}function wa(E,T){for(var A,H=-1,X=E.length;++H<X;){var me=T(E[H]);me!==t&&(A=A===t?me:A+me)}return A}function Sa(E,T){for(var A=-1,H=Array(E);++A<E;)H[A]=T(A);return H}function f1(E,T){return Se(T,function(A){return[A,E[A]]})}function ph(E){return E&&E.slice(0,bh(E)+1).replace(aa,"")}function gt(E){return function(T){return E(T)}}function xa(E,T){return Se(T,function(A){return E[A]})}function ji(E,T){return E.has(T)}function mh(E,T){for(var A=-1,H=E.length;++A<H&&Xr(T,E[A],0)>-1;);return A}function gh(E,T){for(var A=E.length;A--&&Xr(T,E[A],0)>-1;);return A}function h1(E,T){for(var A=E.length,H=0;A--;)E[A]===T&&++H;return H}var d1=va(Yy),p1=va(Xy);function m1(E){return"\\"+Qy[E]}function g1(E,T){return E==null?t:E[T]}function Zr(E){return qy.test(E)}function y1(E){return Gy.test(E)}function b1(E){for(var T,A=[];!(T=E.next()).done;)A.push(T.value);return A}function Ea(E){var T=-1,A=Array(E.size);return E.forEach(function(H,X){A[++T]=[X,H]}),A}function yh(E,T){return function(A){return E(T(A))}}function Nn(E,T){for(var A=-1,H=E.length,X=0,me=[];++A<H;){var Pe=E[A];(Pe===T||Pe===p)&&(E[A]=p,me[X++]=A)}return me}function Gs(E){var T=-1,A=Array(E.size);return E.forEach(function(H){A[++T]=H}),A}function _1(E){var T=-1,A=Array(E.size);return E.forEach(function(H){A[++T]=[H,H]}),A}function v1(E,T,A){for(var H=A-1,X=E.length;++H<X;)if(E[H]===T)return H;return-1}function w1(E,T,A){for(var H=A+1;H--;)if(E[H]===T)return H;return H}function Qr(E){return Zr(E)?x1(E):o1(E)}function Ht(E){return Zr(E)?E1(E):l1(E)}function bh(E){for(var T=E.length;T--&&hy.test(E.charAt(T)););return T}var S1=va(Zy);function x1(E){for(var T=da.lastIndex=0;da.test(E);)++T;return T}function E1(E){return E.match(da)||[]}function k1(E){return E.match(Ky)||[]}var C1=function E(T){T=T==null?Ve:ei.defaults(Ve.Object(),T,ei.pick(Ve,jy));var A=T.Array,H=T.Date,X=T.Error,me=T.Function,Pe=T.Math,be=T.Object,ka=T.RegExp,A1=T.String,Ct=T.TypeError,js=A.prototype,O1=me.prototype,ti=be.prototype,Js=T["__core-js_shared__"],Ys=O1.toString,ye=ti.hasOwnProperty,T1=0,_h=function(){var s=/[^.]+$/.exec(Js&&Js.keys&&Js.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Xs=ti.toString,M1=Ys.call(be),I1=Ve._,N1=ka("^"+Ys.call(ye).replace(la,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zs=nh?T.Buffer:t,Rn=T.Symbol,Qs=T.Uint8Array,vh=Zs?Zs.allocUnsafe:t,eo=yh(be.getPrototypeOf,be),wh=be.create,Sh=ti.propertyIsEnumerable,to=js.splice,xh=Rn?Rn.isConcatSpreadable:t,Ji=Rn?Rn.iterator:t,fr=Rn?Rn.toStringTag:t,no=function(){try{var s=gr(be,"defineProperty");return s({},"",{}),s}catch{}}(),R1=T.clearTimeout!==Ve.clearTimeout&&T.clearTimeout,L1=H&&H.now!==Ve.Date.now&&H.now,P1=T.setTimeout!==Ve.setTimeout&&T.setTimeout,ro=Pe.ceil,io=Pe.floor,Ca=be.getOwnPropertySymbols,D1=Zs?Zs.isBuffer:t,Eh=T.isFinite,F1=js.join,$1=yh(be.keys,be),De=Pe.max,Je=Pe.min,B1=H.now,H1=T.parseInt,kh=Pe.random,z1=js.reverse,Aa=gr(T,"DataView"),Yi=gr(T,"Map"),Oa=gr(T,"Promise"),ni=gr(T,"Set"),Xi=gr(T,"WeakMap"),Zi=gr(be,"create"),so=Xi&&new Xi,ri={},V1=yr(Aa),W1=yr(Yi),U1=yr(Oa),K1=yr(ni),q1=yr(Xi),oo=Rn?Rn.prototype:t,Qi=oo?oo.valueOf:t,Ch=oo?oo.toString:t;function b(s){if(Ce(s)&&!Z(s)&&!(s instanceof le)){if(s instanceof At)return s;if(ye.call(s,"__wrapped__"))return Ad(s)}return new At(s)}var ii=function(){function s(){}return function(l){if(!Ee(l))return{};if(wh)return wh(l);s.prototype=l;var c=new s;return s.prototype=t,c}}();function lo(){}function At(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}b.templateSettings={escape:oy,evaluate:ly,interpolate:Pf,variable:"",imports:{_:b}},b.prototype=lo.prototype,b.prototype.constructor=b,At.prototype=ii(lo.prototype),At.prototype.constructor=At;function le(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=et,this.__views__=[]}function G1(){var s=new le(this.__wrapped__);return s.__actions__=ut(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ut(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ut(this.__views__),s}function j1(){if(this.__filtered__){var s=new le(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function J1(){var s=this.__wrapped__.value(),l=this.__dir__,c=Z(s),h=l<0,g=c?s.length:0,_=l_(0,g,this.__views__),w=_.start,x=_.end,k=x-w,M=h?x:w-1,I=this.__iteratees__,R=I.length,B=0,W=Je(k,this.__takeCount__);if(!c||!h&&g==k&&W==k)return Yh(s,this.__actions__);var j=[];e:for(;k--&&B<W;){M+=l;for(var te=-1,J=s[M];++te<R;){var re=I[te],ae=re.iteratee,_t=re.type,rt=ae(J);if(_t==Kr)J=rt;else if(!rt){if(_t==ur)continue e;break e}}j[B++]=J}return j}le.prototype=ii(lo.prototype),le.prototype.constructor=le;function hr(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function Y1(){this.__data__=Zi?Zi(null):{},this.size=0}function X1(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function Z1(s){var l=this.__data__;if(Zi){var c=l[s];return c===f?t:c}return ye.call(l,s)?l[s]:t}function Q1(s){var l=this.__data__;return Zi?l[s]!==t:ye.call(l,s)}function eb(s,l){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=Zi&&l===t?f:l,this}hr.prototype.clear=Y1,hr.prototype.delete=X1,hr.prototype.get=Z1,hr.prototype.has=Q1,hr.prototype.set=eb;function gn(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function tb(){this.__data__=[],this.size=0}function nb(s){var l=this.__data__,c=ao(l,s);if(c<0)return!1;var h=l.length-1;return c==h?l.pop():to.call(l,c,1),--this.size,!0}function rb(s){var l=this.__data__,c=ao(l,s);return c<0?t:l[c][1]}function ib(s){return ao(this.__data__,s)>-1}function sb(s,l){var c=this.__data__,h=ao(c,s);return h<0?(++this.size,c.push([s,l])):c[h][1]=l,this}gn.prototype.clear=tb,gn.prototype.delete=nb,gn.prototype.get=rb,gn.prototype.has=ib,gn.prototype.set=sb;function yn(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function ob(){this.size=0,this.__data__={hash:new hr,map:new(Yi||gn),string:new hr}}function lb(s){var l=wo(this,s).delete(s);return this.size-=l?1:0,l}function ab(s){return wo(this,s).get(s)}function ub(s){return wo(this,s).has(s)}function cb(s,l){var c=wo(this,s),h=c.size;return c.set(s,l),this.size+=c.size==h?0:1,this}yn.prototype.clear=ob,yn.prototype.delete=lb,yn.prototype.get=ab,yn.prototype.has=ub,yn.prototype.set=cb;function dr(s){var l=-1,c=s==null?0:s.length;for(this.__data__=new yn;++l<c;)this.add(s[l])}function fb(s){return this.__data__.set(s,f),this}function hb(s){return this.__data__.has(s)}dr.prototype.add=dr.prototype.push=fb,dr.prototype.has=hb;function zt(s){var l=this.__data__=new gn(s);this.size=l.size}function db(){this.__data__=new gn,this.size=0}function pb(s){var l=this.__data__,c=l.delete(s);return this.size=l.size,c}function mb(s){return this.__data__.get(s)}function gb(s){return this.__data__.has(s)}function yb(s,l){var c=this.__data__;if(c instanceof gn){var h=c.__data__;if(!Yi||h.length<i-1)return h.push([s,l]),this.size=++c.size,this;c=this.__data__=new yn(h)}return c.set(s,l),this.size=c.size,this}zt.prototype.clear=db,zt.prototype.delete=pb,zt.prototype.get=mb,zt.prototype.has=gb,zt.prototype.set=yb;function Ah(s,l){var c=Z(s),h=!c&&br(s),g=!c&&!h&&$n(s),_=!c&&!h&&!g&&ai(s),w=c||h||g||_,x=w?Sa(s.length,A1):[],k=x.length;for(var M in s)(l||ye.call(s,M))&&!(w&&(M=="length"||g&&(M=="offset"||M=="parent")||_&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||wn(M,k)))&&x.push(M);return x}function Oh(s){var l=s.length;return l?s[Ba(0,l-1)]:t}function bb(s,l){return So(ut(s),pr(l,0,s.length))}function _b(s){return So(ut(s))}function Ta(s,l,c){(c!==t&&!Vt(s[l],c)||c===t&&!(l in s))&&bn(s,l,c)}function es(s,l,c){var h=s[l];(!(ye.call(s,l)&&Vt(h,c))||c===t&&!(l in s))&&bn(s,l,c)}function ao(s,l){for(var c=s.length;c--;)if(Vt(s[c][0],l))return c;return-1}function vb(s,l,c,h){return Ln(s,function(g,_,w){l(h,g,c(g),w)}),h}function Th(s,l){return s&&en(l,Fe(l),s)}function wb(s,l){return s&&en(l,ft(l),s)}function bn(s,l,c){l=="__proto__"&&no?no(s,l,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[l]=c}function Ma(s,l){for(var c=-1,h=l.length,g=A(h),_=s==null;++c<h;)g[c]=_?t:cu(s,l[c]);return g}function pr(s,l,c){return s===s&&(c!==t&&(s=s<=c?s:c),l!==t&&(s=s>=l?s:l)),s}function Ot(s,l,c,h,g,_){var w,x=l&m,k=l&y,M=l&v;if(c&&(w=g?c(s,h,g,_):c(s)),w!==t)return w;if(!Ee(s))return s;var I=Z(s);if(I){if(w=u_(s),!x)return ut(s,w)}else{var R=Ye(s),B=R==Hs||R==If;if($n(s))return Qh(s,x);if(R==mn||R==jr||B&&!g){if(w=k||B?{}:bd(s),!x)return k?Zb(s,wb(w,s)):Xb(s,Th(w,s))}else{if(!_e[R])return g?s:{};w=c_(s,R,x)}}_||(_=new zt);var W=_.get(s);if(W)return W;_.set(s,w),Gd(s)?s.forEach(function(J){w.add(Ot(J,l,c,J,s,_))}):Kd(s)&&s.forEach(function(J,re){w.set(re,Ot(J,l,c,re,s,_))});var j=M?k?Ya:Ja:k?ft:Fe,te=I?t:j(s);return kt(te||s,function(J,re){te&&(re=J,J=s[re]),es(w,re,Ot(J,l,c,re,s,_))}),w}function Sb(s){var l=Fe(s);return function(c){return Mh(c,s,l)}}function Mh(s,l,c){var h=c.length;if(s==null)return!h;for(s=be(s);h--;){var g=c[h],_=l[g],w=s[g];if(w===t&&!(g in s)||!_(w))return!1}return!0}function Ih(s,l,c){if(typeof s!="function")throw new Ct(a);return as(function(){s.apply(t,c)},l)}function ts(s,l,c,h){var g=-1,_=Ks,w=!0,x=s.length,k=[],M=l.length;if(!x)return k;c&&(l=Se(l,gt(c))),h?(_=ga,w=!1):l.length>=i&&(_=ji,w=!1,l=new dr(l));e:for(;++g<x;){var I=s[g],R=c==null?I:c(I);if(I=h||I!==0?I:0,w&&R===R){for(var B=M;B--;)if(l[B]===R)continue e;k.push(I)}else _(l,R,h)||k.push(I)}return k}var Ln=id(Qt),Nh=id(Na,!0);function xb(s,l){var c=!0;return Ln(s,function(h,g,_){return c=!!l(h,g,_),c}),c}function uo(s,l,c){for(var h=-1,g=s.length;++h<g;){var _=s[h],w=l(_);if(w!=null&&(x===t?w===w&&!bt(w):c(w,x)))var x=w,k=_}return k}function Eb(s,l,c,h){var g=s.length;for(c=Q(c),c<0&&(c=-c>g?0:g+c),h=h===t||h>g?g:Q(h),h<0&&(h+=g),h=c>h?0:Jd(h);c<h;)s[c++]=l;return s}function Rh(s,l){var c=[];return Ln(s,function(h,g,_){l(h,g,_)&&c.push(h)}),c}function We(s,l,c,h,g){var _=-1,w=s.length;for(c||(c=h_),g||(g=[]);++_<w;){var x=s[_];l>0&&c(x)?l>1?We(x,l-1,c,h,g):In(g,x):h||(g[g.length]=x)}return g}var Ia=sd(),Lh=sd(!0);function Qt(s,l){return s&&Ia(s,l,Fe)}function Na(s,l){return s&&Lh(s,l,Fe)}function co(s,l){return Mn(l,function(c){return Sn(s[c])})}function mr(s,l){l=Dn(l,s);for(var c=0,h=l.length;s!=null&&c<h;)s=s[tn(l[c++])];return c&&c==h?s:t}function Ph(s,l,c){var h=l(s);return Z(s)?h:In(h,c(s))}function tt(s){return s==null?s===t?Q0:X0:fr&&fr in be(s)?o_(s):__(s)}function Ra(s,l){return s>l}function kb(s,l){return s!=null&&ye.call(s,l)}function Cb(s,l){return s!=null&&l in be(s)}function Ab(s,l,c){return s>=Je(l,c)&&s<De(l,c)}function La(s,l,c){for(var h=c?ga:Ks,g=s[0].length,_=s.length,w=_,x=A(_),k=1/0,M=[];w--;){var I=s[w];w&&l&&(I=Se(I,gt(l))),k=Je(I.length,k),x[w]=!c&&(l||g>=120&&I.length>=120)?new dr(w&&I):t}I=s[0];var R=-1,B=x[0];e:for(;++R<g&&M.length<k;){var W=I[R],j=l?l(W):W;if(W=c||W!==0?W:0,!(B?ji(B,j):h(M,j,c))){for(w=_;--w;){var te=x[w];if(!(te?ji(te,j):h(s[w],j,c)))continue e}B&&B.push(j),M.push(W)}}return M}function Ob(s,l,c,h){return Qt(s,function(g,_,w){l(h,c(g),_,w)}),h}function ns(s,l,c){l=Dn(l,s),s=Sd(s,l);var h=s==null?s:s[tn(Mt(l))];return h==null?t:mt(h,s,c)}function Dh(s){return Ce(s)&&tt(s)==jr}function Tb(s){return Ce(s)&&tt(s)==Gi}function Mb(s){return Ce(s)&&tt(s)==Vi}function rs(s,l,c,h,g){return s===l?!0:s==null||l==null||!Ce(s)&&!Ce(l)?s!==s&&l!==l:Ib(s,l,c,h,rs,g)}function Ib(s,l,c,h,g,_){var w=Z(s),x=Z(l),k=w?$s:Ye(s),M=x?$s:Ye(l);k=k==jr?mn:k,M=M==jr?mn:M;var I=k==mn,R=M==mn,B=k==M;if(B&&$n(s)){if(!$n(l))return!1;w=!0,I=!1}if(B&&!I)return _||(_=new zt),w||ai(s)?md(s,l,c,h,g,_):i_(s,l,k,c,h,g,_);if(!(c&S)){var W=I&&ye.call(s,"__wrapped__"),j=R&&ye.call(l,"__wrapped__");if(W||j){var te=W?s.value():s,J=j?l.value():l;return _||(_=new zt),g(te,J,c,h,_)}}return B?(_||(_=new zt),s_(s,l,c,h,g,_)):!1}function Nb(s){return Ce(s)&&Ye(s)==$t}function Pa(s,l,c,h){var g=c.length,_=g,w=!h;if(s==null)return!_;for(s=be(s);g--;){var x=c[g];if(w&&x[2]?x[1]!==s[x[0]]:!(x[0]in s))return!1}for(;++g<_;){x=c[g];var k=x[0],M=s[k],I=x[1];if(w&&x[2]){if(M===t&&!(k in s))return!1}else{var R=new zt;if(h)var B=h(M,I,k,s,l,R);if(!(B===t?rs(I,M,S|C,h,R):B))return!1}}return!0}function Fh(s){if(!Ee(s)||p_(s))return!1;var l=Sn(s)?N1:Sy;return l.test(yr(s))}function Rb(s){return Ce(s)&&tt(s)==Ui}function Lb(s){return Ce(s)&&Ye(s)==Bt}function Pb(s){return Ce(s)&&Oo(s.length)&&!!ve[tt(s)]}function $h(s){return typeof s=="function"?s:s==null?ht:typeof s=="object"?Z(s)?zh(s[0],s[1]):Hh(s):op(s)}function Da(s){if(!ls(s))return $1(s);var l=[];for(var c in be(s))ye.call(s,c)&&c!="constructor"&&l.push(c);return l}function Db(s){if(!Ee(s))return b_(s);var l=ls(s),c=[];for(var h in s)h=="constructor"&&(l||!ye.call(s,h))||c.push(h);return c}function Fa(s,l){return s<l}function Bh(s,l){var c=-1,h=ct(s)?A(s.length):[];return Ln(s,function(g,_,w){h[++c]=l(g,_,w)}),h}function Hh(s){var l=Za(s);return l.length==1&&l[0][2]?vd(l[0][0],l[0][1]):function(c){return c===s||Pa(c,s,l)}}function zh(s,l){return eu(s)&&_d(l)?vd(tn(s),l):function(c){var h=cu(c,s);return h===t&&h===l?fu(c,s):rs(l,h,S|C)}}function fo(s,l,c,h,g){s!==l&&Ia(l,function(_,w){if(g||(g=new zt),Ee(_))Fb(s,l,w,c,fo,h,g);else{var x=h?h(nu(s,w),_,w+"",s,l,g):t;x===t&&(x=_),Ta(s,w,x)}},ft)}function Fb(s,l,c,h,g,_,w){var x=nu(s,c),k=nu(l,c),M=w.get(k);if(M){Ta(s,c,M);return}var I=_?_(x,k,c+"",s,l,w):t,R=I===t;if(R){var B=Z(k),W=!B&&$n(k),j=!B&&!W&&ai(k);I=k,B||W||j?Z(x)?I=x:Oe(x)?I=ut(x):W?(R=!1,I=Qh(k,!0)):j?(R=!1,I=ed(k,!0)):I=[]:us(k)||br(k)?(I=x,br(x)?I=Yd(x):(!Ee(x)||Sn(x))&&(I=bd(k))):R=!1}R&&(w.set(k,I),g(I,k,h,_,w),w.delete(k)),Ta(s,c,I)}function Vh(s,l){var c=s.length;if(c)return l+=l<0?c:0,wn(l,c)?s[l]:t}function Wh(s,l,c){l.length?l=Se(l,function(_){return Z(_)?function(w){return mr(w,_.length===1?_[0]:_)}:_}):l=[ht];var h=-1;l=Se(l,gt(G()));var g=Bh(s,function(_,w,x){var k=Se(l,function(M){return M(_)});return{criteria:k,index:++h,value:_}});return c1(g,function(_,w){return Yb(_,w,c)})}function $b(s,l){return Uh(s,l,function(c,h){return fu(s,h)})}function Uh(s,l,c){for(var h=-1,g=l.length,_={};++h<g;){var w=l[h],x=mr(s,w);c(x,w)&&is(_,Dn(w,s),x)}return _}function Bb(s){return function(l){return mr(l,s)}}function $a(s,l,c,h){var g=h?u1:Xr,_=-1,w=l.length,x=s;for(s===l&&(l=ut(l)),c&&(x=Se(s,gt(c)));++_<w;)for(var k=0,M=l[_],I=c?c(M):M;(k=g(x,I,k,h))>-1;)x!==s&&to.call(x,k,1),to.call(s,k,1);return s}function Kh(s,l){for(var c=s?l.length:0,h=c-1;c--;){var g=l[c];if(c==h||g!==_){var _=g;wn(g)?to.call(s,g,1):Va(s,g)}}return s}function Ba(s,l){return s+io(kh()*(l-s+1))}function Hb(s,l,c,h){for(var g=-1,_=De(ro((l-s)/(c||1)),0),w=A(_);_--;)w[h?_:++g]=s,s+=c;return w}function Ha(s,l){var c="";if(!s||l<1||l>je)return c;do l%2&&(c+=s),l=io(l/2),l&&(s+=s);while(l);return c}function ne(s,l){return ru(wd(s,l,ht),s+"")}function zb(s){return Oh(ui(s))}function Vb(s,l){var c=ui(s);return So(c,pr(l,0,c.length))}function is(s,l,c,h){if(!Ee(s))return s;l=Dn(l,s);for(var g=-1,_=l.length,w=_-1,x=s;x!=null&&++g<_;){var k=tn(l[g]),M=c;if(k==="__proto__"||k==="constructor"||k==="prototype")return s;if(g!=w){var I=x[k];M=h?h(I,k,x):t,M===t&&(M=Ee(I)?I:wn(l[g+1])?[]:{})}es(x,k,M),x=x[k]}return s}var qh=so?function(s,l){return so.set(s,l),s}:ht,Wb=no?function(s,l){return no(s,"toString",{configurable:!0,enumerable:!1,value:du(l),writable:!0})}:ht;function Ub(s){return So(ui(s))}function Tt(s,l,c){var h=-1,g=s.length;l<0&&(l=-l>g?0:g+l),c=c>g?g:c,c<0&&(c+=g),g=l>c?0:c-l>>>0,l>>>=0;for(var _=A(g);++h<g;)_[h]=s[h+l];return _}function Kb(s,l){var c;return Ln(s,function(h,g,_){return c=l(h,g,_),!c}),!!c}function ho(s,l,c){var h=0,g=s==null?h:s.length;if(typeof l=="number"&&l===l&&g<=Gr){for(;h<g;){var _=h+g>>>1,w=s[_];w!==null&&!bt(w)&&(c?w<=l:w<l)?h=_+1:g=_}return g}return za(s,l,ht,c)}function za(s,l,c,h){var g=0,_=s==null?0:s.length;if(_===0)return 0;l=c(l);for(var w=l!==l,x=l===null,k=bt(l),M=l===t;g<_;){var I=io((g+_)/2),R=c(s[I]),B=R!==t,W=R===null,j=R===R,te=bt(R);if(w)var J=h||j;else M?J=j&&(h||B):x?J=j&&B&&(h||!W):k?J=j&&B&&!W&&(h||!te):W||te?J=!1:J=h?R<=l:R<l;J?g=I+1:_=I}return Je(_,qr)}function Gh(s,l){for(var c=-1,h=s.length,g=0,_=[];++c<h;){var w=s[c],x=l?l(w):w;if(!c||!Vt(x,k)){var k=x;_[g++]=w===0?0:w}}return _}function jh(s){return typeof s=="number"?s:bt(s)?Zt:+s}function yt(s){if(typeof s=="string")return s;if(Z(s))return Se(s,yt)+"";if(bt(s))return Ch?Ch.call(s):"";var l=s+"";return l=="0"&&1/s==-Qe?"-0":l}function Pn(s,l,c){var h=-1,g=Ks,_=s.length,w=!0,x=[],k=x;if(c)w=!1,g=ga;else if(_>=i){var M=l?null:n_(s);if(M)return Gs(M);w=!1,g=ji,k=new dr}else k=l?[]:x;e:for(;++h<_;){var I=s[h],R=l?l(I):I;if(I=c||I!==0?I:0,w&&R===R){for(var B=k.length;B--;)if(k[B]===R)continue e;l&&k.push(R),x.push(I)}else g(k,R,c)||(k!==x&&k.push(R),x.push(I))}return x}function Va(s,l){return l=Dn(l,s),s=Sd(s,l),s==null||delete s[tn(Mt(l))]}function Jh(s,l,c,h){return is(s,l,c(mr(s,l)),h)}function po(s,l,c,h){for(var g=s.length,_=h?g:-1;(h?_--:++_<g)&&l(s[_],_,s););return c?Tt(s,h?0:_,h?_+1:g):Tt(s,h?_+1:0,h?g:_)}function Yh(s,l){var c=s;return c instanceof le&&(c=c.value()),ya(l,function(h,g){return g.func.apply(g.thisArg,In([h],g.args))},c)}function Wa(s,l,c){var h=s.length;if(h<2)return h?Pn(s[0]):[];for(var g=-1,_=A(h);++g<h;)for(var w=s[g],x=-1;++x<h;)x!=g&&(_[g]=ts(_[g]||w,s[x],l,c));return Pn(We(_,1),l,c)}function Xh(s,l,c){for(var h=-1,g=s.length,_=l.length,w={};++h<g;){var x=h<_?l[h]:t;c(w,s[h],x)}return w}function Ua(s){return Oe(s)?s:[]}function Ka(s){return typeof s=="function"?s:ht}function Dn(s,l){return Z(s)?s:eu(s,l)?[s]:Cd(ge(s))}var qb=ne;function Fn(s,l,c){var h=s.length;return c=c===t?h:c,!l&&c>=h?s:Tt(s,l,c)}var Zh=R1||function(s){return Ve.clearTimeout(s)};function Qh(s,l){if(l)return s.slice();var c=s.length,h=vh?vh(c):new s.constructor(c);return s.copy(h),h}function qa(s){var l=new s.constructor(s.byteLength);return new Qs(l).set(new Qs(s)),l}function Gb(s,l){var c=l?qa(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function jb(s){var l=new s.constructor(s.source,Df.exec(s));return l.lastIndex=s.lastIndex,l}function Jb(s){return Qi?be(Qi.call(s)):{}}function ed(s,l){var c=l?qa(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function td(s,l){if(s!==l){var c=s!==t,h=s===null,g=s===s,_=bt(s),w=l!==t,x=l===null,k=l===l,M=bt(l);if(!x&&!M&&!_&&s>l||_&&w&&k&&!x&&!M||h&&w&&k||!c&&k||!g)return 1;if(!h&&!_&&!M&&s<l||M&&c&&g&&!h&&!_||x&&c&&g||!w&&g||!k)return-1}return 0}function Yb(s,l,c){for(var h=-1,g=s.criteria,_=l.criteria,w=g.length,x=c.length;++h<w;){var k=td(g[h],_[h]);if(k){if(h>=x)return k;var M=c[h];return k*(M=="desc"?-1:1)}}return s.index-l.index}function nd(s,l,c,h){for(var g=-1,_=s.length,w=c.length,x=-1,k=l.length,M=De(_-w,0),I=A(k+M),R=!h;++x<k;)I[x]=l[x];for(;++g<w;)(R||g<_)&&(I[c[g]]=s[g]);for(;M--;)I[x++]=s[g++];return I}function rd(s,l,c,h){for(var g=-1,_=s.length,w=-1,x=c.length,k=-1,M=l.length,I=De(_-x,0),R=A(I+M),B=!h;++g<I;)R[g]=s[g];for(var W=g;++k<M;)R[W+k]=l[k];for(;++w<x;)(B||g<_)&&(R[W+c[w]]=s[g++]);return R}function ut(s,l){var c=-1,h=s.length;for(l||(l=A(h));++c<h;)l[c]=s[c];return l}function en(s,l,c,h){var g=!c;c||(c={});for(var _=-1,w=l.length;++_<w;){var x=l[_],k=h?h(c[x],s[x],x,c,s):t;k===t&&(k=s[x]),g?bn(c,x,k):es(c,x,k)}return c}function Xb(s,l){return en(s,Qa(s),l)}function Zb(s,l){return en(s,gd(s),l)}function mo(s,l){return function(c,h){var g=Z(c)?r1:vb,_=l?l():{};return g(c,s,G(h,2),_)}}function si(s){return ne(function(l,c){var h=-1,g=c.length,_=g>1?c[g-1]:t,w=g>2?c[2]:t;for(_=s.length>3&&typeof _=="function"?(g--,_):t,w&&nt(c[0],c[1],w)&&(_=g<3?t:_,g=1),l=be(l);++h<g;){var x=c[h];x&&s(l,x,h,_)}return l})}function id(s,l){return function(c,h){if(c==null)return c;if(!ct(c))return s(c,h);for(var g=c.length,_=l?g:-1,w=be(c);(l?_--:++_<g)&&h(w[_],_,w)!==!1;);return c}}function sd(s){return function(l,c,h){for(var g=-1,_=be(l),w=h(l),x=w.length;x--;){var k=w[s?x:++g];if(c(_[k],k,_)===!1)break}return l}}function Qb(s,l,c){var h=l&O,g=ss(s);function _(){var w=this&&this!==Ve&&this instanceof _?g:s;return w.apply(h?c:this,arguments)}return _}function od(s){return function(l){l=ge(l);var c=Zr(l)?Ht(l):t,h=c?c[0]:l.charAt(0),g=c?Fn(c,1).join(""):l.slice(1);return h[s]()+g}}function oi(s){return function(l){return ya(ip(rp(l).replace(Wy,"")),s,"")}}function ss(s){return function(){var l=arguments;switch(l.length){case 0:return new s;case 1:return new s(l[0]);case 2:return new s(l[0],l[1]);case 3:return new s(l[0],l[1],l[2]);case 4:return new s(l[0],l[1],l[2],l[3]);case 5:return new s(l[0],l[1],l[2],l[3],l[4]);case 6:return new s(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new s(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var c=ii(s.prototype),h=s.apply(c,l);return Ee(h)?h:c}}function e_(s,l,c){var h=ss(s);function g(){for(var _=arguments.length,w=A(_),x=_,k=li(g);x--;)w[x]=arguments[x];var M=_<3&&w[0]!==k&&w[_-1]!==k?[]:Nn(w,k);if(_-=M.length,_<c)return fd(s,l,go,g.placeholder,t,w,M,t,t,c-_);var I=this&&this!==Ve&&this instanceof g?h:s;return mt(I,this,w)}return g}function ld(s){return function(l,c,h){var g=be(l);if(!ct(l)){var _=G(c,3);l=Fe(l),c=function(x){return _(g[x],x,g)}}var w=s(l,c,h);return w>-1?g[_?l[w]:w]:t}}function ad(s){return vn(function(l){var c=l.length,h=c,g=At.prototype.thru;for(s&&l.reverse();h--;){var _=l[h];if(typeof _!="function")throw new Ct(a);if(g&&!w&&vo(_)=="wrapper")var w=new At([],!0)}for(h=w?h:c;++h<c;){_=l[h];var x=vo(_),k=x=="wrapper"?Xa(_):t;k&&tu(k[0])&&k[1]==(ue|K|pe|at)&&!k[4].length&&k[9]==1?w=w[vo(k[0])].apply(w,k[3]):w=_.length==1&&tu(_)?w[x]():w.thru(_)}return function(){var M=arguments,I=M[0];if(w&&M.length==1&&Z(I))return w.plant(I).value();for(var R=0,B=c?l[R].apply(this,M):I;++R<c;)B=l[R].call(this,B);return B}})}function go(s,l,c,h,g,_,w,x,k,M){var I=l&ue,R=l&O,B=l&N,W=l&(K|oe),j=l&Bi,te=B?t:ss(s);function J(){for(var re=arguments.length,ae=A(re),_t=re;_t--;)ae[_t]=arguments[_t];if(W)var rt=li(J),vt=h1(ae,rt);if(h&&(ae=nd(ae,h,g,W)),_&&(ae=rd(ae,_,w,W)),re-=vt,W&&re<M){var Te=Nn(ae,rt);return fd(s,l,go,J.placeholder,c,ae,Te,x,k,M-re)}var Wt=R?c:this,En=B?Wt[s]:s;return re=ae.length,x?ae=v_(ae,x):j&&re>1&&ae.reverse(),I&&k<re&&(ae.length=k),this&&this!==Ve&&this instanceof J&&(En=te||ss(En)),En.apply(Wt,ae)}return J}function ud(s,l){return function(c,h){return Ob(c,s,l(h),{})}}function yo(s,l){return function(c,h){var g;if(c===t&&h===t)return l;if(c!==t&&(g=c),h!==t){if(g===t)return h;typeof c=="string"||typeof h=="string"?(c=yt(c),h=yt(h)):(c=jh(c),h=jh(h)),g=s(c,h)}return g}}function Ga(s){return vn(function(l){return l=Se(l,gt(G())),ne(function(c){var h=this;return s(l,function(g){return mt(g,h,c)})})})}function bo(s,l){l=l===t?" ":yt(l);var c=l.length;if(c<2)return c?Ha(l,s):l;var h=Ha(l,ro(s/Qr(l)));return Zr(l)?Fn(Ht(h),0,s).join(""):h.slice(0,s)}function t_(s,l,c,h){var g=l&O,_=ss(s);function w(){for(var x=-1,k=arguments.length,M=-1,I=h.length,R=A(I+k),B=this&&this!==Ve&&this instanceof w?_:s;++M<I;)R[M]=h[M];for(;k--;)R[M++]=arguments[++x];return mt(B,g?c:this,R)}return w}function cd(s){return function(l,c,h){return h&&typeof h!="number"&&nt(l,c,h)&&(c=h=t),l=xn(l),c===t?(c=l,l=0):c=xn(c),h=h===t?l<c?1:-1:xn(h),Hb(l,c,h,s)}}function _o(s){return function(l,c){return typeof l=="string"&&typeof c=="string"||(l=It(l),c=It(c)),s(l,c)}}function fd(s,l,c,h,g,_,w,x,k,M){var I=l&K,R=I?w:t,B=I?t:w,W=I?_:t,j=I?t:_;l|=I?pe:$,l&=~(I?$:pe),l&q||(l&=~(O|N));var te=[s,l,g,W,R,j,B,x,k,M],J=c.apply(t,te);return tu(s)&&xd(J,te),J.placeholder=h,Ed(J,s,l)}function ja(s){var l=Pe[s];return function(c,h){if(c=It(c),h=h==null?0:Je(Q(h),292),h&&Eh(c)){var g=(ge(c)+"e").split("e"),_=l(g[0]+"e"+(+g[1]+h));return g=(ge(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return l(c)}}var n_=ni&&1/Gs(new ni([,-0]))[1]==Qe?function(s){return new ni(s)}:gu;function hd(s){return function(l){var c=Ye(l);return c==$t?Ea(l):c==Bt?_1(l):f1(l,s(l))}}function _n(s,l,c,h,g,_,w,x){var k=l&N;if(!k&&typeof s!="function")throw new Ct(a);var M=h?h.length:0;if(M||(l&=~(pe|$),h=g=t),w=w===t?w:De(Q(w),0),x=x===t?x:Q(x),M-=g?g.length:0,l&$){var I=h,R=g;h=g=t}var B=k?t:Xa(s),W=[s,l,c,h,g,I,R,_,w,x];if(B&&y_(W,B),s=W[0],l=W[1],c=W[2],h=W[3],g=W[4],x=W[9]=W[9]===t?k?0:s.length:De(W[9]-M,0),!x&&l&(K|oe)&&(l&=~(K|oe)),!l||l==O)var j=Qb(s,l,c);else l==K||l==oe?j=e_(s,l,x):(l==pe||l==(O|pe))&&!g.length?j=t_(s,l,c,h):j=go.apply(t,W);var te=B?qh:xd;return Ed(te(j,W),s,l)}function dd(s,l,c,h){return s===t||Vt(s,ti[c])&&!ye.call(h,c)?l:s}function pd(s,l,c,h,g,_){return Ee(s)&&Ee(l)&&(_.set(l,s),fo(s,l,t,pd,_),_.delete(l)),s}function r_(s){return us(s)?t:s}function md(s,l,c,h,g,_){var w=c&S,x=s.length,k=l.length;if(x!=k&&!(w&&k>x))return!1;var M=_.get(s),I=_.get(l);if(M&&I)return M==l&&I==s;var R=-1,B=!0,W=c&C?new dr:t;for(_.set(s,l),_.set(l,s);++R<x;){var j=s[R],te=l[R];if(h)var J=w?h(te,j,R,l,s,_):h(j,te,R,s,l,_);if(J!==t){if(J)continue;B=!1;break}if(W){if(!ba(l,function(re,ae){if(!ji(W,ae)&&(j===re||g(j,re,c,h,_)))return W.push(ae)})){B=!1;break}}else if(!(j===te||g(j,te,c,h,_))){B=!1;break}}return _.delete(s),_.delete(l),B}function i_(s,l,c,h,g,_,w){switch(c){case Jr:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case Gi:return!(s.byteLength!=l.byteLength||!_(new Qs(s),new Qs(l)));case zi:case Vi:case Wi:return Vt(+s,+l);case Bs:return s.name==l.name&&s.message==l.message;case Ui:case Ki:return s==l+"";case $t:var x=Ea;case Bt:var k=h&S;if(x||(x=Gs),s.size!=l.size&&!k)return!1;var M=w.get(s);if(M)return M==l;h|=C,w.set(s,l);var I=md(x(s),x(l),h,g,_,w);return w.delete(s),I;case zs:if(Qi)return Qi.call(s)==Qi.call(l)}return!1}function s_(s,l,c,h,g,_){var w=c&S,x=Ja(s),k=x.length,M=Ja(l),I=M.length;if(k!=I&&!w)return!1;for(var R=k;R--;){var B=x[R];if(!(w?B in l:ye.call(l,B)))return!1}var W=_.get(s),j=_.get(l);if(W&&j)return W==l&&j==s;var te=!0;_.set(s,l),_.set(l,s);for(var J=w;++R<k;){B=x[R];var re=s[B],ae=l[B];if(h)var _t=w?h(ae,re,B,l,s,_):h(re,ae,B,s,l,_);if(!(_t===t?re===ae||g(re,ae,c,h,_):_t)){te=!1;break}J||(J=B=="constructor")}if(te&&!J){var rt=s.constructor,vt=l.constructor;rt!=vt&&"constructor"in s&&"constructor"in l&&!(typeof rt=="function"&&rt instanceof rt&&typeof vt=="function"&&vt instanceof vt)&&(te=!1)}return _.delete(s),_.delete(l),te}function vn(s){return ru(wd(s,t,Md),s+"")}function Ja(s){return Ph(s,Fe,Qa)}function Ya(s){return Ph(s,ft,gd)}var Xa=so?function(s){return so.get(s)}:gu;function vo(s){for(var l=s.name+"",c=ri[l],h=ye.call(ri,l)?c.length:0;h--;){var g=c[h],_=g.func;if(_==null||_==s)return g.name}return l}function li(s){var l=ye.call(b,"placeholder")?b:s;return l.placeholder}function G(){var s=b.iteratee||pu;return s=s===pu?$h:s,arguments.length?s(arguments[0],arguments[1]):s}function wo(s,l){var c=s.__data__;return d_(l)?c[typeof l=="string"?"string":"hash"]:c.map}function Za(s){for(var l=Fe(s),c=l.length;c--;){var h=l[c],g=s[h];l[c]=[h,g,_d(g)]}return l}function gr(s,l){var c=g1(s,l);return Fh(c)?c:t}function o_(s){var l=ye.call(s,fr),c=s[fr];try{s[fr]=t;var h=!0}catch{}var g=Xs.call(s);return h&&(l?s[fr]=c:delete s[fr]),g}var Qa=Ca?function(s){return s==null?[]:(s=be(s),Mn(Ca(s),function(l){return Sh.call(s,l)}))}:yu,gd=Ca?function(s){for(var l=[];s;)In(l,Qa(s)),s=eo(s);return l}:yu,Ye=tt;(Aa&&Ye(new Aa(new ArrayBuffer(1)))!=Jr||Yi&&Ye(new Yi)!=$t||Oa&&Ye(Oa.resolve())!=Nf||ni&&Ye(new ni)!=Bt||Xi&&Ye(new Xi)!=qi)&&(Ye=function(s){var l=tt(s),c=l==mn?s.constructor:t,h=c?yr(c):"";if(h)switch(h){case V1:return Jr;case W1:return $t;case U1:return Nf;case K1:return Bt;case q1:return qi}return l});function l_(s,l,c){for(var h=-1,g=c.length;++h<g;){var _=c[h],w=_.size;switch(_.type){case"drop":s+=w;break;case"dropRight":l-=w;break;case"take":l=Je(l,s+w);break;case"takeRight":s=De(s,l-w);break}}return{start:s,end:l}}function a_(s){var l=s.match(py);return l?l[1].split(my):[]}function yd(s,l,c){l=Dn(l,s);for(var h=-1,g=l.length,_=!1;++h<g;){var w=tn(l[h]);if(!(_=s!=null&&c(s,w)))break;s=s[w]}return _||++h!=g?_:(g=s==null?0:s.length,!!g&&Oo(g)&&wn(w,g)&&(Z(s)||br(s)))}function u_(s){var l=s.length,c=new s.constructor(l);return l&&typeof s[0]=="string"&&ye.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function bd(s){return typeof s.constructor=="function"&&!ls(s)?ii(eo(s)):{}}function c_(s,l,c){var h=s.constructor;switch(l){case Gi:return qa(s);case zi:case Vi:return new h(+s);case Jr:return Gb(s,c);case Zl:case Ql:case ea:case ta:case na:case ra:case ia:case sa:case oa:return ed(s,c);case $t:return new h;case Wi:case Ki:return new h(s);case Ui:return jb(s);case Bt:return new h;case zs:return Jb(s)}}function f_(s,l){var c=l.length;if(!c)return s;var h=c-1;return l[h]=(c>1?"& ":"")+l[h],l=l.join(c>2?", ":" "),s.replace(dy,`{
|
|
43
|
-
/* [wrapped with `+
|
|
44
|
-
`)}function h_(s){return Z(s)||br(s)||!!(xh&&s&&s[xh])}function wn(s,l){var c=typeof s;return l=l??je,!!l&&(c=="number"||c!="symbol"&&Ey.test(s))&&s>-1&&s%1==0&&s<l}function nt(s,l,c){if(!Ee(c))return!1;var h=typeof l;return(h=="number"?ct(c)&&wn(l,c.length):h=="string"&&l in c)?Vt(c[l],s):!1}function eu(s,l){if(Z(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||bt(s)?!0:uy.test(s)||!ay.test(s)||l!=null&&s in be(l)}function d_(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function tu(s){var l=vo(s),c=b[l];if(typeof c!="function"||!(l in le.prototype))return!1;if(s===c)return!0;var h=Xa(c);return!!h&&s===h[0]}function p_(s){return!!_h&&_h in s}var m_=Js?Sn:bu;function ls(s){var l=s&&s.constructor,c=typeof l=="function"&&l.prototype||ti;return s===c}function _d(s){return s===s&&!Ee(s)}function vd(s,l){return function(c){return c==null?!1:c[s]===l&&(l!==t||s in be(c))}}function g_(s){var l=Co(s,function(h){return c.size===d&&c.clear(),h}),c=l.cache;return l}function y_(s,l){var c=s[1],h=l[1],g=c|h,_=g<(O|N|ue),w=h==ue&&c==K||h==ue&&c==at&&s[7].length<=l[8]||h==(ue|at)&&l[7].length<=l[8]&&c==K;if(!(_||w))return s;h&O&&(s[2]=l[2],g|=c&O?0:q);var x=l[3];if(x){var k=s[3];s[3]=k?nd(k,x,l[4]):x,s[4]=k?Nn(s[3],p):l[4]}return x=l[5],x&&(k=s[5],s[5]=k?rd(k,x,l[6]):x,s[6]=k?Nn(s[5],p):l[6]),x=l[7],x&&(s[7]=x),h&ue&&(s[8]=s[8]==null?l[8]:Je(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=g,s}function b_(s){var l=[];if(s!=null)for(var c in be(s))l.push(c);return l}function __(s){return Xs.call(s)}function wd(s,l,c){return l=De(l===t?s.length-1:l,0),function(){for(var h=arguments,g=-1,_=De(h.length-l,0),w=A(_);++g<_;)w[g]=h[l+g];g=-1;for(var x=A(l+1);++g<l;)x[g]=h[g];return x[l]=c(w),mt(s,this,x)}}function Sd(s,l){return l.length<2?s:mr(s,Tt(l,0,-1))}function v_(s,l){for(var c=s.length,h=Je(l.length,c),g=ut(s);h--;){var _=l[h];s[h]=wn(_,c)?g[_]:t}return s}function nu(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var xd=kd(qh),as=P1||function(s,l){return Ve.setTimeout(s,l)},ru=kd(Wb);function Ed(s,l,c){var h=l+"";return ru(s,f_(h,w_(a_(h),c)))}function kd(s){var l=0,c=0;return function(){var h=B1(),g=Ur-(h-c);if(c=h,g>0){if(++l>=ar)return arguments[0]}else l=0;return s.apply(t,arguments)}}function So(s,l){var c=-1,h=s.length,g=h-1;for(l=l===t?h:l;++c<l;){var _=Ba(c,g),w=s[_];s[_]=s[c],s[c]=w}return s.length=l,s}var Cd=g_(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(cy,function(c,h,g,_){l.push(g?_.replace(by,"$1"):h||c)}),l});function tn(s){if(typeof s=="string"||bt(s))return s;var l=s+"";return l=="0"&&1/s==-Qe?"-0":l}function yr(s){if(s!=null){try{return Ys.call(s)}catch{}try{return s+""}catch{}}return""}function w_(s,l){return kt(j0,function(c){var h="_."+c[0];l&c[1]&&!Ks(s,h)&&s.push(h)}),s.sort()}function Ad(s){if(s instanceof le)return s.clone();var l=new At(s.__wrapped__,s.__chain__);return l.__actions__=ut(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function S_(s,l,c){(c?nt(s,l,c):l===t)?l=1:l=De(Q(l),0);var h=s==null?0:s.length;if(!h||l<1)return[];for(var g=0,_=0,w=A(ro(h/l));g<h;)w[_++]=Tt(s,g,g+=l);return w}function x_(s){for(var l=-1,c=s==null?0:s.length,h=0,g=[];++l<c;){var _=s[l];_&&(g[h++]=_)}return g}function E_(){var s=arguments.length;if(!s)return[];for(var l=A(s-1),c=arguments[0],h=s;h--;)l[h-1]=arguments[h];return In(Z(c)?ut(c):[c],We(l,1))}var k_=ne(function(s,l){return Oe(s)?ts(s,We(l,1,Oe,!0)):[]}),C_=ne(function(s,l){var c=Mt(l);return Oe(c)&&(c=t),Oe(s)?ts(s,We(l,1,Oe,!0),G(c,2)):[]}),A_=ne(function(s,l){var c=Mt(l);return Oe(c)&&(c=t),Oe(s)?ts(s,We(l,1,Oe,!0),t,c):[]});function O_(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:Q(l),Tt(s,l<0?0:l,h)):[]}function T_(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:Q(l),l=h-l,Tt(s,0,l<0?0:l)):[]}function M_(s,l){return s&&s.length?po(s,G(l,3),!0,!0):[]}function I_(s,l){return s&&s.length?po(s,G(l,3),!0):[]}function N_(s,l,c,h){var g=s==null?0:s.length;return g?(c&&typeof c!="number"&&nt(s,l,c)&&(c=0,h=g),Eb(s,l,c,h)):[]}function Od(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=c==null?0:Q(c);return g<0&&(g=De(h+g,0)),qs(s,G(l,3),g)}function Td(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=h-1;return c!==t&&(g=Q(c),g=c<0?De(h+g,0):Je(g,h-1)),qs(s,G(l,3),g,!0)}function Md(s){var l=s==null?0:s.length;return l?We(s,1):[]}function R_(s){var l=s==null?0:s.length;return l?We(s,Qe):[]}function L_(s,l){var c=s==null?0:s.length;return c?(l=l===t?1:Q(l),We(s,l)):[]}function P_(s){for(var l=-1,c=s==null?0:s.length,h={};++l<c;){var g=s[l];h[g[0]]=g[1]}return h}function Id(s){return s&&s.length?s[0]:t}function D_(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=c==null?0:Q(c);return g<0&&(g=De(h+g,0)),Xr(s,l,g)}function F_(s){var l=s==null?0:s.length;return l?Tt(s,0,-1):[]}var $_=ne(function(s){var l=Se(s,Ua);return l.length&&l[0]===s[0]?La(l):[]}),B_=ne(function(s){var l=Mt(s),c=Se(s,Ua);return l===Mt(c)?l=t:c.pop(),c.length&&c[0]===s[0]?La(c,G(l,2)):[]}),H_=ne(function(s){var l=Mt(s),c=Se(s,Ua);return l=typeof l=="function"?l:t,l&&c.pop(),c.length&&c[0]===s[0]?La(c,t,l):[]});function z_(s,l){return s==null?"":F1.call(s,l)}function Mt(s){var l=s==null?0:s.length;return l?s[l-1]:t}function V_(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=h;return c!==t&&(g=Q(c),g=g<0?De(h+g,0):Je(g,h-1)),l===l?w1(s,l,g):qs(s,fh,g,!0)}function W_(s,l){return s&&s.length?Vh(s,Q(l)):t}var U_=ne(Nd);function Nd(s,l){return s&&s.length&&l&&l.length?$a(s,l):s}function K_(s,l,c){return s&&s.length&&l&&l.length?$a(s,l,G(c,2)):s}function q_(s,l,c){return s&&s.length&&l&&l.length?$a(s,l,t,c):s}var G_=vn(function(s,l){var c=s==null?0:s.length,h=Ma(s,l);return Kh(s,Se(l,function(g){return wn(g,c)?+g:g}).sort(td)),h});function j_(s,l){var c=[];if(!(s&&s.length))return c;var h=-1,g=[],_=s.length;for(l=G(l,3);++h<_;){var w=s[h];l(w,h,s)&&(c.push(w),g.push(h))}return Kh(s,g),c}function iu(s){return s==null?s:z1.call(s)}function J_(s,l,c){var h=s==null?0:s.length;return h?(c&&typeof c!="number"&&nt(s,l,c)?(l=0,c=h):(l=l==null?0:Q(l),c=c===t?h:Q(c)),Tt(s,l,c)):[]}function Y_(s,l){return ho(s,l)}function X_(s,l,c){return za(s,l,G(c,2))}function Z_(s,l){var c=s==null?0:s.length;if(c){var h=ho(s,l);if(h<c&&Vt(s[h],l))return h}return-1}function Q_(s,l){return ho(s,l,!0)}function ev(s,l,c){return za(s,l,G(c,2),!0)}function tv(s,l){var c=s==null?0:s.length;if(c){var h=ho(s,l,!0)-1;if(Vt(s[h],l))return h}return-1}function nv(s){return s&&s.length?Gh(s):[]}function rv(s,l){return s&&s.length?Gh(s,G(l,2)):[]}function iv(s){var l=s==null?0:s.length;return l?Tt(s,1,l):[]}function sv(s,l,c){return s&&s.length?(l=c||l===t?1:Q(l),Tt(s,0,l<0?0:l)):[]}function ov(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:Q(l),l=h-l,Tt(s,l<0?0:l,h)):[]}function lv(s,l){return s&&s.length?po(s,G(l,3),!1,!0):[]}function av(s,l){return s&&s.length?po(s,G(l,3)):[]}var uv=ne(function(s){return Pn(We(s,1,Oe,!0))}),cv=ne(function(s){var l=Mt(s);return Oe(l)&&(l=t),Pn(We(s,1,Oe,!0),G(l,2))}),fv=ne(function(s){var l=Mt(s);return l=typeof l=="function"?l:t,Pn(We(s,1,Oe,!0),t,l)});function hv(s){return s&&s.length?Pn(s):[]}function dv(s,l){return s&&s.length?Pn(s,G(l,2)):[]}function pv(s,l){return l=typeof l=="function"?l:t,s&&s.length?Pn(s,t,l):[]}function su(s){if(!(s&&s.length))return[];var l=0;return s=Mn(s,function(c){if(Oe(c))return l=De(c.length,l),!0}),Sa(l,function(c){return Se(s,_a(c))})}function Rd(s,l){if(!(s&&s.length))return[];var c=su(s);return l==null?c:Se(c,function(h){return mt(l,t,h)})}var mv=ne(function(s,l){return Oe(s)?ts(s,l):[]}),gv=ne(function(s){return Wa(Mn(s,Oe))}),yv=ne(function(s){var l=Mt(s);return Oe(l)&&(l=t),Wa(Mn(s,Oe),G(l,2))}),bv=ne(function(s){var l=Mt(s);return l=typeof l=="function"?l:t,Wa(Mn(s,Oe),t,l)}),_v=ne(su);function vv(s,l){return Xh(s||[],l||[],es)}function wv(s,l){return Xh(s||[],l||[],is)}var Sv=ne(function(s){var l=s.length,c=l>1?s[l-1]:t;return c=typeof c=="function"?(s.pop(),c):t,Rd(s,c)});function Ld(s){var l=b(s);return l.__chain__=!0,l}function xv(s,l){return l(s),s}function xo(s,l){return l(s)}var Ev=vn(function(s){var l=s.length,c=l?s[0]:0,h=this.__wrapped__,g=function(_){return Ma(_,s)};return l>1||this.__actions__.length||!(h instanceof le)||!wn(c)?this.thru(g):(h=h.slice(c,+c+(l?1:0)),h.__actions__.push({func:xo,args:[g],thisArg:t}),new At(h,this.__chain__).thru(function(_){return l&&!_.length&&_.push(t),_}))});function kv(){return Ld(this)}function Cv(){return new At(this.value(),this.__chain__)}function Av(){this.__values__===t&&(this.__values__=jd(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function Ov(){return this}function Tv(s){for(var l,c=this;c instanceof lo;){var h=Ad(c);h.__index__=0,h.__values__=t,l?g.__wrapped__=h:l=h;var g=h;c=c.__wrapped__}return g.__wrapped__=s,l}function Mv(){var s=this.__wrapped__;if(s instanceof le){var l=s;return this.__actions__.length&&(l=new le(this)),l=l.reverse(),l.__actions__.push({func:xo,args:[iu],thisArg:t}),new At(l,this.__chain__)}return this.thru(iu)}function Iv(){return Yh(this.__wrapped__,this.__actions__)}var Nv=mo(function(s,l,c){ye.call(s,c)?++s[c]:bn(s,c,1)});function Rv(s,l,c){var h=Z(s)?uh:xb;return c&&nt(s,l,c)&&(l=t),h(s,G(l,3))}function Lv(s,l){var c=Z(s)?Mn:Rh;return c(s,G(l,3))}var Pv=ld(Od),Dv=ld(Td);function Fv(s,l){return We(Eo(s,l),1)}function $v(s,l){return We(Eo(s,l),Qe)}function Bv(s,l,c){return c=c===t?1:Q(c),We(Eo(s,l),c)}function Pd(s,l){var c=Z(s)?kt:Ln;return c(s,G(l,3))}function Dd(s,l){var c=Z(s)?i1:Nh;return c(s,G(l,3))}var Hv=mo(function(s,l,c){ye.call(s,c)?s[c].push(l):bn(s,c,[l])});function zv(s,l,c,h){s=ct(s)?s:ui(s),c=c&&!h?Q(c):0;var g=s.length;return c<0&&(c=De(g+c,0)),To(s)?c<=g&&s.indexOf(l,c)>-1:!!g&&Xr(s,l,c)>-1}var Vv=ne(function(s,l,c){var h=-1,g=typeof l=="function",_=ct(s)?A(s.length):[];return Ln(s,function(w){_[++h]=g?mt(l,w,c):ns(w,l,c)}),_}),Wv=mo(function(s,l,c){bn(s,c,l)});function Eo(s,l){var c=Z(s)?Se:Bh;return c(s,G(l,3))}function Uv(s,l,c,h){return s==null?[]:(Z(l)||(l=l==null?[]:[l]),c=h?t:c,Z(c)||(c=c==null?[]:[c]),Wh(s,l,c))}var Kv=mo(function(s,l,c){s[c?0:1].push(l)},function(){return[[],[]]});function qv(s,l,c){var h=Z(s)?ya:dh,g=arguments.length<3;return h(s,G(l,4),c,g,Ln)}function Gv(s,l,c){var h=Z(s)?s1:dh,g=arguments.length<3;return h(s,G(l,4),c,g,Nh)}function jv(s,l){var c=Z(s)?Mn:Rh;return c(s,Ao(G(l,3)))}function Jv(s){var l=Z(s)?Oh:zb;return l(s)}function Yv(s,l,c){(c?nt(s,l,c):l===t)?l=1:l=Q(l);var h=Z(s)?bb:Vb;return h(s,l)}function Xv(s){var l=Z(s)?_b:Ub;return l(s)}function Zv(s){if(s==null)return 0;if(ct(s))return To(s)?Qr(s):s.length;var l=Ye(s);return l==$t||l==Bt?s.size:Da(s).length}function Qv(s,l,c){var h=Z(s)?ba:Kb;return c&&nt(s,l,c)&&(l=t),h(s,G(l,3))}var ew=ne(function(s,l){if(s==null)return[];var c=l.length;return c>1&&nt(s,l[0],l[1])?l=[]:c>2&&nt(l[0],l[1],l[2])&&(l=[l[0]]),Wh(s,We(l,1),[])}),ko=L1||function(){return Ve.Date.now()};function tw(s,l){if(typeof l!="function")throw new Ct(a);return s=Q(s),function(){if(--s<1)return l.apply(this,arguments)}}function Fd(s,l,c){return l=c?t:l,l=s&&l==null?s.length:l,_n(s,ue,t,t,t,t,l)}function $d(s,l){var c;if(typeof l!="function")throw new Ct(a);return s=Q(s),function(){return--s>0&&(c=l.apply(this,arguments)),s<=1&&(l=t),c}}var ou=ne(function(s,l,c){var h=O;if(c.length){var g=Nn(c,li(ou));h|=pe}return _n(s,h,l,c,g)}),Bd=ne(function(s,l,c){var h=O|N;if(c.length){var g=Nn(c,li(Bd));h|=pe}return _n(l,h,s,c,g)});function Hd(s,l,c){l=c?t:l;var h=_n(s,K,t,t,t,t,t,l);return h.placeholder=Hd.placeholder,h}function zd(s,l,c){l=c?t:l;var h=_n(s,oe,t,t,t,t,t,l);return h.placeholder=zd.placeholder,h}function Vd(s,l,c){var h,g,_,w,x,k,M=0,I=!1,R=!1,B=!0;if(typeof s!="function")throw new Ct(a);l=It(l)||0,Ee(c)&&(I=!!c.leading,R="maxWait"in c,_=R?De(It(c.maxWait)||0,l):_,B="trailing"in c?!!c.trailing:B);function W(Te){var Wt=h,En=g;return h=g=t,M=Te,w=s.apply(En,Wt),w}function j(Te){return M=Te,x=as(re,l),I?W(Te):w}function te(Te){var Wt=Te-k,En=Te-M,lp=l-Wt;return R?Je(lp,_-En):lp}function J(Te){var Wt=Te-k,En=Te-M;return k===t||Wt>=l||Wt<0||R&&En>=_}function re(){var Te=ko();if(J(Te))return ae(Te);x=as(re,te(Te))}function ae(Te){return x=t,B&&h?W(Te):(h=g=t,w)}function _t(){x!==t&&Zh(x),M=0,h=k=g=x=t}function rt(){return x===t?w:ae(ko())}function vt(){var Te=ko(),Wt=J(Te);if(h=arguments,g=this,k=Te,Wt){if(x===t)return j(k);if(R)return Zh(x),x=as(re,l),W(k)}return x===t&&(x=as(re,l)),w}return vt.cancel=_t,vt.flush=rt,vt}var nw=ne(function(s,l){return Ih(s,1,l)}),rw=ne(function(s,l,c){return Ih(s,It(l)||0,c)});function iw(s){return _n(s,Bi)}function Co(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Ct(a);var c=function(){var h=arguments,g=l?l.apply(this,h):h[0],_=c.cache;if(_.has(g))return _.get(g);var w=s.apply(this,h);return c.cache=_.set(g,w)||_,w};return c.cache=new(Co.Cache||yn),c}Co.Cache=yn;function Ao(s){if(typeof s!="function")throw new Ct(a);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function sw(s){return $d(2,s)}var ow=qb(function(s,l){l=l.length==1&&Z(l[0])?Se(l[0],gt(G())):Se(We(l,1),gt(G()));var c=l.length;return ne(function(h){for(var g=-1,_=Je(h.length,c);++g<_;)h[g]=l[g].call(this,h[g]);return mt(s,this,h)})}),lu=ne(function(s,l){var c=Nn(l,li(lu));return _n(s,pe,t,l,c)}),Wd=ne(function(s,l){var c=Nn(l,li(Wd));return _n(s,$,t,l,c)}),lw=vn(function(s,l){return _n(s,at,t,t,t,l)});function aw(s,l){if(typeof s!="function")throw new Ct(a);return l=l===t?l:Q(l),ne(s,l)}function uw(s,l){if(typeof s!="function")throw new Ct(a);return l=l==null?0:De(Q(l),0),ne(function(c){var h=c[l],g=Fn(c,0,l);return h&&In(g,h),mt(s,this,g)})}function cw(s,l,c){var h=!0,g=!0;if(typeof s!="function")throw new Ct(a);return Ee(c)&&(h="leading"in c?!!c.leading:h,g="trailing"in c?!!c.trailing:g),Vd(s,l,{leading:h,maxWait:l,trailing:g})}function fw(s){return Fd(s,1)}function hw(s,l){return lu(Ka(l),s)}function dw(){if(!arguments.length)return[];var s=arguments[0];return Z(s)?s:[s]}function pw(s){return Ot(s,v)}function mw(s,l){return l=typeof l=="function"?l:t,Ot(s,v,l)}function gw(s){return Ot(s,m|v)}function yw(s,l){return l=typeof l=="function"?l:t,Ot(s,m|v,l)}function bw(s,l){return l==null||Mh(s,l,Fe(l))}function Vt(s,l){return s===l||s!==s&&l!==l}var _w=_o(Ra),vw=_o(function(s,l){return s>=l}),br=Dh(function(){return arguments}())?Dh:function(s){return Ce(s)&&ye.call(s,"callee")&&!Sh.call(s,"callee")},Z=A.isArray,ww=rh?gt(rh):Tb;function ct(s){return s!=null&&Oo(s.length)&&!Sn(s)}function Oe(s){return Ce(s)&&ct(s)}function Sw(s){return s===!0||s===!1||Ce(s)&&tt(s)==zi}var $n=D1||bu,xw=ih?gt(ih):Mb;function Ew(s){return Ce(s)&&s.nodeType===1&&!us(s)}function kw(s){if(s==null)return!0;if(ct(s)&&(Z(s)||typeof s=="string"||typeof s.splice=="function"||$n(s)||ai(s)||br(s)))return!s.length;var l=Ye(s);if(l==$t||l==Bt)return!s.size;if(ls(s))return!Da(s).length;for(var c in s)if(ye.call(s,c))return!1;return!0}function Cw(s,l){return rs(s,l)}function Aw(s,l,c){c=typeof c=="function"?c:t;var h=c?c(s,l):t;return h===t?rs(s,l,t,c):!!h}function au(s){if(!Ce(s))return!1;var l=tt(s);return l==Bs||l==Y0||typeof s.message=="string"&&typeof s.name=="string"&&!us(s)}function Ow(s){return typeof s=="number"&&Eh(s)}function Sn(s){if(!Ee(s))return!1;var l=tt(s);return l==Hs||l==If||l==J0||l==Z0}function Ud(s){return typeof s=="number"&&s==Q(s)}function Oo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=je}function Ee(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Ce(s){return s!=null&&typeof s=="object"}var Kd=sh?gt(sh):Nb;function Tw(s,l){return s===l||Pa(s,l,Za(l))}function Mw(s,l,c){return c=typeof c=="function"?c:t,Pa(s,l,Za(l),c)}function Iw(s){return qd(s)&&s!=+s}function Nw(s){if(m_(s))throw new X(o);return Fh(s)}function Rw(s){return s===null}function Lw(s){return s==null}function qd(s){return typeof s=="number"||Ce(s)&&tt(s)==Wi}function us(s){if(!Ce(s)||tt(s)!=mn)return!1;var l=eo(s);if(l===null)return!0;var c=ye.call(l,"constructor")&&l.constructor;return typeof c=="function"&&c instanceof c&&Ys.call(c)==M1}var uu=oh?gt(oh):Rb;function Pw(s){return Ud(s)&&s>=-je&&s<=je}var Gd=lh?gt(lh):Lb;function To(s){return typeof s=="string"||!Z(s)&&Ce(s)&&tt(s)==Ki}function bt(s){return typeof s=="symbol"||Ce(s)&&tt(s)==zs}var ai=ah?gt(ah):Pb;function Dw(s){return s===t}function Fw(s){return Ce(s)&&Ye(s)==qi}function $w(s){return Ce(s)&&tt(s)==ey}var Bw=_o(Fa),Hw=_o(function(s,l){return s<=l});function jd(s){if(!s)return[];if(ct(s))return To(s)?Ht(s):ut(s);if(Ji&&s[Ji])return b1(s[Ji]());var l=Ye(s),c=l==$t?Ea:l==Bt?Gs:ui;return c(s)}function xn(s){if(!s)return s===0?s:0;if(s=It(s),s===Qe||s===-Qe){var l=s<0?-1:1;return l*pn}return s===s?s:0}function Q(s){var l=xn(s),c=l%1;return l===l?c?l-c:l:0}function Jd(s){return s?pr(Q(s),0,et):0}function It(s){if(typeof s=="number")return s;if(bt(s))return Zt;if(Ee(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Ee(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=ph(s);var c=wy.test(s);return c||xy.test(s)?t1(s.slice(2),c?2:8):vy.test(s)?Zt:+s}function Yd(s){return en(s,ft(s))}function zw(s){return s?pr(Q(s),-je,je):s===0?s:0}function ge(s){return s==null?"":yt(s)}var Vw=si(function(s,l){if(ls(l)||ct(l)){en(l,Fe(l),s);return}for(var c in l)ye.call(l,c)&&es(s,c,l[c])}),Xd=si(function(s,l){en(l,ft(l),s)}),Mo=si(function(s,l,c,h){en(l,ft(l),s,h)}),Ww=si(function(s,l,c,h){en(l,Fe(l),s,h)}),Uw=vn(Ma);function Kw(s,l){var c=ii(s);return l==null?c:Th(c,l)}var qw=ne(function(s,l){s=be(s);var c=-1,h=l.length,g=h>2?l[2]:t;for(g&&nt(l[0],l[1],g)&&(h=1);++c<h;)for(var _=l[c],w=ft(_),x=-1,k=w.length;++x<k;){var M=w[x],I=s[M];(I===t||Vt(I,ti[M])&&!ye.call(s,M))&&(s[M]=_[M])}return s}),Gw=ne(function(s){return s.push(t,pd),mt(Zd,t,s)});function jw(s,l){return ch(s,G(l,3),Qt)}function Jw(s,l){return ch(s,G(l,3),Na)}function Yw(s,l){return s==null?s:Ia(s,G(l,3),ft)}function Xw(s,l){return s==null?s:Lh(s,G(l,3),ft)}function Zw(s,l){return s&&Qt(s,G(l,3))}function Qw(s,l){return s&&Na(s,G(l,3))}function eS(s){return s==null?[]:co(s,Fe(s))}function tS(s){return s==null?[]:co(s,ft(s))}function cu(s,l,c){var h=s==null?t:mr(s,l);return h===t?c:h}function nS(s,l){return s!=null&&yd(s,l,kb)}function fu(s,l){return s!=null&&yd(s,l,Cb)}var rS=ud(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=Xs.call(l)),s[l]=c},du(ht)),iS=ud(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=Xs.call(l)),ye.call(s,l)?s[l].push(c):s[l]=[c]},G),sS=ne(ns);function Fe(s){return ct(s)?Ah(s):Da(s)}function ft(s){return ct(s)?Ah(s,!0):Db(s)}function oS(s,l){var c={};return l=G(l,3),Qt(s,function(h,g,_){bn(c,l(h,g,_),h)}),c}function lS(s,l){var c={};return l=G(l,3),Qt(s,function(h,g,_){bn(c,g,l(h,g,_))}),c}var aS=si(function(s,l,c){fo(s,l,c)}),Zd=si(function(s,l,c,h){fo(s,l,c,h)}),uS=vn(function(s,l){var c={};if(s==null)return c;var h=!1;l=Se(l,function(_){return _=Dn(_,s),h||(h=_.length>1),_}),en(s,Ya(s),c),h&&(c=Ot(c,m|y|v,r_));for(var g=l.length;g--;)Va(c,l[g]);return c});function cS(s,l){return Qd(s,Ao(G(l)))}var fS=vn(function(s,l){return s==null?{}:$b(s,l)});function Qd(s,l){if(s==null)return{};var c=Se(Ya(s),function(h){return[h]});return l=G(l),Uh(s,c,function(h,g){return l(h,g[0])})}function hS(s,l,c){l=Dn(l,s);var h=-1,g=l.length;for(g||(g=1,s=t);++h<g;){var _=s==null?t:s[tn(l[h])];_===t&&(h=g,_=c),s=Sn(_)?_.call(s):_}return s}function dS(s,l,c){return s==null?s:is(s,l,c)}function pS(s,l,c,h){return h=typeof h=="function"?h:t,s==null?s:is(s,l,c,h)}var ep=hd(Fe),tp=hd(ft);function mS(s,l,c){var h=Z(s),g=h||$n(s)||ai(s);if(l=G(l,4),c==null){var _=s&&s.constructor;g?c=h?new _:[]:Ee(s)?c=Sn(_)?ii(eo(s)):{}:c={}}return(g?kt:Qt)(s,function(w,x,k){return l(c,w,x,k)}),c}function gS(s,l){return s==null?!0:Va(s,l)}function yS(s,l,c){return s==null?s:Jh(s,l,Ka(c))}function bS(s,l,c,h){return h=typeof h=="function"?h:t,s==null?s:Jh(s,l,Ka(c),h)}function ui(s){return s==null?[]:xa(s,Fe(s))}function _S(s){return s==null?[]:xa(s,ft(s))}function vS(s,l,c){return c===t&&(c=l,l=t),c!==t&&(c=It(c),c=c===c?c:0),l!==t&&(l=It(l),l=l===l?l:0),pr(It(s),l,c)}function wS(s,l,c){return l=xn(l),c===t?(c=l,l=0):c=xn(c),s=It(s),Ab(s,l,c)}function SS(s,l,c){if(c&&typeof c!="boolean"&&nt(s,l,c)&&(l=c=t),c===t&&(typeof l=="boolean"?(c=l,l=t):typeof s=="boolean"&&(c=s,s=t)),s===t&&l===t?(s=0,l=1):(s=xn(s),l===t?(l=s,s=0):l=xn(l)),s>l){var h=s;s=l,l=h}if(c||s%1||l%1){var g=kh();return Je(s+g*(l-s+e1("1e-"+((g+"").length-1))),l)}return Ba(s,l)}var xS=oi(function(s,l,c){return l=l.toLowerCase(),s+(c?np(l):l)});function np(s){return hu(ge(s).toLowerCase())}function rp(s){return s=ge(s),s&&s.replace(ky,d1).replace(Uy,"")}function ES(s,l,c){s=ge(s),l=yt(l);var h=s.length;c=c===t?h:pr(Q(c),0,h);var g=c;return c-=l.length,c>=0&&s.slice(c,g)==l}function kS(s){return s=ge(s),s&&sy.test(s)?s.replace(Lf,p1):s}function CS(s){return s=ge(s),s&&fy.test(s)?s.replace(la,"\\$&"):s}var AS=oi(function(s,l,c){return s+(c?"-":"")+l.toLowerCase()}),OS=oi(function(s,l,c){return s+(c?" ":"")+l.toLowerCase()}),TS=od("toLowerCase");function MS(s,l,c){s=ge(s),l=Q(l);var h=l?Qr(s):0;if(!l||h>=l)return s;var g=(l-h)/2;return bo(io(g),c)+s+bo(ro(g),c)}function IS(s,l,c){s=ge(s),l=Q(l);var h=l?Qr(s):0;return l&&h<l?s+bo(l-h,c):s}function NS(s,l,c){s=ge(s),l=Q(l);var h=l?Qr(s):0;return l&&h<l?bo(l-h,c)+s:s}function RS(s,l,c){return c||l==null?l=0:l&&(l=+l),H1(ge(s).replace(aa,""),l||0)}function LS(s,l,c){return(c?nt(s,l,c):l===t)?l=1:l=Q(l),Ha(ge(s),l)}function PS(){var s=arguments,l=ge(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var DS=oi(function(s,l,c){return s+(c?"_":"")+l.toLowerCase()});function FS(s,l,c){return c&&typeof c!="number"&&nt(s,l,c)&&(l=c=t),c=c===t?et:c>>>0,c?(s=ge(s),s&&(typeof l=="string"||l!=null&&!uu(l))&&(l=yt(l),!l&&Zr(s))?Fn(Ht(s),0,c):s.split(l,c)):[]}var $S=oi(function(s,l,c){return s+(c?" ":"")+hu(l)});function BS(s,l,c){return s=ge(s),c=c==null?0:pr(Q(c),0,s.length),l=yt(l),s.slice(c,c+l.length)==l}function HS(s,l,c){var h=b.templateSettings;c&&nt(s,l,c)&&(l=t),s=ge(s),l=Mo({},l,h,dd);var g=Mo({},l.imports,h.imports,dd),_=Fe(g),w=xa(g,_),x,k,M=0,I=l.interpolate||Vs,R="__p += '",B=ka((l.escape||Vs).source+"|"+I.source+"|"+(I===Pf?_y:Vs).source+"|"+(l.evaluate||Vs).source+"|$","g"),W="//# sourceURL="+(ye.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jy+"]")+`
|
|
45
|
-
`;s.replace(
|
|
46
|
-
__e(`+
|
|
47
|
-
'`),
|
|
48
|
-
`+
|
|
49
|
-
__p += '`),
|
|
50
|
-
((__t = (`+
|
|
51
|
-
'`),
|
|
52
|
-
`;var
|
|
53
|
-
`+
|
|
40
|
+
3. "-" cannot repeat`);Te.customSchemes.push([n,e])}function tM(){Te.scanner=KT(Te.customSchemes);for(let n=0;n<Te.tokenQueue.length;n++)Te.tokenQueue[n][1]({scanner:Te.scanner});Te.parser=YT(Te.scanner.tokens);for(let n=0;n<Te.pluginQueue.length;n++)Te.pluginQueue[n][1]({scanner:Te.scanner,parser:Te.parser});Te.initialized=!0}function x0(n){return Te.initialized||tM(),XT(Te.parser.start,n,GT(Te.scanner.start,n))}function _f(n,e,t){if(e===void 0&&(e=null),t===void 0&&(t=null),e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new yf(t),i=x0(n),o=[];for(let l=0;l<i.length;l++){const u=i[l];u.isLink&&(!e||u.t===e)&&o.push(u.toFormattedObject(r))}return o}function nM(n,e){e===void 0&&(e=null);const t=x0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class rM extends Qc{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),o=nM(i);if(!i||!o)return!1;const l=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(l),!0}_createLinkAttrs(e,t){return Lf.query(t,{typeName:ie.TEXT,mark:{typeName:he.LINK},getMark:{typeName:he.LINK}})?.attrs||{href:e}}}function H(n){return(...e)=>t=>n(t,...e)}function Za(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const o=r.replace(/_/g,"-");return`${t}--zw-${o}:${i};`},"");return e?{style:e}:null}function Hr(n){const e=Za(n);return["span",e?{...e,class:"zw-style"}:{},0]}function iM(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Vt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var sM=Object.defineProperty,oM=(n,e,t)=>e in n?sM(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ds=(n,e,t)=>oM(n,typeof e!="symbol"?e+"":e,t);const E0=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),aM=n=>n in E0,lM="[-\\+]?\\d+%?",uM="[-\\+]?\\d*\\.\\d+%?",ur=`(?:${uM})|(?:${lM})`,vf=`[\\s|\\(]+(${ur})[,|\\s]+(${ur})[,|\\s]+(${ur})\\s*\\)?`,wf=`[\\s|\\(]+(${ur})[,|\\s]+(${ur})[,|\\s]+(${ur})[,|\\s]+(${ur})\\s*\\)?`,pn=Object.freeze({CSS_UNIT:new RegExp(ur),RGB:new RegExp(`rgb${vf}`),RGBA:new RegExp(`rgba${wf}`),HSL:new RegExp(`hsl${vf}`),HSLA:new RegExp(`hsla${wf}`),HSV:new RegExp(`hsv${vf}`),HSVA:new RegExp(`hsva${wf}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),Sf=Object.freeze({WINDOW:Symbol("window")});function xf(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function k0(n,e){let t=!1;return function(){t||(n.apply(this,arguments),t=!0,setTimeout(function(){t=!1},e))}}function $r(n){return n>1||n<-1?n/100:n}const zr=8,cM="#fff",fM="#e6e6e6";function hM(){const n=document.createElement("canvas");n.width=n.height=zr*2;const e=n.getContext("2d");return e?(e.fillStyle=cM,e.fillRect(0,0,n.width,n.height),e.fillStyle=fM,e.fillRect(0,0,zr,zr),e.translate(zr,zr),e.fillRect(0,0,zr,zr),n.toDataURL()):null}const C0=3;function Pi(n){return Number.parseFloat(n.toFixed(C0+2).substr(0,C0+2))}function dM(n,e=1){const t=[];let r=0;for(;r<n.length;)t.push(n.substr(r,e)),r+=e;return t}function A0(n){const e=dM(n.slice(1),2).map(r=>parseInt(r,16)),t=e[3]!==void 0?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:t}}function O0({h:n,s:e,v:t,a:r}){const i=l=>{const u=(l+n/60)%6;return t-t*e*Math.max(Math.min(u,4-u,1),0)},o=[i(5),i(3),i(1)].map(l=>Math.round(l*255));return{r:o[0],g:o[1],b:o[2],a:r}}function pM({h:n,s:e,l:t,a:r}){const i=t+e*Math.min(t,1-t),o=i===0?0:2-2*t/i,l=Pi(o),u=Pi(i);return{h:n,s:l,v:u,a:r}}function mM(n){const e=r=>{const i=Math.round(r).toString(16);return("00".substr(0,2-i.length)+i).toUpperCase()};return`#${[e(n.r),e(n.g),e(n.b)].join("")}`}function T0(n){if(!n)return{h:0,s:1,v:1,a:1};const e=n.r/255,t=n.g/255,r=n.b/255,i=Math.max(e,t,r),o=Math.min(e,t,r);let l=0;i!==o&&(i===e?l=60*(0+(t-r)/(i-o)):i===t?l=60*(2+(r-e)/(i-o)):i===r&&(l=60*(4+(e-t)/(i-o)))),l<0&&(l=l+360);const u=i===0?0:(i-o)/i,f=[l,u,i],d=Pi(f[1]),g=Pi(f[2]);return{h:Math.floor(f[0]),s:d,v:g,a:n.a}}function gM(n){return T0(A0(n))}function yM({h:n,s:e,v:t,a:r}){const i=t-t*e/2,o=i===1||i===0?0:(t-i)/Math.min(i,1-i),l=Pi(o),u=Pi(i);return{h:n,s:l,l:u,a:r}}function bM(n){const e=gM(n),t=yM(e),r=A0(n);return{alpha:e.a,hex:n.substr(0,7),hexa:n,hsla:t,hsva:e,hue:e.h,rgba:r}}function Ef(n,e,t="0"){return n+t.repeat(Math.max(0,e-n.length))}function _M(n){let e=n;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length===6?e=Ef(e,8,"F"):e=Ef(Ef(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}function vM(n){return bM(_M(n))}const kf=class Ye{constructor(e){Ds(this,"rgba"),Ds(this,"hsva"),Ds(this,"alpha"),this.rgba=e,this.hsva=this.calcHsva(),this.alpha=e.a}static create(e){if(!e)return Ye.fromBlack();let t=e.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(aM(t))t=E0[t];else if(t===this.TRANSPARENT)return Ye.fromTransparent();const r=pn.RGB.exec(t)||pn.RGBA.exec(t);if(r){const u=r[4]===void 0?1:r[4];return Ye.fromRgba({r:Number.parseInt(r[1]),g:Number.parseInt(r[2]),b:Number.parseInt(r[3]),a:Number.parseFloat(u.toString())})}const i=pn.HSL.exec(t)||pn.HSLA.exec(t);if(i){const u=i[4]===void 0?1:i[4];return Ye.fromHsla({h:Number.parseInt(i[1]),s:Number.parseFloat(i[2]),l:Number.parseFloat(i[3]),a:Number.parseFloat(u.toString())})}const o=pn.HSV.exec(t)||pn.HSVA.exec(t);if(o){const u=o[4]===void 0?1:o[4];return Ye.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(u.toString())})}return pn.HEX8.exec(t)||pn.HEX6.exec(t)||pn.HEX4.exec(t)||pn.HEX3.exec(t)?Ye.fromHex(t):Ye.fromBlack()}static fromHex(e){const{rgba:t}=vM(e);return new Ye(t)}static fromRgba({r:e,g:t,b:r,a:i}){const o=$r(i);return new Ye({r:e,g:t,b:r,a:o})}static fromHsla({h:e,s:t,l:r,a:i}){const o=$r(t),l=$r(r),u=$r(i);return Ye.fromHsva(pM({h:e,s:o,l,a:u}))}static fromHsva({h:e,s:t,v:r,a:i}){const o=$r(t),l=$r(r),u=$r(i),f=O0({h:e,s:o,v:l,a:u});return new Ye(f)}static fromTransparent(){return new Ye({r:0,g:0,b:0,a:0})}static fromWhite(){return new Ye({r:255,g:255,b:255,a:1})}static fromBlack(){return new Ye({r:0,g:0,b:0,a:1})}static isTransparent(e){return Ye.create(e).isTransparent()}static isDark(e){return Ye.create(e).isDark()}get hex(){return this.toHexString()}get r(){return this.rgba.r}get b(){return this.rgba.b}get g(){return this.rgba.g}get h(){return this.hsva.h}get s(){return this.hsva.s}get v(){return this.hsva.v}setAlpha(e){return this.alpha=e,this}toHexString(){return mM({r:this.r,g:this.g,b:this.b})}toRgbaString(){const e=`${Math.floor(this.alpha*100)}%`;return`rgba(${[this.r,this.g,this.b,e].join(", ")})`}updateRgb(e){this.rgba={...this.rgba,...e},this.hsva=this.calcHsva()}updateHsv(e){this.hsva={...this.hsva,...e},this.rgba=this.calcRgba()}isTransparent(){return this.alpha===0}isDark(){return this.getBrightness()<128}getBrightness(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3}calcHsva(){return T0(this.rgba)}calcRgba(){return O0(this.hsva)}};Ds(kf,"TRANSPARENT","transparent"),Ds(kf,"NONE","none");let wM=kf;Sf.WINDOW;const M0=3,SM=n=>Number.parseFloat(n.toFixed(M0+2).substr(0,M0+2));Sf.WINDOW,Sf.WINDOW,k0((n,e)=>{n(e)},20);function I0(n){const e=wM.create(n);return e.alpha===1?e.toHexString():e.toRgbaString()}function N0(n,e){if(!n.includes("em"))return parseInt(n);const t=Di.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function xM(n,e){return(n.firstElementChild||n).style.fontSize||Di.getComputedStyle(e).fontSize}function EM(n,e,t){if(!n.includes("px"))return n;const r=xM(e,t),i=N0(r,t);return i?(parseInt(n)/i).toFixed(2):null}const kM={start:sr.LEFT,end:sr.RIGHT};function CM(n){const e=kM[n]||n;return sr.values.includes(e)?e:null}const R0=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function L0(n,e){return n.resolve(e).depth+1}function AM(n,e,t,r){const i=L0(n,r),o=e.from-i<=r,l=e.to+i>=t.nodeSize+r;return o&&l}const OM=(n,e)=>n.eq(e);function TM(n,e,t,r=OM){const i=n.resolve(e).path.reverse();for(const o of i)if(typeof o!="number"){for(const l of o.marks)if(r(l,t))return!0}return!1}function MM(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Fs={exports:{}};var IM=Fs.exports,P0;function NM(){return P0||(P0=1,function(n,e){(function(){var t,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",d=500,g="__lodash_placeholder__",p=1,_=2,S=4,k=1,m=2,b=1,x=2,A=4,O=8,R=16,W=32,D=64,U=128,Q=256,we=512,rn=30,Fn="...",_n=800,qr=16,dr=1,Kr=2,Bn=3,rt=1/0,Ze=9007199254740991,vn=17976931348623157e292,sn=NaN,it=4294967295,Gr=it-1,jr=it>>>1,q0=[["ary",U],["bind",b],["bindKey",x],["curry",O],["curryRight",R],["flip",we],["partial",W],["partialRight",D],["rearg",Q]],Jr="[object Arguments]",$s="[object Array]",K0="[object AsyncFunction]",zi="[object Boolean]",Vi="[object Date]",G0="[object DOMException]",zs="[object Error]",Vs="[object Function]",Pf="[object GeneratorFunction]",Ut="[object Map]",Wi="[object Number]",j0="[object Null]",wn="[object Object]",Df="[object Promise]",J0="[object Proxy]",Ui="[object RegExp]",qt="[object Set]",qi="[object String]",Ws="[object Symbol]",Y0="[object Undefined]",Ki="[object WeakMap]",X0="[object WeakSet]",Gi="[object ArrayBuffer]",Yr="[object DataView]",rl="[object Float32Array]",il="[object Float64Array]",sl="[object Int8Array]",ol="[object Int16Array]",al="[object Int32Array]",ll="[object Uint8Array]",ul="[object Uint8ClampedArray]",cl="[object Uint16Array]",fl="[object Uint32Array]",Z0=/\b__p \+= '';/g,Q0=/\b(__p \+=) '' \+/g,ey=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ff=/&(?:amp|lt|gt|quot|#39);/g,Bf=/[&<>"']/g,ty=RegExp(Ff.source),ny=RegExp(Bf.source),ry=/<%-([\s\S]+?)%>/g,iy=/<%([\s\S]+?)%>/g,Hf=/<%=([\s\S]+?)%>/g,sy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oy=/^\w*$/,ay=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hl=/[\\^$.*+?()[\]{}|]/g,ly=RegExp(hl.source),dl=/^\s+/,uy=/\s/,cy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fy=/\{\n\/\* \[wrapped with (.+)\] \*/,hy=/,? & /,dy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,py=/[()=,{}\[\]\/\s]/,my=/\\(\\)?/g,gy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$f=/\w*$/,yy=/^[-+]0x[0-9a-f]+$/i,by=/^0b[01]+$/i,_y=/^\[object .+?Constructor\]$/,vy=/^0o[0-7]+$/i,wy=/^(?:0|[1-9]\d*)$/,Sy=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Us=/($^)/,xy=/['\n\r\u2028\u2029\\]/g,qs="\\ud800-\\udfff",Ey="\\u0300-\\u036f",ky="\\ufe20-\\ufe2f",Cy="\\u20d0-\\u20ff",zf=Ey+ky+Cy,Vf="\\u2700-\\u27bf",Wf="a-z\\xdf-\\xf6\\xf8-\\xff",Ay="\\xac\\xb1\\xd7\\xf7",Oy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ty="\\u2000-\\u206f",My=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Uf="A-Z\\xc0-\\xd6\\xd8-\\xde",qf="\\ufe0e\\ufe0f",Kf=Ay+Oy+Ty+My,pl="['\u2019]",Iy="["+qs+"]",Gf="["+Kf+"]",Ks="["+zf+"]",jf="\\d+",Ny="["+Vf+"]",Jf="["+Wf+"]",Yf="[^"+qs+Kf+jf+Vf+Wf+Uf+"]",ml="\\ud83c[\\udffb-\\udfff]",Ry="(?:"+Ks+"|"+ml+")",Xf="[^"+qs+"]",gl="(?:\\ud83c[\\udde6-\\uddff]){2}",yl="[\\ud800-\\udbff][\\udc00-\\udfff]",Xr="["+Uf+"]",Zf="\\u200d",Qf="(?:"+Jf+"|"+Yf+")",Ly="(?:"+Xr+"|"+Yf+")",eh="(?:"+pl+"(?:d|ll|m|re|s|t|ve))?",th="(?:"+pl+"(?:D|LL|M|RE|S|T|VE))?",nh=Ry+"?",rh="["+qf+"]?",Py="(?:"+Zf+"(?:"+[Xf,gl,yl].join("|")+")"+rh+nh+")*",Dy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ih=rh+nh+Py,By="(?:"+[Ny,gl,yl].join("|")+")"+ih,Hy="(?:"+[Xf+Ks+"?",Ks,gl,yl,Iy].join("|")+")",$y=RegExp(pl,"g"),zy=RegExp(Ks,"g"),bl=RegExp(ml+"(?="+ml+")|"+Hy+ih,"g"),Vy=RegExp([Xr+"?"+Jf+"+"+eh+"(?="+[Gf,Xr,"$"].join("|")+")",Ly+"+"+th+"(?="+[Gf,Xr+Qf,"$"].join("|")+")",Xr+"?"+Qf+"+"+eh,Xr+"+"+th,Fy,Dy,jf,By].join("|"),"g"),Wy=RegExp("["+Zf+qs+zf+qf+"]"),Uy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qy=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ky=-1,xe={};xe[rl]=xe[il]=xe[sl]=xe[ol]=xe[al]=xe[ll]=xe[ul]=xe[cl]=xe[fl]=!0,xe[Jr]=xe[$s]=xe[Gi]=xe[zi]=xe[Yr]=xe[Vi]=xe[zs]=xe[Vs]=xe[Ut]=xe[Wi]=xe[wn]=xe[Ui]=xe[qt]=xe[qi]=xe[Ki]=!1;var Se={};Se[Jr]=Se[$s]=Se[Gi]=Se[Yr]=Se[zi]=Se[Vi]=Se[rl]=Se[il]=Se[sl]=Se[ol]=Se[al]=Se[Ut]=Se[Wi]=Se[wn]=Se[Ui]=Se[qt]=Se[qi]=Se[Ws]=Se[ll]=Se[ul]=Se[cl]=Se[fl]=!0,Se[zs]=Se[Vs]=Se[Ki]=!1;var Gy={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},jy={"&":"&","<":"<",">":">",'"':""","'":"'"},Jy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xy=parseFloat,Zy=parseInt,sh=typeof Ro=="object"&&Ro&&Ro.Object===Object&&Ro,Qy=typeof self=="object"&&self&&self.Object===Object&&self,qe=sh||Qy||Function("return this")(),_l=e&&!e.nodeType&&e,pr=_l&&!0&&n&&!n.nodeType&&n,oh=pr&&pr.exports===_l,vl=oh&&sh.process,Tt=function(){try{var T=pr&&pr.require&&pr.require("util").types;return T||vl&&vl.binding&&vl.binding("util")}catch{}}(),ah=Tt&&Tt.isArrayBuffer,lh=Tt&&Tt.isDate,uh=Tt&&Tt.isMap,ch=Tt&&Tt.isRegExp,fh=Tt&&Tt.isSet,hh=Tt&&Tt.isTypedArray;function bt(T,N,I){switch(I.length){case 0:return T.call(N);case 1:return T.call(N,I[0]);case 2:return T.call(N,I[0],I[1]);case 3:return T.call(N,I[0],I[1],I[2])}return T.apply(N,I)}function e1(T,N,I,q){for(var te=-1,ge=T==null?0:T.length;++te<ge;){var Fe=T[te];N(q,Fe,I(Fe),T)}return q}function Mt(T,N){for(var I=-1,q=T==null?0:T.length;++I<q&&N(T[I],I,T)!==!1;);return T}function t1(T,N){for(var I=T==null?0:T.length;I--&&N(T[I],I,T)!==!1;);return T}function dh(T,N){for(var I=-1,q=T==null?0:T.length;++I<q;)if(!N(T[I],I,T))return!1;return!0}function Hn(T,N){for(var I=-1,q=T==null?0:T.length,te=0,ge=[];++I<q;){var Fe=T[I];N(Fe,I,T)&&(ge[te++]=Fe)}return ge}function Gs(T,N){var I=T==null?0:T.length;return!!I&&Zr(T,N,0)>-1}function wl(T,N,I){for(var q=-1,te=T==null?0:T.length;++q<te;)if(I(N,T[q]))return!0;return!1}function ke(T,N){for(var I=-1,q=T==null?0:T.length,te=Array(q);++I<q;)te[I]=N(T[I],I,T);return te}function $n(T,N){for(var I=-1,q=N.length,te=T.length;++I<q;)T[te+I]=N[I];return T}function Sl(T,N,I,q){var te=-1,ge=T==null?0:T.length;for(q&&ge&&(I=T[++te]);++te<ge;)I=N(I,T[te],te,T);return I}function n1(T,N,I,q){var te=T==null?0:T.length;for(q&&te&&(I=T[--te]);te--;)I=N(I,T[te],te,T);return I}function xl(T,N){for(var I=-1,q=T==null?0:T.length;++I<q;)if(N(T[I],I,T))return!0;return!1}var r1=El("length");function i1(T){return T.split("")}function s1(T){return T.match(dy)||[]}function ph(T,N,I){var q;return I(T,function(te,ge,Fe){if(N(te,ge,Fe))return q=ge,!1}),q}function js(T,N,I,q){for(var te=T.length,ge=I+(q?1:-1);q?ge--:++ge<te;)if(N(T[ge],ge,T))return ge;return-1}function Zr(T,N,I){return N===N?y1(T,N,I):js(T,mh,I)}function o1(T,N,I,q){for(var te=I-1,ge=T.length;++te<ge;)if(q(T[te],N))return te;return-1}function mh(T){return T!==T}function gh(T,N){var I=T==null?0:T.length;return I?Cl(T,N)/I:sn}function El(T){return function(N){return N==null?t:N[T]}}function kl(T){return function(N){return T==null?t:T[N]}}function yh(T,N,I,q,te){return te(T,function(ge,Fe,ve){I=q?(q=!1,ge):N(I,ge,Fe,ve)}),I}function a1(T,N){var I=T.length;for(T.sort(N);I--;)T[I]=T[I].value;return T}function Cl(T,N){for(var I,q=-1,te=T.length;++q<te;){var ge=N(T[q]);ge!==t&&(I=I===t?ge:I+ge)}return I}function Al(T,N){for(var I=-1,q=Array(T);++I<T;)q[I]=N(I);return q}function l1(T,N){return ke(N,function(I){return[I,T[I]]})}function bh(T){return T&&T.slice(0,Sh(T)+1).replace(dl,"")}function _t(T){return function(N){return T(N)}}function Ol(T,N){return ke(N,function(I){return T[I]})}function ji(T,N){return T.has(N)}function _h(T,N){for(var I=-1,q=T.length;++I<q&&Zr(N,T[I],0)>-1;);return I}function vh(T,N){for(var I=T.length;I--&&Zr(N,T[I],0)>-1;);return I}function u1(T,N){for(var I=T.length,q=0;I--;)T[I]===N&&++q;return q}var c1=kl(Gy),f1=kl(jy);function h1(T){return"\\"+Yy[T]}function d1(T,N){return T==null?t:T[N]}function Qr(T){return Wy.test(T)}function p1(T){return Uy.test(T)}function m1(T){for(var N,I=[];!(N=T.next()).done;)I.push(N.value);return I}function Tl(T){var N=-1,I=Array(T.size);return T.forEach(function(q,te){I[++N]=[te,q]}),I}function wh(T,N){return function(I){return T(N(I))}}function zn(T,N){for(var I=-1,q=T.length,te=0,ge=[];++I<q;){var Fe=T[I];(Fe===N||Fe===g)&&(T[I]=g,ge[te++]=I)}return ge}function Js(T){var N=-1,I=Array(T.size);return T.forEach(function(q){I[++N]=q}),I}function g1(T){var N=-1,I=Array(T.size);return T.forEach(function(q){I[++N]=[q,q]}),I}function y1(T,N,I){for(var q=I-1,te=T.length;++q<te;)if(T[q]===N)return q;return-1}function b1(T,N,I){for(var q=I+1;q--;)if(T[q]===N)return q;return q}function ei(T){return Qr(T)?v1(T):r1(T)}function Kt(T){return Qr(T)?w1(T):i1(T)}function Sh(T){for(var N=T.length;N--&&uy.test(T.charAt(N)););return N}var _1=kl(Jy);function v1(T){for(var N=bl.lastIndex=0;bl.test(T);)++N;return N}function w1(T){return T.match(bl)||[]}function S1(T){return T.match(Vy)||[]}var x1=function T(N){N=N==null?qe:ti.defaults(qe.Object(),N,ti.pick(qe,qy));var I=N.Array,q=N.Date,te=N.Error,ge=N.Function,Fe=N.Math,ve=N.Object,Ml=N.RegExp,E1=N.String,It=N.TypeError,Ys=I.prototype,k1=ge.prototype,ni=ve.prototype,Xs=N["__core-js_shared__"],Zs=k1.toString,_e=ni.hasOwnProperty,C1=0,xh=function(){var s=/[^.]+$/.exec(Xs&&Xs.keys&&Xs.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Qs=ni.toString,A1=Zs.call(ve),O1=qe._,T1=Ml("^"+Zs.call(_e).replace(hl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eo=oh?N.Buffer:t,Vn=N.Symbol,to=N.Uint8Array,Eh=eo?eo.allocUnsafe:t,no=wh(ve.getPrototypeOf,ve),kh=ve.create,Ch=ni.propertyIsEnumerable,ro=Ys.splice,Ah=Vn?Vn.isConcatSpreadable:t,Ji=Vn?Vn.iterator:t,mr=Vn?Vn.toStringTag:t,io=function(){try{var s=vr(ve,"defineProperty");return s({},"",{}),s}catch{}}(),M1=N.clearTimeout!==qe.clearTimeout&&N.clearTimeout,I1=q&&q.now!==qe.Date.now&&q.now,N1=N.setTimeout!==qe.setTimeout&&N.setTimeout,so=Fe.ceil,oo=Fe.floor,Il=ve.getOwnPropertySymbols,R1=eo?eo.isBuffer:t,Oh=N.isFinite,L1=Ys.join,P1=wh(ve.keys,ve),Be=Fe.max,Qe=Fe.min,D1=q.now,F1=N.parseInt,Th=Fe.random,B1=Ys.reverse,Nl=vr(N,"DataView"),Yi=vr(N,"Map"),Rl=vr(N,"Promise"),ri=vr(N,"Set"),Xi=vr(N,"WeakMap"),Zi=vr(ve,"create"),ao=Xi&&new Xi,ii={},H1=wr(Nl),$1=wr(Yi),z1=wr(Rl),V1=wr(ri),W1=wr(Xi),lo=Vn?Vn.prototype:t,Qi=lo?lo.valueOf:t,Mh=lo?lo.toString:t;function v(s){if(Me(s)&&!ne(s)&&!(s instanceof ue)){if(s instanceof Nt)return s;if(_e.call(s,"__wrapped__"))return Id(s)}return new Nt(s)}var si=function(){function s(){}return function(a){if(!Ae(a))return{};if(kh)return kh(a);s.prototype=a;var c=new s;return s.prototype=t,c}}();function uo(){}function Nt(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=t}v.templateSettings={escape:ry,evaluate:iy,interpolate:Hf,variable:"",imports:{_:v}},v.prototype=uo.prototype,v.prototype.constructor=v,Nt.prototype=si(uo.prototype),Nt.prototype.constructor=Nt;function ue(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=it,this.__views__=[]}function U1(){var s=new ue(this.__wrapped__);return s.__actions__=ht(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ht(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ht(this.__views__),s}function q1(){if(this.__filtered__){var s=new ue(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function K1(){var s=this.__wrapped__.value(),a=this.__dir__,c=ne(s),h=a<0,y=c?s.length:0,w=i_(0,y,this.__views__),E=w.start,C=w.end,M=C-E,L=h?C:E-1,P=this.__iteratees__,F=P.length,V=0,j=Qe(M,this.__takeCount__);if(!c||!h&&y==M&&j==M)return ed(s,this.__actions__);var X=[];e:for(;M--&&V<j;){L+=a;for(var se=-1,Z=s[L];++se<F;){var ae=P[se],fe=ae.iteratee,St=ae.type,at=fe(Z);if(St==Kr)Z=at;else if(!at){if(St==dr)continue e;break e}}X[V++]=Z}return X}ue.prototype=si(uo.prototype),ue.prototype.constructor=ue;function gr(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var h=s[a];this.set(h[0],h[1])}}function G1(){this.__data__=Zi?Zi(null):{},this.size=0}function j1(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function J1(s){var a=this.__data__;if(Zi){var c=a[s];return c===f?t:c}return _e.call(a,s)?a[s]:t}function Y1(s){var a=this.__data__;return Zi?a[s]!==t:_e.call(a,s)}function X1(s,a){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=Zi&&a===t?f:a,this}gr.prototype.clear=G1,gr.prototype.delete=j1,gr.prototype.get=J1,gr.prototype.has=Y1,gr.prototype.set=X1;function Sn(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var h=s[a];this.set(h[0],h[1])}}function Z1(){this.__data__=[],this.size=0}function Q1(s){var a=this.__data__,c=co(a,s);if(c<0)return!1;var h=a.length-1;return c==h?a.pop():ro.call(a,c,1),--this.size,!0}function eb(s){var a=this.__data__,c=co(a,s);return c<0?t:a[c][1]}function tb(s){return co(this.__data__,s)>-1}function nb(s,a){var c=this.__data__,h=co(c,s);return h<0?(++this.size,c.push([s,a])):c[h][1]=a,this}Sn.prototype.clear=Z1,Sn.prototype.delete=Q1,Sn.prototype.get=eb,Sn.prototype.has=tb,Sn.prototype.set=nb;function xn(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var h=s[a];this.set(h[0],h[1])}}function rb(){this.size=0,this.__data__={hash:new gr,map:new(Yi||Sn),string:new gr}}function ib(s){var a=xo(this,s).delete(s);return this.size-=a?1:0,a}function sb(s){return xo(this,s).get(s)}function ob(s){return xo(this,s).has(s)}function ab(s,a){var c=xo(this,s),h=c.size;return c.set(s,a),this.size+=c.size==h?0:1,this}xn.prototype.clear=rb,xn.prototype.delete=ib,xn.prototype.get=sb,xn.prototype.has=ob,xn.prototype.set=ab;function yr(s){var a=-1,c=s==null?0:s.length;for(this.__data__=new xn;++a<c;)this.add(s[a])}function lb(s){return this.__data__.set(s,f),this}function ub(s){return this.__data__.has(s)}yr.prototype.add=yr.prototype.push=lb,yr.prototype.has=ub;function Gt(s){var a=this.__data__=new Sn(s);this.size=a.size}function cb(){this.__data__=new Sn,this.size=0}function fb(s){var a=this.__data__,c=a.delete(s);return this.size=a.size,c}function hb(s){return this.__data__.get(s)}function db(s){return this.__data__.has(s)}function pb(s,a){var c=this.__data__;if(c instanceof Sn){var h=c.__data__;if(!Yi||h.length<i-1)return h.push([s,a]),this.size=++c.size,this;c=this.__data__=new xn(h)}return c.set(s,a),this.size=c.size,this}Gt.prototype.clear=cb,Gt.prototype.delete=fb,Gt.prototype.get=hb,Gt.prototype.has=db,Gt.prototype.set=pb;function Ih(s,a){var c=ne(s),h=!c&&Sr(s),y=!c&&!h&&Gn(s),w=!c&&!h&&!y&&ui(s),E=c||h||y||w,C=E?Al(s.length,E1):[],M=C.length;for(var L in s)(a||_e.call(s,L))&&!(E&&(L=="length"||y&&(L=="offset"||L=="parent")||w&&(L=="buffer"||L=="byteLength"||L=="byteOffset")||An(L,M)))&&C.push(L);return C}function Nh(s){var a=s.length;return a?s[Ul(0,a-1)]:t}function mb(s,a){return Eo(ht(s),br(a,0,s.length))}function gb(s){return Eo(ht(s))}function Ll(s,a,c){(c!==t&&!jt(s[a],c)||c===t&&!(a in s))&&En(s,a,c)}function es(s,a,c){var h=s[a];(!(_e.call(s,a)&&jt(h,c))||c===t&&!(a in s))&&En(s,a,c)}function co(s,a){for(var c=s.length;c--;)if(jt(s[c][0],a))return c;return-1}function yb(s,a,c,h){return Wn(s,function(y,w,E){a(h,y,c(y),E)}),h}function Rh(s,a){return s&&an(a,He(a),s)}function bb(s,a){return s&&an(a,pt(a),s)}function En(s,a,c){a=="__proto__"&&io?io(s,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[a]=c}function Pl(s,a){for(var c=-1,h=a.length,y=I(h),w=s==null;++c<h;)y[c]=w?t:mu(s,a[c]);return y}function br(s,a,c){return s===s&&(c!==t&&(s=s<=c?s:c),a!==t&&(s=s>=a?s:a)),s}function Rt(s,a,c,h,y,w){var E,C=a&p,M=a&_,L=a&S;if(c&&(E=y?c(s,h,y,w):c(s)),E!==t)return E;if(!Ae(s))return s;var P=ne(s);if(P){if(E=o_(s),!C)return ht(s,E)}else{var F=et(s),V=F==Vs||F==Pf;if(Gn(s))return rd(s,C);if(F==wn||F==Jr||V&&!y){if(E=M||V?{}:Sd(s),!C)return M?Jb(s,bb(E,s)):jb(s,Rh(E,s))}else{if(!Se[F])return y?s:{};E=a_(s,F,C)}}w||(w=new Gt);var j=w.get(s);if(j)return j;w.set(s,E),Xd(s)?s.forEach(function(Z){E.add(Rt(Z,a,c,Z,s,w))}):Jd(s)&&s.forEach(function(Z,ae){E.set(ae,Rt(Z,a,c,ae,s,w))});var X=L?M?tu:eu:M?pt:He,se=P?t:X(s);return Mt(se||s,function(Z,ae){se&&(ae=Z,Z=s[ae]),es(E,ae,Rt(Z,a,c,ae,s,w))}),E}function _b(s){var a=He(s);return function(c){return Lh(c,s,a)}}function Lh(s,a,c){var h=c.length;if(s==null)return!h;for(s=ve(s);h--;){var y=c[h],w=a[y],E=s[y];if(E===t&&!(y in s)||!w(E))return!1}return!0}function Ph(s,a,c){if(typeof s!="function")throw new It(l);return ls(function(){s.apply(t,c)},a)}function ts(s,a,c,h){var y=-1,w=Gs,E=!0,C=s.length,M=[],L=a.length;if(!C)return M;c&&(a=ke(a,_t(c))),h?(w=wl,E=!1):a.length>=i&&(w=ji,E=!1,a=new yr(a));e:for(;++y<C;){var P=s[y],F=c==null?P:c(P);if(P=h||P!==0?P:0,E&&F===F){for(var V=L;V--;)if(a[V]===F)continue e;M.push(P)}else w(a,F,h)||M.push(P)}return M}var Wn=ld(on),Dh=ld(Fl,!0);function vb(s,a){var c=!0;return Wn(s,function(h,y,w){return c=!!a(h,y,w),c}),c}function fo(s,a,c){for(var h=-1,y=s.length;++h<y;){var w=s[h],E=a(w);if(E!=null&&(C===t?E===E&&!wt(E):c(E,C)))var C=E,M=w}return M}function wb(s,a,c,h){var y=s.length;for(c=re(c),c<0&&(c=-c>y?0:y+c),h=h===t||h>y?y:re(h),h<0&&(h+=y),h=c>h?0:Qd(h);c<h;)s[c++]=a;return s}function Fh(s,a){var c=[];return Wn(s,function(h,y,w){a(h,y,w)&&c.push(h)}),c}function Ke(s,a,c,h,y){var w=-1,E=s.length;for(c||(c=u_),y||(y=[]);++w<E;){var C=s[w];a>0&&c(C)?a>1?Ke(C,a-1,c,h,y):$n(y,C):h||(y[y.length]=C)}return y}var Dl=ud(),Bh=ud(!0);function on(s,a){return s&&Dl(s,a,He)}function Fl(s,a){return s&&Bh(s,a,He)}function ho(s,a){return Hn(a,function(c){return On(s[c])})}function _r(s,a){a=qn(a,s);for(var c=0,h=a.length;s!=null&&c<h;)s=s[ln(a[c++])];return c&&c==h?s:t}function Hh(s,a,c){var h=a(s);return ne(s)?h:$n(h,c(s))}function st(s){return s==null?s===t?Y0:j0:mr&&mr in ve(s)?r_(s):g_(s)}function Bl(s,a){return s>a}function Sb(s,a){return s!=null&&_e.call(s,a)}function xb(s,a){return s!=null&&a in ve(s)}function Eb(s,a,c){return s>=Qe(a,c)&&s<Be(a,c)}function Hl(s,a,c){for(var h=c?wl:Gs,y=s[0].length,w=s.length,E=w,C=I(w),M=1/0,L=[];E--;){var P=s[E];E&&a&&(P=ke(P,_t(a))),M=Qe(P.length,M),C[E]=!c&&(a||y>=120&&P.length>=120)?new yr(E&&P):t}P=s[0];var F=-1,V=C[0];e:for(;++F<y&&L.length<M;){var j=P[F],X=a?a(j):j;if(j=c||j!==0?j:0,!(V?ji(V,X):h(L,X,c))){for(E=w;--E;){var se=C[E];if(!(se?ji(se,X):h(s[E],X,c)))continue e}V&&V.push(X),L.push(j)}}return L}function kb(s,a,c,h){return on(s,function(y,w,E){a(h,c(y),w,E)}),h}function ns(s,a,c){a=qn(a,s),s=Cd(s,a);var h=s==null?s:s[ln(Pt(a))];return h==null?t:bt(h,s,c)}function $h(s){return Me(s)&&st(s)==Jr}function Cb(s){return Me(s)&&st(s)==Gi}function Ab(s){return Me(s)&&st(s)==Vi}function rs(s,a,c,h,y){return s===a?!0:s==null||a==null||!Me(s)&&!Me(a)?s!==s&&a!==a:Ob(s,a,c,h,rs,y)}function Ob(s,a,c,h,y,w){var E=ne(s),C=ne(a),M=E?$s:et(s),L=C?$s:et(a);M=M==Jr?wn:M,L=L==Jr?wn:L;var P=M==wn,F=L==wn,V=M==L;if(V&&Gn(s)){if(!Gn(a))return!1;E=!0,P=!1}if(V&&!P)return w||(w=new Gt),E||ui(s)?_d(s,a,c,h,y,w):t_(s,a,M,c,h,y,w);if(!(c&k)){var j=P&&_e.call(s,"__wrapped__"),X=F&&_e.call(a,"__wrapped__");if(j||X){var se=j?s.value():s,Z=X?a.value():a;return w||(w=new Gt),y(se,Z,c,h,w)}}return V?(w||(w=new Gt),n_(s,a,c,h,y,w)):!1}function Tb(s){return Me(s)&&et(s)==Ut}function $l(s,a,c,h){var y=c.length,w=y,E=!h;if(s==null)return!w;for(s=ve(s);y--;){var C=c[y];if(E&&C[2]?C[1]!==s[C[0]]:!(C[0]in s))return!1}for(;++y<w;){C=c[y];var M=C[0],L=s[M],P=C[1];if(E&&C[2]){if(L===t&&!(M in s))return!1}else{var F=new Gt;if(h)var V=h(L,P,M,s,a,F);if(!(V===t?rs(P,L,k|m,h,F):V))return!1}}return!0}function zh(s){if(!Ae(s)||f_(s))return!1;var a=On(s)?T1:_y;return a.test(wr(s))}function Mb(s){return Me(s)&&st(s)==Ui}function Ib(s){return Me(s)&&et(s)==qt}function Nb(s){return Me(s)&&Mo(s.length)&&!!xe[st(s)]}function Vh(s){return typeof s=="function"?s:s==null?mt:typeof s=="object"?ne(s)?qh(s[0],s[1]):Uh(s):cp(s)}function zl(s){if(!as(s))return P1(s);var a=[];for(var c in ve(s))_e.call(s,c)&&c!="constructor"&&a.push(c);return a}function Rb(s){if(!Ae(s))return m_(s);var a=as(s),c=[];for(var h in s)h=="constructor"&&(a||!_e.call(s,h))||c.push(h);return c}function Vl(s,a){return s<a}function Wh(s,a){var c=-1,h=dt(s)?I(s.length):[];return Wn(s,function(y,w,E){h[++c]=a(y,w,E)}),h}function Uh(s){var a=ru(s);return a.length==1&&a[0][2]?Ed(a[0][0],a[0][1]):function(c){return c===s||$l(c,s,a)}}function qh(s,a){return su(s)&&xd(a)?Ed(ln(s),a):function(c){var h=mu(c,s);return h===t&&h===a?gu(c,s):rs(a,h,k|m)}}function po(s,a,c,h,y){s!==a&&Dl(a,function(w,E){if(y||(y=new Gt),Ae(w))Lb(s,a,E,c,po,h,y);else{var C=h?h(au(s,E),w,E+"",s,a,y):t;C===t&&(C=w),Ll(s,E,C)}},pt)}function Lb(s,a,c,h,y,w,E){var C=au(s,c),M=au(a,c),L=E.get(M);if(L){Ll(s,c,L);return}var P=w?w(C,M,c+"",s,a,E):t,F=P===t;if(F){var V=ne(M),j=!V&&Gn(M),X=!V&&!j&&ui(M);P=M,V||j||X?ne(C)?P=C:Ie(C)?P=ht(C):j?(F=!1,P=rd(M,!0)):X?(F=!1,P=id(M,!0)):P=[]:us(M)||Sr(M)?(P=C,Sr(C)?P=ep(C):(!Ae(C)||On(C))&&(P=Sd(M))):F=!1}F&&(E.set(M,P),y(P,M,h,w,E),E.delete(M)),Ll(s,c,P)}function Kh(s,a){var c=s.length;if(c)return a+=a<0?c:0,An(a,c)?s[a]:t}function Gh(s,a,c){a.length?a=ke(a,function(w){return ne(w)?function(E){return _r(E,w.length===1?w[0]:w)}:w}):a=[mt];var h=-1;a=ke(a,_t(Y()));var y=Wh(s,function(w,E,C){var M=ke(a,function(L){return L(w)});return{criteria:M,index:++h,value:w}});return a1(y,function(w,E){return Gb(w,E,c)})}function Pb(s,a){return jh(s,a,function(c,h){return gu(s,h)})}function jh(s,a,c){for(var h=-1,y=a.length,w={};++h<y;){var E=a[h],C=_r(s,E);c(C,E)&&is(w,qn(E,s),C)}return w}function Db(s){return function(a){return _r(a,s)}}function Wl(s,a,c,h){var y=h?o1:Zr,w=-1,E=a.length,C=s;for(s===a&&(a=ht(a)),c&&(C=ke(s,_t(c)));++w<E;)for(var M=0,L=a[w],P=c?c(L):L;(M=y(C,P,M,h))>-1;)C!==s&&ro.call(C,M,1),ro.call(s,M,1);return s}function Jh(s,a){for(var c=s?a.length:0,h=c-1;c--;){var y=a[c];if(c==h||y!==w){var w=y;An(y)?ro.call(s,y,1):Gl(s,y)}}return s}function Ul(s,a){return s+oo(Th()*(a-s+1))}function Fb(s,a,c,h){for(var y=-1,w=Be(so((a-s)/(c||1)),0),E=I(w);w--;)E[h?w:++y]=s,s+=c;return E}function ql(s,a){var c="";if(!s||a<1||a>Ze)return c;do a%2&&(c+=s),a=oo(a/2),a&&(s+=s);while(a);return c}function oe(s,a){return lu(kd(s,a,mt),s+"")}function Bb(s){return Nh(ci(s))}function Hb(s,a){var c=ci(s);return Eo(c,br(a,0,c.length))}function is(s,a,c,h){if(!Ae(s))return s;a=qn(a,s);for(var y=-1,w=a.length,E=w-1,C=s;C!=null&&++y<w;){var M=ln(a[y]),L=c;if(M==="__proto__"||M==="constructor"||M==="prototype")return s;if(y!=E){var P=C[M];L=h?h(P,M,C):t,L===t&&(L=Ae(P)?P:An(a[y+1])?[]:{})}es(C,M,L),C=C[M]}return s}var Yh=ao?function(s,a){return ao.set(s,a),s}:mt,$b=io?function(s,a){return io(s,"toString",{configurable:!0,enumerable:!1,value:bu(a),writable:!0})}:mt;function zb(s){return Eo(ci(s))}function Lt(s,a,c){var h=-1,y=s.length;a<0&&(a=-a>y?0:y+a),c=c>y?y:c,c<0&&(c+=y),y=a>c?0:c-a>>>0,a>>>=0;for(var w=I(y);++h<y;)w[h]=s[h+a];return w}function Vb(s,a){var c;return Wn(s,function(h,y,w){return c=a(h,y,w),!c}),!!c}function mo(s,a,c){var h=0,y=s==null?h:s.length;if(typeof a=="number"&&a===a&&y<=jr){for(;h<y;){var w=h+y>>>1,E=s[w];E!==null&&!wt(E)&&(c?E<=a:E<a)?h=w+1:y=w}return y}return Kl(s,a,mt,c)}function Kl(s,a,c,h){var y=0,w=s==null?0:s.length;if(w===0)return 0;a=c(a);for(var E=a!==a,C=a===null,M=wt(a),L=a===t;y<w;){var P=oo((y+w)/2),F=c(s[P]),V=F!==t,j=F===null,X=F===F,se=wt(F);if(E)var Z=h||X;else L?Z=X&&(h||V):C?Z=X&&V&&(h||!j):M?Z=X&&V&&!j&&(h||!se):j||se?Z=!1:Z=h?F<=a:F<a;Z?y=P+1:w=P}return Qe(w,Gr)}function Xh(s,a){for(var c=-1,h=s.length,y=0,w=[];++c<h;){var E=s[c],C=a?a(E):E;if(!c||!jt(C,M)){var M=C;w[y++]=E===0?0:E}}return w}function Zh(s){return typeof s=="number"?s:wt(s)?sn:+s}function vt(s){if(typeof s=="string")return s;if(ne(s))return ke(s,vt)+"";if(wt(s))return Mh?Mh.call(s):"";var a=s+"";return a=="0"&&1/s==-rt?"-0":a}function Un(s,a,c){var h=-1,y=Gs,w=s.length,E=!0,C=[],M=C;if(c)E=!1,y=wl;else if(w>=i){var L=a?null:Qb(s);if(L)return Js(L);E=!1,y=ji,M=new yr}else M=a?[]:C;e:for(;++h<w;){var P=s[h],F=a?a(P):P;if(P=c||P!==0?P:0,E&&F===F){for(var V=M.length;V--;)if(M[V]===F)continue e;a&&M.push(F),C.push(P)}else y(M,F,c)||(M!==C&&M.push(F),C.push(P))}return C}function Gl(s,a){return a=qn(a,s),s=Cd(s,a),s==null||delete s[ln(Pt(a))]}function Qh(s,a,c,h){return is(s,a,c(_r(s,a)),h)}function go(s,a,c,h){for(var y=s.length,w=h?y:-1;(h?w--:++w<y)&&a(s[w],w,s););return c?Lt(s,h?0:w,h?w+1:y):Lt(s,h?w+1:0,h?y:w)}function ed(s,a){var c=s;return c instanceof ue&&(c=c.value()),Sl(a,function(h,y){return y.func.apply(y.thisArg,$n([h],y.args))},c)}function jl(s,a,c){var h=s.length;if(h<2)return h?Un(s[0]):[];for(var y=-1,w=I(h);++y<h;)for(var E=s[y],C=-1;++C<h;)C!=y&&(w[y]=ts(w[y]||E,s[C],a,c));return Un(Ke(w,1),a,c)}function td(s,a,c){for(var h=-1,y=s.length,w=a.length,E={};++h<y;){var C=h<w?a[h]:t;c(E,s[h],C)}return E}function Jl(s){return Ie(s)?s:[]}function Yl(s){return typeof s=="function"?s:mt}function qn(s,a){return ne(s)?s:su(s,a)?[s]:Md(ye(s))}var Wb=oe;function Kn(s,a,c){var h=s.length;return c=c===t?h:c,!a&&c>=h?s:Lt(s,a,c)}var nd=M1||function(s){return qe.clearTimeout(s)};function rd(s,a){if(a)return s.slice();var c=s.length,h=Eh?Eh(c):new s.constructor(c);return s.copy(h),h}function Xl(s){var a=new s.constructor(s.byteLength);return new to(a).set(new to(s)),a}function Ub(s,a){var c=a?Xl(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function qb(s){var a=new s.constructor(s.source,$f.exec(s));return a.lastIndex=s.lastIndex,a}function Kb(s){return Qi?ve(Qi.call(s)):{}}function id(s,a){var c=a?Xl(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function sd(s,a){if(s!==a){var c=s!==t,h=s===null,y=s===s,w=wt(s),E=a!==t,C=a===null,M=a===a,L=wt(a);if(!C&&!L&&!w&&s>a||w&&E&&M&&!C&&!L||h&&E&&M||!c&&M||!y)return 1;if(!h&&!w&&!L&&s<a||L&&c&&y&&!h&&!w||C&&c&&y||!E&&y||!M)return-1}return 0}function Gb(s,a,c){for(var h=-1,y=s.criteria,w=a.criteria,E=y.length,C=c.length;++h<E;){var M=sd(y[h],w[h]);if(M){if(h>=C)return M;var L=c[h];return M*(L=="desc"?-1:1)}}return s.index-a.index}function od(s,a,c,h){for(var y=-1,w=s.length,E=c.length,C=-1,M=a.length,L=Be(w-E,0),P=I(M+L),F=!h;++C<M;)P[C]=a[C];for(;++y<E;)(F||y<w)&&(P[c[y]]=s[y]);for(;L--;)P[C++]=s[y++];return P}function ad(s,a,c,h){for(var y=-1,w=s.length,E=-1,C=c.length,M=-1,L=a.length,P=Be(w-C,0),F=I(P+L),V=!h;++y<P;)F[y]=s[y];for(var j=y;++M<L;)F[j+M]=a[M];for(;++E<C;)(V||y<w)&&(F[j+c[E]]=s[y++]);return F}function ht(s,a){var c=-1,h=s.length;for(a||(a=I(h));++c<h;)a[c]=s[c];return a}function an(s,a,c,h){var y=!c;c||(c={});for(var w=-1,E=a.length;++w<E;){var C=a[w],M=h?h(c[C],s[C],C,c,s):t;M===t&&(M=s[C]),y?En(c,C,M):es(c,C,M)}return c}function jb(s,a){return an(s,iu(s),a)}function Jb(s,a){return an(s,vd(s),a)}function yo(s,a){return function(c,h){var y=ne(c)?e1:yb,w=a?a():{};return y(c,s,Y(h,2),w)}}function oi(s){return oe(function(a,c){var h=-1,y=c.length,w=y>1?c[y-1]:t,E=y>2?c[2]:t;for(w=s.length>3&&typeof w=="function"?(y--,w):t,E&&ot(c[0],c[1],E)&&(w=y<3?t:w,y=1),a=ve(a);++h<y;){var C=c[h];C&&s(a,C,h,w)}return a})}function ld(s,a){return function(c,h){if(c==null)return c;if(!dt(c))return s(c,h);for(var y=c.length,w=a?y:-1,E=ve(c);(a?w--:++w<y)&&h(E[w],w,E)!==!1;);return c}}function ud(s){return function(a,c,h){for(var y=-1,w=ve(a),E=h(a),C=E.length;C--;){var M=E[s?C:++y];if(c(w[M],M,w)===!1)break}return a}}function Yb(s,a,c){var h=a&b,y=ss(s);function w(){var E=this&&this!==qe&&this instanceof w?y:s;return E.apply(h?c:this,arguments)}return w}function cd(s){return function(a){a=ye(a);var c=Qr(a)?Kt(a):t,h=c?c[0]:a.charAt(0),y=c?Kn(c,1).join(""):a.slice(1);return h[s]()+y}}function ai(s){return function(a){return Sl(lp(ap(a).replace($y,"")),s,"")}}function ss(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var c=si(s.prototype),h=s.apply(c,a);return Ae(h)?h:c}}function Xb(s,a,c){var h=ss(s);function y(){for(var w=arguments.length,E=I(w),C=w,M=li(y);C--;)E[C]=arguments[C];var L=w<3&&E[0]!==M&&E[w-1]!==M?[]:zn(E,M);if(w-=L.length,w<c)return md(s,a,bo,y.placeholder,t,E,L,t,t,c-w);var P=this&&this!==qe&&this instanceof y?h:s;return bt(P,this,E)}return y}function fd(s){return function(a,c,h){var y=ve(a);if(!dt(a)){var w=Y(c,3);a=He(a),c=function(C){return w(y[C],C,y)}}var E=s(a,c,h);return E>-1?y[w?a[E]:E]:t}}function hd(s){return Cn(function(a){var c=a.length,h=c,y=Nt.prototype.thru;for(s&&a.reverse();h--;){var w=a[h];if(typeof w!="function")throw new It(l);if(y&&!E&&So(w)=="wrapper")var E=new Nt([],!0)}for(h=E?h:c;++h<c;){w=a[h];var C=So(w),M=C=="wrapper"?nu(w):t;M&&ou(M[0])&&M[1]==(U|O|W|Q)&&!M[4].length&&M[9]==1?E=E[So(M[0])].apply(E,M[3]):E=w.length==1&&ou(w)?E[C]():E.thru(w)}return function(){var L=arguments,P=L[0];if(E&&L.length==1&&ne(P))return E.plant(P).value();for(var F=0,V=c?a[F].apply(this,L):P;++F<c;)V=a[F].call(this,V);return V}})}function bo(s,a,c,h,y,w,E,C,M,L){var P=a&U,F=a&b,V=a&x,j=a&(O|R),X=a&we,se=V?t:ss(s);function Z(){for(var ae=arguments.length,fe=I(ae),St=ae;St--;)fe[St]=arguments[St];if(j)var at=li(Z),xt=u1(fe,at);if(h&&(fe=od(fe,h,y,j)),w&&(fe=ad(fe,w,E,j)),ae-=xt,j&&ae<L){var Ne=zn(fe,at);return md(s,a,bo,Z.placeholder,c,fe,Ne,C,M,L-ae)}var Jt=F?c:this,Mn=V?Jt[s]:s;return ae=fe.length,C?fe=y_(fe,C):X&&ae>1&&fe.reverse(),P&&M<ae&&(fe.length=M),this&&this!==qe&&this instanceof Z&&(Mn=se||ss(Mn)),Mn.apply(Jt,fe)}return Z}function dd(s,a){return function(c,h){return kb(c,s,a(h),{})}}function _o(s,a){return function(c,h){var y;if(c===t&&h===t)return a;if(c!==t&&(y=c),h!==t){if(y===t)return h;typeof c=="string"||typeof h=="string"?(c=vt(c),h=vt(h)):(c=Zh(c),h=Zh(h)),y=s(c,h)}return y}}function Zl(s){return Cn(function(a){return a=ke(a,_t(Y())),oe(function(c){var h=this;return s(a,function(y){return bt(y,h,c)})})})}function vo(s,a){a=a===t?" ":vt(a);var c=a.length;if(c<2)return c?ql(a,s):a;var h=ql(a,so(s/ei(a)));return Qr(a)?Kn(Kt(h),0,s).join(""):h.slice(0,s)}function Zb(s,a,c,h){var y=a&b,w=ss(s);function E(){for(var C=-1,M=arguments.length,L=-1,P=h.length,F=I(P+M),V=this&&this!==qe&&this instanceof E?w:s;++L<P;)F[L]=h[L];for(;M--;)F[L++]=arguments[++C];return bt(V,y?c:this,F)}return E}function pd(s){return function(a,c,h){return h&&typeof h!="number"&&ot(a,c,h)&&(c=h=t),a=Tn(a),c===t?(c=a,a=0):c=Tn(c),h=h===t?a<c?1:-1:Tn(h),Fb(a,c,h,s)}}function wo(s){return function(a,c){return typeof a=="string"&&typeof c=="string"||(a=Dt(a),c=Dt(c)),s(a,c)}}function md(s,a,c,h,y,w,E,C,M,L){var P=a&O,F=P?E:t,V=P?t:E,j=P?w:t,X=P?t:w;a|=P?W:D,a&=~(P?D:W),a&A||(a&=~(b|x));var se=[s,a,y,j,F,X,V,C,M,L],Z=c.apply(t,se);return ou(s)&&Ad(Z,se),Z.placeholder=h,Od(Z,s,a)}function Ql(s){var a=Fe[s];return function(c,h){if(c=Dt(c),h=h==null?0:Qe(re(h),292),h&&Oh(c)){var y=(ye(c)+"e").split("e"),w=a(y[0]+"e"+(+y[1]+h));return y=(ye(w)+"e").split("e"),+(y[0]+"e"+(+y[1]-h))}return a(c)}}var Qb=ri&&1/Js(new ri([,-0]))[1]==rt?function(s){return new ri(s)}:wu;function gd(s){return function(a){var c=et(a);return c==Ut?Tl(a):c==qt?g1(a):l1(a,s(a))}}function kn(s,a,c,h,y,w,E,C){var M=a&x;if(!M&&typeof s!="function")throw new It(l);var L=h?h.length:0;if(L||(a&=~(W|D),h=y=t),E=E===t?E:Be(re(E),0),C=C===t?C:re(C),L-=y?y.length:0,a&D){var P=h,F=y;h=y=t}var V=M?t:nu(s),j=[s,a,c,h,y,P,F,w,E,C];if(V&&p_(j,V),s=j[0],a=j[1],c=j[2],h=j[3],y=j[4],C=j[9]=j[9]===t?M?0:s.length:Be(j[9]-L,0),!C&&a&(O|R)&&(a&=~(O|R)),!a||a==b)var X=Yb(s,a,c);else a==O||a==R?X=Xb(s,a,C):(a==W||a==(b|W))&&!y.length?X=Zb(s,a,c,h):X=bo.apply(t,j);var se=V?Yh:Ad;return Od(se(X,j),s,a)}function yd(s,a,c,h){return s===t||jt(s,ni[c])&&!_e.call(h,c)?a:s}function bd(s,a,c,h,y,w){return Ae(s)&&Ae(a)&&(w.set(a,s),po(s,a,t,bd,w),w.delete(a)),s}function e_(s){return us(s)?t:s}function _d(s,a,c,h,y,w){var E=c&k,C=s.length,M=a.length;if(C!=M&&!(E&&M>C))return!1;var L=w.get(s),P=w.get(a);if(L&&P)return L==a&&P==s;var F=-1,V=!0,j=c&m?new yr:t;for(w.set(s,a),w.set(a,s);++F<C;){var X=s[F],se=a[F];if(h)var Z=E?h(se,X,F,a,s,w):h(X,se,F,s,a,w);if(Z!==t){if(Z)continue;V=!1;break}if(j){if(!xl(a,function(ae,fe){if(!ji(j,fe)&&(X===ae||y(X,ae,c,h,w)))return j.push(fe)})){V=!1;break}}else if(!(X===se||y(X,se,c,h,w))){V=!1;break}}return w.delete(s),w.delete(a),V}function t_(s,a,c,h,y,w,E){switch(c){case Yr:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Gi:return!(s.byteLength!=a.byteLength||!w(new to(s),new to(a)));case zi:case Vi:case Wi:return jt(+s,+a);case zs:return s.name==a.name&&s.message==a.message;case Ui:case qi:return s==a+"";case Ut:var C=Tl;case qt:var M=h&k;if(C||(C=Js),s.size!=a.size&&!M)return!1;var L=E.get(s);if(L)return L==a;h|=m,E.set(s,a);var P=_d(C(s),C(a),h,y,w,E);return E.delete(s),P;case Ws:if(Qi)return Qi.call(s)==Qi.call(a)}return!1}function n_(s,a,c,h,y,w){var E=c&k,C=eu(s),M=C.length,L=eu(a),P=L.length;if(M!=P&&!E)return!1;for(var F=M;F--;){var V=C[F];if(!(E?V in a:_e.call(a,V)))return!1}var j=w.get(s),X=w.get(a);if(j&&X)return j==a&&X==s;var se=!0;w.set(s,a),w.set(a,s);for(var Z=E;++F<M;){V=C[F];var ae=s[V],fe=a[V];if(h)var St=E?h(fe,ae,V,a,s,w):h(ae,fe,V,s,a,w);if(!(St===t?ae===fe||y(ae,fe,c,h,w):St)){se=!1;break}Z||(Z=V=="constructor")}if(se&&!Z){var at=s.constructor,xt=a.constructor;at!=xt&&"constructor"in s&&"constructor"in a&&!(typeof at=="function"&&at instanceof at&&typeof xt=="function"&&xt instanceof xt)&&(se=!1)}return w.delete(s),w.delete(a),se}function Cn(s){return lu(kd(s,t,Ld),s+"")}function eu(s){return Hh(s,He,iu)}function tu(s){return Hh(s,pt,vd)}var nu=ao?function(s){return ao.get(s)}:wu;function So(s){for(var a=s.name+"",c=ii[a],h=_e.call(ii,a)?c.length:0;h--;){var y=c[h],w=y.func;if(w==null||w==s)return y.name}return a}function li(s){var a=_e.call(v,"placeholder")?v:s;return a.placeholder}function Y(){var s=v.iteratee||_u;return s=s===_u?Vh:s,arguments.length?s(arguments[0],arguments[1]):s}function xo(s,a){var c=s.__data__;return c_(a)?c[typeof a=="string"?"string":"hash"]:c.map}function ru(s){for(var a=He(s),c=a.length;c--;){var h=a[c],y=s[h];a[c]=[h,y,xd(y)]}return a}function vr(s,a){var c=d1(s,a);return zh(c)?c:t}function r_(s){var a=_e.call(s,mr),c=s[mr];try{s[mr]=t;var h=!0}catch{}var y=Qs.call(s);return h&&(a?s[mr]=c:delete s[mr]),y}var iu=Il?function(s){return s==null?[]:(s=ve(s),Hn(Il(s),function(a){return Ch.call(s,a)}))}:Su,vd=Il?function(s){for(var a=[];s;)$n(a,iu(s)),s=no(s);return a}:Su,et=st;(Nl&&et(new Nl(new ArrayBuffer(1)))!=Yr||Yi&&et(new Yi)!=Ut||Rl&&et(Rl.resolve())!=Df||ri&&et(new ri)!=qt||Xi&&et(new Xi)!=Ki)&&(et=function(s){var a=st(s),c=a==wn?s.constructor:t,h=c?wr(c):"";if(h)switch(h){case H1:return Yr;case $1:return Ut;case z1:return Df;case V1:return qt;case W1:return Ki}return a});function i_(s,a,c){for(var h=-1,y=c.length;++h<y;){var w=c[h],E=w.size;switch(w.type){case"drop":s+=E;break;case"dropRight":a-=E;break;case"take":a=Qe(a,s+E);break;case"takeRight":s=Be(s,a-E);break}}return{start:s,end:a}}function s_(s){var a=s.match(fy);return a?a[1].split(hy):[]}function wd(s,a,c){a=qn(a,s);for(var h=-1,y=a.length,w=!1;++h<y;){var E=ln(a[h]);if(!(w=s!=null&&c(s,E)))break;s=s[E]}return w||++h!=y?w:(y=s==null?0:s.length,!!y&&Mo(y)&&An(E,y)&&(ne(s)||Sr(s)))}function o_(s){var a=s.length,c=new s.constructor(a);return a&&typeof s[0]=="string"&&_e.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function Sd(s){return typeof s.constructor=="function"&&!as(s)?si(no(s)):{}}function a_(s,a,c){var h=s.constructor;switch(a){case Gi:return Xl(s);case zi:case Vi:return new h(+s);case Yr:return Ub(s,c);case rl:case il:case sl:case ol:case al:case ll:case ul:case cl:case fl:return id(s,c);case Ut:return new h;case Wi:case qi:return new h(s);case Ui:return qb(s);case qt:return new h;case Ws:return Kb(s)}}function l_(s,a){var c=a.length;if(!c)return s;var h=c-1;return a[h]=(c>1?"& ":"")+a[h],a=a.join(c>2?", ":" "),s.replace(cy,`{
|
|
41
|
+
/* [wrapped with `+a+`] */
|
|
42
|
+
`)}function u_(s){return ne(s)||Sr(s)||!!(Ah&&s&&s[Ah])}function An(s,a){var c=typeof s;return a=a??Ze,!!a&&(c=="number"||c!="symbol"&&wy.test(s))&&s>-1&&s%1==0&&s<a}function ot(s,a,c){if(!Ae(c))return!1;var h=typeof a;return(h=="number"?dt(c)&&An(a,c.length):h=="string"&&a in c)?jt(c[a],s):!1}function su(s,a){if(ne(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||wt(s)?!0:oy.test(s)||!sy.test(s)||a!=null&&s in ve(a)}function c_(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function ou(s){var a=So(s),c=v[a];if(typeof c!="function"||!(a in ue.prototype))return!1;if(s===c)return!0;var h=nu(c);return!!h&&s===h[0]}function f_(s){return!!xh&&xh in s}var h_=Xs?On:xu;function as(s){var a=s&&s.constructor,c=typeof a=="function"&&a.prototype||ni;return s===c}function xd(s){return s===s&&!Ae(s)}function Ed(s,a){return function(c){return c==null?!1:c[s]===a&&(a!==t||s in ve(c))}}function d_(s){var a=Oo(s,function(h){return c.size===d&&c.clear(),h}),c=a.cache;return a}function p_(s,a){var c=s[1],h=a[1],y=c|h,w=y<(b|x|U),E=h==U&&c==O||h==U&&c==Q&&s[7].length<=a[8]||h==(U|Q)&&a[7].length<=a[8]&&c==O;if(!(w||E))return s;h&b&&(s[2]=a[2],y|=c&b?0:A);var C=a[3];if(C){var M=s[3];s[3]=M?od(M,C,a[4]):C,s[4]=M?zn(s[3],g):a[4]}return C=a[5],C&&(M=s[5],s[5]=M?ad(M,C,a[6]):C,s[6]=M?zn(s[5],g):a[6]),C=a[7],C&&(s[7]=C),h&U&&(s[8]=s[8]==null?a[8]:Qe(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=y,s}function m_(s){var a=[];if(s!=null)for(var c in ve(s))a.push(c);return a}function g_(s){return Qs.call(s)}function kd(s,a,c){return a=Be(a===t?s.length-1:a,0),function(){for(var h=arguments,y=-1,w=Be(h.length-a,0),E=I(w);++y<w;)E[y]=h[a+y];y=-1;for(var C=I(a+1);++y<a;)C[y]=h[y];return C[a]=c(E),bt(s,this,C)}}function Cd(s,a){return a.length<2?s:_r(s,Lt(a,0,-1))}function y_(s,a){for(var c=s.length,h=Qe(a.length,c),y=ht(s);h--;){var w=a[h];s[h]=An(w,c)?y[w]:t}return s}function au(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Ad=Td(Yh),ls=N1||function(s,a){return qe.setTimeout(s,a)},lu=Td($b);function Od(s,a,c){var h=a+"";return lu(s,l_(h,b_(s_(h),c)))}function Td(s){var a=0,c=0;return function(){var h=D1(),y=qr-(h-c);if(c=h,y>0){if(++a>=_n)return arguments[0]}else a=0;return s.apply(t,arguments)}}function Eo(s,a){var c=-1,h=s.length,y=h-1;for(a=a===t?h:a;++c<a;){var w=Ul(c,y),E=s[w];s[w]=s[c],s[c]=E}return s.length=a,s}var Md=d_(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ay,function(c,h,y,w){a.push(y?w.replace(my,"$1"):h||c)}),a});function ln(s){if(typeof s=="string"||wt(s))return s;var a=s+"";return a=="0"&&1/s==-rt?"-0":a}function wr(s){if(s!=null){try{return Zs.call(s)}catch{}try{return s+""}catch{}}return""}function b_(s,a){return Mt(q0,function(c){var h="_."+c[0];a&c[1]&&!Gs(s,h)&&s.push(h)}),s.sort()}function Id(s){if(s instanceof ue)return s.clone();var a=new Nt(s.__wrapped__,s.__chain__);return a.__actions__=ht(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function __(s,a,c){(c?ot(s,a,c):a===t)?a=1:a=Be(re(a),0);var h=s==null?0:s.length;if(!h||a<1)return[];for(var y=0,w=0,E=I(so(h/a));y<h;)E[w++]=Lt(s,y,y+=a);return E}function v_(s){for(var a=-1,c=s==null?0:s.length,h=0,y=[];++a<c;){var w=s[a];w&&(y[h++]=w)}return y}function w_(){var s=arguments.length;if(!s)return[];for(var a=I(s-1),c=arguments[0],h=s;h--;)a[h-1]=arguments[h];return $n(ne(c)?ht(c):[c],Ke(a,1))}var S_=oe(function(s,a){return Ie(s)?ts(s,Ke(a,1,Ie,!0)):[]}),x_=oe(function(s,a){var c=Pt(a);return Ie(c)&&(c=t),Ie(s)?ts(s,Ke(a,1,Ie,!0),Y(c,2)):[]}),E_=oe(function(s,a){var c=Pt(a);return Ie(c)&&(c=t),Ie(s)?ts(s,Ke(a,1,Ie,!0),t,c):[]});function k_(s,a,c){var h=s==null?0:s.length;return h?(a=c||a===t?1:re(a),Lt(s,a<0?0:a,h)):[]}function C_(s,a,c){var h=s==null?0:s.length;return h?(a=c||a===t?1:re(a),a=h-a,Lt(s,0,a<0?0:a)):[]}function A_(s,a){return s&&s.length?go(s,Y(a,3),!0,!0):[]}function O_(s,a){return s&&s.length?go(s,Y(a,3),!0):[]}function T_(s,a,c,h){var y=s==null?0:s.length;return y?(c&&typeof c!="number"&&ot(s,a,c)&&(c=0,h=y),wb(s,a,c,h)):[]}function Nd(s,a,c){var h=s==null?0:s.length;if(!h)return-1;var y=c==null?0:re(c);return y<0&&(y=Be(h+y,0)),js(s,Y(a,3),y)}function Rd(s,a,c){var h=s==null?0:s.length;if(!h)return-1;var y=h-1;return c!==t&&(y=re(c),y=c<0?Be(h+y,0):Qe(y,h-1)),js(s,Y(a,3),y,!0)}function Ld(s){var a=s==null?0:s.length;return a?Ke(s,1):[]}function M_(s){var a=s==null?0:s.length;return a?Ke(s,rt):[]}function I_(s,a){var c=s==null?0:s.length;return c?(a=a===t?1:re(a),Ke(s,a)):[]}function N_(s){for(var a=-1,c=s==null?0:s.length,h={};++a<c;){var y=s[a];h[y[0]]=y[1]}return h}function Pd(s){return s&&s.length?s[0]:t}function R_(s,a,c){var h=s==null?0:s.length;if(!h)return-1;var y=c==null?0:re(c);return y<0&&(y=Be(h+y,0)),Zr(s,a,y)}function L_(s){var a=s==null?0:s.length;return a?Lt(s,0,-1):[]}var P_=oe(function(s){var a=ke(s,Jl);return a.length&&a[0]===s[0]?Hl(a):[]}),D_=oe(function(s){var a=Pt(s),c=ke(s,Jl);return a===Pt(c)?a=t:c.pop(),c.length&&c[0]===s[0]?Hl(c,Y(a,2)):[]}),F_=oe(function(s){var a=Pt(s),c=ke(s,Jl);return a=typeof a=="function"?a:t,a&&c.pop(),c.length&&c[0]===s[0]?Hl(c,t,a):[]});function B_(s,a){return s==null?"":L1.call(s,a)}function Pt(s){var a=s==null?0:s.length;return a?s[a-1]:t}function H_(s,a,c){var h=s==null?0:s.length;if(!h)return-1;var y=h;return c!==t&&(y=re(c),y=y<0?Be(h+y,0):Qe(y,h-1)),a===a?b1(s,a,y):js(s,mh,y,!0)}function $_(s,a){return s&&s.length?Kh(s,re(a)):t}var z_=oe(Dd);function Dd(s,a){return s&&s.length&&a&&a.length?Wl(s,a):s}function V_(s,a,c){return s&&s.length&&a&&a.length?Wl(s,a,Y(c,2)):s}function W_(s,a,c){return s&&s.length&&a&&a.length?Wl(s,a,t,c):s}var U_=Cn(function(s,a){var c=s==null?0:s.length,h=Pl(s,a);return Jh(s,ke(a,function(y){return An(y,c)?+y:y}).sort(sd)),h});function q_(s,a){var c=[];if(!(s&&s.length))return c;var h=-1,y=[],w=s.length;for(a=Y(a,3);++h<w;){var E=s[h];a(E,h,s)&&(c.push(E),y.push(h))}return Jh(s,y),c}function uu(s){return s==null?s:B1.call(s)}function K_(s,a,c){var h=s==null?0:s.length;return h?(c&&typeof c!="number"&&ot(s,a,c)?(a=0,c=h):(a=a==null?0:re(a),c=c===t?h:re(c)),Lt(s,a,c)):[]}function G_(s,a){return mo(s,a)}function j_(s,a,c){return Kl(s,a,Y(c,2))}function J_(s,a){var c=s==null?0:s.length;if(c){var h=mo(s,a);if(h<c&&jt(s[h],a))return h}return-1}function Y_(s,a){return mo(s,a,!0)}function X_(s,a,c){return Kl(s,a,Y(c,2),!0)}function Z_(s,a){var c=s==null?0:s.length;if(c){var h=mo(s,a,!0)-1;if(jt(s[h],a))return h}return-1}function Q_(s){return s&&s.length?Xh(s):[]}function ev(s,a){return s&&s.length?Xh(s,Y(a,2)):[]}function tv(s){var a=s==null?0:s.length;return a?Lt(s,1,a):[]}function nv(s,a,c){return s&&s.length?(a=c||a===t?1:re(a),Lt(s,0,a<0?0:a)):[]}function rv(s,a,c){var h=s==null?0:s.length;return h?(a=c||a===t?1:re(a),a=h-a,Lt(s,a<0?0:a,h)):[]}function iv(s,a){return s&&s.length?go(s,Y(a,3),!1,!0):[]}function sv(s,a){return s&&s.length?go(s,Y(a,3)):[]}var ov=oe(function(s){return Un(Ke(s,1,Ie,!0))}),av=oe(function(s){var a=Pt(s);return Ie(a)&&(a=t),Un(Ke(s,1,Ie,!0),Y(a,2))}),lv=oe(function(s){var a=Pt(s);return a=typeof a=="function"?a:t,Un(Ke(s,1,Ie,!0),t,a)});function uv(s){return s&&s.length?Un(s):[]}function cv(s,a){return s&&s.length?Un(s,Y(a,2)):[]}function fv(s,a){return a=typeof a=="function"?a:t,s&&s.length?Un(s,t,a):[]}function cu(s){if(!(s&&s.length))return[];var a=0;return s=Hn(s,function(c){if(Ie(c))return a=Be(c.length,a),!0}),Al(a,function(c){return ke(s,El(c))})}function Fd(s,a){if(!(s&&s.length))return[];var c=cu(s);return a==null?c:ke(c,function(h){return bt(a,t,h)})}var hv=oe(function(s,a){return Ie(s)?ts(s,a):[]}),dv=oe(function(s){return jl(Hn(s,Ie))}),pv=oe(function(s){var a=Pt(s);return Ie(a)&&(a=t),jl(Hn(s,Ie),Y(a,2))}),mv=oe(function(s){var a=Pt(s);return a=typeof a=="function"?a:t,jl(Hn(s,Ie),t,a)}),gv=oe(cu);function yv(s,a){return td(s||[],a||[],es)}function bv(s,a){return td(s||[],a||[],is)}var _v=oe(function(s){var a=s.length,c=a>1?s[a-1]:t;return c=typeof c=="function"?(s.pop(),c):t,Fd(s,c)});function Bd(s){var a=v(s);return a.__chain__=!0,a}function vv(s,a){return a(s),s}function ko(s,a){return a(s)}var wv=Cn(function(s){var a=s.length,c=a?s[0]:0,h=this.__wrapped__,y=function(w){return Pl(w,s)};return a>1||this.__actions__.length||!(h instanceof ue)||!An(c)?this.thru(y):(h=h.slice(c,+c+(a?1:0)),h.__actions__.push({func:ko,args:[y],thisArg:t}),new Nt(h,this.__chain__).thru(function(w){return a&&!w.length&&w.push(t),w}))});function Sv(){return Bd(this)}function xv(){return new Nt(this.value(),this.__chain__)}function Ev(){this.__values__===t&&(this.__values__=Zd(this.value()));var s=this.__index__>=this.__values__.length,a=s?t:this.__values__[this.__index__++];return{done:s,value:a}}function kv(){return this}function Cv(s){for(var a,c=this;c instanceof uo;){var h=Id(c);h.__index__=0,h.__values__=t,a?y.__wrapped__=h:a=h;var y=h;c=c.__wrapped__}return y.__wrapped__=s,a}function Av(){var s=this.__wrapped__;if(s instanceof ue){var a=s;return this.__actions__.length&&(a=new ue(this)),a=a.reverse(),a.__actions__.push({func:ko,args:[uu],thisArg:t}),new Nt(a,this.__chain__)}return this.thru(uu)}function Ov(){return ed(this.__wrapped__,this.__actions__)}var Tv=yo(function(s,a,c){_e.call(s,c)?++s[c]:En(s,c,1)});function Mv(s,a,c){var h=ne(s)?dh:vb;return c&&ot(s,a,c)&&(a=t),h(s,Y(a,3))}function Iv(s,a){var c=ne(s)?Hn:Fh;return c(s,Y(a,3))}var Nv=fd(Nd),Rv=fd(Rd);function Lv(s,a){return Ke(Co(s,a),1)}function Pv(s,a){return Ke(Co(s,a),rt)}function Dv(s,a,c){return c=c===t?1:re(c),Ke(Co(s,a),c)}function Hd(s,a){var c=ne(s)?Mt:Wn;return c(s,Y(a,3))}function $d(s,a){var c=ne(s)?t1:Dh;return c(s,Y(a,3))}var Fv=yo(function(s,a,c){_e.call(s,c)?s[c].push(a):En(s,c,[a])});function Bv(s,a,c,h){s=dt(s)?s:ci(s),c=c&&!h?re(c):0;var y=s.length;return c<0&&(c=Be(y+c,0)),Io(s)?c<=y&&s.indexOf(a,c)>-1:!!y&&Zr(s,a,c)>-1}var Hv=oe(function(s,a,c){var h=-1,y=typeof a=="function",w=dt(s)?I(s.length):[];return Wn(s,function(E){w[++h]=y?bt(a,E,c):ns(E,a,c)}),w}),$v=yo(function(s,a,c){En(s,c,a)});function Co(s,a){var c=ne(s)?ke:Wh;return c(s,Y(a,3))}function zv(s,a,c,h){return s==null?[]:(ne(a)||(a=a==null?[]:[a]),c=h?t:c,ne(c)||(c=c==null?[]:[c]),Gh(s,a,c))}var Vv=yo(function(s,a,c){s[c?0:1].push(a)},function(){return[[],[]]});function Wv(s,a,c){var h=ne(s)?Sl:yh,y=arguments.length<3;return h(s,Y(a,4),c,y,Wn)}function Uv(s,a,c){var h=ne(s)?n1:yh,y=arguments.length<3;return h(s,Y(a,4),c,y,Dh)}function qv(s,a){var c=ne(s)?Hn:Fh;return c(s,To(Y(a,3)))}function Kv(s){var a=ne(s)?Nh:Bb;return a(s)}function Gv(s,a,c){(c?ot(s,a,c):a===t)?a=1:a=re(a);var h=ne(s)?mb:Hb;return h(s,a)}function jv(s){var a=ne(s)?gb:zb;return a(s)}function Jv(s){if(s==null)return 0;if(dt(s))return Io(s)?ei(s):s.length;var a=et(s);return a==Ut||a==qt?s.size:zl(s).length}function Yv(s,a,c){var h=ne(s)?xl:Vb;return c&&ot(s,a,c)&&(a=t),h(s,Y(a,3))}var Xv=oe(function(s,a){if(s==null)return[];var c=a.length;return c>1&&ot(s,a[0],a[1])?a=[]:c>2&&ot(a[0],a[1],a[2])&&(a=[a[0]]),Gh(s,Ke(a,1),[])}),Ao=I1||function(){return qe.Date.now()};function Zv(s,a){if(typeof a!="function")throw new It(l);return s=re(s),function(){if(--s<1)return a.apply(this,arguments)}}function zd(s,a,c){return a=c?t:a,a=s&&a==null?s.length:a,kn(s,U,t,t,t,t,a)}function Vd(s,a){var c;if(typeof a!="function")throw new It(l);return s=re(s),function(){return--s>0&&(c=a.apply(this,arguments)),s<=1&&(a=t),c}}var fu=oe(function(s,a,c){var h=b;if(c.length){var y=zn(c,li(fu));h|=W}return kn(s,h,a,c,y)}),Wd=oe(function(s,a,c){var h=b|x;if(c.length){var y=zn(c,li(Wd));h|=W}return kn(a,h,s,c,y)});function Ud(s,a,c){a=c?t:a;var h=kn(s,O,t,t,t,t,t,a);return h.placeholder=Ud.placeholder,h}function qd(s,a,c){a=c?t:a;var h=kn(s,R,t,t,t,t,t,a);return h.placeholder=qd.placeholder,h}function Kd(s,a,c){var h,y,w,E,C,M,L=0,P=!1,F=!1,V=!0;if(typeof s!="function")throw new It(l);a=Dt(a)||0,Ae(c)&&(P=!!c.leading,F="maxWait"in c,w=F?Be(Dt(c.maxWait)||0,a):w,V="trailing"in c?!!c.trailing:V);function j(Ne){var Jt=h,Mn=y;return h=y=t,L=Ne,E=s.apply(Mn,Jt),E}function X(Ne){return L=Ne,C=ls(ae,a),P?j(Ne):E}function se(Ne){var Jt=Ne-M,Mn=Ne-L,fp=a-Jt;return F?Qe(fp,w-Mn):fp}function Z(Ne){var Jt=Ne-M,Mn=Ne-L;return M===t||Jt>=a||Jt<0||F&&Mn>=w}function ae(){var Ne=Ao();if(Z(Ne))return fe(Ne);C=ls(ae,se(Ne))}function fe(Ne){return C=t,V&&h?j(Ne):(h=y=t,E)}function St(){C!==t&&nd(C),L=0,h=M=y=C=t}function at(){return C===t?E:fe(Ao())}function xt(){var Ne=Ao(),Jt=Z(Ne);if(h=arguments,y=this,M=Ne,Jt){if(C===t)return X(M);if(F)return nd(C),C=ls(ae,a),j(M)}return C===t&&(C=ls(ae,a)),E}return xt.cancel=St,xt.flush=at,xt}var Qv=oe(function(s,a){return Ph(s,1,a)}),ew=oe(function(s,a,c){return Ph(s,Dt(a)||0,c)});function tw(s){return kn(s,we)}function Oo(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new It(l);var c=function(){var h=arguments,y=a?a.apply(this,h):h[0],w=c.cache;if(w.has(y))return w.get(y);var E=s.apply(this,h);return c.cache=w.set(y,E)||w,E};return c.cache=new(Oo.Cache||xn),c}Oo.Cache=xn;function To(s){if(typeof s!="function")throw new It(l);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function nw(s){return Vd(2,s)}var rw=Wb(function(s,a){a=a.length==1&&ne(a[0])?ke(a[0],_t(Y())):ke(Ke(a,1),_t(Y()));var c=a.length;return oe(function(h){for(var y=-1,w=Qe(h.length,c);++y<w;)h[y]=a[y].call(this,h[y]);return bt(s,this,h)})}),hu=oe(function(s,a){var c=zn(a,li(hu));return kn(s,W,t,a,c)}),Gd=oe(function(s,a){var c=zn(a,li(Gd));return kn(s,D,t,a,c)}),iw=Cn(function(s,a){return kn(s,Q,t,t,t,a)});function sw(s,a){if(typeof s!="function")throw new It(l);return a=a===t?a:re(a),oe(s,a)}function ow(s,a){if(typeof s!="function")throw new It(l);return a=a==null?0:Be(re(a),0),oe(function(c){var h=c[a],y=Kn(c,0,a);return h&&$n(y,h),bt(s,this,y)})}function aw(s,a,c){var h=!0,y=!0;if(typeof s!="function")throw new It(l);return Ae(c)&&(h="leading"in c?!!c.leading:h,y="trailing"in c?!!c.trailing:y),Kd(s,a,{leading:h,maxWait:a,trailing:y})}function lw(s){return zd(s,1)}function uw(s,a){return hu(Yl(a),s)}function cw(){if(!arguments.length)return[];var s=arguments[0];return ne(s)?s:[s]}function fw(s){return Rt(s,S)}function hw(s,a){return a=typeof a=="function"?a:t,Rt(s,S,a)}function dw(s){return Rt(s,p|S)}function pw(s,a){return a=typeof a=="function"?a:t,Rt(s,p|S,a)}function mw(s,a){return a==null||Lh(s,a,He(a))}function jt(s,a){return s===a||s!==s&&a!==a}var gw=wo(Bl),yw=wo(function(s,a){return s>=a}),Sr=$h(function(){return arguments}())?$h:function(s){return Me(s)&&_e.call(s,"callee")&&!Ch.call(s,"callee")},ne=I.isArray,bw=ah?_t(ah):Cb;function dt(s){return s!=null&&Mo(s.length)&&!On(s)}function Ie(s){return Me(s)&&dt(s)}function _w(s){return s===!0||s===!1||Me(s)&&st(s)==zi}var Gn=R1||xu,vw=lh?_t(lh):Ab;function ww(s){return Me(s)&&s.nodeType===1&&!us(s)}function Sw(s){if(s==null)return!0;if(dt(s)&&(ne(s)||typeof s=="string"||typeof s.splice=="function"||Gn(s)||ui(s)||Sr(s)))return!s.length;var a=et(s);if(a==Ut||a==qt)return!s.size;if(as(s))return!zl(s).length;for(var c in s)if(_e.call(s,c))return!1;return!0}function xw(s,a){return rs(s,a)}function Ew(s,a,c){c=typeof c=="function"?c:t;var h=c?c(s,a):t;return h===t?rs(s,a,t,c):!!h}function du(s){if(!Me(s))return!1;var a=st(s);return a==zs||a==G0||typeof s.message=="string"&&typeof s.name=="string"&&!us(s)}function kw(s){return typeof s=="number"&&Oh(s)}function On(s){if(!Ae(s))return!1;var a=st(s);return a==Vs||a==Pf||a==K0||a==J0}function jd(s){return typeof s=="number"&&s==re(s)}function Mo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Ze}function Ae(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Me(s){return s!=null&&typeof s=="object"}var Jd=uh?_t(uh):Tb;function Cw(s,a){return s===a||$l(s,a,ru(a))}function Aw(s,a,c){return c=typeof c=="function"?c:t,$l(s,a,ru(a),c)}function Ow(s){return Yd(s)&&s!=+s}function Tw(s){if(h_(s))throw new te(o);return zh(s)}function Mw(s){return s===null}function Iw(s){return s==null}function Yd(s){return typeof s=="number"||Me(s)&&st(s)==Wi}function us(s){if(!Me(s)||st(s)!=wn)return!1;var a=no(s);if(a===null)return!0;var c=_e.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&Zs.call(c)==A1}var pu=ch?_t(ch):Mb;function Nw(s){return jd(s)&&s>=-Ze&&s<=Ze}var Xd=fh?_t(fh):Ib;function Io(s){return typeof s=="string"||!ne(s)&&Me(s)&&st(s)==qi}function wt(s){return typeof s=="symbol"||Me(s)&&st(s)==Ws}var ui=hh?_t(hh):Nb;function Rw(s){return s===t}function Lw(s){return Me(s)&&et(s)==Ki}function Pw(s){return Me(s)&&st(s)==X0}var Dw=wo(Vl),Fw=wo(function(s,a){return s<=a});function Zd(s){if(!s)return[];if(dt(s))return Io(s)?Kt(s):ht(s);if(Ji&&s[Ji])return m1(s[Ji]());var a=et(s),c=a==Ut?Tl:a==qt?Js:ci;return c(s)}function Tn(s){if(!s)return s===0?s:0;if(s=Dt(s),s===rt||s===-rt){var a=s<0?-1:1;return a*vn}return s===s?s:0}function re(s){var a=Tn(s),c=a%1;return a===a?c?a-c:a:0}function Qd(s){return s?br(re(s),0,it):0}function Dt(s){if(typeof s=="number")return s;if(wt(s))return sn;if(Ae(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=Ae(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=bh(s);var c=by.test(s);return c||vy.test(s)?Zy(s.slice(2),c?2:8):yy.test(s)?sn:+s}function ep(s){return an(s,pt(s))}function Bw(s){return s?br(re(s),-Ze,Ze):s===0?s:0}function ye(s){return s==null?"":vt(s)}var Hw=oi(function(s,a){if(as(a)||dt(a)){an(a,He(a),s);return}for(var c in a)_e.call(a,c)&&es(s,c,a[c])}),tp=oi(function(s,a){an(a,pt(a),s)}),No=oi(function(s,a,c,h){an(a,pt(a),s,h)}),$w=oi(function(s,a,c,h){an(a,He(a),s,h)}),zw=Cn(Pl);function Vw(s,a){var c=si(s);return a==null?c:Rh(c,a)}var Ww=oe(function(s,a){s=ve(s);var c=-1,h=a.length,y=h>2?a[2]:t;for(y&&ot(a[0],a[1],y)&&(h=1);++c<h;)for(var w=a[c],E=pt(w),C=-1,M=E.length;++C<M;){var L=E[C],P=s[L];(P===t||jt(P,ni[L])&&!_e.call(s,L))&&(s[L]=w[L])}return s}),Uw=oe(function(s){return s.push(t,bd),bt(np,t,s)});function qw(s,a){return ph(s,Y(a,3),on)}function Kw(s,a){return ph(s,Y(a,3),Fl)}function Gw(s,a){return s==null?s:Dl(s,Y(a,3),pt)}function jw(s,a){return s==null?s:Bh(s,Y(a,3),pt)}function Jw(s,a){return s&&on(s,Y(a,3))}function Yw(s,a){return s&&Fl(s,Y(a,3))}function Xw(s){return s==null?[]:ho(s,He(s))}function Zw(s){return s==null?[]:ho(s,pt(s))}function mu(s,a,c){var h=s==null?t:_r(s,a);return h===t?c:h}function Qw(s,a){return s!=null&&wd(s,a,Sb)}function gu(s,a){return s!=null&&wd(s,a,xb)}var eS=dd(function(s,a,c){a!=null&&typeof a.toString!="function"&&(a=Qs.call(a)),s[a]=c},bu(mt)),tS=dd(function(s,a,c){a!=null&&typeof a.toString!="function"&&(a=Qs.call(a)),_e.call(s,a)?s[a].push(c):s[a]=[c]},Y),nS=oe(ns);function He(s){return dt(s)?Ih(s):zl(s)}function pt(s){return dt(s)?Ih(s,!0):Rb(s)}function rS(s,a){var c={};return a=Y(a,3),on(s,function(h,y,w){En(c,a(h,y,w),h)}),c}function iS(s,a){var c={};return a=Y(a,3),on(s,function(h,y,w){En(c,y,a(h,y,w))}),c}var sS=oi(function(s,a,c){po(s,a,c)}),np=oi(function(s,a,c,h){po(s,a,c,h)}),oS=Cn(function(s,a){var c={};if(s==null)return c;var h=!1;a=ke(a,function(w){return w=qn(w,s),h||(h=w.length>1),w}),an(s,tu(s),c),h&&(c=Rt(c,p|_|S,e_));for(var y=a.length;y--;)Gl(c,a[y]);return c});function aS(s,a){return rp(s,To(Y(a)))}var lS=Cn(function(s,a){return s==null?{}:Pb(s,a)});function rp(s,a){if(s==null)return{};var c=ke(tu(s),function(h){return[h]});return a=Y(a),jh(s,c,function(h,y){return a(h,y[0])})}function uS(s,a,c){a=qn(a,s);var h=-1,y=a.length;for(y||(y=1,s=t);++h<y;){var w=s==null?t:s[ln(a[h])];w===t&&(h=y,w=c),s=On(w)?w.call(s):w}return s}function cS(s,a,c){return s==null?s:is(s,a,c)}function fS(s,a,c,h){return h=typeof h=="function"?h:t,s==null?s:is(s,a,c,h)}var ip=gd(He),sp=gd(pt);function hS(s,a,c){var h=ne(s),y=h||Gn(s)||ui(s);if(a=Y(a,4),c==null){var w=s&&s.constructor;y?c=h?new w:[]:Ae(s)?c=On(w)?si(no(s)):{}:c={}}return(y?Mt:on)(s,function(E,C,M){return a(c,E,C,M)}),c}function dS(s,a){return s==null?!0:Gl(s,a)}function pS(s,a,c){return s==null?s:Qh(s,a,Yl(c))}function mS(s,a,c,h){return h=typeof h=="function"?h:t,s==null?s:Qh(s,a,Yl(c),h)}function ci(s){return s==null?[]:Ol(s,He(s))}function gS(s){return s==null?[]:Ol(s,pt(s))}function yS(s,a,c){return c===t&&(c=a,a=t),c!==t&&(c=Dt(c),c=c===c?c:0),a!==t&&(a=Dt(a),a=a===a?a:0),br(Dt(s),a,c)}function bS(s,a,c){return a=Tn(a),c===t?(c=a,a=0):c=Tn(c),s=Dt(s),Eb(s,a,c)}function _S(s,a,c){if(c&&typeof c!="boolean"&&ot(s,a,c)&&(a=c=t),c===t&&(typeof a=="boolean"?(c=a,a=t):typeof s=="boolean"&&(c=s,s=t)),s===t&&a===t?(s=0,a=1):(s=Tn(s),a===t?(a=s,s=0):a=Tn(a)),s>a){var h=s;s=a,a=h}if(c||s%1||a%1){var y=Th();return Qe(s+y*(a-s+Xy("1e-"+((y+"").length-1))),a)}return Ul(s,a)}var vS=ai(function(s,a,c){return a=a.toLowerCase(),s+(c?op(a):a)});function op(s){return yu(ye(s).toLowerCase())}function ap(s){return s=ye(s),s&&s.replace(Sy,c1).replace(zy,"")}function wS(s,a,c){s=ye(s),a=vt(a);var h=s.length;c=c===t?h:br(re(c),0,h);var y=c;return c-=a.length,c>=0&&s.slice(c,y)==a}function SS(s){return s=ye(s),s&&ny.test(s)?s.replace(Bf,f1):s}function xS(s){return s=ye(s),s&&ly.test(s)?s.replace(hl,"\\$&"):s}var ES=ai(function(s,a,c){return s+(c?"-":"")+a.toLowerCase()}),kS=ai(function(s,a,c){return s+(c?" ":"")+a.toLowerCase()}),CS=cd("toLowerCase");function AS(s,a,c){s=ye(s),a=re(a);var h=a?ei(s):0;if(!a||h>=a)return s;var y=(a-h)/2;return vo(oo(y),c)+s+vo(so(y),c)}function OS(s,a,c){s=ye(s),a=re(a);var h=a?ei(s):0;return a&&h<a?s+vo(a-h,c):s}function TS(s,a,c){s=ye(s),a=re(a);var h=a?ei(s):0;return a&&h<a?vo(a-h,c)+s:s}function MS(s,a,c){return c||a==null?a=0:a&&(a=+a),F1(ye(s).replace(dl,""),a||0)}function IS(s,a,c){return(c?ot(s,a,c):a===t)?a=1:a=re(a),ql(ye(s),a)}function NS(){var s=arguments,a=ye(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var RS=ai(function(s,a,c){return s+(c?"_":"")+a.toLowerCase()});function LS(s,a,c){return c&&typeof c!="number"&&ot(s,a,c)&&(a=c=t),c=c===t?it:c>>>0,c?(s=ye(s),s&&(typeof a=="string"||a!=null&&!pu(a))&&(a=vt(a),!a&&Qr(s))?Kn(Kt(s),0,c):s.split(a,c)):[]}var PS=ai(function(s,a,c){return s+(c?" ":"")+yu(a)});function DS(s,a,c){return s=ye(s),c=c==null?0:br(re(c),0,s.length),a=vt(a),s.slice(c,c+a.length)==a}function FS(s,a,c){var h=v.templateSettings;c&&ot(s,a,c)&&(a=t),s=ye(s),a=No({},a,h,yd);var y=No({},a.imports,h.imports,yd),w=He(y),E=Ol(y,w),C,M,L=0,P=a.interpolate||Us,F="__p += '",V=Ml((a.escape||Us).source+"|"+P.source+"|"+(P===Hf?gy:Us).source+"|"+(a.evaluate||Us).source+"|$","g"),j="//# sourceURL="+(_e.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ky+"]")+`
|
|
43
|
+
`;s.replace(V,function(Z,ae,fe,St,at,xt){return fe||(fe=St),F+=s.slice(L,xt).replace(xy,h1),ae&&(C=!0,F+=`' +
|
|
44
|
+
__e(`+ae+`) +
|
|
45
|
+
'`),at&&(M=!0,F+=`';
|
|
46
|
+
`+at+`;
|
|
47
|
+
__p += '`),fe&&(F+=`' +
|
|
48
|
+
((__t = (`+fe+`)) == null ? '' : __t) +
|
|
49
|
+
'`),L=xt+Z.length,Z}),F+=`';
|
|
50
|
+
`;var X=_e.call(a,"variable")&&a.variable;if(!X)F=`with (obj) {
|
|
51
|
+
`+F+`
|
|
54
52
|
}
|
|
55
|
-
`;else if(
|
|
56
|
-
`+(
|
|
57
|
-
`)+"var __t, __p = ''"+(
|
|
53
|
+
`;else if(py.test(X))throw new te(u);F=(M?F.replace(Z0,""):F).replace(Q0,"$1").replace(ey,"$1;"),F="function("+(X||"obj")+`) {
|
|
54
|
+
`+(X?"":`obj || (obj = {});
|
|
55
|
+
`)+"var __t, __p = ''"+(C?", __e = _.escape":"")+(M?`, __j = Array.prototype.join;
|
|
58
56
|
function print() { __p += __j.call(arguments, '') }
|
|
59
57
|
`:`;
|
|
60
|
-
`)+
|
|
61
|
-
}`;var te=sp(function(){return me(_,W+"return "+R).apply(t,w)});if(te.source=R,au(te))throw te;return te}function zS(s){return ge(s).toLowerCase()}function VS(s){return ge(s).toUpperCase()}function WS(s,l,c){if(s=ge(s),s&&(c||l===t))return ph(s);if(!s||!(l=yt(l)))return s;var h=Ht(s),g=Ht(l),_=mh(h,g),w=gh(h,g)+1;return Fn(h,_,w).join("")}function US(s,l,c){if(s=ge(s),s&&(c||l===t))return s.slice(0,bh(s)+1);if(!s||!(l=yt(l)))return s;var h=Ht(s),g=gh(h,Ht(l))+1;return Fn(h,0,g).join("")}function KS(s,l,c){if(s=ge(s),s&&(c||l===t))return s.replace(aa,"");if(!s||!(l=yt(l)))return s;var h=Ht(s),g=mh(h,Ht(l));return Fn(h,g).join("")}function qS(s,l){var c=Xl,h=Hi;if(Ee(l)){var g="separator"in l?l.separator:g;c="length"in l?Q(l.length):c,h="omission"in l?yt(l.omission):h}s=ge(s);var _=s.length;if(Zr(s)){var w=Ht(s);_=w.length}if(c>=_)return s;var x=c-Qr(h);if(x<1)return h;var k=w?Fn(w,0,x).join(""):s.slice(0,x);if(g===t)return k+h;if(w&&(x+=k.length-x),uu(g)){if(s.slice(x).search(g)){var M,I=k;for(g.global||(g=ka(g.source,ge(Df.exec(g))+"g")),g.lastIndex=0;M=g.exec(I);)var R=M.index;k=k.slice(0,R===t?x:R)}}else if(s.indexOf(yt(g),x)!=x){var B=k.lastIndexOf(g);B>-1&&(k=k.slice(0,B))}return k+h}function GS(s){return s=ge(s),s&&iy.test(s)?s.replace(Rf,S1):s}var jS=oi(function(s,l,c){return s+(c?" ":"")+l.toUpperCase()}),hu=od("toUpperCase");function ip(s,l,c){return s=ge(s),l=c?t:l,l===t?y1(s)?k1(s):a1(s):s.match(l)||[]}var sp=ne(function(s,l){try{return mt(s,t,l)}catch(c){return au(c)?c:new X(c)}}),JS=vn(function(s,l){return kt(l,function(c){c=tn(c),bn(s,c,ou(s[c],s))}),s});function YS(s){var l=s==null?0:s.length,c=G();return s=l?Se(s,function(h){if(typeof h[1]!="function")throw new Ct(a);return[c(h[0]),h[1]]}):[],ne(function(h){for(var g=-1;++g<l;){var _=s[g];if(mt(_[0],this,h))return mt(_[1],this,h)}})}function XS(s){return Sb(Ot(s,m))}function du(s){return function(){return s}}function ZS(s,l){return s==null||s!==s?l:s}var QS=ad(),ex=ad(!0);function ht(s){return s}function pu(s){return $h(typeof s=="function"?s:Ot(s,m))}function tx(s){return Hh(Ot(s,m))}function nx(s,l){return zh(s,Ot(l,m))}var rx=ne(function(s,l){return function(c){return ns(c,s,l)}}),ix=ne(function(s,l){return function(c){return ns(s,c,l)}});function mu(s,l,c){var h=Fe(l),g=co(l,h);c==null&&!(Ee(l)&&(g.length||!h.length))&&(c=l,l=s,s=this,g=co(l,Fe(l)));var _=!(Ee(c)&&"chain"in c)||!!c.chain,w=Sn(s);return kt(g,function(x){var k=l[x];s[x]=k,w&&(s.prototype[x]=function(){var M=this.__chain__;if(_||M){var I=s(this.__wrapped__),R=I.__actions__=ut(this.__actions__);return R.push({func:k,args:arguments,thisArg:s}),I.__chain__=M,I}return k.apply(s,In([this.value()],arguments))})}),s}function sx(){return Ve._===this&&(Ve._=I1),this}function gu(){}function ox(s){return s=Q(s),ne(function(l){return Vh(l,s)})}var lx=Ga(Se),ax=Ga(uh),ux=Ga(ba);function op(s){return eu(s)?_a(tn(s)):Bb(s)}function cx(s){return function(l){return s==null?t:mr(s,l)}}var fx=cd(),hx=cd(!0);function yu(){return[]}function bu(){return!1}function dx(){return{}}function px(){return""}function mx(){return!0}function gx(s,l){if(s=Q(s),s<1||s>je)return[];var c=et,h=Je(s,et);l=G(l),s-=et;for(var g=Sa(h,l);++c<s;)l(c);return g}function yx(s){return Z(s)?Se(s,tn):bt(s)?[s]:ut(Cd(ge(s)))}function bx(s){var l=++T1;return ge(s)+l}var _x=yo(function(s,l){return s+l},0),vx=ja("ceil"),wx=yo(function(s,l){return s/l},1),Sx=ja("floor");function xx(s){return s&&s.length?uo(s,ht,Ra):t}function Ex(s,l){return s&&s.length?uo(s,G(l,2),Ra):t}function kx(s){return hh(s,ht)}function Cx(s,l){return hh(s,G(l,2))}function Ax(s){return s&&s.length?uo(s,ht,Fa):t}function Ox(s,l){return s&&s.length?uo(s,G(l,2),Fa):t}var Tx=yo(function(s,l){return s*l},1),Mx=ja("round"),Ix=yo(function(s,l){return s-l},0);function Nx(s){return s&&s.length?wa(s,ht):0}function Rx(s,l){return s&&s.length?wa(s,G(l,2)):0}return b.after=tw,b.ary=Fd,b.assign=Vw,b.assignIn=Xd,b.assignInWith=Mo,b.assignWith=Ww,b.at=Uw,b.before=$d,b.bind=ou,b.bindAll=JS,b.bindKey=Bd,b.castArray=dw,b.chain=Ld,b.chunk=S_,b.compact=x_,b.concat=E_,b.cond=YS,b.conforms=XS,b.constant=du,b.countBy=Nv,b.create=Kw,b.curry=Hd,b.curryRight=zd,b.debounce=Vd,b.defaults=qw,b.defaultsDeep=Gw,b.defer=nw,b.delay=rw,b.difference=k_,b.differenceBy=C_,b.differenceWith=A_,b.drop=O_,b.dropRight=T_,b.dropRightWhile=M_,b.dropWhile=I_,b.fill=N_,b.filter=Lv,b.flatMap=Fv,b.flatMapDeep=$v,b.flatMapDepth=Bv,b.flatten=Md,b.flattenDeep=R_,b.flattenDepth=L_,b.flip=iw,b.flow=QS,b.flowRight=ex,b.fromPairs=P_,b.functions=eS,b.functionsIn=tS,b.groupBy=Hv,b.initial=F_,b.intersection=$_,b.intersectionBy=B_,b.intersectionWith=H_,b.invert=rS,b.invertBy=iS,b.invokeMap=Vv,b.iteratee=pu,b.keyBy=Wv,b.keys=Fe,b.keysIn=ft,b.map=Eo,b.mapKeys=oS,b.mapValues=lS,b.matches=tx,b.matchesProperty=nx,b.memoize=Co,b.merge=aS,b.mergeWith=Zd,b.method=rx,b.methodOf=ix,b.mixin=mu,b.negate=Ao,b.nthArg=ox,b.omit=uS,b.omitBy=cS,b.once=sw,b.orderBy=Uv,b.over=lx,b.overArgs=ow,b.overEvery=ax,b.overSome=ux,b.partial=lu,b.partialRight=Wd,b.partition=Kv,b.pick=fS,b.pickBy=Qd,b.property=op,b.propertyOf=cx,b.pull=U_,b.pullAll=Nd,b.pullAllBy=K_,b.pullAllWith=q_,b.pullAt=G_,b.range=fx,b.rangeRight=hx,b.rearg=lw,b.reject=jv,b.remove=j_,b.rest=aw,b.reverse=iu,b.sampleSize=Yv,b.set=dS,b.setWith=pS,b.shuffle=Xv,b.slice=J_,b.sortBy=ew,b.sortedUniq=nv,b.sortedUniqBy=rv,b.split=FS,b.spread=uw,b.tail=iv,b.take=sv,b.takeRight=ov,b.takeRightWhile=lv,b.takeWhile=av,b.tap=xv,b.throttle=cw,b.thru=xo,b.toArray=jd,b.toPairs=ep,b.toPairsIn=tp,b.toPath=yx,b.toPlainObject=Yd,b.transform=mS,b.unary=fw,b.union=uv,b.unionBy=cv,b.unionWith=fv,b.uniq=hv,b.uniqBy=dv,b.uniqWith=pv,b.unset=gS,b.unzip=su,b.unzipWith=Rd,b.update=yS,b.updateWith=bS,b.values=ui,b.valuesIn=_S,b.without=mv,b.words=ip,b.wrap=hw,b.xor=gv,b.xorBy=yv,b.xorWith=bv,b.zip=_v,b.zipObject=vv,b.zipObjectDeep=wv,b.zipWith=Sv,b.entries=ep,b.entriesIn=tp,b.extend=Xd,b.extendWith=Mo,mu(b,b),b.add=_x,b.attempt=sp,b.camelCase=xS,b.capitalize=np,b.ceil=vx,b.clamp=vS,b.clone=pw,b.cloneDeep=gw,b.cloneDeepWith=yw,b.cloneWith=mw,b.conformsTo=bw,b.deburr=rp,b.defaultTo=ZS,b.divide=wx,b.endsWith=ES,b.eq=Vt,b.escape=kS,b.escapeRegExp=CS,b.every=Rv,b.find=Pv,b.findIndex=Od,b.findKey=jw,b.findLast=Dv,b.findLastIndex=Td,b.findLastKey=Jw,b.floor=Sx,b.forEach=Pd,b.forEachRight=Dd,b.forIn=Yw,b.forInRight=Xw,b.forOwn=Zw,b.forOwnRight=Qw,b.get=cu,b.gt=_w,b.gte=vw,b.has=nS,b.hasIn=fu,b.head=Id,b.identity=ht,b.includes=zv,b.indexOf=D_,b.inRange=wS,b.invoke=sS,b.isArguments=br,b.isArray=Z,b.isArrayBuffer=ww,b.isArrayLike=ct,b.isArrayLikeObject=Oe,b.isBoolean=Sw,b.isBuffer=$n,b.isDate=xw,b.isElement=Ew,b.isEmpty=kw,b.isEqual=Cw,b.isEqualWith=Aw,b.isError=au,b.isFinite=Ow,b.isFunction=Sn,b.isInteger=Ud,b.isLength=Oo,b.isMap=Kd,b.isMatch=Tw,b.isMatchWith=Mw,b.isNaN=Iw,b.isNative=Nw,b.isNil=Lw,b.isNull=Rw,b.isNumber=qd,b.isObject=Ee,b.isObjectLike=Ce,b.isPlainObject=us,b.isRegExp=uu,b.isSafeInteger=Pw,b.isSet=Gd,b.isString=To,b.isSymbol=bt,b.isTypedArray=ai,b.isUndefined=Dw,b.isWeakMap=Fw,b.isWeakSet=$w,b.join=z_,b.kebabCase=AS,b.last=Mt,b.lastIndexOf=V_,b.lowerCase=OS,b.lowerFirst=TS,b.lt=Bw,b.lte=Hw,b.max=xx,b.maxBy=Ex,b.mean=kx,b.meanBy=Cx,b.min=Ax,b.minBy=Ox,b.stubArray=yu,b.stubFalse=bu,b.stubObject=dx,b.stubString=px,b.stubTrue=mx,b.multiply=Tx,b.nth=W_,b.noConflict=sx,b.noop=gu,b.now=ko,b.pad=MS,b.padEnd=IS,b.padStart=NS,b.parseInt=RS,b.random=SS,b.reduce=qv,b.reduceRight=Gv,b.repeat=LS,b.replace=PS,b.result=hS,b.round=Mx,b.runInContext=E,b.sample=Jv,b.size=Zv,b.snakeCase=DS,b.some=Qv,b.sortedIndex=Y_,b.sortedIndexBy=X_,b.sortedIndexOf=Z_,b.sortedLastIndex=Q_,b.sortedLastIndexBy=ev,b.sortedLastIndexOf=tv,b.startCase=$S,b.startsWith=BS,b.subtract=Ix,b.sum=Nx,b.sumBy=Rx,b.template=HS,b.times=gx,b.toFinite=xn,b.toInteger=Q,b.toLength=Jd,b.toLower=zS,b.toNumber=It,b.toSafeInteger=zw,b.toString=ge,b.toUpper=VS,b.trim=WS,b.trimEnd=US,b.trimStart=KS,b.truncate=qS,b.unescape=GS,b.uniqueId=bx,b.upperCase=jS,b.upperFirst=hu,b.each=Pd,b.eachRight=Dd,b.first=Id,mu(b,function(){var s={};return Qt(b,function(l,c){ye.call(b.prototype,c)||(s[c]=l)}),s}(),{chain:!1}),b.VERSION=r,kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),kt(["drop","take"],function(s,l){le.prototype[s]=function(c){c=c===t?1:De(Q(c),0);var h=this.__filtered__&&!l?new le(this):this.clone();return h.__filtered__?h.__takeCount__=Je(c,h.__takeCount__):h.__views__.push({size:Je(c,et),type:s+(h.__dir__<0?"Right":"")}),h},le.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),kt(["filter","map","takeWhile"],function(s,l){var c=l+1,h=c==ur||c==Tn;le.prototype[s]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:G(g,3),type:c}),_.__filtered__=_.__filtered__||h,_}}),kt(["head","last"],function(s,l){var c="take"+(l?"Right":"");le.prototype[s]=function(){return this[c](1).value()[0]}}),kt(["initial","tail"],function(s,l){var c="drop"+(l?"":"Right");le.prototype[s]=function(){return this.__filtered__?new le(this):this[c](1)}}),le.prototype.compact=function(){return this.filter(ht)},le.prototype.find=function(s){return this.filter(s).head()},le.prototype.findLast=function(s){return this.reverse().find(s)},le.prototype.invokeMap=ne(function(s,l){return typeof s=="function"?new le(this):this.map(function(c){return ns(c,s,l)})}),le.prototype.reject=function(s){return this.filter(Ao(G(s)))},le.prototype.slice=function(s,l){s=Q(s);var c=this;return c.__filtered__&&(s>0||l<0)?new le(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),l!==t&&(l=Q(l),c=l<0?c.dropRight(-l):c.take(l-s)),c)},le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},le.prototype.toArray=function(){return this.take(et)},Qt(le.prototype,function(s,l){var c=/^(?:filter|find|map|reject)|While$/.test(l),h=/^(?:head|last)$/.test(l),g=b[h?"take"+(l=="last"?"Right":""):l],_=h||/^find/.test(l);g&&(b.prototype[l]=function(){var w=this.__wrapped__,x=h?[1]:arguments,k=w instanceof le,M=x[0],I=k||Z(w),R=function(re){var ae=g.apply(b,In([re],x));return h&&B?ae[0]:ae};I&&c&&typeof M=="function"&&M.length!=1&&(k=I=!1);var B=this.__chain__,W=!!this.__actions__.length,j=_&&!B,te=k&&!W;if(!_&&I){w=te?w:new le(this);var J=s.apply(w,x);return J.__actions__.push({func:xo,args:[R],thisArg:t}),new At(J,B)}return j&&te?s.apply(this,x):(J=this.thru(R),j?h?J.value()[0]:J.value():J)})}),kt(["pop","push","shift","sort","splice","unshift"],function(s){var l=js[s],c=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",h=/^(?:pop|shift)$/.test(s);b.prototype[s]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return l.apply(Z(_)?_:[],g)}return this[c](function(w){return l.apply(Z(w)?w:[],g)})}}),Qt(le.prototype,function(s,l){var c=b[l];if(c){var h=c.name+"";ye.call(ri,h)||(ri[h]=[]),ri[h].push({name:l,func:c})}}),ri[go(t,N).name]=[{name:"wrapper",func:t}],le.prototype.clone=G1,le.prototype.reverse=j1,le.prototype.value=J1,b.prototype.at=Ev,b.prototype.chain=kv,b.prototype.commit=Cv,b.prototype.next=Av,b.prototype.plant=Tv,b.prototype.reverse=Mv,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=Iv,b.prototype.first=b.prototype.head,Ji&&(b.prototype[Ji]=Ov),b},ei=C1();cr?((cr.exports=ei)._=ei,pa._=ei):Ve._=ei}).call(cs)}(ql,ql.exports);var $0=ql.exports;function Sf(n){return n.type.create($0.cloneDeep(n.attrs))}const qM=Re.create({name:"node_processor",addCommands(){return{setBlockAttributes:P(({commands:n,state:e},t,r,i={})=>{const o=F(n.getBlockAttributes(t))??{},{doc:a,tr:u}=e,{from:f,to:d}=u.selection;a.nodesBetween(f,d,(p,m)=>{ee.blocks.includes(p.type.name)&&u.setNodeAttribute(m,t,{...i,...o,...r})})}),getBlockAttributes:P(({editor:n},e,t)=>fe(()=>{let r=Object.assign({},t||{});for(const i of ee.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:P(({commands:n},e)=>{for(const t of ee.blocks)n.resetAttributes(t,e)}),applyMark:P(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:a,schema:u}=n,{$from:f,$to:d}=o.selection,p=sn(ce.LINK,u),m=sn(t,u);if(!(m.spec.group||"").includes(Jt.SETTINGS))return e.setMark(t,r);if(f.pos===d.pos)return;const v=S=>{if(!i.onAppliedToParent||i.onAppliedToParent(S)===!1){const{tr:C,node:O,position:N,mark:q}=S;e._removeNodeMark({tr:C,node:O,position:N,mark:q.type})}};a.nodesBetween(f.pos,d.pos,(S,C)=>{if(S.type.name===ee.LIST)return;const O=KM(S.marks,t),N=m.create({...O?.attrs||{},...r}),q=D0(f,d,S,C);if(!p.isInSet(S.marks)&&UM(o.doc,C,N,i.isAppliedToParent))return v({tr:o,node:S,position:C,mark:N});if(S.isText){o.addMark(q.from,q.to,N);return}VM(o.doc,o.selection,S,C)&&o.addNodeMark(C,N)})}),getMarks:P(({editor:n},e)=>{const t=hi(n,"state");return fe(()=>{const{selection:r,doc:i}=F(t),{from:o,to:a}=F(r),u=[];return i.nodesBetween(o,a,f=>{for(const d of f.marks)d.type.name===e&&u.unshift(d.attrs)}),u})}),getMark:P(({commands:n},e)=>{const t=n.getMarks(e);return fe(()=>F(t)[0]??null)}),hasMark:P(({commands:n},e)=>{const t=n.getMark(e);return fe(()=>!!F(t))}),getCommonSettingMark:P(({commands:n},e,t)=>{const r=n.getMark(e);return fe(()=>F(r)?.value??F(t))}),getDeviceSettingMark:P(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return fe(()=>{for(const o of F(r)){const a=o[F(i)];if(a)return a}return F(t)})}),removeAllMarks:P(({state:n,commands:e})=>{const{tr:t,doc:r}=n,{from:i,to:o}=t.selection;r.nodesBetween(i,o,(a,u)=>{for(const f of a.marks)e._removeNodeMark({tr:t,node:a,position:u,mark:f})})}),removeMarks:P(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:a}=r.selection;i.nodesBetween(o,a,(u,f)=>{const d=u.marks.filter(p=>t.includes(p.type.name));for(const p of d)e._removeNodeMark({tr:r,node:u,position:f,mark:p})})}),_removeNodeMark:P((n,{tr:e,node:t,position:r,mark:i})=>t.isText?e.removeMark(r,r+t.nodeSize,i):e.removeNodeMark(r,i))}}}),GM=Re.create({name:"text_processor",addCommands(){return{getSelectedText:P(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:P(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const a=D0(t,r,i,o),u=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),d=e({text:i.textContent.substring(u,f)}),p=n.schema.text(d,i.marks);n.tr.replaceWith(a.from,a.to,p)})})}}}),jM=Re.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:P(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:P(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:P(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;n.doc.nodesBetween(r,i,(o,a,u)=>{if(t({node:o,parent:u})){const f=o.isText?0:F0(n.doc,a);r=Math.min(r,a+f),i=Math.max(i,a+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:P(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===ee.DOCUMENT)})}}}),JM=On.create({name:"doc",topNode:!0,content:"block+"});class Fs extends Xe{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=Or.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Le.ok(t)}invert(){return new Fs(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new Fs(e.key,e.value,e.stepType)}}Xe.jsonID("setDocAttr",Fs);const YM=JM.extend({marks:Jt.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:P(({state:n},e,t)=>{n.tr.step(new Fs(e,t,n.schema))})}}}),XM=On.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ci(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ZM=XM.extend({marks:Jt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),QM=On.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ci(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>$T({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),eI=QM.extend({marks:Jt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),tI=Re.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[XT.create(this.editor),ZT.create(this.editor)]}}),nI=()=>[YM,ZM,eI,zT,YT,qM,GM,jM,tI],rI=xt.create({name:ce.FONT_FAMILY,group:Jt.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:P(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=F(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(ce.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:P(({commands:n})=>{const e=F(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return fe(()=>n.findFontByName(F(r))||t)}),findFontByName:P((n,e)=>F(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:P(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return $r({font_family:e})}}),iI=Re.create({name:ce.STYLE_PRESET,addGlobalAttributes(){return[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{preset:{isRequired:!1,default:{id:F(this.options.defaultId)},parseHTML:n=>{const e=F(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const o=F(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(o))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:F(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:F(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const o of Object.keys(t)){const a=t[o],u=r[o],f=!u||u.toLowerCase()==="inherit";i[o]=f?a:u}return i}return{getPresetList:P(()=>fe(()=>F(this.options.presets).filter(t=>!t.hidden))),getPreset:P(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:F(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return fe(()=>{const u=n(F(i),F(r).id);if(!F(o))return u;const f=F(a);return{id:u.id,common:e(u.common,f.common),mobile:e(u.mobile,f.mobile),tablet:e(u.tablet,f.tablet),desktop:e(u.desktop,f.desktop)}})}),applyPreset:P(({commands:t,chain:r},i)=>{const o=F(t.getPresetList()),a=n(o,i),u=a.node?.type??ee.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const d of ce.attributes)f[d]=F(t.getBlockAttributes(d));r().removeList().setNode(u,f).run()}),applyDefaultPreset:P(({commands:t})=>{t.applyPreset(F(this.options.defaultId))}),removePreset:P(({commands:t})=>{t.setNode(ee.PARAGRAPH,{preset:null})}),getPresetCustomization:P(({editor:t,commands:r})=>{const i=hi(t,"state");return fe(()=>{const{selection:o,doc:a}=F(i),{from:u,to:f}=o;return r._getSettingCustomization(a,u,f)})}),isSettingCustomized:P(({commands:t},r)=>{const i=t.getPresetCustomization(),o=ce.presetAttributes.includes(r)?"attributes":"marks";return fe(()=>F(i)[o]?.includes(r)??!1)}),getContentCustomization:P(({editor:t,commands:r})=>{const i=hi(t,"state");return fe(()=>{const{doc:o}=F(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:P((t,r,i,o)=>{const a=new Set,u=new Set;return r.nodesBetween(i,o,f=>{for(const[d,p]of Object.entries(f.attrs))ce.presetAttributes.includes(d)&&p&&u.add(d);for(const{type:d}of f.marks)ce.marks.includes(d.name)&&a.add(d.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(ce.marks).resetAttributes(ee.PARAGRAPH,ce.presetAttributes).resetAttributes(ee.HEADING,ce.presetAttributes).restoreSelection().run()}),removeFormat:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Li.head,F(this.options.presets))}}),sI=xt.create({name:ce.FONT_WEIGHT,group:Jt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:P(({commands:n},e)=>{n.applyMark(this.name,{value:e}),F(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:P(({commands:n})=>{const e=F(n.getFontWeight()),t=F(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:P(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return fe(()=>{const r=F(e),i=F(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Dt("toggleBold"),"Mod-B":Dt("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return $r({font_weight:n.value})}}),oI=xt.create({name:ce.FONT_SIZE,group:Jt.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:P(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].font_size.replace("px",""))}),applyFontSize:P(({commands:n},e)=>{const t=F(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:o,mark:a})=>{const u={...a.attrs,[t]:null};if(!Object.values(u).some(p=>!!p))return!1;const d=a.type.create(u);if(i.isText){r.addMark(o,o+i.nodeSize,d);return}r.addNodeMark(o,d)}})}),increaseFontSize:P(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.min(e+1,F(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:P(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.max(e-1,F(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Dt("increaseFontSize"),"Mod-Shift--":Dt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=F(this.options.wrapperRef),r=P0(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return $r({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),lI=xt.create({name:ce.FONT_COLOR,group:Jt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:P(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.color)}),applyFontColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:L0(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return $r({font_color:n.value})}}),aI=xt.create({name:ce.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:P(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:L0(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return $r({background_color:n.value})}}),uI=Re.create({name:"device_manager",addCommands(){return{getDevice:P(()=>hi(this.options,"device"))}}}),cI=xt.create({name:ce.FONT_STYLE,group:Jt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return fe(()=>F(e)?.italic??F(t).italic)}),isItalicAvailable:P(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return fe(()=>{const r=F(e),i=F(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:P(({commands:n})=>{const e=n.getPreset();return fe(()=>({italic:F(e).common.font_style==="italic"}))}),toggleItalic:P(({commands:n})=>{F(n.isItalicAvailable())&&(F(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:P(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:P(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Dt("toggleItalic"),"Mod-I":Dt("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return $r({font_style:e})}}),fI=xt.create({name:ce.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:P(({commands:n})=>{const e=n.getTextDecoration();return fe(()=>F(e).underline)}),isStrikeThrough:P(({commands:n})=>{const e=n.getTextDecoration();return fe(()=>F(e).strike_through)}),getTextDecoration:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return fe(()=>{const r=F(e)??{},i=F(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:P(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return fe(()=>F(e)!==F(t).underline)}),getDefaultTextDecoration:P(({commands:n})=>{const e=n.getPreset();return fe(()=>{const{text_decoration:t}=F(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:P(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:P(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:P(({commands:n},e,t=null)=>{const r=F(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:P(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:P(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Dt("toggleUnderline"),"Mod-U":Dt("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),$r({text_decoration:e.join(" ")})}}),hI=Re.create({name:"case_style",addCommands(){return{applyCaseStyle:P(({commands:n},e)=>{switch(e){case jc.CAPITALIZE:return n.applyCapitalize();case jc.LOWERCASE:return n.applyLowerCase();case jc.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:P(({commands:n})=>{n.transformText(({text:e})=>_M(e))}),applyLowerCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),B0={mobile:null,tablet:null,desktop:null},dI=Re.create({name:ce.ALIGNMENT,addGlobalAttributes:()=>[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=zM(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?Kl({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:P(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},B0)}),removeAlignment:P(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,B0),t=n.getDevice(),r=n.getDefaultAlignment();return fe(()=>F(e)?.[F(t)]??F(r))}),getDefaultAlignment:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].alignment??er.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Dt("applyAlignment",er.LEFT),"Mod-Shift-e":Dt("applyAlignment",er.CENTER),"Mod-Shift-r":Dt("applyAlignment",er.RIGHT),"Mod-Shift-j":Dt("applyAlignment",er.JUSTIFY)})}),H0={mobile:null,tablet:null,desktop:null},pI=Re.create({name:ce.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const o=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=F(this.options.wrapperRef),r=BM(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Kl({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,H0),t=n.getDevice(),r=n.getDefaultLineHeight();return fe(()=>F(e)?.[F(t)]??F(r))}),getDefaultLineHeight:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].line_height)}),applyLineHeight:P(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},H0)})}}}),mI=On.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ci(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),gI=mI.extend({name:ee.LIST_ITEM,marks:Jt.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:P(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=n(t);for(const a of r.marks)t.addNodeMark(o,Sf(a));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===ee.LIST))return t.listItemNewline()}})}),yI=On.create({name:ee.LIST,content:`${ee.LIST_ITEM}+`,group:"block list",marks:Jt.SETTINGS,addExtensions:()=>[gI],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Lt.DISC}}}),parseHTML(){const n={a:Lt.ROMAN,i:Lt.LATIN,1:Lt.DECIMAL},e=t=>{for(const r of Lt.values){const i=`.${F(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Lt.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Lt.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[F(this.options.baseClass)+n.bullet.type,F(this.options.presetClass)];return[Lt.ordered.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:P(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return fe(()=>F(e).type??null)}),applyList:P(({commands:n,chain:e},t)=>{if(F(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(ee.LIST,ee.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({commands:i,tr:o})=>i._bubbleListItemMarks(o)).run()}),_bubbleListItemMarks:P((n,e)=>{const{doc:t,selection:r}=e,i=r.$from.start(),o=r.$to.end();function a(u,f){if(ce.inlineMarks.includes(f.type)||f.type.isInSet(u.marks))return!1;for(const d of u.content.content)if(d.childCount&&(!d.marks||!f.isInSet(d.marks)))return!1;return!0}t.nodesBetween(i,o,(u,f)=>{if(u.type.name===ee.LIST)return;if(u.type.name!==ee.LIST_ITEM)return!1;const d=[];return u.forEach(p=>{for(const m of p.marks){if(m.isInSet(d)){e.removeNodeMark(f+1,m);continue}a(u,m)&&(e.removeNodeMark(f+1,m),e.addNodeMark(f,Sf(m)),d.push(m))}}),!1})}),removeList:P(({commands:n,state:e})=>{const{tr:t,doc:r,selection:i}=e,o=i.$from.start(),a=i.$to.end();r.nodesBetween(o,a,(u,f,d)=>{if([ee.LIST,ee.LIST_ITEM].includes(u.type.name))return;if(d.type.name!==ee.LIST_ITEM)return!1;const p=d.marks.filter(function(m){return!m.type.isInSet(u.marks)});for(const m of p)t.addNodeMark(f,Sf(m));return!1}),n.liftListItem(ee.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>BT({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(Lt.DISC,/^\s*([-+*])\s$/),n(Lt.DECIMAL,/^(\d+)\.\s$/),n(Lt.LATIN,/^([ivx]{1,3})\.\s$/i),n(Lt.ROMAN,/^([a-z])\.\s$/i)]}});function bI(n){return new wt({key:new Gt("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,u=lT(t.doc,[...e]);if(gT(u).forEach(({newRange:d})=>{const p=uT(r.doc,d,v=>v.isTextblock);let m,y;if(p.length>1?(m=p[0],y=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ")):p.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(m=p[0],y=r.doc.textBetween(m.pos,d.to,void 0," ")),m&&y){const v=y.split(" ").filter(O=>O!=="");if(v.length<=0)return!1;const S=v[v.length-1],C=m.pos+y.lastIndexOf(S);if(!S)return!1;mf(S).filter(O=>O.isLink).map(O=>({...O,from:C+O.start+1,to:C+O.end+1})).filter(O=>r.schema.marks.code?!r.doc.rangeHasMark(O.from,O.to,r.schema.marks.code):!0).filter(O=>n.validate?n.validate(O.value):!0).forEach(O=>{t0(O.from,O.to,r.doc).some(N=>N.mark.type===n.type)||a.addMark(O.from,O.to,n.type.create({href:O.href}))})}}),!!a.steps.length)return a}})}function _I(n){return new wt({key:new Gt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=dT(e.state,n.type.name),f=r.target,d=(i=f?.href)!==null&&i!==void 0?i:u.href,p=(o=f?.target)!==null&&o!==void 0?o:u.target;return f&&d?(e.editable&&window.open(d,p),!0):!1}}})}function vI(n){return new wt({key:new Gt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{var i;const{state:o}=e,{selection:a}=o,{empty:u}=a;if(u)return!1;let f="";r.content.forEach(S=>{f+=S.textContent});const d=mf(f).find(S=>S.isLink&&S.value===f);if(!f||!d)return!1;const p=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),m=/href="([^"]*)"/,y=p?.match(m),v=y?y[1]:d.href;return n.editor.commands.setMark(n.type,{href:v}),!0}}})}const wI=xt.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){k0(n);return}k0(n.scheme,n.optionalSlashes)})},onDestroy(){mM()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",Ci(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Ci(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[HT({find:n=>mf(n).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:(n,e)=>{var t,r;const i=(t=e?.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),o=/href="([^"]*)"/,a=i?.match(o);return a?{href:a[1]}:{href:(r=n.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(bI({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(_I({type:this.type})),this.options.linkOnPaste&&n.push(vI({editor:this.editor,type:this.type})),n}}),SI=wI.extend({name:ce.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:f0.SELF,parseHTML:n=>n.getAttribute("target")||f0.SELF},destination:{default:Os.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Os.URL;const t=e.replace("#","");return F(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Os.BLOCK:Os.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:P(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent(V0.text(r.text,[V0.mark(ce.LINK,r)])))),expandSelectionToLink:P(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:P(({commands:e})=>e.hasMark(this.name)),getLinkPreset:P(()=>fe(()=>F(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),bM.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Os.BLOCK?`#${n.href}`:n.href,t=F(this.options.basePresetClass)+F(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),xI=xt.create({name:ce.SUPERSCRIPT,addCommands(){return{applySuperscript:P(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:P(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:P(({commands:n})=>{F(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:P(({commands:n})=>{const e=n.getMark(this.name);return fe(()=>!!F(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),EI=Re.create({name:ce.MARGIN,addGlobalAttributes:()=>[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:o}=n.style;return[e,t,r,i,o].some(f=>!!f)?e?{value:e}:{value:[t||0,r||0,i||0,o||0].join(" ")}:null},renderHTML(n){return n.margin?Kl({margin:n.margin.value}):null}}}}]});function kI(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Fu({default:null,link:null});return _k(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),nI().concat([iI.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new OI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),yI.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),uI.configure({device:n.deviceRef}),oI.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),rI.configure({fonts:n.fonts,defaultPreset:hi(t,"default"),defaultFont:n.defaultFont}),sI,lI,aI,cI,fI,hI,xI,dI,pI.configure({wrapperRef:n.wrapperRef}),SI.configure({preset:hi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),EI])}class CI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class z0{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class fn extends z0{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=fn.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=o=>o.tagName!=="BODY"&&t.call(this,o),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:o=>r(o)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,o;const a=u=>{this._assignElementProperties(u,e,fn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,fn.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){a(u),i=null,o=u;continue}if(u.tagName==="BR"&&o&&o?.tagName!=="BR"){u.remove(),o=u;continue}if(u.tagName==="BR"){const f=this.dom.createElement("p");f.append(u),a(f),i=null,o=u;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(u),o=u}e.append(t),this._removeStyleProperties(e,fn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,fn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return fn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return fn.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const o=t.style.getPropertyValue(i);o&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,o)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let o=i.cloneNode();const a=u=>{this._assignElementProperties(u,e,fn.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){a(o),o=i.cloneNode();continue}o.append(u)}t.append(o),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=this._parseTextDecoration(i),a={underline:o.underline||t.underline,line_through:o.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(a).filter(([,u])=>u).map(([u])=>u.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=i.style.backgroundColor||t;i.style.backgroundColor=o}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class AI extends z0{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==ee.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(ce.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===ee.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>$0.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===ee.TEXT&&this._includesMarkType(e,ce.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class Yl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new fn({content:e,parser:t.parser||new CI})}static _buildJson(e){return new AI({content:e})}static normalize(e,t={}){return Yl.build(e,t).normalize()}}class Li{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class Tf{static build({config:e,nodeDomParser:t}){const r=kI({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Wo(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Wo(Gc.DESKTOP),pageBlocksRef:Wo([]),wrapperRef:Li.document.createElement("p")}),i=fT(r);return new Tf({schema:i,domParser:tc.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=Yl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class V0{static doc(e){return{type:ee.DOCUMENT,content:e}}static list(e,t){return{type:ee.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===ee.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:ee.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[].concat(r).map(o=>typeof o=="string"?this.paragraph(o):o)}}static heading(e,...t){const r=this._textBlock(t,this.text);return r.attrs??={},r.attrs.level=e,{type:ee.HEADING,...r}}static paragraph(...e){return{type:ee.PARAGRAPH,...this._textBlock(e,this.text)}}static _textBlock(e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:r,...t?{attrs:t}:{},...i?{marks:i}:{}}}static _normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:ee.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(ce.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class OI{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=Li.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,o=this.makePresetCssClass(r);t+=` ${o} {`;for(const a of Gc.values)for(const u of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:u}),d=this._makeInternalVariableName(u,a);if(t+=`${d}: var(${f}, inherit);`,i&&!ce.attributes.includes(u)){const p=d.replace("preset-","");t+=`${p}: var(${d});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Gc.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class Mf{static _instance;static get instance(){return this._instance??=new Mf,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class W0{static createWindow(){return new ap.JSDOM().window}types;parse(e){const{window:t}=new ap.JSDOM(e);return this.types=t,t.document}}class U0{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(e){if(!this.name)throw new Error('Command "name" is required');let t=e.command(this.name);if(this.description&&(t=t.description(this.description)),this.argument&&(t=t.argument(this.argument)),this.options.length)for(const r of this.options)t=t.option(r.flags,r.description,r.default);t.action(this.doCommand.bind(this))}output(e){console.log(e)}}class TI extends U0{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:_u.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){Li.use(W0.createWindow());const i=_u.resolve(process.cwd(),t),o=Tf.build({config:require(i).editor,nodeDomParser:new W0}),a=e.map(d=>o.toJSON(this._formatInputHtml(d))),u=a.length===1?a[0]:a,f=this._stringifyContent(u);this.output(r==="rb"?this._formatOutputRb(f):f)}_formatInputHtml(e){return e.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,(t,r)=>t.replace(r,parseFloat(r)/100))}_stringifyContent(e){return JSON.stringify(e,(r,i)=>i===null?void 0:i,2)}_formatOutputRb(e){return e.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,t=>t.replace(/"/g,"")).replace(/: "(.+)"([,\n])/g,": '$1'$2")}}var MI="4.6.0-0";class II extends U0{name="version";description="display cli version";doCommand(){this.output(MI)}}const K0=new sE,NI=[TI,II];for(const n of NI)new n().install(K0);K0.parse();
|
|
58
|
+
`)+F+`return __p
|
|
59
|
+
}`;var se=up(function(){return ge(w,j+"return "+F).apply(t,E)});if(se.source=F,du(se))throw se;return se}function BS(s){return ye(s).toLowerCase()}function HS(s){return ye(s).toUpperCase()}function $S(s,a,c){if(s=ye(s),s&&(c||a===t))return bh(s);if(!s||!(a=vt(a)))return s;var h=Kt(s),y=Kt(a),w=_h(h,y),E=vh(h,y)+1;return Kn(h,w,E).join("")}function zS(s,a,c){if(s=ye(s),s&&(c||a===t))return s.slice(0,Sh(s)+1);if(!s||!(a=vt(a)))return s;var h=Kt(s),y=vh(h,Kt(a))+1;return Kn(h,0,y).join("")}function VS(s,a,c){if(s=ye(s),s&&(c||a===t))return s.replace(dl,"");if(!s||!(a=vt(a)))return s;var h=Kt(s),y=_h(h,Kt(a));return Kn(h,y).join("")}function WS(s,a){var c=rn,h=Fn;if(Ae(a)){var y="separator"in a?a.separator:y;c="length"in a?re(a.length):c,h="omission"in a?vt(a.omission):h}s=ye(s);var w=s.length;if(Qr(s)){var E=Kt(s);w=E.length}if(c>=w)return s;var C=c-ei(h);if(C<1)return h;var M=E?Kn(E,0,C).join(""):s.slice(0,C);if(y===t)return M+h;if(E&&(C+=M.length-C),pu(y)){if(s.slice(C).search(y)){var L,P=M;for(y.global||(y=Ml(y.source,ye($f.exec(y))+"g")),y.lastIndex=0;L=y.exec(P);)var F=L.index;M=M.slice(0,F===t?C:F)}}else if(s.indexOf(vt(y),C)!=C){var V=M.lastIndexOf(y);V>-1&&(M=M.slice(0,V))}return M+h}function US(s){return s=ye(s),s&&ty.test(s)?s.replace(Ff,_1):s}var qS=ai(function(s,a,c){return s+(c?" ":"")+a.toUpperCase()}),yu=cd("toUpperCase");function lp(s,a,c){return s=ye(s),a=c?t:a,a===t?p1(s)?S1(s):s1(s):s.match(a)||[]}var up=oe(function(s,a){try{return bt(s,t,a)}catch(c){return du(c)?c:new te(c)}}),KS=Cn(function(s,a){return Mt(a,function(c){c=ln(c),En(s,c,fu(s[c],s))}),s});function GS(s){var a=s==null?0:s.length,c=Y();return s=a?ke(s,function(h){if(typeof h[1]!="function")throw new It(l);return[c(h[0]),h[1]]}):[],oe(function(h){for(var y=-1;++y<a;){var w=s[y];if(bt(w[0],this,h))return bt(w[1],this,h)}})}function jS(s){return _b(Rt(s,p))}function bu(s){return function(){return s}}function JS(s,a){return s==null||s!==s?a:s}var YS=hd(),XS=hd(!0);function mt(s){return s}function _u(s){return Vh(typeof s=="function"?s:Rt(s,p))}function ZS(s){return Uh(Rt(s,p))}function QS(s,a){return qh(s,Rt(a,p))}var ex=oe(function(s,a){return function(c){return ns(c,s,a)}}),tx=oe(function(s,a){return function(c){return ns(s,c,a)}});function vu(s,a,c){var h=He(a),y=ho(a,h);c==null&&!(Ae(a)&&(y.length||!h.length))&&(c=a,a=s,s=this,y=ho(a,He(a)));var w=!(Ae(c)&&"chain"in c)||!!c.chain,E=On(s);return Mt(y,function(C){var M=a[C];s[C]=M,E&&(s.prototype[C]=function(){var L=this.__chain__;if(w||L){var P=s(this.__wrapped__),F=P.__actions__=ht(this.__actions__);return F.push({func:M,args:arguments,thisArg:s}),P.__chain__=L,P}return M.apply(s,$n([this.value()],arguments))})}),s}function nx(){return qe._===this&&(qe._=O1),this}function wu(){}function rx(s){return s=re(s),oe(function(a){return Kh(a,s)})}var ix=Zl(ke),sx=Zl(dh),ox=Zl(xl);function cp(s){return su(s)?El(ln(s)):Db(s)}function ax(s){return function(a){return s==null?t:_r(s,a)}}var lx=pd(),ux=pd(!0);function Su(){return[]}function xu(){return!1}function cx(){return{}}function fx(){return""}function hx(){return!0}function dx(s,a){if(s=re(s),s<1||s>Ze)return[];var c=it,h=Qe(s,it);a=Y(a),s-=it;for(var y=Al(h,a);++c<s;)a(c);return y}function px(s){return ne(s)?ke(s,ln):wt(s)?[s]:ht(Md(ye(s)))}function mx(s){var a=++C1;return ye(s)+a}var gx=_o(function(s,a){return s+a},0),yx=Ql("ceil"),bx=_o(function(s,a){return s/a},1),_x=Ql("floor");function vx(s){return s&&s.length?fo(s,mt,Bl):t}function wx(s,a){return s&&s.length?fo(s,Y(a,2),Bl):t}function Sx(s){return gh(s,mt)}function xx(s,a){return gh(s,Y(a,2))}function Ex(s){return s&&s.length?fo(s,mt,Vl):t}function kx(s,a){return s&&s.length?fo(s,Y(a,2),Vl):t}var Cx=_o(function(s,a){return s*a},1),Ax=Ql("round"),Ox=_o(function(s,a){return s-a},0);function Tx(s){return s&&s.length?Cl(s,mt):0}function Mx(s,a){return s&&s.length?Cl(s,Y(a,2)):0}return v.after=Zv,v.ary=zd,v.assign=Hw,v.assignIn=tp,v.assignInWith=No,v.assignWith=$w,v.at=zw,v.before=Vd,v.bind=fu,v.bindAll=KS,v.bindKey=Wd,v.castArray=cw,v.chain=Bd,v.chunk=__,v.compact=v_,v.concat=w_,v.cond=GS,v.conforms=jS,v.constant=bu,v.countBy=Tv,v.create=Vw,v.curry=Ud,v.curryRight=qd,v.debounce=Kd,v.defaults=Ww,v.defaultsDeep=Uw,v.defer=Qv,v.delay=ew,v.difference=S_,v.differenceBy=x_,v.differenceWith=E_,v.drop=k_,v.dropRight=C_,v.dropRightWhile=A_,v.dropWhile=O_,v.fill=T_,v.filter=Iv,v.flatMap=Lv,v.flatMapDeep=Pv,v.flatMapDepth=Dv,v.flatten=Ld,v.flattenDeep=M_,v.flattenDepth=I_,v.flip=tw,v.flow=YS,v.flowRight=XS,v.fromPairs=N_,v.functions=Xw,v.functionsIn=Zw,v.groupBy=Fv,v.initial=L_,v.intersection=P_,v.intersectionBy=D_,v.intersectionWith=F_,v.invert=eS,v.invertBy=tS,v.invokeMap=Hv,v.iteratee=_u,v.keyBy=$v,v.keys=He,v.keysIn=pt,v.map=Co,v.mapKeys=rS,v.mapValues=iS,v.matches=ZS,v.matchesProperty=QS,v.memoize=Oo,v.merge=sS,v.mergeWith=np,v.method=ex,v.methodOf=tx,v.mixin=vu,v.negate=To,v.nthArg=rx,v.omit=oS,v.omitBy=aS,v.once=nw,v.orderBy=zv,v.over=ix,v.overArgs=rw,v.overEvery=sx,v.overSome=ox,v.partial=hu,v.partialRight=Gd,v.partition=Vv,v.pick=lS,v.pickBy=rp,v.property=cp,v.propertyOf=ax,v.pull=z_,v.pullAll=Dd,v.pullAllBy=V_,v.pullAllWith=W_,v.pullAt=U_,v.range=lx,v.rangeRight=ux,v.rearg=iw,v.reject=qv,v.remove=q_,v.rest=sw,v.reverse=uu,v.sampleSize=Gv,v.set=cS,v.setWith=fS,v.shuffle=jv,v.slice=K_,v.sortBy=Xv,v.sortedUniq=Q_,v.sortedUniqBy=ev,v.split=LS,v.spread=ow,v.tail=tv,v.take=nv,v.takeRight=rv,v.takeRightWhile=iv,v.takeWhile=sv,v.tap=vv,v.throttle=aw,v.thru=ko,v.toArray=Zd,v.toPairs=ip,v.toPairsIn=sp,v.toPath=px,v.toPlainObject=ep,v.transform=hS,v.unary=lw,v.union=ov,v.unionBy=av,v.unionWith=lv,v.uniq=uv,v.uniqBy=cv,v.uniqWith=fv,v.unset=dS,v.unzip=cu,v.unzipWith=Fd,v.update=pS,v.updateWith=mS,v.values=ci,v.valuesIn=gS,v.without=hv,v.words=lp,v.wrap=uw,v.xor=dv,v.xorBy=pv,v.xorWith=mv,v.zip=gv,v.zipObject=yv,v.zipObjectDeep=bv,v.zipWith=_v,v.entries=ip,v.entriesIn=sp,v.extend=tp,v.extendWith=No,vu(v,v),v.add=gx,v.attempt=up,v.camelCase=vS,v.capitalize=op,v.ceil=yx,v.clamp=yS,v.clone=fw,v.cloneDeep=dw,v.cloneDeepWith=pw,v.cloneWith=hw,v.conformsTo=mw,v.deburr=ap,v.defaultTo=JS,v.divide=bx,v.endsWith=wS,v.eq=jt,v.escape=SS,v.escapeRegExp=xS,v.every=Mv,v.find=Nv,v.findIndex=Nd,v.findKey=qw,v.findLast=Rv,v.findLastIndex=Rd,v.findLastKey=Kw,v.floor=_x,v.forEach=Hd,v.forEachRight=$d,v.forIn=Gw,v.forInRight=jw,v.forOwn=Jw,v.forOwnRight=Yw,v.get=mu,v.gt=gw,v.gte=yw,v.has=Qw,v.hasIn=gu,v.head=Pd,v.identity=mt,v.includes=Bv,v.indexOf=R_,v.inRange=bS,v.invoke=nS,v.isArguments=Sr,v.isArray=ne,v.isArrayBuffer=bw,v.isArrayLike=dt,v.isArrayLikeObject=Ie,v.isBoolean=_w,v.isBuffer=Gn,v.isDate=vw,v.isElement=ww,v.isEmpty=Sw,v.isEqual=xw,v.isEqualWith=Ew,v.isError=du,v.isFinite=kw,v.isFunction=On,v.isInteger=jd,v.isLength=Mo,v.isMap=Jd,v.isMatch=Cw,v.isMatchWith=Aw,v.isNaN=Ow,v.isNative=Tw,v.isNil=Iw,v.isNull=Mw,v.isNumber=Yd,v.isObject=Ae,v.isObjectLike=Me,v.isPlainObject=us,v.isRegExp=pu,v.isSafeInteger=Nw,v.isSet=Xd,v.isString=Io,v.isSymbol=wt,v.isTypedArray=ui,v.isUndefined=Rw,v.isWeakMap=Lw,v.isWeakSet=Pw,v.join=B_,v.kebabCase=ES,v.last=Pt,v.lastIndexOf=H_,v.lowerCase=kS,v.lowerFirst=CS,v.lt=Dw,v.lte=Fw,v.max=vx,v.maxBy=wx,v.mean=Sx,v.meanBy=xx,v.min=Ex,v.minBy=kx,v.stubArray=Su,v.stubFalse=xu,v.stubObject=cx,v.stubString=fx,v.stubTrue=hx,v.multiply=Cx,v.nth=$_,v.noConflict=nx,v.noop=wu,v.now=Ao,v.pad=AS,v.padEnd=OS,v.padStart=TS,v.parseInt=MS,v.random=_S,v.reduce=Wv,v.reduceRight=Uv,v.repeat=IS,v.replace=NS,v.result=uS,v.round=Ax,v.runInContext=T,v.sample=Kv,v.size=Jv,v.snakeCase=RS,v.some=Yv,v.sortedIndex=G_,v.sortedIndexBy=j_,v.sortedIndexOf=J_,v.sortedLastIndex=Y_,v.sortedLastIndexBy=X_,v.sortedLastIndexOf=Z_,v.startCase=PS,v.startsWith=DS,v.subtract=Ox,v.sum=Tx,v.sumBy=Mx,v.template=FS,v.times=dx,v.toFinite=Tn,v.toInteger=re,v.toLength=Qd,v.toLower=BS,v.toNumber=Dt,v.toSafeInteger=Bw,v.toString=ye,v.toUpper=HS,v.trim=$S,v.trimEnd=zS,v.trimStart=VS,v.truncate=WS,v.unescape=US,v.uniqueId=mx,v.upperCase=qS,v.upperFirst=yu,v.each=Hd,v.eachRight=$d,v.first=Pd,vu(v,function(){var s={};return on(v,function(a,c){_e.call(v.prototype,c)||(s[c]=a)}),s}(),{chain:!1}),v.VERSION=r,Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){v[s].placeholder=v}),Mt(["drop","take"],function(s,a){ue.prototype[s]=function(c){c=c===t?1:Be(re(c),0);var h=this.__filtered__&&!a?new ue(this):this.clone();return h.__filtered__?h.__takeCount__=Qe(c,h.__takeCount__):h.__views__.push({size:Qe(c,it),type:s+(h.__dir__<0?"Right":"")}),h},ue.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),Mt(["filter","map","takeWhile"],function(s,a){var c=a+1,h=c==dr||c==Bn;ue.prototype[s]=function(y){var w=this.clone();return w.__iteratees__.push({iteratee:Y(y,3),type:c}),w.__filtered__=w.__filtered__||h,w}}),Mt(["head","last"],function(s,a){var c="take"+(a?"Right":"");ue.prototype[s]=function(){return this[c](1).value()[0]}}),Mt(["initial","tail"],function(s,a){var c="drop"+(a?"":"Right");ue.prototype[s]=function(){return this.__filtered__?new ue(this):this[c](1)}}),ue.prototype.compact=function(){return this.filter(mt)},ue.prototype.find=function(s){return this.filter(s).head()},ue.prototype.findLast=function(s){return this.reverse().find(s)},ue.prototype.invokeMap=oe(function(s,a){return typeof s=="function"?new ue(this):this.map(function(c){return ns(c,s,a)})}),ue.prototype.reject=function(s){return this.filter(To(Y(s)))},ue.prototype.slice=function(s,a){s=re(s);var c=this;return c.__filtered__&&(s>0||a<0)?new ue(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),a!==t&&(a=re(a),c=a<0?c.dropRight(-a):c.take(a-s)),c)},ue.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ue.prototype.toArray=function(){return this.take(it)},on(ue.prototype,function(s,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),y=v[h?"take"+(a=="last"?"Right":""):a],w=h||/^find/.test(a);y&&(v.prototype[a]=function(){var E=this.__wrapped__,C=h?[1]:arguments,M=E instanceof ue,L=C[0],P=M||ne(E),F=function(ae){var fe=y.apply(v,$n([ae],C));return h&&V?fe[0]:fe};P&&c&&typeof L=="function"&&L.length!=1&&(M=P=!1);var V=this.__chain__,j=!!this.__actions__.length,X=w&&!V,se=M&&!j;if(!w&&P){E=se?E:new ue(this);var Z=s.apply(E,C);return Z.__actions__.push({func:ko,args:[F],thisArg:t}),new Nt(Z,V)}return X&&se?s.apply(this,C):(Z=this.thru(F),X?h?Z.value()[0]:Z.value():Z)})}),Mt(["pop","push","shift","sort","splice","unshift"],function(s){var a=Ys[s],c=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",h=/^(?:pop|shift)$/.test(s);v.prototype[s]=function(){var y=arguments;if(h&&!this.__chain__){var w=this.value();return a.apply(ne(w)?w:[],y)}return this[c](function(E){return a.apply(ne(E)?E:[],y)})}}),on(ue.prototype,function(s,a){var c=v[a];if(c){var h=c.name+"";_e.call(ii,h)||(ii[h]=[]),ii[h].push({name:a,func:c})}}),ii[bo(t,x).name]=[{name:"wrapper",func:t}],ue.prototype.clone=U1,ue.prototype.reverse=q1,ue.prototype.value=K1,v.prototype.at=wv,v.prototype.chain=Sv,v.prototype.commit=xv,v.prototype.next=Ev,v.prototype.plant=Cv,v.prototype.reverse=Av,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=Ov,v.prototype.first=v.prototype.head,Ji&&(v.prototype[Ji]=kv),v},ti=x1();pr?((pr.exports=ti)._=ti,_l._=ti):qe._=ti}).call(IM)}(Fs,Fs.exports)),Fs.exports}var D0=NM();function Cf(n){return n.type.create(D0.cloneDeep(n.attrs))}const RM=Pe.create({name:"node_processor",addCommands(){return{setBlockAttributes:H(({commands:n,state:e},t,r,i={})=>{const o=z(n.getBlockAttributes(t))??{},{doc:l,tr:u}=e,{from:f,to:d}=u.selection;l.nodesBetween(f,d,(g,p)=>{ie.blocks.includes(g.type.name)&&u.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:H(({editor:n},e,t)=>de(()=>{let r=Object.assign({},t||{});for(const i of ie.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:H(({commands:n},e)=>{for(const t of ie.blocks)n.resetAttributes(t,e)}),applyMark:H(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:l,schema:u}=n,{$from:f,$to:d}=o.selection,g=cn(he.LINK,u),p=cn(t,u);if(!(p.spec.group||"").includes(en.SETTINGS))return e.setMark(t,r);if(f.pos===d.pos)return;const S=k=>{if(!i.onAppliedToParent||i.onAppliedToParent(k)===!1){const{tr:m,node:b,position:x,mark:A}=k;e._removeNodeMark({tr:m,node:b,position:x,mark:A.type})}};l.nodesBetween(f.pos,d.pos,(k,m)=>{if(k.type.name===ie.LIST)return;const b=MM(k.marks,t),x=p.create({...b?.attrs||{},...r}),A=R0(f,d,k,m);if(!g.isInSet(k.marks)&&TM(o.doc,m,x,i.isAppliedToParent))return S({tr:o,node:k,position:m,mark:x});if(k.isText){o.addMark(A.from,A.to,x);return}AM(o.doc,o.selection,k,m)&&o.addNodeMark(m,x)})}),getMarks:H(({editor:n},e)=>{const t=pi(n,"state");return de(()=>{const{selection:r,doc:i}=z(t),{from:o,to:l}=z(r),u=[];return i.nodesBetween(o,l,f=>{for(const d of f.marks)d.type.name===e&&u.unshift(d.attrs)}),u})}),getMark:H(({commands:n},e)=>{const t=n.getMarks(e);return de(()=>z(t)[0]??null)}),hasMark:H(({commands:n},e)=>{const t=n.getMark(e);return de(()=>!!z(t))}),getCommonSettingMark:H(({commands:n},e,t)=>{const r=n.getMark(e);return de(()=>z(r)?.value??z(t))}),getDeviceSettingMark:H(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return de(()=>{for(const o of z(r)){const l=o[z(i)];if(l)return l}return z(t)})}),removeAllMarks:H(({state:n,commands:e})=>{const{tr:t,doc:r}=n,{from:i,to:o}=t.selection;r.nodesBetween(i,o,(l,u)=>{for(const f of l.marks)e._removeNodeMark({tr:t,node:l,position:u,mark:f})})}),removeMarks:H(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:l}=r.selection;i.nodesBetween(o,l,(u,f)=>{const d=u.marks.filter(g=>t.includes(g.type.name));for(const g of d)e._removeNodeMark({tr:r,node:u,position:f,mark:g})})}),_removeNodeMark:H((n,{tr:e,node:t,position:r,mark:i})=>t.isText?e.removeMark(r,r+t.nodeSize,i):e.removeNodeMark(r,i))}}}),LM=Pe.create({name:"text_processor",addCommands(){return{getSelectedText:H(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:H(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const l=R0(t,r,i,o),u=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),d=e({text:i.textContent.substring(u,f)}),g=n.schema.text(d,i.marks);n.tr.replaceWith(l.from,l.to,g)})})}}}),PM=Pe.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:H(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:H(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:H(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;n.doc.nodesBetween(r,i,(o,l,u)=>{if(t({node:o,parent:u})){const f=o.isText?0:L0(n.doc,l);r=Math.min(r,l+f),i=Math.max(i,l+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:H(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===ie.DOCUMENT)})}}}),DM=Dn.create({name:"doc",topNode:!0,content:"block+"});class Hs extends tt{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=Tr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,De.ok(t)}invert(){return new Hs(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new Hs(e.key,e.value,e.stepType)}}tt.jsonID("setDocAttr",Hs);const FM=DM.extend({marks:en.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:H(({state:n},e,t)=>{n.tr.step(new Hs(e,t,n.schema))})}}}),BM=Dn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Oi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),HM=BM.extend({marks:en.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),$M=Dn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Oi(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>xT({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),zM=$M.extend({marks:en.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),VM=Pe.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[DT.create(this.editor),FT.create(this.editor)]}}),WM=()=>[FM,HM,zM,CT,PT,RM,LM,PM,VM],UM=Ot.create({name:he.FONT_FAMILY,group:en.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:H(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=z(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(he.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:H(({commands:n})=>{const e=z(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return de(()=>n.findFontByName(z(r))||t)}),findFontByName:H((n,e)=>z(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:H(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:H(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return Hr({font_family:e})}}),qM=Pe.create({name:he.STYLE_PRESET,addGlobalAttributes(){return[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{preset:{isRequired:!1,default:{id:z(this.options.defaultId)},parseHTML:n=>{const e=z(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const o=z(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(o))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:z(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:z(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const o of Object.keys(t)){const l=t[o],u=r[o],f=!u||u.toLowerCase()==="inherit";i[o]=f?l:u}return i}return{getPresetList:H(()=>de(()=>z(this.options.presets).filter(t=>!t.hidden))),getPreset:H(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:z(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),l=t.getLinkPreset();return de(()=>{const u=n(z(i),z(r).id);if(!z(o))return u;const f=z(l);return{id:u.id,common:e(u.common,f.common),mobile:e(u.mobile,f.mobile),tablet:e(u.tablet,f.tablet),desktop:e(u.desktop,f.desktop)}})}),applyPreset:H(({commands:t,chain:r},i)=>{const o=z(t.getPresetList()),l=n(o,i),u=l.node?.type??ie.PARAGRAPH,f={preset:{id:i}};l.node&&(f.level=l.node.level);for(const d of he.attributes)f[d]=z(t.getBlockAttributes(d));r().removeList().setNode(u,f).run()}),applyDefaultPreset:H(({commands:t})=>{t.applyPreset(z(this.options.defaultId))}),removePreset:H(({commands:t})=>{t.setNode(ie.PARAGRAPH,{preset:null})}),getPresetCustomization:H(({editor:t,commands:r})=>{const i=pi(t,"state");return de(()=>{const{selection:o,doc:l}=z(i),{from:u,to:f}=o;return r._getSettingCustomization(l,u,f)})}),isSettingCustomized:H(({commands:t},r)=>{const i=t.getPresetCustomization(),o=he.presetAttributes.includes(r)?"attributes":"marks";return de(()=>z(i)[o]?.includes(r)??!1)}),getContentCustomization:H(({editor:t,commands:r})=>{const i=pi(t,"state");return de(()=>{const{doc:o}=z(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:H((t,r,i,o)=>{const l=new Set,u=new Set;return r.nodesBetween(i,o,f=>{for(const[d,g]of Object.entries(f.attrs))he.presetAttributes.includes(d)&&g&&u.add(d);for(const{type:d}of f.marks)he.marks.includes(d.name)&&l.add(d.name)}),{attributes:Array.from(u),marks:Array.from(l)}}),removePresetCustomization:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(he.marks).resetAttributes(ie.PARAGRAPH,he.presetAttributes).resetAttributes(ie.HEADING,he.presetAttributes).restoreSelection().run()}),removeFormat:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Di.head,z(this.options.presets))}}),KM=Ot.create({name:he.FONT_WEIGHT,group:en.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:H(({commands:n},e)=>{n.applyMark(this.name,{value:e}),z(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:H(({commands:n})=>{const e=z(n.getFontWeight()),t=z(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:H(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return de(()=>{const r=z(e),i=z(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:H(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Vt("toggleBold"),"Mod-B":Vt("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return Hr({font_weight:n.value})}}),GM=Ot.create({name:he.FONT_SIZE,group:en.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:H(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].font_size.replace("px",""))}),applyFontSize:H(({commands:n},e)=>{const t=z(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:o,mark:l})=>{const u={...l.attrs,[t]:null};if(!Object.values(u).some(g=>!!g))return!1;const d=l.type.create(u);if(i.isText){r.addMark(o,o+i.nodeSize,d);return}r.addNodeMark(o,d)}})}),increaseFontSize:H(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.min(e+1,z(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:H(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.max(e-1,z(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Vt("increaseFontSize"),"Mod-Shift--":Vt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=z(this.options.wrapperRef),r=N0(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return Hr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),jM=Ot.create({name:he.FONT_COLOR,group:en.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:H(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:H(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.color)}),applyFontColor:H(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:I0(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Hr({font_color:n.value})}}),JM=Ot.create({name:he.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:H(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:H(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:I0(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Hr({background_color:n.value})}}),YM=Pe.create({name:"device_manager",addCommands(){return{getDevice:H(()=>pi(this.options,"device"))}}}),XM=Ot.create({name:he.FONT_STYLE,group:en.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return de(()=>z(e)?.italic??z(t).italic)}),isItalicAvailable:H(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return de(()=>{const r=z(e),i=z(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:H(({commands:n})=>{const e=n.getPreset();return de(()=>({italic:z(e).common.font_style==="italic"}))}),toggleItalic:H(({commands:n})=>{z(n.isItalicAvailable())&&(z(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:H(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:H(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Vt("toggleItalic"),"Mod-I":Vt("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return Hr({font_style:e})}}),ZM=Ot.create({name:he.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:H(({commands:n})=>{const e=n.getTextDecoration();return de(()=>z(e).underline)}),isStrikeThrough:H(({commands:n})=>{const e=n.getTextDecoration();return de(()=>z(e).strike_through)}),getTextDecoration:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return de(()=>{const r=z(e)??{},i=z(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:H(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return de(()=>z(e)!==z(t).underline)}),getDefaultTextDecoration:H(({commands:n})=>{const e=n.getPreset();return de(()=>{const{text_decoration:t}=z(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:H(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:H(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:H(({commands:n},e,t=null)=>{const r=z(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:H(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:H(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Vt("toggleUnderline"),"Mod-U":Vt("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),Hr({text_decoration:e.join(" ")})}}),QM=Pe.create({name:"case_style",addCommands(){return{applyCaseStyle:H(({commands:n},e)=>{switch(e){case Zc.CAPITALIZE:return n.applyCapitalize();case Zc.LOWERCASE:return n.applyLowerCase();case Zc.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:H(({commands:n})=>{n.transformText(({text:e})=>iM(e))}),applyLowerCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),F0={mobile:null,tablet:null,desktop:null},eI=Pe.create({name:he.ALIGNMENT,addGlobalAttributes:()=>[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[he.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=CM(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?Za({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:H(({commands:n},e)=>{const t=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},F0)}),removeAlignment:H(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:H(({commands:n})=>{const e=n.getBlockAttributes(this.name,F0),t=n.getDevice(),r=n.getDefaultAlignment();return de(()=>z(e)?.[z(t)]??z(r))}),getDefaultAlignment:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].alignment??sr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Vt("applyAlignment",sr.LEFT),"Mod-Shift-e":Vt("applyAlignment",sr.CENTER),"Mod-Shift-r":Vt("applyAlignment",sr.RIGHT),"Mod-Shift-j":Vt("applyAlignment",sr.JUSTIFY)})}),B0={mobile:null,tablet:null,desktop:null},tI=Pe.create({name:he.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[he.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const o=n.style.getPropertyValue("--zw-line-height-tablet")||null,l=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:l}}const e=n.style.lineHeight;if(!e)return null;const t=z(this.options.wrapperRef),r=EM(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Za({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:H(({commands:n})=>{const e=n.getBlockAttributes(this.name,B0),t=n.getDevice(),r=n.getDefaultLineHeight();return de(()=>z(e)?.[z(t)]??z(r))}),getDefaultLineHeight:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].line_height)}),applyLineHeight:H(({commands:n},e)=>{const t=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},B0)})}}}),nI=Dn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Oi(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),rI=nI.extend({name:ie.LIST_ITEM,marks:en.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:H(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=n(t);for(const l of r.marks)t.addNodeMark(o,Cf(l));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===ie.LIST))return t.listItemNewline()}})}),iI=Dn.create({name:ie.LIST,content:`${ie.LIST_ITEM}+`,group:"block list",marks:en.SETTINGS,addExtensions:()=>[rI],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:$t.DISC}}}),parseHTML(){const n={a:$t.ROMAN,i:$t.LATIN,1:$t.DECIMAL},e=t=>{for(const r of $t.values){const i=`.${z(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||$t.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||$t.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[z(this.options.baseClass)+n.bullet.type,z(this.options.presetClass)];return[$t.ordered.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:H(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return de(()=>z(e).type??null)}),applyList:H(({commands:n,chain:e},t)=>{if(z(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(ie.LIST,ie.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({commands:i,tr:o})=>i._bubbleListItemMarks(o)).run()}),_bubbleListItemMarks:H((n,e)=>{const{doc:t,selection:r}=e,i=r.$from.start(),o=r.$to.end();function l(u,f){if(he.inlineMarks.includes(f.type)||f.type.isInSet(u.marks))return!1;for(const d of u.content.content)if(d.childCount&&(!d.marks||!f.isInSet(d.marks)))return!1;return!0}t.nodesBetween(i,o,(u,f)=>{if(u.type.name===ie.LIST)return;if(u.type.name!==ie.LIST_ITEM)return!1;const d=[];return u.forEach(g=>{for(const p of g.marks){if(p.isInSet(d)){e.removeNodeMark(f+1,p);continue}l(u,p)&&(e.removeNodeMark(f+1,p),e.addNodeMark(f,Cf(p)),d.push(p))}}),!1})}),removeList:H(({commands:n,state:e})=>{const{tr:t,doc:r,selection:i}=e,o=i.$from.start(),l=i.$to.end();r.nodesBetween(o,l,(u,f,d)=>{if([ie.LIST,ie.LIST_ITEM].includes(u.type.name))return;if(d.type.name!==ie.LIST_ITEM)return!1;const g=d.marks.filter(function(p){return!p.type.isInSet(u.marks)});for(const p of g)t.addNodeMark(f,Cf(p));return!1}),n.liftListItem(ie.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>ET({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n($t.DISC,/^\s*([-+*])\s$/),n($t.DECIMAL,/^(\d+)\.\s$/),n($t.LATIN,/^([ivx]{1,3})\.\s$/i),n($t.ROMAN,/^([a-z])\.\s$/i)]}});function sI(n){return new Ct({key:new Zt("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:l}=r,u=KO(t.doc,[...e]);if(tT(u).forEach(({newRange:d})=>{const g=jO(r.doc,d,S=>S.isTextblock);let p,_;if(g.length>1?(p=g[0],_=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):g.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(p=g[0],_=r.doc.textBetween(p.pos,d.to,void 0," ")),p&&_){const S=_.split(" ").filter(b=>b!=="");if(S.length<=0)return!1;const k=S[S.length-1],m=p.pos+_.lastIndexOf(k);if(!k)return!1;_f(k).filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>n.validate?n.validate(b.value):!0).forEach(b=>{Zg(b.from,b.to,r.doc).some(x=>x.mark.type===n.type)||l.addMark(b.from,b.to,n.type.create({href:b.href}))})}}),!!l.steps.length)return l}})}function oI(n){return new Ct({key:new Zt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=ZO(e.state,n.type.name),f=r.target,d=(i=f?.href)!==null&&i!==void 0?i:u.href,g=(o=f?.target)!==null&&o!==void 0?o:u.target;return f&&d?(e.editable&&window.open(d,g),!0):!1}}})}function aI(n){return new Ct({key:new Zt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{var i;const{state:o}=e,{selection:l}=o,{empty:u}=l;if(u)return!1;let f="";r.content.forEach(k=>{f+=k.textContent});const d=_f(f).find(k=>k.isLink&&k.value===f);if(!f||!d)return!1;const g=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),p=/href="([^"]*)"/,_=g?.match(p),S=_?_[1]:d.href;return n.editor.commands.setMark(n.type,{href:S}),!0}}})}const lI=Ot.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){S0(n);return}S0(n.scheme,n.optionalSlashes)})},onDestroy(){eM()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",Oi(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Oi(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[kT({find:n=>_f(n).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:(n,e)=>{var t,r;const i=(t=e?.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),o=/href="([^"]*)"/,l=i?.match(o);return l?{href:l[1]}:{href:(r=n.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(sI({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(oI({type:this.type})),this.options.linkOnPaste&&n.push(aI({editor:this.editor,type:this.type})),n}}),uI=lI.extend({name:he.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:l0.SELF,parseHTML:n=>n.getAttribute("target")||l0.SELF},destination:{default:Ts.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Ts.URL;const t=e.replace("#","");return z(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Ts.BLOCK:Ts.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:H(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent($0.text(r.text,[$0.mark(he.LINK,r)])))),expandSelectionToLink:H(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:H(({commands:e})=>e.hasMark(this.name)),getLinkPreset:H(()=>de(()=>z(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),rM.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Ts.BLOCK?`#${n.href}`:n.href,t=z(this.options.basePresetClass)+z(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),cI=Ot.create({name:he.SUPERSCRIPT,addCommands(){return{applySuperscript:H(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:H(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:H(({commands:n})=>{z(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:H(({commands:n})=>{const e=n.getMark(this.name);return de(()=>!!z(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),fI=Pe.create({name:he.MARGIN,addGlobalAttributes:()=>[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[he.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:o}=n.style;return[e,t,r,i,o].some(f=>!!f)?e?{value:e}:{value:[t||0,r||0,i||0,o||0].join(" ")}:null},renderHTML(n){return n.margin?Za({margin:n.margin.value}):null}}}}]});function hI(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Wu({default:null,link:null});return fk(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),WM().concat([qM.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new mI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),iI.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),YM.configure({device:n.deviceRef}),GM.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),UM.configure({fonts:n.fonts,defaultPreset:pi(t,"default"),defaultFont:n.defaultFont}),KM,jM,JM,XM,ZM,QM,cI,eI,tI.configure({wrapperRef:n.wrapperRef}),uI.configure({preset:pi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),fI])}class dI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class H0{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class gn extends H0{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=gn.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=o=>o.tagName!=="BODY"&&t.call(this,o),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:o=>r(o)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,o;const l=u=>{this._assignElementProperties(u,e,gn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,gn.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){l(u),i=null,o=u;continue}if(u.tagName==="BR"&&o&&o?.tagName!=="BR"){u.remove(),o=u;continue}if(u.tagName==="BR"){const f=this.dom.createElement("p");f.append(u),l(f),i=null,o=u;continue}i||(i=this.dom.createElement("p"),l(i)),i.append(u),o=u}e.append(t),this._removeStyleProperties(e,gn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,gn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return gn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return gn.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const o=t.style.getPropertyValue(i);o&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,o)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let o=i.cloneNode();const l=u=>{this._assignElementProperties(u,e,gn.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){l(o),o=i.cloneNode();continue}o.append(u)}t.append(o),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=this._parseTextDecoration(i),l={underline:o.underline||t.underline,line_through:o.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(l).filter(([,u])=>u).map(([u])=>u.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=i.style.backgroundColor||t;i.style.backgroundColor=o}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class pI extends H0{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==ie.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(he.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===ie.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>D0.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===ie.TEXT&&this._includesMarkType(e,he.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class nl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new gn({content:e,parser:t.parser||new dI})}static _buildJson(e){return new pI({content:e})}static normalize(e,t={}){return nl.build(e,t).normalize()}}class Di{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class Rf{static build({config:e,nodeDomParser:t}){const r=hI({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Go(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Go(Xc.DESKTOP),pageBlocksRef:Go([]),wrapperRef:Di.document.createElement("p")}),i=YO(r);return new Rf({schema:i,domParser:sc.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=nl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class $0{static doc(e){return{type:ie.DOCUMENT,content:e}}static list(e,t){return{type:ie.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===ie.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:ie.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[].concat(r).map(o=>typeof o=="string"?this.paragraph(o):o)}}static heading(e,...t){const r=this._textBlock(t,this.text);return r.attrs??={},r.attrs.level=e,{type:ie.HEADING,...r}}static paragraph(...e){return{type:ie.PARAGRAPH,...this._textBlock(e,this.text)}}static _textBlock(e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:r,...t?{attrs:t}:{},...i?{marks:i}:{}}}static _normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:ie.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(he.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class mI{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=Di.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,o=this.makePresetCssClass(r);t+=` ${o} {`;for(const l of Xc.values)for(const u of Object.keys(r[l])){const f=this._makeVariable({device:l,preset:r,property:u}),d=this._makeInternalVariableName(u,l);if(t+=`${d}: var(${f}, inherit);`,i&&!he.attributes.includes(u)){const g=d.replace("preset-","");t+=`${g}: var(${d});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Xc.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class Lf{static _instance;static get instance(){return this._instance??=new Lf,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class z0{static createWindow(){return new dp.JSDOM().window}types;parse(e){const{window:t}=new dp.JSDOM(e);return this.types=t,t.document}}class V0{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(e){if(!this.name)throw new Error('Command "name" is required');let t=e.command(this.name);if(this.description&&(t=t.description(this.description)),this.argument&&(t=t.argument(this.argument)),this.options.length)for(const r of this.options)t=t.option(r.flags,r.description,r.default);t.action(this.doCommand.bind(this))}output(e){console.log(e)}}class gI extends V0{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:hp.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){Di.use(z0.createWindow());const i=hp.resolve(process.cwd(),t),o=Rf.build({config:require(i).editor,nodeDomParser:new z0}),l=e.map(d=>o.toJSON(this._formatInputHtml(d))),u=l.length===1?l[0]:l,f=this._stringifyContent(u);this.output(r==="rb"?this._formatOutputRb(f):f)}_formatInputHtml(e){return e.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,(t,r)=>t.replace(r,parseFloat(r)/100))}_stringifyContent(e){return JSON.stringify(e,(r,i)=>i===null?void 0:i,2)}_formatOutputRb(e){return e.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,t=>t.replace(/"/g,"")).replace(/: "(.+)"([,\n])/g,": '$1'$2")}}var yI="4.7.0";class bI extends V0{name="version";description="display cli version";doCommand(){this.output(yI)}}const W0=new Vx,_I=[gI,bI];for(const n of _I)new n().install(W0);W0.parse();
|