@zipify/wysiwyg 1.3.0-0 → 2.0.0-1

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.
Files changed (103) hide show
  1. package/.eslintrc.js +1 -1
  2. package/config/build/lib.config.js +4 -2
  3. package/dist/cli.js +10 -2
  4. package/dist/wysiwyg.css +43 -48
  5. package/dist/wysiwyg.mjs +1928 -787
  6. package/example/ExampleApp.vue +3 -1
  7. package/lib/__tests__/utils/buildTestExtensions.js +14 -0
  8. package/lib/__tests__/utils/index.js +1 -0
  9. package/lib/components/base/Button.vue +0 -7
  10. package/lib/components/base/dropdown/Dropdown.vue +1 -7
  11. package/lib/components/base/dropdown/DropdownActivator.vue +4 -19
  12. package/lib/components/base/dropdown/__tests__/DropdownActivator.test.js +1 -23
  13. package/lib/components/toolbar/controls/AlignmentControl.vue +1 -11
  14. package/lib/components/toolbar/controls/FontColorControl.vue +0 -13
  15. package/lib/components/toolbar/controls/FontFamilyControl.vue +0 -4
  16. package/lib/components/toolbar/controls/FontSizeControl.vue +1 -6
  17. package/lib/components/toolbar/controls/FontWeightControl.vue +0 -12
  18. package/lib/components/toolbar/controls/ItalicControl.vue +0 -13
  19. package/lib/components/toolbar/controls/LineHeightControl.vue +0 -14
  20. package/lib/components/toolbar/controls/StylePresetControl.vue +1 -1
  21. package/lib/components/toolbar/controls/SuperscriptControl.vue +2 -2
  22. package/lib/components/toolbar/controls/UnderlineControl.vue +0 -12
  23. package/lib/components/toolbar/controls/__tests__/AlignmentControl.test.js +5 -72
  24. package/lib/components/toolbar/controls/__tests__/FontColorControl.test.js +1 -22
  25. package/lib/components/toolbar/controls/__tests__/FontFamilyControl.test.js +0 -1
  26. package/lib/components/toolbar/controls/__tests__/FontSizeControl.test.js +0 -1
  27. package/lib/components/toolbar/controls/__tests__/FontWeightControl.test.js +0 -1
  28. package/lib/components/toolbar/controls/__tests__/ItalicControl.test.js +1 -23
  29. package/lib/components/toolbar/controls/__tests__/LineHeightControl.test.js +1 -23
  30. package/lib/components/toolbar/controls/__tests__/StylePresetControl.test.js +2 -2
  31. package/lib/components/toolbar/controls/__tests__/SuperscriptControl.test.js +2 -2
  32. package/lib/components/toolbar/controls/__tests__/UnderlineControl.test.js +1 -25
  33. package/lib/composables/__tests__/useEditor.test.js +2 -2
  34. package/lib/enums/TextSettings.js +5 -5
  35. package/lib/extensions/BackgroundColor.js +4 -4
  36. package/lib/extensions/FontColor.js +4 -5
  37. package/lib/extensions/FontFamily.js +4 -5
  38. package/lib/extensions/FontSize.js +5 -7
  39. package/lib/extensions/FontStyle.js +13 -11
  40. package/lib/extensions/FontWeight.js +6 -9
  41. package/lib/extensions/Link.js +1 -1
  42. package/lib/extensions/StylePreset.js +1 -15
  43. package/lib/extensions/Superscript.js +23 -1
  44. package/lib/extensions/TextDecoration.js +16 -20
  45. package/lib/extensions/__tests__/Alignment.test.js +10 -7
  46. package/lib/extensions/__tests__/BackgroundColor.test.js +6 -3
  47. package/lib/extensions/__tests__/CaseStyle.test.js +11 -7
  48. package/lib/extensions/__tests__/FontColor.test.js +6 -3
  49. package/lib/extensions/__tests__/FontFamily.test.js +29 -22
  50. package/lib/extensions/__tests__/FontSize.test.js +24 -17
  51. package/lib/extensions/__tests__/FontStyle.test.js +22 -16
  52. package/lib/extensions/__tests__/FontWeight.test.js +28 -21
  53. package/lib/extensions/__tests__/LineHeight.test.js +14 -11
  54. package/lib/extensions/__tests__/Link.test.js +14 -10
  55. package/lib/extensions/__tests__/Margin.test.js +2 -2
  56. package/lib/extensions/__tests__/StylePreset.test.js +49 -100
  57. package/lib/extensions/__tests__/TextDecoration.test.js +59 -37
  58. package/lib/extensions/__tests__/__snapshots__/BackgroundColor.test.js.snap +25 -25
  59. package/lib/extensions/__tests__/__snapshots__/FontColor.test.js.snap +25 -25
  60. package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +105 -105
  61. package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +72 -72
  62. package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +54 -46
  63. package/lib/extensions/__tests__/__snapshots__/FontWeight.test.js.snap +77 -77
  64. package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +68 -3
  65. package/lib/extensions/core/Document.js +5 -0
  66. package/lib/extensions/core/Heading.js +10 -0
  67. package/lib/extensions/core/NodeProcessor.js +112 -10
  68. package/lib/extensions/core/Paragraph.js +9 -0
  69. package/lib/extensions/core/TextProcessor.js +9 -16
  70. package/lib/extensions/core/__tests__/NodeProcessor.test.js +137 -10
  71. package/lib/extensions/core/__tests__/SelectionProcessor.test.js +2 -2
  72. package/lib/extensions/core/__tests__/TextProcessor.test.js +18 -41
  73. package/lib/extensions/core/__tests__/__snapshots__/NodeProcessor.test.js.snap +192 -0
  74. package/lib/extensions/core/__tests__/__snapshots__/TextProcessor.test.js.snap +7 -27
  75. package/lib/extensions/core/index.js +5 -5
  76. package/lib/extensions/core/steps/AddNodeMarkStep.js +60 -0
  77. package/lib/extensions/core/steps/AttrStep.js +54 -0
  78. package/lib/extensions/core/steps/RemoveNodeMarkStep.js +50 -0
  79. package/lib/extensions/core/steps/index.js +3 -0
  80. package/lib/extensions/list/List.js +1 -0
  81. package/lib/extensions/list/ListItem.js +5 -0
  82. package/lib/extensions/list/__tests__/List.test.js +30 -25
  83. package/lib/services/NodeFactory.js +25 -21
  84. package/lib/services/index.js +1 -1
  85. package/lib/services/normalizer/BaseNormalizer.js +11 -0
  86. package/lib/services/{BrowserDomParser.js → normalizer/BrowserDomParser.js} +0 -0
  87. package/lib/services/normalizer/ContentNormalizer.js +24 -0
  88. package/lib/services/normalizer/HtmlNormalizer.js +245 -0
  89. package/lib/services/normalizer/JsonNormalizer.js +81 -0
  90. package/lib/services/{__tests__/ContentNormalizer.test.js → normalizer/__tests__/HtmlNormalizer.test.js} +27 -67
  91. package/lib/services/normalizer/__tests__/JsonNormalizer.test.js +70 -0
  92. package/lib/services/normalizer/__tests__/__snapshots__/JsonNormalizer.test.js.snap +159 -0
  93. package/lib/services/normalizer/index.js +1 -0
  94. package/lib/styles/content.css +8 -0
  95. package/lib/utils/findMarkByType.js +5 -0
  96. package/lib/utils/index.js +5 -0
  97. package/lib/utils/isMarkAppliedToParent.js +10 -0
  98. package/lib/utils/isNodeFullySelected.js +10 -0
  99. package/lib/utils/resolveNodePosition.js +6 -0
  100. package/lib/utils/resolveTextPosition.js +6 -0
  101. package/package.json +3 -1
  102. package/lib/assets/icons/indicator.svg +0 -5
  103. package/lib/services/ContentNormalizer.js +0 -293
package/dist/cli.js CHANGED
@@ -1,6 +1,14 @@
1
- "use strict";var e=require("path"),t=require("events"),n=require("child_process"),r=require("fs"),o=require("process"),i=require("jsdom");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=s(e),l=s(t),c=s(n),u=s(r),d=s(o),p={exports:{}},h={},f={};class m extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}f.CommanderError=m,f.InvalidArgumentError=class extends m{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:g}=f;h.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new g(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},h.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"};var v={},y={};const{humanReadableArgName:b}=h;y.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,n,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=e.createCommand(n).helpOption(!1);o.description(e._helpCommandDescription),r&&o.arguments(r),t.push(o)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||r){let o;o=n?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(o)}if(this.sortOptions){const e=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");t.sort(((t,n)=>e(t).localeCompare(e(n))))}return t}visibleArguments(e){return e._argsDescription&&e._args.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e._args.find((e=>e.description))?e._args:[]}subcommandTerm(e){const t=e._args.map((e=>b(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,n)=>Math.max(e,t.subcommandTerm(n).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,n)=>Math.max(e,t.argumentTerm(n).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let t=e.parent;t;t=t.parent)n=t.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function o(e,o){if(o){const i=`${e.padEnd(n+2)}${o}`;return t.wrap(i,r-2,n+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(s=s.concat([a,""]));const l=t.visibleArguments(e).map((e=>o(t.argumentTerm(e),t.argumentDescription(e))));l.length>0&&(s=s.concat(["Arguments:",i(l),""]));const c=t.visibleOptions(e).map((e=>o(t.optionTerm(e),t.optionDescription(e))));c.length>0&&(s=s.concat(["Options:",i(c),""]));const u=t.visibleCommands(e).map((e=>o(t.subcommandTerm(e),t.subcommandDescription(e))));return u.length>0&&(s=s.concat(["Commands:",i(u),""])),s.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){if(e.match(/[\n]\s+/))return e;const o=t-n;if(o<r)return e;const i=e.slice(0,n),s=e.slice(n),a=" ".repeat(n),l=new RegExp(".{1,"+(o-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");return i+(s.match(l)||[]).map(((e,t)=>("\n"===e.slice(-1)&&(e=e.slice(0,e.length-1)),(t>0?a:"")+e.trimRight()))).join("\n")}};var D={};const{InvalidArgumentError:E}=f;function C(e){let t,n;const r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0),{shortFlag:t,longFlag:n}}D.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=C(e);this.short=n.shortFlag,this.long=n.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(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){return this.implied=Object.assign(this.implied||{},e),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new E(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},D.splitOptionFlags=C,D.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)})),this.negativeOptions.forEach(((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)}))}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,o=void 0!==r&&r;return t.negate===(o===e)}};var w={};w.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map((e=>e.slice(2))));let r=[],o=3;return t.forEach((t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let o=1;o<=e.length;o++){let i=1;i=e[o-1]===t[r-1]?0:1,n[o][r]=Math.min(n[o-1][r]+1,n[o][r-1]+1,n[o-1][r-1]+i),o>1&&r>1&&e[o-1]===t[r-2]&&e[o-2]===t[r-1]&&(n[o][r]=Math.min(n[o][r],n[o-2][r-2]+1))}return n[e.length][t.length]}(e,t),i=Math.max(e.length,t.length);(i-n)/i>.4&&(n<o?(o=n,r=[t]):n===o&&r.push(t))})),r.sort(((e,t)=>e.localeCompare(t))),n&&(r=r.map((e=>`--${e}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""};const A=l.default.EventEmitter,_=c.default,k=a.default,x=u.default,O=d.default,{Argument:S,humanReadableArgName:N}=h,{CommanderError:T}=f,{Help:F}=y,{Option:M,splitOptionFlags:I,DualOptions:$}=D,{suggestSimilar:B}=w;class L extends A{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",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:e=>O.stdout.write(e),writeErr:e=>O.stderr.write(e),getOutHelpWidth:()=>O.stdout.isTTY?O.stdout.columns:void 0,getErrHelpWidth:()=>O.stderr.isTTY?O.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,t,n){let r=t,o=n;"object"==typeof r&&null!==r&&(o=r,r=null),o=o||{};const[,i,s]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(i);return r&&(a.description(r),a._executableHandler=!0),o.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!o.noHelp&&!o.hidden),a._executableFile=o.executableFile||null,s&&a.arguments(s),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(e){return new L(e)}createHelp(){return Object.assign(new F,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new S(e,t)}argument(e,t,n,r){const o=this.createArgument(e,t);return"function"==typeof n?o.default(r).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new T(e,t,n)),O.exit(e)}action(e){return this._actionHandler=t=>{const n=this._args.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new M(e,t)}addOption(e){const t=e.name(),n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(n,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(n,e.defaultValue,"default");this.options.push(e);const r=(t,r,o)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const i=this.getOptionValue(n);if(null!==t&&e.parseArg)try{t=e.parseArg(t,i)}catch(e){if("commander.invalidArgument"===e.code){const t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,i));null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(n,t,o)};return this.on("option:"+t,(t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,"cli")})),e.envVar&&this.on("optionEnv:"+t,(t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,"env")})),this}_optionEx(e,t,n,r,o){if("object"==typeof t&&t instanceof M)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(t,n);if(i.makeOptionMandatory(!!e.mandatory),"function"==typeof r)i.default(o).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},i.default(o).argParser(r)}else i.default(r);return this.addOption(i)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this}setOptionValueWithSource(e,t,n){return this.setOptionValue(e,t),this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let n;switch(t=t||{},void 0===e&&(e=O.argv,O.versions&&O.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":O.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function o(e,t){const n=k.resolve(e,t);if(x.existsSync(n))return n;if(r.includes(k.extname(t)))return;const o=r.find((e=>x.existsSync(`${n}${e}`)));return o?`${n}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i,s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let e;try{e=x.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}a=k.resolve(k.dirname(e),a)}if(a){let t=o(a,s);if(!t&&!e._executableFile&&this._scriptPath){const n=k.basename(this._scriptPath,k.extname(this._scriptPath));n!==this._name&&(t=o(a,`${n}-${e._name}`))}s=t||s}if(n=r.includes(k.extname(s)),"win32"!==O.platform?n?(t.unshift(s),t=R(O.execArgv).concat(t),i=_.spawn(O.argv[0],t,{stdio:"inherit"})):i=_.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=R(O.execArgv).concat(t),i=_.spawn(O.execPath,t,{stdio:"inherit"})),!i.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{O.on(e,(()=>{!1===i.killed&&null===i.exitCode&&i.kill(e)}))}))}const l=this._exitCallback;l?i.on("close",(()=>{l(new T(O.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):i.on("close",O.exit.bind(O)),i.on("error",(t=>{if("ENOENT"===t.code){const t=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${s}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}if("EACCES"===t.code)throw new Error(`'${s}' not executable`);if(l){const e=new T(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,l(e)}else O.exit(1)})),this.runningCommand=i}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);let o;return r||this.help({error:!0}),o=this._chainOrCallSubCommandHook(o,r,"preSubcommand"),o=this._chainOrCall(o,(()=>{if(!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))})),o}_checkNumberOfArguments(){this._args.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg)try{r=e.parseArg(t,n)}catch(n){if("commander.invalidArgument"===n.code){const r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${n.message}`;this.error(r,{exitCode:n.exitCode,code:n.code})}throw n}return r};this._checkNumberOfArguments();const t=[];this._args.forEach(((n,r)=>{let o=n.defaultValue;n.variadic?r<this.args.length?(o=this.args.slice(r),n.parseArg&&(o=o.reduce(((t,r)=>e(n,r,t)),n.defaultValue))):void 0===o&&(o=[]):r<this.args.length&&(o=this.args[r],n.parseArg&&(o=e(n,o,n.defaultValue))),t[r]=o})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return z(this).reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{r.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&r.reverse(),r.forEach((e=>{n=this._chainOrCall(n,(()=>e.callback(e.hookedCommand,this)))})),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach((e=>{r=this._chainOrCall(r,(()=>e(this,t)))})),r}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return P(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),P(this,n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs))),this.parent&&(n=this._chainOrCall(n,(()=>{this.parent.emit(o,e,t)}))),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(o))r(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)})),t=e.filter((e=>e.conflictsWith.length>0));t.forEach((t=>{const n=e.find((e=>t.conflictsWith.includes(e.attributeName())));n&&this._conflictingOption(t,n)}))}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){const t=[],n=[];let r=t;const o=e.slice();function i(e){return e.length>1&&"-"===e[0]}let s=null;for(;o.length;){const e=o.shift();if("--"===e){r===n&&r.push(e),r.push(...o);break}if(!s||i(e)){if(s=null,i(e)){const t=this._findOption(e);if(t){if(t.required){const e=o.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;o.length>0&&!i(o[0])&&(e=o.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);s=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),o.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(i(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),o.length>0&&n.push(...o);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),o.length>0&&t.push(...o);break}if(this._defaultCommandName){n.push(e),o.length>0&&n.push(...o);break}}if(this._passThroughOptions){r.push(e),o.length>0&&r.push(...o);break}r.push(e)}else this.emit(`option:${s.name()}`,e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return z(this).reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=t||{},r=n.exitCode||1,o=n.code||"commander.error";this._exit(r,o,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in O.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,O.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new $(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((n=>void 0!==n.implied&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n))).forEach((e=>{Object.keys(e.implied).filter((e=>!t(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const n=e=>{const t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find((e=>e.negate&&t===e.attributeName())),o=this.options.find((e=>!e.negate&&t===e.attributeName()));return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:o||e},r=e=>{const t=n(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},o=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter((e=>e.long)).map((e=>e.long));n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=B(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((e=>{n.push(e.name()),e.alias()&&n.push(e.alias())})),t=B(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map((e=>N(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=k.basename(e,k.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);z(this).reverse().forEach((e=>e.emit("beforeAllHelp",n))),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",n),z(this).forEach((e=>e.emit("afterAllHelp",n)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const n=I(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let t=O.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,(e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)})),this}}function P(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function R(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",o="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?o=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],o=n[4]),t&&"0"!==o?`${t}=${r}:${parseInt(o)+1}`:e}))}function z(e){const t=[];for(let n=e;n;n=n.parent)t.push(n);return t}v.Command=L,function(e,t){const{Argument:n}=h,{Command:r}=v,{CommanderError:o,InvalidArgumentError:i}=f,{Help:s}=y,{Option:a}=D;(t=e.exports=new r).program=t,t.Argument=n,t.Command=r,t.CommanderError=o,t.Help=s,t.InvalidArgumentError=i,t.InvalidOptionArgumentError=i,t.Option=a}(p,p.exports);var j=p.exports;const{program:H,createCommand:V,createArgument:K,createOption:W,CommanderError:U,InvalidArgumentError:q,InvalidOptionArgumentError:G,Command:J,Argument:Y,Option:X,Help:Q}=j;
1
+ "use strict";function t(t,e,n){return function(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e),n}function e(t,e){r(t,e),e.add(t)}function n(t,e,n){r(t,e),e.set(t,n)}function r(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function s(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,u(t,e,"get"))}function a(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,u(t,e,"set"),n),n}function u(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}var l=require("path"),c=require("events"),p=require("child_process"),f=require("fs"),h=require("process"),d=require("jsdom");function m(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var g=m(l),v=m(c),y=m(p),b=m(f),_=m(h),D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},w={exports:{}},E={},C={};class k extends Error{constructor(t,e,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}C.CommanderError=k,C.InvalidArgumentError=class extends k{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:A}=C;E.Argument=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new A(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},E.humanReadableArgName=function(t){const e=t.name()+(!0===t.variadic?"...":"");return t.required?"<"+e+">":"["+e+"]"};var x={},O={};const{humanReadableArgName:S}=E;O.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(t){const e=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,n,r]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=t.createCommand(n).helpOption(!1);o.description(t._helpCommandDescription),r&&o.arguments(r),e.push(o)}return this.sortSubcommands&&e.sort(((t,e)=>t.name().localeCompare(e.name()))),e}visibleOptions(t){const e=t.options.filter((t=>!t.hidden)),n=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag),r=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(n||r){let o;o=n?r?t.createOption(t._helpFlags,t._helpDescription):t.createOption(t._helpShortFlag,t._helpDescription):t.createOption(t._helpLongFlag,t._helpDescription),e.push(o)}if(this.sortOptions){const t=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");e.sort(((e,n)=>t(e).localeCompare(t(n))))}return e}visibleArguments(t){return t._argsDescription&&t._args.forEach((e=>{e.description=e.description||t._argsDescription[e.name()]||""})),t._args.find((t=>t.description))?t._args:[]}subcommandTerm(t){const e=t._args.map((t=>S(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce(((t,n)=>Math.max(t,e.subcommandTerm(n).length)),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce(((t,n)=>Math.max(t,e.optionTerm(n).length)),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce(((t,n)=>Math.max(t,e.argumentTerm(n).length)),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let n="";for(let e=t.parent;e;e=e.parent)n=e.name()+" "+n;return n+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue){(t.required||t.optional||t.isBoolean()&&"boolean"==typeof t.defaultValue)&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}return void 0!==t.presetArg&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),void 0!==t.envVar&&e.push(`env: ${t.envVar}`),e.length>0?`${t.description} (${e.join(", ")})`:t.description}argumentDescription(t){const e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){const n=`(${e.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatHelp(t,e){const n=e.padWidth(t,e),r=e.helpWidth||80;function o(t,o){if(o){const i=`${t.padEnd(n+2)}${o}`;return e.wrap(i,r-2,n+2)}return t}function i(t){return t.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${e.commandUsage(t)}`,""];const a=e.commandDescription(t);a.length>0&&(s=s.concat([a,""]));const u=e.visibleArguments(t).map((t=>o(e.argumentTerm(t),e.argumentDescription(t))));u.length>0&&(s=s.concat(["Arguments:",i(u),""]));const l=e.visibleOptions(t).map((t=>o(e.optionTerm(t),e.optionDescription(t))));l.length>0&&(s=s.concat(["Options:",i(l),""]));const c=e.visibleCommands(t).map((t=>o(e.subcommandTerm(t),e.subcommandDescription(t))));return c.length>0&&(s=s.concat(["Commands:",i(c),""])),s.join("\n")}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}wrap(t,e,n,r=40){if(t.match(/[\n]\s+/))return t;const o=e-n;if(o<r)return t;const i=t.slice(0,n),s=t.slice(n),a=" ".repeat(n),u=new RegExp(".{1,"+(o-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");return i+(s.match(u)||[]).map(((t,e)=>("\n"===t.slice(-1)&&(t=t.slice(0,t.length-1)),(e>0?a:"")+t.trimRight()))).join("\n")}};var N={};const{InvalidArgumentError:T}=C;function F(t){let e,n;const r=t.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(e=r.shift()),n=r.shift(),!e&&/^-[^-]$/.test(n)&&(e=n,n=void 0),{shortFlag:e,longFlag:n}}N.Option=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;const n=F(t);this.short=n.shortFlag,this.long=n.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(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){return this.implied=Object.assign(this.implied||{},t),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new T(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((t,e)=>t+e[0].toUpperCase()+e.slice(1)))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},N.splitOptionFlags=F,N.DualOptions=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach((t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)})),this.negativeOptions.forEach(((t,e)=>{this.positiveOptions.has(e)&&this.dualOptions.add(e)}))}valueFromOption(t,e){const n=e.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,o=void 0!==r&&r;return e.negate===(o===t)}};var M={};M.suggestSimilar=function(t,e){if(!e||0===e.length)return"";e=Array.from(new Set(e));const n=t.startsWith("--");n&&(t=t.slice(2),e=e.map((t=>t.slice(2))));let r=[],o=3;return e.forEach((e=>{if(e.length<=1)return;const n=function(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);const n=[];for(let e=0;e<=t.length;e++)n[e]=[e];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let r=1;r<=e.length;r++)for(let o=1;o<=t.length;o++){let i=1;i=t[o-1]===e[r-1]?0:1,n[o][r]=Math.min(n[o-1][r]+1,n[o][r-1]+1,n[o-1][r-1]+i),o>1&&r>1&&t[o-1]===e[r-2]&&t[o-2]===e[r-1]&&(n[o][r]=Math.min(n[o][r],n[o-2][r-2]+1))}return n[t.length][e.length]}(t,e),i=Math.max(t.length,e.length);(i-n)/i>.4&&(n<o?(o=n,r=[e]):n===o&&r.push(e))})),r.sort(((t,e)=>t.localeCompare(e))),n&&(r=r.map((t=>`--${t}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""};const I=v.default.EventEmitter,$=y.default,B=g.default,R=b.default,L=_.default,{Argument:P,humanReadableArgName:j}=E,{CommanderError:z}=C,{Help:H}=O,{Option:V,splitOptionFlags:W,DualOptions:U}=N,{suggestSimilar:q}=M;class K extends I{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",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:t=>L.stdout.write(t),writeErr:t=>L.stderr.write(t),getOutHelpWidth:()=>L.stdout.isTTY?L.stdout.columns:void 0,getErrHelpWidth:()=>L.stderr.isTTY?L.stderr.columns:void 0,outputError:(t,e)=>e(t)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._hasHelpOption=t._hasHelpOption,this._helpFlags=t._helpFlags,this._helpDescription=t._helpDescription,this._helpShortFlag=t._helpShortFlag,this._helpLongFlag=t._helpLongFlag,this._helpCommandName=t._helpCommandName,this._helpCommandnameAndArgs=t._helpCommandnameAndArgs,this._helpCommandDescription=t._helpCommandDescription,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}command(t,e,n){let r=e,o=n;"object"==typeof r&&null!==r&&(o=r,r=null),o=o||{};const[,i,s]=t.match(/([^ ]+) *(.*)/),a=this.createCommand(i);return r&&(a.description(r),a._executableHandler=!0),o.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!o.noHelp&&!o.hidden),a._executableFile=o.executableFile||null,s&&a.arguments(s),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(t){return new K(t)}createHelp(){return Object.assign(new H,this.configureHelp())}configureHelp(t){return void 0===t?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return void 0===t?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return"string"!=typeof t&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(e=e||{}).isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this.commands.push(t),t.parent=this,this}createArgument(t,e){return new P(t,e)}argument(t,e,n,r){const o=this.createArgument(t,e);return"function"==typeof n?o.default(r).argParser(n):o.default(n),this.addArgument(o),this}arguments(t){return t.split(/ +/).forEach((t=>{this.argument(t)})),this}addArgument(t){const e=this._args.slice(-1)[0];if(e&&e.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&void 0!==t.defaultValue&&void 0===t.parseArg)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this._args.push(t),this}addHelpCommand(t,e){return!1===t?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof t&&(this._helpCommandName=t.split(" ")[0],this._helpCommandnameAndArgs=t),this._helpCommandDescription=e||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(t,e){const n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return this._exitCallback=t||(t=>{if("commander.executeSubCommandAsync"!==t.code)throw t}),this}_exit(t,e,n){this._exitCallback&&this._exitCallback(new z(t,e,n)),L.exit(t)}action(t){return this._actionHandler=e=>{const n=this._args.length,r=e.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),t.apply(this,r)},this}createOption(t,e){return new V(t,e)}addOption(t){const e=t.name(),n=t.attributeName();if(t.negate){const e=t.long.replace(/^--no-/,"--");this._findOption(e)||this.setOptionValueWithSource(n,void 0===t.defaultValue||t.defaultValue,"default")}else void 0!==t.defaultValue&&this.setOptionValueWithSource(n,t.defaultValue,"default");this.options.push(t);const r=(e,r,o)=>{null==e&&void 0!==t.presetArg&&(e=t.presetArg);const i=this.getOptionValue(n);if(null!==e&&t.parseArg)try{e=t.parseArg(e,i)}catch(t){if("commander.invalidArgument"===t.code){const e=`${r} ${t.message}`;this.error(e,{exitCode:t.exitCode,code:t.code})}throw t}else null!==e&&t.variadic&&(e=t._concatValue(e,i));null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(n,e,o)};return this.on("option:"+e,(e=>{const n=`error: option '${t.flags}' argument '${e}' is invalid.`;r(e,n,"cli")})),t.envVar&&this.on("optionEnv:"+e,(e=>{const n=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;r(e,n,"env")})),this}_optionEx(t,e,n,r,o){if("object"==typeof e&&e instanceof V)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(e,n);if(i.makeOptionMandatory(!!t.mandatory),"function"==typeof r)i.default(o).argParser(r);else if(r instanceof RegExp){const t=r;r=(e,n)=>{const r=t.exec(e);return r?r[0]:n},i.default(o).argParser(r)}else i.default(r);return this.addOption(i)}option(t,e,n,r){return this._optionEx({},t,e,n,r)}requiredOption(t,e,n,r){return this._optionEx({mandatory:!0},t,e,n,r)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){if(this._passThroughOptions=!!t,this.parent&&t&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(t=!0){if(this._storeOptionsAsProperties=!!t,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this}setOptionValueWithSource(t,e,n){return this.setOptionValue(t,e),this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,e){if(void 0!==t&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");let n;switch(e=e||{},void 0===t&&(t=L.argv,L.versions&&L.versions.electron&&(e.from="electron")),this.rawArgs=t.slice(),e.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":L.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,e){const n=this._prepareUserArgs(t,e);return this._parseCommand([],n),this}async parseAsync(t,e){const n=this._prepareUserArgs(t,e);return await this._parseCommand([],n),this}_executeSubCommand(t,e){e=e.slice();let n=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function o(t,e){const n=B.resolve(t,e);if(R.existsSync(n))return n;if(r.includes(B.extname(e)))return;const o=r.find((t=>R.existsSync(`${n}${t}`)));return o?`${n}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i,s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let t;try{t=R.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}a=B.resolve(B.dirname(t),a)}if(a){let e=o(a,s);if(!e&&!t._executableFile&&this._scriptPath){const n=B.basename(this._scriptPath,B.extname(this._scriptPath));n!==this._name&&(e=o(a,`${n}-${t._name}`))}s=e||s}if(n=r.includes(B.extname(s)),"win32"!==L.platform?n?(e.unshift(s),e=G(L.execArgv).concat(e),i=$.spawn(L.argv[0],e,{stdio:"inherit"})):i=$.spawn(s,e,{stdio:"inherit"}):(e.unshift(s),e=G(L.execArgv).concat(e),i=$.spawn(L.execPath,e,{stdio:"inherit"})),!i.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((t=>{L.on(t,(()=>{!1===i.killed&&null===i.exitCode&&i.kill(t)}))}))}const u=this._exitCallback;u?i.on("close",(()=>{u(new z(L.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):i.on("close",L.exit.bind(L)),i.on("error",(e=>{if("ENOENT"===e.code){const e=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${s}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${e}`;throw new Error(n)}if("EACCES"===e.code)throw new Error(`'${s}' not executable`);if(u){const t=new z(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e,u(t)}else L.exit(1)})),this.runningCommand=i}_dispatchSubcommand(t,e,n){const r=this._findCommand(t);let o;return r||this.help({error:!0}),o=this._chainOrCallSubCommandHook(o,r,"preSubcommand"),o=this._chainOrCall(o,(()=>{if(!r._executableHandler)return r._parseCommand(e,n);this._executeSubCommand(r,e.concat(n))})),o}_checkNumberOfArguments(){this._args.forEach(((t,e)=>{t.required&&null==this.args[e]&&this.missingArgument(t.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const t=(t,e,n)=>{let r=e;if(null!==e&&t.parseArg)try{r=t.parseArg(e,n)}catch(n){if("commander.invalidArgument"===n.code){const r=`error: command-argument value '${e}' is invalid for argument '${t.name()}'. ${n.message}`;this.error(r,{exitCode:n.exitCode,code:n.code})}throw n}return r};this._checkNumberOfArguments();const e=[];this._args.forEach(((n,r)=>{let o=n.defaultValue;n.variadic?r<this.args.length?(o=this.args.slice(r),n.parseArg&&(o=o.reduce(((e,r)=>t(n,r,e)),n.defaultValue))):void 0===o&&(o=[]):r<this.args.length&&(o=this.args[r],n.parseArg&&(o=t(n,o,n.defaultValue))),e[r]=o})),this.processedArgs=e}_chainOrCall(t,e){return t&&t.then&&"function"==typeof t.then?t.then((()=>e())):e()}_chainOrCallHooks(t,e){let n=t;const r=[];return Y(this).reverse().filter((t=>void 0!==t._lifeCycleHooks[e])).forEach((t=>{t._lifeCycleHooks[e].forEach((e=>{r.push({hookedCommand:t,callback:e})}))})),"postAction"===e&&r.reverse(),r.forEach((t=>{n=this._chainOrCall(n,(()=>t.callback(t.hookedCommand,this)))})),n}_chainOrCallSubCommandHook(t,e,n){let r=t;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach((t=>{r=this._chainOrCall(r,(()=>t(this,e)))})),r}_parseCommand(t,e){const n=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),e=n.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName)return 1===t.length&&this.help(),this._dispatchSubcommand(t[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return J(this,e),this._dispatchSubcommand(this._defaultCommandName,t,e);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),J(this,n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs))),this.parent&&(n=this._chainOrCall(n,(()=>{this.parent.emit(o,t,e)}))),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(o))r(),this._processArguments(),this.parent.emit(o,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(t){if(t)return this.commands.find((e=>e._name===t||e._aliases.includes(t)))}_findOption(t){return this.options.find((e=>e.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent)t.options.forEach((e=>{e.mandatory&&void 0===t.getOptionValue(e.attributeName())&&t.missingMandatoryOptionValue(e)}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const e=t.attributeName();return void 0!==this.getOptionValue(e)&&"default"!==this.getOptionValueSource(e)})),e=t.filter((t=>t.conflictsWith.length>0));e.forEach((e=>{const n=t.find((t=>e.conflictsWith.includes(t.attributeName())));n&&this._conflictingOption(e,n)}))}_checkForConflictingOptions(){for(let t=this;t;t=t.parent)t._checkForConflictingLocalOptions()}parseOptions(t){const e=[],n=[];let r=e;const o=t.slice();function i(t){return t.length>1&&"-"===t[0]}let s=null;for(;o.length;){const t=o.shift();if("--"===t){r===n&&r.push(t),r.push(...o);break}if(!s||i(t)){if(s=null,i(t)){const e=this._findOption(t);if(e){if(e.required){const t=o.shift();void 0===t&&this.optionMissingArgument(e),this.emit(`option:${e.name()}`,t)}else if(e.optional){let t=null;o.length>0&&!i(o[0])&&(t=o.shift()),this.emit(`option:${e.name()}`,t)}else this.emit(`option:${e.name()}`);s=e.variadic?e:null;continue}}if(t.length>2&&"-"===t[0]&&"-"!==t[1]){const e=this._findOption(`-${t[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,t.slice(2)):(this.emit(`option:${e.name()}`),o.unshift(`-${t.slice(2)}`));continue}}if(/^--[^=]+=/.test(t)){const e=t.indexOf("="),n=this._findOption(t.slice(0,e));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,t.slice(e+1));continue}}if(i(t)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===e.length&&0===n.length){if(this._findCommand(t)){e.push(t),o.length>0&&n.push(...o);break}if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){e.push(t),o.length>0&&e.push(...o);break}if(this._defaultCommandName){n.push(t),o.length>0&&n.push(...o);break}}if(this._passThroughOptions){r.push(t),o.length>0&&r.push(...o);break}r.push(t)}else this.emit(`option:${s.name()}`,t)}return{operands:e,unknown:n}}opts(){if(this._storeOptionsAsProperties){const t={},e=this.options.length;for(let n=0;n<e;n++){const e=this.options[n].attributeName();t[e]=e===this._versionOptionName?this._version:this[e]}return t}return this._optionValues}optsWithGlobals(){return Y(this).reduce(((t,e)=>Object.assign(t,e.opts())),{})}error(t,e){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=e||{},r=n.exitCode||1,o=n.code||"commander.error";this._exit(r,o,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in L.env){const e=t.attributeName();(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,L.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}}))}_parseOptionsImplied(){const t=new U(this.options),e=t=>void 0!==this.getOptionValue(t)&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((n=>void 0!==n.implied&&e(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n))).forEach((t=>{Object.keys(t.implied).filter((t=>!e(t))).forEach((e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")}))}))}missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){const n=t=>{const e=t.attributeName(),n=this.getOptionValue(e),r=this.options.find((t=>t.negate&&e===t.attributeName())),o=this.options.find((t=>!t.negate&&e===t.attributeName()));return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:o||t},r=t=>{const e=n(t),r=e.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${e.envVar}'`:`option '${e.flags}'`},o=`error: ${r(t)} cannot be used with ${r(e)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const t=r.createHelp().visibleOptions(r).filter((t=>t.long)).map((t=>t.long));n=n.concat(t),r=r.parent}while(r&&!r._enablePositionalOptions);e=q(t,n)}const n=`error: unknown option '${t}'${e}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const e=this._args.length,n=1===e?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${n} but got ${t.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((t=>{n.push(t.name()),t.alias()&&n.push(t.alias())})),e=q(t,n)}const n=`error: unknown command '${t}'${e}`;this.error(n,{code:"commander.unknownCommand"})}version(t,e,n){if(void 0===t)return this._version;this._version=t,e=e||"-V, --version",n=n||"output the version number";const r=this.createOption(e,n);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`),this._exit(0,"commander.version",t)})),this}description(t,e){return void 0===t&&void 0===e?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return void 0===t?this._summary:(this._summary=t,this)}alias(t){if(void 0===t)return this._aliases[0];let e=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");return e._aliases.push(t),this}aliases(t){return void 0===t?this._aliases:(t.forEach((t=>this.alias(t))),this)}usage(t){if(void 0===t){if(this._usage)return this._usage;const t=this._args.map((t=>j(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}return this._usage=t,this}name(t){return void 0===t?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=B.basename(t,B.extname(t)),this}executableDir(t){return void 0===t?this._executableDir:(this._executableDir=t,this)}helpInformation(t){const e=this.createHelp();return void 0===e.helpWidth&&(e.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),e.formatHelp(this,e)}_getHelpContext(t){const e={error:!!(t=t||{}).error};let n;return n=e.error?t=>this._outputConfiguration.writeErr(t):t=>this._outputConfiguration.writeOut(t),e.write=t.write||n,e.command=this,e}outputHelp(t){let e;"function"==typeof t&&(e=t,t=void 0);const n=this._getHelpContext(t);Y(this).reverse().forEach((t=>t.emit("beforeAllHelp",n))),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(e&&(r=e(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",n),Y(this).forEach((t=>t.emit("afterAllHelp",n)))}helpOption(t,e){if("boolean"==typeof t)return this._hasHelpOption=t,this;this._helpFlags=t||this._helpFlags,this._helpDescription=e||this._helpDescription;const n=W(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(t){this.outputHelp(t);let e=L.exitCode||0;0===e&&t&&"function"!=typeof t&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){const n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${t}Help`;return this.on(r,(t=>{let n;n="function"==typeof e?e({error:t.error,command:t.command}):e,n&&t.write(`${n}\n`)})),this}}function J(t,e){t._hasHelpOption&&e.find((e=>e===t._helpLongFlag||e===t._helpShortFlag))&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function G(t){return t.map((t=>{if(!t.startsWith("--inspect"))return t;let e,n,r="127.0.0.1",o="9229";return null!==(n=t.match(/^(--inspect(-brk)?)$/))?e=n[1]:null!==(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(e=n[1],/^\d+$/.test(n[3])?o=n[3]:r=n[3]):null!==(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(e=n[1],r=n[3],o=n[4]),e&&"0"!==o?`${e}=${r}:${parseInt(o)+1}`:t}))}function Y(t){const e=[];for(let n=t;n;n=n.parent)e.push(n);return e}x.Command=K,function(t,e){const{Argument:n}=E,{Command:r}=x,{CommanderError:o,InvalidArgumentError:i}=C,{Help:s}=O,{Option:a}=N;(e=t.exports=new r).program=e,e.Argument=n,e.Command=r,e.CommanderError=o,e.Help=s,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i,e.Option=a}(w,w.exports);var X=w.exports;const{program:Q,createCommand:Z,createArgument:tt,createOption:et,CommanderError:nt,InvalidArgumentError:rt,InvalidOptionArgumentError:ot,Command:it,Argument:st,Option:at,Help:ut}=X;
2
2
  /*!
3
3
  * Vue.js v2.7.10
4
4
  * (c) 2014-2022 Evan You
5
5
  * Released under the MIT License.
6
- */var Z=Object.freeze({}),ee=Array.isArray;function te(e){return null==e}function ne(e){return null!=e}function re(e){return!0===e}function oe(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function ie(e){return"function"==typeof e}function se(e){return null!==e&&"object"==typeof e}var ae=Object.prototype.toString;function le(e){return ae.call(e).slice(8,-1)}function ce(e){return"[object Object]"===ae.call(e)}function ue(e){return"[object RegExp]"===ae.call(e)}function de(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function pe(e){return ne(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function he(e){return null==e?"":Array.isArray(e)||ce(e)&&e.toString===ae?JSON.stringify(e,null,2):String(e)}function fe(e){var t=parseFloat(e);return isNaN(t)?e:t}function me(e,t){for(var n=Object.create(null),r=e.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var ge=me("slot,component",!0),ve=me("key,ref,slot,slot-scope,is");function ye(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var be=Object.prototype.hasOwnProperty;function De(e,t){return be.call(e,t)}function Ee(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var Ce=/-(\w)/g,we=Ee((function(e){return e.replace(Ce,(function(e,t){return t?t.toUpperCase():""}))})),Ae=Ee((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),_e=/\B([A-Z])/g,ke=Ee((function(e){return e.replace(_e,"-$1").toLowerCase()}));var xe=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function Oe(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function Se(e,t){for(var n in t)e[n]=t[n];return e}function Ne(e){for(var t={},n=0;n<e.length;n++)e[n]&&Se(t,e[n]);return t}function Te(e,t,n){}var Fe=function(e,t,n){return!1},Me=function(e){return e};function Ie(e,t){if(e===t)return!0;var n=se(e),r=se(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var o=Array.isArray(e),i=Array.isArray(t);if(o&&i)return e.length===t.length&&e.every((function(e,n){return Ie(e,t[n])}));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(o||i)return!1;var s=Object.keys(e),a=Object.keys(t);return s.length===a.length&&s.every((function(n){return Ie(e[n],t[n])}))}catch(e){return!1}}function $e(e,t){for(var n=0;n<e.length;n++)if(Ie(e[n],t))return n;return-1}function Be(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}function Le(e,t){return e===t?0===e&&1/e!=1/t:e==e||t==t}var Pe=["component","directive","filter"],Re=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],ze={optionMergeStrategies:Object.create(null),silent:!1,productionTip:"production"!==process.env.NODE_ENV,devtools:"production"!==process.env.NODE_ENV,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Fe,isReservedAttr:Fe,isUnknownElement:Fe,getTagNamespace:Te,parsePlatformTagName:Me,mustUseProp:Fe,async:!0,_lifecycleHooks:Re},je=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function He(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function Ve(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var Ke=new RegExp("[^".concat(je.source,".$_\\d]"));var We="__proto__"in{},Ue="undefined"!=typeof window,qe=Ue&&window.navigator.userAgent.toLowerCase(),Ge=qe&&/msie|trident/.test(qe),Je=qe&&qe.indexOf("msie 9.0")>0,Ye=qe&&qe.indexOf("edge/")>0;qe&&qe.indexOf("android");var Xe=qe&&/iphone|ipad|ipod|ios/.test(qe);qe&&/chrome\/\d+/.test(qe),qe&&/phantomjs/.test(qe);var Qe,Ze=qe&&qe.match(/firefox\/(\d+)/),et={}.watch,tt=!1;if(Ue)try{var nt={};Object.defineProperty(nt,"passive",{get:function(){tt=!0}}),window.addEventListener("test-passive",null,nt)}catch(e){}var rt=function(){return void 0===Qe&&(Qe=!Ue&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),Qe},ot=Ue&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(e){return"function"==typeof e&&/native code/.test(e.toString())}var st,at="undefined"!=typeof Symbol&&it(Symbol)&&"undefined"!=typeof Reflect&&it(Reflect.ownKeys);st="undefined"!=typeof Set&&it(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var lt=null;function ct(e){void 0===e&&(e=null),e||lt&&lt._scope.off(),lt=e,e&&e._scope.on()}var ut=function(){function e(e,t,n,r,o,i,s,a){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),dt=function(e){void 0===e&&(e="");var t=new ut;return t.text=e,t.isComment=!0,t};function pt(e){return new ut(void 0,void 0,void 0,String(e))}function ht(e){var t=new ut(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ft=function(){return ft=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ft.apply(this,arguments)},mt=0,gt=function(){function e(){this.id=mt++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){ye(this.subs,e)},e.prototype.depend=function(t){e.target&&(e.target.addDep(this),"production"!==process.env.NODE_ENV&&t&&e.target.onTrack&&e.target.onTrack(ft({effect:e.target},t)))},e.prototype.notify=function(e){var t=this.subs.slice();"production"===process.env.NODE_ENV||ze.async||t.sort((function(e,t){return e.id-t.id}));for(var n=0,r=t.length;n<r;n++){if("production"!==process.env.NODE_ENV&&e){var o=t[n];o.onTrigger&&o.onTrigger(ft({effect:t[n]},e))}t[n].update()}},e}();gt.target=null;var vt=[];function yt(e){vt.push(e),gt.target=e}function bt(){vt.pop(),gt.target=vt[vt.length-1]}var Dt=Array.prototype,Et=Object.create(Dt);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(e){var t=Dt[e];Ve(Et,e,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o,i=t.apply(this,n),s=this.__ob__;switch(e){case"push":case"unshift":o=n;break;case"splice":o=n.slice(2)}return o&&s.observeArray(o),"production"!==process.env.NODE_ENV?s.dep.notify({type:"array mutation",target:this,key:e}):s.dep.notify(),i}))}));var Ct=Object.getOwnPropertyNames(Et),wt={},At=!0;function _t(e){At=e}var kt={notify:Te,depend:Te,addSub:Te,removeSub:Te},xt=function(){function e(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=!1),this.value=e,this.shallow=t,this.mock=n,this.dep=n?kt:new gt,this.vmCount=0,Ve(e,"__ob__",this),ee(e)){if(!n)if(We)e.__proto__=Et;else for(var r=0,o=Ct.length;r<o;r++){Ve(e,s=Ct[r],Et[s])}t||this.observeArray(e)}else{var i=Object.keys(e);for(r=0;r<i.length;r++){var s;St(e,s=i[r],wt,void 0,t,n)}}}return e.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ot(e[t],!1,this.mock)},e}();function Ot(e,t,n){var r;if(!(!se(e)||Pt(e)||e instanceof ut))return De(e,"__ob__")&&e.__ob__ instanceof xt?r=e.__ob__:!At||!n&&rt()||!ee(e)&&!ce(e)||!Object.isExtensible(e)||e.__v_skip||(r=new xt(e,t,n)),r}function St(e,t,n,r,o,i){var s=new gt,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var l=a&&a.get,c=a&&a.set;l&&!c||n!==wt&&2!==arguments.length||(n=e[t]);var u=!o&&Ot(n,!1,i);return Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var r=l?l.call(e):n;return gt.target&&("production"!==process.env.NODE_ENV?s.depend({target:e,type:"get",key:t}):s.depend(),u&&(u.dep.depend(),ee(r)&&Ft(r))),Pt(r)&&!o?r.value:r},set:function(a){var d=l?l.call(e):n;if(Le(d,a)){if("production"!==process.env.NODE_ENV&&r&&r(),c)c.call(e,a);else{if(l)return;if(!o&&Pt(d)&&!Pt(a))return void(d.value=a);n=a}u=!o&&Ot(a,!1,i),"production"!==process.env.NODE_ENV?s.notify({type:"set",target:e,key:t,newValue:a,oldValue:d}):s.notify()}}}),s}}function Nt(e,t,n){if("production"!==process.env.NODE_ENV&&(te(e)||oe(e))&&jr("Cannot set reactive property on undefined, null, or primitive value: ".concat(e)),!Lt(e)){var r=e.__ob__;return ee(e)&&de(t)?(e.length=Math.max(e.length,t),e.splice(t,1,n),r&&!r.shallow&&r.mock&&Ot(n,!1,!0),n):t in e&&!(t in Object.prototype)?(e[t]=n,n):e._isVue||r&&r.vmCount?("production"!==process.env.NODE_ENV&&jr("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),n):r?(St(r.value,t,n,void 0,r.shallow,r.mock),"production"!==process.env.NODE_ENV?r.dep.notify({type:"add",target:e,key:t,newValue:n,oldValue:void 0}):r.dep.notify(),n):(e[t]=n,n)}"production"!==process.env.NODE_ENV&&jr('Set operation on key "'.concat(t,'" failed: target is readonly.'))}function Tt(e,t){if("production"!==process.env.NODE_ENV&&(te(e)||oe(e))&&jr("Cannot delete reactive property on undefined, null, or primitive value: ".concat(e)),ee(e)&&de(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount?"production"!==process.env.NODE_ENV&&jr("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):Lt(e)?"production"!==process.env.NODE_ENV&&jr('Delete operation on key "'.concat(t,'" failed: target is readonly.')):De(e,t)&&(delete e[t],n&&("production"!==process.env.NODE_ENV?n.dep.notify({type:"delete",target:e,key:t}):n.dep.notify()))}}function Ft(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),ee(t)&&Ft(t)}function Mt(e){return It(e,!0),Ve(e,"__v_isShallow",!0),e}function It(e,t){if(!Lt(e)){if("production"!==process.env.NODE_ENV){ee(e)&&jr("Avoid using Array as root value for ".concat(t?"shallowReactive()":"reactive()"," as it cannot be tracked in watch() or watchEffect(). Use ").concat(t?"shallowRef()":"ref()"," instead. This is a Vue-2-only limitation."));var n=e&&e.__ob__;n&&n.shallow!==t&&jr("Target is already a ".concat(n.shallow?"":"non-","shallow reactive object, and cannot be converted to ").concat(t?"":"non-","shallow."))}var r=Ot(e,t,rt());"production"===process.env.NODE_ENV||r||((null==e||oe(e))&&jr("value cannot be made reactive: ".concat(String(e))),("Map"===(o=le(e))||"WeakMap"===o||"Set"===o||"WeakSet"===o)&&jr("Vue 2 does not support reactive collection types such as Map or Set."))}var o}function $t(e){return Lt(e)?$t(e.__v_raw):!(!e||!e.__ob__)}function Bt(e){return!(!e||!e.__v_isShallow)}function Lt(e){return!(!e||!e.__v_isReadonly)}function Pt(e){return!(!e||!0!==e.__v_isRef)}function Rt(e){return function(e,t){if(Pt(e))return e;var n={};return Ve(n,"__v_isRef",!0),Ve(n,"__v_isShallow",t),Ve(n,"dep",St(n,"value",e,null,t,rt())),n}(e,!1)}function zt(e){return Pt(e)?e.value:e}function jt(e,t,n){Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:function(){var e=t[n];if(Pt(e))return e.value;var r=e&&e.__ob__;return r&&r.dep.depend(),e},set:function(e){var r=t[n];Pt(r)&&!Pt(e)?r.value=e:t[n]=e}})}function Ht(e,t,n){var r=e[t];if(Pt(r))return r;var o={get value(){var r=e[t];return void 0===r?n:r},set value(n){e[t]=n}};return Ve(o,"__v_isRef",!0),o}function Vt(e,t){var n,r,o=ie(e);o?(n=e,r="production"!==process.env.NODE_ENV?function(){jr("Write operation failed: computed value is readonly")}:Te):(n=e.get,r=e.set);var i=rt()?null:new rr(lt,n,Te,{lazy:!0});"production"!==process.env.NODE_ENV&&i&&t&&(i.onTrack=t.onTrack,i.onTrigger=t.onTrigger);var s={effect:i,get value(){return i?(i.dirty&&i.evaluate(),gt.target&&("production"!==process.env.NODE_ENV&&gt.target.onTrack&&gt.target.onTrack({effect:gt.target,target:s,type:"get",key:"value"}),i.depend()),i.value):n()},set value(e){r(e)}};return Ve(s,"__v_isRef",!0),Ve(s,"__v_isReadonly",o),s}var Kt,Wt="".concat("watcher"," callback"),Ut="".concat("watcher"," getter"),qt="".concat("watcher"," cleanup"),Gt={};function Jt(e,t,n){return"production"!==process.env.NODE_ENV&&"function"!=typeof t&&jr("`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."),function(e,t,n){var r=void 0===n?Z:n,o=r.immediate,i=r.deep,s=r.flush,a=void 0===s?"pre":s,l=r.onTrack,c=r.onTrigger;"production"===process.env.NODE_ENV||t||(void 0!==o&&jr('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==i&&jr('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));var u,d,p=function(e){jr("Invalid watch source: ".concat(e,". A watch source can only be a getter/effect ")+"function, a ref, a reactive object, or an array of these types.")},h=lt,f=function(e,t,n){return void 0===n&&(n=null),Ln(e,null,n,h,t)},m=!1,g=!1;Pt(e)?(u=function(){return e.value},m=Bt(e)):$t(e)?(u=function(){return e.__ob__.dep.depend(),e},i=!0):ee(e)?(g=!0,m=e.some((function(e){return $t(e)||Bt(e)})),u=function(){return e.map((function(e){return Pt(e)?e.value:$t(e)?Xn(e):ie(e)?f(e,Ut):void("production"!==process.env.NODE_ENV&&p(e))}))}):ie(e)?u=t?function(){return f(e,Ut)}:function(){if(!h||!h._isDestroyed)return d&&d(),f(e,"watcher",[y])}:(u=Te,"production"!==process.env.NODE_ENV&&p(e));if(t&&i){var v=u;u=function(){return Xn(v())}}var y=function(e){d=b.onStop=function(){f(e,qt)}};if(rt())return y=Te,t?o&&f(t,Wt,[u(),g?[]:void 0,y]):u(),Te;var b=new rr(lt,u,Te,{lazy:!0});b.noRecurse=!t;var D=g?[]:Gt;b.run=function(){if(b.active)if(t){var e=b.get();(i||m||(g?e.some((function(e,t){return Le(e,D[t])})):Le(e,D)))&&(d&&d(),f(t,Wt,[e,D===Gt?void 0:D,y]),D=e)}else b.get()},"sync"===a?b.update=b.run:"post"===a?(b.post=!0,b.update=function(){return Or(b)}):b.update=function(){if(h&&h===lt&&!h._isMounted){var e=h._preWatchers||(h._preWatchers=[]);e.indexOf(b)<0&&e.push(b)}else Or(b)};"production"!==process.env.NODE_ENV&&(b.onTrack=l,b.onTrigger=c);t?o?b.run():D=b.get():"post"===a&&h?h.$once("hook:mounted",(function(){return b.get()})):b.get();return function(){b.teardown()}}(e,t,n)}var Yt=function(){function e(e){void 0===e&&(e=!1),this.active=!0,this.effects=[],this.cleanups=[],!e&&Kt&&(this.parent=Kt,this.index=(Kt.scopes||(Kt.scopes=[])).push(this)-1)}return e.prototype.run=function(e){if(this.active){var t=Kt;try{return Kt=this,e()}finally{Kt=t}}else"production"!==process.env.NODE_ENV&&jr("cannot run an inactive effect scope.")},e.prototype.on=function(){Kt=this},e.prototype.off=function(){Kt=this.parent},e.prototype.stop=function(e){if(this.active){var t=void 0,n=void 0;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].teardown();for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);if(this.parent&&!e){var r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.active=!1}},e}();var Xt=Ee((function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}}));function Qt(e,t){function n(){var e=n.fns;if(!ee(e))return Ln(e,null,arguments,t,"v-on handler");for(var r=e.slice(),o=0;o<r.length;o++)Ln(r[o],null,arguments,t,"v-on handler")}return n.fns=e,n}function Zt(e,t,n,r,o,i){var s,a,l,c;for(s in e)a=e[s],l=t[s],c=Xt(s),te(a)?"production"!==process.env.NODE_ENV&&jr('Invalid handler for event "'.concat(c.name,'": got ')+String(a),i):te(l)?(te(a.fns)&&(a=e[s]=Qt(a,i)),re(c.once)&&(a=e[s]=o(c.name,a,c.capture)),n(c.name,a,c.capture,c.passive,c.params)):a!==l&&(l.fns=a,e[s]=l);for(s in t)te(e[s])&&r((c=Xt(s)).name,t[s],c.capture)}function en(e,t,n){var r;e instanceof ut&&(e=e.data.hook||(e.data.hook={}));var o=e[t];function i(){n.apply(this,arguments),ye(r.fns,i)}te(o)?r=Qt([i]):ne(o.fns)&&re(o.merged)?(r=o).fns.push(i):r=Qt([o,i]),r.merged=!0,e[t]=r}function tn(e,t,n,r,o){if(ne(t)){if(De(t,n))return e[n]=t[n],o||delete t[n],!0;if(De(t,r))return e[n]=t[r],o||delete t[r],!0}return!1}function nn(e){return oe(e)?[pt(e)]:ee(e)?on(e):void 0}function rn(e){return ne(e)&&ne(e.text)&&!1===e.isComment}function on(e,t){var n,r,o,i,s=[];for(n=0;n<e.length;n++)te(r=e[n])||"boolean"==typeof r||(i=s[o=s.length-1],ee(r)?r.length>0&&(rn((r=on(r,"".concat(t||"","_").concat(n)))[0])&&rn(i)&&(s[o]=pt(i.text+r[0].text),r.shift()),s.push.apply(s,r)):oe(r)?rn(i)?s[o]=pt(i.text+r):""!==r&&s.push(pt(r)):rn(r)&&rn(i)?s[o]=pt(i.text+r.text):(re(e._isVList)&&ne(r.tag)&&te(r.key)&&ne(t)&&(r.key="__vlist".concat(t,"_").concat(n,"__")),s.push(r)));return s}function sn(e,t){var n,r,o,i,s=null;if(ee(e)||"string"==typeof e)for(s=new Array(e.length),n=0,r=e.length;n<r;n++)s[n]=t(e[n],n);else if("number"==typeof e)for(s=new Array(e),n=0;n<e;n++)s[n]=t(n+1,n);else if(se(e))if(at&&e[Symbol.iterator]){s=[];for(var a=e[Symbol.iterator](),l=a.next();!l.done;)s.push(t(l.value,s.length)),l=a.next()}else for(o=Object.keys(e),s=new Array(o.length),n=0,r=o.length;n<r;n++)i=o[n],s[n]=t(e[i],i,n);return ne(s)||(s=[]),s._isVList=!0,s}function an(e,t,n,r){var o,i=this.$scopedSlots[e];i?(n=n||{},r&&("production"===process.env.NODE_ENV||se(r)||jr("slot v-bind without argument expects an Object",this),n=Se(Se({},r),n)),o=i(n)||(ie(t)?t():t)):o=this.$slots[e]||(ie(t)?t():t);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function ln(e){return eo(this.$options,"filters",e,!0)||Me}function cn(e,t){return ee(e)?-1===e.indexOf(t):e!==t}function un(e,t,n,r,o){var i=ze.keyCodes[t]||n;return o&&r&&!ze.keyCodes[t]?cn(o,r):i?cn(i,e):r?ke(r)!==t:void 0===e}function dn(e,t,n,r,o){if(n)if(se(n)){ee(n)&&(n=Ne(n));var i=void 0,s=function(s){if("class"===s||"style"===s||ve(s))i=e;else{var a=e.attrs&&e.attrs.type;i=r||ze.mustUseProp(t,a,s)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var l=we(s),c=ke(s);l in i||c in i||(i[s]=n[s],o&&((e.on||(e.on={}))["update:".concat(s)]=function(e){n[s]=e}))};for(var a in n)s(a)}else"production"!==process.env.NODE_ENV&&jr("v-bind without argument expects an Object or Array value",this);return e}function pn(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t||fn(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,this._c,this),"__static__".concat(e),!1),r}function hn(e,t,n){return fn(e,"__once__".concat(t).concat(n?"_".concat(n):""),!0),e}function fn(e,t,n){if(ee(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&mn(e[r],"".concat(t,"_").concat(r),n);else mn(e,t,n)}function mn(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function gn(e,t){if(t)if(ce(t)){var n=e.on=e.on?Se({},e.on):{};for(var r in t){var o=n[r],i=t[r];n[r]=o?[].concat(o,i):i}}else"production"!==process.env.NODE_ENV&&jr("v-on without argument expects an Object value",this);return e}function vn(e,t,n,r){t=t||{$stable:!n};for(var o=0;o<e.length;o++){var i=e[o];ee(i)?vn(i,t,n):i&&(i.proxy&&(i.fn.proxy=!0),t[i.key]=i.fn)}return r&&(t.$key=r),t}function yn(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r?e[t[n]]=t[n+1]:"production"!==process.env.NODE_ENV&&""!==r&&null!==r&&jr("Invalid value for dynamic directive argument (expected string or null): ".concat(r),this)}return e}function bn(e,t){return"string"==typeof e?t+e:e}function Dn(e){e._o=hn,e._n=fe,e._s=he,e._l=sn,e._t=an,e._q=Ie,e._i=$e,e._m=pn,e._f=ln,e._k=un,e._b=dn,e._v=pt,e._e=dt,e._u=vn,e._g=gn,e._d=yn,e._p=bn}function En(e,t){if(!e||!e.length)return{};for(var n={},r=0,o=e.length;r<o;r++){var i=e[r],s=i.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,i.context!==t&&i.fnContext!==t||!s||null==s.slot)(n.default||(n.default=[])).push(i);else{var a=s.slot,l=n[a]||(n[a]=[]);"template"===i.tag?l.push.apply(l,i.children||[]):l.push(i)}}for(var c in n)n[c].every(Cn)&&delete n[c];return n}function Cn(e){return e.isComment&&!e.asyncFactory||" "===e.text}function wn(e){return e.isComment&&e.asyncFactory}function An(e,t,n,r){var o,i=Object.keys(n).length>0,s=t?!!t.$stable:!i,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&r&&r!==Z&&a===r.$key&&!i&&!r.$hasNormal)return r;for(var l in o={},t)t[l]&&"$"!==l[0]&&(o[l]=_n(e,n,l,t[l]))}else o={};for(var c in n)c in o||(o[c]=kn(n,c));return t&&Object.isExtensible(t)&&(t._normalized=o),Ve(o,"$stable",s),Ve(o,"$key",a),Ve(o,"$hasNormal",i),o}function _n(e,t,n,r){var o=function(){var t=lt;ct(e);var n=arguments.length?r.apply(null,arguments):r({}),o=(n=n&&"object"==typeof n&&!ee(n)?[n]:nn(n))&&n[0];return ct(t),n&&(!o||1===n.length&&o.isComment&&!wn(o))?void 0:n};return r.proxy&&Object.defineProperty(t,n,{get:o,enumerable:!0,configurable:!0}),o}function kn(e,t){return function(){return e[t]}}function xn(e){var t=e.$options,n=t.setup;if(n){var r=e._setupContext=function(e){var t=!1;return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};Ve(t,"_v_attr_proxy",!0),On(t,e.$attrs,Z,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||On(e._listenersProxy={},e.$listeners,Z,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||Nn(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:xe(e.$emit,e),expose:function(n){"production"!==process.env.NODE_ENV&&(t&&jr("expose() should be called only once per setup().",e),t=!0),n&&Object.keys(n).forEach((function(t){return jt(e,n,t)}))}}}(e);ct(e),yt();var o=Ln(n,null,[e._props||Mt({}),r],e,"setup");if(bt(),ct(),ie(o))t.render=o;else if(se(o))if("production"!==process.env.NODE_ENV&&o instanceof ut&&jr("setup() should not return VNodes directly - return a render function instead."),e._setupState=o,o.__sfc){var i=e._setupProxy={};for(var s in o)"__sfc"!==s&&jt(i,o,s)}else for(var s in o)He(s)?"production"!==process.env.NODE_ENV&&jr("Avoid using variables that start with _ or $ in setup()."):jt(e,o,s);else"production"!==process.env.NODE_ENV&&void 0!==o&&jr("setup() should return an object. Received: ".concat(null===o?"null":typeof o))}}function On(e,t,n,r,o){var i=!1;for(var s in t)s in e?t[s]!==n[s]&&(i=!0):(i=!0,Sn(e,s,r,o));for(var s in e)s in t||(i=!0,delete e[s]);return i}function Sn(e,t,n,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return n[r][t]}})}function Nn(e,t){for(var n in t)e[n]=t[n];for(var n in e)n in t||delete e[n]}var Tn=null;function Fn(e,t){return(e.__esModule||at&&"Module"===e[Symbol.toStringTag])&&(e=e.default),se(e)?t.extend(e):e}function Mn(e){if(ee(e))for(var t=0;t<e.length;t++){var n=e[t];if(ne(n)&&(ne(n.componentOptions)||wn(n)))return n}}function In(e,t,n,r,o,i){return(ee(n)||oe(n))&&(o=r,r=n,n=void 0),re(i)&&(o=2),function(e,t,n,r,o){if(ne(n)&&ne(n.__ob__))return"production"!==process.env.NODE_ENV&&jr("Avoid using observed data object as vnode data: ".concat(JSON.stringify(n),"\n")+"Always create fresh vnode data objects in each render!",e),dt();ne(n)&&ne(n.is)&&(t=n.is);if(!t)return dt();"production"!==process.env.NODE_ENV&&ne(n)&&ne(n.key)&&!oe(n.key)&&jr("Avoid using non-primitive value as key, use string/number value instead.",e);ee(r)&&ie(r[0])&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);2===o?r=nn(r):1===o&&(r=function(e){for(var t=0;t<e.length;t++)if(ee(e[t]))return Array.prototype.concat.apply([],e);return e}(r));var i,s;if("string"==typeof t){var a=void 0;s=e.$vnode&&e.$vnode.ns||ze.getTagNamespace(t),ze.isReservedTag(t)?("production"!==process.env.NODE_ENV&&ne(n)&&ne(n.nativeOn)&&"component"!==n.tag&&jr("The .native modifier for v-on is only valid on components but it was used on <".concat(t,">."),e),i=new ut(ze.parsePlatformTagName(t),n,r,void 0,void 0,e)):i=n&&n.pre||!ne(a=eo(e.$options,"components",t))?new ut(t,n,r,void 0,void 0,e):Lr(a,n,e,r,t)}else i=Lr(t,n,e,r);return ee(i)?i:ne(i)?(ne(s)&&$n(i,s),ne(n)&&function(e){se(e.style)&&Xn(e.style);se(e.class)&&Xn(e.class)}(n),i):dt()}(e,t,n,r,o)}function $n(e,t,n){if(e.ns=t,"foreignObject"===e.tag&&(t=void 0,n=!0),ne(e.children))for(var r=0,o=e.children.length;r<o;r++){var i=e.children[r];ne(i.tag)&&(te(i.ns)||re(n)&&"svg"!==i.tag)&&$n(i,t,n)}}function Bn(e,t,n){yt();try{if(t)for(var r=t;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,e,t,n))return}catch(e){Pn(e,r,"errorCaptured hook")}}Pn(e,t,n)}finally{bt()}}function Ln(e,t,n,r,o){var i;try{(i=n?e.apply(t,n):e.call(t))&&!i._isVue&&pe(i)&&!i._handled&&(i.catch((function(e){return Bn(e,r,o+" (Promise/async)")})),i._handled=!0)}catch(e){Bn(e,r,o)}return i}function Pn(e,t,n){if(ze.errorHandler)try{return ze.errorHandler.call(null,e,t,n)}catch(t){t!==e&&Rn(t,null,"config.errorHandler")}Rn(e,t,n)}function Rn(e,t,n){if("production"!==process.env.NODE_ENV&&jr("Error in ".concat(n,': "').concat(e.toString(),'"'),t),!Ue||"undefined"==typeof console)throw e;console.error(e)}var zn,jn=!1,Hn=[],Vn=!1;function Kn(){Vn=!1;var e=Hn.slice(0);Hn.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&it(Promise)){var Wn=Promise.resolve();zn=function(){Wn.then(Kn),Xe&&setTimeout(Te)},jn=!0}else if(Ge||"undefined"==typeof MutationObserver||!it(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())zn="undefined"!=typeof setImmediate&&it(setImmediate)?function(){setImmediate(Kn)}:function(){setTimeout(Kn,0)};else{var Un=1,qn=new MutationObserver(Kn),Gn=document.createTextNode(String(Un));qn.observe(Gn,{characterData:!0}),zn=function(){Un=(Un+1)%2,Gn.data=String(Un)},jn=!0}function Jn(e,t){var n;if(Hn.push((function(){if(e)try{e.call(t)}catch(e){Bn(e,t,"nextTick")}else n&&n(t)})),Vn||(Vn=!0,zn()),!e&&"undefined"!=typeof Promise)return new Promise((function(e){n=e}))}var Yn=new st;function Xn(e){return Qn(e,Yn),Yn.clear(),e}function Qn(e,t){var n,r,o=ee(e);if(!(!o&&!se(e)||Object.isFrozen(e)||e instanceof ut)){if(e.__ob__){var i=e.__ob__.dep.id;if(t.has(i))return;t.add(i)}if(o)for(n=e.length;n--;)Qn(e[n],t);else if(Pt(e))Qn(e.value,t);else for(n=(r=Object.keys(e)).length;n--;)Qn(e[r[n]],t)}}var Zn,er,tr,nr=0,rr=function(){function e(e,t,n,r,o){var i,s;i=this,void 0===(s=Kt&&!Kt._vm?Kt:e?e._scope:void 0)&&(s=Kt),s&&s.active&&s.effects.push(i),(this.vm=e)&&o&&(e._watcher=this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before,"production"!==process.env.NODE_ENV&&(this.onTrack=r.onTrack,this.onTrigger=r.onTrigger)):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++nr,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new st,this.newDepIds=new st,this.expression="production"!==process.env.NODE_ENV?t.toString():"",ie(t)?this.getter=t:(this.getter=function(e){if(!Ke.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=Te,"production"!==process.env.NODE_ENV&&jr('Failed watching path: "'.concat(t,'" ')+"Watcher only accepts simple dot-delimited paths. For full control, use a function instead.",e))),this.value=this.lazy?void 0:this.get()}return e.prototype.get=function(){var e;yt(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Bn(e,t,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&Xn(e),bt(),this.cleanupDeps()}return e},e.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},e.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},e.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Or(this)},e.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||se(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'.concat(this.expression,'"');Ln(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},e.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},e.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},e.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&ye(this.vm._scope.effects,this),this.active){for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},e}();if("production"!==process.env.NODE_ENV){var or=Ue&&window.performance;or&&or.mark&&or.measure&&or.clearMarks&&or.clearMeasures&&(Zn=function(e){return or.mark(e)},er=function(e,t,n){or.measure(e,t,n),or.clearMarks(t),or.clearMarks(n)})}function ir(e,t){tr.$on(e,t)}function sr(e,t){tr.$off(e,t)}function ar(e,t){var n=tr;return function r(){var o=t.apply(null,arguments);null!==o&&n.$off(e,r)}}function lr(e,t,n){tr=e,Zt(t,n||{},ir,sr,ar,e),tr=void 0}var cr=null,ur=!1;function dr(e){var t=cr;return cr=e,function(){cr=t}}function pr(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function hr(e,t){if(t){if(e._directInactive=!1,pr(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)hr(e.$children[n]);mr(e,"activated")}}function fr(e,t){if(!(t&&(e._directInactive=!0,pr(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)fr(e.$children[n]);mr(e,"deactivated")}}function mr(e,t,n,r){void 0===r&&(r=!0),yt();var o=lt;r&&ct(e);var i=e.$options[t],s="".concat(t," hook");if(i)for(var a=0,l=i.length;a<l;a++)Ln(i[a],e,n||null,e,s);e._hasHookEvent&&e.$emit("hook:"+t),r&&ct(o),bt()}var gr=[],vr=[],yr={},br={},Dr=!1,Er=!1,Cr=0;var wr=0,Ar=Date.now;if(Ue&&!Ge){var _r=window.performance;_r&&"function"==typeof _r.now&&Ar()>document.createEvent("Event").timeStamp&&(Ar=function(){return _r.now()})}var kr=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function xr(){var e,t;for(wr=Ar(),Er=!0,gr.sort(kr),Cr=0;Cr<gr.length;Cr++)if((e=gr[Cr]).before&&e.before(),t=e.id,yr[t]=null,e.run(),"production"!==process.env.NODE_ENV&&null!=yr[t]&&(br[t]=(br[t]||0)+1,br[t]>100)){jr("You may have an infinite update loop "+(e.user?'in watcher with expression "'.concat(e.expression,'"'):"in a component render function."),e.vm);break}var n=vr.slice(),r=gr.slice();Cr=gr.length=vr.length=0,yr={},"production"!==process.env.NODE_ENV&&(br={}),Dr=Er=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,hr(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r&&r._watcher===n&&r._isMounted&&!r._isDestroyed&&mr(r,"updated")}}(r),ot&&ze.devtools&&ot.emit("flush")}function Or(e){var t=e.id;if(null==yr[t]&&(e!==gt.target||!e.noRecurse)){if(yr[t]=!0,Er){for(var n=gr.length-1;n>Cr&&gr[n].id>e.id;)n--;gr.splice(n+1,0,e)}else gr.push(e);if(!Dr){if(Dr=!0,"production"!==process.env.NODE_ENV&&!ze.async)return void xr();Jn(xr)}}}function Sr(e){var t=e.$options.provide;if(t){var n=ie(t)?t.call(e):t;if(!se(n))return;for(var r=function(e){var t=e._provided,n=e.$parent&&e.$parent._provided;return n===t?e._provided=Object.create(n):t}(e),o=at?Reflect.ownKeys(n):Object.keys(n),i=0;i<o.length;i++){var s=o[i];Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(n,s))}}}function Nr(e,t){if(e){for(var n=Object.create(null),r=at?Reflect.ownKeys(e):Object.keys(e),o=0;o<r.length;o++){var i=r[o];if("__ob__"!==i){var s=e[i].from;if(s in t._provided)n[i]=t._provided[s];else if("default"in e[i]){var a=e[i].default;n[i]=ie(a)?a.call(t):a}else"production"!==process.env.NODE_ENV&&jr('Injection "'.concat(i,'" not found'),t)}}return n}}function Tr(e,t,n,r,o){var i,s=this,a=o.options;De(r,"_uid")?(i=Object.create(r))._original=r:(i=r,r=r._original);var l=re(a._compiled),c=!l;this.data=e,this.props=t,this.children=n,this.parent=r,this.listeners=e.on||Z,this.injections=Nr(a.inject,r),this.slots=function(){return s.$slots||An(r,e.scopedSlots,s.$slots=En(n,r)),s.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return An(r,e.scopedSlots,this.slots())}}),l&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=An(r,e.scopedSlots,this.$slots)),a._scopeId?this._c=function(e,t,n,o){var s=In(i,e,t,n,o,c);return s&&!ee(s)&&(s.fnScopeId=a._scopeId,s.fnContext=r),s}:this._c=function(e,t,n,r){return In(i,e,t,n,r,c)}}function Fr(e,t,n,r,o){var i=ht(e);return i.fnContext=n,i.fnOptions=r,"production"!==process.env.NODE_ENV&&((i.devtoolsMeta=i.devtoolsMeta||{}).renderContext=o),t.slot&&((i.data||(i.data={})).slot=t.slot),i}function Mr(e,t){for(var n in t)e[we(n)]=t[n]}function Ir(e){return e.name||e.__name||e._componentTag}Dn(Tr.prototype);var $r={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var n=e;$r.prepatch(n,n)}else{(e.componentInstance=function(e,t){var n={_isComponent:!0,_parentVnode:e,parent:t},r=e.data.inlineTemplate;ne(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new e.componentOptions.Ctor(n)}(e,cr)).$mount(t?e.elm:void 0,t)}},prepatch:function(e,t){var n=t.componentOptions;!function(e,t,n,r,o){"production"!==process.env.NODE_ENV&&(ur=!0);var i=r.data.scopedSlots,s=e.$scopedSlots,a=!!(i&&!i.$stable||s!==Z&&!s.$stable||i&&e.$scopedSlots.$key!==i.$key||!i&&e.$scopedSlots.$key),l=!!(o||e.$options._renderChildren||a),c=e.$vnode;e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=o;var u=r.data.attrs||Z;e._attrsProxy&&On(e._attrsProxy,u,c.data&&c.data.attrs||Z,e,"$attrs")&&(l=!0),e.$attrs=u,n=n||Z;var d=e.$options._parentListeners;if(e._listenersProxy&&On(e._listenersProxy,n,d||Z,e,"$listeners"),e.$listeners=e.$options._parentListeners=n,lr(e,n,d),t&&e.$options.props){_t(!1);for(var p=e._props,h=e.$options._propKeys||[],f=0;f<h.length;f++){var m=h[f],g=e.$options.props;p[m]=to(m,g,t,e)}_t(!0),e.$options.propsData=t}l&&(e.$slots=En(o,r.context),e.$forceUpdate()),"production"!==process.env.NODE_ENV&&(ur=!1)}(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,mr(r,"mounted")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,vr.push(t)):hr(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?fr(t,!0):t.$destroy())}},Br=Object.keys($r);function Lr(e,t,n,r,o){if(!te(e)){var i=n.$options._base;if(se(e)&&(e=i.extend(e)),"function"==typeof e){var s;if(te(e.cid)&&(e=function(e,t){if(re(e.error)&&ne(e.errorComp))return e.errorComp;if(ne(e.resolved))return e.resolved;var n=Tn;if(n&&ne(e.owners)&&-1===e.owners.indexOf(n)&&e.owners.push(n),re(e.loading)&&ne(e.loadingComp))return e.loadingComp;if(n&&!ne(e.owners)){var r=e.owners=[n],o=!0,i=null,s=null;n.$on("hook:destroyed",(function(){return ye(r,n)}));var a=function(e){for(var t=0,n=r.length;t<n;t++)r[t].$forceUpdate();e&&(r.length=0,null!==i&&(clearTimeout(i),i=null),null!==s&&(clearTimeout(s),s=null))},l=Be((function(n){e.resolved=Fn(n,t),o?r.length=0:a(!0)})),c=Be((function(t){"production"!==process.env.NODE_ENV&&jr("Failed to resolve async component: ".concat(String(e))+(t?"\nReason: ".concat(t):"")),ne(e.errorComp)&&(e.error=!0,a(!0))})),u=e(l,c);return se(u)&&(pe(u)?te(e.resolved)&&u.then(l,c):pe(u.component)&&(u.component.then(l,c),ne(u.error)&&(e.errorComp=Fn(u.error,t)),ne(u.loading)&&(e.loadingComp=Fn(u.loading,t),0===u.delay?e.loading=!0:i=setTimeout((function(){i=null,te(e.resolved)&&te(e.error)&&(e.loading=!0,a(!1))}),u.delay||200)),ne(u.timeout)&&(s=setTimeout((function(){s=null,te(e.resolved)&&c("production"!==process.env.NODE_ENV?"timeout (".concat(u.timeout,"ms)"):null)}),u.timeout)))),o=!1,e.loading?e.loadingComp:e.resolved}}(s=e,i),void 0===e))return function(e,t,n,r,o){var i=dt();return i.asyncFactory=e,i.asyncMeta={data:t,context:n,children:r,tag:o},i}(s,t,n,r,o);t=t||{},So(e),ne(t.model)&&function(e,t){var n=e.model&&e.model.prop||"value",r=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[n]=t.model.value;var o=t.on||(t.on={}),i=o[r],s=t.model.callback;ne(i)?(ee(i)?-1===i.indexOf(s):i!==s)&&(o[r]=[s].concat(i)):o[r]=s}(e.options,t);var a=function(e,t,n){var r=t.options.props;if(!te(r)){var o={},i=e.attrs,s=e.props;if(ne(i)||ne(s))for(var a in r){var l=ke(a);if("production"!==process.env.NODE_ENV){var c=a.toLowerCase();a!==c&&i&&De(i,c)&&Hr('Prop "'.concat(c,'" is passed to component ')+"".concat(zr(n||t),", but the declared prop name is")+' "'.concat(a,'". ')+"Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM "+'templates. You should probably use "'.concat(l,'" instead of "').concat(a,'".'))}tn(o,s,a,l,!0)||tn(o,i,a,l,!1)}return o}}(t,e,o);if(re(e.options.functional))return function(e,t,n,r,o){var i=e.options,s={},a=i.props;if(ne(a))for(var l in a)s[l]=to(l,a,t||Z);else ne(n.attrs)&&Mr(s,n.attrs),ne(n.props)&&Mr(s,n.props);var c=new Tr(n,s,o,r,e),u=i.render.call(null,c._c,c);if(u instanceof ut)return Fr(u,n,c.parent,i,c);if(ee(u)){for(var d=nn(u)||[],p=new Array(d.length),h=0;h<d.length;h++)p[h]=Fr(d[h],n,c.parent,i,c);return p}}(e,a,t,n,r);var l=t.on;if(t.on=t.nativeOn,re(e.options.abstract)){var c=t.slot;t={},c&&(t.slot=c)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<Br.length;n++){var r=Br[n],o=t[r],i=$r[r];o===i||o&&o._merged||(t[r]=o?Pr(i,o):i)}}(t);var u=Ir(e.options)||o;return new ut("vue-component-".concat(e.cid).concat(u?"-".concat(u):""),t,void 0,void 0,void 0,n,{Ctor:e,propsData:a,listeners:l,tag:o,children:r},s)}"production"!==process.env.NODE_ENV&&jr("Invalid Component definition: ".concat(String(e)),n)}}function Pr(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}var Rr,zr,jr=Te,Hr=Te;if("production"!==process.env.NODE_ENV){var Vr="undefined"!=typeof console,Kr=/(?:^|[-_])(\w)/g;jr=function(e,t){void 0===t&&(t=lt);var n=t?Rr(t):"";ze.warnHandler?ze.warnHandler.call(null,e,t,n):Vr&&!ze.silent&&console.error("[Vue warn]: ".concat(e).concat(n))},Hr=function(e,t){Vr&&!ze.silent&&console.warn("[Vue tip]: ".concat(e)+(t?Rr(t):""))},zr=function(e,t){if(e.$root===e)return"<Root>";var n=ie(e)&&null!=e.cid?e.options:e._isVue?e.$options||e.constructor.options:e,r=Ir(n),o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<".concat(r.replace(Kr,(function(e){return e.toUpperCase()})).replace(/[-_]/g,""),">"):"<Anonymous>")+(o&&!1!==t?" at ".concat(o):"")};Rr=function(e){if(e._isVue&&e.$parent){for(var t=[],n=0;e;){if(t.length>0){var r=t[t.length-1];if(r.constructor===e.constructor){n++,e=e.$parent;continue}n>0&&(t[t.length-1]=[r,n],n=0)}t.push(e),e=e.$parent}return"\n\nfound in\n\n"+t.map((function(e,t){return"".concat(0===t?"---\x3e ":function(e,t){for(var n="";t;)t%2==1&&(n+=e),t>1&&(e+=e),t>>=1;return n}(" ",5+2*t)).concat(ee(e)?"".concat(zr(e[0]),"... (").concat(e[1]," recursive calls)"):zr(e))})).join("\n")}return"\n\n(found in ".concat(zr(e),")")}}var Wr=ze.optionMergeStrategies;function Ur(e,t){if(!t)return e;for(var n,r,o,i=at?Reflect.ownKeys(t):Object.keys(t),s=0;s<i.length;s++)"__ob__"!==(n=i[s])&&(r=e[n],o=t[n],De(e,n)?r!==o&&ce(r)&&ce(o)&&Ur(r,o):Nt(e,n,o));return e}function qr(e,t,n){return n?function(){var r=ie(t)?t.call(n,n):t,o=ie(e)?e.call(n,n):e;return r?Ur(r,o):o}:t?e?function(){return Ur(ie(t)?t.call(this,this):t,ie(e)?e.call(this,this):e)}:t:e}function Gr(e,t){var n=t?e?e.concat(t):ee(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Jr(e,t,n,r){var o=Object.create(e||null);return t?("production"!==process.env.NODE_ENV&&Qr(r,t,n),Se(o,t)):o}"production"!==process.env.NODE_ENV&&(Wr.el=Wr.propsData=function(e,t,n,r){return n||jr('option "'.concat(r,'" can only be used during instance ')+"creation with the `new` keyword."),Yr(e,t)}),Wr.data=function(e,t,n){return n?qr(e,t,n):t&&"function"!=typeof t?("production"!==process.env.NODE_ENV&&jr('The "data" option should be a function that returns a per-instance value in component definitions.',n),e):qr(e,t)},Re.forEach((function(e){Wr[e]=Gr})),Pe.forEach((function(e){Wr[e+"s"]=Jr})),Wr.watch=function(e,t,n,r){if(e===et&&(e=void 0),t===et&&(t=void 0),!t)return Object.create(e||null);if("production"!==process.env.NODE_ENV&&Qr(r,t,n),!e)return t;var o={};for(var i in Se(o,e),t){var s=o[i],a=t[i];s&&!ee(s)&&(s=[s]),o[i]=s?s.concat(a):ee(a)?a:[a]}return o},Wr.props=Wr.methods=Wr.inject=Wr.computed=function(e,t,n,r){if(t&&"production"!==process.env.NODE_ENV&&Qr(r,t,n),!e)return t;var o=Object.create(null);return Se(o,e),t&&Se(o,t),o},Wr.provide=qr;var Yr=function(e,t){return void 0===t?e:t};function Xr(e){new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(je.source,"]*$")).test(e)||jr('Invalid component name: "'+e+'". Component names should conform to valid custom element name in html5 specification.'),(ge(e)||ze.isReservedTag(e))&&jr("Do not use built-in or reserved HTML elements as component id: "+e)}function Qr(e,t,n){ce(t)||jr('Invalid value for option "'.concat(e,'": expected an Object, ')+"but got ".concat(le(t),"."),n)}function Zr(e,t,n){if("production"!==process.env.NODE_ENV&&function(e){for(var t in e.components)Xr(t)}(t),ie(t)&&(t=t.options),function(e,t){var n=e.props;if(n){var r,o,i={};if(ee(n))for(r=n.length;r--;)"string"==typeof(o=n[r])?i[we(o)]={type:null}:"production"!==process.env.NODE_ENV&&jr("props must be strings when using array syntax.");else if(ce(n))for(var s in n)o=n[s],i[we(s)]=ce(o)?o:{type:o};else"production"!==process.env.NODE_ENV&&jr('Invalid value for option "props": expected an Array or an Object, '+"but got ".concat(le(n),"."),t);e.props=i}}(t,n),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(ee(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(ce(n))for(var i in n){var s=n[i];r[i]=ce(s)?Se({from:i},s):{from:s}}else"production"!==process.env.NODE_ENV&&jr('Invalid value for option "inject": expected an Array or an Object, '+"but got ".concat(le(n),"."),t)}}(t,n),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];ie(r)&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=Zr(e,t.extends,n)),t.mixins))for(var r=0,o=t.mixins.length;r<o;r++)e=Zr(e,t.mixins[r],n);var i,s={};for(i in e)a(i);for(i in t)De(e,i)||a(i);function a(r){var o=Wr[r]||Yr;s[r]=o(e[r],t[r],n,r)}return s}function eo(e,t,n,r){if("string"==typeof n){var o=e[t];if(De(o,n))return o[n];var i=we(n);if(De(o,i))return o[i];var s=Ae(i);if(De(o,s))return o[s];var a=o[n]||o[i]||o[s];return"production"!==process.env.NODE_ENV&&r&&!a&&jr("Failed to resolve "+t.slice(0,-1)+": "+n),a}}function to(e,t,n,r){var o=t[e],i=!De(n,e),s=n[e],a=ao(Boolean,o.type);if(a>-1)if(i&&!De(o,"default"))s=!1;else if(""===s||s===ke(e)){var l=ao(String,o.type);(l<0||a<l)&&(s=!0)}if(void 0===s){s=function(e,t,n){if(!De(t,"default"))return;var r=t.default;"production"!==process.env.NODE_ENV&&se(r)&&jr('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',e);if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return ie(r)&&"Function"!==io(t.type)?r.call(e):r}(r,o,e);var c=At;_t(!0),Ot(s),_t(c)}return"production"!==process.env.NODE_ENV&&function(e,t,n,r,o){if(e.required&&o)return void jr('Missing required prop: "'+t+'"',r);if(null==n&&!e.required)return;var i=e.type,s=!i||!0===i,a=[];if(i){ee(i)||(i=[i]);for(var l=0;l<i.length&&!s;l++){var c=ro(n,i[l],r);a.push(c.expectedType||""),s=c.valid}}var u=a.some((function(e){return e}));if(!s&&u)return void jr(function(e,t,n){var r='Invalid prop: type check failed for prop "'.concat(e,'".')+" Expected ".concat(n.map(Ae).join(", ")),o=n[0],i=le(t);1===n.length&&po(o)&&po(typeof t)&&!function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.some((function(e){return"boolean"===e.toLowerCase()}))}(o,i)&&(r+=" with value ".concat(lo(t,o)));r+=", got ".concat(i," "),po(i)&&(r+="with value ".concat(lo(t,i),"."));return r}(t,n,a),r);var d=e.validator;d&&(d(n)||jr('Invalid prop: custom validator check failed for prop "'+t+'".',r))}(o,e,s,r,i),s}var no=/^(String|Number|Boolean|Function|Symbol|BigInt)$/;function ro(e,t,n){var r,o=io(t);if(no.test(o)){var i=typeof e;(r=i===o.toLowerCase())||"object"!==i||(r=e instanceof t)}else if("Object"===o)r=ce(e);else if("Array"===o)r=ee(e);else try{r=e instanceof t}catch(e){jr('Invalid prop type: "'+String(t)+'" is not a constructor',n),r=!1}return{valid:r,expectedType:o}}var oo=/^\s*function (\w+)/;function io(e){var t=e&&e.toString().match(oo);return t?t[1]:""}function so(e,t){return io(e)===io(t)}function ao(e,t){if(!ee(t))return so(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(so(t[n],e))return n;return-1}function lo(e,t){return"String"===t?'"'.concat(e,'"'):"".concat("Number"===t?Number(e):e)}var co,uo=["string","number","boolean"];function po(e){return uo.some((function(t){return e.toLowerCase()===t}))}if("production"!==process.env.NODE_ENV){var ho=me("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,require"),fo=function(e,t){jr('Property or method "'.concat(t,'" is not defined on the instance but ')+"referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.",e)},mo=function(e,t){jr('Property "'.concat(t,'" must be accessed with "$data.').concat(t,'" because ')+'properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internals. See: https://v2.vuejs.org/v2/api/#data',e)},go="undefined"!=typeof Proxy&&it(Proxy);if(go){var vo=me("stop,prevent,self,ctrl,shift,alt,meta,exact");ze.keyCodes=new Proxy(ze.keyCodes,{set:function(e,t,n){return vo(t)?(jr("Avoid overwriting built-in modifier in config.keyCodes: .".concat(t)),!1):(e[t]=n,!0)}})}var yo={has:function(e,t){var n=t in e,r=ho(t)||"string"==typeof t&&"_"===t.charAt(0)&&!(t in e.$data);return n||r||(t in e.$data?mo(e,t):fo(e,t)),n||!r}},bo={get:function(e,t){return"string"!=typeof t||t in e||(t in e.$data?mo(e,t):fo(e,t)),e[t]}};co=function(e){if(go){var t=e.$options,n=t.render&&t.render._withStripped?bo:yo;e._renderProxy=new Proxy(e,n)}else e._renderProxy=e}}var Do={enumerable:!0,configurable:!0,get:Te,set:Te};function Eo(e,t,n){Do.get=function(){return this[t][n]},Do.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Do)}function Co(e){var t=e.$options;if(t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props=Mt({}),o=e.$options._propKeys=[],i=!e.$parent;i||_t(!1);var s=function(s){o.push(s);var a=to(s,t,n,e);if("production"!==process.env.NODE_ENV){var l=ke(s);(ve(l)||ze.isReservedAttr(l))&&jr('"'.concat(l,'" is a reserved attribute and cannot be used as component prop.'),e),St(r,s,a,(function(){i||ur||jr("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's "+'value. Prop being mutated: "'.concat(s,'"'),e)}))}else St(r,s,a);s in e||Eo(e,"_props",s)};for(var a in t)s(a);_t(!0)}(e,t.props),xn(e),t.methods&&function(e,t){var n=e.$options.props;for(var r in t)"production"!==process.env.NODE_ENV&&("function"!=typeof t[r]&&jr('Method "'.concat(r,'" has type "').concat(typeof t[r],'" in the component definition. ')+"Did you reference the function correctly?",e),n&&De(n,r)&&jr('Method "'.concat(r,'" has already been defined as a prop.'),e),r in e&&He(r)&&jr('Method "'.concat(r,'" conflicts with an existing Vue instance method. ')+"Avoid defining component methods that start with _ or $.")),e[r]="function"!=typeof t[r]?Te:xe(t[r],e)}(e,t.methods),t.data)!function(e){var t=e.$options.data;ce(t=e._data=ie(t)?function(e,t){yt();try{return e.call(t,t)}catch(e){return Bn(e,t,"data()"),{}}finally{bt()}}(t,e):t||{})||(t={},"production"!==process.env.NODE_ENV&&jr("data functions should return an object:\nhttps://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",e));var n=Object.keys(t),r=e.$options.props,o=e.$options.methods,i=n.length;for(;i--;){var s=n[i];"production"!==process.env.NODE_ENV&&o&&De(o,s)&&jr('Method "'.concat(s,'" has already been defined as a data property.'),e),r&&De(r,s)?"production"!==process.env.NODE_ENV&&jr('The data property "'.concat(s,'" is already declared as a prop. ')+"Use prop default value instead.",e):He(s)||Eo(e,"_data",s)}var a=Ot(t);a&&a.vmCount++}(e);else{var n=Ot(e._data={});n&&n.vmCount++}t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=rt();for(var o in t){var i=t[o],s=ie(i)?i:i.get;"production"!==process.env.NODE_ENV&&null==s&&jr('Getter is missing for computed property "'.concat(o,'".'),e),r||(n[o]=new rr(e,s||Te,Te,wo)),o in e?"production"!==process.env.NODE_ENV&&(o in e.$data?jr('The computed property "'.concat(o,'" is already defined in data.'),e):e.$options.props&&o in e.$options.props?jr('The computed property "'.concat(o,'" is already defined as a prop.'),e):e.$options.methods&&o in e.$options.methods&&jr('The computed property "'.concat(o,'" is already defined as a method.'),e)):Ao(e,o,i)}}(e,t.computed),t.watch&&t.watch!==et&&function(e,t){for(var n in t){var r=t[n];if(ee(r))for(var o=0;o<r.length;o++)xo(e,n,r[o]);else xo(e,n,r)}}(e,t.watch)}var wo={lazy:!0};function Ao(e,t,n){var r=!rt();ie(n)?(Do.get=r?_o(t):ko(n),Do.set=Te):(Do.get=n.get?r&&!1!==n.cache?_o(t):ko(n.get):Te,Do.set=n.set||Te),"production"!==process.env.NODE_ENV&&Do.set===Te&&(Do.set=function(){jr('Computed property "'.concat(t,'" was assigned to but it has no setter.'),this)}),Object.defineProperty(e,t,Do)}function _o(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),gt.target&&("production"!==process.env.NODE_ENV&&gt.target.onTrack&&gt.target.onTrack({effect:gt.target,target:this,type:"get",key:e}),t.depend()),t.value}}function ko(e){return function(){return e.call(this,this)}}function xo(e,t,n,r){return ce(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var Oo=0;function So(e){var t=e.options;if(e.super){var n=So(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var o in n)n[o]!==r[o]&&(t||(t={}),t[o]=n[o]);return t}(e);r&&Se(e.extendOptions,r),(t=e.options=Zr(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function No(e){"production"===process.env.NODE_ENV||this instanceof No||jr("Vue is a constructor and should be called with the `new` keyword"),this._init(e)}function To(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,o=e._Ctor||(e._Ctor={});if(o[r])return o[r];var i=Ir(e)||Ir(n.options);"production"!==process.env.NODE_ENV&&i&&Xr(i);var s=function(e){this._init(e)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=t++,s.options=Zr(n.options,e),s.super=n,s.options.props&&function(e){var t=e.options.props;for(var n in t)Eo(e.prototype,"_props",n)}(s),s.options.computed&&function(e){var t=e.options.computed;for(var n in t)Ao(e.prototype,n,t[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,Pe.forEach((function(e){s[e]=n[e]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=e,s.sealedOptions=Se({},s.options),o[r]=s,s}}function Fo(e){return e&&(Ir(e.Ctor.options)||e.tag)}function Mo(e,t){return ee(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!ue(e)&&e.test(t)}function Io(e,t){var n=e.cache,r=e.keys,o=e._vnode;for(var i in n){var s=n[i];if(s){var a=s.name;a&&!t(a)&&$o(n,i,r,o)}}}function $o(e,t,n,r){var o=e[t];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),e[t]=null,ye(n,t)}!function(e){e.prototype._init=function(e){var t,n,r=this;r._uid=Oo++,"production"!==process.env.NODE_ENV&&ze.performance&&Zn&&(t="vue-perf-start:".concat(r._uid),n="vue-perf-end:".concat(r._uid),Zn(t)),r._isVue=!0,r.__v_skip=!0,r._scope=new Yt(!0),r._scope._vm=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(r,e):r.$options=Zr(So(r.constructor),e||{},r),"production"!==process.env.NODE_ENV?co(r):r._renderProxy=r,r._self=r,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._provided=n?n._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(r),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&lr(e,t)}(r),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=En(t._renderChildren,r),e.$scopedSlots=n?An(e.$parent,n.data.scopedSlots,e.$slots):Z,e._c=function(t,n,r,o){return In(e,t,n,r,o,!1)},e.$createElement=function(t,n,r,o){return In(e,t,n,r,o,!0)};var o=n&&n.data;"production"!==process.env.NODE_ENV?(St(e,"$attrs",o&&o.attrs||Z,(function(){!ur&&jr("$attrs is readonly.",e)}),!0),St(e,"$listeners",t._parentListeners||Z,(function(){!ur&&jr("$listeners is readonly.",e)}),!0)):(St(e,"$attrs",o&&o.attrs||Z,null,!0),St(e,"$listeners",t._parentListeners||Z,null,!0))}(r),mr(r,"beforeCreate",void 0,!1),function(e){var t=Nr(e.$options.inject,e);t&&(_t(!1),Object.keys(t).forEach((function(n){"production"!==process.env.NODE_ENV?St(e,n,t[n],(function(){jr("Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. "+'injection being mutated: "'.concat(n,'"'),e)})):St(e,n,t[n])})),_t(!0))}(r),Co(r),Sr(r),mr(r,"created"),"production"!==process.env.NODE_ENV&&ze.performance&&Zn&&(r._name=zr(r,!1),Zn(n),er("vue ".concat(r._name," init"),t,n)),r.$options.el&&r.$mount(r.$options.el)}}(No),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};"production"!==process.env.NODE_ENV&&(t.set=function(){jr("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){jr("$props is readonly.",this)}),Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Nt,e.prototype.$delete=Tt,e.prototype.$watch=function(e,t,n){var r=this;if(ce(t))return xo(r,e,t,n);(n=n||{}).user=!0;var o=new rr(r,e,t,n);if(n.immediate){var i='callback for immediate watcher "'.concat(o.expression,'"');yt(),Ln(t,r,[o.value],r,i),bt()}return function(){o.teardown()}}}(No),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(ee(e))for(var o=0,i=e.length;o<i;o++)r.$on(e[o],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(ee(e)){for(var r=0,o=e.length;r<o;r++)n.$off(e[r],t);return n}var i,s=n._events[e];if(!s)return n;if(!t)return n._events[e]=null,n;for(var a=s.length;a--;)if((i=s[a])===t||i.fn===t){s.splice(a,1);break}return n},e.prototype.$emit=function(e){var t=this;if("production"!==process.env.NODE_ENV){var n=e.toLowerCase();n!==e&&t._events[n]&&Hr('Event "'.concat(n,'" is emitted in component ')+"".concat(zr(t),' but the handler is registered for "').concat(e,'". ')+"Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. "+'You should probably use "'.concat(ke(e),'" instead of "').concat(e,'".'))}var r=t._events[e];if(r){r=r.length>1?Oe(r):r;for(var o=Oe(arguments,1),i='event handler for "'.concat(e,'"'),s=0,a=r.length;s<a;s++)Ln(r[s],t,o,t,i)}return t}}(No),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,o=n._vnode,i=dr(n);n._vnode=e,n.$el=o?n.__patch__(o,e):n.__patch__(n.$el,e,t,!1),i(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n);for(var s=n;s&&s.$vnode&&s.$parent&&s.$vnode===s.$parent._vnode;)s.$parent.$el=s.$el,s=s.$parent},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){mr(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||ye(t.$children,e),e._scope.stop(),e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),mr(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(No),function(e){Dn(e.prototype),e.prototype.$nextTick=function(e){return Jn(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,o=n._parentVnode;o&&t._isMounted&&(t.$scopedSlots=An(t.$parent,o.data.scopedSlots,t.$slots,t.$scopedSlots),t._slotsProxy&&Nn(t._slotsProxy,t.$scopedSlots)),t.$vnode=o;try{ct(t),Tn=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){if(Bn(n,t,"render"),"production"!==process.env.NODE_ENV&&t.$options.renderError)try{e=t.$options.renderError.call(t._renderProxy,t.$createElement,n)}catch(n){Bn(n,t,"renderError"),e=t._vnode}else e=t._vnode}finally{Tn=null,ct()}return ee(e)&&1===e.length&&(e=e[0]),e instanceof ut||("production"!==process.env.NODE_ENV&&ee(e)&&jr("Multiple root nodes returned from render function. Render function should return a single root node.",t),e=dt()),e.parent=o,e}}(No);var Bo=[String,RegExp,Array],Lo={name:"keep-alive",abstract:!0,props:{include:Bo,exclude:Bo,max:[String,Number]},methods:{cacheVNode:function(){var e=this,t=e.cache,n=e.keys,r=e.vnodeToCache,o=e.keyToCache;if(r){var i=r.tag,s=r.componentInstance,a=r.componentOptions;t[o]={name:Fo(a),tag:i,componentInstance:s},n.push(o),this.max&&n.length>parseInt(this.max)&&$o(t,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)$o(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){Io(e,(function(e){return Mo(t,e)}))})),this.$watch("exclude",(function(t){Io(e,(function(e){return!Mo(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Mn(e),n=t&&t.componentOptions;if(n){var r=Fo(n),o=this.include,i=this.exclude;if(o&&(!r||!Mo(o,r))||i&&r&&Mo(i,r))return t;var s=this.cache,a=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):t.key;s[l]?(t.componentInstance=s[l].componentInstance,ye(a,l),a.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}},Po={KeepAlive:Lo};!function(e){var t={get:function(){return ze}};"production"!==process.env.NODE_ENV&&(t.set=function(){jr("Do not replace the Vue.config object, set individual fields instead.")}),Object.defineProperty(e,"config",t),e.util={warn:jr,extend:Se,mergeOptions:Zr,defineReactive:St},e.set=Nt,e.delete=Tt,e.nextTick=Jn,e.observable=function(e){return Ot(e),e},e.options=Object.create(null),Pe.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,Se(e.options.components,Po),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=Oe(arguments,1);return n.unshift(this),ie(e.install)?e.install.apply(e,n):ie(e)&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Zr(this.options,e),this}}(e),To(e),function(e){Pe.forEach((function(t){e[t]=function(e,n){return n?("production"!==process.env.NODE_ENV&&"component"===t&&Xr(e),"component"===t&&ce(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&ie(n)&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(No),Object.defineProperty(No.prototype,"$isServer",{get:rt}),Object.defineProperty(No.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(No,"FunctionalRenderContext",{value:Tr}),No.version="2.7.10";var Ro=me("style,class"),zo=me("input,textarea,option,select,progress"),jo=me("contenteditable,draggable,spellcheck"),Ho=me("events,caret,typing,plaintext-only"),Vo=me("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Ko="http://www.w3.org/1999/xlink",Wo=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Uo=function(e){return Wo(e)?e.slice(6,e.length):""},qo=function(e){return null==e||!1===e};function Go(e){for(var t=e.data,n=e,r=e;ne(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=Jo(r.data,t));for(;ne(n=n.parent);)n&&n.data&&(t=Jo(t,n.data));return function(e,t){if(ne(e)||ne(t))return Yo(e,Xo(t));return""}(t.staticClass,t.class)}function Jo(e,t){return{staticClass:Yo(e.staticClass,t.staticClass),class:ne(e.class)?[e.class,t.class]:t.class}}function Yo(e,t){return e?t?e+" "+t:e:t||""}function Xo(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,o=e.length;r<o;r++)ne(t=Xo(e[r]))&&""!==t&&(n&&(n+=" "),n+=t);return n}(e):se(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}var Qo={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Zo=me("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),ei=me("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),ti=function(e){return Zo(e)||ei(e)};var ni=Object.create(null);var ri=me("text,number,password,search,email,tel,url");var oi=Object.freeze({__proto__:null,createElement:function(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(e,t){return document.createElementNS(Qo[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,"")}}),ii={create:function(e,t){si(t)},update:function(e,t){e.data.ref!==t.data.ref&&(si(e,!0),si(t))},destroy:function(e){si(e,!0)}};function si(e,t){var n=e.data.ref;if(ne(n)){var r=e.context,o=e.componentInstance||e.elm,i=t?null:o,s=t?void 0:o;if(ie(n))Ln(n,r,[i],r,"template ref function");else{var a=e.data.refInFor,l="string"==typeof n||"number"==typeof n,c=Pt(n),u=r.$refs;if(l||c)if(a){var d=l?u[n]:n.value;t?ee(d)&&ye(d,o):ee(d)?d.includes(o)||d.push(o):l?(u[n]=[o],ai(r,n,u[n])):n.value=[o]}else if(l){if(t&&u[n]!==o)return;u[n]=s,ai(r,n,i)}else if(c){if(t&&n.value!==o)return;n.value=i}else"production"!==process.env.NODE_ENV&&jr("Invalid template ref type: ".concat(typeof n))}}}function ai(e,t,n){var r=e._setupState;r&&De(r,t)&&(Pt(r[t])?r[t].value=n:r[t]=n)}var li=new ut("",{},[]),ci=["create","activate","update","remove","destroy"];function ui(e,t){return e.key===t.key&&e.asyncFactory===t.asyncFactory&&(e.tag===t.tag&&e.isComment===t.isComment&&ne(e.data)===ne(t.data)&&function(e,t){if("input"!==e.tag)return!0;var n,r=ne(n=e.data)&&ne(n=n.attrs)&&n.type,o=ne(n=t.data)&&ne(n=n.attrs)&&n.type;return r===o||ri(r)&&ri(o)}(e,t)||re(e.isAsyncPlaceholder)&&te(t.asyncFactory.error))}function di(e,t,n){var r,o,i={};for(r=t;r<=n;++r)ne(o=e[r].key)&&(i[o]=r);return i}var pi={create:hi,update:hi,destroy:function(e){hi(e,li)}};function hi(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,o,i=e===li,s=t===li,a=mi(e.data.directives,e.context),l=mi(t.data.directives,t.context),c=[],u=[];for(n in l)r=a[n],o=l[n],r?(o.oldValue=r.value,o.oldArg=r.arg,vi(o,"update",t,e),o.def&&o.def.componentUpdated&&u.push(o)):(vi(o,"bind",t,e),o.def&&o.def.inserted&&c.push(o));if(c.length){var d=function(){for(var n=0;n<c.length;n++)vi(c[n],"inserted",t,e)};i?en(t,"insert",d):d()}u.length&&en(t,"postpatch",(function(){for(var n=0;n<u.length;n++)vi(u[n],"componentUpdated",t,e)}));if(!i)for(n in a)l[n]||vi(a[n],"unbind",e,e,s)}(e,t)}var fi=Object.create(null);function mi(e,t){var n,r,o=Object.create(null);if(!e)return o;for(n=0;n<e.length;n++){if((r=e[n]).modifiers||(r.modifiers=fi),o[gi(r)]=r,t._setupState&&t._setupState.__sfc){var i=r.def||eo(t,"_setupState","v-"+r.name);r.def="function"==typeof i?{bind:i,update:i}:i}r.def=r.def||eo(t.$options,"directives",r.name,!0)}return o}function gi(e){return e.rawName||"".concat(e.name,".").concat(Object.keys(e.modifiers||{}).join("."))}function vi(e,t,n,r,o){var i=e.def&&e.def[t];if(i)try{i(n.elm,e,n,r,o)}catch(r){Bn(r,n.context,"directive ".concat(e.name," ").concat(t," hook"))}}var yi=[ii,pi];function bi(e,t){var n=t.componentOptions;if(!(ne(n)&&!1===n.Ctor.options.inheritAttrs||te(e.data.attrs)&&te(t.data.attrs))){var r,o,i=t.elm,s=e.data.attrs||{},a=t.data.attrs||{};for(r in(ne(a.__ob__)||re(a._v_attr_proxy))&&(a=t.data.attrs=Se({},a)),a)o=a[r],s[r]!==o&&Di(i,r,o,t.data.pre);for(r in(Ge||Ye)&&a.value!==s.value&&Di(i,"value",a.value),s)te(a[r])&&(Wo(r)?i.removeAttributeNS(Ko,Uo(r)):jo(r)||i.removeAttribute(r))}}function Di(e,t,n,r){r||e.tagName.indexOf("-")>-1?Ei(e,t,n):Vo(t)?qo(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):jo(t)?e.setAttribute(t,function(e,t){return qo(t)||"false"===t?"false":"contenteditable"===e&&Ho(t)?t:"true"}(t,n)):Wo(t)?qo(n)?e.removeAttributeNS(Ko,Uo(t)):e.setAttributeNS(Ko,t,n):Ei(e,t,n)}function Ei(e,t,n){if(qo(n))e.removeAttribute(t);else{if(Ge&&!Je&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Ci={create:bi,update:bi};function wi(e,t){var n=t.elm,r=t.data,o=e.data;if(!(te(r.staticClass)&&te(r.class)&&(te(o)||te(o.staticClass)&&te(o.class)))){var i=Go(t),s=n._transitionClasses;ne(s)&&(i=Yo(i,Xo(s))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}}var Ai,_i={create:wi,update:wi};function ki(e,t,n){var r=Ai;return function o(){var i=t.apply(null,arguments);null!==i&&Si(e,o,n,r)}}var xi=jn&&!(Ze&&Number(Ze[1])<=53);function Oi(e,t,n,r){if(xi){var o=wr,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=o||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Ai.addEventListener(e,t,tt?{capture:n,passive:r}:n)}function Si(e,t,n,r){(r||Ai).removeEventListener(e,t._wrapper||t,n)}function Ni(e,t){if(!te(e.data.on)||!te(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Ai=t.elm||e.elm,function(e){if(ne(e.__r)){var t=Ge?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}ne(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),Zt(n,r,Oi,Si,ki,t.context),Ai=void 0}}var Ti,Fi={create:Ni,update:Ni,destroy:function(e){return Ni(e,li)}};function Mi(e,t){if(!te(e.data.domProps)||!te(t.data.domProps)){var n,r,o=t.elm,i=e.data.domProps||{},s=t.data.domProps||{};for(n in(ne(s.__ob__)||re(s._v_attr_proxy))&&(s=t.data.domProps=Se({},s)),i)n in s||(o[n]="");for(n in s){if(r=s[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===i[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var a=te(r)?"":String(r);Ii(o,a)&&(o.value=a)}else if("innerHTML"===n&&ei(o.tagName)&&te(o.innerHTML)){(Ti=Ti||document.createElement("div")).innerHTML="<svg>".concat(r,"</svg>");for(var l=Ti.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}else if(r!==i[n])try{o[n]=r}catch(e){}}}}function Ii(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(ne(r)){if(r.number)return fe(n)!==fe(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var $i={create:Mi,update:Mi},Bi=Ee((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function Li(e){var t=Pi(e.style);return e.staticStyle?Se(e.staticStyle,t):t}function Pi(e){return Array.isArray(e)?Ne(e):"string"==typeof e?Bi(e):e}var Ri,zi=/^--/,ji=/\s*!important$/,Hi=function(e,t,n){if(zi.test(t))e.style.setProperty(t,n);else if(ji.test(n))e.style.setProperty(ke(t),n.replace(ji,""),"important");else{var r=Ki(t);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)e.style[r]=n[o];else e.style[r]=n}},Vi=["Webkit","Moz","ms"],Ki=Ee((function(e){if(Ri=Ri||document.createElement("div").style,"filter"!==(e=we(e))&&e in Ri)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Vi.length;n++){var r=Vi[n]+t;if(r in Ri)return r}}));function Wi(e,t){var n=t.data,r=e.data;if(!(te(n.staticStyle)&&te(n.style)&&te(r.staticStyle)&&te(r.style))){var o,i,s=t.elm,a=r.staticStyle,l=r.normalizedStyle||r.style||{},c=a||l,u=Pi(t.data.style)||{};t.data.normalizedStyle=ne(u.__ob__)?Se({},u):u;var d=function(e,t){var n,r={};if(t)for(var o=e;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=Li(o.data))&&Se(r,n);(n=Li(e.data))&&Se(r,n);for(var i=e;i=i.parent;)i.data&&(n=Li(i.data))&&Se(r,n);return r}(t,!0);for(i in c)te(d[i])&&Hi(s,i,"");for(i in d)(o=d[i])!==c[i]&&Hi(s,i,null==o?"":o)}}var Ui={create:Wi,update:Wi},qi=/\s+/;function Gi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(qi).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" ".concat(e.getAttribute("class")||""," ");n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Ji(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(qi).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" ".concat(e.getAttribute("class")||""," "),r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function Yi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&Se(t,Xi(e.name||"v")),Se(t,e),t}return"string"==typeof e?Xi(e):void 0}}var Xi=Ee((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),Qi=Ue&&!Je,Zi="transition",es="transitionend",ts="animation",ns="animationend";Qi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Zi="WebkitTransition",es="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ts="WebkitAnimation",ns="webkitAnimationEnd"));var rs=Ue?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function is(e){rs((function(){rs(e)}))}function ss(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Gi(e,t))}function as(e,t){e._transitionClasses&&ye(e._transitionClasses,t),Ji(e,t)}function ls(e,t,n){var r=us(e,t),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a="transition"===o?es:ns,l=0,c=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++l>=s&&c()};setTimeout((function(){l<s&&c()}),i+1),e.addEventListener(a,u)}var cs=/\b(transform|all)(,|$)/;function us(e,t){var n,r=window.getComputedStyle(e),o=(r[Zi+"Delay"]||"").split(", "),i=(r[Zi+"Duration"]||"").split(", "),s=ds(o,i),a=(r[ts+"Delay"]||"").split(", "),l=(r[ts+"Duration"]||"").split(", "),c=ds(a,l),u=0,d=0;return"transition"===t?s>0&&(n="transition",u=s,d=i.length):"animation"===t?c>0&&(n="animation",u=c,d=l.length):d=(n=(u=Math.max(s,c))>0?s>c?"transition":"animation":null)?"transition"===n?i.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&cs.test(r[Zi+"Property"])}}function ds(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map((function(t,n){return ps(t)+ps(e[n])})))}function ps(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function hs(e,t){var n=e.elm;ne(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=Yi(e.data.transition);if(!te(r)&&!ne(n._enterCb)&&1===n.nodeType){for(var o=r.css,i=r.type,s=r.enterClass,a=r.enterToClass,l=r.enterActiveClass,c=r.appearClass,u=r.appearToClass,d=r.appearActiveClass,p=r.beforeEnter,h=r.enter,f=r.afterEnter,m=r.enterCancelled,g=r.beforeAppear,v=r.appear,y=r.afterAppear,b=r.appearCancelled,D=r.duration,E=cr,C=cr.$vnode;C&&C.parent;)E=C.context,C=C.parent;var w=!E._isMounted||!e.isRootInsert;if(!w||v||""===v){var A=w&&c?c:s,_=w&&d?d:l,k=w&&u?u:a,x=w&&g||p,O=w&&ie(v)?v:h,S=w&&y||f,N=w&&b||m,T=fe(se(D)?D.enter:D);"production"!==process.env.NODE_ENV&&null!=T&&ms(T,"enter",e);var F=!1!==o&&!Je,M=vs(O),I=n._enterCb=Be((function(){F&&(as(n,k),as(n,_)),I.cancelled?(F&&as(n,A),N&&N(n)):S&&S(n),n._enterCb=null}));e.data.show||en(e,"insert",(function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),O&&O(n,I)})),x&&x(n),F&&(ss(n,A),ss(n,_),is((function(){as(n,A),I.cancelled||(ss(n,k),M||(gs(T)?setTimeout(I,T):ls(n,i,I)))}))),e.data.show&&(t&&t(),O&&O(n,I)),F||M||I()}}}function fs(e,t){var n=e.elm;ne(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=Yi(e.data.transition);if(te(r)||1!==n.nodeType)return t();if(!ne(n._leaveCb)){var o=r.css,i=r.type,s=r.leaveClass,a=r.leaveToClass,l=r.leaveActiveClass,c=r.beforeLeave,u=r.leave,d=r.afterLeave,p=r.leaveCancelled,h=r.delayLeave,f=r.duration,m=!1!==o&&!Je,g=vs(u),v=fe(se(f)?f.leave:f);"production"!==process.env.NODE_ENV&&ne(v)&&ms(v,"leave",e);var y=n._leaveCb=Be((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[e.key]=null),m&&(as(n,a),as(n,l)),y.cancelled?(m&&as(n,s),p&&p(n)):(t(),d&&d(n)),n._leaveCb=null}));h?h(b):b()}function b(){y.cancelled||(!e.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[e.key]=e),c&&c(n),m&&(ss(n,s),ss(n,l),is((function(){as(n,s),y.cancelled||(ss(n,a),g||(gs(v)?setTimeout(y,v):ls(n,i,y)))}))),u&&u(n,y),m||g||y())}}function ms(e,t,n){"number"!=typeof e?jr("<transition> explicit ".concat(t," duration is not a valid number - ")+"got ".concat(JSON.stringify(e),"."),n.context):isNaN(e)&&jr("<transition> explicit ".concat(t," duration is NaN - ")+"the duration expression might be incorrect.",n.context)}function gs(e){return"number"==typeof e&&!isNaN(e)}function vs(e){if(te(e))return!1;var t=e.fns;return ne(t)?vs(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function ys(e,t){!0!==t.data.show&&hs(t)}var bs=function(e){var t,n,r={},o=e.modules,i=e.nodeOps;for(t=0;t<ci.length;++t)for(r[ci[t]]=[],n=0;n<o.length;++n)ne(o[n][ci[t]])&&r[ci[t]].push(o[n][ci[t]]);function s(e){var t=i.parentNode(e);ne(t)&&i.removeChild(t,e)}function a(e,t){return!t&&!e.ns&&!(ze.ignoredElements.length&&ze.ignoredElements.some((function(t){return ue(t)?t.test(e.tag):t===e.tag})))&&ze.isUnknownElement(e.tag)}var l=0;function c(e,t,n,o,s,c,h){if(ne(e.elm)&&ne(c)&&(e=c[h]=ht(e)),e.isRootInsert=!s,!function(e,t,n,o){var i=e.data;if(ne(i)){var s=ne(e.componentInstance)&&i.keepAlive;if(ne(i=i.hook)&&ne(i=i.init)&&i(e,!1),ne(e.componentInstance))return u(e,t),d(n,e.elm,o),re(s)&&function(e,t,n,o){var i,s=e;for(;s.componentInstance;)if(ne(i=(s=s.componentInstance._vnode).data)&&ne(i=i.transition)){for(i=0;i<r.activate.length;++i)r.activate[i](li,s);t.push(s);break}d(n,e.elm,o)}(e,t,n,o),!0}}(e,t,n,o)){var g=e.data,v=e.children,y=e.tag;ne(y)?("production"!==process.env.NODE_ENV&&(g&&g.pre&&l++,a(e,l)&&jr("Unknown custom element: <"+y+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',e.context)),e.elm=e.ns?i.createElementNS(e.ns,y):i.createElement(y,e),m(e),p(e,v,t),ne(g)&&f(e,t),d(n,e.elm,o),"production"!==process.env.NODE_ENV&&g&&g.pre&&l--):re(e.isComment)?(e.elm=i.createComment(e.text),d(n,e.elm,o)):(e.elm=i.createTextNode(e.text),d(n,e.elm,o))}}function u(e,t){ne(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,h(e)?(f(e,t),m(e)):(si(e),t.push(e))}function d(e,t,n){ne(e)&&(ne(n)?i.parentNode(n)===e&&i.insertBefore(e,t,n):i.appendChild(e,t))}function p(e,t,n){if(ee(t)){"production"!==process.env.NODE_ENV&&D(t);for(var r=0;r<t.length;++r)c(t[r],n,e.elm,null,!0,t,r)}else oe(e.text)&&i.appendChild(e.elm,i.createTextNode(String(e.text)))}function h(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return ne(e.tag)}function f(e,n){for(var o=0;o<r.create.length;++o)r.create[o](li,e);ne(t=e.data.hook)&&(ne(t.create)&&t.create(li,e),ne(t.insert)&&n.push(e))}function m(e){var t;if(ne(t=e.fnScopeId))i.setStyleScope(e.elm,t);else for(var n=e;n;)ne(t=n.context)&&ne(t=t.$options._scopeId)&&i.setStyleScope(e.elm,t),n=n.parent;ne(t=cr)&&t!==e.context&&t!==e.fnContext&&ne(t=t.$options._scopeId)&&i.setStyleScope(e.elm,t)}function g(e,t,n,r,o,i){for(;r<=o;++r)c(n[r],i,e,t,!1,n,r)}function v(e){var t,n,o=e.data;if(ne(o))for(ne(t=o.hook)&&ne(t=t.destroy)&&t(e),t=0;t<r.destroy.length;++t)r.destroy[t](e);if(ne(t=e.children))for(n=0;n<e.children.length;++n)v(e.children[n])}function y(e,t,n){for(;t<=n;++t){var r=e[t];ne(r)&&(ne(r.tag)?(b(r),v(r)):s(r.elm))}}function b(e,t){if(ne(t)||ne(e.data)){var n,o=r.remove.length+1;for(ne(t)?t.listeners+=o:t=function(e,t){function n(){0==--n.listeners&&s(e)}return n.listeners=t,n}(e.elm,o),ne(n=e.componentInstance)&&ne(n=n._vnode)&&ne(n.data)&&b(n,t),n=0;n<r.remove.length;++n)r.remove[n](e,t);ne(n=e.data.hook)&&ne(n=n.remove)?n(e,t):t()}else s(e.elm)}function D(e){for(var t={},n=0;n<e.length;n++){var r=e[n],o=r.key;ne(o)&&(t[o]?jr("Duplicate keys detected: '".concat(o,"'. This may cause an update error."),r.context):t[o]=!0)}}function E(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];if(ne(i)&&ui(e,i))return o}}function C(e,t,n,o,s,a){if(e!==t){ne(t.elm)&&ne(o)&&(t=o[s]=ht(t));var l=t.elm=e.elm;if(re(e.isAsyncPlaceholder))ne(t.asyncFactory.resolved)?k(e.elm,t,n):t.isAsyncPlaceholder=!0;else if(re(t.isStatic)&&re(e.isStatic)&&t.key===e.key&&(re(t.isCloned)||re(t.isOnce)))t.componentInstance=e.componentInstance;else{var u,d=t.data;ne(d)&&ne(u=d.hook)&&ne(u=u.prepatch)&&u(e,t);var p=e.children,f=t.children;if(ne(d)&&h(t)){for(u=0;u<r.update.length;++u)r.update[u](e,t);ne(u=d.hook)&&ne(u=u.update)&&u(e,t)}te(t.text)?ne(p)&&ne(f)?p!==f&&function(e,t,n,r,o){var s,a,l,u=0,d=0,p=t.length-1,h=t[0],f=t[p],m=n.length-1,v=n[0],b=n[m],w=!o;for("production"!==process.env.NODE_ENV&&D(n);u<=p&&d<=m;)te(h)?h=t[++u]:te(f)?f=t[--p]:ui(h,v)?(C(h,v,r,n,d),h=t[++u],v=n[++d]):ui(f,b)?(C(f,b,r,n,m),f=t[--p],b=n[--m]):ui(h,b)?(C(h,b,r,n,m),w&&i.insertBefore(e,h.elm,i.nextSibling(f.elm)),h=t[++u],b=n[--m]):ui(f,v)?(C(f,v,r,n,d),w&&i.insertBefore(e,f.elm,h.elm),f=t[--p],v=n[++d]):(te(s)&&(s=di(t,u,p)),te(a=ne(v.key)?s[v.key]:E(v,t,u,p))?c(v,r,e,h.elm,!1,n,d):ui(l=t[a],v)?(C(l,v,r,n,d),t[a]=void 0,w&&i.insertBefore(e,l.elm,h.elm)):c(v,r,e,h.elm,!1,n,d),v=n[++d]);u>p?g(e,te(n[m+1])?null:n[m+1].elm,n,d,m,r):d>m&&y(t,u,p)}(l,p,f,n,a):ne(f)?("production"!==process.env.NODE_ENV&&D(f),ne(e.text)&&i.setTextContent(l,""),g(l,null,f,0,f.length-1,n)):ne(p)?y(p,0,p.length-1):ne(e.text)&&i.setTextContent(l,""):e.text!==t.text&&i.setTextContent(l,t.text),ne(d)&&ne(u=d.hook)&&ne(u=u.postpatch)&&u(e,t)}}}function w(e,t,n){if(re(n)&&ne(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r<t.length;++r)t[r].data.hook.insert(t[r])}var A=!1,_=me("attrs,class,staticClass,staticStyle,key");function k(e,t,n,r){var o,i=t.tag,s=t.data,l=t.children;if(r=r||s&&s.pre,t.elm=e,re(t.isComment)&&ne(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if("production"!==process.env.NODE_ENV&&!function(e,t,n){return ne(t.tag)?0===t.tag.indexOf("vue-component")||!a(t,n)&&t.tag.toLowerCase()===(e.tagName&&e.tagName.toLowerCase()):e.nodeType===(t.isComment?8:3)}(e,t,r))return!1;if(ne(s)&&(ne(o=s.hook)&&ne(o=o.init)&&o(t,!0),ne(o=t.componentInstance)))return u(t,n),!0;if(ne(i)){if(ne(l))if(e.hasChildNodes())if(ne(o=s)&&ne(o=o.domProps)&&ne(o=o.innerHTML)){if(o!==e.innerHTML)return"production"===process.env.NODE_ENV||"undefined"==typeof console||A||(A=!0,console.warn("Parent: ",e),console.warn("server innerHTML: ",o),console.warn("client innerHTML: ",e.innerHTML)),!1}else{for(var c=!0,d=e.firstChild,h=0;h<l.length;h++){if(!d||!k(d,l[h],n,r)){c=!1;break}d=d.nextSibling}if(!c||d)return"production"===process.env.NODE_ENV||"undefined"==typeof console||A||(A=!0,console.warn("Parent: ",e),console.warn("Mismatching childNodes vs. VNodes: ",e.childNodes,l)),!1}else p(t,l,n);if(ne(s)){var m=!1;for(var g in s)if(!_(g)){m=!0,f(t,n);break}!m&&s.class&&Xn(s.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,n,o){if(!te(t)){var s,a=!1,l=[];if(te(e))a=!0,c(t,l);else{var u=ne(e.nodeType);if(!u&&ui(e,t))C(e,t,l,null,null,o);else{if(u){if(1===e.nodeType&&e.hasAttribute("data-server-rendered")&&(e.removeAttribute("data-server-rendered"),n=!0),re(n)){if(k(e,t,l))return w(t,l,!0),e;"production"!==process.env.NODE_ENV&&jr("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}s=e,e=new ut(i.tagName(s).toLowerCase(),{},[],void 0,s)}var d=e.elm,p=i.parentNode(d);if(c(t,l,d._leaveCb?null:p,i.nextSibling(d)),ne(t.parent))for(var f=t.parent,m=h(t);f;){for(var g=0;g<r.destroy.length;++g)r.destroy[g](f);if(f.elm=t.elm,m){for(var b=0;b<r.create.length;++b)r.create[b](li,f);var D=f.data.hook.insert;if(D.merged)for(var E=1;E<D.fns.length;E++)D.fns[E]()}else si(f);f=f.parent}ne(p)?y([e],0,0):ne(e.tag)&&v(e)}}return w(t,l,a),t.elm}ne(e)&&v(e)}}({nodeOps:oi,modules:[Ci,_i,Fi,$i,Ui,Ue?{create:ys,activate:ys,remove:function(e,t){!0!==e.data.show?fs(e,t):t()}}:{}].concat(yi)});Je&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&xs(e,"input")}));var Ds={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?en(n,"postpatch",(function(){Ds.componentUpdated(e,t,n)})):Es(e,t,n.context),e._vOptions=[].map.call(e.options,As)):("textarea"===n.tag||ri(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",_s),e.addEventListener("compositionend",ks),e.addEventListener("change",ks),Je&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Es(e,t,n.context);var r=e._vOptions,o=e._vOptions=[].map.call(e.options,As);if(o.some((function(e,t){return!Ie(e,r[t])})))(e.multiple?t.value.some((function(e){return ws(e,o)})):t.value!==t.oldValue&&ws(t.value,o))&&xs(e,"change")}}};function Es(e,t,n){Cs(e,t,n),(Ge||Ye)&&setTimeout((function(){Cs(e,t,n)}),0)}function Cs(e,t,n){var r=t.value,o=e.multiple;if(!o||Array.isArray(r)){for(var i,s,a=0,l=e.options.length;a<l;a++)if(s=e.options[a],o)i=$e(r,As(s))>-1,s.selected!==i&&(s.selected=i);else if(Ie(As(s),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));o||(e.selectedIndex=-1)}else"production"!==process.env.NODE_ENV&&jr('<select multiple v-model="'.concat(t.expression,'"> ')+"expects an Array value for its binding, but got ".concat(Object.prototype.toString.call(r).slice(8,-1)),n)}function ws(e,t){return t.every((function(t){return!Ie(t,e)}))}function As(e){return"_value"in e?e._value:e.value}function _s(e){e.target.composing=!0}function ks(e){e.target.composing&&(e.target.composing=!1,xs(e.target,"input"))}function xs(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Os(e){return!e.componentInstance||e.data&&e.data.transition?e:Os(e.componentInstance._vnode)}var Ss={bind:function(e,t,n){var r=t.value,o=(n=Os(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&o?(n.data.show=!0,hs(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Os(n)).data&&n.data.transition?(n.data.show=!0,r?hs(n,(function(){e.style.display=e.__vOriginalDisplay})):fs(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,o){o||(e.style.display=e.__vOriginalDisplay)}},Ns={model:Ds,show:Ss},Ts={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Fs(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Fs(Mn(t.children)):e}function Ms(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var o=n._parentListeners;for(var r in o)t[we(r)]=o[r];return t}function Is(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var $s=function(e){return e.tag||wn(e)},Bs=function(e){return"show"===e.name},Ls={name:"transition",props:Ts,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter($s)).length){"production"!==process.env.NODE_ENV&&n.length>1&&jr("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;"production"!==process.env.NODE_ENV&&r&&"in-out"!==r&&"out-in"!==r&&jr("invalid <transition> mode: "+r,this.$parent);var o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var i=Fs(o);if(!i)return o;if(this._leaving)return Is(e,o);var s="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?s+"comment":s+i.tag:oe(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var a=(i.data||(i.data={})).transition=Ms(this),l=this._vnode,c=Fs(l);if(i.data.directives&&i.data.directives.some(Bs)&&(i.data.show=!0),c&&c.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,c)&&!wn(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var u=c.data.transition=Se({},a);if("out-in"===r)return this._leaving=!0,en(u,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Is(e,o);if("in-out"===r){if(wn(i))return l;var d,p=function(){d()};en(a,"afterEnter",p),en(a,"enterCancelled",p),en(u,"delayLeave",(function(e){d=e}))}}return o}}},Ps=Se({tag:String,moveClass:String},Ts);delete Ps.mode;var Rs={props:Ps,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var o=dr(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,o(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=Ms(this),a=0;a<o.length;a++){if((p=o[a]).tag)if(null!=p.key&&0!==String(p.key).indexOf("__vlist"))i.push(p),n[p.key]=p,(p.data||(p.data={})).transition=s;else if("production"!==process.env.NODE_ENV){var l=p.componentOptions,c=l?Ir(l.Ctor.options)||l.tag||"":p.tag;jr("<transition-group> children must be keyed: <".concat(c,">"))}}if(r){var u=[],d=[];for(a=0;a<r.length;a++){var p;(p=r[a]).data.transition=s,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):d.push(p)}this.kept=e(t,null,u),this.removed=d}return e(t,null,i)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(zs),e.forEach(js),e.forEach(Hs),this._reflow=document.body.offsetHeight,e.forEach((function(e){if(e.data.moved){var n=e.elm,r=n.style;ss(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(es,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(es,e),n._moveCb=null,as(n,t))})}})))},methods:{hasMove:function(e,t){if(!Qi)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach((function(e){Ji(n,e)})),Gi(n,t),n.style.display="none",this.$el.appendChild(n);var r=us(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function zs(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function js(e){e.data.newPos=e.elm.getBoundingClientRect()}function Hs(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,o=t.top-n.top;if(r||o){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}var Vs={Transition:Ls,TransitionGroup:Rs};function Ks(e){this.content=e}function Ws(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=Ws(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function Us(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=Us(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}No.config.mustUseProp=function(e,t,n){return"value"===n&&zo(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},No.config.isReservedTag=ti,No.config.isReservedAttr=Ro,No.config.getTagNamespace=function(e){return ei(e)?"svg":"math"===e?"math":void 0},No.config.isUnknownElement=function(e){if(!Ue)return!0;if(ti(e))return!1;if(e=e.toLowerCase(),null!=ni[e])return ni[e];var t=document.createElement(e);return e.indexOf("-")>-1?ni[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:ni[e]=/HTMLUnknownElement/.test(t.toString())},Se(No.options.directives,Ns),Se(No.options.components,Vs),No.prototype.__patch__=Ue?bs:Te,No.prototype.$mount=function(e,t){return function(e,t,n){var r;e.$el=t,e.$options.render||(e.$options.render=dt,"production"!==process.env.NODE_ENV&&(e.$options.template&&"#"!==e.$options.template.charAt(0)||e.$options.el||t?jr("You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",e):jr("Failed to mount component: template or render function not defined.",e))),mr(e,"beforeMount"),r="production"!==process.env.NODE_ENV&&ze.performance&&Zn?function(){var t=e._name,r=e._uid,o="vue-perf-start:".concat(r),i="vue-perf-end:".concat(r);Zn(o);var s=e._render();Zn(i),er("vue ".concat(t," render"),o,i),Zn(o),e._update(s,n),Zn(i),er("vue ".concat(t," patch"),o,i)}:function(){e._update(e._render(),n)};var o={before:function(){e._isMounted&&!e._isDestroyed&&mr(e,"beforeUpdate")}};"production"!==process.env.NODE_ENV&&(o.onTrack=function(t){return mr(e,"renderTracked",[t])},o.onTrigger=function(t){return mr(e,"renderTriggered",[t])}),new rr(e,r,Te,o,!0),n=!1;var i=e._preWatchers;if(i)for(var s=0;s<i.length;s++)i[s].run();return null==e.$vnode&&(e._isMounted=!0,mr(e,"mounted")),e}(this,e=e&&Ue?function(e){if("string"==typeof e){return document.querySelector(e)||("production"!==process.env.NODE_ENV&&jr("Cannot find element: "+e),document.createElement("div"))}return e}(e):void 0,t)},Ue&&setTimeout((function(){ze.devtools&&(ot?ot.emit("init",No):"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&console[console.info?"info":"log"]("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&!1!==ze.productionTip&&"undefined"!=typeof console&&console[console.info?"info":"log"]("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html")}),0),Ks.prototype={constructor:Ks,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Ks(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Ks(n)},addToStart:function(e,t){return new Ks([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ks(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new Ks(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=Ks.from(e)).size?new Ks(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Ks.from(e)).size?new Ks(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ks.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},Ks.from=function(e){if(e instanceof Ks)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ks(t)};class qs{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new qs(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],a=i+s.nodeSize;a>e&&((i<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=a}return new qs(n,r)}cutByIndex(e,t){return e==t?qs.empty:0==e&&t==this.content.length?this:new qs(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new qs(r,o)}addToStart(e){return new qs([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new qs(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,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Ws(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Us(this,e,t,n)}findIndex(e,t=-1){if(0==e)return Js(0,e);if(e==this.size)return Js(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?Js(n+1,o):Js(n,r);r=o}}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 qs.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new qs(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return qs.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new qs(t||e,n)}static from(e){if(!e)return qs.empty;if(e instanceof qs)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new qs([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}qs.empty=new qs([],0);const Gs={index:0,offset:0};function Js(e,t){return Gs.index=e,Gs.offset=t,Gs}function Ys(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Ys(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Ys(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class Xs{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||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&&Ys(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 n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return Xs.none;if(e instanceof Xs)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}Xs.none=[];class Qs extends Error{}class Zs{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ta(this.content,e+this.openStart,t);return n&&new Zs(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Zs(ea(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 Zs.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Zs(qs.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new Zs(e,n,r)}}function ea(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(ea(i.content,t-o-1,n-o-1)))}function ta(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ta(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function na(e,t,n){if(n.openStart>e.depth)throw new Qs("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Qs("Inconsistent open depths");return ra(e,t,n,0)}function ra(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=ra(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(qs.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return la(i,ca(e,o,s,t,r))}{let r=e.parent,o=r.content;return la(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return la(i,ua(e,t,r))}function oa(e,t){if(!t.type.compatibleContent(e.type))throw new Qs("Cannot join "+t.type.name+" onto "+e.type.name)}function ia(e,t,n){let r=e.node(n);return oa(r,t.node(n)),r}function sa(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function aa(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(sa(e.nodeAfter,r),i++));for(let e=i;e<s;e++)sa(o.child(e),r);t&&t.depth==n&&t.textOffset&&sa(t.nodeBefore,r)}function la(e,t){if(!e.type.validContent(t))throw new Qs("Invalid content for node "+e.type.name);return e.copy(t)}function ca(e,t,n,r,o){let i=e.depth>o&&ia(e,t,o+1),s=r.depth>o&&ia(n,r,o+1),a=[];return aa(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(oa(i,s),sa(la(i,ca(e,t,n,r,o+1)),a)):(i&&sa(la(i,ua(e,t,o+1)),a),aa(t,n,o,a),s&&sa(la(s,ua(n,r,o+1)),a)),aa(r,null,o,a),new qs(a)}function ua(e,t,n){let r=[];if(aa(null,e,n,r),e.depth>n){sa(la(ia(e,t,n+1),ua(e,t,n+1)),r)}return aa(t,null,n,r),new qs(r)}Zs.empty=new Zs(qs.empty,0,0);class da{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].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 n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}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):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Xs.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}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 n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ma(this,e,n);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 n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new da(t,n,o)}static resolveCached(e,t){for(let n=0;n<pa.length;n++){let r=pa[n];if(r.pos==t&&r.doc==e)return r}let n=pa[ha]=da.resolve(e,t);return ha=(ha+1)%fa,n}}let pa=[],ha=0,fa=12;class ma{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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 ga=Object.create(null);class va{constructor(e,t,n,r=Xs.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||qs.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,n,r=0){this.content.nodesBetween(e,t,n,r,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,n,r){return this.content.textBetween(e,t,n,r)}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,n){return this.type==e&&Ys(this.attrs,t||e.defaultAttrs||ga)&&Xs.sameSet(this.marks,n||Xs.none)}copy(e=null){return e==this.content?this:new va(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new va(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Zs.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new Zs(a,r.depth-i,o.depth-i)}replace(e,t,n){return na(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return da.resolveCached(this,e)}resolveNoCache(e){return da.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}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()+")"),ba(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,n=qs.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=Xs.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Xs.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.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((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=qs.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}va.prototype.text=void 0;class ya extends va{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ba(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 ya(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ya(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&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 ba(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Da{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Ea(e,t);if(null==n.next)return Da.empty;let r=Ca(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(Oa(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);Oa(e,n).forEach((e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new Da(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(xa);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}}(function(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}function i(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(i(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(i(e.expr,s),t),s=t}if(-1==e.max)o(i(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),o(i(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(e.exprs[r],t);if(r==e.exprs.length-1)return s;o(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),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,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return this.next.length&&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 n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(e,n);if(a&&(!t||a.validEnd))return qs.from(s.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.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=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}Da.empty=new Da(!0);class Ea{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 Ca(e){let t=[];do{t.push(wa(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function wa(e){let t=[];do{t.push(Aa(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Aa(e){let t=function(e){if(e.eat("(")){let t=Ca(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&o.push(r)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=ka(e,t)}return t}function _a(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function ka(e,t){let n=_a(e),r=n;return e.eat(",")&&(r="}"!=e.next?_a(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function xa(e,t){return t-e}function Oa(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(xa)}function Sa(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Na(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function Ta(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Ma(e[n]);return t}class Fa{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Ta(n.attrs),this.defaultAttrs=Sa(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Da.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:Na(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new va(this,this.computeAttrs(e),qs.from(t),Xs.setFrom(n))}createChecked(e=null,t,n){if(t=qs.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new va(this,this.computeAttrs(e),t,Xs.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=qs.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(qs.empty,!0);return o?new va(this,e,t.append(o),Xs.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Xs.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new Fa(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Ma{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ia{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ta(r.attrs),this.excluded=null;let o=Sa(this.attrs);this.instance=o?new Xs(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Xs(this,Na(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new Ia(e,r++,t,o))),n}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 $a{constructor(e){this.cached=Object.create(null),this.spec={nodes:Ks.from(e.nodes),marks:Ks.from(e.marks||{}),topNode:e.topNode},this.nodes=Fa.compile(this.spec.nodes,this),this.marks=Ia.compile(this.spec.marks,this);let t=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],r=n.spec.content||"",o=n.spec.marks;n.contentMatch=t[r]||(t[r]=Da.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?Ba(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Ba(this,n.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,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Fa))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ya(n,n.defaultAttrs,e,Xs.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return va.fromJSON(this,e)}markFromJSON(e){return Xs.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ba(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class La{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new Va(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Va(this,t,!0);return n.addAll(e,t.from,t.to),Zs.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Ka(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=Wa(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=Wa(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new La(e,La.schemaRules(e)))}}const Pa={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},Ra={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},za={ol:!0,ul:!0};function ja(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Ha{constructor(e,t,n,r,o,i,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Xs.none,this.stashMarks=[],this.match=i||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(qs.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=qs.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(qs.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,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):Ua(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Pa.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Va{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,o=t.topNode,i=ja(null,t.preserveWhitespace,0)|(n?4:0);r=o?new Ha(o.type,o.attrs,Xs.none,Xs.none,!0,t.topMatch||o.type.contentMatch,i):new Ha(n?null:e.schema.topNodeType,null,Xs.none,Xs.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):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 r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();za.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&za.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:Ra.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 t,n=this.top,i=this.needsBlock;if(Pa.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=i}else this.addElementByRule(e,o,!1===o.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Xs.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let o=this.parser.matchStyle(e[n],e[n+1],this,r);if(!o)continue e;if(o.ignore)return null;if(t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;r=o}return t}addElementByRule(e,t,n){let r,o,i;if(t.node)o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace);else{i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i)}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(e,t,n){let r=t||0;for(let o=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let i=ja(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new Ha(e,t,o.activeMarks,o.pendingMarks,n,null,i)),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 n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].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("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function Ka(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Wa(e){let t={};for(let n in e)t[n]=e[n];return t}function Ua(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class qa{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Ja(t).createDocumentFragment());let r=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=qa.renderSpec(Ja(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&qa.renderSpec(Ja(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,o=t[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?e.createElementNS(n,o):e.createElement(o),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let o=l;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=qa.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new qa(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ga(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Ga(e.marks)}}function Ga(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Ja(e){return e.document||window.document}const Ya=Math.pow(2,16);function Xa(e,t){return e+t*Ya}function Qa(e){return 65535&e}class Za{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class el{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&el.empty)return el.empty}recover(e){let t=0,n=Qa(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Ya}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(e<=u){let o=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?a:u)?null:Xa(s/3,e-a),d=e==a?2:e==u?1:4;return(t<0?e!=a:e!=u)&&(d|=8),new Za(o,d,i)}r+=c-l}return n?e+r:new Za(e+r,0,null)}touches(e,t){let n=0,r=Qa(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+o];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+i]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new el(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?el.empty:new el(e<0?[0,-e,0]:[0,0,e])}}el.empty=new el([]);class tl{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new tl(this.maps,this.mirror,e,t)}copy(){return new tl(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r: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,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new tl;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new Za(e,r,null)}}const nl=Object.create(null);class rl{getMap(){return el.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=nl[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in nl)throw new RangeError("Duplicate use of step JSON ID "+e);return nl[e]=t,t.prototype.jsonID=e,t}}class ol{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ol(e,null)}static fail(e){return new ol(null,e)}static fromReplace(e,t,n,r){try{return ol.ok(e.replace(t,n,r))}catch(e){if(e instanceof Qs)return ol.fail(e.message);throw e}}}function il(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(il(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return qs.fromArray(r)}class sl extends rl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new Zs(il(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return ol.fromReplace(e,this.from,this.to,o)}invert(){return new al(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new sl(t.pos,n.pos,this.mark)}merge(e){return e instanceof sl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new sl(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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new sl(t.from,t.to,e.markFromJSON(t.mark))}}rl.jsonID("addMark",sl);class al extends rl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Zs(il(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return ol.fromReplace(e,this.from,this.to,n)}invert(){return new sl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new al(t.pos,n.pos,this.mark)}merge(e){return e instanceof al&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new al(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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new al(t.from,t.to,e.markFromJSON(t.mark))}}rl.jsonID("removeMark",al);class ll extends rl{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&ul(e,this.from,this.to)?ol.fail("Structure replace would overwrite content"):ol.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new el([this.from,this.to-this.from,this.slice.size])}invert(e){return new ll(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new ll(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof ll)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?Zs.empty:new Zs(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ll(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?Zs.empty:new Zs(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ll(this.from,this.to+(e.to-e.from),t,this.structure)}}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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ll(t.from,t.to,Zs.fromJSON(e,t.slice),!!t.structure)}}rl.jsonID("replace",ll);class cl extends rl{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(ul(e,this.from,this.gapFrom)||ul(e,this.gapTo,this.to)))return ol.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ol.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?ol.fromReplace(e,this.from,this.to,n):ol.fail("Content does not fit in gap")}getMap(){return new el([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 cl(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),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new cl(t.pos,n.pos,r,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("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new cl(t.from,t.to,t.gapFrom,t.gapTo,Zs.fromJSON(e,t.slice),t.insert,!!t.structure)}}function ul(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function dl(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function pl(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!dl(r,o,i))break}return null}function hl(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return i?o.map(fl).concat({type:t,attrs:n}).concat(i.map(fl)):null}function fl(e){return{type:e,attrs:null}}function ml(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function gl(e,t){let n=e.resolve(t),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function vl(e,t,n=t,r=Zs.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return yl(o,i,r)?new ll(t,n,r):new bl(o,i,r).fit()}function yl(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}rl.jsonID("replaceAround",cl);class bl{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=qs.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=qs.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new Zs(o,i,s);return e>-1?new cl(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new ll(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=Cl(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(o?a.matchType(o.type)||(l=a.fillBefore(qs.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Cl(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Zs(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Cl(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new Zs(Dl(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new Zs(Dl(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let p=s.size+e-(i.content.size-i.openEnd);for(;l<s.childCount;){let e=s.child(l),t=u.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(u=t,c.push(wl(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=El(this.placed,t,qs.from(c)),this.frontier[t].match=u,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?Zs.empty:new Zs(Dl(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new Zs(Dl(i.content,e,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Al(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=Al(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=Al(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,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=El(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=El(this.placed,this.depth,qs.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(qs.empty,!0);e.childCount&&(this.placed=El(this.placed,this.frontier.length,e))}}function Dl(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Dl(e.firstChild.content,t-1,n)))}function El(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(El(e.lastChild.content,t-1,n)))}function Cl(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function wl(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,wl(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(qs.empty,!0)))),e.copy(r)}function Al(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function _l(e){return e.spec.defining||e.spec.definingForContent}function kl(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(kl(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(qs.empty,!0))}return e}function xl(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}let Ol=class extends Error{};Ol=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Ol.prototype=Object.create(Error.prototype)).constructor=Ol,Ol.prototype.name="TransformError";class Sl{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new tl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ol(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,n=Zs.empty){let r=vl(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Zs(qs.from(n),0,0))}delete(e,t){return this.replace(e,t,Zs.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(yl(o,i,r))return e.step(new ll(t,n,r));let s=xl(o,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:o.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=c[e].type,n=_l(t);if(n&&o.node(l).type!=t)u=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+u+1)%(r.openStart+1),d=c[a];if(d)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),h=o.index(c-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(o.before(c),u?i.after(c):n,new Zs(kl(r.content,0,r.openStart,a),a,r.openEnd))}}let d=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>d));a--){let e=s[a];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new Zs(qs.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=xl(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=qs.empty,d=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=qs.from(r.node(e).copy(u)),d++):l--;let p=qs.empty,h=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,p=qs.from(o.node(e).copy(p)),h++):c++;e.step(new cl(l,c,s,a,new Zs(u.append(p),d,h),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new ll(t-n,t+n,Zs.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=qs.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=qs.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new cl(o,i,o,i,new Zs(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){e.clearIncompatible(e.mapping.slice(i).map(n,1),r);let s=e.mapping.slice(i),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new cl(a,l,a+1,l-1,new Zs(qs.from(r.create(o,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new cl(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Zs(qs.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=qs.empty,s=qs.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){i=qs.from(o.node(e).copy(i));let t=r&&r[a];s=qs.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new ll(t,t,new Zs(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=d:s.push(o=new al(c,d,u[e])));i&&i.to==c?i.to=d:a.push(i=new sl(c,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;i++;let a=null;if(r instanceof Ia){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&l.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,t),to:r,step:i})}}})),o.forEach((t=>e.step(new al(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let t=0;t<o.childCount;t++){let a=o.child(t),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new al(s,l,a.marks[t]))}else i.push(new ll(s,l,Zs.empty));s=l}if(!r.validEnd){let t=r.fillBefore(qs.empty,!0);e.replace(s,s,new Zs(t,0,0))}for(let t=i.length-1;t>=0;t--)e.step(i[t])}(this,e,t,n),this}}const Nl=Object.create(null);class Tl{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Fl(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=Zs.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?Zs.empty:t),0==s&&Hl(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),Hl(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new $l(e):jl(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?jl(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):jl(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Rl(e.node(0))}static atStart(e){return jl(e,e,0,0,1)||new Rl(e)}static atEnd(e){return jl(e,e,e.content.size,e.childCount,-1)||new Rl(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Nl[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Nl)throw new RangeError("Duplicate use of selection JSON ID "+e);return Nl[e]=t,t.prototype.jsonID=e,t}getBookmark(){return $l.between(this.$anchor,this.$head).getBookmark()}}Tl.prototype.visible=!0;class Fl{constructor(e,t){this.$from=e,this.$to=t}}let Ml=!1;function Il(e){Ml||e.parent.inlineContent||(Ml=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class $l extends Tl{constructor(e,t=e){Il(e),Il(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return Tl.near(n);let r=e.resolve(t.map(this.anchor));return new $l(r.parent.inlineContent?r:n,n)}replace(e,t=Zs.empty){if(super.replace(e,t),t==Zs.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof $l&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new $l(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=Tl.findFrom(t,n,!0)||Tl.findFrom(t,-n,!0);if(!e)return Tl.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(Tl.findFrom(e,-n,!0)||Tl.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new $l(e,t)}}Tl.jsonID("text",$l);class Bl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Bl(e.map(this.anchor),e.map(this.head))}resolve(e){return $l.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ll extends Tl{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?Tl.near(o):new Ll(o)}content(){return new Zs(qs.from(this.node),0,0)}eq(e){return e instanceof Ll&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Pl(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ll(e.resolve(t.anchor))}static create(e,t){return new Ll(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Ll.prototype.visible=!1,Tl.jsonID("node",Ll);class Pl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Bl(n,n):new Pl(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ll.isSelectable(n)?new Ll(t):Tl.near(t)}}class Rl extends Tl{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Zs.empty){if(t==Zs.empty){e.delete(0,e.doc.content.size);let t=Tl.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Rl(e)}map(e){return new Rl(e)}eq(e){return e instanceof Rl}getBookmark(){return zl}}Tl.jsonID("all",Rl);const zl={map(){return this},resolve:e=>new Rl(e)};function jl(e,t,n,r,o,i=!1){if(t.inlineContent)return $l.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&Ll.isSelectable(r))return Ll.create(e,n-(o<0?r.nodeSize:0))}else{let t=jl(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function Hl(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof ll||i instanceof cl)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==o&&(o=r)})),e.setSelection(Tl.near(e.doc.resolve(o),n)))}function Vl(e,t){return t&&e?e.bind(t):e}class Kl{constructor(e,t,n){this.name=e,this.init=Vl(t.init,n),this.apply=Vl(t.apply,n)}}function Wl(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Wl(o,t,{})),n[r]=o}return n}new Kl("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Kl("selection",{init:(e,t)=>e.selection||Tl.atStart(t.doc),apply:e=>e.selection}),new Kl("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Kl("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t});class Ul{constructor(e){this.spec=e,this.props={},e.props&&Wl(e.props,this,this.props),this.key=e.key?e.key.key:Gl("plugin")}getState(e){return e[this.key]}}const ql=Object.create(null);function Gl(e){return e in ql?e+"$"+ ++ql[e]:(ql[e]=0,e+"$")}class Jl{constructor(e="key"){this.key=Gl(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Yl="undefined"!=typeof navigator?navigator:null,Xl="undefined"!=typeof document?document:null,Ql=Yl&&Yl.userAgent||"",Zl=/Edge\/(\d+)/.exec(Ql),ec=/MSIE \d/.exec(Ql),tc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ql),nc=!!(ec||tc||Zl),rc=ec?document.documentMode:tc?+tc[1]:Zl?+Zl[1]:0,oc=!nc&&/gecko\/(\d+)/i.test(Ql);oc&&(/Firefox\/(\d+)/.exec(Ql)||[0,0])[1];const ic=!nc&&/Chrome\/(\d+)/.exec(Ql),sc=!!ic,ac=ic?+ic[1]:0,lc=!nc&&!!Yl&&/Apple Computer/.test(Yl.vendor),cc=lc&&(/Mobile\/\w+/.test(Ql)||!!Yl&&Yl.maxTouchPoints>2),uc=cc||!!Yl&&/Mac/.test(Yl.platform),dc=/Android \d/.test(Ql),pc=!!Xl&&"webkitFontSmoothing"in Xl.documentElement.style,hc=pc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,fc=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},mc=/^(img|br|input|textarea|hr)$/i;function gc(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:vc(e))){let n=e.parentNode;if(!n||1!=n.nodeType||yc(e)||mc.test(e.nodeName)||"false"==e.contentEditable)return!1;t=fc(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?vc(e):0}}}function vc(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function yc(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const bc=function(e){let t=e.isCollapsed;return t&&sc&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Dc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Ec(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(bc(n)){for(a=c;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Ll.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==vc(e);r||o;){if(e==n)return!0;let t=fc(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==vc(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;l=new Ll(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=Sc(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)}return l}function Cc(e){return e.editable?e.hasFocus():function(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function wc(e,t=!1){let n=e.state.selection;if(function(e,t){if(t instanceof Ll){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Oc(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Oc(e)}(e,n),Cc(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&sc){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&(r=t.anchorNode,o=t.anchorOffset,i=n.anchorNode,s=n.anchorOffset,i&&(gc(r,o,i,s,-1)||gc(r,o,i,s,1))))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}var r,o,i,s;if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,fc(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&nc&&rc<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,o,{anchor:i,head:s}=n;!Ac||n instanceof $l||(n.$from.parent.inlineContent||(r=_c(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=_c(e,n.to))),e.docView.setSelection(i,s,e.root,t),Ac&&(r&&xc(r),o&&xc(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Cc(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ac=lc||sc&&ac<63;function _c(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(lc&&o&&"false"==o.contentEditable)return kc(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return kc(o);if(i)return kc(i)}}function kc(e){return e.contentEditable="true",lc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function xc(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Oc(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Sc(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||$l.between(t,n,r)}function Nc(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&Tl.findFrom(i,t)}function Tc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Fc(e,t,n){let r=e.state.selection;if(!(r instanceof $l)){if(r instanceof Ll&&r.node.isInline)return Tc(e,new $l(t>0?r.$to:r.$from));{let n=Nc(e.state,t);return!!n&&Tc(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=Nc(e.state,t);return!!(n&&n instanceof Ll)&&Tc(e,n)}if(!(uc&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Ll.isSelectable(i)?Tc(e,new Ll(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!pc&&Tc(e,new $l(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function Mc(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ic(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function $c(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(oc&&1==n.nodeType&&r<Mc(n)&&Ic(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Ic(e))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Lc(n))break;{let t=n.previousSibling;for(;t&&Ic(t);)o=n.parentNode,i=fc(t),t=t.previousSibling;if(t)n=t,r=Mc(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Pc(e,t,n,r):o&&Pc(e,t,o,i)}function Bc(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=Mc(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Ic(n.childNodes[r]))break;o=n,i=++r}else{if(Lc(n))break;{let t=n.nextSibling;for(;t&&Ic(t);)o=t.parentNode,i=fc(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=Mc(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&Pc(e,t,o,i)}function Lc(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Pc(e,t,n,r){if(bc(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:o}=e;setTimeout((()=>{e.state==o&&wc(e)}),50)}function Rc(e,t,n){let r=e.state.selection;if(r instanceof $l&&!r.empty||n.indexOf("s")>-1)return!1;if(uc&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Nc(e.state,t);if(n&&n instanceof Ll)return Tc(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof Rl?Tl.near(n,t):Tl.findFrom(n,t);return!!s&&Tc(e,s)}return!1}function zc(e,t){if(!(e.state.selection instanceof $l))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function jc(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Hc(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||uc&&72==n&&"c"==r?zc(e,-1)||$c(e):46==n||uc&&68==n&&"c"==r?zc(e,1)||Bc(e):13==n||27==n||(37==n||uc&&66==n&&"c"==r?Fc(e,-1,r)||$c(e):39==n||uc&&70==n&&"c"==r?Fc(e,1,r)||Bc(e):38==n||uc&&80==n&&"c"==r?Rc(e,-1,r)||$c(e):40==n||uc&&78==n&&"c"==r?function(e){if(!lc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;jc(e,n,"true"),setTimeout((()=>jc(e,n,"false")),20)}return!1}(e)||Rc(e,1,r)||Bc(e):r==(uc?"m":"c")&&(66==n||73==n||89==n||90==n))}function Vc(e,t){let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||qa.fromSchema(e.state.schema),a=Zc(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=Xc[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Kc(e,t,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new Zs(qs.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):Zs.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,o,r)));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=qa.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Zc().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Xc[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),pc&&function(e){let t=e.querySelectorAll(sc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0&&i.firstChild;e--)i=i.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||La.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Wc.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:i,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=qs.from(t.create(n[e+1],o)),i++,s++}return new Zs(o,i,s)}(Yc(s,+u[1],+u[2]),u[4]);else if(s=Zs.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach((e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&qc(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Gc(i[i.length-1],r.length));let t=Uc(e,n);i.push(t),o=o.matchType(t.type),r=n}})),i)return qs.from(i)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Yc(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Wc=/^(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 Uc(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,qs.from(e));return e}function qc(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=qc(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(qs.from(Uc(n,e,o+1))))}}function Gc(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Gc(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(qs.empty,!0);return e.copy(n.append(r))}function Jc(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return o<r-1&&(a=Jc(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(qs.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Yc(e,t,n){return t<e.openStart&&(e=new Zs(Jc(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Zs(Jc(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Xc={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 Qc=null;function Zc(){return Qc||(Qc=document.implementation.createHTMLDocument("title"))}const eu={};let tu={};function nu(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ru(e){return{left:e.clientX,top:e.clientY}}function ou(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,(t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function iu(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function su(e,t,n,r,o){return ou(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof Ll&&(n=o.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(Ll.isSelectable(t)){r=n&&o.$from.depth>0&&e>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(e);break}}return null!=r&&(iu(e,Ll.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Ll.isSelectable(r))&&(iu(e,new Ll(n),"pointer"),!0)}(e,n))}function au(e,t,n,r){return ou(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function lu(e,t,n,r){return ou(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(iu(e,$l.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(n.inlineContent)iu(e,$l.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Ll.isSelectable(n))continue;iu(e,Ll.create(r,i),"pointer")}return!0}}(e,n,r)}function cu(e){return gu(e)}tu.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!pu(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!dc||!sc||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!cc||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Hc(e,n)?n.preventDefault():nu(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,Dc(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},tu.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},tu.keypress=(e,t)=>{let n=t;if(pu(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||uc&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof $l&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const uu=uc?"metaKey":"ctrlKey";eu.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=cu(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[uu]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(ru(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new du(e,s,n,!!r)):("doubleClick"==i?au:lu)(e,s.pos,s.inside,n)?n.preventDefault():nu(e,"pointer"))};class du{constructor(e,t,n,r){let o,i;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[uu],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Ll&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!oc||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)),nu(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((()=>wc(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(ru(e))),this.allowDefault||!t?nu(this.view,"pointer"):su(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||lc&&this.mightDrag&&!this.mightDrag.node.isAtom||sc&&!(this.view.state.selection instanceof $l)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(iu(this.view,Tl.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):nu(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),nu(this.view,"pointer"),0==e.buttons&&this.done()}}function pu(e,t){return!!e.composing||!!(lc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}eu.touchdown=e=>{cu(e),nu(e,"pointer")},eu.contextmenu=e=>cu(e);const hu=dc?5e3:-1;function fu(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>gu(e)),t))}function mu(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function gu(e,t=!1){if(!(dc&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),mu(e),t||e.docView&&e.docView.dirty){let t=Ec(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}tu.compositionstart=tu.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),gu(e,!0),e.markCursor=null;else if(gu(e),oc&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}fu(e,hu)},tu.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,fu(e,20))};const vu=nc&&rc<15||cc&&hc<604;function yu(e,t,n,r){let o=Kc(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,o||Zs.empty))))return!0;if(!o)return!1;let i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),s=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}eu.copy=tu.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=vu?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Vc(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},tu.paste=(e,t)=>{let n=t;if(e.composing&&!dc)return;let r=vu?null:n.clipboardData;r&&yu(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?yu(e,r.value,null,t):yu(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class bu{constructor(e,t){this.slice=e,this.move=t}}const Du=uc?"altKey":"ctrlKey";eu.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(ru(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Ll?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(Ll.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(Ll.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=Vc(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(vu?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",vu||n.dataTransfer.setData("text/plain",l),e.dragging=new bu(s,!n[Du])},eu.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},tu.dragover=tu.dragenter=(e,t)=>t.preventDefault(),tu.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(ru(n));if(!o)return;let i=e.state.doc.resolve(o.pos);if(!i)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Kc(e,n.dataTransfer.getData(vu?"Text":"text/plain"),vu?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Du]);if(e.someProp("handleDrop",(t=>t(e,n,s||Zs.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(i,i,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}(e.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let h=c.doc.resolve(u);if(d&&Ll.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ll(h));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),c.setSelection(Sc(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},eu.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&wc(e)}),20))},eu.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},eu.beforeinput=(e,t)=>{if(sc&&dc&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,Dc(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in tu)eu[e]=tu[e];function Eu(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Cu{constructor(e,t){this.toDOM=e,this.spec=t||xu,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new _u(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Cu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Eu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class wu{constructor(e,t){this.attrs=e,this.spec=t||xu}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new _u(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof wu&&Eu(this.attrs,e.attrs)&&Eu(this.spec,e.spec)}static is(e){return e.type instanceof wu}destroy(){}}class Au{constructor(e,t){this.attrs=e,this.spec=t||xu}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new _u(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof Au&&Eu(this.attrs,e.attrs)&&Eu(this.spec,e.spec)}destroy(){}}class _u{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new _u(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,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new _u(e,e,new Cu(t,n))}static inline(e,t,n,r){return new _u(e,t,new wu(n,r))}static node(e,t,n,r){return new _u(e,t,new Au(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof wu}}const ku=[],xu={};class Ou{constructor(e,t){this.local=e.length?e:ku,this.children=t.length?t:ku}static create(e,t){return t.length?Iu(t,e,0,xu):Su}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==Su||0==e.maps.length?this:this.mapInner(e,t,0,0,n||xu)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,c=a[s+1];if(c<0||e>c+i)continue;let u=a[s]+i;t>=u?a[s+1]=e<=u?-2:-1:n>=o&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e<n.maps.length;e++)n.maps[e].forEach(l);let c=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){c=!0,a[t+1]=-1;continue}let l=n.map(e[t]+i),u=l-o;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+i+1,s);r!=Su?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,c=!0)}else c=!0}if(c){let l=function(e,t,n,r,o,i,s){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+i+1);return n}(a,e,t,n,o,i,s),c=Iu(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Ou(t.sort($u),a)}(this.children,i||[],e,t,n,r,o):i?new Ou(i.sort($u),ku):Su}add(e,t){return t.length?this==Su?Ou.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach(((e,i)=>{let s,a=i+n;if(s=Fu(t,e,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,a+1):r.splice(o,0,i,i+e.nodeSize,Iu(s,e,a+1,xu)),o+=3}}));let i=Tu(o?Mu(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new Ou(i.length?this.local.concat(i).sort($u):this.local,r||this.children)}remove(e){return 0==e.length||this==Su?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=Su?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Ou(r,n):Su}forChild(e,t){if(this==Su)return this;if(t.isLeaf)return Ou.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof wu){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new Ou(r.sort($u),ku);return n?new Nu([e,n]):e}return n||Su}eq(e){if(this==e)return!0;if(!(e instanceof Ou)||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 Bu(this.localsInner(e))}localsInner(e){if(this==Su)return ku;if(e.inlineContent||!this.local.some(wu.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof wu||t.push(this.local[e]);return t}}Ou.empty=new Ou([],[]),Ou.removeOverlap=Bu;const Su=Ou.empty;class Nu{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,xu)));return Nu.from(n)}forChild(e,t){if(t.isLeaf)return Ou.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=Su&&(o instanceof Nu?n=n.concat(o.members):n.push(o))}return Nu.from(n)}eq(e){if(!(e instanceof Nu)||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,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?Bu(n?t:t.sort($u)):ku}static from(e){switch(e.length){case 0:return Su;case 1:return e[0];default:return new Nu(e)}}}function Tu(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new _u(o.from+t,o.to+t,o.type))}return n}function Fu(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function Mu(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Iu(e,t,n,r){let o=[],i=!1;t.forEach(((t,s)=>{let a=Fu(e,t,s+n);if(a){i=!0;let e=Iu(a,t,n+s+1,r);e!=Su&&o.push(s,s+t.nodeSize,e)}}));let s=Tu(i?Mu(e):e,-n).sort($u);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new Ou(s,o):Su}function $u(e,t){return e.from-t.from||e.to-t.to}function Bu(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Lu(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Lu(t,o+1,i.copy(r.to,i.to)))}}return t}function Lu(e,t,n){for(;t<e.length&&$u(n,e[t])>0;)t++;e.splice(t,0,n)}for(var Pu={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:"'",229:"q"},Ru={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},zu="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),ju="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Hu="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Vu="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ku="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Wu=zu&&(Vu||+zu[1]<57)||Hu&&Vu,Uu=0;Uu<10;Uu++)Pu[48+Uu]=Pu[96+Uu]=String(Uu);for(Uu=1;Uu<=24;Uu++)Pu[Uu+111]="F"+Uu;for(Uu=65;Uu<=90;Uu++)Pu[Uu]=String.fromCharCode(Uu+32),Ru[Uu]=String.fromCharCode(Uu);for(var qu in Pu)Ru.hasOwnProperty(qu)||(Ru[qu]=Pu[qu]);const Gu="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Ju(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Gu?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Yu(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Xu(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Ju(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!(Wu&&(e.ctrlKey||e.altKey||e.metaKey)||(ju||Ku)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Ru:Pu)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=1==o.length&&" "!=o,s=t[Yu(o,n,!i)];if(s&&s(e.state,e.dispatch,e))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=Pu[n.keyCode])&&r!=o){let o=t[Yu(r,n,!0)];if(o&&o(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){let r=t[Yu(o,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Qu(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Zu(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function ed(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function td(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function nd(e,t,n){let r,o,i=t.nodeBefore,s=t.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!gl(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=t.pos+s.nodeSize,a=qs.empty;for(let e=r.length-1;e>=0;e--)a=qs.from(r[e].create(null,a));a=qs.from(i.copy(a));let l=e.tr.step(new cl(t.pos-1,o,t.pos,o,new Zs(a,1,0),r.length,!0)),c=o+2*r.length;gl(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=Tl.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&pl(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&Qu(s,"start",!0)&&Qu(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=qs.empty;for(let e=o.length-1;e>=0;e--)r=qs.from(o[e].copy(r));n(e.tr.step(new cl(t.pos-o.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new Zs(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function rd(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection($l.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const od=rd(-1),id=rd(1);function sd(e,t=null){return function(n,r){let{from:o,to:i}=n.selection,s=!1;return n.doc.nodesBetween(o,i,((r,o)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(o),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(o,i,e,t).scrollIntoView()),!0)}}function ad(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new ma(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new ma(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=hl(l,e,t,s);return!!c&&(r&&r(function(e,t,n,r,o){let i=qs.empty;for(let e=n.length-1;e>=0;e--)i=qs.from(n[e].type.create(n[e].attrs,i));e.step(new cl(t.start-(r?2:0),t.end,t.start,t.end,new Zs(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&ml(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function ld(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new cl(i-1,s,i,s,new Zs(qs.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ma(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));return t(o.lift(r,pl(r)).scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?qs.empty:qs.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new cl(d-(a?1:0),p+(l?1:0),d+1,p-1,new Zs((a?qs.empty:qs.from(o.copy(qs.empty))).append(l?qs.empty:qs.from(o.copy(qs.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}function cd(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class ud{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:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!e,l=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=e||n.tr,o=this.buildProps(r,false),i=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})])));return{...i,chain:()=>this.createChain(r,false)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&e.setStoredMarks(o.storedMarks);const s={tr:e,editor:r,view:i,state:cd({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function dd(e,t,n){if(void 0===e.config[t]&&e.parent)return dd(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?dd(e.parent,t,n):null})}return e.config[t]}function pd(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function hd(e){const t=[],{nodeExtensions:n,markExtensions:r}=pd(e),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=dd(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=dd(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};r.isRequired&&void 0===r.default&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function fd(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function md(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function gd(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>md(e,t)),{})}function vd(e,t,...n){return function(e){return"function"==typeof e}(e)?t?e.bind(t)(...n):e(...n):e}function yd(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...o}}}}function bd(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function Dd(e){var t;const n=hd(e),{nodeExtensions:r,markExtensions:o}=pd(e),i=null===(t=r.find((e=>dd(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},i=bd({...e.reduce(((e,n)=>{const r=dd(n,"extendNodeSchema",o);return{...e,...r?r(t):{}}}),{}),content:vd(dd(t,"content",o)),marks:vd(dd(t,"marks",o)),group:vd(dd(t,"group",o)),inline:vd(dd(t,"inline",o)),atom:vd(dd(t,"atom",o)),selectable:vd(dd(t,"selectable",o)),draggable:vd(dd(t,"draggable",o)),code:vd(dd(t,"code",o)),defining:vd(dd(t,"defining",o)),isolating:vd(dd(t,"isolating",o)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),s=vd(dd(t,"parseHTML",o));s&&(i.parseDOM=s.map((e=>yd(e,r))));const a=dd(t,"renderHTML",o);a&&(i.toDOM=e=>a({node:e,HTMLAttributes:gd(e,r)}));const l=dd(t,"renderText",o);return l&&(i.toText=l),[t.name,i]}))),a=Object.fromEntries(o.map((t=>{const r=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},i=bd({...e.reduce(((e,n)=>{const r=dd(n,"extendMarkSchema",o);return{...e,...r?r(t):{}}}),{}),inclusive:vd(dd(t,"inclusive",o)),excludes:vd(dd(t,"excludes",o)),group:vd(dd(t,"group",o)),spanning:vd(dd(t,"spanning",o)),code:vd(dd(t,"code",o)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),s=vd(dd(t,"parseHTML",o));s&&(i.parseDOM=s.map((e=>yd(e,r))));const a=dd(t,"renderHTML",o);return a&&(i.toDOM=e=>a({mark:e,HTMLAttributes:gd(e,r)})),[t.name,i]})));return new $a({topNode:i,nodes:s,marks:a})}function Ed(e,t){return t.nodes[e]||t.marks[e]||null}function Cd(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function wd(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class Ad{constructor(e){this.find=e.find,this.handler=e.handler}}function _d(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let u=!1;const d=((e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,((t,r,o,i)=>{var s,a,l;n+=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:r,parent:o,index:i}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(c)+i;return s.forEach((e=>{if(u)return;const t=((e,t)=>{if(wd(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,e.find);if(!t)return;const s=l.state.tr,c=cd({state:l.state,transaction:s}),p={from:r-(t[0].length-i.length),to:o},{commands:h,chain:f,can:m}=new ud({editor:n,state:c});null!==e.handler({state:c,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function kd(e){const{editor:t,rules:n}=e,r=new Ul({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,o,i,s)=>_d({editor:t,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:o}=e.state.selection;o&&_d({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&_d({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class xd{constructor(e){this.find=e.find,this.handler=e.handler}}function Od(e){const{editor:t,state:n,from:r,to:o,rule:i}=e,{commands:s,chain:a,can:l}=new ud({editor:t,state:n}),c=[];n.doc.nodesBetween(r,o,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const u=Math.max(r,t),d=Math.min(o,t+e.content.size),p=((e,t)=>{if(wd(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(u-t,d-t,void 0,""),i.find);p.forEach((e=>{if(void 0===e.index)return;const t=u+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=i.handler({state:n,range:o,match:e,commands:s,chain:a,can:l});c.push(d)}))}));return c.every((e=>null!==e))}function Sd(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1;return n.map((e=>new Ul({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:e=>(i=r===e.dom.parentElement,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!i;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!d||u===d.b)return;const p=s.tr,h=cd({state:s,transaction:p});return Od({editor:t,state:h,from:Math.max(u-1,0),to:d.b-1,rule:e})&&p.steps.length?p:void 0}})))}class Nd{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Nd.resolve(e),this.schema=Dd(this.extensions),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Ed(e.name,this.schema)};if("mark"===e.type){(null===(t=vd(dd(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=dd(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=dd(e,"onCreate",n);o&&this.editor.on("create",o);const i=dd(e,"onUpdate",n);i&&this.editor.on("update",i);const s=dd(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=dd(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=dd(e,"onFocus",n);l&&this.editor.on("focus",l);const c=dd(e,"onBlur",n);c&&this.editor.on("blur",c);const u=dd(e,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(e){const t=Nd.sort(Nd.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=dd(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){return e.sort(((e,t)=>{const n=dd(e,"priority")||100,r=dd(t,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=dd(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Ed(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Nd.sort([...this.extensions].reverse()),n=[],r=[],o=t.map((t=>{const o={name:t.name,options:t.options,storage:t.storage,editor:e,type:Ed(t.name,this.schema)},i=[],s=dd(t,"addKeyboardShortcuts",o);let a={};if("mark"===t.type&&t.config.exitable&&(a.ArrowRight=()=>op.handleExit({editor:e,mark:t})),s){const t=Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})])));a={...a,...t}}const l=new Ul({props:{handleKeyDown:Xu(a)}});i.push(l);const c=dd(t,"addInputRules",o);Cd(t,e.options.enableInputRules)&&c&&n.push(...c());const u=dd(t,"addPasteRules",o);Cd(t,e.options.enablePasteRules)&&u&&r.push(...u());const d=dd(t,"addProseMirrorPlugins",o);if(d){const e=d();i.push(...e)}return i})).flat();return[kd({editor:e,rules:n}),...Sd({editor:e,rules:r}),...o]}get attributes(){return hd(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=pd(this.extensions);return Object.fromEntries(t.filter((e=>!!dd(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:fd(t.name,this.schema)},o=dd(t,"addNodeView",r);if(!o)return[];return[t.name,(r,i,s,a)=>{const l=gd(r,n);return o()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function Td(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Fd(e,t){const n={...e};return Td(e)&&Td(t)&&Object.keys(t).forEach((r=>{Td(t[r])?r in e?n[r]=Fd(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class Md{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=vd(dd(this,"addOptions",{name:this.name}))),this.storage=vd(dd(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Md(e)}configure(e={}){const t=this.extend();return t.options=Fd(this.options,e),t.storage=vd(dd(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Md(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=vd(dd(t,"addOptions",{name:t.name})),t.storage=vd(dd(t,"addStorage",{name:t.name,options:t.options})),t}}Md.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ul({key:new Jl("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map((e=>e.$from.pos))),a=Math.max(...i.map((e=>e.$to.pos))),l=function(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}(n);return function(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,o,((e,n,c,u)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=i,l=!0),c&&(a+=p({node:e,pos:n,parent:c,index:u,range:t}))):e.isText?(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,o-n),l=!1):e.isBlock&&!l&&(a+=i,l=!0)})),a}(r,{from:s,to:a},{textSerializers:l})}}})]}});function Id(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:wd(t[r])?t[r].test(e[r]):t[r]===e[r]))}function $d(e,t,n={}){return e.find((e=>e.type===t&&Id(e.attrs,n)))}function Bd(e,t,n={}){return!!$d(e,t,n)}function Ld(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const o=$d([...r.node.marks],t,n);if(!o)return;let i=r.index,s=e.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for($d([...r.node.marks],t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;a<e.parent.childCount&&Bd([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Pd(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function Rd(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function zd(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function jd(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Hd(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?qs.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Hd("",t,n)}if("string"==typeof e){const r=La.fromSchema(t);return n.slice?r.parseSlice(jd(e),n.parseOptions).content:r.parse(jd(e),n.parseOptions)}return Hd("",t,n)}function Vd(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Kd(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?fd(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:i})}));const l=o-r,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Id(e.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Wd(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Ud(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function qd(e,t){const n=Pd(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function Gd(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function Jd(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}function Yd(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Xd(e,t){const{nodeExtensions:n}=pd(t),r=n.find((t=>t.name===e));if(!r)return!1;const o=vd(dd(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}const Qd=(e,t)=>{const n=Yd((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!gl(e.doc,n.pos)||(e.join(n.pos),!0)},Zd=(e,t)=>{const n=Yd((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!gl(e.doc,r)||(e.join(r),!0)};var ep=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),a=i.blockRange(s);if(!a)return;const l=pl(a);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof Rl||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=td(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection($l.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const o=fd(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1){if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=td(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Tl.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:o})=>{const i=Pd(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const e=Ld(l,i,t);if(e&&e.from<=c&&e.to>=u){const t=$l.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{zd()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(i&&null===e&&!(n.state.selection instanceof $l))return s(),!0;const a=function(e,t=null){if(!t)return null;const n=Tl.atStart(e),r=Tl.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?$l.create(e,Rd(0,o,i),Rd(e.content.size,o,i)):$l.create(e,Rd(t,o,i),Rd(t,o,i))}(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Hd(t,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),c=!!c&&e.isBlock})),s===a&&c){const{parent:e}=r.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?r.insertText(t,s,a):r.replaceWith(s,a,o),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof ll||o instanceof cl))return;const i=e.mapping.maps[r];let s=0;i.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(Tl.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let o=Zu(r);if(!o){let n=r.blockRange(),o=n&&pl(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&nd(e,o,t))return!0;if(0==r.parent.content.size&&(Qu(i,"end")||Ll.isSelectable(i))){let n=vl(e.doc,r.before(),r.after(),Zs.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Qu(i,"end")?Tl.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Ll.create(r.doc,o.pos-i.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let o=ed(r);if(!o)return!1;let i=o.nodeAfter;if(nd(e,o,t))return!0;if(0==r.parent.content.size&&(Qu(i,"start")||Ll.isSelectable(i))){let n=vl(e.doc,r.before(),r.after(),Zs.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Qu(i,"start")?Tl.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Ll.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);zd()||Vd()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=i.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&o&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!Kd(n,fd(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&pl(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ml(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&pl(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>ld(fd(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Wd("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=fd(e,r.schema)),"mark"===a&&(s=Pd(e,r.schema)),o&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,Ud(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((o=>{s===o.type&&n.addMark(r,r+e.nodeSize,s.create(Ud(o.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=Zu(r)}let s=i&&i.nodeBefore;return!(!s||!Ll.isSelectable(s)||(t&&t(e.tr.setSelection(Ll.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=ed(r)}let s=i&&i.nodeAfter;return!(!s||!Ll.isSelectable(s)||(t&&t(e.tr.setSelection(Ll.create(e.doc,i.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(Ll.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>id(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>od(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=function(e,t,n={}){return Hd(e,t,{slice:!1,parseOptions:n})}(e,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Pd(e,r.schema);if(o)if(s){const e=qd(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,((e,r)=>{const s=Math.max(r,o),a=Math.min(r+e.nodeSize,i),c=e.marks.find((e=>e.type===l));c?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return!0},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=fd(e,n.schema);return i.isTextblock?o().command((({commands:e})=>!!sd(i,t)(n)||e.clearNodes())).command((({state:e})=>sd(i,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Rd(e,0,n.content.size),o=Ll.create(n,r);t.setSelection(o)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=$l.atStart(n).from,s=$l.atEnd(n).to,a=Rd(r,i,s),l=Rd(o,i,s),c=$l.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=fd(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,i=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=qs.from(n?o.create():null),s=new Zs(qs.from(o.create(null,qs.from(a.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;t(e.tr.step(new cl(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(t,n);var o},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=Gd(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Ll&&i.node.isBlock)return!(!a.parentOffset||!ml(s,a.pos))&&(r&&(e&&Jd(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;i instanceof $l&&t.deleteSelection();const s=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=r&&s?[{type:s,attrs:c}]:void 0,d=ml(t.doc,t.mapping.map(a.pos),1,u);if(u||d||!ml(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,u=s?[{type:s,attrs:c}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,u),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&Jd(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:o})=>{var i;const s=fd(e,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const d=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let e=qs.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=qs.from(a.node(t).copy(e));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=Gd(d,a.node().type.name,a.node().attrs),l=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;e=e.append(qs.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));t.replace(c,a.after(-r),new Zs(e,4-n,0));let u=-1;t.doc.nodesBetween(c,t.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&t.setSelection($l.near(t.doc.resolve(u))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=Gd(d,u.type.name,u.attrs),f=Gd(d,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const m=p?[{type:s,attrs:h},{type:p,attrs:f}]:[{type:s,attrs:h}];return!!ml(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,u=fd(e,o.schema),d=fd(t,o.schema),{selection:p}=o,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=Yd((e=>Xd(e.type.name,c)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===u)return a.liftListItem(d);if(Xd(g.node.type.name,c)&&u.validContent(g.node.content)&&i)return s().command((()=>(r.setNodeMarkup(g.pos,u),!0))).command((()=>Qd(r,u))).command((()=>Zd(r,u))).run()}return s().command((()=>!!l().wrapInList(u)||a.clearNodes())).wrapInList(u).command((()=>Qd(r,u))).command((()=>Zd(r,u))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Pd(e,r.schema),a=function(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Pd(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!i||i.name===e.type.name)).find((e=>Id(e.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);s+=i-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:i}))))}))})),0===s)return!1;const l=a.filter((e=>!i||i.name===e.mark.type.name)).filter((e=>Id(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!i||e.mark.type!==i&&e.mark.type.excludes(i))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}(r,s,t);return a?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:o})=>{const i=fd(e,r.schema),s=fd(t,r.schema);return Kd(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const o=fd(e,n.schema);return Kd(n,o,t)?r.lift(o):r.wrapIn(o,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Pd(e,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:e,to:t}=a;const r=null===(i=c.marks().find((e=>e.type===l)))||void 0===i?void 0:i.attrs,o=Ld(c,l,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,l)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Wd("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=fd(e,r.schema)),"mark"===a&&(s=Pd(e,r.schema)),o&&n.selection.ranges.forEach((e=>{const o=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(o,a,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((i=>{if(s===i.type){const l=Math.max(r,o),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,s.create({...i.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&hl(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(fd(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>ad(fd(e,n.schema),t)(n,r)});function tp(e,t){const n=Wd("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=fd(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,(e=>{i.push(e)}));const s=i.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?qd(e,t):{}}function np(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function rp(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const o=Ld(n.resolve(e-1),t.type);o&&r.push({mark:t,...o})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}Md.create({name:"commands",addCommands:()=>({...ep})}),Md.create({name:"editable",addProseMirrorPlugins(){return[new Ul({key:new Jl("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Md.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Ul({key:new Jl("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Md.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=Tl.atStart(r).from===s;return!(!(o&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return zd()||Vd()?o:r},addProseMirrorPlugins(){return[new Ul({key:new Jl("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=t.selection,s=Tl.atStart(t.doc).from,a=Tl.atEnd(t.doc).to,l=o===s&&i===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!c)return;const u=n.tr,d=cd({state:n,transaction:u}),{commands:p}=new ud({editor:this.editor,state:d});return p.clearNodes(),u.steps.length?u:void 0}})]}}),Md.create({name:"tabindex",addProseMirrorPlugins(){return[new Ul({key:new Jl("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class op{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=vd(dd(this,"addOptions",{name:this.name}))),this.storage=vd(dd(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new op(e)}configure(e={}){const t=this.extend();return t.options=Fd(this.options,e),t.storage=vd(dd(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new op(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=vd(dd(t,"addOptions",{name:t.name})),t.storage=vd(dd(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const i=o.find((e=>(null==e?void 0:e.type.name)===t.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}class ip{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=vd(dd(this,"addOptions",{name:this.name}))),this.storage=vd(dd(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ip(e)}configure(e={}){const t=this.extend();return t.options=Fd(this.options,e),t.storage=vd(dd(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ip(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=vd(dd(t,"addOptions",{name:t.name})),t.storage=vd(dd(t,"addStorage",{name:t.name,options:t.options})),t}}function sp(e){return new xd({find:e.find,handler:({state:t,range:n,match:r})=>{const o=vd(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(rp(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>c)).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+r,c),l=n.from+r+s.length,i.addMark(n.from+r,l,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function ap(e){return(...t)=>n=>e(n,...t)}function lp(e){const t=Object.entries(e).reduce(((e,[t,n])=>{if(!n)return e;return`${e}--zw-${t.replace(/_/g,"-")}:${n};`}),"");return t?{style:t}:null}function cp(e){const t=lp(e);return["span",t?{...t,class:"zw-style"}:{},0]}function up(e,...t){return({editor:n})=>(n.commands[e](...t),!0)}var dp=Object.defineProperty,pp=(e,t,n)=>(((e,t,n)=>{t in e?dp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);function hp(e,t){let n=!1;return function(){n||(e.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),t))}}function fp(e){return e>1||e<-1?e/100:e}const mp=e=>Number.parseFloat(e.toFixed(5).substr(0,5));function gp(e){const t=function(e,t=1){const n=[];let r=0;for(;r<e.length;)n.push(e.substr(r,t)),r+=t;return n}(e.slice(1),2).map((e=>parseInt(e,16))),n=void 0!==t[3]?Math.round(t[3]/255*100)/100:1;return{r:t[0],g:t[1],b:t[2],a:n}}function vp(e){const{h:t,s:n,v:r,a:o}=e,i=e=>{const o=(e+t/60)%6;return r-r*n*Math.max(Math.min(o,4-o,1),0)},s=[i(5),i(3),i(1)].map((e=>Math.round(255*e)));return{r:s[0],g:s[1],b:s[2],a:o}}function yp(e){if(!e)return{h:0,s:1,v:1,a:1};const t=e.r/255,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),i=Math.min(t,n,r);let s=0;o!==i&&(o===t?s=60*(0+(n-r)/(o-i)):o===n?s=60*(2+(r-t)/(o-i)):o===r&&(s=60*(4+(t-n)/(o-i)))),s<0&&(s+=360);const a=[s,0===o?0:(o-i)/o,o],l=mp(a[1]),c=mp(a[2]);return{h:Math.floor(a[0]),s:l,v:c,a:e.a}}function bp(e){const t=yp(gp(e));const n=function(e){const{h:t,s:n,v:r,a:o}=e,i=r-r*n/2,s=1===i||0===i?0:(r-i)/Math.min(i,1-i);return{h:t,s:mp(s),l:mp(i),a:o}}(t),r=gp(e);return{alpha:t.a,hex:e.substr(0,7),hexa:e,hsla:n,hsva:t,hue:t.h,rgba:r}}function Dp(e,t,n="0"){return e+n.repeat(Math.max(0,t-e.length))}function Ep(e){return bp(function(e){let t=e;return t.startsWith("#")&&(t=t.slice(1)),t=t.replace(/([^0-9a-f])/gi,"F"),3!==t.length&&4!==t.length||(t=t.split("").map((e=>e+e)).join("")),t=6===t.length?Dp(t,8,"F"):Dp(Dp(t,6),8,"F"),`#${t}`.toUpperCase().substr(0,9)}(e))}const Cp=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"}),wp="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",Ap=`[\\s|\\(]+(${wp})[,|\\s]+(${wp})[,|\\s]+(${wp})\\s*\\)?`,_p=`[\\s|\\(]+(${wp})[,|\\s]+(${wp})[,|\\s]+(${wp})[,|\\s]+(${wp})\\s*\\)?`,kp=Object.freeze({CSS_UNIT:new RegExp(wp),RGB:new RegExp(`rgb${Ap}`),RGBA:new RegExp(`rgba${_p}`),HSL:new RegExp(`hsl${Ap}`),HSLA:new RegExp(`hsla${_p}`),HSV:new RegExp(`hsv${Ap}`),HSVA:new RegExp(`hsva${_p}`),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})$/}),xp=Object.freeze({WINDOW:Symbol("window")});xp.WINDOW;xp.WINDOW,xp.WINDOW,hp(((e,t)=>{e(t)}),20);const Op=class{static create(e){if(!e)return Op.fromBlack();let t=e.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(Cp[t])t=Cp[t];else if(t===this.TRANSPARENT)return Op.fromTransparent();const n=kp.RGB.exec(t)||kp.RGBA.exec(t);if(n){const e=void 0===n[4]?1:n[4];return Op.fromRgba({r:Number.parseInt(n[1]),g:Number.parseInt(n[2]),b:Number.parseInt(n[3]),a:Number.parseFloat(e)})}const r=kp.HSL.exec(t)||kp.HSLA.exec(t);if(r){const e=void 0===r[4]?1:r[4];return Op.fromHsla({h:Number.parseInt(r[1]),s:Number.parseFloat(r[2]),l:Number.parseFloat(r[3]),a:Number.parseFloat(e)})}const o=kp.HSV.exec(t)||kp.HSVA.exec(t);if(o){const e=void 0===o[4]?1:o[4];return Op.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(e)})}return kp.HEX8.exec(t)||kp.HEX6.exec(t)||kp.HEX4.exec(t)||kp.HEX3.exec(t)?Op.fromHex(t):Op.fromBlack()}static fromHex(e){const{rgba:t}=Ep(e);return new Op(t)}static fromRgba({r:e,g:t,b:n,a:r}){const o=fp(r);return new Op({r:e,g:t,b:n,a:o})}static fromHsla({h:e,s:t,l:n,a:r}){const o=fp(t),i=fp(n),s=fp(r);return Op.fromHsva(function(e){const{h:t,s:n,l:r,a:o}=e,i=r+n*Math.min(r,1-r);return{h:t,s:mp(0===i?0:2-2*r/i),v:mp(i),a:o}}({h:e,s:o,l:i,a:s}))}static fromHsva({h:e,s:t,v:n,a:r}){const o=vp({h:e,s:fp(t),v:fp(n),a:fp(r)});return new Op(o)}static fromTransparent(){return new Op({r:0,g:0,b:0,a:0})}static fromWhite(){return new Op({r:255,g:255,b:255,a:1})}static fromBlack(){return new Op({r:0,g:0,b:0,a:1})}static isTransparent(e){return Op.create(e).isTransparent()}static isDark(e){return Op.create(e).isDark()}constructor(e){this._rgba=e,this._hsva=this._calcHsva(),this._alpha=e.a}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}get alpha(){return this._alpha}setAlpha(e){return this._alpha=e,this}toHexString(){return function(e){const t=e=>{const t=Math.round(e).toString(16);return("00".substr(0,2-t.length)+t).toUpperCase()};return`#${[t(e.r),t(e.g),t(e.b)].join("")}`}({r:this.r,g:this.g,b:this.b,a:this.alpha})}toRgbaString(){const e=`${Math.floor(100*this.alpha)}%`;return`rgba(${[this.r,this.g,this.b,e].join(", ")})`}get rgba(){return this._rgba}updateRgb(e){this._rgba={...this._rgba,...e},this._hsva=this._calcHsva()}get hsva(){return this._hsva}updateHsv(e){this._hsva={...this._hsva,...e},this._rgba=this._calcRgba()}isTransparent(){return 0===this.alpha}isDark(){return this.getBrightness()<128}getBrightness(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3}_calcHsva(){return yp(this.rgba)}_calcRgba(){return vp(this.hsva)}};let Sp=Op;function Np(e){const t=Sp.create(e);return 1===t.alpha?t.toHexString():t.toRgbaString()}function Tp(e,t){if(!e.includes("em"))return parseInt(e);const n=window.getComputedStyle(t).fontSize,r=parseFloat(e)*parseFloat(n);return Math.round(r)}function Fp(e,t,n){if(!e.includes("px"))return e;const r=function(e,t){return(e.firstElementChild||e).style.fontSize||window.getComputedStyle(t).fontSize}(t,n),o=Tp(r,n);return(parseInt(e)/o).toFixed(2)}pp(Sp,"TRANSPARENT","transparent"),pp(Sp,"NONE","none");const Mp=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),Ip=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),$p=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),Bp=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Lp=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]}}),Pp=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 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]}}),Rp=Object.freeze({BLANK:"_blank",SELF:"_self"}),zp=Object.freeze({URL:"url",BLOCK:"block"}),jp={start:$p.LEFT,end:$p.RIGHT};const Hp=op.create({name:Pp.FONT_FAMILY,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:ap((({commands:e},t)=>{e.setMark(this.name,{value:t});const n=e.findFontByName(t);let r=zt(e.getFontWeight());n.isWeightSupported(r)||(r=n.findClosestWeight(r),e.applyFontWeight(r)),n.isItalicSupported(r)||e.removeItalic()})),getFont:ap((({commands:e})=>{const t=e.getFontFamily();return Vt((()=>{const n=zt(t)||zt(this.options.defaultPreset).common.font_family;return e.findFontByName(n)}))})),findFontByName:ap(((e,t)=>this.options.fonts.find((e=>e.name===t)))),getFontFamily:ap((({editor:e,commands:t})=>{const n=t.getDefaultFontFamily();return Vt((()=>{var t;return(null===(t=e.getAttributes(this.name))||void 0===t?void 0:t.value)??zt(n)}))})),getDefaultFontFamily:ap((({commands:e})=>{const t=e.getPreset();return Vt((()=>zt(t).common.font_family))}))}},parseHTML(){const e=e=>{const t=e.replace(/"/g,"");return{value:this.options.fonts.some((e=>e.name===t))?t:zt(this.options.defaultPreset).common.font_family}};return[{style:"--zw-font-family",getAttrs:e},{style:"font-family",getAttrs:e}]},renderHTML:({HTMLAttributes:e})=>cp({font_family:e.value?`"${e.value}"`:null})}),Vp=ip.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,md(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>function(e){return new Ad({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=vd(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});class Kp{#e=new DOMParser;types=window;parse(e){return this.#e.parseFromString(e,"text/html")}}class Wp{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];static ASSIGN_STYLE_RULES=[{tag:/^(b|strong)$/,ignore:/font-weight/},{tag:/^i$/,ignore:/font-style/},{tag:/^s$/,ignore:/text-decoration(.+)?/}];static build(e,t={}){return new Wp({content:e,parser:t.parser||new Kp})}static normalize(e,t={}){return Wp.build(e,t).normalize()}constructor({content:e,parser:t}){this._content=e,this._parser=t,this.dom=null}normalize(){return"string"!=typeof this._content?this._content:(this.normalizeHTML(),this.normalizedHTML)}normalizeHTML(){this.dom=this._parser.parse(this._content.replace(/(\r)?\n/g,"")),this._removeComments(),this.iterateNodes(this._normalizeBreakLines,(e=>"BR"===e.tagName)),this.iterateNodes(this._removeEmptyNodes,this._isBlockNode),this.iterateNodes(this._normalizeListItems,(e=>"LI"===e.tagName)),this.iterateNodes(this._normalizeSettingsStructure,(e=>"SPAN"===e.tagName)),this.iterateNodes(this._normalizeStyles,(e=>"SPAN"!==e.tagName))}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,(e=>e.remove()))}createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}iterateNodes(e,t=(()=>!0)){const n=e=>"BODY"!==e.tagName&&t.call(this,e),r=this.createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:e=>n(e)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this.runIterator(r,e)}runIterator(e,t){let n=e.nextNode();for(;n;)t.call(this,n),n=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),n=Array.from(e.childNodes);let r,o;const i=n=>{this._assignElementProperties(n,e,Wp.BLOCK_STYLES),t.append(n)};this._assignElementProperties(e,e.parentElement,Wp.BLOCK_STYLES);for(const e of n){var s;if(this._isBlockNode(e))i(e),r=null,o=e;else if("BR"===e.tagName&&o&&"BR"!==(null===(s=o)||void 0===s?void 0:s.tagName))e.remove(),o=e;else if("BR"!==e.tagName)r||(r=this.dom.createElement("p"),i(r)),r.append(e),o=e;else{const t=this.dom.createElement("p");t.append(e),i(t),r=null,o=e}}e.append(t),this._removeStyleProperties(e,Wp.BLOCK_STYLES)}_normalizeSettingsStructure(e){if(this._isOnlyTextContent(e))return;const t=e.cloneNode(!0),n=this._getMigratingStyles(e,{customProperties:!0}),r=[];for(const e of t.childNodes){let o=e;n.length&&(o=this._wrapTextNode(t,e),this._assignElementProperties(o,t,n)),r.push(o)}e.replaceWith(...r)}_normalizeStyles(e){if(!this._isBlockNode(e)&&this._isOnlyTextContent(e))return;const t=this._getMigratingStyles(e);if(t.length){for(const n of e.childNodes){const r=this._wrapTextNode(e,n);this._assignElementProperties(r,e,t)}this._removeStyleProperties(e,t)}}_isOnlyTextContent(e){return Array.from(e.childNodes).every((e=>e.nodeType===this._Node.TEXT_NODE))}_isBlockNode(e){return Wp.BLOCK_NODE_NAMES.includes(e.tagName)}_getMigratingStyles(e,{customProperties:t}={}){const n=Wp.BLOCK_STYLES,r=[];for(let o=0;o<e.style.length;o++){const i=e.style.item(o);n.includes(i)||(!t&&i.startsWith("--")||r.push(i))}return r}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const n=this.dom.createElement("span");return n.append(t.cloneNode()),e.replaceChild(n,t),n}_assignElementProperties(e,t,n){for(const r of n){const n=t.style.getPropertyValue(r);n&&this._canAssignElementProperty(e,t,r)&&e.style.setProperty(r,n)}}_canAssignElementProperty(e,t,n){return!e.style.getPropertyValue(n)&&Wp.ASSIGN_STYLE_RULES.every((t=>!t.tag.test(e.tagName.toLowerCase())||!t.ignore.test(n)))}_removeStyleProperties(e,t){for(const n of t)e.style.removeProperty(n);0===e.style.length&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e))return;if(!e.textContent)return;const t=this.dom.createDocumentFragment(),n=Array.from(e.childNodes),r=e.cloneNode(!0);r.innerHTML="";let o=r.cloneNode();const i=n=>{this._assignElementProperties(n,e,Wp.BLOCK_STYLES),t.append(n)};for(const e of n)"BR"!==e.tagName?o.append(e):(i(o),o=r.cloneNode());t.append(o),e.replaceWith(t)}}class Up{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 qp{static doc(e){return{type:Bp.DOCUMENT,content:e}}static list(e,t){return{type:Bp.LIST,attrs:{bullet:{type:e}},content:t.map((e=>this.listItem([].concat(e))))}}static listItem(e){return{type:Bp.LIST_ITEM,content:e}}static heading(e,...t){const n=this._textBlock(t);return n.attrs??(n.attrs={}),n.attrs.level=e,{type:Bp.HEADING,...n}}static paragraph(...e){return{type:Bp.PARAGRAPH,...this._textBlock(e)}}static _textBlock(e){const t=1===e.length?null:e[0],n=1===e.length?e[0]:e[1];return{content:"string"==typeof n?[this.text(n)]:n,...t?{attrs:t}:{}}}static text(e,t){return{type:Bp.TEXT,...t?{marks:t}:{},text:e}}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:null,tablet:e,desktop:e}}}function Gp(e,t){return e.split(" ").map((e=>`.${e}`)).join("")+t.id}const Jp=Md.create({name:"style_preset",addExtensions:()=>[Vp.configure({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})],addStorage:()=>({presetStyleEl:null}),addGlobalAttributes(){return[{types:[Bp.PARAGRAPH,Bp.HEADING],attributes:{preset:{isRequired:!1,default:{id:this.options.defaultId},parseHTML:e=>{const t=zt(this.options.presets);if("LI"===e.parentElement.tagName)return null;for(const{id:n,node:r,fallbackClass:o}of t){if(o&&e.classList.contains(o))return{id:n};const t=Gp(this.options.baseClass,{id:n});if(e.matches(t))return{id:n};if(e.tagName===`H${null==r?void 0:r.level}`)return{id:n}}return"P"===e.tagName?{id:this.options.defaultId}:null},renderHTML:e=>e.preset?{class:this.options.baseClass+e.preset.id}:null}}}]},addCommands(){function e(e,t){return e.find((e=>t===e.id))}function t(e,t){const n={};for(const r of Object.keys(e)){const o=e[r],i=t[r],s=!i||"inherit"===i.toLowerCase();n[r]=s?o:i}return n}return{getPresetList:ap((()=>Vt((()=>this.options.presets.filter((e=>!e.hidden)))))),getPreset:ap((({commands:n})=>{const r=n.getBlockAttributes("preset",{id:this.options.defaultId}),o=n.getPresetList(),i=n.isLink(),s=n.getLinkPreset();return Vt((()=>{const n=e(zt(o),zt(r).id);if(!zt(i))return n;const a=zt(s);return{id:n.id,common:t(n.common,a.common),mobile:t(n.mobile,a.mobile),tablet:t(n.tablet,a.tablet),desktop:t(n.desktop,a.desktop)}}))})),applyPreset:ap((({commands:t,chain:n},r)=>{var o;const i=e(zt(t.getPresetList()),r),s=(null===(o=i.node)||void 0===o?void 0:o.type)??Bp.PARAGRAPH,a={preset:{id:r}};i.node&&(a.level=i.node.level);for(const e of Pp.attributes)a[e]=zt(t.getBlockAttributes(e));n().removeList().setNode(s,a).run()})),applyDefaultPreset:ap((({commands:e})=>{e.applyPreset(this.options.defaultId)})),removePreset:ap((({commands:e})=>{e.setNode(Bp.PARAGRAPH,{preset:null})})),getPresetCustomization:ap((({editor:e})=>{const t=Ht(e,"state");return Vt((()=>{const e=new Set,n=new Set,{from:r,to:o}=t.value.selection;return t.value.doc.nodesBetween(r,o,(t=>{for(const[n,r]of Object.entries(t.attrs)){Pp.attributes.includes(n)&&r&&e.add(n)}for(const{type:e}of t.marks)Pp.marks.includes(e.name)&&n.add(e.name)})),{attributes:Array.from(e),marks:Array.from(n)}}))})),isSettingCustomized:ap((({commands:e},t,n)=>{const r=e.getPresetCustomization();return Vt((()=>{var e;return(null===(e=zt(r)[t])||void 0===e?void 0:e.includes(n))??!1}))})),removePresetCustomization:ap((({chain:e})=>{e().storeSelection().expandSelectionToBlock().unsetMarks(Pp.marks).resetAttributes(Bp.PARAGRAPH,Pp.attributes).resetAttributes(Bp.HEADING,Pp.attributes).restoreSelection().run()})),removeFormat:ap((({chain:e})=>{e().storeSelection().expandSelectionToBlock().unsetAllMarks().applyDefaultPreset().restoreSelection().run()}))}},onCreate(){const e=Up.document.querySelector("[data-zw-styles]");if(e)this.storage.presetStyleEl=e;else{this.storage.presetStyleEl=Up.document.createElement("style"),this.storage.presetStyleEl.dataset.zwStyles="";for(const e of this.options.presets){const t=[` ${Gp(this.options.baseClass,e)} {`];for(const n of Mp.values)for(const r of Object.keys(e[n])){const o=this.options.makeVariable({device:n,preset:e,property:r}),i=r.replace(/_/i,"-"),s=n===Mp.COMMON?"preset":`preset-${n}`;t.push(`--zw-${s}-${i}: var(${o}, inherit);`)}t.push("}"),this.storage.presetStyleEl.innerHTML+=t.join(" ")}Up.head.append(this.storage.presetStyleEl)}}}),Yp=op.create({name:Pp.FONT_WEIGHT,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:ap((({commands:e},t)=>{e.setMark(this.name,{value:t});zt(e.getFont()).isItalicSupported(t)||e.removeItalic()})),toggleBold:ap((({commands:e})=>{const t=zt(e.getFontWeight()),n=zt(e.getFont()),r=Number(t)>=600?"400":"700",o=n.findClosestWeight(r);e.applyFontWeight(o)})),getFontWeight:ap((({editor:e,commands:t})=>{const n=t.getDefaultFontWeight(),r=t.getFont();return Vt((()=>{var t;const o=(null===(t=e.getAttributes(this.name))||void 0===t?void 0:t.value)??zt(n),i=zt(r);return i.isWeightSupported(o)?o:i.findClosestWeight(o)}))})),getDefaultFontWeight:ap((({commands:e})=>{const t=e.getPreset();return Vt((()=>zt(t).common.font_weight))}))}},addKeyboardShortcuts:()=>({"Mod-b":up("toggleBold"),"Mod-B":up("toggleBold")}),parseHTML(){const e=e=>"bold"===e?{value:"700"}:!!Number(e)&&{value:e};return[{style:"--zw-font-weight",getAttrs:e},{style:"font-weight",getAttrs:e},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML:({HTMLAttributes:e})=>cp({font_weight:e.value})}),Xp=op.create({name:Pp.FONT_SIZE,addOptions:()=>({minSize:1,maxSize:100}),addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getFontSize:ap((({editor:e,commands:t})=>{const n=t.getDevice(),r=t.getDefaultFontSize();return Vt((()=>{var t;return(null===(t=e.getAttributes(this.name))||void 0===t?void 0:t[zt(n)])??zt(r)}))})),getDefaultFontSize:ap((({commands:e})=>{const t=e.getDevice(),n=e.getPreset();return Vt((()=>zt(n)[zt(t)].font_size.replace("px","")))})),applyFontSize:ap((({commands:e},t)=>{e.setMark(this.name,{desktop:t,tablet:t,mobile:null})})),increaseFontSize:ap((({commands:e})=>{const t=Number(zt(e.getFontSize())),n=Math.min(t+1,this.options.maxSize);e.applyFontSize(String(n))})),decreaseFontSize:ap((({commands:e})=>{const t=Number(zt(e.getFontSize())),n=Math.max(t-1,this.options.minSize);e.applyFontSize(String(n))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-=":up("increaseFontSize"),"Mod-Shift--":up("decreaseFontSize")}),parseHTML(){const e=e=>{if(!e)return null;const t=Tp(e,zt(this.options.wrapperRef));return String(t)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:t})=>({mobile:e(t.getPropertyValue("--zw-font-size-mobile")),tablet:e(t.getPropertyValue("--zw-font-size-tablet")),desktop:e(t.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:t=>{const n=e(t);return{desktop:n,tablet:n,mobile:null}}}]},renderHTML({HTMLAttributes:e}){const t=e=>e?`${e}px`:null;return cp({font_size_mobile:t(e.mobile),font_size_tablet:t(e.tablet),font_size_desktop:t(e.desktop)})}}),Qp=op.create({name:Pp.FONT_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:ap((({commands:e,editor:t})=>{const n=e.getDefaultFontColor();return Vt((()=>{var e;return(null===(e=t.getAttributes(this.name))||void 0===e?void 0:e.value)??zt(n)}))})),getDefaultFontColor:ap((({commands:e})=>{const t=e.getPreset();return Vt((()=>zt(t).common.color))})),applyFontColor:ap((({commands:e},t)=>{e.setMark(this.name,{value:t})}))}},parseHTML(){const e=e=>({value:Np(e)});return[{style:"--zw-font-color",getAttrs:e},{style:"color",getAttrs:e}]},renderHTML:({HTMLAttributes:e})=>cp({font_color:e.value})}),Zp=op.create({name:Pp.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:ap((({editor:e})=>Vt((()=>{var t;return(null===(t=e.getAttributes(this.name))||void 0===t?void 0:t.value)??"rgba(255, 255, 255, 0%)"})))),applyBackgroundColor:ap((({commands:e},t)=>{e.setMark(this.name,{value:t})}))}},parseHTML(){const e=e=>({value:Np(e)});return[{style:"--zw-background-color",getAttrs:e},{style:"background-color",getAttrs:e}]},renderHTML:({HTMLAttributes:e})=>cp({background_color:e.value})}),eh=Md.create({name:"device_manager",addCommands(){return{getDevice:ap((()=>Ht(this.options,"device")))}}}),th=op.create({name:Pp.FONT_STYLE,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:ap((({editor:e,commands:t})=>{const n=t.getDefaultFontStyle();return Vt((()=>{var t;return(null===(t=e.getAttributes(this.name))||void 0===t?void 0:t.italic)??zt(n).italic}))})),isItalicAvailable:ap((({commands:e})=>{const t=e.getFont(),n=e.getFontWeight();return Vt((()=>zt(t).isItalicSupported(zt(n))))})),getDefaultFontStyle:ap((({commands:e})=>{const t=e.getPreset();return Vt((()=>({italic:"italic"===zt(t).common.font_style})))})),toggleItalic:ap((({commands:e})=>{zt(this.editor.commands.isItalicAvailable())&&(zt(e.isItalic())?e.removeItalic():e.applyItalic())})),applyItalic:ap((({commands:e})=>{e.setMark(this.name,{italic:!0})})),removeItalic:ap((({commands:e})=>{e.setMark(this.name,{italic:!1})}))}},addKeyboardShortcuts:()=>({"Mod-i":up("toggleItalic"),"Mod-I":up("toggleItalic")}),parseHTML(){const e=e=>e.includes("italic")&&{italic:!0};return[{style:"--zw-font-style",getAttrs:e},{style:"font-style",getAttrs:e},{tag:"i",attrs:{italic:!0}}]},renderHTML:({HTMLAttributes:e})=>cp({font_style:e.italic?"italic":"normal"})}),nh=op.create({name:Pp.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:ap((({commands:e})=>{const t=e.getTextDecoration();return Vt((()=>zt(t).underline))})),isStrikeThrough:ap((({commands:e})=>{const t=e.getTextDecoration();return Vt((()=>zt(t).strike_through))})),getTextDecoration:ap((({editor:e,commands:t})=>{const n=t.getDefaultTextDecoration();return Vt((()=>{const t=e.getAttributes(this.name)??{};return{underline:t.underline??zt(n).underline,strike_through:t.strike_through??zt(n).strike_through}}))})),isUnderlineCustomized:ap((({commands:e})=>{const t=e.isUnderline(),n=e.getDefaultTextDecoration();return Vt((()=>zt(t)!==zt(n).underline))})),getDefaultTextDecoration:ap((({commands:e})=>{const t=e.getPreset();return Vt((()=>{const e=zt(t).common.text_decoration;return{underline:e.includes("underline"),strike_through:e.includes("line-through")}}))})),toggleUnderline:ap((({commands:e})=>{e.toggleTextDecoration("underline")})),toggleStrikeThrough:ap((({commands:e})=>{e.toggleTextDecoration("strike_through")})),toggleTextDecoration:ap((({commands:e},t)=>{zt(e.getTextDecoration())[t]?e.removeTextDecoration(t):e.applyTextDecoration(t)})),applyTextDecoration:ap((({commands:e},t)=>{e.setMark(this.name,{[t]:!0})})),removeTextDecoration:ap((({commands:e},t)=>{e.setMark(this.name,{...zt(e.getTextDecoration()),[t]:!1})}))}},addKeyboardShortcuts:()=>({"Mod-u":up("toggleUnderline"),"Mod-U":up("toggleUnderline")}),parseHTML(){const e=e=>{const t=e.includes("underline"),n=e.includes("line-through");return!(!t&&!n)&&{underline:t,strike_through:n}};return[{style:"--zw-text-decoration",getAttrs:e},{style:"text-decoration-line",getAttrs:e},{style:"text-decoration",getAttrs:e},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:e}){const t=[];return e.underline&&t.push("underline"),e.strike_through&&t.push("line-through"),t.length||t.push("none"),cp({text_decoration:t.join(" ")})}}),rh=Md.create({name:"case_style",addCommands:()=>({applyCaseStyle:ap((({commands:e},t)=>{switch(t){case Ip.CAPITALIZE:return e.applyCapitalize();case Ip.LOWERCASE:return e.applyLowerCase();case Ip.UPPERCASE:return e.applyUpperCase()}})),applyCapitalize:ap((({commands:e})=>{e.transformText((({text:e})=>function(e){return e.toLowerCase().replace(/(?:^|\s)\S/g,(e=>e.toUpperCase()))}(e)))})),applyLowerCase:ap((({commands:e})=>{e.transformText((({text:e})=>e.toLowerCase()))})),applyUpperCase:ap((({commands:e})=>{e.transformText((({text:e})=>e.toUpperCase()))}))})}),oh={mobile:null,tablet:null,desktop:null},ih=Md.create({name:Pp.ALIGNMENT,addGlobalAttributes:()=>[{types:[Bp.PARAGRAPH,Bp.HEADING],attributes:{[Pp.ALIGNMENT]:{isRequired:!1,parseHTML({style:e}){const t=function(e){const t=jp[e]||e;return $p.values.includes(t)?t:null}(e.textAlign);if(t)return{desktop:t,tablet:t,mobile:t};const n=e.getPropertyValue("--zw-text-align-mobile")||null,r=e.getPropertyValue("--zw-text-align-tablet")||null,o=e.getPropertyValue("--zw-text-align-desktop")||null;return n||r||o?{desktop:o,tablet:r,mobile:n}:null},renderHTML:e=>e.alignment?lp({text_align_mobile:e.alignment.mobile,text_align_tablet:e.alignment.tablet,text_align_desktop:e.alignment.desktop}):null}}}],addCommands(){return{applyAlignment:ap((({commands:e},t)=>{e.setBlockAttributes(this.name,{desktop:t,tablet:t,mobile:t})})),getAlignment:ap((({commands:e})=>{const t=e.getBlockAttributes(this.name,oh),n=e.getDevice(),r=e.getDefaultAlignment();return Vt((()=>{var e;return(null===(e=zt(t))||void 0===e?void 0:e[zt(n)])??zt(r)}))})),getDefaultAlignment:ap((({commands:e})=>{const t=e.getDevice(),n=e.getPreset();return Vt((()=>zt(n)[zt(t)].alignment))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-l":up("applyAlignment",$p.LEFT),"Mod-Shift-e":up("applyAlignment",$p.CENTER),"Mod-Shift-r":up("applyAlignment",$p.RIGHT),"Mod-Shift-j":up("applyAlignment",$p.JUSTIFY)})}),sh={mobile:null,tablet:null,desktop:null},ah=Md.create({name:Pp.LINE_HEIGHT,addGlobalAttributes(){return[{types:[Bp.PARAGRAPH,Bp.HEADING],attributes:{[Pp.LINE_HEIGHT]:{isRequired:!1,parseHTML:e=>{if(e.matches('[style*="--zw-line-height"]')){return{mobile:null,tablet:e.style.getPropertyValue("--zw-line-height-tablet")||null,desktop:e.style.getPropertyValue("--zw-line-height-desktop")||null}}const t=e.style.lineHeight;if(!t)return null;const n=Fp(t,e,zt(this.options.wrapperRef));return{desktop:n,tablet:n,mobile:null}},renderHTML:e=>e.line_height?lp({line_height_mobile:e.line_height.mobile,line_height_tablet:e.line_height.tablet,line_height_desktop:e.line_height.desktop}):null}}}]},addCommands(){return{getLineHeight:ap((({commands:e})=>{const t=e.getBlockAttributes(this.name,sh),n=e.getDevice(),r=e.getDefaultLineHeight();return Vt((()=>{var e;return(null===(e=zt(t))||void 0===e?void 0:e[zt(n)])??zt(r)}))})),getDefaultLineHeight:ap((({commands:e})=>{const t=e.getDevice(),n=e.getPreset();return Vt((()=>zt(n)[zt(t)].line_height))})),applyLineHeight:ap((({commands:e},t)=>{e.setBlockAttributes(this.name,{desktop:t,tablet:t,mobile:null},sh)}))}}}),lh=ip.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",md(this.options.HTMLAttributes,e),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)}}}).extend({name:Bp.LIST_ITEM,addKeyboardShortcuts(){const{Enter:e}=this.parent();return{Enter:e}}}),ch=ip.create({name:Bp.LIST,content:`${Bp.LIST_ITEM}+`,group:"block list",addExtensions:()=>[lh],addOptions:()=>({baseClass:""}),addAttributes:()=>({bullet:{default:{type:Lp.DISC}}}),parseHTML(){const e={a:Lp.ROMAN,i:Lp.LATIN,1:Lp.DECIMAL},t=t=>{for(const n of Lp.values){const r=`.${this.options.baseClass}${n}`;if(t.matches(r))return n;if(e[t.type.toLowerCase()]===n)return n}};return[{tag:"ol",getAttrs:e=>({bullet:{type:t(e)||Lp.DECIMAL}})},{tag:"ul",getAttrs:e=>({bullet:{type:t(e)||Lp.DISC}})}]},renderHTML({HTMLAttributes:e}){return[Lp.ordered.includes(e.bullet.type)?"ol":"ul",{class:this.options.baseClass+e.bullet.type},0]},addCommands:()=>({getListType:ap((({commands:e})=>{const t=e.getBlockAttributes("bullet",{type:null});return Vt((()=>zt(t).type??null))})),applyList:ap((({commands:e,chain:t},n)=>{if(zt(e.getListType())!==n)return t().applyDefaultPreset()._addList(n).run();e.applyDefaultPreset()})),_addList:ap((({chain:e},t)=>e().toggleList(Bp.LIST,Bp.LIST_ITEM).setBlockAttributes("bullet",{type:t}).run())),removeList:ap((({commands:e})=>{e.liftListItem(Bp.LIST_ITEM)}))}),addInputRules(){const e=(e,t)=>function(e){return new Ad({find:e.find,handler:({state:t,range:n,match:r})=>{const o=vd(e.getAttributes,void 0,r)||{},i=t.tr.delete(n.from,n.to),s=i.doc.resolve(n.from).blockRange(),a=s&&hl(s,e.type,o);if(!a)return null;i.wrap(s,a);const l=i.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&gl(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&i.join(n.from-1)}})}({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(t,{attrs:n})=>n.bullet.type===e});return[e(Lp.DISC,/^\s*([-+*])\s$/),e(Lp.DECIMAL,/^(\d+)\.\s$/),e(Lp.LATIN,/^([ivx]{1,3})\.\s$/i),e(Lp.ROMAN,/^([a-z])\.\s$/i)]}});function uh(e){this.j={},this.jr=[],this.jd=null,this.t=e}uh.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=dh();var o=mh(this,e);return o?(Object.assign(r.j,o.j),r.jr.append(o.jr),r.jr=o.jd,r.t=n||o.t):r.t=n,this.j[e]=r,r}};var dh=function(){return new uh},ph=function(e){return new uh(e)},hh=function(e,t,n){e.j[t]||(e.j[t]=n)},fh=function(e,t,n){e.jr.push([t,n])},mh=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r<e.jr.length;r++){var o=e.jr[r][0],i=e.jr[r][1];if(o.test(t))return i}return e.jd},gh=function(e,t,n){for(var r=0;r<t.length;r++)hh(e,t[r],n)},vh=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],o=t[n][1];hh(e,r,o)}},yh=function(e,t,n,r){for(var o,i=0,s=t.length;i<s&&(o=e.j[t[i]]);)e=o,i++;if(i>=s)return[];for(;i<s-1;)o=r(),hh(e,t[i],o),e=o,i++;hh(e,t[s-1],n)},bh="DOMAIN",Dh="TLD",Eh="NUM",Ch="AT",wh="DOT",Ah="SLASH",_h=Object.freeze({__proto__:null,DOMAIN:bh,LOCALHOST:"LOCALHOST",TLD:Dh,NUM:Eh,PROTOCOL:"PROTOCOL",MAILTO:"MAILTO",WS:"WS",NL:"NL",OPENBRACE:"OPENBRACE",OPENBRACKET:"OPENBRACKET",OPENANGLEBRACKET:"OPENANGLEBRACKET",OPENPAREN:"OPENPAREN",CLOSEBRACE:"CLOSEBRACE",CLOSEBRACKET:"CLOSEBRACKET",CLOSEANGLEBRACKET:"CLOSEANGLEBRACKET",CLOSEPAREN:"CLOSEPAREN",AMPERSAND:"AMPERSAND",APOSTROPHE:"APOSTROPHE",ASTERISK:"ASTERISK",AT:Ch,BACKSLASH:"BACKSLASH",BACKTICK:"BACKTICK",CARET:"CARET",COLON:"COLON",COMMA:"COMMA",DOLLAR:"DOLLAR",DOT:wh,EQUALS:"EQUALS",EXCLAMATION:"EXCLAMATION",HYPHEN:"HYPHEN",PERCENT:"PERCENT",PIPE:"PIPE",PLUS:"PLUS",POUND:"POUND",QUERY:"QUERY",QUOTE:"QUOTE",SEMI:"SEMI",SLASH:Ah,TILDE:"TILDE",UNDERSCORE:"UNDERSCORE",SYM:"SYM"}),kh="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw vermögensberater-ctb vermögensberatung-pwb ελ ευ бг бел дети ею католик ком қаз мкд мон москва онлайн орг рус рф сайт срб укр გე հայ ישראל קום ابوظبي اتصالات ارامكو الاردن البحرين الجزائر السعودية العليان المغرب امارات ایران بارت بازار بھارت بيتك پاکستان ڀارت تونس سودان سورية شبكة عراق عرب عمان فلسطين قطر كاثوليك كوم مصر مليسيا موريتانيا موقع همراه कॉम नेट भारत भारतम् भारोत संगठन বাংলা ভারত ভাৰত ਭਾਰਤ ભારત ଭାରତ இந்தியா இலங்கை சிங்கப்பூர் భారత్ ಭಾರತ ഭാരതം ලංකා คอม ไทย ລາວ 닷넷 닷컴 삼성 한국 アマゾン グーグル クラウド コム ストア セール ファッション ポイント みんな 世界 中信 中国 中國 中文网 亚马逊 企业 佛山 信息 健康 八卦 公司 公益 台湾 台灣 商城 商店 商标 嘉里 嘉里大酒店 在线 大众汽车 大拿 天主教 娱乐 家電 广东 微博 慈善 我爱你 手机 招聘 政务 政府 新加坡 新闻 时尚 書籍 机构 淡马锡 游戏 澳門 点看 移动 组织机构 网址 网店 网站 网络 联通 诺基亚 谷歌 购物 通販 集团 電訊盈科 飞利浦 食品 餐厅 香格里拉 香港".split(" "),xh=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,Oh=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,Sh=/\uFE0F/,Nh=/\d/,Th=/\s/;function Fh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=dh(),n=ph(Eh),r=ph(bh),o=dh(),i=ph("WS"),s=[[Nh,r],[xh,r],[Oh,r],[Sh,r]],a=function(){var e=ph(bh);return e.j={"-":o},e.jr=[].concat(s),e},l=function(e){var t=a();return t.t=e,t};vh(t,[["'",ph("APOSTROPHE")],["{",ph("OPENBRACE")],["[",ph("OPENBRACKET")],["<",ph("OPENANGLEBRACKET")],["(",ph("OPENPAREN")],["}",ph("CLOSEBRACE")],["]",ph("CLOSEBRACKET")],[">",ph("CLOSEANGLEBRACKET")],[")",ph("CLOSEPAREN")],["&",ph("AMPERSAND")],["*",ph("ASTERISK")],["@",ph(Ch)],["`",ph("BACKTICK")],["^",ph("CARET")],[":",ph("COLON")],[",",ph("COMMA")],["$",ph("DOLLAR")],[".",ph(wh)],["=",ph("EQUALS")],["!",ph("EXCLAMATION")],["-",ph("HYPHEN")],["%",ph("PERCENT")],["|",ph("PIPE")],["+",ph("PLUS")],["#",ph("POUND")],["?",ph("QUERY")],['"',ph("QUOTE")],["/",ph(Ah)],[";",ph("SEMI")],["~",ph("TILDE")],["_",ph("UNDERSCORE")],["\\",ph("BACKSLASH")]]),hh(t,"\n",ph("NL")),fh(t,Th,i),hh(i,"\n",dh()),fh(i,Th,i);for(var c=0;c<kh.length;c++)yh(t,kh[c],l(Dh),a);var u=a(),d=a(),p=a(),h=a();yh(t,"file",u,a),yh(t,"ftp",d,a),yh(t,"http",p,a),yh(t,"mailto",h,a);var f=a(),m=ph("PROTOCOL"),g=ph("MAILTO");hh(d,"s",f),hh(d,":",m),hh(p,"s",f),hh(p,":",m),hh(u,":",m),hh(f,":",m),hh(h,":",g);for(var v=a(),y=0;y<e.length;y++)yh(t,e[y],v,a);return hh(v,":",m),yh(t,"localhost",l("LOCALHOST"),a),fh(t,Nh,n),fh(t,xh,r),fh(t,Oh,r),fh(t,Sh,r),fh(n,Nh,n),fh(n,xh,r),fh(n,Oh,r),fh(n,Sh,r),hh(n,"-",o),hh(r,"-",o),hh(o,"-",o),fh(r,Nh,r),fh(r,xh,r),fh(r,Oh,r),fh(r,Sh,r),fh(o,Nh,r),fh(o,xh,r),fh(o,Oh,r),fh(o,Sh,r),t.jd=ph("SYM"),t}var Mh={defaultProtocol:"http",events:null,format:Ih,formatHref:Ih,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function Ih(e){return e}function $h(){}function Bh(e,t){function n(t,n){this.t=e,this.v=t,this.tk=n}return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var o in n)r[o]=n[o];r.constructor=t,t.prototype=r}($h,n,t),n}$h.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mh.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var Lh=Bh("email",{isLink:!0}),Ph=Bh("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Rh=Bh("text"),zh=Bh("nl"),jh=Bh("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mh.defaultProtocol,t=this.tk,n=!1,r=!1,o=[],i=0;"PROTOCOL"===t[i].t;)n=!0,o.push(t[i].v),i++;for(;t[i].t===Ah;)r=!0,o.push(t[i].v),i++;for(;i<t.length;i++)o.push(t[i].v);return o=o.join(""),n||r||(o="".concat(e,"://").concat(o)),o},hasProtocol:function(){return"PROTOCOL"===this.tk[0].t}}),Hh=Object.freeze({__proto__:null,MultiToken:$h,Base:$h,createTokenClass:Bh,MailtoEmail:Lh,Email:Ph,Text:Rh,Nl:zh,Url:jh});function Vh(){var e=dh(),t=dh(),n=dh(),r=dh(),o=dh(),i=dh(),s=dh(),a=ph(jh),l=dh(),c=ph(jh),u=ph(jh),d=dh(),p=dh(),h=dh(),f=dh(),m=dh(),g=ph(jh),v=ph(jh),y=ph(jh),b=ph(jh),D=dh(),E=dh(),C=dh(),w=dh(),A=dh(),_=dh(),k=ph(Ph),x=dh(),O=ph(Ph),S=ph(Lh),N=dh(),T=dh(),F=dh(),M=dh(),I=ph(zh);hh(e,"NL",I),hh(e,"PROTOCOL",t),hh(e,"MAILTO",n),hh(t,Ah,r),hh(r,Ah,o),hh(e,Dh,i),hh(e,bh,i),hh(e,"LOCALHOST",a),hh(e,Eh,i),hh(o,Dh,u),hh(o,bh,u),hh(o,Eh,u),hh(o,"LOCALHOST",u),hh(i,wh,s),hh(A,wh,_),hh(s,Dh,a),hh(s,bh,i),hh(s,Eh,i),hh(s,"LOCALHOST",i),hh(_,Dh,k),hh(_,bh,A),hh(_,Eh,A),hh(_,"LOCALHOST",A),hh(a,wh,s),hh(k,wh,_),hh(a,"COLON",l),hh(a,Ah,u),hh(l,Eh,c),hh(c,Ah,u),hh(k,"COLON",x),hh(x,Eh,O);var $=["AMPERSAND","ASTERISK",Ch,"BACKSLASH","BACKTICK","CARET","DOLLAR",bh,"EQUALS","HYPHEN","LOCALHOST",Eh,"PERCENT","PIPE","PLUS","POUND","PROTOCOL",Ah,"SYM","TILDE",Dh,"UNDERSCORE"],B=["APOSTROPHE","CLOSEANGLEBRACKET","CLOSEBRACE","CLOSEBRACKET","CLOSEPAREN","COLON","COMMA",wh,"EXCLAMATION","OPENANGLEBRACKET","OPENBRACE","OPENBRACKET","OPENPAREN","QUERY","QUOTE","SEMI"];hh(u,"OPENBRACE",p),hh(u,"OPENBRACKET",h),hh(u,"OPENANGLEBRACKET",f),hh(u,"OPENPAREN",m),hh(d,"OPENBRACE",p),hh(d,"OPENBRACKET",h),hh(d,"OPENANGLEBRACKET",f),hh(d,"OPENPAREN",m),hh(p,"CLOSEBRACE",u),hh(h,"CLOSEBRACKET",u),hh(f,"CLOSEANGLEBRACKET",u),hh(m,"CLOSEPAREN",u),hh(g,"CLOSEBRACE",u),hh(v,"CLOSEBRACKET",u),hh(y,"CLOSEANGLEBRACKET",u),hh(b,"CLOSEPAREN",u),hh(D,"CLOSEBRACE",u),hh(E,"CLOSEBRACKET",u),hh(C,"CLOSEANGLEBRACKET",u),hh(w,"CLOSEPAREN",u),gh(p,$,g),gh(h,$,v),gh(f,$,y),gh(m,$,b),gh(p,B,D),gh(h,B,E),gh(f,B,C),gh(m,B,w),gh(g,$,g),gh(v,$,v),gh(y,$,y),gh(b,$,b),gh(g,B,g),gh(v,B,v),gh(y,B,y),gh(b,B,b),gh(D,$,g),gh(E,$,v),gh(C,$,y),gh(w,$,b),gh(D,B,D),gh(E,B,E),gh(C,B,C),gh(w,B,w),gh(u,$,u),gh(d,$,u),gh(u,B,d),gh(d,B,d),hh(n,Dh,S),hh(n,bh,S),hh(n,Eh,S),hh(n,"LOCALHOST",S),gh(S,$,S),gh(S,B,N),gh(N,$,S),gh(N,B,N);var L=["AMPERSAND","APOSTROPHE","ASTERISK","BACKSLASH","BACKTICK","CARET","CLOSEBRACE","DOLLAR",bh,"EQUALS","HYPHEN",Eh,"OPENBRACE","PERCENT","PIPE","PLUS","POUND","QUERY",Ah,"SYM","TILDE",Dh,"UNDERSCORE"];return gh(i,L,T),hh(i,Ch,F),gh(a,L,T),hh(a,Ch,F),gh(s,L,T),gh(T,L,T),hh(T,Ch,F),hh(T,wh,M),gh(M,L,T),hh(F,Dh,A),hh(F,bh,A),hh(F,Eh,A),hh(F,"LOCALHOST",k),e}function Kh(e,t,n){var r=n[0].s,o=n[n.length-1].e;return new e(t.substr(r,o-r),n)}var Wh="undefined"!=typeof console&&console&&console.warn||function(){},Uh={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function qh(e){if(Uh.initialized&&Wh('linkifyjs: already initialized - will not register custom protocol "'.concat(e,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(e))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");Uh.customProtocols.push(e)}function Gh(e){return Uh.initialized||function(){Uh.scanner={start:Fh(Uh.customProtocols),tokens:_h},Uh.parser={start:Vh(),tokens:Hh};for(var e={createTokenClass:Bh},t=0;t<Uh.pluginQueue.length;t++)Uh.pluginQueue[t][1]({scanner:Uh.scanner,parser:Uh.parser,utils:e});Uh.initialized=!0}(),function(e,t,n){for(var r=n.length,o=0,i=[],s=[];o<r;){for(var a=e,l=null,c=null,u=0,d=null,p=-1;o<r&&!(l=mh(a,n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||mh(a,n[o].t));)l=null,(a=c).accepts()?(p=0,d=a):p>=0&&p++,o++,u++;if(p<0)for(var h=o-u;h<o;h++)s.push(n[h]);else{s.length>0&&(i.push(Kh(Rh,t,s)),s=[]),o-=p,u-=p;var f=d.t,m=n.slice(o-u,o);i.push(Kh(f,t,m))}}return s.length>0&&i.push(Kh(Rh,t,s)),i}(Uh.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r<n;){var o=e.charCodeAt(r),i=void 0,s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,o=[],i=0,s=0;s<r;){for(var a=e,l=null,c=0,u=null,d=-1,p=-1;s<r&&(l=mh(a,n[s]));)(a=l).accepts()?(d=0,p=0,u=a):d>=0&&(d+=n[s].length,p++),c+=n[s].length,i+=n[s].length,s++;i-=d,s-=p,c-=d,o.push({t:u.t,v:t.substr(i-c,c),s:i-c,e:i})}return o}(Uh.scanner.start,e))}function Jh(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Gh(e),r=[],o=0;o<n.length;o++){var i=n[o];!i.isLink||t&&i.t!==t||r.push(i.toObject())}return r}function Yh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Gh(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function Xh(e){return new Ul({key:new Jl("autolink"),appendTransaction:(t,n,r)=>{const o=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),i=t.some((e=>e.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(e,t){const n=new Sl(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]),{mapping:l}=a,c=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,o)=>{const i=[];if(e.ranges.length)e.forEach(((e,t)=>{i.push({from:e,to:t})}));else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach((({from:e,to:n})=>{const i=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(i,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),np(r)}(a);return c.forEach((({oldRange:t,newRange:o})=>{rp(t.from,t.to,n.doc).filter((t=>t.mark.type===e.type)).forEach((t=>{const o=rp(l.map(t.from),l.map(t.to),r.doc).filter((t=>t.mark.type===e.type));if(!o.length)return;const i=o[0],a=n.doc.textBetween(t.from,t.to,void 0," "),c=r.doc.textBetween(i.from,i.to,void 0," "),u=Yh(a),d=Yh(c);u&&!d&&s.removeMark(i.from,i.to,e.type)})),function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,o,(e=>e.isTextblock)).forEach((t=>{Jh(r.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((e=>e.isLink)).filter((t=>!e.validate||e.validate(t.value))).map((e=>({...e,from:t.pos+e.start+1,to:t.pos+e.end+1}))).filter((e=>{const t=o.from>=e.from&&o.from<=e.to,n=o.to>=e.from&&o.to<=e.to;return t||n})).forEach((t=>{s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),s.steps.length?s:void 0}})}const Qh=op.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(qh)},inclusive(){return this.options.autolink},addOptions:()=>({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},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){return["a",md(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[sp({find:e=>Jh(e).filter((e=>!this.options.validate||this.options.validate(e.value))).filter((e=>e.isLink)).map((e=>({text:e.value,index:e.start,data:e}))),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];var t;return this.options.autolink&&e.push(Xh({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push((t={type:this.type},new Ul({key:new Jl("handleClickLink"),props:{handleClick:(e,n,r)=>{var o;const i=tp(e.state,t.type.name);return!(!(null===(o=r.target)||void 0===o?void 0:o.closest("a"))||!i.href||(window.open(i.href,i.target),0))}}}))),this.options.linkOnPaste&&e.push(function(e){return new Ul({key:new Jl("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:o}=t,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((e=>{a+=e.textContent}));const l=Jh(a).find((e=>e.isLink&&e.value===a));return!(!a||!l||(e.editor.commands.setMark(e.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),e}}),Zh=Qh.extend({name:Pp.LINK,addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),openOnClick:!1}},addAttributes(){return{href:{default:null,parseHTML:e=>{const t=e.getAttribute("href");return t.startsWith("#")?parseFloat(e.getAttribute("href").replace("#","")):t}},target:{default:Rp.SELF,parseHTML:e=>e.getAttribute("target")||Rp.SELF},destination:{default:zp.URL,parseHTML:e=>{const t=e.getAttribute("href");if(!t.startsWith("#"))return zp.URL;const n=t.replace("#","");return zt(this.options.pageBlocks).find((e=>e.id===parseInt(n)))?zp.BLOCK:zp.URL}}}},addCommands(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),applyLink:ap((({commands:e,chain:t},n)=>e.getSelectedText()?t().setMark(this.name,n).transformText((()=>n.text)).extendMarkRange(Pp.LINK).run():e.insertContent(qp.text(n.text,[qp.mark(Pp.LINK,n)])))),isLink:ap((({editor:e})=>Vt((()=>e.isActive(Pp.LINK))))),getLinkPreset:ap((()=>Vt((()=>this.options.preset))))}},renderHTML({HTMLAttributes:e}){const t=e.destination===zp.BLOCK?`#${e.href}`:e.href,n=`${this.options.basePresetClass+this.options.preset.id} zw-style`;return["a",{href:t,target:e.target,class:n},0]}}),ef=op.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:e=>"super"===e&&null}],renderHTML({HTMLAttributes:e}){return["sup",md(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),tf=ef.extend({addKeyboardShortcuts:null,addOptions:()=>({HTMLAttributes:{class:"zw-superscript"}})}),nf=ip.create({name:"doc",topNode:!0,content:"block+"}),rf=ip.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",md(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),of=ip.create({name:"text",group:"inline"}),sf=Md.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Ul({props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];return n?(e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,i=!e.isLeaf&&!e.childCount;if((n||!this.options.showOnlyCurrent)&&i){const r=[this.options.emptyNodeClass];this.editor.isEmpty&&r.push(this.options.emptyEditorClass);const i=_u.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(i)}return this.options.includeChildren})),Ou.create(e,o)):null}}})]}});var af=function(){};af.prototype.append=function(e){return e.length?(e=af.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},af.prototype.prepend=function(e){return e.length?af.from(e).append(this):this},af.prototype.appendInner=function(e){return new cf(this,e)},af.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?af.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},af.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},af.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},af.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},af.from=function(e){return e instanceof af?e:e&&e.length?new lf(e):af.empty};var lf=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(af);af.empty=new lf([]);var cf=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(af),uf=af;class df{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new pf(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new pf(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new df(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),u=new pf(e.mapping.maps[n],c,t);(l=a&&a.merge(u))&&(u=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(u),t&&(i++,t=void 0),r||(a=u)}let l=i-n.depth;return l>ff&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new df(s.append(o),i)}remapping(e,t){let n=new tl;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new df(this.items.append(e.map((e=>new pf(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new pf(l,i,c))}else n.push(new pf(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new pf(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),u=new df(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new pf(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new df(uf.from(r.reverse()),o)}}df.empty=new df(uf.empty,0);class pf{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new pf(t.getMap().invert(),t,this.selection)}}}class hf{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const ff=20;function mf(e){let t=[];return e.forEach(((e,n,r,o)=>t.push(r,o))),t}function gf(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function vf(e,t,n,r){let o=Df(t),i=Ef.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,o),c=new hf(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(Ef,{redo:r,historyState:c}).scrollIntoView())}let yf=!1,bf=null;function Df(e){let t=e.plugins;if(bf!=t){yf=!1,bf=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){yf=!0;break}}return yf}const Ef=new Jl("history"),Cf=new Jl("closeHistory");function wf(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Ul({key:Ef,state:{init:()=>new hf(df.empty,df.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(Ef);if(i)return i.historyState;n.getMeta(Cf)&&(e=new hf(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Ef))return s.getMeta(Ef).redo?new hf(e.done.addTransform(n,void 0,r,Df(t)),e.undone,mf(n.mapping.maps[n.steps.length-1]),e.prevTime):new hf(e.done,e.undone.addTransform(n,void 0,r,Df(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new hf(e.done.rebased(n,o),e.undone.rebased(n,o),gf(e.prevRanges,n.mapping),e.prevTime):new hf(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),gf(e.prevRanges,n.mapping),e.prevTime);{let o=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),i=s?gf(e.prevRanges,n.mapping):mf(n.mapping.maps[n.steps.length-1]);return new hf(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,Df(t)),df.empty,i,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Af:"historyRedo"==n?_f:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const Af=(e,t)=>{let n=Ef.getState(e);return!(!n||0==n.done.eventCount)&&(t&&vf(n,e,t,!1),!0)},_f=(e,t)=>{let n=Ef.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&vf(n,e,t,!0),!0)},kf=Md.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Af(e,t),redo:()=>({state:e,dispatch:t})=>_f(e,t)}),addProseMirrorPlugins(){return[wf(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),xf=Md.create({name:"node_processor",addCommands:()=>({setBlockAttributes:ap((({commands:e},t,n,r={})=>{const o=zt(e.getBlockAttributes(t))??{};for(const i of Bp.blocks)e.updateAttributes(i,{[t]:{...r,...o,...n}})})),getBlockAttributes:ap((({editor:e},t,n)=>Vt((()=>{let r=Object.assign({},n||{});for(const n of Bp.blocks){var o;Object.assign(r,(null===(o=e.getAttributes(n))||void 0===o?void 0:o[t])||{})}return Object.keys(r).length?r:null}))))})}),Of=Md.create({name:"text_processor",addCommands:()=>({getSelectedText:ap((({state:e})=>{const{from:t,to:n}=e.selection;return e.doc.textBetween(t,n," ")})),unsetMarks:ap((({commands:e},t)=>{t.forEach((t=>e.unsetMark(t)))})),transformText:ap((({state:e},t)=>{const{selection:n}=e.tr;n.from!==n.to&&e.doc.nodesBetween(n.from,n.to,((r,o)=>{if(!r.isText)return;const i=Math.max(o,n.from),s=Math.min(o+r.nodeSize,n.to),a=Math.max(0,n.from-o),l=Math.max(0,n.to-o),c=t({text:r.textContent.substring(a,l),position:{start:i,end:s}}),u=e.schema.text(c,r.marks);e.tr.replaceWith(i,s,u)}))}))})}),Sf=Md.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:ap((({state:e})=>{this.storage.selection=e.selection})),restoreSelection:ap((({commands:e})=>{this.storage.selection&&e.setTextSelection(this.storage.selection)})),expandSelectionToBlock:ap((({state:e,commands:t})=>{let n=e.selection.from,r=e.selection.to;e.doc.nodesBetween(n,r,((e,t,o)=>{o.type.name===Bp.DOCUMENT&&(n=Math.min(n,t+1),r=Math.max(r,t+e.nodeSize-1))})),t.setTextSelection({from:n,to:r})}))}}});class Nf extends class{static create(e){const t=new this(e||{});return new Ul({key:new Jl(this.name),props:t.buildProps()})}constructor(e){this.options=e}buildProps(){return{}}}{buildProps(){return{transformPastedHTML:this._transformPastedHTML.bind(this),handlePaste:this._handlePaste.bind(this)}}_transformPastedHTML(e){const t=Wp.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const e of Array.from(t))e.style.removeProperty("margin"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-right"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("margin-left")}_handlePaste(e,t,n){const r=this._insertPastedContent(e,n).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(r),!0}_insertPastedContent({state:e,input:t},n){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(n.content,t.shiftKey):e.tr.replaceSelection(n)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),n=this._isMatchPosition(t.from,e.selection.from),r=this._isMatchPosition(t.to,e.selection.to);return n&&r}_expandSelectionToBlocks({selection:e,doc:t}){let n=e.from,r=e.to;return t.nodesBetween(n,r,((e,t,o)=>{o.type.name===Bp.DOCUMENT&&(n=Math.min(n,t+1),r=Math.max(r,t+e.nodeSize-1))})),{from:n,to:r}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}const Tf=Md.create({name:"copy_paste_processor",addProseMirrorPlugins:()=>[Nf.create()]}),Ff=Md.create({name:Pp.MARGIN,addGlobalAttributes:()=>[{types:[Bp.PARAGRAPH,Bp.HEADING],attributes:{[Pp.MARGIN]:{isRequired:!1,parseHTML(e){const{margin:t,marginTop:n,marginRight:r,marginBottom:o,marginLeft:i}=e.style;if(![t,n,r,o,i].some((e=>!!e)))return null;if(t)return{value:t};return{value:[n||0,r||0,o||0,i||0].join(" ")}},renderHTML:e=>e.margin?lp({margin:e.margin.value}):null}}}]});function Mf(e){const t=t=>e.presetsRef.value.find((e=>e.id===t)),n=function(e){return It(e,!1),e}({default:null,link:null});return Jt(e.presetsRef,(()=>{n.default=t(e.defaultPresetId),n.link=t(e.linkPresetId)}),{immediate:!0}),[nf,rf.configure({HTMLAttributes:{class:"zw-style"}}),sf.configure({placeholder:"Type your text here...",emptyNodeClass:"zw-wysiwyg__placeholder"}),of,kf,xf,Of,Sf,Tf].concat([Jp.configure({presets:e.presetsRef,defaultId:e.defaultPresetId,baseClass:e.basePresetClass,makeVariable:e.makePresetVariable}),ch.configure({baseClass:e.baseListClass}),eh.configure({device:e.deviceRef}),Xp.configure({minSize:e.minFontSize,maxSize:e.maxFontSize,wrapperRef:e.wrapperRef}),Hp.configure({fonts:e.fonts,defaultPreset:Ht(n,"default")}),Yp,Qp,Zp,th,nh,rh,tf,ih,ah.configure({wrapperRef:e.wrapperRef}),Zh.configure({preset:Ht(n,"link"),basePresetClass:e.basePresetClass,pageBlocks:e.pageBlocksRef}),Ff])}class If{types;parse(e){const{window:t}=new i.JSDOM(e);return this.types=t,t.document}}class $f{static build(e){const t=function(e){return Dd(Nd.resolve(e))}(Mf({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Rt(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Rt(Mp.DESKTOP),pageBlocksRef:Rt([]),wrapperRef:i.JSDOM.fragment("<p></p>").firstElementChild}));return new $f({schema:t,domParser:La.fromSchema(t)})}#t;#e;constructor({schema:e,domParser:t}){this.#t=e,this.#e=t}toJSON(e){const t=Wp.build(e,{parser:new If});return t.normalizeHTML(),this.#e.parse(t.dom.body)}}const Bf=new J;Bf.command("to-json").argument("<html>").option("--config <path>","generator config",e.resolve(__dirname,"../bin/zp.config.json")).action(((t,{config:n})=>{const r=e.resolve(process.cwd(),n),o=$f.build(require(r).editor),i=(s=o.toJSON(t),JSON.stringify(s,((e,t)=>null===t?void 0:t),2).replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,(e=>e.replace(/"/g,""))).replace(/: "(.+)"([,\n])/g,": '$1'$2"));var s;console.log(i)})),Bf.parse();
6
+ */var lt=Object.freeze({}),ct=Array.isArray;function pt(t){return null==t}function ft(t){return null!=t}function ht(t){return!0===t}function dt(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function mt(t){return"function"==typeof t}function gt(t){return null!==t&&"object"==typeof t}var vt=Object.prototype.toString;function yt(t){return vt.call(t).slice(8,-1)}function bt(t){return"[object Object]"===vt.call(t)}function _t(t){return"[object RegExp]"===vt.call(t)}function Dt(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function wt(t){return ft(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function Et(t){return null==t?"":Array.isArray(t)||bt(t)&&t.toString===vt?JSON.stringify(t,null,2):String(t)}function Ct(t){var e=parseFloat(t);return isNaN(e)?t:e}function kt(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}var At=kt("slot,component",!0),xt=kt("key,ref,slot,slot-scope,is");function Ot(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}var St=Object.prototype.hasOwnProperty;function Nt(t,e){return St.call(t,e)}function Tt(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var Ft=/-(\w)/g,Mt=Tt((function(t){return t.replace(Ft,(function(t,e){return e?e.toUpperCase():""}))})),It=Tt((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),$t=/\B([A-Z])/g,Bt=Tt((function(t){return t.replace($t,"-$1").toLowerCase()}));var Rt=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function Lt(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function Pt(t,e){for(var n in e)t[n]=e[n];return t}function jt(t){for(var e={},n=0;n<t.length;n++)t[n]&&Pt(e,t[n]);return e}function zt(t,e,n){}var Ht=function(t,e,n){return!1},Vt=function(t){return t};function Wt(t,e){if(t===e)return!0;var n=gt(t),r=gt(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var o=Array.isArray(t),i=Array.isArray(e);if(o&&i)return t.length===e.length&&t.every((function(t,n){return Wt(t,e[n])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(o||i)return!1;var s=Object.keys(t),a=Object.keys(e);return s.length===a.length&&s.every((function(n){return Wt(t[n],e[n])}))}catch(t){return!1}}function Ut(t,e){for(var n=0;n<t.length;n++)if(Wt(t[n],e))return n;return-1}function qt(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function Kt(t,e){return t===e?0===t&&1/t!=1/e:t==t||e==e}var Jt=["component","directive","filter"],Gt=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],Yt={optionMergeStrategies:Object.create(null),silent:!1,productionTip:"production"!==process.env.NODE_ENV,devtools:"production"!==process.env.NODE_ENV,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Ht,isReservedAttr:Ht,isUnknownElement:Ht,getTagNamespace:zt,parsePlatformTagName:Vt,mustUseProp:Ht,async:!0,_lifecycleHooks:Gt},Xt=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function Qt(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function Zt(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var te=new RegExp("[^".concat(Xt.source,".$_\\d]"));var ee="__proto__"in{},ne="undefined"!=typeof window,re=ne&&window.navigator.userAgent.toLowerCase(),oe=re&&/msie|trident/.test(re),ie=re&&re.indexOf("msie 9.0")>0,se=re&&re.indexOf("edge/")>0;re&&re.indexOf("android");var ae=re&&/iphone|ipad|ipod|ios/.test(re);re&&/chrome\/\d+/.test(re),re&&/phantomjs/.test(re);var ue,le=re&&re.match(/firefox\/(\d+)/),ce={}.watch,pe=!1;if(ne)try{var fe={};Object.defineProperty(fe,"passive",{get:function(){pe=!0}}),window.addEventListener("test-passive",null,fe)}catch(t){}var he=function(){return void 0===ue&&(ue=!ne&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),ue},de=ne&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function me(t){return"function"==typeof t&&/native code/.test(t.toString())}var ge,ve="undefined"!=typeof Symbol&&me(Symbol)&&"undefined"!=typeof Reflect&&me(Reflect.ownKeys);ge="undefined"!=typeof Set&&me(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ye=null;function be(t){void 0===t&&(t=null),t||ye&&ye._scope.off(),ye=t,t&&t._scope.on()}var _e=function(){function t(t,e,n,r,o,i,s,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),De=function(t){void 0===t&&(t="");var e=new _e;return e.text=t,e.isComment=!0,e};function we(t){return new _e(void 0,void 0,void 0,String(t))}function Ee(t){var e=new _e(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var Ce=function(){return Ce=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ce.apply(this,arguments)},ke=0,Ae=function(){function t(){this.id=ke++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){Ot(this.subs,t)},t.prototype.depend=function(e){t.target&&(t.target.addDep(this),"production"!==process.env.NODE_ENV&&e&&t.target.onTrack&&t.target.onTrack(Ce({effect:t.target},e)))},t.prototype.notify=function(t){var e=this.subs.slice();"production"===process.env.NODE_ENV||Yt.async||e.sort((function(t,e){return t.id-e.id}));for(var n=0,r=e.length;n<r;n++){if("production"!==process.env.NODE_ENV&&t){var o=e[n];o.onTrigger&&o.onTrigger(Ce({effect:e[n]},t))}e[n].update()}},t}();Ae.target=null;var xe=[];function Oe(t){xe.push(t),Ae.target=t}function Se(){xe.pop(),Ae.target=xe[xe.length-1]}var Ne=Array.prototype,Te=Object.create(Ne);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(t){var e=Ne[t];Zt(Te,t,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o,i=e.apply(this,n),s=this.__ob__;switch(t){case"push":case"unshift":o=n;break;case"splice":o=n.slice(2)}return o&&s.observeArray(o),"production"!==process.env.NODE_ENV?s.dep.notify({type:"array mutation",target:this,key:t}):s.dep.notify(),i}))}));var Fe=Object.getOwnPropertyNames(Te),Me={},Ie=!0;function $e(t){Ie=t}var Be={notify:zt,depend:zt,addSub:zt,removeSub:zt},Re=function(){function t(t,e,n){if(void 0===e&&(e=!1),void 0===n&&(n=!1),this.value=t,this.shallow=e,this.mock=n,this.dep=n?Be:new Ae,this.vmCount=0,Zt(t,"__ob__",this),ct(t)){if(!n)if(ee)t.__proto__=Te;else for(var r=0,o=Fe.length;r<o;r++){Zt(t,s=Fe[r],Te[s])}e||this.observeArray(t)}else{var i=Object.keys(t);for(r=0;r<i.length;r++){var s;Pe(t,s=i[r],Me,void 0,e,n)}}}return t.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)Le(t[e],!1,this.mock)},t}();function Le(t,e,n){var r;if(!(!gt(t)||Je(t)||t instanceof _e))return Nt(t,"__ob__")&&t.__ob__ instanceof Re?r=t.__ob__:!Ie||!n&&he()||!ct(t)&&!bt(t)||!Object.isExtensible(t)||t.__v_skip||(r=new Re(t,e,n)),r}function Pe(t,e,n,r,o,i){var s=new Ae,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var u=a&&a.get,l=a&&a.set;u&&!l||n!==Me&&2!==arguments.length||(n=t[e]);var c=!o&&Le(n,!1,i);return Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var r=u?u.call(t):n;return Ae.target&&("production"!==process.env.NODE_ENV?s.depend({target:t,type:"get",key:e}):s.depend(),c&&(c.dep.depend(),ct(r)&&He(r))),Je(r)&&!o?r.value:r},set:function(a){var p=u?u.call(t):n;if(Kt(p,a)){if("production"!==process.env.NODE_ENV&&r&&r(),l)l.call(t,a);else{if(u)return;if(!o&&Je(p)&&!Je(a))return void(p.value=a);n=a}c=!o&&Le(a,!1,i),"production"!==process.env.NODE_ENV?s.notify({type:"set",target:t,key:e,newValue:a,oldValue:p}):s.notify()}}}),s}}function je(t,e,n){if("production"!==process.env.NODE_ENV&&(pt(t)||dt(t))&&Xr("Cannot set reactive property on undefined, null, or primitive value: ".concat(t)),!Ke(t)){var r=t.__ob__;return ct(t)&&Dt(e)?(t.length=Math.max(t.length,e),t.splice(e,1,n),r&&!r.shallow&&r.mock&&Le(n,!1,!0),n):e in t&&!(e in Object.prototype)?(t[e]=n,n):t._isVue||r&&r.vmCount?("production"!==process.env.NODE_ENV&&Xr("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),n):r?(Pe(r.value,e,n,void 0,r.shallow,r.mock),"production"!==process.env.NODE_ENV?r.dep.notify({type:"add",target:t,key:e,newValue:n,oldValue:void 0}):r.dep.notify(),n):(t[e]=n,n)}"production"!==process.env.NODE_ENV&&Xr('Set operation on key "'.concat(e,'" failed: target is readonly.'))}function ze(t,e){if("production"!==process.env.NODE_ENV&&(pt(t)||dt(t))&&Xr("Cannot delete reactive property on undefined, null, or primitive value: ".concat(t)),ct(t)&&Dt(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount?"production"!==process.env.NODE_ENV&&Xr("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):Ke(t)?"production"!==process.env.NODE_ENV&&Xr('Delete operation on key "'.concat(e,'" failed: target is readonly.')):Nt(t,e)&&(delete t[e],n&&("production"!==process.env.NODE_ENV?n.dep.notify({type:"delete",target:t,key:e}):n.dep.notify()))}}function He(t){for(var e=void 0,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),ct(e)&&He(e)}function Ve(t){return We(t,!0),Zt(t,"__v_isShallow",!0),t}function We(t,e){if(!Ke(t)){if("production"!==process.env.NODE_ENV){ct(t)&&Xr("Avoid using Array as root value for ".concat(e?"shallowReactive()":"reactive()"," as it cannot be tracked in watch() or watchEffect(). Use ").concat(e?"shallowRef()":"ref()"," instead. This is a Vue-2-only limitation."));var n=t&&t.__ob__;n&&n.shallow!==e&&Xr("Target is already a ".concat(n.shallow?"":"non-","shallow reactive object, and cannot be converted to ").concat(e?"":"non-","shallow."))}var r=Le(t,e,he());"production"===process.env.NODE_ENV||r||((null==t||dt(t))&&Xr("value cannot be made reactive: ".concat(String(t))),("Map"===(o=yt(t))||"WeakMap"===o||"Set"===o||"WeakSet"===o)&&Xr("Vue 2 does not support reactive collection types such as Map or Set."))}var o}function Ue(t){return Ke(t)?Ue(t.__v_raw):!(!t||!t.__ob__)}function qe(t){return!(!t||!t.__v_isShallow)}function Ke(t){return!(!t||!t.__v_isReadonly)}function Je(t){return!(!t||!0!==t.__v_isRef)}function Ge(t){return function(t,e){if(Je(t))return t;var n={};return Zt(n,"__v_isRef",!0),Zt(n,"__v_isShallow",e),Zt(n,"dep",Pe(n,"value",t,null,e,he())),n}(t,!1)}function Ye(t){return Je(t)?t.value:t}function Xe(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){var t=e[n];if(Je(t))return t.value;var r=t&&t.__ob__;return r&&r.dep.depend(),t},set:function(t){var r=e[n];Je(r)&&!Je(t)?r.value=t:e[n]=t}})}function Qe(t,e,n){var r=t[e];if(Je(r))return r;var o={get value(){var r=t[e];return void 0===r?n:r},set value(n){t[e]=n}};return Zt(o,"__v_isRef",!0),o}function Ze(t,e){var n,r,o=mt(t);o?(n=t,r="production"!==process.env.NODE_ENV?function(){Xr("Write operation failed: computed value is readonly")}:zt):(n=t.get,r=t.set);var i=he()?null:new hr(ye,n,zt,{lazy:!0});"production"!==process.env.NODE_ENV&&i&&e&&(i.onTrack=e.onTrack,i.onTrigger=e.onTrigger);var s={effect:i,get value(){return i?(i.dirty&&i.evaluate(),Ae.target&&("production"!==process.env.NODE_ENV&&Ae.target.onTrack&&Ae.target.onTrack({effect:Ae.target,target:s,type:"get",key:"value"}),i.depend()),i.value):n()},set value(t){r(t)}};return Zt(s,"__v_isRef",!0),Zt(s,"__v_isReadonly",o),s}var tn,en="".concat("watcher"," callback"),nn="".concat("watcher"," getter"),rn="".concat("watcher"," cleanup"),on={};function sn(t,e,n){return"production"!==process.env.NODE_ENV&&"function"!=typeof e&&Xr("`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."),function(t,e,n){var r=void 0===n?lt:n,o=r.immediate,i=r.deep,s=r.flush,a=void 0===s?"pre":s,u=r.onTrack,l=r.onTrigger;"production"===process.env.NODE_ENV||e||(void 0!==o&&Xr('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==i&&Xr('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));var c,p,f=function(t){Xr("Invalid watch source: ".concat(t,". A watch source can only be a getter/effect ")+"function, a ref, a reactive object, or an array of these types.")},h=ye,d=function(t,e,n){return void 0===n&&(n=null),Kn(t,null,n,h,e)},m=!1,g=!1;Je(t)?(c=function(){return t.value},m=qe(t)):Ue(t)?(c=function(){return t.__ob__.dep.depend(),t},i=!0):ct(t)?(g=!0,m=t.some((function(t){return Ue(t)||qe(t)})),c=function(){return t.map((function(t){return Je(t)?t.value:Ue(t)?ar(t):mt(t)?d(t,nn):void("production"!==process.env.NODE_ENV&&f(t))}))}):mt(t)?c=e?function(){return d(t,nn)}:function(){if(!h||!h._isDestroyed)return p&&p(),d(t,"watcher",[y])}:(c=zt,"production"!==process.env.NODE_ENV&&f(t));if(e&&i){var v=c;c=function(){return ar(v())}}var y=function(t){p=b.onStop=function(){d(t,rn)}};if(he())return y=zt,e?o&&d(e,en,[c(),g?[]:void 0,y]):c(),zt;var b=new hr(ye,c,zt,{lazy:!0});b.noRecurse=!e;var _=g?[]:on;b.run=function(){if(b.active)if(e){var t=b.get();(i||m||(g?t.some((function(t,e){return Kt(t,_[e])})):Kt(t,_)))&&(p&&p(),d(e,en,[t,_===on?void 0:_,y]),_=t)}else b.get()},"sync"===a?b.update=b.run:"post"===a?(b.post=!0,b.update=function(){return Lr(b)}):b.update=function(){if(h&&h===ye&&!h._isMounted){var t=h._preWatchers||(h._preWatchers=[]);t.indexOf(b)<0&&t.push(b)}else Lr(b)};"production"!==process.env.NODE_ENV&&(b.onTrack=u,b.onTrigger=l);e?o?b.run():_=b.get():"post"===a&&h?h.$once("hook:mounted",(function(){return b.get()})):b.get();return function(){b.teardown()}}(t,e,n)}var an=function(){function t(t){void 0===t&&(t=!1),this.active=!0,this.effects=[],this.cleanups=[],!t&&tn&&(this.parent=tn,this.index=(tn.scopes||(tn.scopes=[])).push(this)-1)}return t.prototype.run=function(t){if(this.active){var e=tn;try{return tn=this,t()}finally{tn=e}}else"production"!==process.env.NODE_ENV&&Xr("cannot run an inactive effect scope.")},t.prototype.on=function(){tn=this},t.prototype.off=function(){tn=this.parent},t.prototype.stop=function(t){if(this.active){var e=void 0,n=void 0;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].teardown();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(this.parent&&!t){var r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.active=!1}},t}();var un=Tt((function(t){var e="&"===t.charAt(0),n="~"===(t=e?t.slice(1):t).charAt(0),r="!"===(t=n?t.slice(1):t).charAt(0);return{name:t=r?t.slice(1):t,once:n,capture:r,passive:e}}));function ln(t,e){function n(){var t=n.fns;if(!ct(t))return Kn(t,null,arguments,e,"v-on handler");for(var r=t.slice(),o=0;o<r.length;o++)Kn(r[o],null,arguments,e,"v-on handler")}return n.fns=t,n}function cn(t,e,n,r,o,i){var s,a,u,l;for(s in t)a=t[s],u=e[s],l=un(s),pt(a)?"production"!==process.env.NODE_ENV&&Xr('Invalid handler for event "'.concat(l.name,'": got ')+String(a),i):pt(u)?(pt(a.fns)&&(a=t[s]=ln(a,i)),ht(l.once)&&(a=t[s]=o(l.name,a,l.capture)),n(l.name,a,l.capture,l.passive,l.params)):a!==u&&(u.fns=a,t[s]=u);for(s in e)pt(t[s])&&r((l=un(s)).name,e[s],l.capture)}function pn(t,e,n){var r;t instanceof _e&&(t=t.data.hook||(t.data.hook={}));var o=t[e];function i(){n.apply(this,arguments),Ot(r.fns,i)}pt(o)?r=ln([i]):ft(o.fns)&&ht(o.merged)?(r=o).fns.push(i):r=ln([o,i]),r.merged=!0,t[e]=r}function fn(t,e,n,r,o){if(ft(e)){if(Nt(e,n))return t[n]=e[n],o||delete e[n],!0;if(Nt(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function hn(t){return dt(t)?[we(t)]:ct(t)?mn(t):void 0}function dn(t){return ft(t)&&ft(t.text)&&!1===t.isComment}function mn(t,e){var n,r,o,i,s=[];for(n=0;n<t.length;n++)pt(r=t[n])||"boolean"==typeof r||(i=s[o=s.length-1],ct(r)?r.length>0&&(dn((r=mn(r,"".concat(e||"","_").concat(n)))[0])&&dn(i)&&(s[o]=we(i.text+r[0].text),r.shift()),s.push.apply(s,r)):dt(r)?dn(i)?s[o]=we(i.text+r):""!==r&&s.push(we(r)):dn(r)&&dn(i)?s[o]=we(i.text+r.text):(ht(t._isVList)&&ft(r.tag)&&pt(r.key)&&ft(e)&&(r.key="__vlist".concat(e,"_").concat(n,"__")),s.push(r)));return s}function gn(t,e){var n,r,o,i,s=null;if(ct(t)||"string"==typeof t)for(s=new Array(t.length),n=0,r=t.length;n<r;n++)s[n]=e(t[n],n);else if("number"==typeof t)for(s=new Array(t),n=0;n<t;n++)s[n]=e(n+1,n);else if(gt(t))if(ve&&t[Symbol.iterator]){s=[];for(var a=t[Symbol.iterator](),u=a.next();!u.done;)s.push(e(u.value,s.length)),u=a.next()}else for(o=Object.keys(t),s=new Array(o.length),n=0,r=o.length;n<r;n++)i=o[n],s[n]=e(t[i],i,n);return ft(s)||(s=[]),s._isVList=!0,s}function vn(t,e,n,r){var o,i=this.$scopedSlots[t];i?(n=n||{},r&&("production"===process.env.NODE_ENV||gt(r)||Xr("slot v-bind without argument expects an Object",this),n=Pt(Pt({},r),n)),o=i(n)||(mt(e)?e():e)):o=this.$slots[t]||(mt(e)?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function yn(t){return co(this.$options,"filters",t,!0)||Vt}function bn(t,e){return ct(t)?-1===t.indexOf(e):t!==e}function _n(t,e,n,r,o){var i=Yt.keyCodes[e]||n;return o&&r&&!Yt.keyCodes[e]?bn(o,r):i?bn(i,t):r?Bt(r)!==e:void 0===t}function Dn(t,e,n,r,o){if(n)if(gt(n)){ct(n)&&(n=jt(n));var i=void 0,s=function(s){if("class"===s||"style"===s||xt(s))i=t;else{var a=t.attrs&&t.attrs.type;i=r||Yt.mustUseProp(e,a,s)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var u=Mt(s),l=Bt(s);u in i||l in i||(i[s]=n[s],o&&((t.on||(t.on={}))["update:".concat(s)]=function(t){n[s]=t}))};for(var a in n)s(a)}else"production"!==process.env.NODE_ENV&&Xr("v-bind without argument expects an Object or Array value",this);return t}function wn(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||Cn(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),"__static__".concat(t),!1),r}function En(t,e,n){return Cn(t,"__once__".concat(e).concat(n?"_".concat(n):""),!0),t}function Cn(t,e,n){if(ct(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&kn(t[r],"".concat(e,"_").concat(r),n);else kn(t,e,n)}function kn(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function An(t,e){if(e)if(bt(e)){var n=t.on=t.on?Pt({},t.on):{};for(var r in e){var o=n[r],i=e[r];n[r]=o?[].concat(o,i):i}}else"production"!==process.env.NODE_ENV&&Xr("v-on without argument expects an Object value",this);return t}function xn(t,e,n,r){e=e||{$stable:!n};for(var o=0;o<t.length;o++){var i=t[o];ct(i)?xn(i,e,n):i&&(i.proxy&&(i.fn.proxy=!0),e[i.key]=i.fn)}return r&&(e.$key=r),e}function On(t,e){for(var n=0;n<e.length;n+=2){var r=e[n];"string"==typeof r&&r?t[e[n]]=e[n+1]:"production"!==process.env.NODE_ENV&&""!==r&&null!==r&&Xr("Invalid value for dynamic directive argument (expected string or null): ".concat(r),this)}return t}function Sn(t,e){return"string"==typeof t?e+t:t}function Nn(t){t._o=En,t._n=Ct,t._s=Et,t._l=gn,t._t=vn,t._q=Wt,t._i=Ut,t._m=wn,t._f=yn,t._k=_n,t._b=Dn,t._v=we,t._e=De,t._u=xn,t._g=An,t._d=On,t._p=Sn}function Tn(t,e){if(!t||!t.length)return{};for(var n={},r=0,o=t.length;r<o;r++){var i=t[r],s=i.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,i.context!==e&&i.fnContext!==e||!s||null==s.slot)(n.default||(n.default=[])).push(i);else{var a=s.slot,u=n[a]||(n[a]=[]);"template"===i.tag?u.push.apply(u,i.children||[]):u.push(i)}}for(var l in n)n[l].every(Fn)&&delete n[l];return n}function Fn(t){return t.isComment&&!t.asyncFactory||" "===t.text}function Mn(t){return t.isComment&&t.asyncFactory}function In(t,e,n,r){var o,i=Object.keys(n).length>0,s=e?!!e.$stable:!i,a=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&r&&r!==lt&&a===r.$key&&!i&&!r.$hasNormal)return r;for(var u in o={},e)e[u]&&"$"!==u[0]&&(o[u]=$n(t,n,u,e[u]))}else o={};for(var l in n)l in o||(o[l]=Bn(n,l));return e&&Object.isExtensible(e)&&(e._normalized=o),Zt(o,"$stable",s),Zt(o,"$key",a),Zt(o,"$hasNormal",i),o}function $n(t,e,n,r){var o=function(){var e=ye;be(t);var n=arguments.length?r.apply(null,arguments):r({}),o=(n=n&&"object"==typeof n&&!ct(n)?[n]:hn(n))&&n[0];return be(e),n&&(!o||1===n.length&&o.isComment&&!Mn(o))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:o,enumerable:!0,configurable:!0}),o}function Bn(t,e){return function(){return t[e]}}function Rn(t){var e=t.$options,n=e.setup;if(n){var r=t._setupContext=function(t){var e=!1;return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};Zt(e,"_v_attr_proxy",!0),Ln(e,t.$attrs,lt,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||Ln(t._listenersProxy={},t.$listeners,lt,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||jn(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:Rt(t.$emit,t),expose:function(n){"production"!==process.env.NODE_ENV&&(e&&Xr("expose() should be called only once per setup().",t),e=!0),n&&Object.keys(n).forEach((function(e){return Xe(t,n,e)}))}}}(t);be(t),Oe();var o=Kn(n,null,[t._props||Ve({}),r],t,"setup");if(Se(),be(),mt(o))e.render=o;else if(gt(o))if("production"!==process.env.NODE_ENV&&o instanceof _e&&Xr("setup() should not return VNodes directly - return a render function instead."),t._setupState=o,o.__sfc){var i=t._setupProxy={};for(var s in o)"__sfc"!==s&&Xe(i,o,s)}else for(var s in o)Qt(s)?"production"!==process.env.NODE_ENV&&Xr("Avoid using variables that start with _ or $ in setup()."):Xe(t,o,s);else"production"!==process.env.NODE_ENV&&void 0!==o&&Xr("setup() should return an object. Received: ".concat(null===o?"null":typeof o))}}function Ln(t,e,n,r,o){var i=!1;for(var s in e)s in t?e[s]!==n[s]&&(i=!0):(i=!0,Pn(t,s,r,o));for(var s in t)s in e||(i=!0,delete t[s]);return i}function Pn(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function jn(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var zn=null;function Hn(t,e){return(t.__esModule||ve&&"Module"===t[Symbol.toStringTag])&&(t=t.default),gt(t)?e.extend(t):t}function Vn(t){if(ct(t))for(var e=0;e<t.length;e++){var n=t[e];if(ft(n)&&(ft(n.componentOptions)||Mn(n)))return n}}function Wn(t,e,n,r,o,i){return(ct(n)||dt(n))&&(o=r,r=n,n=void 0),ht(i)&&(o=2),function(t,e,n,r,o){if(ft(n)&&ft(n.__ob__))return"production"!==process.env.NODE_ENV&&Xr("Avoid using observed data object as vnode data: ".concat(JSON.stringify(n),"\n")+"Always create fresh vnode data objects in each render!",t),De();ft(n)&&ft(n.is)&&(e=n.is);if(!e)return De();"production"!==process.env.NODE_ENV&&ft(n)&&ft(n.key)&&!dt(n.key)&&Xr("Avoid using non-primitive value as key, use string/number value instead.",t);ct(r)&&mt(r[0])&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);2===o?r=hn(r):1===o&&(r=function(t){for(var e=0;e<t.length;e++)if(ct(t[e]))return Array.prototype.concat.apply([],t);return t}(r));var i,s;if("string"==typeof e){var a=void 0;s=t.$vnode&&t.$vnode.ns||Yt.getTagNamespace(e),Yt.isReservedTag(e)?("production"!==process.env.NODE_ENV&&ft(n)&&ft(n.nativeOn)&&"component"!==n.tag&&Xr("The .native modifier for v-on is only valid on components but it was used on <".concat(e,">."),t),i=new _e(Yt.parsePlatformTagName(e),n,r,void 0,void 0,t)):i=n&&n.pre||!ft(a=co(t.$options,"components",e))?new _e(e,n,r,void 0,void 0,t):Kr(a,n,t,r,e)}else i=Kr(e,n,t,r);return ct(i)?i:ft(i)?(ft(s)&&Un(i,s),ft(n)&&function(t){gt(t.style)&&ar(t.style);gt(t.class)&&ar(t.class)}(n),i):De()}(t,e,n,r,o)}function Un(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),ft(t.children))for(var r=0,o=t.children.length;r<o;r++){var i=t.children[r];ft(i.tag)&&(pt(i.ns)||ht(n)&&"svg"!==i.tag)&&Un(i,e,n)}}function qn(t,e,n){Oe();try{if(e)for(var r=e;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,t,e,n))return}catch(t){Jn(t,r,"errorCaptured hook")}}Jn(t,e,n)}finally{Se()}}function Kn(t,e,n,r,o){var i;try{(i=n?t.apply(e,n):t.call(e))&&!i._isVue&&wt(i)&&!i._handled&&(i.catch((function(t){return qn(t,r,o+" (Promise/async)")})),i._handled=!0)}catch(t){qn(t,r,o)}return i}function Jn(t,e,n){if(Yt.errorHandler)try{return Yt.errorHandler.call(null,t,e,n)}catch(e){e!==t&&Gn(e,null,"config.errorHandler")}Gn(t,e,n)}function Gn(t,e,n){if("production"!==process.env.NODE_ENV&&Xr("Error in ".concat(n,': "').concat(t.toString(),'"'),e),!ne||"undefined"==typeof console)throw t;console.error(t)}var Yn,Xn=!1,Qn=[],Zn=!1;function tr(){Zn=!1;var t=Qn.slice(0);Qn.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!=typeof Promise&&me(Promise)){var er=Promise.resolve();Yn=function(){er.then(tr),ae&&setTimeout(zt)},Xn=!0}else if(oe||"undefined"==typeof MutationObserver||!me(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Yn="undefined"!=typeof setImmediate&&me(setImmediate)?function(){setImmediate(tr)}:function(){setTimeout(tr,0)};else{var nr=1,rr=new MutationObserver(tr),or=document.createTextNode(String(nr));rr.observe(or,{characterData:!0}),Yn=function(){nr=(nr+1)%2,or.data=String(nr)},Xn=!0}function ir(t,e){var n;if(Qn.push((function(){if(t)try{t.call(e)}catch(t){qn(t,e,"nextTick")}else n&&n(e)})),Zn||(Zn=!0,Yn()),!t&&"undefined"!=typeof Promise)return new Promise((function(t){n=t}))}var sr=new ge;function ar(t){return ur(t,sr),sr.clear(),t}function ur(t,e){var n,r,o=ct(t);if(!(!o&&!gt(t)||Object.isFrozen(t)||t instanceof _e)){if(t.__ob__){var i=t.__ob__.dep.id;if(e.has(i))return;e.add(i)}if(o)for(n=t.length;n--;)ur(t[n],e);else if(Je(t))ur(t.value,e);else for(n=(r=Object.keys(t)).length;n--;)ur(t[r[n]],e)}}var lr,cr,pr,fr=0,hr=function(){function t(t,e,n,r,o){var i,s;i=this,void 0===(s=tn&&!tn._vm?tn:t?t._scope:void 0)&&(s=tn),s&&s.active&&s.effects.push(i),(this.vm=t)&&o&&(t._watcher=this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before,"production"!==process.env.NODE_ENV&&(this.onTrack=r.onTrack,this.onTrigger=r.onTrigger)):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++fr,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ge,this.newDepIds=new ge,this.expression="production"!==process.env.NODE_ENV?e.toString():"",mt(e)?this.getter=e:(this.getter=function(t){if(!te.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}(e),this.getter||(this.getter=zt,"production"!==process.env.NODE_ENV&&Xr('Failed watching path: "'.concat(e,'" ')+"Watcher only accepts simple dot-delimited paths. For full control, use a function instead.",t))),this.value=this.lazy?void 0:this.get()}return t.prototype.get=function(){var t;Oe(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;qn(t,e,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&ar(t),Se(),this.cleanupDeps()}return t},t.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},t.prototype.cleanupDeps=function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},t.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Lr(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||gt(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');Kn(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&Ot(this.vm._scope.effects,this),this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}();if("production"!==process.env.NODE_ENV){var dr=ne&&window.performance;dr&&dr.mark&&dr.measure&&dr.clearMarks&&dr.clearMeasures&&(lr=function(t){return dr.mark(t)},cr=function(t,e,n){dr.measure(t,e,n),dr.clearMarks(e),dr.clearMarks(n)})}function mr(t,e){pr.$on(t,e)}function gr(t,e){pr.$off(t,e)}function vr(t,e){var n=pr;return function r(){var o=e.apply(null,arguments);null!==o&&n.$off(t,r)}}function yr(t,e,n){pr=t,cn(e,n||{},mr,gr,vr,t),pr=void 0}var br=null,_r=!1;function Dr(t){var e=br;return br=t,function(){br=e}}function wr(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function Er(t,e){if(e){if(t._directInactive=!1,wr(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)Er(t.$children[n]);kr(t,"activated")}}function Cr(t,e){if(!(e&&(t._directInactive=!0,wr(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)Cr(t.$children[n]);kr(t,"deactivated")}}function kr(t,e,n,r){void 0===r&&(r=!0),Oe();var o=ye;r&&be(t);var i=t.$options[e],s="".concat(e," hook");if(i)for(var a=0,u=i.length;a<u;a++)Kn(i[a],t,n||null,t,s);t._hasHookEvent&&t.$emit("hook:"+e),r&&be(o),Se()}var Ar=[],xr=[],Or={},Sr={},Nr=!1,Tr=!1,Fr=0;var Mr=0,Ir=Date.now;if(ne&&!oe){var $r=window.performance;$r&&"function"==typeof $r.now&&Ir()>document.createEvent("Event").timeStamp&&(Ir=function(){return $r.now()})}var Br=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Rr(){var t,e;for(Mr=Ir(),Tr=!0,Ar.sort(Br),Fr=0;Fr<Ar.length;Fr++)if((t=Ar[Fr]).before&&t.before(),e=t.id,Or[e]=null,t.run(),"production"!==process.env.NODE_ENV&&null!=Or[e]&&(Sr[e]=(Sr[e]||0)+1,Sr[e]>100)){Xr("You may have an infinite update loop "+(t.user?'in watcher with expression "'.concat(t.expression,'"'):"in a component render function."),t.vm);break}var n=xr.slice(),r=Ar.slice();Fr=Ar.length=xr.length=0,Or={},"production"!==process.env.NODE_ENV&&(Sr={}),Nr=Tr=!1,function(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,Er(t[e],!0)}(n),function(t){var e=t.length;for(;e--;){var n=t[e],r=n.vm;r&&r._watcher===n&&r._isMounted&&!r._isDestroyed&&kr(r,"updated")}}(r),de&&Yt.devtools&&de.emit("flush")}function Lr(t){var e=t.id;if(null==Or[e]&&(t!==Ae.target||!t.noRecurse)){if(Or[e]=!0,Tr){for(var n=Ar.length-1;n>Fr&&Ar[n].id>t.id;)n--;Ar.splice(n+1,0,t)}else Ar.push(t);if(!Nr){if(Nr=!0,"production"!==process.env.NODE_ENV&&!Yt.async)return void Rr();ir(Rr)}}}function Pr(t){var e=t.$options.provide;if(e){var n=mt(e)?e.call(t):e;if(!gt(n))return;for(var r=function(t){var e=t._provided,n=t.$parent&&t.$parent._provided;return n===e?t._provided=Object.create(n):e}(t),o=ve?Reflect.ownKeys(n):Object.keys(n),i=0;i<o.length;i++){var s=o[i];Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(n,s))}}}function jr(t,e){if(t){for(var n=Object.create(null),r=ve?Reflect.ownKeys(t):Object.keys(t),o=0;o<r.length;o++){var i=r[o];if("__ob__"!==i){var s=t[i].from;if(s in e._provided)n[i]=e._provided[s];else if("default"in t[i]){var a=t[i].default;n[i]=mt(a)?a.call(e):a}else"production"!==process.env.NODE_ENV&&Xr('Injection "'.concat(i,'" not found'),e)}}return n}}function zr(t,e,n,r,o){var i,s=this,a=o.options;Nt(r,"_uid")?(i=Object.create(r))._original=r:(i=r,r=r._original);var u=ht(a._compiled),l=!u;this.data=t,this.props=e,this.children=n,this.parent=r,this.listeners=t.on||lt,this.injections=jr(a.inject,r),this.slots=function(){return s.$slots||In(r,t.scopedSlots,s.$slots=Tn(n,r)),s.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return In(r,t.scopedSlots,this.slots())}}),u&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=In(r,t.scopedSlots,this.$slots)),a._scopeId?this._c=function(t,e,n,o){var s=Wn(i,t,e,n,o,l);return s&&!ct(s)&&(s.fnScopeId=a._scopeId,s.fnContext=r),s}:this._c=function(t,e,n,r){return Wn(i,t,e,n,r,l)}}function Hr(t,e,n,r,o){var i=Ee(t);return i.fnContext=n,i.fnOptions=r,"production"!==process.env.NODE_ENV&&((i.devtoolsMeta=i.devtoolsMeta||{}).renderContext=o),e.slot&&((i.data||(i.data={})).slot=e.slot),i}function Vr(t,e){for(var n in e)t[Mt(n)]=e[n]}function Wr(t){return t.name||t.__name||t._componentTag}Nn(zr.prototype);var Ur={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;Ur.prepatch(n,n)}else{(t.componentInstance=function(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;ft(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,br)).$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var n=e.componentOptions;!function(t,e,n,r,o){"production"!==process.env.NODE_ENV&&(_r=!0);var i=r.data.scopedSlots,s=t.$scopedSlots,a=!!(i&&!i.$stable||s!==lt&&!s.$stable||i&&t.$scopedSlots.$key!==i.$key||!i&&t.$scopedSlots.$key),u=!!(o||t.$options._renderChildren||a),l=t.$vnode;t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=o;var c=r.data.attrs||lt;t._attrsProxy&&Ln(t._attrsProxy,c,l.data&&l.data.attrs||lt,t,"$attrs")&&(u=!0),t.$attrs=c,n=n||lt;var p=t.$options._parentListeners;if(t._listenersProxy&&Ln(t._listenersProxy,n,p||lt,t,"$listeners"),t.$listeners=t.$options._parentListeners=n,yr(t,n,p),e&&t.$options.props){$e(!1);for(var f=t._props,h=t.$options._propKeys||[],d=0;d<h.length;d++){var m=h[d],g=t.$options.props;f[m]=po(m,g,e,t)}$e(!0),t.$options.propsData=e}u&&(t.$slots=Tn(o,r.context),t.$forceUpdate()),"production"!==process.env.NODE_ENV&&(_r=!1)}(e.componentInstance=t.componentInstance,n.propsData,n.listeners,e,n.children)},insert:function(t){var e,n=t.context,r=t.componentInstance;r._isMounted||(r._isMounted=!0,kr(r,"mounted")),t.data.keepAlive&&(n._isMounted?((e=r)._inactive=!1,xr.push(e)):Er(r,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?Cr(e,!0):e.$destroy())}},qr=Object.keys(Ur);function Kr(t,e,n,r,o){if(!pt(t)){var i=n.$options._base;if(gt(t)&&(t=i.extend(t)),"function"==typeof t){var s;if(pt(t.cid)&&(t=function(t,e){if(ht(t.error)&&ft(t.errorComp))return t.errorComp;if(ft(t.resolved))return t.resolved;var n=zn;if(n&&ft(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n),ht(t.loading)&&ft(t.loadingComp))return t.loadingComp;if(n&&!ft(t.owners)){var r=t.owners=[n],o=!0,i=null,s=null;n.$on("hook:destroyed",(function(){return Ot(r,n)}));var a=function(t){for(var e=0,n=r.length;e<n;e++)r[e].$forceUpdate();t&&(r.length=0,null!==i&&(clearTimeout(i),i=null),null!==s&&(clearTimeout(s),s=null))},u=qt((function(n){t.resolved=Hn(n,e),o?r.length=0:a(!0)})),l=qt((function(e){"production"!==process.env.NODE_ENV&&Xr("Failed to resolve async component: ".concat(String(t))+(e?"\nReason: ".concat(e):"")),ft(t.errorComp)&&(t.error=!0,a(!0))})),c=t(u,l);return gt(c)&&(wt(c)?pt(t.resolved)&&c.then(u,l):wt(c.component)&&(c.component.then(u,l),ft(c.error)&&(t.errorComp=Hn(c.error,e)),ft(c.loading)&&(t.loadingComp=Hn(c.loading,e),0===c.delay?t.loading=!0:i=setTimeout((function(){i=null,pt(t.resolved)&&pt(t.error)&&(t.loading=!0,a(!1))}),c.delay||200)),ft(c.timeout)&&(s=setTimeout((function(){s=null,pt(t.resolved)&&l("production"!==process.env.NODE_ENV?"timeout (".concat(c.timeout,"ms)"):null)}),c.timeout)))),o=!1,t.loading?t.loadingComp:t.resolved}}(s=t,i),void 0===t))return function(t,e,n,r,o){var i=De();return i.asyncFactory=t,i.asyncMeta={data:e,context:n,children:r,tag:o},i}(s,e,n,r,o);e=e||{},Po(t),ft(e.model)&&function(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[n]=e.model.value;var o=e.on||(e.on={}),i=o[r],s=e.model.callback;ft(i)?(ct(i)?-1===i.indexOf(s):i!==s)&&(o[r]=[s].concat(i)):o[r]=s}(t.options,e);var a=function(t,e,n){var r=e.options.props;if(!pt(r)){var o={},i=t.attrs,s=t.props;if(ft(i)||ft(s))for(var a in r){var u=Bt(a);if("production"!==process.env.NODE_ENV){var l=a.toLowerCase();a!==l&&i&&Nt(i,l)&&Qr('Prop "'.concat(l,'" is passed to component ')+"".concat(Yr(n||e),", but the declared prop name is")+' "'.concat(a,'". ')+"Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM "+'templates. You should probably use "'.concat(u,'" instead of "').concat(a,'".'))}fn(o,s,a,u,!0)||fn(o,i,a,u,!1)}return o}}(e,t,o);if(ht(t.options.functional))return function(t,e,n,r,o){var i=t.options,s={},a=i.props;if(ft(a))for(var u in a)s[u]=po(u,a,e||lt);else ft(n.attrs)&&Vr(s,n.attrs),ft(n.props)&&Vr(s,n.props);var l=new zr(n,s,o,r,t),c=i.render.call(null,l._c,l);if(c instanceof _e)return Hr(c,n,l.parent,i,l);if(ct(c)){for(var p=hn(c)||[],f=new Array(p.length),h=0;h<p.length;h++)f[h]=Hr(p[h],n,l.parent,i,l);return f}}(t,a,e,n,r);var u=e.on;if(e.on=e.nativeOn,ht(t.options.abstract)){var l=e.slot;e={},l&&(e.slot=l)}!function(t){for(var e=t.hook||(t.hook={}),n=0;n<qr.length;n++){var r=qr[n],o=e[r],i=Ur[r];o===i||o&&o._merged||(e[r]=o?Jr(i,o):i)}}(e);var c=Wr(t.options)||o;return new _e("vue-component-".concat(t.cid).concat(c?"-".concat(c):""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:a,listeners:u,tag:o,children:r},s)}"production"!==process.env.NODE_ENV&&Xr("Invalid Component definition: ".concat(String(t)),n)}}function Jr(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}var Gr,Yr,Xr=zt,Qr=zt;if("production"!==process.env.NODE_ENV){var Zr="undefined"!=typeof console,to=/(?:^|[-_])(\w)/g;Xr=function(t,e){void 0===e&&(e=ye);var n=e?Gr(e):"";Yt.warnHandler?Yt.warnHandler.call(null,t,e,n):Zr&&!Yt.silent&&console.error("[Vue warn]: ".concat(t).concat(n))},Qr=function(t,e){Zr&&!Yt.silent&&console.warn("[Vue tip]: ".concat(t)+(e?Gr(e):""))},Yr=function(t,e){if(t.$root===t)return"<Root>";var n=mt(t)&&null!=t.cid?t.options:t._isVue?t.$options||t.constructor.options:t,r=Wr(n),o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<".concat(r.replace(to,(function(t){return t.toUpperCase()})).replace(/[-_]/g,""),">"):"<Anonymous>")+(o&&!1!==e?" at ".concat(o):"")};Gr=function(t){if(t._isVue&&t.$parent){for(var e=[],n=0;t;){if(e.length>0){var r=e[e.length-1];if(r.constructor===t.constructor){n++,t=t.$parent;continue}n>0&&(e[e.length-1]=[r,n],n=0)}e.push(t),t=t.$parent}return"\n\nfound in\n\n"+e.map((function(t,e){return"".concat(0===e?"---\x3e ":function(t,e){for(var n="";e;)e%2==1&&(n+=t),e>1&&(t+=t),e>>=1;return n}(" ",5+2*e)).concat(ct(t)?"".concat(Yr(t[0]),"... (").concat(t[1]," recursive calls)"):Yr(t))})).join("\n")}return"\n\n(found in ".concat(Yr(t),")")}}var eo=Yt.optionMergeStrategies;function no(t,e){if(!e)return t;for(var n,r,o,i=ve?Reflect.ownKeys(e):Object.keys(e),s=0;s<i.length;s++)"__ob__"!==(n=i[s])&&(r=t[n],o=e[n],Nt(t,n)?r!==o&&bt(r)&&bt(o)&&no(r,o):je(t,n,o));return t}function ro(t,e,n){return n?function(){var r=mt(e)?e.call(n,n):e,o=mt(t)?t.call(n,n):t;return r?no(r,o):o}:e?t?function(){return no(mt(e)?e.call(this,this):e,mt(t)?t.call(this,this):t)}:e:t}function oo(t,e){var n=e?t?t.concat(e):ct(e)?e:[e]:t;return n?function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(n):n}function io(t,e,n,r){var o=Object.create(t||null);return e?("production"!==process.env.NODE_ENV&&uo(r,e,n),Pt(o,e)):o}"production"!==process.env.NODE_ENV&&(eo.el=eo.propsData=function(t,e,n,r){return n||Xr('option "'.concat(r,'" can only be used during instance ')+"creation with the `new` keyword."),so(t,e)}),eo.data=function(t,e,n){return n?ro(t,e,n):e&&"function"!=typeof e?("production"!==process.env.NODE_ENV&&Xr('The "data" option should be a function that returns a per-instance value in component definitions.',n),t):ro(t,e)},Gt.forEach((function(t){eo[t]=oo})),Jt.forEach((function(t){eo[t+"s"]=io})),eo.watch=function(t,e,n,r){if(t===ce&&(t=void 0),e===ce&&(e=void 0),!e)return Object.create(t||null);if("production"!==process.env.NODE_ENV&&uo(r,e,n),!t)return e;var o={};for(var i in Pt(o,t),e){var s=o[i],a=e[i];s&&!ct(s)&&(s=[s]),o[i]=s?s.concat(a):ct(a)?a:[a]}return o},eo.props=eo.methods=eo.inject=eo.computed=function(t,e,n,r){if(e&&"production"!==process.env.NODE_ENV&&uo(r,e,n),!t)return e;var o=Object.create(null);return Pt(o,t),e&&Pt(o,e),o},eo.provide=ro;var so=function(t,e){return void 0===e?t:e};function ao(t){new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(Xt.source,"]*$")).test(t)||Xr('Invalid component name: "'+t+'". Component names should conform to valid custom element name in html5 specification.'),(At(t)||Yt.isReservedTag(t))&&Xr("Do not use built-in or reserved HTML elements as component id: "+t)}function uo(t,e,n){bt(e)||Xr('Invalid value for option "'.concat(t,'": expected an Object, ')+"but got ".concat(yt(e),"."),n)}function lo(t,e,n){if("production"!==process.env.NODE_ENV&&function(t){for(var e in t.components)ao(e)}(e),mt(e)&&(e=e.options),function(t,e){var n=t.props;if(n){var r,o,i={};if(ct(n))for(r=n.length;r--;)"string"==typeof(o=n[r])?i[Mt(o)]={type:null}:"production"!==process.env.NODE_ENV&&Xr("props must be strings when using array syntax.");else if(bt(n))for(var s in n)o=n[s],i[Mt(s)]=bt(o)?o:{type:o};else"production"!==process.env.NODE_ENV&&Xr('Invalid value for option "props": expected an Array or an Object, '+"but got ".concat(yt(n),"."),e);t.props=i}}(e,n),function(t,e){var n=t.inject;if(n){var r=t.inject={};if(ct(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(bt(n))for(var i in n){var s=n[i];r[i]=bt(s)?Pt({from:i},s):{from:s}}else"production"!==process.env.NODE_ENV&&Xr('Invalid value for option "inject": expected an Array or an Object, '+"but got ".concat(yt(n),"."),e)}}(e,n),function(t){var e=t.directives;if(e)for(var n in e){var r=e[n];mt(r)&&(e[n]={bind:r,update:r})}}(e),!e._base&&(e.extends&&(t=lo(t,e.extends,n)),e.mixins))for(var r=0,o=e.mixins.length;r<o;r++)t=lo(t,e.mixins[r],n);var i,s={};for(i in t)a(i);for(i in e)Nt(t,i)||a(i);function a(r){var o=eo[r]||so;s[r]=o(t[r],e[r],n,r)}return s}function co(t,e,n,r){if("string"==typeof n){var o=t[e];if(Nt(o,n))return o[n];var i=Mt(n);if(Nt(o,i))return o[i];var s=It(i);if(Nt(o,s))return o[s];var a=o[n]||o[i]||o[s];return"production"!==process.env.NODE_ENV&&r&&!a&&Xr("Failed to resolve "+e.slice(0,-1)+": "+n),a}}function po(t,e,n,r){var o=e[t],i=!Nt(n,t),s=n[t],a=yo(Boolean,o.type);if(a>-1)if(i&&!Nt(o,"default"))s=!1;else if(""===s||s===Bt(t)){var u=yo(String,o.type);(u<0||a<u)&&(s=!0)}if(void 0===s){s=function(t,e,n){if(!Nt(e,"default"))return;var r=e.default;"production"!==process.env.NODE_ENV&&gt(r)&&Xr('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',t);if(t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n])return t._props[n];return mt(r)&&"Function"!==go(e.type)?r.call(t):r}(r,o,t);var l=Ie;$e(!0),Le(s),$e(l)}return"production"!==process.env.NODE_ENV&&function(t,e,n,r,o){if(t.required&&o)return void Xr('Missing required prop: "'+e+'"',r);if(null==n&&!t.required)return;var i=t.type,s=!i||!0===i,a=[];if(i){ct(i)||(i=[i]);for(var u=0;u<i.length&&!s;u++){var l=ho(n,i[u],r);a.push(l.expectedType||""),s=l.valid}}var c=a.some((function(t){return t}));if(!s&&c)return void Xr(function(t,e,n){var r='Invalid prop: type check failed for prop "'.concat(t,'".')+" Expected ".concat(n.map(It).join(", ")),o=n[0],i=yt(e);1===n.length&&wo(o)&&wo(typeof e)&&!function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.some((function(t){return"boolean"===t.toLowerCase()}))}(o,i)&&(r+=" with value ".concat(bo(e,o)));r+=", got ".concat(i," "),wo(i)&&(r+="with value ".concat(bo(e,i),"."));return r}(e,n,a),r);var p=t.validator;p&&(p(n)||Xr('Invalid prop: custom validator check failed for prop "'+e+'".',r))}(o,t,s,r,i),s}var fo=/^(String|Number|Boolean|Function|Symbol|BigInt)$/;function ho(t,e,n){var r,o=go(e);if(fo.test(o)){var i=typeof t;(r=i===o.toLowerCase())||"object"!==i||(r=t instanceof e)}else if("Object"===o)r=bt(t);else if("Array"===o)r=ct(t);else try{r=t instanceof e}catch(t){Xr('Invalid prop type: "'+String(e)+'" is not a constructor',n),r=!1}return{valid:r,expectedType:o}}var mo=/^\s*function (\w+)/;function go(t){var e=t&&t.toString().match(mo);return e?e[1]:""}function vo(t,e){return go(t)===go(e)}function yo(t,e){if(!ct(e))return vo(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(vo(e[n],t))return n;return-1}function bo(t,e){return"String"===e?'"'.concat(t,'"'):"".concat("Number"===e?Number(t):t)}var _o,Do=["string","number","boolean"];function wo(t){return Do.some((function(e){return t.toLowerCase()===e}))}if("production"!==process.env.NODE_ENV){var Eo=kt("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,require"),Co=function(t,e){Xr('Property or method "'.concat(e,'" is not defined on the instance but ')+"referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.",t)},ko=function(t,e){Xr('Property "'.concat(e,'" must be accessed with "$data.').concat(e,'" because ')+'properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internals. See: https://v2.vuejs.org/v2/api/#data',t)},Ao="undefined"!=typeof Proxy&&me(Proxy);if(Ao){var xo=kt("stop,prevent,self,ctrl,shift,alt,meta,exact");Yt.keyCodes=new Proxy(Yt.keyCodes,{set:function(t,e,n){return xo(e)?(Xr("Avoid overwriting built-in modifier in config.keyCodes: .".concat(e)),!1):(t[e]=n,!0)}})}var Oo={has:function(t,e){var n=e in t,r=Eo(e)||"string"==typeof e&&"_"===e.charAt(0)&&!(e in t.$data);return n||r||(e in t.$data?ko(t,e):Co(t,e)),n||!r}},So={get:function(t,e){return"string"!=typeof e||e in t||(e in t.$data?ko(t,e):Co(t,e)),t[e]}};_o=function(t){if(Ao){var e=t.$options,n=e.render&&e.render._withStripped?So:Oo;t._renderProxy=new Proxy(t,n)}else t._renderProxy=t}}var No={enumerable:!0,configurable:!0,get:zt,set:zt};function To(t,e,n){No.get=function(){return this[e][n]},No.set=function(t){this[e][n]=t},Object.defineProperty(t,n,No)}function Fo(t){var e=t.$options;if(e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=Ve({}),o=t.$options._propKeys=[],i=!t.$parent;i||$e(!1);var s=function(s){o.push(s);var a=po(s,e,n,t);if("production"!==process.env.NODE_ENV){var u=Bt(s);(xt(u)||Yt.isReservedAttr(u))&&Xr('"'.concat(u,'" is a reserved attribute and cannot be used as component prop.'),t),Pe(r,s,a,(function(){i||_r||Xr("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's "+'value. Prop being mutated: "'.concat(s,'"'),t)}))}else Pe(r,s,a);s in t||To(t,"_props",s)};for(var a in e)s(a);$e(!0)}(t,e.props),Rn(t),e.methods&&function(t,e){var n=t.$options.props;for(var r in e)"production"!==process.env.NODE_ENV&&("function"!=typeof e[r]&&Xr('Method "'.concat(r,'" has type "').concat(typeof e[r],'" in the component definition. ')+"Did you reference the function correctly?",t),n&&Nt(n,r)&&Xr('Method "'.concat(r,'" has already been defined as a prop.'),t),r in t&&Qt(r)&&Xr('Method "'.concat(r,'" conflicts with an existing Vue instance method. ')+"Avoid defining component methods that start with _ or $.")),t[r]="function"!=typeof e[r]?zt:Rt(e[r],t)}(t,e.methods),e.data)!function(t){var e=t.$options.data;bt(e=t._data=mt(e)?function(t,e){Oe();try{return t.call(e,e)}catch(t){return qn(t,e,"data()"),{}}finally{Se()}}(e,t):e||{})||(e={},"production"!==process.env.NODE_ENV&&Xr("data functions should return an object:\nhttps://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",t));var n=Object.keys(e),r=t.$options.props,o=t.$options.methods,i=n.length;for(;i--;){var s=n[i];"production"!==process.env.NODE_ENV&&o&&Nt(o,s)&&Xr('Method "'.concat(s,'" has already been defined as a data property.'),t),r&&Nt(r,s)?"production"!==process.env.NODE_ENV&&Xr('The data property "'.concat(s,'" is already declared as a prop. ')+"Use prop default value instead.",t):Qt(s)||To(t,"_data",s)}var a=Le(e);a&&a.vmCount++}(t);else{var n=Le(t._data={});n&&n.vmCount++}e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=he();for(var o in e){var i=e[o],s=mt(i)?i:i.get;"production"!==process.env.NODE_ENV&&null==s&&Xr('Getter is missing for computed property "'.concat(o,'".'),t),r||(n[o]=new hr(t,s||zt,zt,Mo)),o in t?"production"!==process.env.NODE_ENV&&(o in t.$data?Xr('The computed property "'.concat(o,'" is already defined in data.'),t):t.$options.props&&o in t.$options.props?Xr('The computed property "'.concat(o,'" is already defined as a prop.'),t):t.$options.methods&&o in t.$options.methods&&Xr('The computed property "'.concat(o,'" is already defined as a method.'),t)):Io(t,o,i)}}(t,e.computed),e.watch&&e.watch!==ce&&function(t,e){for(var n in e){var r=e[n];if(ct(r))for(var o=0;o<r.length;o++)Ro(t,n,r[o]);else Ro(t,n,r)}}(t,e.watch)}var Mo={lazy:!0};function Io(t,e,n){var r=!he();mt(n)?(No.get=r?$o(e):Bo(n),No.set=zt):(No.get=n.get?r&&!1!==n.cache?$o(e):Bo(n.get):zt,No.set=n.set||zt),"production"!==process.env.NODE_ENV&&No.set===zt&&(No.set=function(){Xr('Computed property "'.concat(e,'" was assigned to but it has no setter.'),this)}),Object.defineProperty(t,e,No)}function $o(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Ae.target&&("production"!==process.env.NODE_ENV&&Ae.target.onTrack&&Ae.target.onTrack({effect:Ae.target,target:this,type:"get",key:t}),e.depend()),e.value}}function Bo(t){return function(){return t.call(this,this)}}function Ro(t,e,n,r){return bt(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var Lo=0;function Po(t){var e=t.options;if(t.super){var n=Po(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var o in n)n[o]!==r[o]&&(e||(e={}),e[o]=n[o]);return e}(t);r&&Pt(t.extendOptions,r),(e=t.options=lo(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function jo(t){"production"===process.env.NODE_ENV||this instanceof jo||Xr("Vue is a constructor and should be called with the `new` keyword"),this._init(t)}function zo(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var i=Wr(t)||Wr(n.options);"production"!==process.env.NODE_ENV&&i&&ao(i);var s=function(t){this._init(t)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=e++,s.options=lo(n.options,t),s.super=n,s.options.props&&function(t){var e=t.options.props;for(var n in e)To(t.prototype,"_props",n)}(s),s.options.computed&&function(t){var e=t.options.computed;for(var n in e)Io(t.prototype,n,e[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,Jt.forEach((function(t){s[t]=n[t]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=Pt({},s.options),o[r]=s,s}}function Ho(t){return t&&(Wr(t.Ctor.options)||t.tag)}function Vo(t,e){return ct(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!_t(t)&&t.test(e)}function Wo(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var s=n[i];if(s){var a=s.name;a&&!e(a)&&Uo(n,i,r,o)}}}function Uo(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,Ot(n,e)}!function(t){t.prototype._init=function(t){var e,n,r=this;r._uid=Lo++,"production"!==process.env.NODE_ENV&&Yt.performance&&lr&&(e="vue-perf-start:".concat(r._uid),n="vue-perf-end:".concat(r._uid),lr(e)),r._isVue=!0,r.__v_skip=!0,r._scope=new an(!0),r._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(r,t):r.$options=lo(Po(r.constructor),t||{},r),"production"!==process.env.NODE_ENV?_o(r):r._renderProxy=r,r._self=r,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(r),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&yr(t,e)}(r),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,r=n&&n.context;t.$slots=Tn(e._renderChildren,r),t.$scopedSlots=n?In(t.$parent,n.data.scopedSlots,t.$slots):lt,t._c=function(e,n,r,o){return Wn(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return Wn(t,e,n,r,o,!0)};var o=n&&n.data;"production"!==process.env.NODE_ENV?(Pe(t,"$attrs",o&&o.attrs||lt,(function(){!_r&&Xr("$attrs is readonly.",t)}),!0),Pe(t,"$listeners",e._parentListeners||lt,(function(){!_r&&Xr("$listeners is readonly.",t)}),!0)):(Pe(t,"$attrs",o&&o.attrs||lt,null,!0),Pe(t,"$listeners",e._parentListeners||lt,null,!0))}(r),kr(r,"beforeCreate",void 0,!1),function(t){var e=jr(t.$options.inject,t);e&&($e(!1),Object.keys(e).forEach((function(n){"production"!==process.env.NODE_ENV?Pe(t,n,e[n],(function(){Xr("Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. "+'injection being mutated: "'.concat(n,'"'),t)})):Pe(t,n,e[n])})),$e(!0))}(r),Fo(r),Pr(r),kr(r,"created"),"production"!==process.env.NODE_ENV&&Yt.performance&&lr&&(r._name=Yr(r,!1),lr(n),cr("vue ".concat(r._name," init"),e,n)),r.$options.el&&r.$mount(r.$options.el)}}(jo),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};"production"!==process.env.NODE_ENV&&(e.set=function(){Xr("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){Xr("$props is readonly.",this)}),Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=je,t.prototype.$delete=ze,t.prototype.$watch=function(t,e,n){var r=this;if(bt(e))return Ro(r,t,e,n);(n=n||{}).user=!0;var o=new hr(r,t,e,n);if(n.immediate){var i='callback for immediate watcher "'.concat(o.expression,'"');Oe(),Kn(e,r,[o.value],r,i),Se()}return function(){o.teardown()}}}(jo),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(ct(t))for(var o=0,i=t.length;o<i;o++)r.$on(t[o],n);else(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){var n=this;function r(){n.$off(t,r),e.apply(n,arguments)}return r.fn=e,n.$on(t,r),n},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(ct(t)){for(var r=0,o=t.length;r<o;r++)n.$off(t[r],e);return n}var i,s=n._events[t];if(!s)return n;if(!e)return n._events[t]=null,n;for(var a=s.length;a--;)if((i=s[a])===e||i.fn===e){s.splice(a,1);break}return n},t.prototype.$emit=function(t){var e=this;if("production"!==process.env.NODE_ENV){var n=t.toLowerCase();n!==t&&e._events[n]&&Qr('Event "'.concat(n,'" is emitted in component ')+"".concat(Yr(e),' but the handler is registered for "').concat(t,'". ')+"Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. "+'You should probably use "'.concat(Bt(t),'" instead of "').concat(t,'".'))}var r=e._events[t];if(r){r=r.length>1?Lt(r):r;for(var o=Lt(arguments,1),i='event handler for "'.concat(t,'"'),s=0,a=r.length;s<a;s++)Kn(r[s],e,o,e,i)}return e}}(jo),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,o=n._vnode,i=Dr(n);n._vnode=t,n.$el=o?n.__patch__(o,t):n.__patch__(n.$el,t,e,!1),i(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n);for(var s=n;s&&s.$vnode&&s.$parent&&s.$vnode===s.$parent._vnode;)s.$parent.$el=s.$el,s=s.$parent},t.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){kr(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||Ot(e.$children,t),t._scope.stop(),t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),kr(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(jo),function(t){Nn(t.prototype),t.prototype.$nextTick=function(t){return ir(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,r=n.render,o=n._parentVnode;o&&e._isMounted&&(e.$scopedSlots=In(e.$parent,o.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&jn(e._slotsProxy,e.$scopedSlots)),e.$vnode=o;try{be(e),zn=e,t=r.call(e._renderProxy,e.$createElement)}catch(n){if(qn(n,e,"render"),"production"!==process.env.NODE_ENV&&e.$options.renderError)try{t=e.$options.renderError.call(e._renderProxy,e.$createElement,n)}catch(n){qn(n,e,"renderError"),t=e._vnode}else t=e._vnode}finally{zn=null,be()}return ct(t)&&1===t.length&&(t=t[0]),t instanceof _e||("production"!==process.env.NODE_ENV&&ct(t)&&Xr("Multiple root nodes returned from render function. Render function should return a single root node.",e),t=De()),t.parent=o,t}}(jo);var qo=[String,RegExp,Array],Ko={name:"keep-alive",abstract:!0,props:{include:qo,exclude:qo,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,n=t.keys,r=t.vnodeToCache,o=t.keyToCache;if(r){var i=r.tag,s=r.componentInstance,a=r.componentOptions;e[o]={name:Ho(a),tag:i,componentInstance:s},n.push(o),this.max&&n.length>parseInt(this.max)&&Uo(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Uo(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Wo(t,(function(t){return Vo(e,t)}))})),this.$watch("exclude",(function(e){Wo(t,(function(t){return!Vo(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Vn(t),n=e&&e.componentOptions;if(n){var r=Ho(n),o=this.include,i=this.exclude;if(o&&(!r||!Vo(o,r))||i&&r&&Vo(i,r))return e;var s=this.cache,a=this.keys,u=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;s[u]?(e.componentInstance=s[u].componentInstance,Ot(a,u),a.push(u)):(this.vnodeToCache=e,this.keyToCache=u),e.data.keepAlive=!0}return e||t&&t[0]}},Jo={KeepAlive:Ko};!function(t){var e={get:function(){return Yt}};"production"!==process.env.NODE_ENV&&(e.set=function(){Xr("Do not replace the Vue.config object, set individual fields instead.")}),Object.defineProperty(t,"config",e),t.util={warn:Xr,extend:Pt,mergeOptions:lo,defineReactive:Pe},t.set=je,t.delete=ze,t.nextTick=ir,t.observable=function(t){return Le(t),t},t.options=Object.create(null),Jt.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,Pt(t.options.components,Jo),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=Lt(arguments,1);return n.unshift(this),mt(t.install)?t.install.apply(t,n):mt(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=lo(this.options,t),this}}(t),zo(t),function(t){Jt.forEach((function(e){t[e]=function(t,n){return n?("production"!==process.env.NODE_ENV&&"component"===e&&ao(t),"component"===e&&bt(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&mt(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(jo),Object.defineProperty(jo.prototype,"$isServer",{get:he}),Object.defineProperty(jo.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(jo,"FunctionalRenderContext",{value:zr}),jo.version="2.7.10";var Go=kt("style,class"),Yo=kt("input,textarea,option,select,progress"),Xo=kt("contenteditable,draggable,spellcheck"),Qo=kt("events,caret,typing,plaintext-only"),Zo=kt("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ti="http://www.w3.org/1999/xlink",ei=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},ni=function(t){return ei(t)?t.slice(6,t.length):""},ri=function(t){return null==t||!1===t};function oi(t){for(var e=t.data,n=t,r=t;ft(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=ii(r.data,e));for(;ft(n=n.parent);)n&&n.data&&(e=ii(e,n.data));return function(t,e){if(ft(t)||ft(e))return si(t,ai(e));return""}(e.staticClass,e.class)}function ii(t,e){return{staticClass:si(t.staticClass,e.staticClass),class:ft(t.class)?[t.class,e.class]:e.class}}function si(t,e){return t?e?t+" "+e:t:e||""}function ai(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r<o;r++)ft(e=ai(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):gt(t)?function(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}var ui={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},li=kt("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),ci=kt("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),pi=function(t){return li(t)||ci(t)};var fi=Object.create(null);var hi=kt("text,number,password,search,email,tel,url");var di=Object.freeze({__proto__:null,createElement:function(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(t,e){return document.createElementNS(ui[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){t.appendChild(e)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},setStyleScope:function(t,e){t.setAttribute(e,"")}}),mi={create:function(t,e){gi(e)},update:function(t,e){t.data.ref!==e.data.ref&&(gi(t,!0),gi(e))},destroy:function(t){gi(t,!0)}};function gi(t,e){var n=t.data.ref;if(ft(n)){var r=t.context,o=t.componentInstance||t.elm,i=e?null:o,s=e?void 0:o;if(mt(n))Kn(n,r,[i],r,"template ref function");else{var a=t.data.refInFor,u="string"==typeof n||"number"==typeof n,l=Je(n),c=r.$refs;if(u||l)if(a){var p=u?c[n]:n.value;e?ct(p)&&Ot(p,o):ct(p)?p.includes(o)||p.push(o):u?(c[n]=[o],vi(r,n,c[n])):n.value=[o]}else if(u){if(e&&c[n]!==o)return;c[n]=s,vi(r,n,i)}else if(l){if(e&&n.value!==o)return;n.value=i}else"production"!==process.env.NODE_ENV&&Xr("Invalid template ref type: ".concat(typeof n))}}}function vi(t,e,n){var r=t._setupState;r&&Nt(r,e)&&(Je(r[e])?r[e].value=n:r[e]=n)}var yi=new _e("",{},[]),bi=["create","activate","update","remove","destroy"];function _i(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&ft(t.data)===ft(e.data)&&function(t,e){if("input"!==t.tag)return!0;var n,r=ft(n=t.data)&&ft(n=n.attrs)&&n.type,o=ft(n=e.data)&&ft(n=n.attrs)&&n.type;return r===o||hi(r)&&hi(o)}(t,e)||ht(t.isAsyncPlaceholder)&&pt(e.asyncFactory.error))}function Di(t,e,n){var r,o,i={};for(r=e;r<=n;++r)ft(o=t[r].key)&&(i[o]=r);return i}var wi={create:Ei,update:Ei,destroy:function(t){Ei(t,yi)}};function Ei(t,e){(t.data.directives||e.data.directives)&&function(t,e){var n,r,o,i=t===yi,s=e===yi,a=ki(t.data.directives,t.context),u=ki(e.data.directives,e.context),l=[],c=[];for(n in u)r=a[n],o=u[n],r?(o.oldValue=r.value,o.oldArg=r.arg,xi(o,"update",e,t),o.def&&o.def.componentUpdated&&c.push(o)):(xi(o,"bind",e,t),o.def&&o.def.inserted&&l.push(o));if(l.length){var p=function(){for(var n=0;n<l.length;n++)xi(l[n],"inserted",e,t)};i?pn(e,"insert",p):p()}c.length&&pn(e,"postpatch",(function(){for(var n=0;n<c.length;n++)xi(c[n],"componentUpdated",e,t)}));if(!i)for(n in a)u[n]||xi(a[n],"unbind",t,t,s)}(t,e)}var Ci=Object.create(null);function ki(t,e){var n,r,o=Object.create(null);if(!t)return o;for(n=0;n<t.length;n++){if((r=t[n]).modifiers||(r.modifiers=Ci),o[Ai(r)]=r,e._setupState&&e._setupState.__sfc){var i=r.def||co(e,"_setupState","v-"+r.name);r.def="function"==typeof i?{bind:i,update:i}:i}r.def=r.def||co(e.$options,"directives",r.name,!0)}return o}function Ai(t){return t.rawName||"".concat(t.name,".").concat(Object.keys(t.modifiers||{}).join("."))}function xi(t,e,n,r,o){var i=t.def&&t.def[e];if(i)try{i(n.elm,t,n,r,o)}catch(r){qn(r,n.context,"directive ".concat(t.name," ").concat(e," hook"))}}var Oi=[mi,wi];function Si(t,e){var n=e.componentOptions;if(!(ft(n)&&!1===n.Ctor.options.inheritAttrs||pt(t.data.attrs)&&pt(e.data.attrs))){var r,o,i=e.elm,s=t.data.attrs||{},a=e.data.attrs||{};for(r in(ft(a.__ob__)||ht(a._v_attr_proxy))&&(a=e.data.attrs=Pt({},a)),a)o=a[r],s[r]!==o&&Ni(i,r,o,e.data.pre);for(r in(oe||se)&&a.value!==s.value&&Ni(i,"value",a.value),s)pt(a[r])&&(ei(r)?i.removeAttributeNS(ti,ni(r)):Xo(r)||i.removeAttribute(r))}}function Ni(t,e,n,r){r||t.tagName.indexOf("-")>-1?Ti(t,e,n):Zo(e)?ri(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Xo(e)?t.setAttribute(e,function(t,e){return ri(e)||"false"===e?"false":"contenteditable"===t&&Qo(e)?e:"true"}(e,n)):ei(e)?ri(n)?t.removeAttributeNS(ti,ni(e)):t.setAttributeNS(ti,e,n):Ti(t,e,n)}function Ti(t,e,n){if(ri(n))t.removeAttribute(e);else{if(oe&&!ie&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Fi={create:Si,update:Si};function Mi(t,e){var n=e.elm,r=e.data,o=t.data;if(!(pt(r.staticClass)&&pt(r.class)&&(pt(o)||pt(o.staticClass)&&pt(o.class)))){var i=oi(e),s=n._transitionClasses;ft(s)&&(i=si(i,ai(s))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}}var Ii,$i={create:Mi,update:Mi};function Bi(t,e,n){var r=Ii;return function o(){var i=e.apply(null,arguments);null!==i&&Pi(t,o,n,r)}}var Ri=Xn&&!(le&&Number(le[1])<=53);function Li(t,e,n,r){if(Ri){var o=Mr,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}Ii.addEventListener(t,e,pe?{capture:n,passive:r}:n)}function Pi(t,e,n,r){(r||Ii).removeEventListener(t,e._wrapper||e,n)}function ji(t,e){if(!pt(t.data.on)||!pt(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Ii=e.elm||t.elm,function(t){if(ft(t.__r)){var e=oe?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}ft(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),cn(n,r,Li,Pi,Bi,e.context),Ii=void 0}}var zi,Hi={create:ji,update:ji,destroy:function(t){return ji(t,yi)}};function Vi(t,e){if(!pt(t.data.domProps)||!pt(e.data.domProps)){var n,r,o=e.elm,i=t.data.domProps||{},s=e.data.domProps||{};for(n in(ft(s.__ob__)||ht(s._v_attr_proxy))&&(s=e.data.domProps=Pt({},s)),i)n in s||(o[n]="");for(n in s){if(r=s[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===i[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var a=pt(r)?"":String(r);Wi(o,a)&&(o.value=a)}else if("innerHTML"===n&&ci(o.tagName)&&pt(o.innerHTML)){(zi=zi||document.createElement("div")).innerHTML="<svg>".concat(r,"</svg>");for(var u=zi.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;u.firstChild;)o.appendChild(u.firstChild)}else if(r!==i[n])try{o[n]=r}catch(t){}}}}function Wi(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(ft(r)){if(r.number)return Ct(n)!==Ct(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Ui={create:Vi,update:Vi},qi=Tt((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Ki(t){var e=Ji(t.style);return t.staticStyle?Pt(t.staticStyle,e):e}function Ji(t){return Array.isArray(t)?jt(t):"string"==typeof t?qi(t):t}var Gi,Yi=/^--/,Xi=/\s*!important$/,Qi=function(t,e,n){if(Yi.test(e))t.style.setProperty(e,n);else if(Xi.test(n))t.style.setProperty(Bt(e),n.replace(Xi,""),"important");else{var r=ts(e);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)t.style[r]=n[o];else t.style[r]=n}},Zi=["Webkit","Moz","ms"],ts=Tt((function(t){if(Gi=Gi||document.createElement("div").style,"filter"!==(t=Mt(t))&&t in Gi)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Zi.length;n++){var r=Zi[n]+e;if(r in Gi)return r}}));function es(t,e){var n=e.data,r=t.data;if(!(pt(n.staticStyle)&&pt(n.style)&&pt(r.staticStyle)&&pt(r.style))){var o,i,s=e.elm,a=r.staticStyle,u=r.normalizedStyle||r.style||{},l=a||u,c=Ji(e.data.style)||{};e.data.normalizedStyle=ft(c.__ob__)?Pt({},c):c;var p=function(t,e){var n,r={};if(e)for(var o=t;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=Ki(o.data))&&Pt(r,n);(n=Ki(t.data))&&Pt(r,n);for(var i=t;i=i.parent;)i.data&&(n=Ki(i.data))&&Pt(r,n);return r}(e,!0);for(i in l)pt(p[i])&&Qi(s,i,"");for(i in p)(o=p[i])!==l[i]&&Qi(s,i,null==o?"":o)}}var ns={create:es,update:es},rs=/\s+/;function is(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(rs).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function ss(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(rs).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function as(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&Pt(e,us(t.name||"v")),Pt(e,t),e}return"string"==typeof t?us(t):void 0}}var us=Tt((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),ls=ne&&!ie,cs="transition",ps="transitionend",fs="animation",hs="animationend";ls&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(cs="WebkitTransition",ps="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(fs="WebkitAnimation",hs="webkitAnimationEnd"));var ds=ne?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function ms(t){ds((function(){ds(t)}))}function gs(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),is(t,e))}function vs(t,e){t._transitionClasses&&Ot(t._transitionClasses,e),ss(t,e)}function ys(t,e,n){var r=_s(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a="transition"===o?ps:hs,u=0,l=function(){t.removeEventListener(a,c),n()},c=function(e){e.target===t&&++u>=s&&l()};setTimeout((function(){u<s&&l()}),i+1),t.addEventListener(a,c)}var bs=/\b(transform|all)(,|$)/;function _s(t,e){var n,r=window.getComputedStyle(t),o=(r[cs+"Delay"]||"").split(", "),i=(r[cs+"Duration"]||"").split(", "),s=Ds(o,i),a=(r[fs+"Delay"]||"").split(", "),u=(r[fs+"Duration"]||"").split(", "),l=Ds(a,u),c=0,p=0;return"transition"===e?s>0&&(n="transition",c=s,p=i.length):"animation"===e?l>0&&(n="animation",c=l,p=u.length):p=(n=(c=Math.max(s,l))>0?s>l?"transition":"animation":null)?"transition"===n?i.length:u.length:0,{type:n,timeout:c,propCount:p,hasTransform:"transition"===n&&bs.test(r[cs+"Property"])}}function Ds(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return ws(e)+ws(t[n])})))}function ws(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function Es(t,e){var n=t.elm;ft(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=as(t.data.transition);if(!pt(r)&&!ft(n._enterCb)&&1===n.nodeType){for(var o=r.css,i=r.type,s=r.enterClass,a=r.enterToClass,u=r.enterActiveClass,l=r.appearClass,c=r.appearToClass,p=r.appearActiveClass,f=r.beforeEnter,h=r.enter,d=r.afterEnter,m=r.enterCancelled,g=r.beforeAppear,v=r.appear,y=r.afterAppear,b=r.appearCancelled,_=r.duration,D=br,w=br.$vnode;w&&w.parent;)D=w.context,w=w.parent;var E=!D._isMounted||!t.isRootInsert;if(!E||v||""===v){var C=E&&l?l:s,k=E&&p?p:u,A=E&&c?c:a,x=E&&g||f,O=E&&mt(v)?v:h,S=E&&y||d,N=E&&b||m,T=Ct(gt(_)?_.enter:_);"production"!==process.env.NODE_ENV&&null!=T&&ks(T,"enter",t);var F=!1!==o&&!ie,M=xs(O),I=n._enterCb=qt((function(){F&&(vs(n,A),vs(n,k)),I.cancelled?(F&&vs(n,C),N&&N(n)):S&&S(n),n._enterCb=null}));t.data.show||pn(t,"insert",(function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),O&&O(n,I)})),x&&x(n),F&&(gs(n,C),gs(n,k),ms((function(){vs(n,C),I.cancelled||(gs(n,A),M||(As(T)?setTimeout(I,T):ys(n,i,I)))}))),t.data.show&&(e&&e(),O&&O(n,I)),F||M||I()}}}function Cs(t,e){var n=t.elm;ft(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=as(t.data.transition);if(pt(r)||1!==n.nodeType)return e();if(!ft(n._leaveCb)){var o=r.css,i=r.type,s=r.leaveClass,a=r.leaveToClass,u=r.leaveActiveClass,l=r.beforeLeave,c=r.leave,p=r.afterLeave,f=r.leaveCancelled,h=r.delayLeave,d=r.duration,m=!1!==o&&!ie,g=xs(c),v=Ct(gt(d)?d.leave:d);"production"!==process.env.NODE_ENV&&ft(v)&&ks(v,"leave",t);var y=n._leaveCb=qt((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),m&&(vs(n,a),vs(n,u)),y.cancelled?(m&&vs(n,s),f&&f(n)):(e(),p&&p(n)),n._leaveCb=null}));h?h(b):b()}function b(){y.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),l&&l(n),m&&(gs(n,s),gs(n,u),ms((function(){vs(n,s),y.cancelled||(gs(n,a),g||(As(v)?setTimeout(y,v):ys(n,i,y)))}))),c&&c(n,y),m||g||y())}}function ks(t,e,n){"number"!=typeof t?Xr("<transition> explicit ".concat(e," duration is not a valid number - ")+"got ".concat(JSON.stringify(t),"."),n.context):isNaN(t)&&Xr("<transition> explicit ".concat(e," duration is NaN - ")+"the duration expression might be incorrect.",n.context)}function As(t){return"number"==typeof t&&!isNaN(t)}function xs(t){if(pt(t))return!1;var e=t.fns;return ft(e)?xs(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function Os(t,e){!0!==e.data.show&&Es(e)}var Ss=function(t){var e,n,r={},o=t.modules,i=t.nodeOps;for(e=0;e<bi.length;++e)for(r[bi[e]]=[],n=0;n<o.length;++n)ft(o[n][bi[e]])&&r[bi[e]].push(o[n][bi[e]]);function s(t){var e=i.parentNode(t);ft(e)&&i.removeChild(e,t)}function a(t,e){return!e&&!t.ns&&!(Yt.ignoredElements.length&&Yt.ignoredElements.some((function(e){return _t(e)?e.test(t.tag):e===t.tag})))&&Yt.isUnknownElement(t.tag)}var u=0;function l(t,e,n,o,s,l,h){if(ft(t.elm)&&ft(l)&&(t=l[h]=Ee(t)),t.isRootInsert=!s,!function(t,e,n,o){var i=t.data;if(ft(i)){var s=ft(t.componentInstance)&&i.keepAlive;if(ft(i=i.hook)&&ft(i=i.init)&&i(t,!1),ft(t.componentInstance))return c(t,e),p(n,t.elm,o),ht(s)&&function(t,e,n,o){var i,s=t;for(;s.componentInstance;)if(ft(i=(s=s.componentInstance._vnode).data)&&ft(i=i.transition)){for(i=0;i<r.activate.length;++i)r.activate[i](yi,s);e.push(s);break}p(n,t.elm,o)}(t,e,n,o),!0}}(t,e,n,o)){var g=t.data,v=t.children,y=t.tag;ft(y)?("production"!==process.env.NODE_ENV&&(g&&g.pre&&u++,a(t,u)&&Xr("Unknown custom element: <"+y+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',t.context)),t.elm=t.ns?i.createElementNS(t.ns,y):i.createElement(y,t),m(t),f(t,v,e),ft(g)&&d(t,e),p(n,t.elm,o),"production"!==process.env.NODE_ENV&&g&&g.pre&&u--):ht(t.isComment)?(t.elm=i.createComment(t.text),p(n,t.elm,o)):(t.elm=i.createTextNode(t.text),p(n,t.elm,o))}}function c(t,e){ft(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,h(t)?(d(t,e),m(t)):(gi(t),e.push(t))}function p(t,e,n){ft(t)&&(ft(n)?i.parentNode(n)===t&&i.insertBefore(t,e,n):i.appendChild(t,e))}function f(t,e,n){if(ct(e)){"production"!==process.env.NODE_ENV&&_(e);for(var r=0;r<e.length;++r)l(e[r],n,t.elm,null,!0,e,r)}else dt(t.text)&&i.appendChild(t.elm,i.createTextNode(String(t.text)))}function h(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return ft(t.tag)}function d(t,n){for(var o=0;o<r.create.length;++o)r.create[o](yi,t);ft(e=t.data.hook)&&(ft(e.create)&&e.create(yi,t),ft(e.insert)&&n.push(t))}function m(t){var e;if(ft(e=t.fnScopeId))i.setStyleScope(t.elm,e);else for(var n=t;n;)ft(e=n.context)&&ft(e=e.$options._scopeId)&&i.setStyleScope(t.elm,e),n=n.parent;ft(e=br)&&e!==t.context&&e!==t.fnContext&&ft(e=e.$options._scopeId)&&i.setStyleScope(t.elm,e)}function g(t,e,n,r,o,i){for(;r<=o;++r)l(n[r],i,t,e,!1,n,r)}function v(t){var e,n,o=t.data;if(ft(o))for(ft(e=o.hook)&&ft(e=e.destroy)&&e(t),e=0;e<r.destroy.length;++e)r.destroy[e](t);if(ft(e=t.children))for(n=0;n<t.children.length;++n)v(t.children[n])}function y(t,e,n){for(;e<=n;++e){var r=t[e];ft(r)&&(ft(r.tag)?(b(r),v(r)):s(r.elm))}}function b(t,e){if(ft(e)||ft(t.data)){var n,o=r.remove.length+1;for(ft(e)?e.listeners+=o:e=function(t,e){function n(){0==--n.listeners&&s(t)}return n.listeners=e,n}(t.elm,o),ft(n=t.componentInstance)&&ft(n=n._vnode)&&ft(n.data)&&b(n,e),n=0;n<r.remove.length;++n)r.remove[n](t,e);ft(n=t.data.hook)&&ft(n=n.remove)?n(t,e):e()}else s(t.elm)}function _(t){for(var e={},n=0;n<t.length;n++){var r=t[n],o=r.key;ft(o)&&(e[o]?Xr("Duplicate keys detected: '".concat(o,"'. This may cause an update error."),r.context):e[o]=!0)}}function D(t,e,n,r){for(var o=n;o<r;o++){var i=e[o];if(ft(i)&&_i(t,i))return o}}function w(t,e,n,o,s,a){if(t!==e){ft(e.elm)&&ft(o)&&(e=o[s]=Ee(e));var u=e.elm=t.elm;if(ht(t.isAsyncPlaceholder))ft(e.asyncFactory.resolved)?A(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(ht(e.isStatic)&&ht(t.isStatic)&&e.key===t.key&&(ht(e.isCloned)||ht(e.isOnce)))e.componentInstance=t.componentInstance;else{var c,p=e.data;ft(p)&&ft(c=p.hook)&&ft(c=c.prepatch)&&c(t,e);var f=t.children,d=e.children;if(ft(p)&&h(e)){for(c=0;c<r.update.length;++c)r.update[c](t,e);ft(c=p.hook)&&ft(c=c.update)&&c(t,e)}pt(e.text)?ft(f)&&ft(d)?f!==d&&function(t,e,n,r,o){var s,a,u,c=0,p=0,f=e.length-1,h=e[0],d=e[f],m=n.length-1,v=n[0],b=n[m],E=!o;for("production"!==process.env.NODE_ENV&&_(n);c<=f&&p<=m;)pt(h)?h=e[++c]:pt(d)?d=e[--f]:_i(h,v)?(w(h,v,r,n,p),h=e[++c],v=n[++p]):_i(d,b)?(w(d,b,r,n,m),d=e[--f],b=n[--m]):_i(h,b)?(w(h,b,r,n,m),E&&i.insertBefore(t,h.elm,i.nextSibling(d.elm)),h=e[++c],b=n[--m]):_i(d,v)?(w(d,v,r,n,p),E&&i.insertBefore(t,d.elm,h.elm),d=e[--f],v=n[++p]):(pt(s)&&(s=Di(e,c,f)),pt(a=ft(v.key)?s[v.key]:D(v,e,c,f))?l(v,r,t,h.elm,!1,n,p):_i(u=e[a],v)?(w(u,v,r,n,p),e[a]=void 0,E&&i.insertBefore(t,u.elm,h.elm)):l(v,r,t,h.elm,!1,n,p),v=n[++p]);c>f?g(t,pt(n[m+1])?null:n[m+1].elm,n,p,m,r):p>m&&y(e,c,f)}(u,f,d,n,a):ft(d)?("production"!==process.env.NODE_ENV&&_(d),ft(t.text)&&i.setTextContent(u,""),g(u,null,d,0,d.length-1,n)):ft(f)?y(f,0,f.length-1):ft(t.text)&&i.setTextContent(u,""):t.text!==e.text&&i.setTextContent(u,e.text),ft(p)&&ft(c=p.hook)&&ft(c=c.postpatch)&&c(t,e)}}}function E(t,e,n){if(ht(n)&&ft(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}var C=!1,k=kt("attrs,class,staticClass,staticStyle,key");function A(t,e,n,r){var o,i=e.tag,s=e.data,u=e.children;if(r=r||s&&s.pre,e.elm=t,ht(e.isComment)&&ft(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if("production"!==process.env.NODE_ENV&&!function(t,e,n){return ft(e.tag)?0===e.tag.indexOf("vue-component")||!a(e,n)&&e.tag.toLowerCase()===(t.tagName&&t.tagName.toLowerCase()):t.nodeType===(e.isComment?8:3)}(t,e,r))return!1;if(ft(s)&&(ft(o=s.hook)&&ft(o=o.init)&&o(e,!0),ft(o=e.componentInstance)))return c(e,n),!0;if(ft(i)){if(ft(u))if(t.hasChildNodes())if(ft(o=s)&&ft(o=o.domProps)&&ft(o=o.innerHTML)){if(o!==t.innerHTML)return"production"===process.env.NODE_ENV||"undefined"==typeof console||C||(C=!0,console.warn("Parent: ",t),console.warn("server innerHTML: ",o),console.warn("client innerHTML: ",t.innerHTML)),!1}else{for(var l=!0,p=t.firstChild,h=0;h<u.length;h++){if(!p||!A(p,u[h],n,r)){l=!1;break}p=p.nextSibling}if(!l||p)return"production"===process.env.NODE_ENV||"undefined"==typeof console||C||(C=!0,console.warn("Parent: ",t),console.warn("Mismatching childNodes vs. VNodes: ",t.childNodes,u)),!1}else f(e,u,n);if(ft(s)){var m=!1;for(var g in s)if(!k(g)){m=!0,d(e,n);break}!m&&s.class&&ar(s.class)}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,o){if(!pt(e)){var s,a=!1,u=[];if(pt(t))a=!0,l(e,u);else{var c=ft(t.nodeType);if(!c&&_i(t,e))w(t,e,u,null,null,o);else{if(c){if(1===t.nodeType&&t.hasAttribute("data-server-rendered")&&(t.removeAttribute("data-server-rendered"),n=!0),ht(n)){if(A(t,e,u))return E(e,u,!0),t;"production"!==process.env.NODE_ENV&&Xr("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}s=t,t=new _e(i.tagName(s).toLowerCase(),{},[],void 0,s)}var p=t.elm,f=i.parentNode(p);if(l(e,u,p._leaveCb?null:f,i.nextSibling(p)),ft(e.parent))for(var d=e.parent,m=h(e);d;){for(var g=0;g<r.destroy.length;++g)r.destroy[g](d);if(d.elm=e.elm,m){for(var b=0;b<r.create.length;++b)r.create[b](yi,d);var _=d.data.hook.insert;if(_.merged)for(var D=1;D<_.fns.length;D++)_.fns[D]()}else gi(d);d=d.parent}ft(f)?y([t],0,0):ft(t.tag)&&v(t)}}return E(e,u,a),e.elm}ft(t)&&v(t)}}({nodeOps:di,modules:[Fi,$i,Hi,Ui,ns,ne?{create:Os,activate:Os,remove:function(t,e){!0!==t.data.show?Cs(t,e):e()}}:{}].concat(Oi)});ie&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&Rs(t,"input")}));var Ns={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?pn(n,"postpatch",(function(){Ns.componentUpdated(t,e,n)})):Ts(t,e,n.context),t._vOptions=[].map.call(t.options,Is)):("textarea"===n.tag||hi(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",$s),t.addEventListener("compositionend",Bs),t.addEventListener("change",Bs),ie&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Ts(t,e,n.context);var r=t._vOptions,o=t._vOptions=[].map.call(t.options,Is);if(o.some((function(t,e){return!Wt(t,r[e])})))(t.multiple?e.value.some((function(t){return Ms(t,o)})):e.value!==e.oldValue&&Ms(e.value,o))&&Rs(t,"change")}}};function Ts(t,e,n){Fs(t,e,n),(oe||se)&&setTimeout((function(){Fs(t,e,n)}),0)}function Fs(t,e,n){var r=e.value,o=t.multiple;if(!o||Array.isArray(r)){for(var i,s,a=0,u=t.options.length;a<u;a++)if(s=t.options[a],o)i=Ut(r,Is(s))>-1,s.selected!==i&&(s.selected=i);else if(Wt(Is(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}else"production"!==process.env.NODE_ENV&&Xr('<select multiple v-model="'.concat(e.expression,'"> ')+"expects an Array value for its binding, but got ".concat(Object.prototype.toString.call(r).slice(8,-1)),n)}function Ms(t,e){return e.every((function(e){return!Wt(e,t)}))}function Is(t){return"_value"in t?t._value:t.value}function $s(t){t.target.composing=!0}function Bs(t){t.target.composing&&(t.target.composing=!1,Rs(t.target,"input"))}function Rs(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ls(t){return!t.componentInstance||t.data&&t.data.transition?t:Ls(t.componentInstance._vnode)}var Ps={bind:function(t,e,n){var r=e.value,o=(n=Ls(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,Es(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Ls(n)).data&&n.data.transition?(n.data.show=!0,r?Es(n,(function(){t.style.display=t.__vOriginalDisplay})):Cs(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}},js={model:Ns,show:Ps},zs={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Hs(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Hs(Vn(e.children)):t}function Vs(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[Mt(r)]=o[r];return e}function Ws(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Us=function(t){return t.tag||Mn(t)},qs=function(t){return"show"===t.name},Ks={name:"transition",props:zs,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Us)).length){"production"!==process.env.NODE_ENV&&n.length>1&&Xr("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;"production"!==process.env.NODE_ENV&&r&&"in-out"!==r&&"out-in"!==r&&Xr("invalid <transition> mode: "+r,this.$parent);var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=Hs(o);if(!i)return o;if(this._leaving)return Ws(t,o);var s="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?s+"comment":s+i.tag:dt(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var a=(i.data||(i.data={})).transition=Vs(this),u=this._vnode,l=Hs(u);if(i.data.directives&&i.data.directives.some(qs)&&(i.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,l)&&!Mn(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var c=l.data.transition=Pt({},a);if("out-in"===r)return this._leaving=!0,pn(c,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Ws(t,o);if("in-out"===r){if(Mn(i))return u;var p,f=function(){p()};pn(a,"afterEnter",f),pn(a,"enterCancelled",f),pn(c,"delayLeave",(function(t){p=t}))}}return o}}},Js=Pt({tag:String,moveClass:String},zs);delete Js.mode;var Gs={props:Js,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Dr(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=Vs(this),a=0;a<o.length;a++){if((f=o[a]).tag)if(null!=f.key&&0!==String(f.key).indexOf("__vlist"))i.push(f),n[f.key]=f,(f.data||(f.data={})).transition=s;else if("production"!==process.env.NODE_ENV){var u=f.componentOptions,l=u?Wr(u.Ctor.options)||u.tag||"":f.tag;Xr("<transition-group> children must be keyed: <".concat(l,">"))}}if(r){var c=[],p=[];for(a=0;a<r.length;a++){var f;(f=r[a]).data.transition=s,f.data.pos=f.elm.getBoundingClientRect(),n[f.key]?c.push(f):p.push(f)}this.kept=t(e,null,c),this.removed=p}return t(e,null,i)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(Ys),t.forEach(Xs),t.forEach(Qs),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,r=n.style;gs(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(ps,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(ps,t),n._moveCb=null,vs(n,e))})}})))},methods:{hasMove:function(t,e){if(!ls)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){ss(n,t)})),is(n,e),n.style.display="none",this.$el.appendChild(n);var r=_s(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Ys(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Xs(t){t.data.newPos=t.elm.getBoundingClientRect()}function Qs(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}var Zs={Transition:Ks,TransitionGroup:Gs};function ta(t){this.content=t}function ea(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=ea(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function na(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),u=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t<e&&s.text[s.text.length-t-1]==a.text[a.text.length-t-1];)t++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let t=na(s.content,a.content,n-1,r-1);if(t)return t}n-=u,r-=u}else n-=u,r-=u}}jo.config.mustUseProp=function(t,e,n){return"value"===n&&Yo(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},jo.config.isReservedTag=pi,jo.config.isReservedAttr=Go,jo.config.getTagNamespace=function(t){return ci(t)?"svg":"math"===t?"math":void 0},jo.config.isUnknownElement=function(t){if(!ne)return!0;if(pi(t))return!1;if(t=t.toLowerCase(),null!=fi[t])return fi[t];var e=document.createElement(t);return t.indexOf("-")>-1?fi[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:fi[t]=/HTMLUnknownElement/.test(e.toString())},Pt(jo.options.directives,js),Pt(jo.options.components,Zs),jo.prototype.__patch__=ne?Ss:zt,jo.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=De,"production"!==process.env.NODE_ENV&&(t.$options.template&&"#"!==t.$options.template.charAt(0)||t.$options.el||e?Xr("You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",t):Xr("Failed to mount component: template or render function not defined.",t))),kr(t,"beforeMount"),r="production"!==process.env.NODE_ENV&&Yt.performance&&lr?function(){var e=t._name,r=t._uid,o="vue-perf-start:".concat(r),i="vue-perf-end:".concat(r);lr(o);var s=t._render();lr(i),cr("vue ".concat(e," render"),o,i),lr(o),t._update(s,n),lr(i),cr("vue ".concat(e," patch"),o,i)}:function(){t._update(t._render(),n)};var o={before:function(){t._isMounted&&!t._isDestroyed&&kr(t,"beforeUpdate")}};"production"!==process.env.NODE_ENV&&(o.onTrack=function(e){return kr(t,"renderTracked",[e])},o.onTrigger=function(e){return kr(t,"renderTriggered",[e])}),new hr(t,r,zt,o,!0),n=!1;var i=t._preWatchers;if(i)for(var s=0;s<i.length;s++)i[s].run();return null==t.$vnode&&(t._isMounted=!0,kr(t,"mounted")),t}(this,t=t&&ne?function(t){if("string"==typeof t){return document.querySelector(t)||("production"!==process.env.NODE_ENV&&Xr("Cannot find element: "+t),document.createElement("div"))}return t}(t):void 0,e)},ne&&setTimeout((function(){Yt.devtools&&(de?de.emit("init",jo):"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&console[console.info?"info":"log"]("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&!1!==Yt.productionTip&&"undefined"!=typeof console&&console[console.info?"info":"log"]("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html")}),0),ta.prototype={constructor:ta,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return-1==o?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new ta(i)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new ta(n)},addToStart:function(t,e){return new ta([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ta(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(-1==i?o.length:i,0,e,n),new ta(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=ta.from(t)).size?new ta(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=ta.from(t)).size?new ta(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ta.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},ta.from=function(t){if(t instanceof ta)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ta(e)};class ra{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],u=s+a.nodeSize;if(u>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new ra(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new ra(n,r)}cutByIndex(t,e){return t==e?ra.empty:0==t&&e==this.content.length?this:new ra(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new ra(r,o)}addToStart(t){return new ra([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new ra(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))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(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return ea(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return na(this,t,e,n)}findIndex(t,e=-1){if(0==t)return ia(0,t);if(t==this.size)return ia(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?ia(n+1,o):ia(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return ra.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new ra(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return ra.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new ra(e||t,n)}static from(t){if(!t)return ra.empty;if(t instanceof ra)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new ra([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ra.empty=new ra([],0);const oa={index:0,offset:0};function ia(t,e){return oa.index=t,oa.offset=e,oa}function sa(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!sa(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!sa(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class aa{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&sa(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return aa.none;if(t instanceof aa)return[t];let e=t.slice();return e.sort(((t,e)=>t.type.rank-e.type.rank)),e}}aa.none=[];class ua extends Error{}class la{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=pa(this.content,t+this.openStart,e);return n&&new la(n,this.openStart,this.openEnd)}removeBetween(t,e){return new la(ca(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return la.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new la(ra.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new la(t,n,r)}}function ca(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(ca(i.content,e-o-1,n-o-1)))}function pa(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=pa(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function fa(t,e,n){if(n.openStart>t.depth)throw new ua("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ua("Inconsistent open depths");return ha(t,e,n,0)}function ha(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=ha(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(ra.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return ya(i,ba(t,o,s,e,r))}{let r=t.parent,o=r.content;return ya(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return ya(i,_a(t,e,r))}function da(t,e){if(!e.type.compatibleContent(t.type))throw new ua("Cannot join "+e.type.name+" onto "+t.type.name)}function ma(t,e,n){let r=t.node(n);return da(r,e.node(n)),r}function ga(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function va(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ga(t.nodeAfter,r),i++));for(let t=i;t<s;t++)ga(o.child(t),r);e&&e.depth==n&&e.textOffset&&ga(e.nodeBefore,r)}function ya(t,e){if(!t.type.validContent(e))throw new ua("Invalid content for node "+t.type.name);return t.copy(e)}function ba(t,e,n,r,o){let i=t.depth>o&&ma(t,e,o+1),s=r.depth>o&&ma(n,r,o+1),a=[];return va(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(da(i,s),ga(ya(i,ba(t,e,n,r,o+1)),a)):(i&&ga(ya(i,_a(t,e,o+1)),a),va(e,n,o,a),s&&ga(ya(s,_a(n,r,o+1)),a)),va(r,null,o,a),new ra(a)}function _a(t,e,n){let r=[];if(va(null,t,n,r),t.depth>n){ga(ya(ma(t,e,n+1),_a(t,e,n+1)),r)}return va(e,null,n,r),new ra(r)}la.empty=new la(ra.empty,0,0);class Da{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return aa.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new ka(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(n.push(e,t,r+i),!s)break;if(e=e.child(t),e.isText)break;o=s-1,r+=i+1}return new Da(e,n,o)}static resolveCached(t,e){for(let n=0;n<wa.length;n++){let r=wa[n];if(r.pos==e&&r.doc==t)return r}let n=wa[Ea]=Da.resolve(t,e);return Ea=(Ea+1)%Ca,n}}let wa=[],Ea=0,Ca=12;class ka{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}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 Aa=Object.create(null);class xa{constructor(t,e,n,r=aa.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||ra.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&sa(this.attrs,e||t.defaultAttrs||Aa)&&aa.sameSet(this.marks,n||aa.none)}copy(t=null){return t==this.content?this:new xa(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new xa(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return la.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new la(a,r.depth-i,o.depth-i)}replace(t,e,n){return fa(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return Da.resolveCached(this,t)}resolveNoCache(t){return Da.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Sa(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=ra.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let t=aa.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!aa.sameSet(t,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 t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=ra.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}xa.prototype.text=void 0;class Oa extends xa{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Sa(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Oa(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Oa(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Sa(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Na{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Ta(t,e);if(null==n.next)return Na.empty;let r=Fa(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(La(t,0));function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);La(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new Na(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(Ra);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}}(function(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((t=>t.to=e))}function i(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(i(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;e<t.min;e++){let e=n();o(i(t.expr,s),e),s=e}if(-1==t.max)o(i(t.expr,s),s);else for(let e=t.min;e<t.max;e++){let e=n();r(s,e),o(i(t.expr,s),e),s=e}return[r(s)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(t.exprs[r],e);if(r==t.exprs.length-1)return s;o(s,e=n())}}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(t,n);if(a&&(!e||a.validEnd))return ra.from(s.map((t=>t.createAndFill())));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r})).join("\n")}}Na.empty=new Na(!0);class Ta{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Fa(t){let e=[];do{e.push(Ma(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Ma(t){let e=[];do{e.push(Ia(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Ia(t){let e=function(t){if(t.eat("(")){let e=Fa(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&o.push(r)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Ba(t,e)}return e}function $a(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Ba(t,e){let n=$a(t),r=n;return t.eat(",")&&(r="}"!=t.next?$a(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Ra(t,e){return e-t}function La(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(Ra)}function Pa(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function ja(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function za(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Va(t[n]);return e}class Ha{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=za(n.attrs),this.defaultAttrs=Pa(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Na.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:ja(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new xa(this,this.computeAttrs(t),ra.from(e),aa.setFrom(n))}createChecked(t=null,e,n){if(e=ra.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new xa(this,this.computeAttrs(t),e,aa.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=ra.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(ra.empty,!0);return o?new xa(this,t,e.append(o),aa.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:aa.none:t}static compile(t,e){let n=Object.create(null);t.forEach(((t,r)=>n[t]=new Ha(t,e,r)));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Va{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Wa{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=za(r.attrs),this.excluded=null;let o=Pa(this.attrs);this.instance=o?new aa(this,o):null}create(t=null){return!t&&this.instance?this.instance:new aa(this,ja(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new Wa(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class Ua{constructor(t){this.cached=Object.create(null),this.spec={nodes:ta.from(t.nodes),marks:ta.from(t.marks||{}),topNode:t.topNode},this.nodes=Ha.compile(this.spec.nodes,this),this.marks=Wa.compile(this.spec.marks,this);let e=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let n=this.nodes[t],r=n.spec.content||"",o=n.spec.marks;n.contentMatch=e[r]||(e[r]=Na.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?qa(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:qa(this,n.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(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Ha))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new Oa(n,n.defaultAttrs,t,aa.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return xa.fromJSON(this,t)}markFromJSON(t){return aa.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function qa(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class Ka{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new Za(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Za(this,e,!0);return n.addAll(t,e.from,e.to),la.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(tu(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach((t=>{n(t=eu(t)),t.mark=e}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=eu(t)),t.node=e}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Ka(t,Ka.schemaRules(t)))}}const Ja={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},Ga={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ya={ol:!0,ul:!0};function Xa(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Qa{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=aa.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(ra.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=ra.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(ra.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):nu(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Ja.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Za{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=Xa(null,e.preserveWhitespace,0)|(n?4:0);r=o?new Qa(o.type,o.attrs,aa.none,aa.none,!0,e.topMatch||o.type.contentMatch,i):new Qa(n?null:t.schema.topNodeType,null,aa.none,aa.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let e=t.getAttribute("style"),n=e?this.readStyles(function(t){let e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e)):null,r=this.top;if(null!=n)for(let t=0;t<n.length;t++)this.addPendingMark(n[t]);if(this.addElement(t),null!=n)for(let t=0;t<n.length;t++)this.removePendingMark(n[t],r)}}addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n,r=t.nodeName.toLowerCase();Ya.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&Ya.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:Ga.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let e,n=this.top,i=this.needsBlock;if(Ja.hasOwnProperty(r))e=!0,n.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),e&&this.sync(n),this.needsBlock=i}else this.addElementByRule(t,o,!1===o.consuming?n:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=aa.none;t:for(let n=0;n<t.length;n+=2)for(let r;;){let o=this.parser.matchStyle(t[n],t[n+1],this,r);if(!o)continue t;if(o.ignore)return null;if(e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;r=o}return e}addElementByRule(t,e,n){let r,o,i;if(e.node)o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs||null,e.preserveWhitespace);else{i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i)}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)e.type&&!e.type.allowsMarkType(t.marks[r].type)||(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let i=Xa(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new Qa(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));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(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function tu(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function eu(t){let e={};for(let n in t)e[n]=t[n];return e}function nu(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class ru{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=iu(e).createDocumentFragment());let r=n,o=[];return t.forEach((t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))})),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=ru.renderSpec(iu(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&ru.renderSpec(iu(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],u=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){u=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let o=u;o<e.length;o++){let i=e[o];if(0===i){if(o<e.length-1||o>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=ru.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ru(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=ou(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return ou(t.marks)}}function ou(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function iu(t){return t.document||window.document}const su=Math.pow(2,16);function au(t,e){return t+e*su}function uu(t){return 65535&t}class lu{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class cu{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&cu.empty)return cu.empty}recover(t){let e=0,n=uu(t);if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/su}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let u=this.ranges[s+o],l=this.ranges[s+i],c=a+u;if(t<=c){let o=a+r+((u?t==a?-1:t==c?1:e:e)<0?0:l);if(n)return o;let i=t==(e<0?a:c)?null:au(s/3,t-a),p=t==a?2:t==c?1:4;return(e<0?t!=a:t!=c)&&(p|=8),new lu(o,p,i)}r+=l-u}return n?t+r:new lu(t+r,0,null)}touches(t,e){let n=0,r=uu(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+o];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),u=this.ranges[r+e],l=this.ranges[r+n];t(s,s+u,a,a+l),o+=l-u}}invert(){return new cu(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?cu.empty:new cu(t<0?[0,-t,0]:[0,0,t])}}cu.empty=new cu([]);class pu{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new pu(this.maps,this.mirror,t,e)}copy(){return new pu(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new pu;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(t,e);if(null!=o.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new lu(t,r,null)}}const fu=Object.create(null);class hu{getMap(){return cu.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=fu[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in fu)throw new RangeError("Duplicate use of step JSON ID "+t);return fu[t]=e,e.prototype.jsonID=t,e}}class du{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new du(t,null)}static fail(t){return new du(null,t)}static fromReplace(t,e,n,r){try{return du.ok(t.replace(e,n,r))}catch(t){if(t instanceof ua)return du.fail(t.message);throw t}}}function mu(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(mu(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return ra.fromArray(r)}class gu extends hu{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new la(mu(e.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return du.fromReplace(t,this.from,this.to,o)}invert(){return new vu(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new gu(e.pos,n.pos,this.mark)}merge(t){return t instanceof gu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new gu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new gu(e.from,e.to,t.markFromJSON(e.mark))}}hu.jsonID("addMark",gu);class vu extends hu{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new la(mu(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return du.fromReplace(t,this.from,this.to,n)}invert(){return new gu(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new vu(e.pos,n.pos,this.mark)}merge(t){return t instanceof vu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new vu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new vu(e.from,e.to,t.markFromJSON(e.mark))}}hu.jsonID("removeMark",vu);class yu extends hu{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&_u(t,this.from,this.to)?du.fail("Structure replace would overwrite content"):du.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new cu([this.from,this.to-this.from,this.slice.size])}invert(t){return new yu(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new yu(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof yu)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?la.empty:new la(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new yu(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?la.empty:new la(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new yu(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new yu(e.from,e.to,la.fromJSON(t,e.slice),!!e.structure)}}hu.jsonID("replace",yu);class bu extends hu{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(_u(t,this.from,this.gapFrom)||_u(t,this.gapTo,this.to)))return du.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return du.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?du.fromReplace(t,this.from,this.to,n):du.fail("Content does not fit in gap")}getMap(){return new cu([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new bu(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new bu(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bu(e.from,e.to,e.gapFrom,e.gapTo,la.fromJSON(t,e.slice),e.insert,!!e.structure)}}function _u(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function Du(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function wu(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!Du(r,o,i))break}return null}function Eu(t,e,n=null,r=t){let o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<o;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(Cu).concat({type:e,attrs:n}).concat(i.map(Cu)):null}function Cu(t){return{type:t,attrs:null}}function ku(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let t=o.depth-1,e=n-2;t>i;t--,e--){let n=o.node(t),i=o.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[e]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),u=r&&r[0];return o.node(i).canReplaceWith(a,a,u?u.type:o.node(i+1).type)}function Au(t,e){let n=t.resolve(e),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function xu(t,e,n=e,r=la.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Ou(o,i,r)?new yu(e,n,r):new Su(o,i,r).fit()}function Ou(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}hu.jsonID("replaceAround",bu);class Su{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=ra.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=ra.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new la(o,i,s);return t>-1?new bu(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new yu(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=Fu(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],u=null;if(1==t&&(o?a.matchType(o.type)||(u=a.fillBefore(ra.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:n,parent:r,inject:u};if(2==t&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Fu(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new la(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Fu(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new la(Nu(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new la(Nu(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-t,u=0,l=[],{match:c,type:p}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)l.push(r.child(t));c=c.matchFragment(r)}let f=s.size+t-(i.content.size-i.openEnd);for(;u<s.childCount;){let t=s.child(u),e=c.matchType(t.type);if(!e)break;u++,(u>1||0==a||t.content.size)&&(c=e,l.push(Mu(t.mark(p.allowedMarks(t.marks)),1==u?a:0,u==s.childCount?f:-1)))}let h=u==s.childCount;h||(f=-1),this.placed=Tu(this.placed,e,ra.from(l)),this.frontier[e].match=c,h&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t<f;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=h?0==t?la.empty:new la(Nu(i.content,t-1,1),t-1,f<0?i.openEnd:t-1):new la(Nu(i.content,t,u),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Iu(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:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=Iu(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=Iu(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Tu(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Tu(this.placed,this.depth,ra.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ra.empty,!0);t.childCount&&(this.placed=Tu(this.placed,this.frontier.length,t))}}function Nu(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Nu(t.firstChild.content,e-1,n)))}function Tu(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Tu(t.lastChild.content,e-1,n)))}function Fu(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Mu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Mu(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ra.empty,!0)))),t.copy(r)}function Iu(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function $u(t){return t.spec.defining||t.spec.definingForContent}function Bu(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Bu(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(ra.empty,!0))}return t}function Ru(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}let Lu=class extends Error{};Lu=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Lu.prototype=Object.create(Error.prototype)).constructor=Lu,Lu.prototype.name="TransformError";class Pu{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new pu}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Lu(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=la.empty){let r=xu(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new la(ra.from(n),0,0))}delete(t,e){return this.replace(t,e,la.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(Ou(o,i,r))return t.step(new yu(e,n,r));let s=Ru(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let u=s.indexOf(a),l=[],c=r.openStart;for(let t=r.content,e=0;;e++){let n=t.firstChild;if(l.push(n),e==r.openStart)break;t=n.content}for(let t=c-1;t>=0;t--){let e=l[t].type,n=$u(e);if(n&&o.node(u).type!=e)c=t;else if(n||!e.isTextblock)break}for(let e=r.openStart;e>=0;e--){let a=(e+c+1)%(r.openStart+1),p=l[a];if(p)for(let e=0;e<s.length;e++){let l=s[(e+u)%s.length],c=!0;l<0&&(c=!1,l=-l);let f=o.node(l-1),h=o.index(l-1);if(f.canReplaceWith(h,h,p.type,p.marks))return t.replace(o.before(l),c?i.after(l):n,new la(Bu(r.content,0,r.openStart,a),a,r.openEnd))}}let p=t.steps.length;for(let a=s.length-1;a>=0&&(t.replace(e,n,r),!(t.steps.length>p));a--){let t=s[a];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)return null}return null}(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new la(ra.from(r),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Ru(r,o);for(let e=0;e<i.length;e++){let n=i[e],s=e==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return t.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),u=s,l=a,c=ra.empty,p=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,c=ra.from(r.node(t).copy(c)),p++):u--;let f=ra.empty,h=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,f=ra.from(o.node(t).copy(f)),h++):l++;t.step(new bu(u,l,s,a,new la(c.append(f),p,h),c.size-p,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new yu(e-n,e+n,la.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=ra.empty;for(let t=n.length-1;t>=0;t--){if(r.size){let e=n[t].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ra.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new bu(o,i,o,i,new la(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),a=s.map(n,1),u=s.map(n+e.nodeSize,1);return t.step(new bu(a,u,a+1,u-1,new la(ra.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new bu(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new la(ra.from(s),0,0),1,!0))}(this,t,e,n,r),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=ra.empty,s=ra.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=ra.from(o.node(t).copy(i));let e=r&&r[a];s=ra.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new yu(e,e,new la(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,u,l)=>{if(!t.isInline)return;let c=t.marks;if(!r.isInSet(c)&&l.type.allowsMarkType(r.type)){let l=Math.max(u,e),p=Math.min(u+t.nodeSize,n),f=r.addToSet(c);for(let t=0;t<c.length;t++)c[t].isInSet(f)||(o&&o.to==l&&o.mark.eq(c[t])?o.to=p:s.push(o=new vu(l,p,c[t])));i&&i.to==l?i.to=p:a.push(i=new gu(l,p,r))}})),s.forEach((e=>t.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof Wa){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,u=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&u.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:u,from:Math.max(s,e),to:r,step:i})}}})),o.forEach((e=>t.step(new vu(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let e=0;e<o.childCount;e++){let a=o.child(e),u=s+a.nodeSize,l=r.matchType(a.type);if(l){r=l;for(let e=0;e<a.marks.length;e++)n.allowsMarkType(a.marks[e].type)||t.step(new vu(s,u,a.marks[e]))}else i.push(new yu(s,u,la.empty));s=u}if(!r.validEnd){let e=r.fillBefore(ra.empty,!0);t.replace(s,s,new la(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}const ju=Object.create(null);class zu{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Hu(t.min(e),t.max(e))]}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 t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=la.empty){let n=e.content.lastChild,r=null;for(let t=0;t<e.openEnd;t++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:u}=i[s],l=t.mapping.slice(o);t.replaceRange(l.map(a.pos),l.map(u.pos),s?la.empty:e),0==s&&Qu(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),u=a.map(i.pos),l=a.map(s.pos);o?t.deleteRange(u,l):(t.replaceRangeWith(u,l,e),Qu(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Uu(t):Xu(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let o=e<0?Xu(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):Xu(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Gu(t.node(0))}static atStart(t){return Xu(t,t,0,0,1)||new Gu(t)}static atEnd(t){return Xu(t,t,t.content.size,t.childCount,-1)||new Gu(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=ju[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in ju)throw new RangeError("Duplicate use of selection JSON ID "+t);return ju[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Uu.between(this.$anchor,this.$head).getBookmark()}}zu.prototype.visible=!0;class Hu{constructor(t,e){this.$from=t,this.$to=e}}let Vu=!1;function Wu(t){Vu||t.parent.inlineContent||(Vu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Uu extends zu{constructor(t,e=t){Wu(t),Wu(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return zu.near(n);let r=t.resolve(e.map(this.anchor));return new Uu(r.parent.inlineContent?r:n,n)}replace(t,e=la.empty){if(super.replace(t,e),e==la.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Uu&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new qu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Uu(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=zu.findFrom(e,n,!0)||zu.findFrom(e,-n,!0);if(!t)return zu.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(zu.findFrom(t,-n,!0)||zu.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new Uu(t,e)}}zu.jsonID("text",Uu);class qu{constructor(t,e){this.anchor=t,this.head=e}map(t){return new qu(t.map(this.anchor),t.map(this.head))}resolve(t){return Uu.between(t.resolve(this.anchor),t.resolve(this.head))}}class Ku extends zu{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?zu.near(o):new Ku(o)}content(){return new la(ra.from(this.node),0,0)}eq(t){return t instanceof Ku&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ju(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ku(t.resolve(e.anchor))}static create(t,e){return new Ku(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Ku.prototype.visible=!1,zu.jsonID("node",Ku);class Ju{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new qu(n,n):new Ju(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Ku.isSelectable(n)?new Ku(e):zu.near(e)}}class Gu extends zu{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=la.empty){if(e==la.empty){t.delete(0,t.doc.content.size);let e=zu.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Gu(t)}map(t){return new Gu(t)}eq(t){return t instanceof Gu}getBookmark(){return Yu}}zu.jsonID("all",Gu);const Yu={map(){return this},resolve:t=>new Gu(t)};function Xu(t,e,n,r,o,i=!1){if(e.inlineContent)return Uu.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Ku.isSelectable(r))return Ku.create(t,n-(o<0?r.nodeSize:0))}else{let e=Xu(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function Qu(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof yu||i instanceof bu)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(zu.near(t.doc.resolve(o),n)))}function Zu(t,e){return e&&t?t.bind(e):t}class tl{constructor(t,e,n){this.name=t,this.init=Zu(e.init,n),this.apply=Zu(e.apply,n)}}function el(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=el(o,e,{})),n[r]=o}return n}new tl("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new tl("selection",{init:(t,e)=>t.selection||zu.atStart(e.doc),apply:t=>t.selection}),new tl("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new tl("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e});class nl{constructor(t){this.spec=t,this.props={},t.props&&el(t.props,this,this.props),this.key=t.key?t.key.key:ol("plugin")}getState(t){return t[this.key]}}const rl=Object.create(null);function ol(t){return t in rl?t+"$"+ ++rl[t]:(rl[t]=0,t+"$")}class il{constructor(t="key"){this.key=ol(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const sl="undefined"!=typeof navigator?navigator:null,al="undefined"!=typeof document?document:null,ul=sl&&sl.userAgent||"",ll=/Edge\/(\d+)/.exec(ul),cl=/MSIE \d/.exec(ul),pl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ul),fl=!!(cl||pl||ll),hl=cl?document.documentMode:pl?+pl[1]:ll?+ll[1]:0,dl=!fl&&/gecko\/(\d+)/i.test(ul);dl&&(/Firefox\/(\d+)/.exec(ul)||[0,0])[1];const ml=!fl&&/Chrome\/(\d+)/.exec(ul),gl=!!ml,vl=ml?+ml[1]:0,yl=!fl&&!!sl&&/Apple Computer/.test(sl.vendor),bl=yl&&(/Mobile\/\w+/.test(ul)||!!sl&&sl.maxTouchPoints>2),_l=bl||!!sl&&/Mac/.test(sl.platform),Dl=/Android \d/.test(ul),wl=!!al&&"webkitFontSmoothing"in al.documentElement.style,El=wl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Cl=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},kl=/^(img|br|input|textarea|hr)$/i;function Al(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:xl(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Ol(t)||kl.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Cl(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?xl(t):0}}}function xl(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ol(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Sl=function(t){let e=t.isCollapsed;return e&&gl&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Nl(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Tl(t,e=null){let n=t.domSelection(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,u,l=r.resolve(s);if(Sl(n)){for(a=l;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Ku.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==xl(t);r||o;){if(t==n)return!0;let e=Cl(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==xl(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;u=new Ku(s==t?l:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}if(!u){u=Pl(t,a,l,"pointer"==e||t.state.selection.head<l.pos&&!i?1:-1)}return u}function Fl(t){return t.editable?t.hasFocus():function(t){let e=t.domSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ml(t,e=!1){let n=t.state.selection;if(function(t,e){if(e instanceof Ku){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Ll(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Ll(t)}(t,n),Fl(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&gl){let e=t.domSelection(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&(r=e.anchorNode,o=e.anchorOffset,i=n.anchorNode,s=n.anchorOffset,i&&(Al(r,o,i,s,-1)||Al(r,o,i,s,1))))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}var r,o,i,s;if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,Cl(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&fl&&hl<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!Il||n instanceof Uu||(n.$from.parent.inlineContent||(r=$l(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=$l(t,n.to))),t.docView.setSelection(i,s,t.root,e),Il&&(r&&Rl(r),o&&Rl(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelection(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Fl(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Il=yl||gl&&vl<63;function $l(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(yl&&o&&"false"==o.contentEditable)return Bl(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Bl(o);if(i)return Bl(i)}}function Bl(t){return t.contentEditable="true",yl&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Rl(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Ll(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Pl(t,e,n,r){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||Uu.between(e,n,r)}function jl(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&zu.findFrom(i,e)}function zl(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Hl(t,e,n){let r=t.state.selection;if(!(r instanceof Uu)){if(r instanceof Ku&&r.node.isInline)return zl(t,new Uu(e>0?r.$to:r.$from));{let n=jl(t.state,e);return!!n&&zl(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=jl(t.state,e);return!!(n&&n instanceof Ku)&&zl(t,n)}if(!(_l&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Ku.isSelectable(i)?zl(t,new Ku(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!wl&&zl(t,new Uu(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Vl(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Wl(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Ul(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(dl&&1==n.nodeType&&r<Vl(n)&&Wl(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Wl(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Kl(n))break;{let e=n.previousSibling;for(;e&&Wl(e);)o=n.parentNode,i=Cl(e),e=e.previousSibling;if(e)n=e,r=Vl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Jl(t,e,n,r):o&&Jl(t,e,o,i)}function ql(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Vl(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Wl(n.childNodes[r]))break;o=n,i=++r}else{if(Kl(n))break;{let e=n.nextSibling;for(;e&&Wl(e);)o=e.parentNode,i=Cl(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=Vl(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&Jl(t,e,o,i)}function Kl(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Jl(t,e,n,r){if(Sl(e)){let t=document.createRange();t.setEnd(n,r),t.setStart(n,r),e.removeAllRanges(),e.addRange(t)}else e.extend&&e.extend(n,r);t.domObserver.setCurSelection();let{state:o}=t;setTimeout((()=>{t.state==o&&Ml(t)}),50)}function Gl(t,e,n){let r=t.state.selection;if(r instanceof Uu&&!r.empty||n.indexOf("s")>-1)return!1;if(_l&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=jl(t.state,e);if(n&&n instanceof Ku)return zl(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Gu?zu.near(n,e):zu.findFrom(n,e);return!!s&&zl(t,s)}return!1}function Yl(t,e){if(!(t.state.selection instanceof Uu))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function Xl(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Ql(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||_l&&72==n&&"c"==r?Yl(t,-1)||Ul(t):46==n||_l&&68==n&&"c"==r?Yl(t,1)||ql(t):13==n||27==n||(37==n||_l&&66==n&&"c"==r?Hl(t,-1,r)||Ul(t):39==n||_l&&70==n&&"c"==r?Hl(t,1,r)||ql(t):38==n||_l&&80==n&&"c"==r?Gl(t,-1,r)||Ul(t):40==n||_l&&78==n&&"c"==r?function(t){if(!yl||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelection();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Xl(t,n,"true"),setTimeout((()=>Xl(t,n,"false")),20)}return!1}(t)||Gl(t,1,r)||ql(t):r==(_l?"m":"c")&&(66==n||73==n||89==n||90==n))}function Zl(t,e){let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||ru.fromSchema(t.state.schema),a=lc(),u=a.createElement("div");u.appendChild(s.serializeFragment(r,{document:a}));let l,c=u.firstChild,p=0;for(;c&&1==c.nodeType&&(l=ac[c.nodeName.toLowerCase()]);){for(let t=l.length-1;t>=0;t--){let e=a.createElement(l[t]);for(;u.firstChild;)e.appendChild(u.firstChild);u.appendChild(e),p++}c=u.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${o} ${i}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:u,text:t.someProp("clipboardTextSerializer",(t=>t(e)))||e.content.textBetween(0,e.content.size,"\n\n")}}function tc(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let u=e&&(r||a||!n);if(u){if(t.someProp("transformPastedText",(t=>{e=t(e,a||r)})),a)return e?new la(ra.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):la.empty;let n=t.someProp("clipboardTextParser",(t=>t(e,o,r)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=ru.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(t=>{n=t(n)})),i=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=lc().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&ac[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"</"+t+">")).reverse().join(""));if(r.innerHTML=t,n)for(let t=0;t<n.length;t++)r=r.querySelector(n[t])||r;return r}(n),wl&&function(t){let e=t.querySelectorAll(gl?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(i);let l=i&&i.querySelector("[data-pm-slice]"),c=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let t=+c[3];t>0&&i.firstChild;t--)i=i.firstChild;if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Ka.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!u&&!c),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||ec.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=n.length-2;t>=0;t-=2){let e=r.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;o=ra.from(e.create(n[t+1],o)),i++,s++}return new la(o,i,s)}(sc(s,+c[1],+c[2]),c[4]);else if(s=la.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&rc(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=oc(i[i.length-1],r.length));let e=nc(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return ra.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t<s.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=s.content.lastChild;e<s.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);s=sc(s,t,e)}return t.someProp("transformPasted",(t=>{s=t(s)})),s}const ec=/^(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 nc(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ra.from(t));return t}function rc(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=rc(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(ra.from(nc(n,t,o+1))))}}function oc(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,oc(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ra.empty,!0);return t.copy(n.append(r))}function ic(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return o<r-1&&(a=ic(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ra.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function sc(t,e,n){return e<t.openStart&&(t=new la(ic(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new la(ic(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const ac={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 uc=null;function lc(){return uc||(uc=document.implementation.createHTMLDocument("title"))}const cc={};let pc={};function fc(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function hc(t){return{left:t.clientX,top:t.clientY}}function dc(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(t.someProp(e,(e=>r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function mc(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function gc(t,e,n,r,o){return dc(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Ku&&(n=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);if(Ku.isSelectable(e)){r=n&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=r&&(mc(t,Ku.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Ku.isSelectable(r))&&(mc(t,new Ku(n),"pointer"),!0)}(t,n))}function vc(t,e,n,r){return dc(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function yc(t,e,n,r){return dc(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(mc(t,Uu.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let e=o.depth+1;e>0;e--){let n=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(n.inlineContent)mc(t,Uu.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Ku.isSelectable(n))continue;mc(t,Ku.create(r,i),"pointer")}return!0}}(t,n,r)}function bc(t){return Ac(t)}pc.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!wc(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Dl||!gl||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!bl||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Ql(t,n)?n.preventDefault():fc(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,Nl(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},pc.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},pc.keypress=(t,e)=>{let n=e;if(wc(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||_l&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Uu&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const _c=_l?"metaKey":"ctrlKey";cc.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=bc(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[_c]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(hc(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Dc(t,s,n,!!r)):("doubleClick"==i?vc:yc)(t,s.pos,s.inside,n)?n.preventDefault():fc(t,"pointer"))};class Dc{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[_c],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:u}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||u instanceof Ku&&u.from<=i&&u.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!dl||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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),fc(t,"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((()=>Ml(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(hc(t))),this.allowDefault||!e?fc(this.view,"pointer"):gc(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||yl&&this.mightDrag&&!this.mightDrag.node.isAtom||gl&&!(this.view.state.selection instanceof Uu)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(mc(this.view,zu.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):fc(this.view,"pointer")}move(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),fc(this.view,"pointer"),0==t.buttons&&this.done()}}function wc(t,e){return!!t.composing||!!(yl&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}cc.touchdown=t=>{bc(t),fc(t,"pointer")},cc.contextmenu=t=>bc(t);const Ec=Dl?5e3:-1;function Cc(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Ac(t)),e))}function kc(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Ac(t,e=!1){if(!(Dl&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),kc(t),e||t.docView&&t.docView.dirty){let e=Tl(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}pc.compositionstart=pc.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Ac(t,!0),t.markCursor=null;else if(Ac(t),dl&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelection();for(let t=e.focusNode,n=e.focusOffset;t&&1==t.nodeType&&0!=n;){let r=n<0?t.lastChild:t.childNodes[n-1];if(!r)break;if(3==r.nodeType){e.collapse(r,r.nodeValue.length);break}t=r,n=-1}}t.input.composing=!0}Cc(t,Ec)},pc.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,Cc(t,20))};const xc=fl&&hl<15||bl&&El<604;function Oc(t,e,n,r){let o=tc(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||la.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}cc.copy=pc.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=xc?null:n.clipboardData,s=r.content(),{dom:a,text:u}=Zl(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",u)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},pc.paste=(t,e)=>{let n=e;if(t.composing&&!Dl)return;let r=xc?null:n.clipboardData;r&&Oc(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Oc(t,r.value,null,e):Oc(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class Sc{constructor(t,e){this.slice=t,this.move=e}}const Nc=_l?"altKey":"ctrlKey";cc.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(hc(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Ku?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Ku.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Ku.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:u}=Zl(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(xc?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",xc||n.dataTransfer.setData("text/plain",u),t.dragging=new Sc(s,!n[Nc])},cc.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},pc.dragover=pc.dragenter=(t,e)=>e.preventDefault(),pc.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(hc(n));if(!o)return;let i=t.state.doc.resolve(o.pos);if(!i)return;let s=r&&r.slice;s?t.someProp("transformPasted",(t=>{s=t(s)})):s=tc(t,n.dataTransfer.getData(xc?"Text":"text/plain"),xc?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Nc]);if(t.someProp("handleDrop",(e=>e(t,n,s||la.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let u=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let t=0;t<n.openStart;t++)o=o.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,i=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}(t.state.doc,i.pos,s):i.pos;null==u&&(u=i.pos);let l=t.state.tr;a&&l.deleteSelection();let c=l.mapping.map(u),p=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=l.doc;if(p?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(f))return;let h=l.doc.resolve(c);if(p&&Ku.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Ku(h));else{let e=l.mapping.map(u);l.mapping.maps[l.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),l.setSelection(Pl(t,h,l.doc.resolve(e)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))},cc.focus=t=>{t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelection())&&Ml(t)}),20))},cc.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},cc.beforeinput=(t,e)=>{if(gl&&Dl&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,Nl(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in pc)cc[t]=pc[t];function Tc(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Fc{constructor(t,e){this.toDOM=t,this.spec=e||Rc,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new $c(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Fc&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Tc(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Mc{constructor(t,e){this.attrs=t,this.spec=e||Rc}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new $c(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Mc&&Tc(this.attrs,t.attrs)&&Tc(this.spec,t.spec)}static is(t){return t.type instanceof Mc}destroy(){}}class Ic{constructor(t,e){this.attrs=t,this.spec=e||Rc}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new $c(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof Ic&&Tc(this.attrs,t.attrs)&&Tc(this.spec,t.spec)}destroy(){}}class $c{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new $c(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new $c(t,t,new Fc(e,n))}static inline(t,e,n,r){return new $c(t,e,new Mc(n,r))}static node(t,e,n,r){return new $c(t,e,new Ic(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Mc}}const Bc=[],Rc={};class Lc{constructor(t,e){this.local=t.length?t:Bc,this.children=e.length?e:Bc}static create(t,e){return e.length?Wc(e,t,0,Rc):Pc}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==Pc||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Rc)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice(),u=(t,e,n,r)=>{for(let s=0;s<a.length;s+=3){let u,l=a[s+1];if(l<0||t>l+i)continue;let c=a[s]+i;e>=c?a[s+1]=t<=c?-2:-1:n>=o&&(u=r-n-(e-t))&&(a[s]+=u,a[s+1]+=u)}};for(let t=0;t<n.maps.length;t++)n.maps[t].forEach(u);let l=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){l=!0,a[e+1]=-1;continue}let u=n.map(t[e]+i),c=u-o;if(c<0||c>=r.content.size){l=!0;continue}let p=n.map(t[e+1]+i,-1)-o,{index:f,offset:h}=r.content.findIndex(c),d=r.maybeChild(f);if(d&&h==c&&h+d.nodeSize==p){let r=a[e+2].mapInner(n,d,u+1,t[e]+i+1,s);r!=Pc?(a[e]=c,a[e+1]=p,a[e+2]=r):(a[e+1]=-2,l=!0)}else l=!0}if(l){let u=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let n=0;n<t.length;n+=3)-1==t[n+1]&&a(t[n+2],e[n]+i+1);return n}(a,t,e,n,o,i,s),l=Wc(u,r,0,s);e=l.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<l.children.length;t+=3){let n=l.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,l.children[t],l.children[t+1],l.children[t+2])}}return new Lc(e.sort(Uc),a)}(this.children,i||[],t,e,n,r,o):i?new Lc(i.sort(Uc),Bc):Pc}add(t,e){return e.length?this==Pc?Lc.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach(((t,i)=>{let s,a=i+n;if(s=Hc(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,Wc(s,t,a+1,Rc)),o+=3}}));let i=zc(o?Vc(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new Lc(i.length?this.local.concat(i).sort(Uc):this.local,r||this.children)}remove(t){return 0==t.length||this==Pc?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+e,s=n[r+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=Pc?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<t.length;o++)if(n=t[o])for(let t=0;t<r.length;t++)r[t].eq(n,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Lc(r,n):Pc}forChild(t,e){if(this==Pc)return this;if(e.isLeaf)return Lc.empty;let n,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(n=this.children[e+2]);break}let o=t+1,i=o+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<i&&e.to>o&&e.type instanceof Mc){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let t=new Lc(r.sort(Uc),Bc);return n?new jc([t,n]):t}return n||Pc}eq(t){if(this==t)return!0;if(!(t instanceof Lc)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return qc(this.localsInner(t))}localsInner(t){if(this==Pc)return Bc;if(t.inlineContent||!this.local.some(Mc.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof Mc||e.push(this.local[t]);return e}}Lc.empty=new Lc([],[]),Lc.removeOverlap=qc;const Pc=Lc.empty;class jc{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,Rc)));return jc.from(n)}forChild(t,e){if(e.isLeaf)return Lc.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=Pc&&(o instanceof jc?n=n.concat(o.members):n.push(o))}return jc.from(n)}eq(t){if(!(t instanceof jc)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?qc(n?e:e.sort(Uc)):Bc}static from(t){switch(t.length){case 0:return Pc;case 1:return t[0];default:return new jc(t)}}}function zc(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new $c(o.from+e,o.to+e,o.type))}return n}function Hc(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>n&&e.to<r&&((o||(o=[])).push(e),t[i]=null);return o}function Vc(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Wc(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=Hc(t,e,s+n);if(a){i=!0;let t=Wc(a,e,n+s+1,r);t!=Pc&&o.push(s,s+e.nodeSize,t)}}));let s=zc(i?Vc(t):t,-n).sort(Uc);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||(r.onRemove&&r.onRemove(s[t].spec),s.splice(t--,1));return s.length||o.length?new Lc(s,o):Pc}function Uc(t,e){return t.from-e.from||t.to-e.to}function qc(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Kc(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Kc(e,o+1,i.copy(r.to,i.to)))}}return e}function Kc(t,e,n){for(;e<t.length&&Uc(n,t[e])>0;)e++;t.splice(e,0,n)}for(var Jc={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:"'",229:"q"},Gc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Yc="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Xc="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Qc="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Zc="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),tp="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ep=Yc&&(Zc||+Yc[1]<57)||Qc&&Zc,np=0;np<10;np++)Jc[48+np]=Jc[96+np]=String(np);for(np=1;np<=24;np++)Jc[np+111]="F"+np;for(np=65;np<=90;np++)Jc[np]=String.fromCharCode(np+32),Gc[np]=String.fromCharCode(np);for(var rp in Jc)Gc.hasOwnProperty(rp)||(Gc[rp]=Jc[rp]);const op="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function ip(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let t=0;t<i.length-1;t++){let s=i[t];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);op?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function sp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function ap(t){let e=function(t){let e=Object.create(null);for(let n in t)e[ip(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!(ep&&(t.ctrlKey||t.altKey||t.metaKey)||(Xc||tp)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?Gc:Jc)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[sp(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=Jc[n.keyCode])&&r!=o){let o=e[sp(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[sp(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}function up(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function lp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function cp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function pp(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function fp(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Au(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,a=ra.empty;for(let t=r.length-1;t>=0;t--)a=ra.from(r[t].create(null,a));a=ra.from(i.copy(a));let u=t.tr.step(new bu(e.pos-1,o,e.pos,o,new la(a,1,0),r.length,!0)),l=o+2*r.length;Au(u.doc,l)&&u.join(l),n(u.scrollIntoView())}return!0}let u=zu.findFrom(e,1),l=u&&u.$from.blockRange(u.$to),c=l&&wu(l);if(null!=c&&c>=e.depth)return n&&n(t.tr.lift(l,c).scrollIntoView()),!0;if(a&&up(s,"start",!0)&&up(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,u=1;for(;!a.isTextblock;a=a.firstChild)u++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=ra.empty;for(let t=o.length-1;t>=0;t--)r=ra.from(o[t].copy(r));n(t.tr.step(new bu(e.pos-o.length,e.pos+s.nodeSize,e.pos+u,e.pos+s.nodeSize-u,new la(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function hp(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Uu.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const dp=hp(-1),mp=hp(1);function gp(t,e=null){return function(n,r){let{from:o,to:i}=n.selection,s=!1;return n.doc.nodesBetween(o,i,((r,o)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)s=!0;else{let e=n.doc.resolve(o),r=e.index();s=e.parent.canReplaceWith(r,r+1,t)}})),!!s&&(r&&r(n.tr.setBlockType(o,i,t,e).scrollIntoView()),!0)}}function vp(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,u=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);u=new ka(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new ka(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let l=Eu(u,t,e,s);return!!l&&(r&&r(function(t,e,n,r,o){let i=ra.empty;for(let t=n.length-1;t>=0;t--)i=ra.from(n[t].type.create(n[t].attrs,i));t.step(new bu(e.start-(r?2:0),e.end,e.start,e.end,new la(i,0,0),n.length,!0));let s=0;for(let t=0;t<n.length;t++)n[t].type==o&&(s=t+1);let a=n.length-s,u=e.start+n.length-(r?2:0),l=e.parent;for(let n=e.startIndex,r=e.endIndex,o=!0;n<r;n++,o=!1)!o&&ku(t.doc,u,a)&&(t.split(u,a),u+=2*a),u+=l.child(n).nodeSize;return t}(n.tr,s,l,a,t).scrollIntoView()),!0)}}function yp(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!i&&(!n||(r.node(i.depth-1).type==t?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new bu(i-1,s,i,s,new la(ra.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ka(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));return e(o.lift(r,wu(r)).scrollIntoView()),!0}(e,n,t,i):function(t,e,n){let r=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,i=n.startIndex;e>i;e--)t-=o.child(e).nodeSize,r.delete(t-1,t+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,u=n.endIndex==o.childCount,l=i.node(-1),c=i.index(-1);if(!l.canReplace(c+(a?0:1),c+1,s.content.append(u?ra.empty:ra.from(o))))return!1;let p=i.pos,f=p+s.nodeSize;return r.step(new bu(p-(a?1:0),f+(u?1:0),p+1,f-1,new la((a?ra.empty:ra.from(o.copy(ra.empty))).append(u?ra.empty:ra.from(o.copy(ra.empty))),a?0:1,u?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,i)))}}function bp(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;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 i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class _p{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!t,u=t||o.tr,l={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(u,e),o=n(...t)(r);return s.push(o),l}]))),run:()=>(a||!e||u.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(u),s.every((t=>!0===t)))};return l}createCan(t){const{rawCommands:e,state:n}=this,r=t||n.tr,o=this.buildProps(r,false),i=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...o,dispatch:void 0})])));return{...i,chain:()=>this.createChain(r,false)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&t.setStoredMarks(o.storedMarks);const s={tr:t,editor:r,view:i,state:bp({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}function Dp(t,e,n){if(void 0===t.config[e]&&t.parent)return Dp(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?Dp(t.parent,e,n):null})}return t.config[e]}function wp(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function Ep(t){const e=[],{nodeExtensions:n,markExtensions:r}=wp(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=Dp(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:{...i,...r}})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Dp(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};r.isRequired&&void 0===r.default&&delete o.default,e.push({type:t.name,name:n,attribute:o})}))})),e}function Cp(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function kp(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]="class"===t?[n[t],e].join(" "):"style"===t?[n[t],e].join("; "):e:n[t]=e})),n}),{})}function Ap(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>kp(t,e)),{})}function xp(t,e,...n){return function(t){return"function"==typeof t}(t)?e?t.bind(e)(...n):t(...n):t}function Op(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:{...t,[e.name]:r}}),{});return{...r,...o}}}}function Sp(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function Np(t){var e;const n=Ep(t),{nodeExtensions:r,markExtensions:o}=wp(t),i=null===(e=r.find((t=>Dp(t,"topNode"))))||void 0===e?void 0:e.name,s=Object.fromEntries(r.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage},i=Sp({...t.reduce(((t,n)=>{const r=Dp(n,"extendNodeSchema",o);return{...t,...r?r(e):{}}}),{}),content:xp(Dp(e,"content",o)),marks:xp(Dp(e,"marks",o)),group:xp(Dp(e,"group",o)),inline:xp(Dp(e,"inline",o)),atom:xp(Dp(e,"atom",o)),selectable:xp(Dp(e,"selectable",o)),draggable:xp(Dp(e,"draggable",o)),code:xp(Dp(e,"code",o)),defining:xp(Dp(e,"defining",o)),isolating:xp(Dp(e,"isolating",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),s=xp(Dp(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>Op(t,r))));const a=Dp(e,"renderHTML",o);a&&(i.toDOM=t=>a({node:t,HTMLAttributes:Ap(t,r)}));const u=Dp(e,"renderText",o);return u&&(i.toText=u),[e.name,i]}))),a=Object.fromEntries(o.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage},i=Sp({...t.reduce(((t,n)=>{const r=Dp(n,"extendMarkSchema",o);return{...t,...r?r(e):{}}}),{}),inclusive:xp(Dp(e,"inclusive",o)),excludes:xp(Dp(e,"excludes",o)),group:xp(Dp(e,"group",o)),spanning:xp(Dp(e,"spanning",o)),code:xp(Dp(e,"code",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),s=xp(Dp(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>Op(t,r))));const a=Dp(e,"renderHTML",o);return a&&(i.toDOM=t=>a({mark:t,HTMLAttributes:Ap(t,r)})),[e.name,i]})));return new Ua({topNode:i,nodes:s,marks:a})}function Tp(t,e){return e.nodes[t]||e.marks[t]||null}function Fp(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function Mp(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class Ip{constructor(t){this.find=t.find,this.handler=t.handler}}function $p(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:u}=n;if(u.composing)return!1;const l=u.state.doc.resolve(r);if(l.parent.type.spec.code||(null===(e=l.nodeBefore||l.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let c=!1;const p=((t,e=500)=>{let n="";return t.parent.nodesBetween(Math.max(0,t.parentOffset-e),t.parentOffset,((e,r,o,i)=>{var s,a,u;n+=(null===(a=(s=e.type.spec).toText)||void 0===a?void 0:a.call(s,{node:e,pos:r,parent:o,index:i}))||(null===(u=t.nodeBefore)||void 0===u?void 0:u.text)||"%leaf%"})),n})(l)+i;return s.forEach((t=>{if(c)return;const e=((t,e)=>{if(Mp(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(p,t.find);if(!e)return;const s=u.state.tr,l=bp({state:u.state,transaction:s}),f={from:r-(e[0].length-i.length),to:o},{commands:h,chain:d,can:m}=new _p({editor:n,state:l});null!==t.handler({state:l,range:f,match:e,commands:h,chain:d,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),u.dispatch(s),c=!0)})),c}function Bp(t){const{editor:e,rules:n}=t,r=new nl({state:{init:()=>null,apply(t,e){const n=t.getMeta(r);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(t,o,i,s)=>$p({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&$p({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:i}=t.state.selection;return!!i&&$p({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Rp{constructor(t){this.find=t.find,this.handler=t.handler}}function Lp(t){const{editor:e,state:n,from:r,to:o,rule:i}=t,{commands:s,chain:a,can:u}=new _p({editor:e,state:n}),l=[];n.doc.nodesBetween(r,o,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const c=Math.max(r,e),p=Math.min(o,e+t.content.size),f=((t,e)=>{if(Mp(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[];return n.push(e.text),n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.textBetween(c-e,p-e,void 0,""),i.find);f.forEach((t=>{if(void 0===t.index)return;const e=c+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:t,commands:s,chain:a,can:u});l.push(p)}))}));return l.every((t=>null!==t))}function Pp(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1;return n.map((t=>new nl({view(t){const e=e=>{var n;r=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:t=>(i=r===t.dom.parentElement,!1),paste:(t,e)=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],u="paste"===a.getMeta("uiEvent")&&!o,l="drop"===a.getMeta("uiEvent")&&!i;if(!u&&!l)return;const c=r.doc.content.findDiffStart(s.doc.content),p=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof c||!p||c===p.b)return;const f=s.tr,h=bp({state:s,transaction:f});return Lp({editor:e,state:h,from:Math.max(c-1,0),to:p.b-1,rule:t})&&f.steps.length?f:void 0}})))}class jp{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=jp.resolve(t),this.schema=Np(this.extensions),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Tp(t.name,this.schema)};if("mark"===t.type){(null===(e=xp(Dp(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const r=Dp(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=Dp(t,"onCreate",n);o&&this.editor.on("create",o);const i=Dp(t,"onUpdate",n);i&&this.editor.on("update",i);const s=Dp(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=Dp(t,"onTransaction",n);a&&this.editor.on("transaction",a);const u=Dp(t,"onFocus",n);u&&this.editor.on("focus",u);const l=Dp(t,"onBlur",n);l&&this.editor.on("blur",l);const c=Dp(t,"onDestroy",n);c&&this.editor.on("destroy",c)}))}static resolve(t){const e=jp.sort(jp.flatten(t)),n=function(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=Dp(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=Dp(t,"priority")||100,r=Dp(e,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=Dp(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Tp(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=jp.sort([...this.extensions].reverse()),n=[],r=[],o=e.map((e=>{const o={name:e.name,options:e.options,storage:e.storage,editor:t,type:Tp(e.name,this.schema)},i=[],s=Dp(e,"addKeyboardShortcuts",o);let a={};if("mark"===e.type&&e.config.exitable&&(a.ArrowRight=()=>mf.handleExit({editor:t,mark:e})),s){const e=Object.fromEntries(Object.entries(s()).map((([e,n])=>[e,()=>n({editor:t})])));a={...a,...e}}const u=new nl({props:{handleKeyDown:ap(a)}});i.push(u);const l=Dp(e,"addInputRules",o);Fp(e,t.options.enableInputRules)&&l&&n.push(...l());const c=Dp(e,"addPasteRules",o);Fp(e,t.options.enablePasteRules)&&c&&r.push(...c());const p=Dp(e,"addProseMirrorPlugins",o);if(p){const t=p();i.push(...t)}return i})).flat();return[Bp({editor:t,rules:n}),...Pp({editor:t,rules:r}),...o]}get attributes(){return Ep(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=wp(this.extensions);return Object.fromEntries(e.filter((t=>!!Dp(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:e.storage,editor:t,type:Cp(e.name,this.schema)},o=Dp(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const u=Ap(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:u,extension:e})}]})))}}function zp(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function Hp(t,e){const n={...t};return zp(t)&&zp(e)&&Object.keys(e).forEach((r=>{zp(e[r])?r in t?n[r]=Hp(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class Vp{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=xp(Dp(this,"addOptions",{name:this.name}))),this.storage=xp(Dp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Vp(t)}configure(t={}){const e=this.extend();return e.options=Hp(this.options,t),e.storage=xp(Dp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Vp(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=xp(Dp(e,"addOptions",{name:e.name})),e.storage=xp(Dp(e,"addStorage",{name:e.name,options:e.options})),e}}Vp.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new nl({key:new il("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map((t=>t.$from.pos))),a=Math.max(...i.map((t=>t.$to.pos))),u=function(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}(n);return function(t,e,n){const{from:r,to:o}=e,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",u=!0;return t.nodesBetween(r,o,((t,n,l,c)=>{var p;const f=null==s?void 0:s[t.type.name];f?(t.isBlock&&!u&&(a+=i,u=!0),l&&(a+=f({node:t,pos:n,parent:l,index:c,range:e}))):t.isText?(a+=null===(p=null==t?void 0:t.text)||void 0===p?void 0:p.slice(Math.max(r,n)-n,o-n),u=!1):t.isBlock&&!u&&(a+=i,u=!0)})),a}(r,{from:s,to:a},{textSerializers:u})}}})]}});function Wp(t,e,n={strict:!0}){const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:Mp(e[r])?e[r].test(t[r]):e[r]===t[r]))}function Up(t,e,n={}){return t.find((t=>t.type===e&&Wp(t.attrs,n)))}function qp(t,e,n={}){return!!Up(t,e,n)}function Kp(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&0!==r.offset&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=Up([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,u=s+r.node.nodeSize;for(Up([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&qp([...t.parent.child(a).marks],e,n);)u+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:u}}function Jp(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Gp(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Yp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Xp(t){const e=`<body>${t}</body>`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Qp(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)?ra.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Qp("",e,n)}if("string"==typeof t){const r=Ka.fromSchema(e);return n.slice?r.parseSlice(Xp(t),n.parseOptions).content:r.parse(Xp(t),n.parseOptions)}return Qp("",e,n)}function Zp(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function tf(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?Cp(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:i})}));const u=o-r,l=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>Wp(t.node.attrs,n,{strict:!1})));if(i)return!!l.length;return l.reduce(((t,e)=>t+e.to-e.from),0)>=u}function ef(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function nf(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}function rf(t,e){const n=Jp(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function of(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function sf(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}function af(t){return e=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(e.$from,t)}function uf(t,e){const{nodeExtensions:n}=wp(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=xp(Dp(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}const lf=(t,e)=>{const n=af((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Au(t.doc,n.pos)||(t.join(n.pos),!0)},cf=(t,e)=>{const n=af((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Au(t.doc,r)||(t.join(r),!0)};var pf=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{t.doc.nodesBetween(n.pos,r.pos,((t,n)=>{if(t.type.isText)return;const{doc:r,mapping:o}=e,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+t.nodeSize)),a=i.blockRange(s);if(!a)return;const u=wu(a);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(a.start,t)}(u||0===u)&&e.lift(a,u)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>((t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Gu||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=pp(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(Uu.create(s.doc,n+1)),e(s.scrollIntoView())}return!0})(t,e),deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=Cp(t,n.schema),i=e.selection.$anchor;for(let t=i.depth;t>0;t-=1){if(i.node(t).type===o){if(r){const n=i.before(t),r=i.after(t);e.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},deleteSelection:()=>({state:t,dispatch:e})=>((t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0))(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=pp(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(zu.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0})(t,e),extendMarkRange:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Jp(t,r.schema),{doc:s,selection:a}=n,{$from:u,from:l,to:c}=a;if(o){const t=Kp(u,i,e);if(t&&t.from<=l&&t.to>=c){const e=Uu.create(s,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{Yp()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===t||!1===t)return!0;if(i&&null===t&&!(n.state.selection instanceof Uu))return s(),!0;const a=function(t,e=null){if(!e)return null;const n=zu.atStart(t),r=zu.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?Uu.create(t,Gp(0,o,i),Gp(t.content.size,o,i)):Uu.create(t,Gp(e,o,i),Gp(e,o,i))}(o.doc,t)||n.state.selection,u=n.state.selection.eq(a);return i&&(u||o.setSelection(a),u&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,r)=>e(t,{...n,index:r}))),insertContent:(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Qp(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:t,u=!0,l=!0;if((o.toString().startsWith("<")?o:[o]).forEach((t=>{t.check(),u=!!u&&(t.isText&&0===t.marks.length),l=!!l&&t.isBlock})),s===a&&l){const{parent:t}=r.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}u?r.insertText(e,s,a):r.replaceWith(s,a,o),n.updateSelection&&function(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof yu||o instanceof bu))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(zu.near(t.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;let o=lp(r);if(!o){let n=r.blockRange(),o=n&&wu(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&fp(t,o,e))return!0;if(0==r.parent.content.size&&(up(i,"end")||Ku.isSelectable(i))){let n=xu(t.doc,r.before(),r.after(),la.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(up(i,"end")?zu.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Ku.create(r.doc,o.pos-i.nodeSize)),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))})(t,e),joinForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size))return!1;let o=cp(r);if(!o)return!1;let i=o.nodeAfter;if(fp(t,o,e))return!0;if(0==r.parent.content.size&&(up(i,"start")||Ku.isSelectable(i))){let n=xu(t.doc,r.before(),r.after(),la.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(up(i,"start")?zu.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Ku.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t<e.length-1;t+=1){const s=e[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Yp()||Zp()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(t).split(/-(?!$)/),s=i.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==u||u.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:r})=>!!tf(n,Cp(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&wu(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:t,dispatch:e})=>((t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ku(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&wu(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)})(t,e),liftListItem:t=>({state:e,dispatch:n})=>yp(Cp(t,e.schema))(e,n),newlineInCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))})(t,e),resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ef("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=Cp(t,r.schema)),"mark"===a&&(s=Jp(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,nf(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(nf(o.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=lp(r)}let s=i&&i.nodeBefore;return!(!s||!Ku.isSelectable(s)||(e&&e(t.tr.setSelection(Ku.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))})(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=cp(r)}let s=i&&i.nodeAfter;return!(!s||!Ku.isSelectable(s)||(e&&e(t.tr.setSelection(Ku.create(t.doc,i.pos)).scrollIntoView()),0))})(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(Ku.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>mp(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>dp(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=function(t,e,n={}){return Qp(t,e,{slice:!1,parseOptions:n})}(t,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,u=Jp(t,r.schema);if(o)if(s){const t=rf(r,u);n.addStoredMark(u.create({...t,...e}))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i),l=t.marks.find((t=>t.type===u));l?t.marks.forEach((t=>{u===t.type&&n.addMark(s,a,u.create({...t.attrs,...e}))})):n.addMark(s,a,u.create(e))}))}));return!0},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=Cp(t,n.schema);return i.isTextblock?o().command((({commands:t})=>!!gp(i,e)(n)||t.clearNodes())).command((({state:t})=>gp(i,e)(t,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=Gp(t,0,n.content.size),o=Ku.create(n,r);e.setSelection(o)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=Uu.atStart(n).from,s=Uu.atEnd(n).to,a=Gp(r,i,s),u=Gp(o,i,s),l=Uu.create(n,a,u);e.setSelection(l)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=Cp(t,e.schema);return(o=r,function(t,e){let{$from:n,$to:r}=t.selection,i=n.blockRange(r,(t=>t.childCount>0&&t.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,u=a.child(s-1);if(u.type!=o)return!1;if(e){let n=u.lastChild&&u.lastChild.type==a.type,r=ra.from(n?o.create():null),s=new la(ra.from(o.create(null,ra.from(a.type.create(null,r)))),n?3:1,0),l=i.start,c=i.end;e(t.tr.step(new bu(l-(n?3:1),c,l,c,s,1,!0)).scrollIntoView())}return!0})(e,n);var o},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:u}=i,l=of(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Ku&&i.node.isBlock)return!(!a.parentOffset||!ku(s,a.pos))&&(r&&(t&&sf(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=u.parentOffset===u.parent.content.size;i instanceof Uu&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let c=r&&s?[{type:s,attrs:l}]:void 0,p=ku(e.doc,e.mapping.map(a.pos),1,c);if(c||p||!ku(e.doc,e.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(p=!0,c=s?[{type:s,attrs:l}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,c),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const t=e.mapping.map(a.before()),n=e.doc.resolve(t);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&e.setNodeMarkup(e.mapping.map(a.before()),s)}t&&sf(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=Cp(t,n.schema),{$from:a,$to:u}=n.selection,l=n.selection.node;if(l&&l.isBlock||a.depth<2||!a.sameParent(u))return!1;const c=a.node(-1);if(c.type!==s)return!1;const p=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let t=ra.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let e=a.depth-n;e>=a.depth-3;e-=1)t=ra.from(a.node(e).copy(t));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=of(p,a.node().type.name,a.node().attrs),u=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;t=t.append(ra.from(s.createAndFill(null,u)||void 0));const l=a.before(a.depth-(n-1));e.replace(l,a.after(-r),new la(t,4-n,0));let c=-1;e.doc.nodesBetween(l,e.doc.content.size,((t,e)=>{if(c>-1)return!1;t.isTextblock&&0===t.content.size&&(c=e+1)})),c>-1&&e.setSelection(Uu.near(e.doc.resolve(c))),e.scrollIntoView()}return!0}const f=u.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=of(p,c.type.name,c.attrs),d=of(p,a.node().type.name,a.node().attrs);e.delete(a.pos,u.pos);const m=f?[{type:s,attrs:h},{type:f,attrs:d}]:[{type:s,attrs:h}];return!!ku(e.doc,a.pos,2)&&(r&&e.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(t,e)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:u})=>{const{extensions:l}=n.extensionManager,c=Cp(t,o.schema),p=Cp(e,o.schema),{selection:f}=o,{$from:h,$to:d}=f,m=h.blockRange(d);if(!m)return!1;const g=af((t=>uf(t.type.name,l)))(f);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===c)return a.liftListItem(p);if(uf(g.node.type.name,l)&&c.validContent(g.node.content)&&i)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>lf(r,c))).command((()=>cf(r,c))).run()}return s().command((()=>!!u().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>lf(r,c))).command((()=>cf(r,c))).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Jp(t,r.schema),a=function(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Jp(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>Wp(t.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:e,$to:n})=>{const r=e.pos,o=n.pos;t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);s+=i-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:i}))))}))})),0===s)return!1;const u=a.filter((t=>!i||i.name===t.mark.type.name)).filter((t=>Wp(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),l=a.filter((t=>!i||t.mark.type!==i&&t.mark.type.excludes(i))).reduce(((t,e)=>t+e.to-e.from),0);return(u>0?u+l:u)>=s}(r,s,e);return a?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=Cp(t,r.schema),s=Cp(e,r.schema);return tf(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=Cp(t,n.schema);return tf(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){const n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,u=Jp(t,r.schema),{$from:l,empty:c,ranges:p}=a;if(!o)return!0;if(c&&s){let{from:t,to:e}=a;const r=null===(i=l.marks().find((t=>t.type===u)))||void 0===i?void 0:i.attrs,o=Kp(l,u,r);o&&(t=o.from,e=o.to),n.removeMark(t,e,u)}else p.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,u)}));return n.removeStoredMark(u),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ef("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=Cp(t,r.schema)),"mark"===a&&(s=Jp(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const u=Math.max(r,o),l=Math.min(r+t.nodeSize,a);n.addMark(u,l,s.create({...i.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Eu(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Cp(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>vp(Cp(t,n.schema),e)(n,r)});function ff(t,e){const n=ef("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=Cp(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,(t=>{i.push(t)}));const s=i.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}(t,e):"mark"===n?rf(t,e):{}}function hf(t){const e=function(t,e=JSON.stringify){const n={};return t.filter((t=>{const r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(t);return 1===e.length?e:e.filter(((t,n)=>{const r=e.filter(((t,e)=>e!==n));return!r.some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}))}function df(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach((e=>{const o=Kp(n.resolve(t-1),e.type);o&&r.push({mark:e,...o})})):n.nodesBetween(t,e,((t,e)=>{r.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),r}Vp.create({name:"commands",addCommands:()=>({...pf})}),Vp.create({name:"editable",addProseMirrorPlugins(){return[new nl({key:new il("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Vp.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new nl({key:new il("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Vp.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:r}=e,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,u=zu.atStart(r).from===s;return!(!(o&&u&&a.type.isTextblock)||a.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"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 Yp()||Zp()?o:r},addProseMirrorPlugins(){return[new nl({key:new il("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some((t=>t.docChanged))&&!e.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=e.selection,s=zu.atStart(e.doc).from,a=zu.atEnd(e.doc).to,u=o===s&&i===a,l=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!u||!l)return;const c=n.tr,p=bp({state:n,transaction:c}),{commands:f}=new _p({editor:this.editor,state:p});return f.clearNodes(),c.steps.length?c:void 0}})]}}),Vp.create({name:"tabindex",addProseMirrorPlugins(){return[new nl({key:new il("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class mf{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=xp(Dp(this,"addOptions",{name:this.name}))),this.storage=xp(Dp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new mf(t)}configure(t={}){const e=this.extend();return e.options=Hp(this.options,t),e.storage=xp(Dp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new mf(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=xp(Dp(e,"addOptions",{name:e.name})),e.storage=xp(Dp(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const i=o.find((t=>(null==t?void 0:t.type.name)===e.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),t.view.dispatch(n),!0}return!1}}class gf{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=xp(Dp(this,"addOptions",{name:this.name}))),this.storage=xp(Dp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new gf(t)}configure(t={}){const e=this.extend();return e.options=Hp(this.options,t),e.storage=xp(Dp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new gf(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=xp(Dp(e,"addOptions",{name:e.name})),e.storage=xp(Dp(e,"addStorage",{name:e.name,options:e.options})),e}}function vf(t){return new Rp({find:t.find,handler:({state:e,range:n,match:r})=>{const o=xp(t.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];let u=n.to;if(s){const r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(df(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>l)).length)return null;c<n.to&&i.delete(c,n.to),l>n.from&&i.delete(n.from+r,l),u=n.from+r+s.length,i.addMark(n.from+r,u,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function yf(t){return(...e)=>n=>t(n,...e)}function bf(t){const e=Object.entries(t).reduce(((t,[e,n])=>{if(!n)return t;return`${t}--zw-${e.replace(/_/g,"-")}:${n};`}),"");return e?{style:e}:null}function _f(t){const e=bf(t);return["span",e?{...e,class:"zw-style"}:{},0]}function Df(t,...e){return({editor:n})=>(n.commands[t](...e),!0)}var wf=Object.defineProperty,Ef=(t,e,n)=>(((t,e,n)=>{e in t?wf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);function Cf(t,e){let n=!1;return function(){n||(t.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),e))}}function kf(t){return t>1||t<-1?t/100:t}const Af=t=>Number.parseFloat(t.toFixed(5).substr(0,5));function xf(t){const e=function(t,e=1){const n=[];let r=0;for(;r<t.length;)n.push(t.substr(r,e)),r+=e;return n}(t.slice(1),2).map((t=>parseInt(t,16))),n=void 0!==e[3]?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:n}}function Of(t){const{h:e,s:n,v:r,a:o}=t,i=t=>{const o=(t+e/60)%6;return r-r*n*Math.max(Math.min(o,4-o,1),0)},s=[i(5),i(3),i(1)].map((t=>Math.round(255*t)));return{r:s[0],g:s[1],b:s[2],a:o}}function Sf(t){if(!t)return{h:0,s:1,v:1,a:1};const e=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(e,n,r),i=Math.min(e,n,r);let s=0;o!==i&&(o===e?s=60*(0+(n-r)/(o-i)):o===n?s=60*(2+(r-e)/(o-i)):o===r&&(s=60*(4+(e-n)/(o-i)))),s<0&&(s+=360);const a=[s,0===o?0:(o-i)/o,o],u=Af(a[1]),l=Af(a[2]);return{h:Math.floor(a[0]),s:u,v:l,a:t.a}}function Nf(t){const e=Sf(xf(t));const n=function(t){const{h:e,s:n,v:r,a:o}=t,i=r-r*n/2,s=1===i||0===i?0:(r-i)/Math.min(i,1-i);return{h:e,s:Af(s),l:Af(i),a:o}}(e),r=xf(t);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:n,hsva:e,hue:e.h,rgba:r}}function Tf(t,e,n="0"){return t+n.repeat(Math.max(0,e-t.length))}function Ff(t){return Nf(function(t){let e=t;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),3!==e.length&&4!==e.length||(e=e.split("").map((t=>t+t)).join("")),e=6===e.length?Tf(e,8,"F"):Tf(Tf(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}(t))}const Mf=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"}),If="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",$f=`[\\s|\\(]+(${If})[,|\\s]+(${If})[,|\\s]+(${If})\\s*\\)?`,Bf=`[\\s|\\(]+(${If})[,|\\s]+(${If})[,|\\s]+(${If})[,|\\s]+(${If})\\s*\\)?`,Rf=Object.freeze({CSS_UNIT:new RegExp(If),RGB:new RegExp(`rgb${$f}`),RGBA:new RegExp(`rgba${Bf}`),HSL:new RegExp(`hsl${$f}`),HSLA:new RegExp(`hsla${Bf}`),HSV:new RegExp(`hsv${$f}`),HSVA:new RegExp(`hsva${Bf}`),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})$/}),Lf=Object.freeze({WINDOW:Symbol("window")});Lf.WINDOW;Lf.WINDOW,Lf.WINDOW,Cf(((t,e)=>{t(e)}),20);const Pf=class{static create(t){if(!t)return Pf.fromBlack();let e=t.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(Mf[e])e=Mf[e];else if(e===this.TRANSPARENT)return Pf.fromTransparent();const n=Rf.RGB.exec(e)||Rf.RGBA.exec(e);if(n){const t=void 0===n[4]?1:n[4];return Pf.fromRgba({r:Number.parseInt(n[1]),g:Number.parseInt(n[2]),b:Number.parseInt(n[3]),a:Number.parseFloat(t)})}const r=Rf.HSL.exec(e)||Rf.HSLA.exec(e);if(r){const t=void 0===r[4]?1:r[4];return Pf.fromHsla({h:Number.parseInt(r[1]),s:Number.parseFloat(r[2]),l:Number.parseFloat(r[3]),a:Number.parseFloat(t)})}const o=Rf.HSV.exec(e)||Rf.HSVA.exec(e);if(o){const t=void 0===o[4]?1:o[4];return Pf.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(t)})}return Rf.HEX8.exec(e)||Rf.HEX6.exec(e)||Rf.HEX4.exec(e)||Rf.HEX3.exec(e)?Pf.fromHex(e):Pf.fromBlack()}static fromHex(t){const{rgba:e}=Ff(t);return new Pf(e)}static fromRgba({r:t,g:e,b:n,a:r}){const o=kf(r);return new Pf({r:t,g:e,b:n,a:o})}static fromHsla({h:t,s:e,l:n,a:r}){const o=kf(e),i=kf(n),s=kf(r);return Pf.fromHsva(function(t){const{h:e,s:n,l:r,a:o}=t,i=r+n*Math.min(r,1-r);return{h:e,s:Af(0===i?0:2-2*r/i),v:Af(i),a:o}}({h:t,s:o,l:i,a:s}))}static fromHsva({h:t,s:e,v:n,a:r}){const o=Of({h:t,s:kf(e),v:kf(n),a:kf(r)});return new Pf(o)}static fromTransparent(){return new Pf({r:0,g:0,b:0,a:0})}static fromWhite(){return new Pf({r:255,g:255,b:255,a:1})}static fromBlack(){return new Pf({r:0,g:0,b:0,a:1})}static isTransparent(t){return Pf.create(t).isTransparent()}static isDark(t){return Pf.create(t).isDark()}constructor(t){this._rgba=t,this._hsva=this._calcHsva(),this._alpha=t.a}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}get alpha(){return this._alpha}setAlpha(t){return this._alpha=t,this}toHexString(){return function(t){const e=t=>{const e=Math.round(t).toString(16);return("00".substr(0,2-e.length)+e).toUpperCase()};return`#${[e(t.r),e(t.g),e(t.b)].join("")}`}({r:this.r,g:this.g,b:this.b,a:this.alpha})}toRgbaString(){const t=`${Math.floor(100*this.alpha)}%`;return`rgba(${[this.r,this.g,this.b,t].join(", ")})`}get rgba(){return this._rgba}updateRgb(t){this._rgba={...this._rgba,...t},this._hsva=this._calcHsva()}get hsva(){return this._hsva}updateHsv(t){this._hsva={...this._hsva,...t},this._rgba=this._calcRgba()}isTransparent(){return 0===this.alpha}isDark(){return this.getBrightness()<128}getBrightness(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3}_calcHsva(){return Sf(this.rgba)}_calcRgba(){return Of(this.hsva)}};let jf=Pf;function zf(t){const e=jf.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}function Hf(t,e){if(!t.includes("em"))return parseInt(t);const n=window.getComputedStyle(e).fontSize,r=parseFloat(t)*parseFloat(n);return Math.round(r)}function Vf(t,e,n){if(!t.includes("px"))return t;const r=function(t,e){return(t.firstElementChild||t).style.fontSize||window.getComputedStyle(e).fontSize}(e,n),o=Hf(r,n);return(parseInt(t)/o).toFixed(2)}Ef(jf,"TRANSPARENT","transparent"),Ef(jf,"NONE","none");const Wf=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),Uf=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),qf=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),Kf=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Jf=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]}}),Gf=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 inlineMarks(){return[this.TEXT_DECORATION,this.LINK]},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]}}),Yf=Object.freeze({BLANK:"_blank",SELF:"_self"}),Xf=Object.freeze({URL:"url",BLOCK:"block"}),Qf={start:qf.LEFT,end:qf.RIGHT};function Zf({path:t,pos:e},n,r){const o=t.indexOf(n);return e+r*t.slice(o).reverse().filter((t=>"object"==typeof t)).length}function th(t,e,n,r){return{from:Math.max(r,t.pos),to:Math.min(r+n.nodeSize,e.pos)}}const eh=mf.create({name:Gf.FONT_FAMILY,group:"settings",addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:yf((({commands:t},e)=>{t.applyMark(this.name,{value:e});const n=t.findFontByName(e);let r=Ye(t.getFontWeight());n.isWeightSupported(r)||(r=n.findClosestWeight(r),t.applyFontWeight(r)),n.isItalicSupported(r)||t.removeItalic()})),getFont:yf((({commands:t})=>{const e=t.getFontFamily();return Ze((()=>{const n=Ye(e)||Ye(this.options.defaultPreset).common.font_family;return t.findFontByName(n)}))})),findFontByName:yf(((t,e)=>this.options.fonts.find((t=>t.name===e)))),getFontFamily:yf((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontFamily()))),getDefaultFontFamily:yf((({commands:t})=>{const e=t.getPreset();return Ze((()=>Ye(e).common.font_family))}))}},parseHTML(){const t=t=>{const e=t.replace(/"/g,"");return{value:this.options.fonts.some((t=>t.name===e))?e:Ye(this.options.defaultPreset).common.font_family}};return[{style:"--zw-font-family",getAttrs:t},{style:"font-family",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>_f({font_family:t.value?`"${t.value}"`:null})});class nh{#t=new DOMParser;types=window;parse(t){return this.#t.parseFromString(t,"text/html")}}class rh{content;constructor({content:t}){this.content=t}normalize(){throw new Error("Implement abstract method")}}var oh=new WeakMap,ih=new WeakMap,sh=new WeakMap,ah=new WeakSet,uh=new WeakSet,lh=new WeakSet,ch=new WeakSet,ph=new WeakSet,fh=new WeakSet,hh=new WeakSet,dh=new WeakSet,mh=new WeakSet,gh=new WeakSet,vh=new WeakSet,yh=new WeakSet,bh=new WeakSet,_h=new WeakSet;class Dh extends rh{constructor({content:t,parser:r}){super({content:t}),e(this,_h),e(this,bh),e(this,yh),e(this,vh),e(this,gh),e(this,mh),e(this,dh),e(this,hh),e(this,fh),e(this,ph),e(this,ch),e(this,lh),e(this,uh),e(this,ah),n(this,sh,{get:Eh,set:void 0}),n(this,ih,{get:wh,set:void 0}),n(this,oh,{writable:!0,value:void 0}),a(this,oh,r),this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=s(this,oh).parse(this.content.replace(/(\r)?\n/g,"")),i(this,ah,Ch).call(this),i(this,lh,Ah).call(this,i(this,gh,Mh),(t=>"BR"===t.tagName)),i(this,lh,Ah).call(this,i(this,ph,Oh),i(this,hh,Nh)),i(this,lh,Ah).call(this,i(this,fh,Sh),(t=>"LI"===t.tagName)),i(this,vh,Ih).call(this)}get normalizedHTML(){return this.dom.body.innerHTML}}function wh(){return s(this,oh).types.NodeFilter}function Eh(){return s(this,oh).types.Node}function Ch(){const t=i(this,uh,kh).call(this,s(this,ih).SHOW_COMMENT);i(this,ch,xh).call(this,t,(t=>t.remove()))}function kh(t,e){return this.dom.createNodeIterator(this.dom.body,t,e)}function Ah(t,e=(()=>!0)){const n=t=>"BODY"!==t.tagName&&e.call(this,t),r=i(this,uh,kh).call(this,s(this,ih).SHOW_ELEMENT,{acceptNode:t=>n(t)?s(this,ih).FILTER_ACCEPT:s(this,ih).FILTER_REJECT});i(this,ch,xh).call(this,r,t)}function xh(t,e){let n=t.nextNode();for(;n;)e.call(this,n),n=t.nextNode()}function Oh(t){t.innerHTML.trim()||t.remove()}function Sh(t){const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes);let r,o;const s=n=>{i(this,dh,Th).call(this,n,t,Dh.BLOCK_STYLES),e.append(n)};i(this,dh,Th).call(this,t,t.parentElement,Dh.BLOCK_STYLES);for(const t of n){var a;if(i(this,hh,Nh).call(this,t))s(t),r=null,o=t;else if("BR"===t.tagName&&o&&"BR"!==(null===(a=o)||void 0===a?void 0:a.tagName))t.remove(),o=t;else if("BR"!==t.tagName)r||(r=this.dom.createElement("p"),s(r)),r.append(t),o=t;else{const e=this.dom.createElement("p");e.append(t),s(e),r=null,o=t}}t.append(e),i(this,mh,Fh).call(this,t,Dh.BLOCK_STYLES)}function Nh(t){return Dh.BLOCK_NODE_NAMES.includes(t.tagName)}function Th(t,e,n){for(const r of n){const n=e.style.getPropertyValue(r);n&&!t.style.getPropertyValue(r)&&t.style.setProperty(r,n)}}function Fh(t,e){for(const n of e)t.style.removeProperty(n);0===t.style.length&&t.removeAttribute("style")}function Mh({parentElement:t}){if(!i(this,hh,Nh).call(this,t))return;if(!t.textContent)return;const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes),r=t.cloneNode(!0);r.innerHTML="";let o=r.cloneNode();const s=n=>{i(this,dh,Th).call(this,n,t,Dh.BLOCK_STYLES),e.append(n)};for(const t of n)"BR"!==t.tagName?o.append(t):(s(o),o=r.cloneNode());e.append(o),t.replaceWith(e)}function Ih(){const t=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const e of t)i(this,yh,$h).call(this,e)}function $h(t){const e=i(this,bh,Bh).call(this,t);if(t.style.removeProperty("text-decoration-line"),t.style.removeProperty("text-decoration"),t.style.cssText||t.removeAttribute("style"),!e.none)for(const n of t.childNodes){const r=i(this,_h,Rh).call(this,t,n),o=i(this,bh,Bh).call(this,r),s={underline:o.underline||e.underline,line_through:o.line_through||e.line_through};r.style.removeProperty("text-decoration-line"),r.style.removeProperty("text-decoration"),r.style.textDecoration=Object.entries(s).filter((([,t])=>t)).map((([t])=>t.replace("_","-"))).join(" ")}}function Bh(t){const{textDecoration:e,textDecorationLine:n}=t.style,r=e||n||"";return{none:r.includes("none"),underline:r.includes("underline"),line_through:r.includes("line-through")}}function Rh(t,e){if(e.nodeType!==s(this,sh).TEXT_NODE)return e;const n=this.dom.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}o(Dh,"BLOCK_NODE_NAMES",["P","H1","H2","H3","H4"]),o(Dh,"BLOCK_STYLES",["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"]);var Lh,Ph,jh={exports:{}};
7
+ /**
8
+ * @license
9
+ * Lodash <https://lodash.com/>
10
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
11
+ * Released under MIT license <https://lodash.com/license>
12
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
13
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
14
+ */Lh=jh,Ph=jh.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",o=16,i=32,s=64,a=128,u=256,l=1/0,c=9007199254740991,p=NaN,f=4294967295,h=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",i],["partialRight",s],["rearg",u]],d="[object Arguments]",m="[object Array]",g="[object Boolean]",v="[object Date]",y="[object Error]",b="[object Function]",_="[object GeneratorFunction]",w="[object Map]",E="[object Number]",C="[object Object]",k="[object Promise]",A="[object RegExp]",x="[object Set]",O="[object String]",S="[object Symbol]",N="[object WeakMap]",T="[object ArrayBuffer]",F="[object DataView]",M="[object Float32Array]",I="[object Float64Array]",$="[object Int8Array]",B="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",P="[object Uint8ClampedArray]",j="[object Uint16Array]",z="[object Uint32Array]",H=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,K=RegExp(U.source),J=RegExp(q.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,Dt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",wt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",kt="\\ufe0e\\ufe0f",At="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",xt="['’]",Ot="[\\ud800-\\udfff]",St="["+At+"]",Nt="["+Dt+"]",Tt="\\d+",Ft="[\\u2700-\\u27bf]",Mt="["+Et+"]",It="[^\\ud800-\\udfff"+At+Tt+wt+Et+Ct+"]",$t="\\ud83c[\\udffb-\\udfff]",Bt="[^\\ud800-\\udfff]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Lt="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+Ct+"]",jt="(?:"+Mt+"|"+It+")",zt="(?:"+Pt+"|"+It+")",Ht="(?:['’](?:d|ll|m|re|s|t|ve))?",Vt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Nt+"|"+$t+")?",Ut="[\\ufe0e\\ufe0f]?",qt=Ut+Wt+"(?:\\u200d(?:"+[Bt,Rt,Lt].join("|")+")"+Ut+Wt+")*",Kt="(?:"+[Ft,Rt,Lt].join("|")+")"+qt,Jt="(?:"+[Bt+Nt+"?",Nt,Rt,Lt,Ot].join("|")+")",Gt=RegExp(xt,"g"),Yt=RegExp(Nt,"g"),Xt=RegExp($t+"(?="+$t+")|"+Jt+qt,"g"),Qt=RegExp([Pt+"?"+Mt+"+"+Ht+"(?="+[St,Pt,"$"].join("|")+")",zt+"+"+Vt+"(?="+[St,Pt+jt,"$"].join("|")+")",Pt+"?"+jt+"+"+Ht,Pt+"+"+Vt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tt,Kt].join("|"),"g"),Zt=RegExp("[\\u200d\\ud800-\\udfff"+Dt+kt+"]"),te=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ee=["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"],ne=-1,re={};re[M]=re[I]=re[$]=re[B]=re[R]=re[L]=re[P]=re[j]=re[z]=!0,re[d]=re[m]=re[T]=re[g]=re[F]=re[v]=re[y]=re[b]=re[w]=re[E]=re[C]=re[A]=re[x]=re[O]=re[N]=!1;var oe={};oe[d]=oe[m]=oe[T]=oe[F]=oe[g]=oe[v]=oe[M]=oe[I]=oe[$]=oe[B]=oe[R]=oe[w]=oe[E]=oe[C]=oe[A]=oe[x]=oe[O]=oe[S]=oe[L]=oe[P]=oe[j]=oe[z]=!0,oe[y]=oe[b]=oe[N]=!1;var ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ae=parseInt,ue="object"==typeof D&&D&&D.Object===Object&&D,le="object"==typeof self&&self&&self.Object===Object&&self,ce=ue||le||Function("return this")(),pe=Ph&&!Ph.nodeType&&Ph,fe=pe&&Lh&&!Lh.nodeType&&Lh,he=fe&&fe.exports===pe,de=he&&ue.process,me=function(){try{var t=fe&&fe.require&&fe.require("util").types;return t||de&&de.binding&&de.binding("util")}catch(t){}}(),ge=me&&me.isArrayBuffer,ve=me&&me.isDate,ye=me&&me.isMap,be=me&&me.isRegExp,_e=me&&me.isSet,De=me&&me.isTypedArray;function we(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(r,s,n(s),t)}return r}function Ce(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function ke(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function xe(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function Oe(t,e){return!(null==t||!t.length)&&Le(t,e,0)>-1}function Se(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Ne(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Te(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Fe(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function Me(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function Ie(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var $e=He("length");function Be(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function Re(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Le(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):Re(t,je,n)}function Pe(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function je(t){return t!=t}function ze(t,e){var n=null==t?0:t.length;return n?Ue(t,e)/n:p}function He(e){return function(n){return null==n?t:n[e]}}function Ve(e){return function(n){return null==e?t:e[n]}}function We(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function Ue(e,n){for(var r,o=-1,i=e.length;++o<i;){var s=n(e[o]);s!==t&&(r=r===t?s:r+s)}return r}function qe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ke(t){return t?t.slice(0,fn(t)+1).replace(rt,""):t}function Je(t){return function(e){return t(e)}}function Ge(t,e){return Ne(e,(function(e){return t[e]}))}function Ye(t,e){return t.has(e)}function Xe(t,e){for(var n=-1,r=t.length;++n<r&&Le(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Le(e,t[n],0)>-1;);return n}function Ze(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var tn=Ve({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),en=Ve({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(t){return"\\"+ie[t]}function rn(t){return Zt.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function an(t,e){for(var n=-1,o=t.length,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==r||(t[n]=r,s[i++]=n)}return s}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function cn(t){return rn(t)?function(t){for(var e=Xt.lastIndex=0;Xt.test(t);)++e;return e}(t):$e(t)}function pn(t){return rn(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.split("")}(t)}function fn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var hn=Ve({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),dn=function D(ot){var Dt=(ot=null==ot?ce:dn.defaults(ce.Object(),ot,dn.pick(ce,ee))).Array,wt=ot.Date,Et=ot.Error,Ct=ot.Function,kt=ot.Math,At=ot.Object,xt=ot.RegExp,Ot=ot.String,St=ot.TypeError,Nt=Dt.prototype,Tt=Ct.prototype,Ft=At.prototype,Mt=ot["__core-js_shared__"],It=Tt.toString,$t=Ft.hasOwnProperty,Bt=0,Rt=function(){var t=/[^.]+$/.exec(Mt&&Mt.keys&&Mt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Lt=Ft.toString,Pt=It.call(At),jt=ce._,zt=xt("^"+It.call($t).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ht=he?ot.Buffer:t,Vt=ot.Symbol,Wt=ot.Uint8Array,Ut=Ht?Ht.allocUnsafe:t,qt=sn(At.getPrototypeOf,At),Kt=At.create,Jt=Ft.propertyIsEnumerable,Xt=Nt.splice,Zt=Vt?Vt.isConcatSpreadable:t,ie=Vt?Vt.iterator:t,ue=Vt?Vt.toStringTag:t,le=function(){try{var t=hi(At,"defineProperty");return t({},"",{}),t}catch(t){}}(),pe=ot.clearTimeout!==ce.clearTimeout&&ot.clearTimeout,fe=wt&&wt.now!==ce.Date.now&&wt.now,de=ot.setTimeout!==ce.setTimeout&&ot.setTimeout,me=kt.ceil,$e=kt.floor,Ve=At.getOwnPropertySymbols,mn=Ht?Ht.isBuffer:t,gn=ot.isFinite,vn=Nt.join,yn=sn(At.keys,At),bn=kt.max,_n=kt.min,Dn=wt.now,wn=ot.parseInt,En=kt.random,Cn=Nt.reverse,kn=hi(ot,"DataView"),An=hi(ot,"Map"),xn=hi(ot,"Promise"),On=hi(ot,"Set"),Sn=hi(ot,"WeakMap"),Nn=hi(At,"create"),Tn=Sn&&new Sn,Fn={},Mn=ji(kn),In=ji(An),$n=ji(xn),Bn=ji(On),Rn=ji(Sn),Ln=Vt?Vt.prototype:t,Pn=Ln?Ln.valueOf:t,jn=Ln?Ln.toString:t;function zn(t){if(ra(t)&&!qs(t)&&!(t instanceof Un)){if(t instanceof Wn)return t;if($t.call(t,"__wrapped__"))return zi(t)}return new Wn(t)}var Hn=function(){function e(){}return function(n){if(!na(n))return{};if(Kt)return Kt(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Vn(){}function Wn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Kn(t);this.size=e.size}function Xn(t,e){var n=qs(t),r=!n&&Us(t),o=!n&&!r&&Ys(t),i=!n&&!r&&!o&&pa(t),s=n||r||o||i,a=s?qe(t.length,Ot):[],u=a.length;for(var l in t)!e&&!$t.call(t,l)||s&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||_i(l,u))||a.push(l);return a}function Qn(e){var n=e.length;return n?e[Gr(0,n-1)]:t}function Zn(t,e){return Ri(To(t),ur(e,0,t.length))}function tr(t){return Ri(To(t))}function er(e,n,r){(r!==t&&!Hs(e[n],r)||r===t&&!(n in e))&&sr(e,n,r)}function nr(e,n,r){var o=e[n];$t.call(e,n)&&Hs(o,r)&&(r!==t||n in e)||sr(e,n,r)}function rr(t,e){for(var n=t.length;n--;)if(Hs(t[n][0],e))return n;return-1}function or(t,e,n,r){return hr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function ir(t,e){return t&&Fo(e,Ma(e),t)}function sr(t,e,n){"__proto__"==e&&le?le(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ar(e,n){for(var r=-1,o=n.length,i=Dt(o),s=null==e;++r<o;)i[r]=s?t:Oa(e,n[r]);return i}function ur(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function lr(e,n,r,o,i,s){var a,u=1&n,l=2&n,c=4&n;if(r&&(a=i?r(e,o,i,s):r(e)),a!==t)return a;if(!na(e))return e;var p=qs(e);if(p){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&$t.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!u)return To(e,a)}else{var f=gi(e),h=f==b||f==_;if(Ys(e))return ko(e,u);if(f==C||f==d||h&&!i){if(a=l||h?{}:yi(e),!u)return l?function(t,e){return Fo(t,mi(t),e)}(e,function(t,e){return t&&Fo(e,Ia(e),t)}(a,e)):function(t,e){return Fo(t,di(t),e)}(e,ir(a,e))}else{if(!oe[f])return i?e:{};a=function(t,e,n){var r,o=t.constructor;switch(e){case T:return Ao(t);case g:case v:return new o(+t);case F:return function(t,e){var n=e?Ao(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case I:case $:case B:case R:case L:case P:case j:case z:return xo(t,n);case w:return new o;case E:case O:return new o(t);case A:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case x:return new o;case S:return r=t,Pn?At(Pn.call(r)):{}}}(e,f,u)}}s||(s=new Yn);var m=s.get(e);if(m)return m;s.set(e,a),ua(e)?e.forEach((function(t){a.add(lr(t,n,r,t,e,s))})):oa(e)&&e.forEach((function(t,o){a.set(o,lr(t,n,r,o,e,s))}));var y=p?t:(c?l?si:ii:l?Ia:Ma)(e);return Ce(y||e,(function(t,o){y&&(t=e[o=t]),nr(a,o,lr(t,n,r,o,e,s))})),a}function cr(e,n,r){var o=r.length;if(null==e)return!o;for(e=At(e);o--;){var i=r[o],s=n[i],a=e[i];if(a===t&&!(i in e)||!s(a))return!1}return!0}function pr(n,r,o){if("function"!=typeof n)throw new St(e);return Mi((function(){n.apply(t,o)}),r)}function fr(t,e,n,r){var o=-1,i=Oe,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;n&&(e=Ne(e,Je(n))),r?(i=Se,s=!1):e.length>=200&&(i=Ye,s=!1,e=new Gn(e));t:for(;++o<a;){var c=t[o],p=null==n?c:n(c);if(c=r||0!==c?c:0,s&&p==p){for(var f=l;f--;)if(e[f]===p)continue t;u.push(c)}else i(e,p,r)||u.push(c)}return u}zn.templateSettings={escape:G,evaluate:Y,interpolate:X,variable:"",imports:{_:zn}},zn.prototype=Vn.prototype,zn.prototype.constructor=zn,Wn.prototype=Hn(Vn.prototype),Wn.prototype.constructor=Wn,Un.prototype=Hn(Vn.prototype),Un.prototype.constructor=Un,qn.prototype.clear=function(){this.__data__=Nn?Nn(null):{},this.size=0},qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qn.prototype.get=function(e){var r=this.__data__;if(Nn){var o=r[e];return o===n?t:o}return $t.call(r,e)?r[e]:t},qn.prototype.has=function(e){var n=this.__data__;return Nn?n[e]!==t:$t.call(n,e)},qn.prototype.set=function(e,r){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Nn&&r===t?n:r,this},Kn.prototype.clear=function(){this.__data__=[],this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=rr(e,t);return!(n<0||(n==e.length-1?e.pop():Xt.call(e,n,1),--this.size,0))},Kn.prototype.get=function(e){var n=this.__data__,r=rr(n,e);return r<0?t:n[r][1]},Kn.prototype.has=function(t){return rr(this.__data__,t)>-1},Kn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(An||Kn),string:new qn}},Jn.prototype.delete=function(t){var e=pi(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return pi(this,t).get(t)},Jn.prototype.has=function(t){return pi(this,t).has(t)},Jn.prototype.set=function(t,e){var n=pi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(t){return this.__data__.set(t,n),this},Gn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Kn){var r=n.__data__;if(!An||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var hr=$o(Dr),dr=$o(wr,!0);function mr(t,e){var n=!0;return hr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function gr(e,n,r){for(var o=-1,i=e.length;++o<i;){var s=e[o],a=n(s);if(null!=a&&(u===t?a==a&&!ca(a):r(a,u)))var u=a,l=s}return l}function vr(t,e){var n=[];return hr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function yr(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=bi),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?yr(a,e-1,n,r,o):Te(o,a):r||(o[o.length]=a)}return o}var br=Bo(),_r=Bo(!0);function Dr(t,e){return t&&br(t,e,Ma)}function wr(t,e){return t&&_r(t,e,Ma)}function Er(t,e){return xe(e,(function(e){return Zs(t[e])}))}function Cr(e,n){for(var r=0,o=(n=Do(n,e)).length;null!=e&&r<o;)e=e[Pi(n[r++])];return r&&r==o?e:t}function kr(t,e,n){var r=e(t);return qs(t)?r:Te(r,n(t))}function Ar(e){return null==e?e===t?"[object Undefined]":"[object Null]":ue&&ue in At(e)?function(e){var n=$t.call(e,ue),r=e[ue];try{e[ue]=t;var o=!0}catch(t){}var i=Lt.call(e);return o&&(n?e[ue]=r:delete e[ue]),i}(e):function(t){return Lt.call(t)}(e)}function xr(t,e){return t>e}function Or(t,e){return null!=t&&$t.call(t,e)}function Sr(t,e){return null!=t&&e in At(t)}function Nr(e,n,r){for(var o=r?Se:Oe,i=e[0].length,s=e.length,a=s,u=Dt(s),l=1/0,c=[];a--;){var p=e[a];a&&n&&(p=Ne(p,Je(n))),l=_n(p.length,l),u[a]=!r&&(n||i>=120&&p.length>=120)?new Gn(a&&p):t}p=e[0];var f=-1,h=u[0];t:for(;++f<i&&c.length<l;){var d=p[f],m=n?n(d):d;if(d=r||0!==d?d:0,!(h?Ye(h,m):o(c,m,r))){for(a=s;--a;){var g=u[a];if(!(g?Ye(g,m):o(e[a],m,r)))continue t}h&&h.push(m),c.push(d)}}return c}function Tr(e,n,r){var o=null==(e=Si(e,n=Do(n,e)))?e:e[Pi(Qi(n))];return null==o?t:we(o,e,r)}function Fr(t){return ra(t)&&Ar(t)==d}function Mr(e,n,r,o,i){return e===n||(null==e||null==n||!ra(e)&&!ra(n)?e!=e&&n!=n:function(e,n,r,o,i,s){var a=qs(e),u=qs(n),l=a?m:gi(e),c=u?m:gi(n),p=(l=l==d?C:l)==C,f=(c=c==d?C:c)==C,h=l==c;if(h&&Ys(e)){if(!Ys(n))return!1;a=!0,p=!1}if(h&&!p)return s||(s=new Yn),a||pa(e)?ri(e,n,r,o,i,s):function(t,e,n,r,o,i,s){switch(n){case F:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case T:return!(t.byteLength!=e.byteLength||!i(new Wt(t),new Wt(e)));case g:case v:case E:return Hs(+t,+e);case y:return t.name==e.name&&t.message==e.message;case A:case O:return t==e+"";case w:var a=on;case x:var u=1&r;if(a||(a=un),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;r|=2,s.set(t,e);var c=ri(a(t),a(e),r,o,i,s);return s.delete(t),c;case S:if(Pn)return Pn.call(t)==Pn.call(e)}return!1}(e,n,l,r,o,i,s);if(!(1&r)){var b=p&&$t.call(e,"__wrapped__"),_=f&&$t.call(n,"__wrapped__");if(b||_){var D=b?e.value():e,k=_?n.value():n;return s||(s=new Yn),i(D,k,r,o,s)}}return!!h&&(s||(s=new Yn),function(e,n,r,o,i,s){var a=1&r,u=ii(e),l=u.length,c=ii(n).length;if(l!=c&&!a)return!1;for(var p=l;p--;){var f=u[p];if(!(a?f in n:$t.call(n,f)))return!1}var h=s.get(e),d=s.get(n);if(h&&d)return h==n&&d==e;var m=!0;s.set(e,n),s.set(n,e);for(var g=a;++p<l;){var v=e[f=u[p]],y=n[f];if(o)var b=a?o(y,v,f,n,e,s):o(v,y,f,e,n,s);if(!(b===t?v===y||i(v,y,r,o,s):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var _=e.constructor,D=n.constructor;_==D||!("constructor"in e)||!("constructor"in n)||"function"==typeof _&&_ instanceof _&&"function"==typeof D&&D instanceof D||(m=!1)}return s.delete(e),s.delete(n),m}(e,n,r,o,i,s))}(e,n,r,o,Mr,i))}function Ir(e,n,r,o){var i=r.length,s=i,a=!o;if(null==e)return!s;for(e=At(e);i--;){var u=r[i];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<s;){var l=(u=r[i])[0],c=e[l],p=u[1];if(a&&u[2]){if(c===t&&!(l in e))return!1}else{var f=new Yn;if(o)var h=o(c,p,l,e,n,f);if(!(h===t?Mr(p,c,3,o,f):h))return!1}}return!0}function $r(t){return!(!na(t)||(e=t,Rt&&Rt in e))&&(Zs(t)?zt:mt).test(ji(t));var e}function Br(t){return"function"==typeof t?t:null==t?iu:"object"==typeof t?qs(t)?Hr(t[0],t[1]):zr(t):du(t)}function Rr(t){if(!ki(t))return yn(t);var e=[];for(var n in At(t))$t.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Lr(t){if(!na(t))return function(t){var e=[];if(null!=t)for(var n in At(t))e.push(n);return e}(t);var e=ki(t),n=[];for(var r in t)("constructor"!=r||!e&&$t.call(t,r))&&n.push(r);return n}function Pr(t,e){return t<e}function jr(t,e){var n=-1,r=Js(t)?Dt(t.length):[];return hr(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function zr(t){var e=fi(t);return 1==e.length&&e[0][2]?xi(e[0][0],e[0][1]):function(n){return n===t||Ir(n,t,e)}}function Hr(e,n){return wi(e)&&Ai(n)?xi(Pi(e),n):function(r){var o=Oa(r,e);return o===t&&o===n?Sa(r,e):Mr(n,o,3)}}function Vr(e,n,r,o,i){e!==n&&br(n,(function(s,a){if(i||(i=new Yn),na(s))!function(e,n,r,o,i,s,a){var u=Ti(e,r),l=Ti(n,r),c=a.get(l);if(c)er(e,r,c);else{var p=s?s(u,l,r+"",e,n,a):t,f=p===t;if(f){var h=qs(l),d=!h&&Ys(l),m=!h&&!d&&pa(l);p=l,h||d||m?qs(u)?p=u:Gs(u)?p=To(u):d?(f=!1,p=ko(l,!0)):m?(f=!1,p=xo(l,!0)):p=[]:sa(l)||Us(l)?(p=u,Us(u)?p=ba(u):na(u)&&!Zs(u)||(p=yi(l))):f=!1}f&&(a.set(l,p),i(p,l,o,s,a),a.delete(l)),er(e,r,p)}}(e,n,a,r,Vr,o,i);else{var u=o?o(Ti(e,a),s,a+"",e,n,i):t;u===t&&(u=s),er(e,a,u)}}),Ia)}function Wr(e,n){var r=e.length;if(r)return _i(n+=n<0?r:0,r)?e[n]:t}function Ur(t,e,n){e=e.length?Ne(e,(function(t){return qs(t)?function(e){return Cr(e,1===t.length?t[0]:t)}:t})):[iu];var r=-1;e=Ne(e,Je(ci()));var o=jr(t,(function(t,n,o){var i=Ne(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,s=o.length,a=n.length;++r<s;){var u=Oo(o[r],i[r]);if(u)return r>=a?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var s=e[r],a=Cr(t,s);n(a,s)&&to(i,Do(s,t),a)}return i}function Kr(t,e,n,r){var o=r?Pe:Le,i=-1,s=e.length,a=t;for(t===e&&(e=To(e)),n&&(a=Ne(t,Je(n)));++i<s;)for(var u=0,l=e[i],c=n?n(l):l;(u=o(a,c,u,r))>-1;)a!==t&&Xt.call(a,u,1),Xt.call(t,u,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;_i(o)?Xt.call(t,o,1):fo(t,o)}}return t}function Gr(t,e){return t+$e(En()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>c)return n;do{e%2&&(n+=t),(e=$e(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Ii(Oi(t,e,iu),t+"")}function Qr(t){return Qn(Ha(t))}function Zr(t,e){var n=Ha(t);return Ri(n,ur(e,0,n.length))}function to(e,n,r,o){if(!na(e))return e;for(var i=-1,s=(n=Do(n,e)).length,a=s-1,u=e;null!=u&&++i<s;){var l=Pi(n[i]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=a){var p=u[l];(c=o?o(p,l,u):t)===t&&(c=na(p)?p:_i(n[i+1])?[]:{})}nr(u,l,c),u=u[l]}return e}var eo=Tn?function(t,e){return Tn.set(t,e),t}:iu,no=le?function(t,e){return le(t,"toString",{configurable:!0,enumerable:!1,value:nu(e),writable:!0})}:iu;function ro(t){return Ri(Ha(t))}function oo(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Dt(o);++r<o;)i[r]=t[r+e];return i}function io(t,e){var n;return hr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function so(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,s=t[i];null!==s&&!ca(s)&&(n?s<=e:s<e)?r=i+1:o=i}return o}return ao(t,e,iu,n)}function ao(e,n,r,o){var i=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(n=r(n))!=n,u=null===n,l=ca(n),c=n===t;i<s;){var p=$e((i+s)/2),f=r(e[p]),h=f!==t,d=null===f,m=f==f,g=ca(f);if(a)var v=o||m;else v=c?m&&(o||h):u?m&&h&&(o||!d):l?m&&h&&!d&&(o||!g):!d&&!g&&(o?f<=n:f<n);v?i=p+1:s=p}return _n(s,4294967294)}function uo(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Hs(a,u)){var u=a;i[o++]=0===s?0:s}}return i}function lo(t){return"number"==typeof t?t:ca(t)?p:+t}function co(t){if("string"==typeof t)return t;if(qs(t))return Ne(t,co)+"";if(ca(t))return jn?jn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function po(t,e,n){var r=-1,o=Oe,i=t.length,s=!0,a=[],u=a;if(n)s=!1,o=Se;else if(i>=200){var l=e?null:Xo(t);if(l)return un(l);s=!1,o=Ye,u=new Gn}else u=e?[]:a;t:for(;++r<i;){var c=t[r],p=e?e(c):c;if(c=n||0!==c?c:0,s&&p==p){for(var f=u.length;f--;)if(u[f]===p)continue t;e&&u.push(p),a.push(c)}else o(u,p,n)||(u!==a&&u.push(p),a.push(c))}return a}function fo(t,e){return null==(t=Si(t,e=Do(e,t)))||delete t[Pi(Qi(e))]}function ho(t,e,n,r){return to(t,e,n(Cr(t,e)),r)}function mo(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?oo(t,r?0:i,r?i+1:o):oo(t,r?i+1:0,r?o:i)}function go(t,e){var n=t;return n instanceof Un&&(n=n.value()),Fe(e,(function(t,e){return e.func.apply(e.thisArg,Te([t],e.args))}),n)}function vo(t,e,n){var r=t.length;if(r<2)return r?po(t[0]):[];for(var o=-1,i=Dt(r);++o<r;)for(var s=t[o],a=-1;++a<r;)a!=o&&(i[o]=fr(i[o]||s,t[a],e,n));return po(yr(i,1),e,n)}function yo(e,n,r){for(var o=-1,i=e.length,s=n.length,a={};++o<i;){var u=o<s?n[o]:t;r(a,e[o],u)}return a}function bo(t){return Gs(t)?t:[]}function _o(t){return"function"==typeof t?t:iu}function Do(t,e){return qs(t)?t:wi(t,e)?[t]:Li(_a(t))}var wo=Xr;function Eo(e,n,r){var o=e.length;return r=r===t?o:r,!n&&r>=o?e:oo(e,n,r)}var Co=pe||function(t){return ce.clearTimeout(t)};function ko(t,e){if(e)return t.slice();var n=t.length,r=Ut?Ut(n):new t.constructor(n);return t.copy(r),r}function Ao(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function xo(t,e){var n=e?Ao(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Oo(e,n){if(e!==n){var r=e!==t,o=null===e,i=e==e,s=ca(e),a=n!==t,u=null===n,l=n==n,c=ca(n);if(!u&&!c&&!s&&e>n||s&&a&&l&&!u&&!c||o&&a&&l||!r&&l||!i)return 1;if(!o&&!s&&!c&&e<n||c&&r&&i&&!o&&!s||u&&r&&i||!a&&i||!l)return-1}return 0}function So(t,e,n,r){for(var o=-1,i=t.length,s=n.length,a=-1,u=e.length,l=bn(i-s,0),c=Dt(u+l),p=!r;++a<u;)c[a]=e[a];for(;++o<s;)(p||o<i)&&(c[n[o]]=t[o]);for(;l--;)c[a++]=t[o++];return c}function No(t,e,n,r){for(var o=-1,i=t.length,s=-1,a=n.length,u=-1,l=e.length,c=bn(i-a,0),p=Dt(c+l),f=!r;++o<c;)p[o]=t[o];for(var h=o;++u<l;)p[h+u]=e[u];for(;++s<a;)(f||o<i)&&(p[h+n[s]]=t[o++]);return p}function To(t,e){var n=-1,r=t.length;for(e||(e=Dt(r));++n<r;)e[n]=t[n];return e}function Fo(e,n,r,o){var i=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var u=n[s],l=o?o(r[u],e[u],u,r,e):t;l===t&&(l=e[u]),i?sr(r,u,l):nr(r,u,l)}return r}function Mo(t,e){return function(n,r){var o=qs(n)?Ee:or,i=e?e():{};return o(n,t,ci(r,2),i)}}function Io(e){return Xr((function(n,r){var o=-1,i=r.length,s=i>1?r[i-1]:t,a=i>2?r[2]:t;for(s=e.length>3&&"function"==typeof s?(i--,s):t,a&&Di(r[0],r[1],a)&&(s=i<3?t:s,i=1),n=At(n);++o<i;){var u=r[o];u&&e(n,u,o,s)}return n}))}function $o(t,e){return function(n,r){if(null==n)return n;if(!Js(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=At(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}function Bo(t){return function(e,n,r){for(var o=-1,i=At(e),s=r(e),a=s.length;a--;){var u=s[t?a:++o];if(!1===n(i[u],u,i))break}return e}}function Ro(e){return function(n){var r=rn(n=_a(n))?pn(n):t,o=r?r[0]:n.charAt(0),i=r?Eo(r,1).join(""):n.slice(1);return o[e]()+i}}function Lo(t){return function(e){return Fe(Za(Ua(e).replace(Gt,"")),t,"")}}function Po(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Hn(t.prototype),r=t.apply(n,e);return na(r)?r:n}}function jo(e){return function(n,r,o){var i=At(n);if(!Js(n)){var s=ci(r,3);n=Ma(n),r=function(t){return s(i[t],t,i)}}var a=e(n,r,o);return a>-1?i[s?n[a]:a]:t}}function zo(n){return oi((function(r){var o=r.length,i=o,s=Wn.prototype.thru;for(n&&r.reverse();i--;){var a=r[i];if("function"!=typeof a)throw new St(e);if(s&&!u&&"wrapper"==ui(a))var u=new Wn([],!0)}for(i=u?i:o;++i<o;){var l=ui(a=r[i]),c="wrapper"==l?ai(a):t;u=c&&Ei(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ui(c[0])].apply(u,c[3]):1==a.length&&Ei(a)?u[l]():u.thru(a)}return function(){var t=arguments,e=t[0];if(u&&1==t.length&&qs(e))return u.plant(e).value();for(var n=0,i=o?r[n].apply(this,t):e;++n<o;)i=r[n].call(this,i);return i}}))}function Ho(e,n,r,o,i,s,u,l,c,p){var f=n&a,h=1&n,d=2&n,m=24&n,g=512&n,v=d?t:Po(e);return function t(){for(var a=arguments.length,y=Dt(a),b=a;b--;)y[b]=arguments[b];if(m)var _=li(t),D=Ze(y,_);if(o&&(y=So(y,o,i,m)),s&&(y=No(y,s,u,m)),a-=D,m&&a<p){var w=an(y,_);return Go(e,n,Ho,t.placeholder,r,y,w,l,c,p-a)}var E=h?r:this,C=d?E[e]:e;return a=y.length,l?y=Ni(y,l):g&&a>1&&y.reverse(),f&&c<a&&(y.length=c),this&&this!==ce&&this instanceof t&&(C=v||Po(C)),C.apply(E,y)}}function Vo(t,e){return function(n,r){return function(t,e,n,r){return Dr(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function Wo(e,n){return function(r,o){var i;if(r===t&&o===t)return n;if(r!==t&&(i=r),o!==t){if(i===t)return o;"string"==typeof r||"string"==typeof o?(r=co(r),o=co(o)):(r=lo(r),o=lo(o)),i=e(r,o)}return i}}function Uo(t){return oi((function(e){return e=Ne(e,Je(ci())),Xr((function(n){var r=this;return t(e,(function(t){return we(t,r,n)}))}))}))}function qo(e,n){var r=(n=n===t?" ":co(n)).length;if(r<2)return r?Yr(n,e):n;var o=Yr(n,me(e/cn(n)));return rn(n)?Eo(pn(o),0,e).join(""):o.slice(0,e)}function Ko(e){return function(n,r,o){return o&&"number"!=typeof o&&Di(n,r,o)&&(r=o=t),n=ma(n),r===t?(r=n,n=0):r=ma(r),function(t,e,n,r){for(var o=-1,i=bn(me((e-t)/(n||1)),0),s=Dt(i);i--;)s[r?i:++o]=t,t+=n;return s}(n,r,o=o===t?n<r?1:-1:ma(o),e)}}function Jo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ya(e),n=ya(n)),t(e,n)}}function Go(e,n,r,o,a,u,l,c,p,f){var h=8&n;n|=h?i:s,4&(n&=~(h?s:i))||(n&=-4);var d=[e,n,a,h?u:t,h?l:t,h?t:u,h?t:l,c,p,f],m=r.apply(t,d);return Ei(e)&&Fi(m,d),m.placeholder=o,$i(m,e,n)}function Yo(t){var e=kt[t];return function(t,n){if(t=ya(t),(n=null==n?0:_n(ga(n),292))&&gn(t)){var r=(_a(t)+"e").split("e");return+((r=(_a(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Xo=On&&1/un(new On([,-0]))[1]==l?function(t){return new On(t)}:cu;function Qo(t){return function(e){var n=gi(e);return n==w?on(e):n==x?ln(e):function(t,e){return Ne(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Zo(n,l,c,p,f,h,d,m){var g=2&l;if(!g&&"function"!=typeof n)throw new St(e);var v=p?p.length:0;if(v||(l&=-97,p=f=t),d=d===t?d:bn(ga(d),0),m=m===t?m:ga(m),v-=f?f.length:0,l&s){var y=p,b=f;p=f=t}var _=g?t:ai(n),D=[n,l,c,p,f,y,b,h,d,m];if(_&&function(t,e){var n=t[1],o=e[1],i=n|o,s=i<131,l=o==a&&8==n||o==a&&n==u&&t[7].length<=e[8]||384==o&&e[7].length<=e[8]&&8==n;if(!s&&!l)return t;1&o&&(t[2]=e[2],i|=1&n?0:4);var c=e[3];if(c){var p=t[3];t[3]=p?So(p,c,e[4]):c,t[4]=p?an(t[3],r):e[4]}(c=e[5])&&(p=t[5],t[5]=p?No(p,c,e[6]):c,t[6]=p?an(t[5],r):e[6]),(c=e[7])&&(t[7]=c),o&a&&(t[8]=null==t[8]?e[8]:_n(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(D,_),n=D[0],l=D[1],c=D[2],p=D[3],f=D[4],!(m=D[9]=D[9]===t?g?0:n.length:bn(D[9]-v,0))&&24&l&&(l&=-25),l&&1!=l)w=8==l||l==o?function(e,n,r){var o=Po(e);return function i(){for(var s=arguments.length,a=Dt(s),u=s,l=li(i);u--;)a[u]=arguments[u];var c=s<3&&a[0]!==l&&a[s-1]!==l?[]:an(a,l);return(s-=c.length)<r?Go(e,n,Ho,i.placeholder,t,a,c,t,t,r-s):we(this&&this!==ce&&this instanceof i?o:e,this,a)}}(n,l,m):l!=i&&33!=l||f.length?Ho.apply(t,D):function(t,e,n,r){var o=1&e,i=Po(t);return function e(){for(var s=-1,a=arguments.length,u=-1,l=r.length,c=Dt(l+a),p=this&&this!==ce&&this instanceof e?i:t;++u<l;)c[u]=r[u];for(;a--;)c[u++]=arguments[++s];return we(p,o?n:this,c)}}(n,l,c,p);else var w=function(t,e,n){var r=1&e,o=Po(t);return function e(){return(this&&this!==ce&&this instanceof e?o:t).apply(r?n:this,arguments)}}(n,l,c);return $i((_?eo:Fi)(w,D),n,l)}function ti(e,n,r,o){return e===t||Hs(e,Ft[r])&&!$t.call(o,r)?n:e}function ei(e,n,r,o,i,s){return na(e)&&na(n)&&(s.set(n,e),Vr(e,n,t,ei,s),s.delete(n)),e}function ni(e){return sa(e)?t:e}function ri(e,n,r,o,i,s){var a=1&r,u=e.length,l=n.length;if(u!=l&&!(a&&l>u))return!1;var c=s.get(e),p=s.get(n);if(c&&p)return c==n&&p==e;var f=-1,h=!0,d=2&r?new Gn:t;for(s.set(e,n),s.set(n,e);++f<u;){var m=e[f],g=n[f];if(o)var v=a?o(g,m,f,n,e,s):o(m,g,f,e,n,s);if(v!==t){if(v)continue;h=!1;break}if(d){if(!Ie(n,(function(t,e){if(!Ye(d,e)&&(m===t||i(m,t,r,o,s)))return d.push(e)}))){h=!1;break}}else if(m!==g&&!i(m,g,r,o,s)){h=!1;break}}return s.delete(e),s.delete(n),h}function oi(e){return Ii(Oi(e,t,Ki),e+"")}function ii(t){return kr(t,Ma,di)}function si(t){return kr(t,Ia,mi)}var ai=Tn?function(t){return Tn.get(t)}:cu;function ui(t){for(var e=t.name+"",n=Fn[e],r=$t.call(Fn,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function li(t){return($t.call(zn,"placeholder")?zn:t).placeholder}function ci(){var t=zn.iteratee||su;return t=t===su?Br:t,arguments.length?t(arguments[0],arguments[1]):t}function pi(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function fi(t){for(var e=Ma(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Ai(o)]}return e}function hi(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return $r(r)?r:t}var di=Ve?function(t){return null==t?[]:(t=At(t),xe(Ve(t),(function(e){return Jt.call(t,e)})))}:vu,mi=Ve?function(t){for(var e=[];t;)Te(e,di(t)),t=qt(t);return e}:vu,gi=Ar;function vi(t,e,n){for(var r=-1,o=(e=Do(e,t)).length,i=!1;++r<o;){var s=Pi(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&ea(o)&&_i(s,o)&&(qs(t)||Us(t))}function yi(t){return"function"!=typeof t.constructor||ki(t)?{}:Hn(qt(t))}function bi(t){return qs(t)||Us(t)||!!(Zt&&t&&t[Zt])}function _i(t,e){var n=typeof t;return!!(e=null==e?c:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function Di(t,e,n){if(!na(n))return!1;var r=typeof e;return!!("number"==r?Js(n)&&_i(e,n.length):"string"==r&&e in n)&&Hs(n[e],t)}function wi(t,e){if(qs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ca(t))||Z.test(t)||!Q.test(t)||null!=e&&t in At(e)}function Ei(t){var e=ui(t),n=zn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=ai(n);return!!r&&t===r[0]}(kn&&gi(new kn(new ArrayBuffer(1)))!=F||An&&gi(new An)!=w||xn&&gi(xn.resolve())!=k||On&&gi(new On)!=x||Sn&&gi(new Sn)!=N)&&(gi=function(e){var n=Ar(e),r=n==C?e.constructor:t,o=r?ji(r):"";if(o)switch(o){case Mn:return F;case In:return w;case $n:return k;case Bn:return x;case Rn:return N}return n});var Ci=Mt?Zs:yu;function ki(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ft)}function Ai(t){return t==t&&!na(t)}function xi(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in At(r))}}function Oi(e,n,r){return n=bn(n===t?e.length-1:n,0),function(){for(var t=arguments,o=-1,i=bn(t.length-n,0),s=Dt(i);++o<i;)s[o]=t[n+o];o=-1;for(var a=Dt(n+1);++o<n;)a[o]=t[o];return a[n]=r(s),we(e,this,a)}}function Si(t,e){return e.length<2?t:Cr(t,oo(e,0,-1))}function Ni(e,n){for(var r=e.length,o=_n(n.length,r),i=To(e);o--;){var s=n[o];e[o]=_i(s,r)?i[s]:t}return e}function Ti(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Fi=Bi(eo),Mi=de||function(t,e){return ce.setTimeout(t,e)},Ii=Bi(no);function $i(t,e,n){var r=e+"";return Ii(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ce(h,(function(n){var r="_."+n[0];e&n[1]&&!Oe(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(r),n)))}function Bi(e){var n=0,r=0;return function(){var o=Dn(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Ri(e,n){var r=-1,o=e.length,i=o-1;for(n=n===t?o:n;++r<n;){var s=Gr(r,i),a=e[s];e[s]=e[r],e[r]=a}return e.length=n,e}var Li=function(t){var e=Bs(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,o){e.push(r?o.replace(ct,"$1"):n||t)})),e}));function Pi(t){if("string"==typeof t||ca(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ji(t){if(null!=t){try{return It.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function zi(t){if(t instanceof Un)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=To(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Hi=Xr((function(t,e){return Gs(t)?fr(t,yr(e,1,Gs,!0)):[]})),Vi=Xr((function(e,n){var r=Qi(n);return Gs(r)&&(r=t),Gs(e)?fr(e,yr(n,1,Gs,!0),ci(r,2)):[]})),Wi=Xr((function(e,n){var r=Qi(n);return Gs(r)&&(r=t),Gs(e)?fr(e,yr(n,1,Gs,!0),t,r):[]}));function Ui(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ga(n);return o<0&&(o=bn(r+o,0)),Re(t,ci(e,3),o)}function qi(e,n,r){var o=null==e?0:e.length;if(!o)return-1;var i=o-1;return r!==t&&(i=ga(r),i=r<0?bn(o+i,0):_n(i,o-1)),Re(e,ci(n,3),i,!0)}function Ki(t){return null!=t&&t.length?yr(t,1):[]}function Ji(e){return e&&e.length?e[0]:t}var Gi=Xr((function(t){var e=Ne(t,bo);return e.length&&e[0]===t[0]?Nr(e):[]})),Yi=Xr((function(e){var n=Qi(e),r=Ne(e,bo);return n===Qi(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Nr(r,ci(n,2)):[]})),Xi=Xr((function(e){var n=Qi(e),r=Ne(e,bo);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Nr(r,t,n):[]}));function Qi(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Zi=Xr(ts);function ts(t,e){return t&&t.length&&e&&e.length?Kr(t,e):t}var es=oi((function(t,e){var n=null==t?0:t.length,r=ar(t,e);return Jr(t,Ne(e,(function(t){return _i(t,n)?+t:t})).sort(Oo)),r}));function ns(t){return null==t?t:Cn.call(t)}var rs=Xr((function(t){return po(yr(t,1,Gs,!0))})),os=Xr((function(e){var n=Qi(e);return Gs(n)&&(n=t),po(yr(e,1,Gs,!0),ci(n,2))})),is=Xr((function(e){var n=Qi(e);return n="function"==typeof n?n:t,po(yr(e,1,Gs,!0),t,n)}));function ss(t){if(!t||!t.length)return[];var e=0;return t=xe(t,(function(t){if(Gs(t))return e=bn(t.length,e),!0})),qe(e,(function(e){return Ne(t,He(e))}))}function as(e,n){if(!e||!e.length)return[];var r=ss(e);return null==n?r:Ne(r,(function(e){return we(n,t,e)}))}var us=Xr((function(t,e){return Gs(t)?fr(t,e):[]})),ls=Xr((function(t){return vo(xe(t,Gs))})),cs=Xr((function(e){var n=Qi(e);return Gs(n)&&(n=t),vo(xe(e,Gs),ci(n,2))})),ps=Xr((function(e){var n=Qi(e);return n="function"==typeof n?n:t,vo(xe(e,Gs),t,n)})),fs=Xr(ss),hs=Xr((function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,as(e,r)}));function ds(t){var e=zn(t);return e.__chain__=!0,e}function ms(t,e){return e(t)}var gs=oi((function(e){var n=e.length,r=n?e[0]:0,o=this.__wrapped__,i=function(t){return ar(t,e)};return!(n>1||this.__actions__.length)&&o instanceof Un&&_i(r)?((o=o.slice(r,+r+(n?1:0))).__actions__.push({func:ms,args:[i],thisArg:t}),new Wn(o,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(i)})),vs=Mo((function(t,e,n){$t.call(t,n)?++t[n]:sr(t,n,1)})),ys=jo(Ui),bs=jo(qi);function _s(t,e){return(qs(t)?Ce:hr)(t,ci(e,3))}function Ds(t,e){return(qs(t)?ke:dr)(t,ci(e,3))}var ws=Mo((function(t,e,n){$t.call(t,n)?t[n].push(e):sr(t,n,[e])})),Es=Xr((function(t,e,n){var r=-1,o="function"==typeof e,i=Js(t)?Dt(t.length):[];return hr(t,(function(t){i[++r]=o?we(e,t,n):Tr(t,e,n)})),i})),Cs=Mo((function(t,e,n){sr(t,n,e)}));function ks(t,e){return(qs(t)?Ne:jr)(t,ci(e,3))}var As=Mo((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),xs=Xr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Di(t,e[0],e[1])?e=[]:n>2&&Di(e[0],e[1],e[2])&&(e=[e[0]]),Ur(t,yr(e,1),[])})),Os=fe||function(){return ce.Date.now()};function Ss(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Zo(e,a,t,t,t,t,n)}function Ns(n,r){var o;if("function"!=typeof r)throw new St(e);return n=ga(n),function(){return--n>0&&(o=r.apply(this,arguments)),n<=1&&(r=t),o}}var Ts=Xr((function(t,e,n){var r=1;if(n.length){var o=an(n,li(Ts));r|=i}return Zo(t,r,e,n,o)})),Fs=Xr((function(t,e,n){var r=3;if(n.length){var o=an(n,li(Fs));r|=i}return Zo(e,r,t,n,o)}));function Ms(n,r,o){var i,s,a,u,l,c,p=0,f=!1,h=!1,d=!0;if("function"!=typeof n)throw new St(e);function m(e){var r=i,o=s;return i=s=t,p=e,u=n.apply(o,r)}function g(t){return p=t,l=Mi(y,r),f?m(t):u}function v(e){var n=e-c;return c===t||n>=r||n<0||h&&e-p>=a}function y(){var t=Os();if(v(t))return b(t);l=Mi(y,function(t){var e=r-(t-c);return h?_n(e,a-(t-p)):e}(t))}function b(e){return l=t,d&&i?m(e):(i=s=t,u)}function _(){var e=Os(),n=v(e);if(i=arguments,s=this,c=e,n){if(l===t)return g(c);if(h)return Co(l),l=Mi(y,r),m(c)}return l===t&&(l=Mi(y,r)),u}return r=ya(r)||0,na(o)&&(f=!!o.leading,a=(h="maxWait"in o)?bn(ya(o.maxWait)||0,r):a,d="trailing"in o?!!o.trailing:d),_.cancel=function(){l!==t&&Co(l),p=0,i=c=s=l=t},_.flush=function(){return l===t?u:b(Os())},_}var Is=Xr((function(t,e){return pr(t,1,e)})),$s=Xr((function(t,e,n){return pr(t,ya(e)||0,n)}));function Bs(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new St(e);var r=function(){var e=arguments,o=n?n.apply(this,e):e[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,e);return r.cache=i.set(o,s)||i,s};return r.cache=new(Bs.Cache||Jn),r}function Rs(t){if("function"!=typeof t)throw new St(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Bs.Cache=Jn;var Ls=wo((function(t,e){var n=(e=1==e.length&&qs(e[0])?Ne(e[0],Je(ci())):Ne(yr(e,1),Je(ci()))).length;return Xr((function(r){for(var o=-1,i=_n(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return we(t,this,r)}))})),Ps=Xr((function(e,n){var r=an(n,li(Ps));return Zo(e,i,t,n,r)})),js=Xr((function(e,n){var r=an(n,li(js));return Zo(e,s,t,n,r)})),zs=oi((function(e,n){return Zo(e,u,t,t,t,n)}));function Hs(t,e){return t===e||t!=t&&e!=e}var Vs=Jo(xr),Ws=Jo((function(t,e){return t>=e})),Us=Fr(function(){return arguments}())?Fr:function(t){return ra(t)&&$t.call(t,"callee")&&!Jt.call(t,"callee")},qs=Dt.isArray,Ks=ge?Je(ge):function(t){return ra(t)&&Ar(t)==T};function Js(t){return null!=t&&ea(t.length)&&!Zs(t)}function Gs(t){return ra(t)&&Js(t)}var Ys=mn||yu,Xs=ve?Je(ve):function(t){return ra(t)&&Ar(t)==v};function Qs(t){if(!ra(t))return!1;var e=Ar(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Zs(t){if(!na(t))return!1;var e=Ar(t);return e==b||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ta(t){return"number"==typeof t&&t==ga(t)}function ea(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=c}function na(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var oa=ye?Je(ye):function(t){return ra(t)&&gi(t)==w};function ia(t){return"number"==typeof t||ra(t)&&Ar(t)==E}function sa(t){if(!ra(t)||Ar(t)!=C)return!1;var e=qt(t);if(null===e)return!0;var n=$t.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&It.call(n)==Pt}var aa=be?Je(be):function(t){return ra(t)&&Ar(t)==A},ua=_e?Je(_e):function(t){return ra(t)&&gi(t)==x};function la(t){return"string"==typeof t||!qs(t)&&ra(t)&&Ar(t)==O}function ca(t){return"symbol"==typeof t||ra(t)&&Ar(t)==S}var pa=De?Je(De):function(t){return ra(t)&&ea(t.length)&&!!re[Ar(t)]},fa=Jo(Pr),ha=Jo((function(t,e){return t<=e}));function da(t){if(!t)return[];if(Js(t))return la(t)?pn(t):To(t);if(ie&&t[ie])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ie]());var e=gi(t);return(e==w?on:e==x?un:Ha)(t)}function ma(t){return t?(t=ya(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=ma(t),n=e%1;return e==e?n?e-n:e:0}function va(t){return t?ur(ga(t),0,f):0}function ya(t){if("number"==typeof t)return t;if(ca(t))return p;if(na(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=na(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=dt.test(t);return n||gt.test(t)?ae(t.slice(2),n?2:8):ht.test(t)?p:+t}function ba(t){return Fo(t,Ia(t))}function _a(t){return null==t?"":co(t)}var Da=Io((function(t,e){if(ki(e)||Js(e))Fo(e,Ma(e),t);else for(var n in e)$t.call(e,n)&&nr(t,n,e[n])})),wa=Io((function(t,e){Fo(e,Ia(e),t)})),Ea=Io((function(t,e,n,r){Fo(e,Ia(e),t,r)})),Ca=Io((function(t,e,n,r){Fo(e,Ma(e),t,r)})),ka=oi(ar),Aa=Xr((function(e,n){e=At(e);var r=-1,o=n.length,i=o>2?n[2]:t;for(i&&Di(n[0],n[1],i)&&(o=1);++r<o;)for(var s=n[r],a=Ia(s),u=-1,l=a.length;++u<l;){var c=a[u],p=e[c];(p===t||Hs(p,Ft[c])&&!$t.call(e,c))&&(e[c]=s[c])}return e})),xa=Xr((function(e){return e.push(t,ei),we(Ba,t,e)}));function Oa(e,n,r){var o=null==e?t:Cr(e,n);return o===t?r:o}function Sa(t,e){return null!=t&&vi(t,e,Sr)}var Na=Vo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),nu(iu)),Ta=Vo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),$t.call(t,e)?t[e].push(n):t[e]=[n]}),ci),Fa=Xr(Tr);function Ma(t){return Js(t)?Xn(t):Rr(t)}function Ia(t){return Js(t)?Xn(t,!0):Lr(t)}var $a=Io((function(t,e,n){Vr(t,e,n)})),Ba=Io((function(t,e,n,r){Vr(t,e,n,r)})),Ra=oi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ne(e,(function(e){return e=Do(e,t),r||(r=e.length>1),e})),Fo(t,si(t),n),r&&(n=lr(n,7,ni));for(var o=e.length;o--;)fo(n,e[o]);return n})),La=oi((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return Sa(t,n)}))}(t,e)}));function Pa(t,e){if(null==t)return{};var n=Ne(si(t),(function(t){return[t]}));return e=ci(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var ja=Qo(Ma),za=Qo(Ia);function Ha(t){return null==t?[]:Ge(t,Ma(t))}var Va=Lo((function(t,e,n){return e=e.toLowerCase(),t+(n?Wa(e):e)}));function Wa(t){return Qa(_a(t).toLowerCase())}function Ua(t){return(t=_a(t))&&t.replace(yt,tn).replace(Yt,"")}var qa=Lo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ka=Lo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ja=Ro("toLowerCase"),Ga=Lo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ya=Lo((function(t,e,n){return t+(n?" ":"")+Qa(e)})),Xa=Lo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Qa=Ro("toUpperCase");function Za(e,n,r){return e=_a(e),(n=r?t:n)===t?function(t){return te.test(t)}(e)?function(t){return t.match(Qt)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(n)||[]}var tu=Xr((function(e,n){try{return we(e,t,n)}catch(t){return Qs(t)?t:new Et(t)}})),eu=oi((function(t,e){return Ce(e,(function(e){e=Pi(e),sr(t,e,Ts(t[e],t))})),t}));function nu(t){return function(){return t}}var ru=zo(),ou=zo(!0);function iu(t){return t}function su(t){return Br("function"==typeof t?t:lr(t,1))}var au=Xr((function(t,e){return function(n){return Tr(n,t,e)}})),uu=Xr((function(t,e){return function(n){return Tr(t,n,e)}}));function lu(t,e,n){var r=Ma(e),o=Er(e,r);null!=n||na(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=Er(e,Ma(e)));var i=!(na(n)&&"chain"in n&&!n.chain),s=Zs(t);return Ce(o,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__),o=n.__actions__=To(this.__actions__);return o.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Te([this.value()],arguments))})})),t}function cu(){}var pu=Uo(Ne),fu=Uo(Ae),hu=Uo(Ie);function du(t){return wi(t)?He(Pi(t)):function(t){return function(e){return Cr(e,t)}}(t)}var mu=Ko(),gu=Ko(!0);function vu(){return[]}function yu(){return!1}var bu,_u=Wo((function(t,e){return t+e}),0),Du=Yo("ceil"),wu=Wo((function(t,e){return t/e}),1),Eu=Yo("floor"),Cu=Wo((function(t,e){return t*e}),1),ku=Yo("round"),Au=Wo((function(t,e){return t-e}),0);return zn.after=function(t,n){if("function"!=typeof n)throw new St(e);return t=ga(t),function(){if(--t<1)return n.apply(this,arguments)}},zn.ary=Ss,zn.assign=Da,zn.assignIn=wa,zn.assignInWith=Ea,zn.assignWith=Ca,zn.at=ka,zn.before=Ns,zn.bind=Ts,zn.bindAll=eu,zn.bindKey=Fs,zn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qs(t)?t:[t]},zn.chain=ds,zn.chunk=function(e,n,r){n=(r?Di(e,n,r):n===t)?1:bn(ga(n),0);var o=null==e?0:e.length;if(!o||n<1)return[];for(var i=0,s=0,a=Dt(me(o/n));i<o;)a[s++]=oo(e,i,i+=n);return a},zn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},zn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=Dt(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Te(qs(n)?To(n):[n],yr(e,1))},zn.cond=function(t){var n=null==t?0:t.length,r=ci();return t=n?Ne(t,(function(t){if("function"!=typeof t[1])throw new St(e);return[r(t[0]),t[1]]})):[],Xr((function(e){for(var r=-1;++r<n;){var o=t[r];if(we(o[0],this,e))return we(o[1],this,e)}}))},zn.conforms=function(t){return function(t){var e=Ma(t);return function(n){return cr(n,t,e)}}(lr(t,1))},zn.constant=nu,zn.countBy=vs,zn.create=function(t,e){var n=Hn(t);return null==e?n:ir(n,e)},zn.curry=function e(n,r,o){var i=Zo(n,8,t,t,t,t,t,r=o?t:r);return i.placeholder=e.placeholder,i},zn.curryRight=function e(n,r,i){var s=Zo(n,o,t,t,t,t,t,r=i?t:r);return s.placeholder=e.placeholder,s},zn.debounce=Ms,zn.defaults=Aa,zn.defaultsDeep=xa,zn.defer=Is,zn.delay=$s,zn.difference=Hi,zn.differenceBy=Vi,zn.differenceWith=Wi,zn.drop=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,(n=r||n===t?1:ga(n))<0?0:n,o):[]},zn.dropRight=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,0,(n=o-(n=r||n===t?1:ga(n)))<0?0:n):[]},zn.dropRightWhile=function(t,e){return t&&t.length?mo(t,ci(e,3),!0,!0):[]},zn.dropWhile=function(t,e){return t&&t.length?mo(t,ci(e,3),!0):[]},zn.fill=function(e,n,r,o){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&Di(e,n,r)&&(r=0,o=i),function(e,n,r,o){var i=e.length;for((r=ga(r))<0&&(r=-r>i?0:i+r),(o=o===t||o>i?i:ga(o))<0&&(o+=i),o=r>o?0:va(o);r<o;)e[r++]=n;return e}(e,n,r,o)):[]},zn.filter=function(t,e){return(qs(t)?xe:vr)(t,ci(e,3))},zn.flatMap=function(t,e){return yr(ks(t,e),1)},zn.flatMapDeep=function(t,e){return yr(ks(t,e),l)},zn.flatMapDepth=function(e,n,r){return r=r===t?1:ga(r),yr(ks(e,n),r)},zn.flatten=Ki,zn.flattenDeep=function(t){return null!=t&&t.length?yr(t,l):[]},zn.flattenDepth=function(e,n){return null!=e&&e.length?yr(e,n=n===t?1:ga(n)):[]},zn.flip=function(t){return Zo(t,512)},zn.flow=ru,zn.flowRight=ou,zn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},zn.functions=function(t){return null==t?[]:Er(t,Ma(t))},zn.functionsIn=function(t){return null==t?[]:Er(t,Ia(t))},zn.groupBy=ws,zn.initial=function(t){return null!=t&&t.length?oo(t,0,-1):[]},zn.intersection=Gi,zn.intersectionBy=Yi,zn.intersectionWith=Xi,zn.invert=Na,zn.invertBy=Ta,zn.invokeMap=Es,zn.iteratee=su,zn.keyBy=Cs,zn.keys=Ma,zn.keysIn=Ia,zn.map=ks,zn.mapKeys=function(t,e){var n={};return e=ci(e,3),Dr(t,(function(t,r,o){sr(n,e(t,r,o),t)})),n},zn.mapValues=function(t,e){var n={};return e=ci(e,3),Dr(t,(function(t,r,o){sr(n,r,e(t,r,o))})),n},zn.matches=function(t){return zr(lr(t,1))},zn.matchesProperty=function(t,e){return Hr(t,lr(e,1))},zn.memoize=Bs,zn.merge=$a,zn.mergeWith=Ba,zn.method=au,zn.methodOf=uu,zn.mixin=lu,zn.negate=Rs,zn.nthArg=function(t){return t=ga(t),Xr((function(e){return Wr(e,t)}))},zn.omit=Ra,zn.omitBy=function(t,e){return Pa(t,Rs(ci(e)))},zn.once=function(t){return Ns(2,t)},zn.orderBy=function(e,n,r,o){return null==e?[]:(qs(n)||(n=null==n?[]:[n]),qs(r=o?t:r)||(r=null==r?[]:[r]),Ur(e,n,r))},zn.over=pu,zn.overArgs=Ls,zn.overEvery=fu,zn.overSome=hu,zn.partial=Ps,zn.partialRight=js,zn.partition=As,zn.pick=La,zn.pickBy=Pa,zn.property=du,zn.propertyOf=function(e){return function(n){return null==e?t:Cr(e,n)}},zn.pull=Zi,zn.pullAll=ts,zn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Kr(t,e,ci(n,2)):t},zn.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?Kr(e,n,t,r):e},zn.pullAt=es,zn.range=mu,zn.rangeRight=gu,zn.rearg=zs,zn.reject=function(t,e){return(qs(t)?xe:vr)(t,Rs(ci(e,3)))},zn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=ci(e,3);++r<i;){var s=t[r];e(s,r,t)&&(n.push(s),o.push(r))}return Jr(t,o),n},zn.rest=function(n,r){if("function"!=typeof n)throw new St(e);return Xr(n,r=r===t?r:ga(r))},zn.reverse=ns,zn.sampleSize=function(e,n,r){return n=(r?Di(e,n,r):n===t)?1:ga(n),(qs(e)?Zn:Zr)(e,n)},zn.set=function(t,e,n){return null==t?t:to(t,e,n)},zn.setWith=function(e,n,r,o){return o="function"==typeof o?o:t,null==e?e:to(e,n,r,o)},zn.shuffle=function(t){return(qs(t)?tr:ro)(t)},zn.slice=function(e,n,r){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&Di(e,n,r)?(n=0,r=o):(n=null==n?0:ga(n),r=r===t?o:ga(r)),oo(e,n,r)):[]},zn.sortBy=xs,zn.sortedUniq=function(t){return t&&t.length?uo(t):[]},zn.sortedUniqBy=function(t,e){return t&&t.length?uo(t,ci(e,2)):[]},zn.split=function(e,n,r){return r&&"number"!=typeof r&&Di(e,n,r)&&(n=r=t),(r=r===t?f:r>>>0)?(e=_a(e))&&("string"==typeof n||null!=n&&!aa(n))&&!(n=co(n))&&rn(e)?Eo(pn(e),0,r):e.split(n,r):[]},zn.spread=function(t,n){if("function"!=typeof t)throw new St(e);return n=null==n?0:bn(ga(n),0),Xr((function(e){var r=e[n],o=Eo(e,0,n);return r&&Te(o,r),we(t,this,o)}))},zn.tail=function(t){var e=null==t?0:t.length;return e?oo(t,1,e):[]},zn.take=function(e,n,r){return e&&e.length?oo(e,0,(n=r||n===t?1:ga(n))<0?0:n):[]},zn.takeRight=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,(n=o-(n=r||n===t?1:ga(n)))<0?0:n,o):[]},zn.takeRightWhile=function(t,e){return t&&t.length?mo(t,ci(e,3),!1,!0):[]},zn.takeWhile=function(t,e){return t&&t.length?mo(t,ci(e,3)):[]},zn.tap=function(t,e){return e(t),t},zn.throttle=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new St(e);return na(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),Ms(t,n,{leading:o,maxWait:n,trailing:i})},zn.thru=ms,zn.toArray=da,zn.toPairs=ja,zn.toPairsIn=za,zn.toPath=function(t){return qs(t)?Ne(t,Pi):ca(t)?[t]:To(Li(_a(t)))},zn.toPlainObject=ba,zn.transform=function(t,e,n){var r=qs(t),o=r||Ys(t)||pa(t);if(e=ci(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:na(t)&&Zs(i)?Hn(qt(t)):{}}return(o?Ce:Dr)(t,(function(t,r,o){return e(n,t,r,o)})),n},zn.unary=function(t){return Ss(t,1)},zn.union=rs,zn.unionBy=os,zn.unionWith=is,zn.uniq=function(t){return t&&t.length?po(t):[]},zn.uniqBy=function(t,e){return t&&t.length?po(t,ci(e,2)):[]},zn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?po(e,t,n):[]},zn.unset=function(t,e){return null==t||fo(t,e)},zn.unzip=ss,zn.unzipWith=as,zn.update=function(t,e,n){return null==t?t:ho(t,e,_o(n))},zn.updateWith=function(e,n,r,o){return o="function"==typeof o?o:t,null==e?e:ho(e,n,_o(r),o)},zn.values=Ha,zn.valuesIn=function(t){return null==t?[]:Ge(t,Ia(t))},zn.without=us,zn.words=Za,zn.wrap=function(t,e){return Ps(_o(e),t)},zn.xor=ls,zn.xorBy=cs,zn.xorWith=ps,zn.zip=fs,zn.zipObject=function(t,e){return yo(t||[],e||[],nr)},zn.zipObjectDeep=function(t,e){return yo(t||[],e||[],to)},zn.zipWith=hs,zn.entries=ja,zn.entriesIn=za,zn.extend=wa,zn.extendWith=Ea,lu(zn,zn),zn.add=_u,zn.attempt=tu,zn.camelCase=Va,zn.capitalize=Wa,zn.ceil=Du,zn.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=ya(r))==r?r:0),n!==t&&(n=(n=ya(n))==n?n:0),ur(ya(e),n,r)},zn.clone=function(t){return lr(t,4)},zn.cloneDeep=function(t){return lr(t,5)},zn.cloneDeepWith=function(e,n){return lr(e,5,n="function"==typeof n?n:t)},zn.cloneWith=function(e,n){return lr(e,4,n="function"==typeof n?n:t)},zn.conformsTo=function(t,e){return null==e||cr(t,e,Ma(e))},zn.deburr=Ua,zn.defaultTo=function(t,e){return null==t||t!=t?e:t},zn.divide=wu,zn.endsWith=function(e,n,r){e=_a(e),n=co(n);var o=e.length,i=r=r===t?o:ur(ga(r),0,o);return(r-=n.length)>=0&&e.slice(r,i)==n},zn.eq=Hs,zn.escape=function(t){return(t=_a(t))&&J.test(t)?t.replace(q,en):t},zn.escapeRegExp=function(t){return(t=_a(t))&&nt.test(t)?t.replace(et,"\\$&"):t},zn.every=function(e,n,r){var o=qs(e)?Ae:mr;return r&&Di(e,n,r)&&(n=t),o(e,ci(n,3))},zn.find=ys,zn.findIndex=Ui,zn.findKey=function(t,e){return Be(t,ci(e,3),Dr)},zn.findLast=bs,zn.findLastIndex=qi,zn.findLastKey=function(t,e){return Be(t,ci(e,3),wr)},zn.floor=Eu,zn.forEach=_s,zn.forEachRight=Ds,zn.forIn=function(t,e){return null==t?t:br(t,ci(e,3),Ia)},zn.forInRight=function(t,e){return null==t?t:_r(t,ci(e,3),Ia)},zn.forOwn=function(t,e){return t&&Dr(t,ci(e,3))},zn.forOwnRight=function(t,e){return t&&wr(t,ci(e,3))},zn.get=Oa,zn.gt=Vs,zn.gte=Ws,zn.has=function(t,e){return null!=t&&vi(t,e,Or)},zn.hasIn=Sa,zn.head=Ji,zn.identity=iu,zn.includes=function(t,e,n,r){t=Js(t)?t:Ha(t),n=n&&!r?ga(n):0;var o=t.length;return n<0&&(n=bn(o+n,0)),la(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Le(t,e,n)>-1},zn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ga(n);return o<0&&(o=bn(r+o,0)),Le(t,e,o)},zn.inRange=function(e,n,r){return n=ma(n),r===t?(r=n,n=0):r=ma(r),function(t,e,n){return t>=_n(e,n)&&t<bn(e,n)}(e=ya(e),n,r)},zn.invoke=Fa,zn.isArguments=Us,zn.isArray=qs,zn.isArrayBuffer=Ks,zn.isArrayLike=Js,zn.isArrayLikeObject=Gs,zn.isBoolean=function(t){return!0===t||!1===t||ra(t)&&Ar(t)==g},zn.isBuffer=Ys,zn.isDate=Xs,zn.isElement=function(t){return ra(t)&&1===t.nodeType&&!sa(t)},zn.isEmpty=function(t){if(null==t)return!0;if(Js(t)&&(qs(t)||"string"==typeof t||"function"==typeof t.splice||Ys(t)||pa(t)||Us(t)))return!t.length;var e=gi(t);if(e==w||e==x)return!t.size;if(ki(t))return!Rr(t).length;for(var n in t)if($t.call(t,n))return!1;return!0},zn.isEqual=function(t,e){return Mr(t,e)},zn.isEqualWith=function(e,n,r){var o=(r="function"==typeof r?r:t)?r(e,n):t;return o===t?Mr(e,n,t,r):!!o},zn.isError=Qs,zn.isFinite=function(t){return"number"==typeof t&&gn(t)},zn.isFunction=Zs,zn.isInteger=ta,zn.isLength=ea,zn.isMap=oa,zn.isMatch=function(t,e){return t===e||Ir(t,e,fi(e))},zn.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Ir(e,n,fi(n),r)},zn.isNaN=function(t){return ia(t)&&t!=+t},zn.isNative=function(t){if(Ci(t))throw new Et("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return $r(t)},zn.isNil=function(t){return null==t},zn.isNull=function(t){return null===t},zn.isNumber=ia,zn.isObject=na,zn.isObjectLike=ra,zn.isPlainObject=sa,zn.isRegExp=aa,zn.isSafeInteger=function(t){return ta(t)&&t>=-9007199254740991&&t<=c},zn.isSet=ua,zn.isString=la,zn.isSymbol=ca,zn.isTypedArray=pa,zn.isUndefined=function(e){return e===t},zn.isWeakMap=function(t){return ra(t)&&gi(t)==N},zn.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ar(t)},zn.join=function(t,e){return null==t?"":vn.call(t,e)},zn.kebabCase=qa,zn.last=Qi,zn.lastIndexOf=function(e,n,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==t&&(i=(i=ga(r))<0?bn(o+i,0):_n(i,o-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,i):Re(e,je,i,!0)},zn.lowerCase=Ka,zn.lowerFirst=Ja,zn.lt=fa,zn.lte=ha,zn.max=function(e){return e&&e.length?gr(e,iu,xr):t},zn.maxBy=function(e,n){return e&&e.length?gr(e,ci(n,2),xr):t},zn.mean=function(t){return ze(t,iu)},zn.meanBy=function(t,e){return ze(t,ci(e,2))},zn.min=function(e){return e&&e.length?gr(e,iu,Pr):t},zn.minBy=function(e,n){return e&&e.length?gr(e,ci(n,2),Pr):t},zn.stubArray=vu,zn.stubFalse=yu,zn.stubObject=function(){return{}},zn.stubString=function(){return""},zn.stubTrue=function(){return!0},zn.multiply=Cu,zn.nth=function(e,n){return e&&e.length?Wr(e,ga(n)):t},zn.noConflict=function(){return ce._===this&&(ce._=jt),this},zn.noop=cu,zn.now=Os,zn.pad=function(t,e,n){t=_a(t);var r=(e=ga(e))?cn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return qo($e(o),n)+t+qo(me(o),n)},zn.padEnd=function(t,e,n){t=_a(t);var r=(e=ga(e))?cn(t):0;return e&&r<e?t+qo(e-r,n):t},zn.padStart=function(t,e,n){t=_a(t);var r=(e=ga(e))?cn(t):0;return e&&r<e?qo(e-r,n)+t:t},zn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),wn(_a(t).replace(rt,""),e||0)},zn.random=function(e,n,r){if(r&&"boolean"!=typeof r&&Di(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=ma(e),n===t?(n=e,e=0):n=ma(n)),e>n){var o=e;e=n,n=o}if(r||e%1||n%1){var i=En();return _n(e+i*(n-e+se("1e-"+((i+"").length-1))),n)}return Gr(e,n)},zn.reduce=function(t,e,n){var r=qs(t)?Fe:We,o=arguments.length<3;return r(t,ci(e,4),n,o,hr)},zn.reduceRight=function(t,e,n){var r=qs(t)?Me:We,o=arguments.length<3;return r(t,ci(e,4),n,o,dr)},zn.repeat=function(e,n,r){return n=(r?Di(e,n,r):n===t)?1:ga(n),Yr(_a(e),n)},zn.replace=function(){var t=arguments,e=_a(t[0]);return t.length<3?e:e.replace(t[1],t[2])},zn.result=function(e,n,r){var o=-1,i=(n=Do(n,e)).length;for(i||(i=1,e=t);++o<i;){var s=null==e?t:e[Pi(n[o])];s===t&&(o=i,s=r),e=Zs(s)?s.call(e):s}return e},zn.round=ku,zn.runInContext=D,zn.sample=function(t){return(qs(t)?Qn:Qr)(t)},zn.size=function(t){if(null==t)return 0;if(Js(t))return la(t)?cn(t):t.length;var e=gi(t);return e==w||e==x?t.size:Rr(t).length},zn.snakeCase=Ga,zn.some=function(e,n,r){var o=qs(e)?Ie:io;return r&&Di(e,n,r)&&(n=t),o(e,ci(n,3))},zn.sortedIndex=function(t,e){return so(t,e)},zn.sortedIndexBy=function(t,e,n){return ao(t,e,ci(n,2))},zn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=so(t,e);if(r<n&&Hs(t[r],e))return r}return-1},zn.sortedLastIndex=function(t,e){return so(t,e,!0)},zn.sortedLastIndexBy=function(t,e,n){return ao(t,e,ci(n,2),!0)},zn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=so(t,e,!0)-1;if(Hs(t[n],e))return n}return-1},zn.startCase=Ya,zn.startsWith=function(t,e,n){return t=_a(t),n=null==n?0:ur(ga(n),0,t.length),e=co(e),t.slice(n,n+e.length)==e},zn.subtract=Au,zn.sum=function(t){return t&&t.length?Ue(t,iu):0},zn.sumBy=function(t,e){return t&&t.length?Ue(t,ci(e,2)):0},zn.template=function(e,n,r){var o=zn.templateSettings;r&&Di(e,n,r)&&(n=t),e=_a(e),n=Ea({},n,o,ti);var i,s,a=Ea({},n.imports,o.imports,ti),u=Ma(a),l=Ge(a,u),c=0,p=n.interpolate||bt,f="__p += '",h=xt((n.escape||bt).source+"|"+p.source+"|"+(p===X?pt:bt).source+"|"+(n.evaluate||bt).source+"|$","g"),d="//# sourceURL="+($t.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ne+"]")+"\n";e.replace(h,(function(t,n,r,o,a,u){return r||(r=o),f+=e.slice(c,u).replace(_t,nn),n&&(i=!0,f+="' +\n__e("+n+") +\n'"),a&&(s=!0,f+="';\n"+a+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),f+="';\n";var m=$t.call(n,"variable")&&n.variable;if(m){if(lt.test(m))throw new Et("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(s?f.replace(H,""):f).replace(V,"$1").replace(W,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=tu((function(){return Ct(u,d+"return "+f).apply(t,l)}));if(g.source=f,Qs(g))throw g;return g},zn.times=function(t,e){if((t=ga(t))<1||t>c)return[];var n=f,r=_n(t,f);e=ci(e),t-=f;for(var o=qe(r,e);++n<t;)e(n);return o},zn.toFinite=ma,zn.toInteger=ga,zn.toLength=va,zn.toLower=function(t){return _a(t).toLowerCase()},zn.toNumber=ya,zn.toSafeInteger=function(t){return t?ur(ga(t),-9007199254740991,c):0===t?t:0},zn.toString=_a,zn.toUpper=function(t){return _a(t).toUpperCase()},zn.trim=function(e,n,r){if((e=_a(e))&&(r||n===t))return Ke(e);if(!e||!(n=co(n)))return e;var o=pn(e),i=pn(n);return Eo(o,Xe(o,i),Qe(o,i)+1).join("")},zn.trimEnd=function(e,n,r){if((e=_a(e))&&(r||n===t))return e.slice(0,fn(e)+1);if(!e||!(n=co(n)))return e;var o=pn(e);return Eo(o,0,Qe(o,pn(n))+1).join("")},zn.trimStart=function(e,n,r){if((e=_a(e))&&(r||n===t))return e.replace(rt,"");if(!e||!(n=co(n)))return e;var o=pn(e);return Eo(o,Xe(o,pn(n))).join("")},zn.truncate=function(e,n){var r=30,o="...";if(na(n)){var i="separator"in n?n.separator:i;r="length"in n?ga(n.length):r,o="omission"in n?co(n.omission):o}var s=(e=_a(e)).length;if(rn(e)){var a=pn(e);s=a.length}if(r>=s)return e;var u=r-cn(o);if(u<1)return o;var l=a?Eo(a,0,u).join(""):e.slice(0,u);if(i===t)return l+o;if(a&&(u+=l.length-u),aa(i)){if(e.slice(u).search(i)){var c,p=l;for(i.global||(i=xt(i.source,_a(ft.exec(i))+"g")),i.lastIndex=0;c=i.exec(p);)var f=c.index;l=l.slice(0,f===t?u:f)}}else if(e.indexOf(co(i),u)!=u){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+o},zn.unescape=function(t){return(t=_a(t))&&K.test(t)?t.replace(U,hn):t},zn.uniqueId=function(t){var e=++Bt;return _a(t)+e},zn.upperCase=Xa,zn.upperFirst=Qa,zn.each=_s,zn.eachRight=Ds,zn.first=Ji,lu(zn,(bu={},Dr(zn,(function(t,e){$t.call(zn.prototype,e)||(bu[e]=t)})),bu),{chain:!1}),zn.VERSION="4.17.21",Ce(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){zn[t].placeholder=zn})),Ce(["drop","take"],(function(e,n){Un.prototype[e]=function(r){r=r===t?1:bn(ga(r),0);var o=this.__filtered__&&!n?new Un(this):this.clone();return o.__filtered__?o.__takeCount__=_n(r,o.__takeCount__):o.__views__.push({size:_n(r,f),type:e+(o.__dir__<0?"Right":"")}),o},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ce(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ci(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ce(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),Ce(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(iu)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Tr(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(Rs(ci(t)))},Un.prototype.slice=function(e,n){e=ga(e);var r=this;return r.__filtered__&&(e>0||n<0)?new Un(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=ga(n))<0?r.dropRight(-n):r.take(n-e)),r)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(f)},Dr(Un.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),i=zn[o?"take"+("last"==n?"Right":""):n],s=o||/^find/.test(n);i&&(zn.prototype[n]=function(){var n=this.__wrapped__,a=o?[1]:arguments,u=n instanceof Un,l=a[0],c=u||qs(n),p=function(t){var e=i.apply(zn,Te([t],a));return o&&f?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,h=!!this.__actions__.length,d=s&&!f,m=u&&!h;if(!s&&c){n=m?n:new Un(this);var g=e.apply(n,a);return g.__actions__.push({func:ms,args:[p],thisArg:t}),new Wn(g,f)}return d&&m?e.apply(this,a):(g=this.thru(p),d?o?g.value()[0]:g.value():g)})})),Ce(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Nt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);zn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(qs(o)?o:[],t)}return this[n]((function(n){return e.apply(qs(n)?n:[],t)}))}})),Dr(Un.prototype,(function(t,e){var n=zn[e];if(n){var r=n.name+"";$t.call(Fn,r)||(Fn[r]=[]),Fn[r].push({name:e,func:n})}})),Fn[Ho(t,2).name]=[{name:"wrapper",func:t}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=To(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=To(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=To(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qs(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],s=i.size;switch(i.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=_n(e,t+s);break;case"takeRight":t=bn(t,e-s)}}return{start:t,end:e}}(0,o,this.__views__),s=i.start,a=i.end,u=a-s,l=r?a:s-1,c=this.__iteratees__,p=c.length,f=0,h=_n(u,this.__takeCount__);if(!n||!r&&o==u&&h==u)return go(t,this.__actions__);var d=[];t:for(;u--&&f<h;){for(var m=-1,g=t[l+=e];++m<p;){var v=c[m],y=v.iteratee,b=v.type,_=y(g);if(2==b)g=_;else if(!_){if(1==b)continue t;break t}}d[f++]=g}return d},zn.prototype.at=gs,zn.prototype.chain=function(){return ds(this)},zn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},zn.prototype.next=function(){this.__values__===t&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},zn.prototype.plant=function(e){for(var n,r=this;r instanceof Vn;){var o=zi(r);o.__index__=0,o.__values__=t,n?i.__wrapped__=o:n=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,n},zn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var n=e;return this.__actions__.length&&(n=new Un(this)),(n=n.reverse()).__actions__.push({func:ms,args:[ns],thisArg:t}),new Wn(n,this.__chain__)}return this.thru(ns)},zn.prototype.toJSON=zn.prototype.valueOf=zn.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},zn.prototype.first=zn.prototype.head,ie&&(zn.prototype[ie]=function(){return this}),zn}();fe?((fe.exports=dn)._=dn,pe._=dn):ce._=dn}.call(D);var zh=new WeakSet,Hh=new WeakSet,Vh=new WeakSet,Wh=new WeakSet,Uh=new WeakSet,qh=new WeakSet,Kh=new WeakSet,Jh=new WeakSet,Gh=new WeakSet;class Yh extends rh{constructor(...t){super(...t),e(this,Gh),e(this,Jh),e(this,Kh),e(this,qh),e(this,Uh),e(this,Wh),e(this,Vh),e(this,Hh),e(this,zh)}normalize(){return i(this,zh,Xh).call(this,i(this,Vh,Zh)),this.content}}function Xh(t){i(this,Hh,Qh).call(this,this.content,t)}function Qh(t,e){for(const n of t.content)e.call(this,n),n.content&&i(this,Hh,Qh).call(this,n,e)}function Zh(t){if(t.content&&t.type!==Kf.LIST)for(const e of t.content)if(e.marks)for(const n of e.marks.slice())i(this,Wh,td).call(this,t,n)?(i(this,Kh,rd).call(this,e,n),i(this,Jh,od).call(this,t,n)):i(this,Uh,ed).call(this,t,n)&&i(this,Kh,rd).call(this,e,n)}function td(t,e){if(Gf.inlineMarks.includes(e.type))return!1;if(i(this,qh,nd).call(this,t,e.type))return!1;for(const n of t.content){if(!n.marks)return!1;if(!i(this,qh,nd).call(this,n,e.type))return!1}return!0}function ed(t,e){var n;return(null===(n=t.marks)||void 0===n?void 0:n.some((t=>jh.exports.isEqual(t,e))))??!1}function nd(t,e){var n;return(null===(n=t.marks)||void 0===n?void 0:n.some((t=>t.type===e)))??!1}function rd(t,e){if(!t.marks)return;const n=i(this,Gh,id).call(this,t,e.type);n>=0&&t.marks.splice(n,1),t.marks.length||delete t.marks}function od(t,e){i(this,Kh,rd).call(this,t,e),t.marks??(t.marks=[]),t.marks.push(e)}function id(t,e){var n;return(null===(n=t.marks)||void 0===n?void 0:n.findIndex((t=>t.type===e)))??null}class sd{static build(e,n={}){return"string"==typeof e?t(this,sd,ad).call(this,e,n):t(this,sd,ud).call(this,e)}static normalize(t,e={}){return sd.build(t,e).normalize()}}function ad(t,e){return new Dh({content:t,parser:e.parser||new nh})}function ud(t){return new Yh({content:t})}class ld{static window=globalThis.window;static use(t){this.window=t}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(t){return this.window.getComputedStyle(t)}}class cd{static doc(t){return{type:Kf.DOCUMENT,content:t}}static list(t,e){return{type:Kf.LIST,attrs:{bullet:{type:t}},content:e.map((t=>t.type===Kf.LIST_ITEM?t:this.listItem([].concat(t))))}}static listItem(...e){return{type:Kf.LIST_ITEM,...t(this,cd,pd).call(this,e,this.paragraph)}}static heading(e,...n){const r=t(this,cd,pd).call(this,n,this.text);return r.attrs??(r.attrs={}),r.attrs.level=e,{type:Kf.HEADING,...r}}static paragraph(...e){return{type:Kf.PARAGRAPH,...t(this,cd,pd).call(this,e,this.text)}}static text(t,e){return{type:Kf.TEXT,...e?{marks:e}:{},text:t}}static mark(t,e){return{type:t,attrs:e}}static populateAllDevices(t){return{mobile:null,tablet:t,desktop:t}}}function pd(e,n){const{attrs:r,content:o,marks:i}=t(this,cd,fd).call(this,e);return{content:"string"==typeof o?[n.call(this,o)]:o,...r?{attrs:r}:{},...i?{marks:i}:{}}}function fd(t){return 1===t.length?{attrs:null,marks:null,content:t[0]}:2===t.length?{attrs:t[0],marks:null,content:t[1]}:{attrs:t[0],marks:t[1],content:t[2]}}function hd(t,e){return t.split(" ").map((t=>`.${t}`)).join("")+e.id}const dd=Vp.create({name:"style_preset",addStorage:()=>({presetStyleEl:null}),addGlobalAttributes(){return[{types:[Kf.PARAGRAPH,Kf.HEADING],attributes:{preset:{isRequired:!1,default:{id:this.options.defaultId},parseHTML:t=>{const e=Ye(this.options.presets);if("LI"===t.parentElement.tagName)return null;for(const{id:n,node:r,fallbackClass:o}of e){if(o&&t.classList.contains(o))return{id:n};const e=hd(this.options.baseClass,{id:n});if(t.matches(e))return{id:n};if(t.tagName===`H${null==r?void 0:r.level}`)return{id:n}}return"P"===t.tagName?{id:this.options.defaultId}:null},renderHTML:t=>t.preset?{class:this.options.baseClass+t.preset.id}:null}}}]},addCommands(){function t(t,e){return t.find((t=>e===t.id))}function e(t,e){const n={};for(const r of Object.keys(t)){const o=t[r],i=e[r],s=!i||"inherit"===i.toLowerCase();n[r]=s?o:i}return n}return{getPresetList:yf((()=>Ze((()=>this.options.presets.filter((t=>!t.hidden)))))),getPreset:yf((({commands:n})=>{const r=n.getBlockAttributes("preset",{id:this.options.defaultId}),o=n.getPresetList(),i=n.isLink(),s=n.getLinkPreset();return Ze((()=>{const n=t(Ye(o),Ye(r).id);if(!Ye(i))return n;const a=Ye(s);return{id:n.id,common:e(n.common,a.common),mobile:e(n.mobile,a.mobile),tablet:e(n.tablet,a.tablet),desktop:e(n.desktop,a.desktop)}}))})),applyPreset:yf((({commands:e,chain:n},r)=>{var o;const i=t(Ye(e.getPresetList()),r),s=(null===(o=i.node)||void 0===o?void 0:o.type)??Kf.PARAGRAPH,a={preset:{id:r}};i.node&&(a.level=i.node.level);for(const t of Gf.attributes)a[t]=Ye(e.getBlockAttributes(t));n().removeList().setNode(s,a).run()})),applyDefaultPreset:yf((({commands:t})=>{t.applyPreset(this.options.defaultId)})),removePreset:yf((({commands:t})=>{t.setNode(Kf.PARAGRAPH,{preset:null})})),getPresetCustomization:yf((({editor:t})=>{const e=Qe(t,"state");return Ze((()=>{const t=new Set,n=new Set,{from:r,to:o}=e.value.selection;return e.value.doc.nodesBetween(r,o,(e=>{for(const[n,r]of Object.entries(e.attrs)){Gf.attributes.includes(n)&&r&&t.add(n)}for(const{type:t}of e.marks)Gf.marks.includes(t.name)&&n.add(t.name)})),{attributes:Array.from(t),marks:Array.from(n)}}))})),removePresetCustomization:yf((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(Gf.marks).resetAttributes(Kf.PARAGRAPH,Gf.attributes).resetAttributes(Kf.HEADING,Gf.attributes).restoreSelection().run()})),removeFormat:yf((({chain:t})=>{t().storeSelection().expandSelectionToBlock().unsetAllMarks().applyDefaultPreset().restoreSelection().run()}))}},onCreate(){const t=ld.document.querySelector("[data-zw-styles]");if(t)this.storage.presetStyleEl=t;else{this.storage.presetStyleEl=ld.document.createElement("style"),this.storage.presetStyleEl.dataset.zwStyles="";for(const t of this.options.presets){const e=[` ${hd(this.options.baseClass,t)} {`];for(const n of Wf.values)for(const r of Object.keys(t[n])){const o=this.options.makeVariable({device:n,preset:t,property:r}),i=r.replace(/_/i,"-"),s=n===Wf.COMMON?"preset":`preset-${n}`;e.push(`--zw-${s}-${i}: var(${o}, inherit);`)}e.push("}"),this.storage.presetStyleEl.innerHTML+=e.join(" ")}ld.head.append(this.storage.presetStyleEl)}}}),md=mf.create({name:Gf.FONT_WEIGHT,group:"settings",addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:yf((({commands:t},e)=>{t.applyMark(this.name,{value:e});Ye(t.getFont()).isItalicSupported(e)||t.removeItalic()})),toggleBold:yf((({commands:t})=>{const e=Ye(t.getFontWeight()),n=Ye(t.getFont()),r=Number(e)>=600?"400":"700",o=n.findClosestWeight(r);t.applyFontWeight(o)})),getFontWeight:yf((({commands:t})=>{const e=t.getCommonSettingMark(this.name,t.getDefaultFontWeight()),n=t.getFont();return Ze((()=>{const t=Ye(e),r=Ye(n);return r.isWeightSupported(t)?t:r.findClosestWeight(t)}))})),getDefaultFontWeight:yf((({commands:t})=>{const e=t.getPreset();return Ze((()=>Ye(e).common.font_weight))}))}},addKeyboardShortcuts:()=>({"Mod-b":Df("toggleBold"),"Mod-B":Df("toggleBold")}),parseHTML(){const t=t=>"bold"===t?{value:"700"}:!!Number(t)&&{value:t};return[{style:"--zw-font-weight",getAttrs:t},{style:"font-weight",getAttrs:t},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML:({HTMLAttributes:t})=>_f({font_weight:t.value})}),gd=mf.create({name:Gf.FONT_SIZE,group:"settings",addOptions:()=>({minSize:1,maxSize:100}),addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getFontSize:yf((({commands:t})=>t.getDeviceSettingMark(this.name,t.getDefaultFontSize()))),getDefaultFontSize:yf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Ze((()=>Ye(n)[Ye(e)].font_size.replace("px","")))})),applyFontSize:yf((({commands:t},e)=>{t.applyMark(this.name,{desktop:e,tablet:e,mobile:null})})),increaseFontSize:yf((({commands:t})=>{const e=Number(Ye(t.getFontSize())),n=Math.min(e+1,this.options.maxSize);t.applyFontSize(String(n))})),decreaseFontSize:yf((({commands:t})=>{const e=Number(Ye(t.getFontSize())),n=Math.max(e-1,this.options.minSize);t.applyFontSize(String(n))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Df("increaseFontSize"),"Mod-Shift--":Df("decreaseFontSize")}),parseHTML(){const t=t=>{if(!t)return null;const e=Hf(t,Ye(this.options.wrapperRef));return String(e)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:t(e.getPropertyValue("--zw-font-size-mobile")),tablet:t(e.getPropertyValue("--zw-font-size-tablet")),desktop:t(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const n=t(e);return{desktop:n,tablet:n,mobile:null}}}]},renderHTML({HTMLAttributes:t}){const e=t=>t?`${t}px`:null;return _f({font_size_mobile:e(t.mobile),font_size_tablet:e(t.tablet),font_size_desktop:e(t.desktop)})}}),vd=mf.create({name:Gf.FONT_COLOR,group:"settings",addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:yf((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontColor()))),getDefaultFontColor:yf((({commands:t})=>{const e=t.getPreset();return Ze((()=>Ye(e).common.color))})),applyFontColor:yf((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:zf(t)});return[{style:"--zw-font-color",getAttrs:t},{style:"color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>_f({font_color:t.value})}),yd=mf.create({name:Gf.BACKGROUND_COLOR,group:"settings",addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:yf((({commands:t})=>t.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)"))),applyBackgroundColor:yf((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:zf(t)});return[{style:"--zw-background-color",getAttrs:t},{style:"background-color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>_f({background_color:t.value})}),bd=Vp.create({name:"device_manager",addCommands(){return{getDevice:yf((()=>Qe(this.options,"device")))}}}),_d=mf.create({name:Gf.FONT_STYLE,group:"settings",addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:yf((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultFontStyle();return Ze((()=>{var t;return(null===(t=Ye(e))||void 0===t?void 0:t.italic)??Ye(n).italic}))})),isItalicAvailable:yf((({commands:t})=>{const e=t.getFont(),n=t.getFontWeight();return Ze((()=>Ye(e).isItalicSupported(Ye(n))))})),getDefaultFontStyle:yf((({commands:t})=>{const e=t.getPreset();return Ze((()=>({italic:"italic"===Ye(e).common.font_style})))})),toggleItalic:yf((({commands:t})=>{Ye(t.isItalicAvailable())&&(Ye(t.isItalic())?t.removeItalic():t.applyItalic())})),applyItalic:yf((({commands:t})=>{t.applyMark(this.name,{italic:!0})})),removeItalic:yf((({commands:t})=>{t.applyMark(this.name,{italic:!1})}))}},addKeyboardShortcuts:()=>({"Mod-i":Df("toggleItalic"),"Mod-I":Df("toggleItalic")}),parseHTML(){const t=t=>({italic:t.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:t},{style:"font-style",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>_f({font_style:t.italic?"italic":"normal"})}),Dd=mf.create({name:Gf.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:yf((({commands:t})=>{const e=t.getTextDecoration();return Ze((()=>Ye(e).underline))})),isStrikeThrough:yf((({commands:t})=>{const e=t.getTextDecoration();return Ze((()=>Ye(e).strike_through))})),getTextDecoration:yf((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultTextDecoration();return Ze((()=>{const t=Ye(e)??{},r=Ye(n);return{underline:t.underline||r.underline,strike_through:t.strike_through||r.strike_through}}))})),getDefaultTextDecoration:yf((({commands:t})=>{const e=t.getPreset();return Ze((()=>{const{text_decoration:t}=Ye(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:yf((({commands:t})=>{t.toggleTextDecoration("underline")})),toggleStrikeThrough:yf((({commands:t})=>{t.toggleTextDecoration("strike_through")})),toggleTextDecoration:yf((({commands:t},e,n=null)=>{const r=Ye(t.getTextDecoration()),o=n??!r[e];t.applyMark(this.name,{[e]:o})})),applyTextDecoration:yf((({commands:t},e)=>{t.toggleTextDecoration(e,!0)})),removeTextDecoration:yf((({commands:t},e)=>{t.toggleTextDecoration(e,!1)}))}},addKeyboardShortcuts:()=>({"Mod-u":Df("toggleUnderline"),"Mod-U":Df("toggleUnderline")}),parseHTML(){const t=t=>{const e=t.includes("underline"),n=t.includes("line-through");return!(!e&&!n)&&{underline:e,strike_through:n}};return[{style:"--zw-text-decoration",getAttrs:t},{style:"text-decoration-line",getAttrs:t},{style:"text-decoration",getAttrs:t},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:t}){const e=[];return t.underline&&e.push("underline"),t.strike_through&&e.push("line-through"),e.length||e.push("none"),_f({text_decoration:e.join(" ")})}}),wd=Vp.create({name:"case_style",addCommands:()=>({applyCaseStyle:yf((({commands:t},e)=>{switch(e){case Uf.CAPITALIZE:return t.applyCapitalize();case Uf.LOWERCASE:return t.applyLowerCase();case Uf.UPPERCASE:return t.applyUpperCase()}})),applyCapitalize:yf((({commands:t})=>{t.transformText((({text:t})=>function(t){return t.toLowerCase().replace(/(?:^|\s)\S/g,(t=>t.toUpperCase()))}(t)))})),applyLowerCase:yf((({commands:t})=>{t.transformText((({text:t})=>t.toLowerCase()))})),applyUpperCase:yf((({commands:t})=>{t.transformText((({text:t})=>t.toUpperCase()))}))})}),Ed={mobile:null,tablet:null,desktop:null},Cd=Vp.create({name:Gf.ALIGNMENT,addGlobalAttributes:()=>[{types:[Kf.PARAGRAPH,Kf.HEADING],attributes:{[Gf.ALIGNMENT]:{isRequired:!1,parseHTML({style:t}){const e=function(t){const e=Qf[t]||t;return qf.values.includes(e)?e:null}(t.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const n=t.getPropertyValue("--zw-text-align-mobile")||null,r=t.getPropertyValue("--zw-text-align-tablet")||null,o=t.getPropertyValue("--zw-text-align-desktop")||null;return n||r||o?{desktop:o,tablet:r,mobile:n}:null},renderHTML:t=>t.alignment?bf({text_align_mobile:t.alignment.mobile,text_align_tablet:t.alignment.tablet,text_align_desktop:t.alignment.desktop}):null}}}],addCommands(){return{applyAlignment:yf((({commands:t},e)=>{t.setBlockAttributes(this.name,{desktop:e,tablet:e,mobile:e})})),getAlignment:yf((({commands:t})=>{const e=t.getBlockAttributes(this.name,Ed),n=t.getDevice(),r=t.getDefaultAlignment();return Ze((()=>{var t;return(null===(t=Ye(e))||void 0===t?void 0:t[Ye(n)])??Ye(r)}))})),getDefaultAlignment:yf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Ze((()=>Ye(n)[Ye(e)].alignment))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Df("applyAlignment",qf.LEFT),"Mod-Shift-e":Df("applyAlignment",qf.CENTER),"Mod-Shift-r":Df("applyAlignment",qf.RIGHT),"Mod-Shift-j":Df("applyAlignment",qf.JUSTIFY)})}),kd={mobile:null,tablet:null,desktop:null},Ad=Vp.create({name:Gf.LINE_HEIGHT,addGlobalAttributes(){return[{types:[Kf.PARAGRAPH,Kf.HEADING],attributes:{[Gf.LINE_HEIGHT]:{isRequired:!1,parseHTML:t=>{if(t.matches('[style*="--zw-line-height"]')){return{mobile:null,tablet:t.style.getPropertyValue("--zw-line-height-tablet")||null,desktop:t.style.getPropertyValue("--zw-line-height-desktop")||null}}const e=t.style.lineHeight;if(!e)return null;const n=Vf(e,t,Ye(this.options.wrapperRef));return{desktop:n,tablet:n,mobile:null}},renderHTML:t=>t.line_height?bf({line_height_mobile:t.line_height.mobile,line_height_tablet:t.line_height.tablet,line_height_desktop:t.line_height.desktop}):null}}}]},addCommands(){return{getLineHeight:yf((({commands:t})=>{const e=t.getBlockAttributes(this.name,kd),n=t.getDevice(),r=t.getDefaultLineHeight();return Ze((()=>{var t;return(null===(t=Ye(e))||void 0===t?void 0:t[Ye(n)])??Ye(r)}))})),getDefaultLineHeight:yf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Ze((()=>Ye(n)[Ye(e)].line_height))})),applyLineHeight:yf((({commands:t},e)=>{t.setBlockAttributes(this.name,{desktop:e,tablet:e,mobile:null},kd)}))}}}),xd=gf.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",kp(this.options.HTMLAttributes,t),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)}}}).extend({name:Kf.LIST_ITEM,marks:"settings",addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts(){const{Enter:t}=this.parent();return{Enter:t}}}),Od=gf.create({name:Kf.LIST,content:`${Kf.LIST_ITEM}+`,group:"block list",marks:"settings",addExtensions:()=>[xd],addOptions:()=>({baseClass:""}),addAttributes:()=>({bullet:{default:{type:Jf.DISC}}}),parseHTML(){const t={a:Jf.ROMAN,i:Jf.LATIN,1:Jf.DECIMAL},e=e=>{for(const n of Jf.values){const r=`.${this.options.baseClass}${n}`;if(e.matches(r))return n;if(t[e.type.toLowerCase()]===n)return n}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Jf.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Jf.DISC}})}]},renderHTML({HTMLAttributes:t}){return[Jf.ordered.includes(t.bullet.type)?"ol":"ul",{class:this.options.baseClass+t.bullet.type},0]},addCommands:()=>({getListType:yf((({commands:t})=>{const e=t.getBlockAttributes("bullet",{type:null});return Ze((()=>Ye(e).type??null))})),applyList:yf((({commands:t,chain:e},n)=>{if(Ye(t.getListType())!==n)return e().applyDefaultPreset()._addList(n).run();t.applyDefaultPreset()})),_addList:yf((({chain:t},e)=>t().toggleList(Kf.LIST,Kf.LIST_ITEM).setBlockAttributes("bullet",{type:e}).run())),removeList:yf((({commands:t})=>{t.liftListItem(Kf.LIST_ITEM)}))}),addInputRules(){const t=(t,e)=>function(t){return new Ip({find:t.find,handler:({state:e,range:n,match:r})=>{const o=xp(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),s=i.doc.resolve(n.from).blockRange(),a=s&&Eu(s,t.type,o);if(!a)return null;i.wrap(s,a);const u=i.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Au(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&i.join(n.from-1)}})}({find:e,type:this.type,getAttributes:{bullet:{type:t}},joinPredicate:(e,{attrs:n})=>n.bullet.type===t});return[t(Jf.DISC,/^\s*([-+*])\s$/),t(Jf.DECIMAL,/^(\d+)\.\s$/),t(Jf.LATIN,/^([ivx]{1,3})\.\s$/i),t(Jf.ROMAN,/^([a-z])\.\s$/i)]}});function Sd(t){this.j={},this.jr=[],this.jd=null,this.t=t}Sd.prototype={accepts:function(){return!!this.t},tt:function(t,e){if(e&&e.j)return this.j[t]=e,e;var n=e,r=this.j[t];if(r)return n&&(r.t=n),r;r=Nd();var o=Id(this,t);return o?(Object.assign(r.j,o.j),r.jr.append(o.jr),r.jr=o.jd,r.t=n||o.t):r.t=n,this.j[t]=r,r}};var Nd=function(){return new Sd},Td=function(t){return new Sd(t)},Fd=function(t,e,n){t.j[e]||(t.j[e]=n)},Md=function(t,e,n){t.jr.push([e,n])},Id=function(t,e){var n=t.j[e];if(n)return n;for(var r=0;r<t.jr.length;r++){var o=t.jr[r][0],i=t.jr[r][1];if(o.test(e))return i}return t.jd},$d=function(t,e,n){for(var r=0;r<e.length;r++)Fd(t,e[r],n)},Bd=function(t,e){for(var n=0;n<e.length;n++){var r=e[n][0],o=e[n][1];Fd(t,r,o)}},Rd=function(t,e,n,r){for(var o,i=0,s=e.length;i<s&&(o=t.j[e[i]]);)t=o,i++;if(i>=s)return[];for(;i<s-1;)o=r(),Fd(t,e[i],o),t=o,i++;Fd(t,e[s-1],n)},Ld="DOMAIN",Pd="TLD",jd="NUM",zd="AT",Hd="DOT",Vd="SLASH",Wd=Object.freeze({__proto__:null,DOMAIN:Ld,LOCALHOST:"LOCALHOST",TLD:Pd,NUM:jd,PROTOCOL:"PROTOCOL",MAILTO:"MAILTO",WS:"WS",NL:"NL",OPENBRACE:"OPENBRACE",OPENBRACKET:"OPENBRACKET",OPENANGLEBRACKET:"OPENANGLEBRACKET",OPENPAREN:"OPENPAREN",CLOSEBRACE:"CLOSEBRACE",CLOSEBRACKET:"CLOSEBRACKET",CLOSEANGLEBRACKET:"CLOSEANGLEBRACKET",CLOSEPAREN:"CLOSEPAREN",AMPERSAND:"AMPERSAND",APOSTROPHE:"APOSTROPHE",ASTERISK:"ASTERISK",AT:zd,BACKSLASH:"BACKSLASH",BACKTICK:"BACKTICK",CARET:"CARET",COLON:"COLON",COMMA:"COMMA",DOLLAR:"DOLLAR",DOT:Hd,EQUALS:"EQUALS",EXCLAMATION:"EXCLAMATION",HYPHEN:"HYPHEN",PERCENT:"PERCENT",PIPE:"PIPE",PLUS:"PLUS",POUND:"POUND",QUERY:"QUERY",QUOTE:"QUOTE",SEMI:"SEMI",SLASH:Vd,TILDE:"TILDE",UNDERSCORE:"UNDERSCORE",SYM:"SYM"}),Ud="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw vermögensberater-ctb vermögensberatung-pwb ελ ευ бг бел дети ею католик ком қаз мкд мон москва онлайн орг рус рф сайт срб укр გე հայ ישראל קום ابوظبي اتصالات ارامكو الاردن البحرين الجزائر السعودية العليان المغرب امارات ایران بارت بازار بھارت بيتك پاکستان ڀارت تونس سودان سورية شبكة عراق عرب عمان فلسطين قطر كاثوليك كوم مصر مليسيا موريتانيا موقع همراه कॉम नेट भारत भारतम् भारोत संगठन বাংলা ভারত ভাৰত ਭਾਰਤ ભારત ଭାରତ இந்தியா இலங்கை சிங்கப்பூர் భారత్ ಭಾರತ ഭാരതം ලංකා คอม ไทย ລາວ 닷넷 닷컴 삼성 한국 アマゾン グーグル クラウド コム ストア セール ファッション ポイント みんな 世界 中信 中国 中國 中文网 亚马逊 企业 佛山 信息 健康 八卦 公司 公益 台湾 台灣 商城 商店 商标 嘉里 嘉里大酒店 在线 大众汽车 大拿 天主教 娱乐 家電 广东 微博 慈善 我爱你 手机 招聘 政务 政府 新加坡 新闻 时尚 書籍 机构 淡马锡 游戏 澳門 点看 移动 组织机构 网址 网店 网站 网络 联通 诺基亚 谷歌 购物 通販 集团 電訊盈科 飞利浦 食品 餐厅 香格里拉 香港".split(" "),qd=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,Kd=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,Jd=/\uFE0F/,Gd=/\d/,Yd=/\s/;function Xd(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=Nd(),n=Td(jd),r=Td(Ld),o=Nd(),i=Td("WS"),s=[[Gd,r],[qd,r],[Kd,r],[Jd,r]],a=function(){var t=Td(Ld);return t.j={"-":o},t.jr=[].concat(s),t},u=function(t){var e=a();return e.t=t,e};Bd(e,[["'",Td("APOSTROPHE")],["{",Td("OPENBRACE")],["[",Td("OPENBRACKET")],["<",Td("OPENANGLEBRACKET")],["(",Td("OPENPAREN")],["}",Td("CLOSEBRACE")],["]",Td("CLOSEBRACKET")],[">",Td("CLOSEANGLEBRACKET")],[")",Td("CLOSEPAREN")],["&",Td("AMPERSAND")],["*",Td("ASTERISK")],["@",Td(zd)],["`",Td("BACKTICK")],["^",Td("CARET")],[":",Td("COLON")],[",",Td("COMMA")],["$",Td("DOLLAR")],[".",Td(Hd)],["=",Td("EQUALS")],["!",Td("EXCLAMATION")],["-",Td("HYPHEN")],["%",Td("PERCENT")],["|",Td("PIPE")],["+",Td("PLUS")],["#",Td("POUND")],["?",Td("QUERY")],['"',Td("QUOTE")],["/",Td(Vd)],[";",Td("SEMI")],["~",Td("TILDE")],["_",Td("UNDERSCORE")],["\\",Td("BACKSLASH")]]),Fd(e,"\n",Td("NL")),Md(e,Yd,i),Fd(i,"\n",Nd()),Md(i,Yd,i);for(var l=0;l<Ud.length;l++)Rd(e,Ud[l],u(Pd),a);var c=a(),p=a(),f=a(),h=a();Rd(e,"file",c,a),Rd(e,"ftp",p,a),Rd(e,"http",f,a),Rd(e,"mailto",h,a);var d=a(),m=Td("PROTOCOL"),g=Td("MAILTO");Fd(p,"s",d),Fd(p,":",m),Fd(f,"s",d),Fd(f,":",m),Fd(c,":",m),Fd(d,":",m),Fd(h,":",g);for(var v=a(),y=0;y<t.length;y++)Rd(e,t[y],v,a);return Fd(v,":",m),Rd(e,"localhost",u("LOCALHOST"),a),Md(e,Gd,n),Md(e,qd,r),Md(e,Kd,r),Md(e,Jd,r),Md(n,Gd,n),Md(n,qd,r),Md(n,Kd,r),Md(n,Jd,r),Fd(n,"-",o),Fd(r,"-",o),Fd(o,"-",o),Md(r,Gd,r),Md(r,qd,r),Md(r,Kd,r),Md(r,Jd,r),Md(o,Gd,r),Md(o,qd,r),Md(o,Kd,r),Md(o,Jd,r),e.jd=Td("SYM"),e}var Qd={defaultProtocol:"http",events:null,format:Zd,formatHref:Zd,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function Zd(t){return t}function tm(){}function em(t,e){function n(e,n){this.t=t,this.v=e,this.tk=n}return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(t.prototype);for(var o in n)r[o]=n[o];r.constructor=e,e.prototype=r}(tm,n,e),n}tm.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qd.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}}};var nm=em("email",{isLink:!0}),rm=em("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),om=em("text"),im=em("nl"),sm=em("url",{isLink:!0,toHref:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qd.defaultProtocol,e=this.tk,n=!1,r=!1,o=[],i=0;"PROTOCOL"===e[i].t;)n=!0,o.push(e[i].v),i++;for(;e[i].t===Vd;)r=!0,o.push(e[i].v),i++;for(;i<e.length;i++)o.push(e[i].v);return o=o.join(""),n||r||(o="".concat(t,"://").concat(o)),o},hasProtocol:function(){return"PROTOCOL"===this.tk[0].t}}),am=Object.freeze({__proto__:null,MultiToken:tm,Base:tm,createTokenClass:em,MailtoEmail:nm,Email:rm,Text:om,Nl:im,Url:sm});function um(){var t=Nd(),e=Nd(),n=Nd(),r=Nd(),o=Nd(),i=Nd(),s=Nd(),a=Td(sm),u=Nd(),l=Td(sm),c=Td(sm),p=Nd(),f=Nd(),h=Nd(),d=Nd(),m=Nd(),g=Td(sm),v=Td(sm),y=Td(sm),b=Td(sm),_=Nd(),D=Nd(),w=Nd(),E=Nd(),C=Nd(),k=Nd(),A=Td(rm),x=Nd(),O=Td(rm),S=Td(nm),N=Nd(),T=Nd(),F=Nd(),M=Nd(),I=Td(im);Fd(t,"NL",I),Fd(t,"PROTOCOL",e),Fd(t,"MAILTO",n),Fd(e,Vd,r),Fd(r,Vd,o),Fd(t,Pd,i),Fd(t,Ld,i),Fd(t,"LOCALHOST",a),Fd(t,jd,i),Fd(o,Pd,c),Fd(o,Ld,c),Fd(o,jd,c),Fd(o,"LOCALHOST",c),Fd(i,Hd,s),Fd(C,Hd,k),Fd(s,Pd,a),Fd(s,Ld,i),Fd(s,jd,i),Fd(s,"LOCALHOST",i),Fd(k,Pd,A),Fd(k,Ld,C),Fd(k,jd,C),Fd(k,"LOCALHOST",C),Fd(a,Hd,s),Fd(A,Hd,k),Fd(a,"COLON",u),Fd(a,Vd,c),Fd(u,jd,l),Fd(l,Vd,c),Fd(A,"COLON",x),Fd(x,jd,O);var $=["AMPERSAND","ASTERISK",zd,"BACKSLASH","BACKTICK","CARET","DOLLAR",Ld,"EQUALS","HYPHEN","LOCALHOST",jd,"PERCENT","PIPE","PLUS","POUND","PROTOCOL",Vd,"SYM","TILDE",Pd,"UNDERSCORE"],B=["APOSTROPHE","CLOSEANGLEBRACKET","CLOSEBRACE","CLOSEBRACKET","CLOSEPAREN","COLON","COMMA",Hd,"EXCLAMATION","OPENANGLEBRACKET","OPENBRACE","OPENBRACKET","OPENPAREN","QUERY","QUOTE","SEMI"];Fd(c,"OPENBRACE",f),Fd(c,"OPENBRACKET",h),Fd(c,"OPENANGLEBRACKET",d),Fd(c,"OPENPAREN",m),Fd(p,"OPENBRACE",f),Fd(p,"OPENBRACKET",h),Fd(p,"OPENANGLEBRACKET",d),Fd(p,"OPENPAREN",m),Fd(f,"CLOSEBRACE",c),Fd(h,"CLOSEBRACKET",c),Fd(d,"CLOSEANGLEBRACKET",c),Fd(m,"CLOSEPAREN",c),Fd(g,"CLOSEBRACE",c),Fd(v,"CLOSEBRACKET",c),Fd(y,"CLOSEANGLEBRACKET",c),Fd(b,"CLOSEPAREN",c),Fd(_,"CLOSEBRACE",c),Fd(D,"CLOSEBRACKET",c),Fd(w,"CLOSEANGLEBRACKET",c),Fd(E,"CLOSEPAREN",c),$d(f,$,g),$d(h,$,v),$d(d,$,y),$d(m,$,b),$d(f,B,_),$d(h,B,D),$d(d,B,w),$d(m,B,E),$d(g,$,g),$d(v,$,v),$d(y,$,y),$d(b,$,b),$d(g,B,g),$d(v,B,v),$d(y,B,y),$d(b,B,b),$d(_,$,g),$d(D,$,v),$d(w,$,y),$d(E,$,b),$d(_,B,_),$d(D,B,D),$d(w,B,w),$d(E,B,E),$d(c,$,c),$d(p,$,c),$d(c,B,p),$d(p,B,p),Fd(n,Pd,S),Fd(n,Ld,S),Fd(n,jd,S),Fd(n,"LOCALHOST",S),$d(S,$,S),$d(S,B,N),$d(N,$,S),$d(N,B,N);var R=["AMPERSAND","APOSTROPHE","ASTERISK","BACKSLASH","BACKTICK","CARET","CLOSEBRACE","DOLLAR",Ld,"EQUALS","HYPHEN",jd,"OPENBRACE","PERCENT","PIPE","PLUS","POUND","QUERY",Vd,"SYM","TILDE",Pd,"UNDERSCORE"];return $d(i,R,T),Fd(i,zd,F),$d(a,R,T),Fd(a,zd,F),$d(s,R,T),$d(T,R,T),Fd(T,zd,F),Fd(T,Hd,M),$d(M,R,T),Fd(F,Pd,C),Fd(F,Ld,C),Fd(F,jd,C),Fd(F,"LOCALHOST",A),t}function lm(t,e,n){var r=n[0].s,o=n[n.length-1].e;return new t(e.substr(r,o-r),n)}var cm="undefined"!=typeof console&&console&&console.warn||function(){},pm={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function fm(t){if(pm.initialized&&cm('linkifyjs: already initialized - will not register custom protocol "'.concat(t,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(t))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");pm.customProtocols.push(t)}function hm(t){return pm.initialized||function(){pm.scanner={start:Xd(pm.customProtocols),tokens:Wd},pm.parser={start:um(),tokens:am};for(var t={createTokenClass:em},e=0;e<pm.pluginQueue.length;e++)pm.pluginQueue[e][1]({scanner:pm.scanner,parser:pm.parser,utils:t});pm.initialized=!0}(),function(t,e,n){for(var r=n.length,o=0,i=[],s=[];o<r;){for(var a=t,u=null,l=null,c=0,p=null,f=-1;o<r&&!(u=Id(a,n[o].t));)s.push(n[o++]);for(;o<r&&(l=u||Id(a,n[o].t));)u=null,(a=l).accepts()?(f=0,p=a):f>=0&&f++,o++,c++;if(f<0)for(var h=o-c;h<o;h++)s.push(n[h]);else{s.length>0&&(i.push(lm(om,e,s)),s=[]),o-=f,c-=f;var d=p.t,m=n.slice(o-c,o);i.push(lm(d,e,m))}}return s.length>0&&i.push(lm(om,e,s)),i}(pm.parser.start,t,function(t,e){for(var n=function(t){for(var e=[],n=t.length,r=0;r<n;){var o=t.charCodeAt(r),i=void 0,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(function(t){return t.toLowerCase()}))),r=n.length,o=[],i=0,s=0;s<r;){for(var a=t,u=null,l=0,c=null,p=-1,f=-1;s<r&&(u=Id(a,n[s]));)(a=u).accepts()?(p=0,f=0,c=a):p>=0&&(p+=n[s].length,f++),l+=n[s].length,i+=n[s].length,s++;i-=p,s-=f,l-=p,o.push({t:c.t,v:e.substr(i-l,l),s:i-l,e:i})}return o}(pm.scanner.start,t))}function dm(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=hm(t),r=[],o=0;o<n.length;o++){var i=n[o];!i.isLink||e&&i.t!==e||r.push(i.toObject())}return r}function mm(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=hm(t);return 1===n.length&&n[0].isLink&&(!e||n[0].t===e)}function gm(t){return new nl({key:new il("autolink"),appendTransaction:(e,n,r)=>{const o=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),i=e.some((t=>t.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(t,e){const n=new Pu(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}(n.doc,[...e]),{mapping:u}=a,l=function(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach(((t,o)=>{const i=[];if(t.ranges.length)t.forEach(((t,e)=>{i.push({from:t,to:e})}));else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;i.push({from:t,to:e})}i.forEach((({from:t,to:n})=>{const i=e.slice(o).map(t,-1),s=e.slice(o).map(n),a=e.invert().map(i,-1),u=e.invert().map(s);r.push({oldRange:{from:a,to:u},newRange:{from:i,to:s}})}))})),hf(r)}(a);return l.forEach((({oldRange:e,newRange:o})=>{df(e.from,e.to,n.doc).filter((e=>e.mark.type===t.type)).forEach((e=>{const o=df(u.map(e.from),u.map(e.to),r.doc).filter((e=>e.mark.type===t.type));if(!o.length)return;const i=o[0],a=n.doc.textBetween(e.from,e.to,void 0," "),l=r.doc.textBetween(i.from,i.to,void 0," "),c=mm(a),p=mm(l);c&&!p&&s.removeMark(i.from,i.to,t.type)})),function(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&r.push({node:t,pos:e})})),r}(r.doc,o,(t=>t.isTextblock)).forEach((e=>{dm(r.doc.textBetween(e.pos,e.pos+e.node.nodeSize,void 0," ")).filter((t=>t.isLink)).filter((e=>!t.validate||t.validate(e.value))).map((t=>({...t,from:e.pos+t.start+1,to:e.pos+t.end+1}))).filter((t=>{const e=o.from>=t.from&&o.from<=t.to,n=o.to>=t.from&&o.to<=t.to;return e||n})).forEach((e=>{s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}))})),s.steps.length?s:void 0}})}const vm=mf.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(fm)},inclusive(){return this.options.autolink},addOptions:()=>({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},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",kp(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vf({find:t=>dm(t).filter((t=>!this.options.validate||this.options.validate(t.value))).filter((t=>t.isLink)).map((t=>({text:t.value,index:t.start,data:t}))),type:this.type,getAttributes:t=>{var e;return{href:null===(e=t.data)||void 0===e?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];var e;return this.options.autolink&&t.push(gm({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new nl({key:new il("handleClickLink"),props:{handleClick:(t,n,r)=>{var o;const i=ff(t.state,e.type.name);return!(!(null===(o=r.target)||void 0===o?void 0:o.closest("a"))||!i.href||(window.open(i.href,i.target),0))}}}))),this.options.linkOnPaste&&t.push(function(t){return new nl({key:new il("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((t=>{a+=t.textContent}));const u=dm(a).find((t=>t.isLink&&t.value===a));return!(!a||!u||(t.editor.commands.setMark(t.type,{href:u.href}),0))}}})}({editor:this.editor,type:this.type})),t}}),ym=vm.extend({name:Gf.LINK,addOptions(){var t;return{...null===(t=this.parent)||void 0===t?void 0:t.call(this),openOnClick:!1}},addAttributes(){return{href:{default:null,parseHTML:t=>{const e=t.getAttribute("href");return e.startsWith("#")?parseFloat(t.getAttribute("href").replace("#","")):e}},target:{default:Yf.SELF,parseHTML:t=>t.getAttribute("target")||Yf.SELF},destination:{default:Xf.URL,parseHTML:t=>{const e=t.getAttribute("href");if(!e.startsWith("#"))return Xf.URL;const n=e.replace("#","");return Ye(this.options.pageBlocks).find((t=>t.id===parseInt(n)))?Xf.BLOCK:Xf.URL}}}},addCommands(){var t;return{...null===(t=this.parent)||void 0===t?void 0:t.call(this),applyLink:yf((({commands:t,chain:e},n)=>t.getSelectedText()?e().applyMark(this.name,n).transformText((()=>n.text)).extendMarkRange(Gf.LINK).run():t.insertContent(cd.text(n.text,[cd.mark(Gf.LINK,n)])))),isLink:yf((({editor:t})=>Ze((()=>t.isActive(Gf.LINK))))),getLinkPreset:yf((()=>Ze((()=>this.options.preset))))}},renderHTML({HTMLAttributes:t}){const e=t.destination===Xf.BLOCK?`#${t.href}`:t.href,n=`${this.options.basePresetClass+this.options.preset.id} zw-style`;return["a",{href:e,target:t.target,class:n},0]}}),bm=mf.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML({HTMLAttributes:t}){return["sup",kp(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),_m=bm.extend({name:Gf.SUPERSCRIPT,addKeyboardShortcuts:null,addOptions:()=>({HTMLAttributes:{class:"zw-superscript"}}),addCommands(){return{...this.parent(),toggleSuperscript:yf((({commands:t})=>{Ye(t.isSuperscript())?t.unsetSuperscript():t.setSuperscript()})),isSuperscript:yf((({commands:t})=>{const e=t.getMark(this.name);return Ze((()=>!!Ye(e)))}))}}}),Dm=gf.create({name:"text",group:"inline"}),wm=Vp.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new nl({props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];return n?(t.descendants(((t,e)=>{const n=r>=e&&r<=e+t.nodeSize,i=!t.isLeaf&&!t.childCount;if((n||!this.options.showOnlyCurrent)&&i){const r=[this.options.emptyNodeClass];this.editor.isEmpty&&r.push(this.options.emptyEditorClass);const i=$c.node(e,e+t.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:e,hasAnchor:n}):this.options.placeholder});o.push(i)}return this.options.includeChildren})),Lc.create(t,o)):null}}})]}});var Em=function(){};Em.prototype.append=function(t){return t.length?(t=Em.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},Em.prototype.prepend=function(t){return t.length?Em.from(t).append(this):this},Em.prototype.appendInner=function(t){return new km(this,t)},Em.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Em.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Em.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Em.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Em.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Em.from=function(t){return t instanceof Em?t:t&&t.length?new Cm(t):Em.empty};var Cm=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Em);Em.empty=new Cm([]);var km=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Em),Am=Em;class xm{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,u=[],l=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void l.push(t);if(n){l.push(new Om(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],u.push(new Om(e,void 0,void 0,u.length+l.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new xm(this.items.slice(0,o).append(l.reverse().concat(u)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let u,l=t.steps[n].invert(t.docs[n]),c=new Om(t.mapping.maps[n],l,e);(u=a&&a.merge(c))&&(c=u,n?o.pop():s=s.slice(0,s.length-1)),o.push(c),e&&(i++,e=void 0),r||(a=c)}let u=i-n.depth;return u>Nm&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,u),i-=u),new xm(s.append(o),i)}remapping(t,e){let n=new pu;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new xm(this.items.append(t.map((t=>new Om(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let u=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(o.slice(a+1,r));l&&s++,n.push(new Om(u,i,l))}else n.push(new Om(u))}),r);let u=[];for(let t=e;t<i;t++)u.push(new Om(o.maps[t]));let l=this.items.slice(0,r).append(u).append(n),c=new xm(l,s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let u,l=new Om(s.invert(),t,a),c=r.length-1;(u=r.length&&r[c].merge(l))?r[c]=u:r.push(l)}}else i.map&&n--}),this.items.length,0),new xm(Am.from(r.reverse()),o)}}xm.empty=new xm(Am.empty,0);class Om{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new Om(e.getMap().invert(),e,this.selection)}}}class Sm{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const Nm=20;function Tm(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function Fm(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function Mm(t,e,n,r){let o=Bm(e),i=Rm.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),u=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),l=new Sm(r?u:s.remaining,r?s.remaining:u,null,0);n(s.transform.setSelection(a).setMeta(Rm,{redo:r,historyState:l}).scrollIntoView())}let Im=!1,$m=null;function Bm(t){let e=t.plugins;if($m!=e){Im=!1,$m=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Im=!0;break}}return Im}const Rm=new il("history"),Lm=new il("closeHistory");function Pm(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new nl({key:Rm,state:{init:()=>new Sm(xm.empty,xm.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(Rm);if(i)return i.historyState;n.getMeta(Lm)&&(t=new Sm(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Rm))return s.getMeta(Rm).redo?new Sm(t.done.addTransform(n,void 0,r,Bm(e)),t.undone,Tm(n.mapping.maps[n.steps.length-1]),t.prevTime):new Sm(t.done,t.undone.addTransform(n,void 0,r,Bm(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Sm(t.done.rebased(n,o),t.undone.rebased(n,o),Fm(t.prevRanges,n.mapping),t.prevTime):new Sm(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Fm(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?Fm(t.prevRanges,n.mapping):Tm(n.mapping.maps[n.steps.length-1]);return new Sm(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,Bm(e)),xm.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?jm:"historyRedo"==n?zm:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const jm=(t,e)=>{let n=Rm.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Mm(n,t,e,!1),!0)},zm=(t,e)=>{let n=Rm.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Mm(n,t,e,!0),!0)},Hm=Vp.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>jm(t,e),redo:()=>({state:t,dispatch:e})=>zm(t,e)}),addProseMirrorPlugins(){return[Pm(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});class Vm extends hu{static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Vm(e.pos,t.markFromJSON(e.mark))}constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){const e=t.nodeAt(this.pos);if(!e)return du.fail("No node at mark step's position");const n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks)),r=new la(ra.from(n),0,e.isLeaf?0:1);return du.fromReplace(t,this.pos,this.pos+1,r)}invert(t){const e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new Wm(this.pos,this.mark):this}map(t){const e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Vm(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}hu.jsonID("removeNodeMark",Vm);class Wm extends hu{static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Wm(e.pos,t.markFromJSON(e.mark))}constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){const e=t.nodeAt(this.pos);if(!e)return du.fail("No node at mark step's position");const n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks)),r=new la(ra.from(n),0,e.isLeaf?0:1);return du.fromReplace(t,this.pos,this.pos+1,r)}invert(t){const e=t.nodeAt(this.pos);if(e){const t=this.mark.addToSet(e.marks);if(t.length===e.marks.length){for(const n of e.marks)if(!n.isInSet(t))return new Wm(this.pos,n);return new Wm(this.pos,this.mark)}}return new Vm(this.pos,this.mark)}map(t){const e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Wm(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}hu.jsonID("addNodeMark",Wm);class Um extends hu{static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Um(e.pos,e.attr,e.value)}constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){const e=t.nodeAt(this.pos);if(!e)return du.fail("No node at attribute step's position");const n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;const r=e.type.create(n,null,e.marks),o=new la(ra.from(r),0,e.isLeaf?0:1);return du.fromReplace(t,this.pos,this.pos+1,o)}getMap(){return cu.empty}invert(t){return new Um(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Um(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}hu.jsonID("attr",Um);const qm=Vp.create({name:"node_processor",addCommands:()=>({setBlockAttributes:yf((({commands:t,state:e},n,r,o={})=>{const i=Ye(t.getBlockAttributes(n))??{},{doc:s,tr:a}=e,{selection:u}=a,{from:l,to:c}=u;s.nodesBetween(l,c,((t,e)=>{Kf.blocks.includes(t.type.name)&&a.step(new Um(e,n,{...o,...i,...r}))}))})),getBlockAttributes:yf((({editor:t},e,n)=>Ze((()=>{let r=Object.assign({},n||{});for(const n of Kf.blocks){var o;Object.assign(r,(null===(o=t.getAttributes(n))||void 0===o?void 0:o[e])||{})}return Object.keys(r).length?r:null})))),applyMark:yf((({state:t,commands:e},n,r)=>{const{tr:o,doc:i,schema:s}=t,{$from:a,$to:u}=o.selection,l=Jp(n,s);if(!(l.spec.group||"").includes("settings"))return e.setMark(n,r);a.pos!==u.pos&&i.nodesBetween(a.pos,u.pos,((t,e)=>{if(t.type.name===Kf.LIST)return;const i=function(t,e){const n="string"==typeof e?e:e.name;return t.find((t=>t.type.name===n))}(t.marks,n),s=l.create({...(null==i?void 0:i.attrs)||{},...r}),c=th(a,u,t,e);!function({doc:t},e,n){const r=t.resolve(e).path.reverse();for(const t of r)if("number"!=typeof t&&n.isInSet(t.marks))return!0;return!1}(o,e,s)?t.isText?o.addMark(c.from,c.to,s):function(t,e,n,r){const o=Zf(t,n,-1)<=r,i=Zf(e,n,1)>=n.nodeSize+r;return o&&i}(a,u,t,e)&&o.step(new Wm(e,s)):o.removeMark(c.from,c.to,s.type)}))})),getMarks:yf((({editor:t},e)=>{const n=Qe(t,"state");return Ze((()=>{const{selection:t,doc:r}=Ye(n),{from:o,to:i}=Ye(t),s=[];return r.nodesBetween(o,i,(t=>{for(const n of t.marks)n.type.name===e&&s.unshift(n.attrs)})),s}))})),getMark:yf((({commands:t},e)=>{const n=t.getMarks(e);return Ze((()=>Ye(n)[0]??null))})),getCommonSettingMark:yf((({commands:t},e,n)=>{const r=t.getMark(e);return Ze((()=>{var t;return(null===(t=Ye(r))||void 0===t?void 0:t.value)??Ye(n)}))})),getDeviceSettingMark:yf((({commands:t},e,n)=>{const r=t.getMark(e),o=t.getDevice();return Ze((()=>{var t;return(null===(t=Ye(r))||void 0===t?void 0:t[Ye(o)])??Ye(n)}))})),removeMarks:yf((({state:t},e)=>{const{tr:n,selection:r,doc:o}=t,{$from:i,$to:s}=r;i.pos!==s.pos&&o.nodesBetween(i.pos,s.pos,((t,r)=>{const o=th(i,s,t,r),a=e=>t.isText?n.removeMark(o.from,o.to,e):n.step(new Vm(r,e));for(const n of t.marks)e.includes(n.type.name)&&a(n)}))}))})}),Km=Vp.create({name:"text_processor",addCommands:()=>({getSelectedText:yf((({state:t})=>{const{from:e,to:n}=t.selection;return t.doc.textBetween(e,n," ")})),transformText:yf((({state:t},e)=>{const{$from:n,$to:r}=t.tr.selection;n.pos!==r.pos&&t.doc.nodesBetween(n.pos,r.pos,((o,i)=>{if(!o.isText)return;const s=th(n,r,o,i),a=Math.max(0,n.pos-i),u=Math.max(0,r.pos-i),l=e({text:o.textContent.substring(a,u)}),c=t.schema.text(l,o.marks);t.tr.replaceWith(s.from,s.to,c)}))}))})}),Jm=Vp.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:yf((({state:t})=>{this.storage.selection=t.selection})),restoreSelection:yf((({commands:t})=>{this.storage.selection&&t.setTextSelection(this.storage.selection)})),expandSelectionToBlock:yf((({state:t,commands:e})=>{let n=t.selection.from,r=t.selection.to;t.doc.nodesBetween(n,r,((t,e,o)=>{o.type.name===Kf.DOCUMENT&&(n=Math.min(n,e+1),r=Math.max(r,e+t.nodeSize-1))})),e.setTextSelection({from:n,to:r})}))}}});class Gm extends class{static create(t){const e=new this(t||{});return new nl({key:new il(this.name),props:e.buildProps()})}constructor(t){this.options=t}buildProps(){return{}}}{buildProps(){return{transformPastedHTML:this._transformPastedHTML.bind(this),handlePaste:this._handlePaste.bind(this)}}_transformPastedHTML(t){const e=sd.build(t);return e.normalizeHTML(),this._removeDeprecatedStyles(e),e.normalizedHTML}_removeDeprecatedStyles(t){const e=t.dom.querySelectorAll('[style*="margin"]');for(const t of Array.from(e))t.style.removeProperty("margin"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-right"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("margin-left")}_handlePaste(t,e,n){const r=this._insertPastedContent(t,n).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return t.dispatch(r),!0}_insertPastedContent({state:t,input:e},n){return this._isFullBlockSelected(t)?t.tr.replaceSelectionWith(n.content,e.shiftKey):t.tr.replaceSelection(n)}_isFullBlockSelected(t){const e=this._expandSelectionToBlocks(t),n=this._isMatchPosition(e.from,t.selection.from),r=this._isMatchPosition(e.to,t.selection.to);return n&&r}_expandSelectionToBlocks({selection:t,doc:e}){let n=t.from,r=t.to;return e.nodesBetween(n,r,((t,e,o)=>{o.type.name===Kf.DOCUMENT&&(n=Math.min(n,e+1),r=Math.max(r,e+t.nodeSize-1))})),{from:n,to:r}}_isMatchPosition(t,e){return Math.abs(t-e)<5}}const Ym=Vp.create({name:"copy_paste_processor",addProseMirrorPlugins:()=>[Gm.create()]}),Xm=gf.create({name:"doc",topNode:!0,content:"block+"}).extend({marks:"settings"}),Qm=gf.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",kp(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Zm=Qm.extend({marks:"_",addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),tg=gf.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,kp(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>function(t){return new Ip({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=xp(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}}),eg=tg.extend({marks:"_",addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),ng=Vp.create({name:Gf.MARGIN,addGlobalAttributes:()=>[{types:[Kf.PARAGRAPH,Kf.HEADING],attributes:{[Gf.MARGIN]:{isRequired:!1,parseHTML(t){const{margin:e,marginTop:n,marginRight:r,marginBottom:o,marginLeft:i}=t.style;if(![e,n,r,o,i].some((t=>!!t)))return null;if(e)return{value:e};return{value:[n||0,r||0,o||0,i||0].join(" ")}},renderHTML:t=>t.margin?bf({margin:t.margin.value}):null}}}]});function rg(t){const e=e=>t.presetsRef.value.find((t=>t.id===e)),n=function(t){return We(t,!1),t}({default:null,link:null});return sn(t.presetsRef,(()=>{n.default=e(t.defaultPresetId),n.link=e(t.linkPresetId)}),{immediate:!0}),[Xm,wm.configure({placeholder:"Type your text here...",emptyNodeClass:"zw-wysiwyg__placeholder"}),Zm,eg,Dm,Hm,qm,Km,Jm,Ym].concat([dd.configure({presets:t.presetsRef,defaultId:t.defaultPresetId,baseClass:t.basePresetClass,makeVariable:t.makePresetVariable}),Od.configure({baseClass:t.baseListClass}),bd.configure({device:t.deviceRef}),gd.configure({minSize:t.minFontSize,maxSize:t.maxFontSize,wrapperRef:t.wrapperRef}),eh.configure({fonts:t.fonts,defaultPreset:Qe(n,"default")}),md,vd,yd,_d,Dd,wd,_m,Cd,Ad.configure({wrapperRef:t.wrapperRef}),ym.configure({preset:Qe(n,"link"),basePresetClass:t.basePresetClass,pageBlocks:t.pageBlocksRef}),ng])}class og{types;parse(t){const{window:e}=new d.JSDOM(t);return this.types=e,e.document}}class ig{static build(t){const e=function(t){return Np(jp.resolve(t))}(rg({fonts:t.fonts,minFontSize:0,maxFontSize:0,presetsRef:Ge(t.presets),defaultPresetId:t.defaultPresetId,linkPresetId:t.linkPresetId,makePresetVariable:()=>"",basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:Ge(Wf.DESKTOP),pageBlocksRef:Ge([]),wrapperRef:d.JSDOM.fragment("<p></p>").firstElementChild}));return new ig({schema:e,domParser:Ka.fromSchema(e)})}#e;#t;constructor({schema:t,domParser:e}){this.#e=t,this.#t=e}toJSON(t){const e=sd.build(t,{parser:new og});return e.normalizeHTML(),this.#t.parse(e.dom.body)}}const sg=new it;sg.command("to-json").argument("<html>").option("--config <path>","generator config",l.resolve(__dirname,"../bin/zp.config.json")).action(((t,{config:e})=>{const n=l.resolve(process.cwd(),e),r=ig.build(require(n).editor),o=(i=r.toJSON(t),JSON.stringify(i,((t,e)=>null===e?void 0:e),2).replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,(t=>t.replace(/"/g,""))).replace(/: "(.+)"([,\n])/g,": '$1'$2"));var i;console.log(o)})),sg.parse();