@zipify/wysiwyg 3.1.0-2 → 3.1.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 (66) hide show
  1. package/.eslintrc.js +17 -235
  2. package/.github/actions/setup/action.yaml +1 -1
  3. package/README.md +2 -0
  4. package/config/build/cli.config.js +6 -6
  5. package/config/build/lib.config.js +5 -3
  6. package/config/svgo.js +6 -3
  7. package/dist/cli.js +5 -4
  8. package/dist/wysiwyg.css +18 -18
  9. package/dist/wysiwyg.mjs +12502 -11732
  10. package/example/tooltip/Tooltip.js +92 -69
  11. package/example/tooltip/modifiers/TooltipCloseOnScrollModifier.js +2 -5
  12. package/example/tooltip/tooltip.css +8 -31
  13. package/lib/Wysiwyg.vue +3 -0
  14. package/lib/cli/commands/ToJsonCommand.js +6 -6
  15. package/lib/components/base/__tests__/Button.test.js +1 -1
  16. package/lib/components/base/composables/__tests__/useDeselectionLock.test.js +2 -2
  17. package/lib/components/base/composables/__tests__/useElementRef.test.js +1 -1
  18. package/lib/components/base/composables/__tests__/useModalToggler.test.js +0 -2
  19. package/lib/components/base/composables/__tests__/useValidator.test.js +2 -2
  20. package/lib/components/base/composables/useModalToggler.js +30 -24
  21. package/lib/components/toolbar/Toolbar.vue +1 -1
  22. package/lib/components/toolbar/base/__tests__/ToolbarDivider.test.js +1 -1
  23. package/lib/components/toolbar/controls/StylePresetControl.vue +1 -1
  24. package/lib/components/toolbar/controls/__tests__/LineHeightControl.test.js +0 -2
  25. package/lib/components/toolbar/controls/composables/__tests__/useRecentFonts.test.js +1 -1
  26. package/lib/components/toolbar/controls/link/composables/__tests__/useLink.test.js +2 -2
  27. package/lib/composables/useToolbar.js +24 -19
  28. package/lib/extensions/FontSize.js +1 -2
  29. package/lib/extensions/Link.js +2 -0
  30. package/lib/extensions/__tests__/BackgroundColor.test.js +2 -2
  31. package/lib/extensions/__tests__/FontColor.test.js +3 -3
  32. package/lib/extensions/__tests__/FontFamily.test.js +3 -3
  33. package/lib/extensions/__tests__/FontSize.test.js +3 -3
  34. package/lib/extensions/__tests__/FontWeight.test.js +4 -4
  35. package/lib/extensions/__tests__/LineHeight.test.js +2 -2
  36. package/lib/extensions/__tests__/Link.test.js +33 -5
  37. package/lib/extensions/__tests__/__snapshots__/Link.test.js.snap +27 -0
  38. package/lib/extensions/core/Document.js +8 -1
  39. package/lib/extensions/core/NodeProcessor.js +3 -4
  40. package/lib/extensions/core/__tests__/NodeProcessor.test.js +6 -8
  41. package/lib/extensions/core/__tests__/TextProcessor.test.js +1 -1
  42. package/lib/extensions/core/index.js +0 -2
  43. package/lib/extensions/core/plugins/PlaceholderPlugin.js +2 -2
  44. package/lib/extensions/list/List.js +4 -5
  45. package/lib/extensions/list/ListItem.js +1 -2
  46. package/lib/extensions/list/__tests__/List.test.js +1 -1
  47. package/lib/models/Font.js +2 -2
  48. package/lib/models/__tests__/Font.test.js +3 -9
  49. package/lib/services/ContentSerializer.js +8 -8
  50. package/lib/services/HtmlToJsonParser.js +3 -3
  51. package/lib/services/NodeFactory.js +6 -6
  52. package/lib/services/StylePresetRenderer.js +11 -11
  53. package/lib/services/__tests__/JsonSerializer.test.js +1 -1
  54. package/lib/services/__tests__/Storage.test.js +1 -1
  55. package/lib/services/__tests__/StylePresetRenderer.test.js +1 -1
  56. package/lib/services/normalizer/BrowserDomParser.js +2 -2
  57. package/lib/services/normalizer/ContentNormalizer.js +3 -3
  58. package/lib/services/normalizer/HtmlNormalizer.js +52 -52
  59. package/lib/services/normalizer/JsonNormalizer.js +21 -21
  60. package/lib/utils/__tests__/convertAlignment.test.js +1 -1
  61. package/lib/utils/__tests__/renderInlineSetting.test.js +2 -2
  62. package/package.json +50 -48
  63. package/lib/extensions/core/steps/AddNodeMarkStep.js +0 -66
  64. package/lib/extensions/core/steps/AttrStep.js +0 -60
  65. package/lib/extensions/core/steps/RemoveNodeMarkStep.js +0 -56
  66. package/lib/extensions/core/steps/index.js +0 -3
package/dist/cli.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";var t=require("events"),e=require("child_process"),n=require("path"),r=require("fs"),o=require("process"),i=require("jsdom");function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=s(t),u=s(e),l=s(n),c=s(r),p=s(o),f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d={exports:{}},h={},m={};class g 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}}m.CommanderError=g,m.InvalidArgumentError=class extends g{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:v}=m;h.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 v(`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}},h.humanReadableArgName=function(t){const e=t.name()+(!0===t.variadic?"...":"");return t.required?"<"+e+">":"["+e+"]"};var y={},b={};const{humanReadableArgName:_}=h;b.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=>_(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 D={};const{InvalidArgumentError:E}=m;function w(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}}D.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=w(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 E(`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}},D.splitOptionFlags=w,D.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 C={};C.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 k=a.default.EventEmitter,A=u.default,x=l.default,O=c.default,S=p.default,{Argument:N,humanReadableArgName:T}=h,{CommanderError:F}=m,{Help:M}=b,{Option:I,splitOptionFlags:$,DualOptions:B}=D,{suggestSimilar:R}=C;class L extends k{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=>S.stdout.write(t),writeErr:t=>S.stderr.write(t),getOutHelpWidth:()=>S.stdout.isTTY?S.stdout.columns:void 0,getErrHelpWidth:()=>S.stderr.isTTY?S.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 L(t)}createHelp(){return Object.assign(new M,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 N(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 F(t,e,n)),S.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 I(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 I)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=S.argv,S.versions&&S.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":S.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=x.resolve(t,e);if(O.existsSync(n))return n;if(r.includes(x.extname(e)))return;const o=r.find((t=>O.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=O.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}a=x.resolve(x.dirname(t),a)}if(a){let e=o(a,s);if(!e&&!t._executableFile&&this._scriptPath){const n=x.basename(this._scriptPath,x.extname(this._scriptPath));n!==this._name&&(e=o(a,`${n}-${t._name}`))}s=e||s}if(n=r.includes(x.extname(s)),"win32"!==S.platform?n?(e.unshift(s),e=j(S.execArgv).concat(e),i=A.spawn(S.argv[0],e,{stdio:"inherit"})):i=A.spawn(s,e,{stdio:"inherit"}):(e.unshift(s),e=j(S.execArgv).concat(e),i=A.spawn(S.execPath,e,{stdio:"inherit"})),!i.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((t=>{S.on(t,(()=>{!1===i.killed&&null===i.exitCode&&i.kill(t)}))}))}const u=this._exitCallback;u?i.on("close",(()=>{u(new F(S.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):i.on("close",S.exit.bind(S)),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 F(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e,u(t)}else S.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 z(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 P(this,e),this._dispatchSubcommand(this._defaultCommandName,t,e);!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,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 z(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 S.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()}`,S.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}}))}_parseOptionsImplied(){const t=new B(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=R(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=R(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=>T(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=x.basename(t,x.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);z(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),z(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=$(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(t){this.outputHelp(t);let e=S.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 P(t,e){t._hasHelpOption&&e.find((e=>e===t._helpLongFlag||e===t._helpShortFlag))&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function j(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 z(t){const e=[];for(let n=t;n;n=n.parent)e.push(n);return e}y.Command=L,function(t,e){const{Argument:n}=h,{Command:r}=y,{CommanderError:o,InvalidArgumentError:i}=m,{Help:s}=b,{Option:a}=D;(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}(d,d.exports);var H=d.exports;const{program:V,createCommand:W,createArgument:U,createOption:q,CommanderError:K,InvalidArgumentError:J,InvalidOptionArgumentError:G,Command:Y,Argument:X,Option:Q,Help:Z}=H;
1
+ "use strict";var t=require("events"),e=require("child_process"),n=require("path"),r=require("fs"),o=require("process"),i=require("jsdom"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a={},u={get exports(){return a},set exports(t){a=t}},l={},c={};let p=class 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=p,c.InvalidArgumentError=class extends p{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:f}=c;l.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 f(`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}},l.humanReadableArgName=function(t){const e=t.name()+(!0===t.variadic?"...":"");return t.required?"<"+e+">":"["+e+"]"};var d={},h={};const{humanReadableArgName:m}=l;h.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=>m(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 g={};const{InvalidArgumentError:v}=c;function y(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}}g.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=y(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 v(`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}},g.splitOptionFlags=y,g.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 b={};b.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 _=t.EventEmitter,D=e,w=n,k=r,E=o,{Argument:C,humanReadableArgName:x}=l,{CommanderError:A}=c,{Help:S}=h,{Option:O,splitOptionFlags:N,DualOptions:T}=g,{suggestSimilar:F}=b;let M=class extends _{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=>E.stdout.write(t),writeErr:t=>E.stderr.write(t),getOutHelpWidth:()=>E.stdout.isTTY?E.stdout.columns:void 0,getErrHelpWidth:()=>E.stderr.isTTY?E.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 M(t)}createHelp(){return Object.assign(new S,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 C(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 A(t,e,n)),E.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 O(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 O)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.setOptionValueWithSource(t,e,void 0)}setOptionValueWithSource(t,e,n){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[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=E.argv,E.versions&&E.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":E.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=w.resolve(t,e);if(k.existsSync(n))return n;if(r.includes(w.extname(e)))return;const o=r.find((t=>k.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=k.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}a=w.resolve(w.dirname(t),a)}if(a){let e=o(a,s);if(!e&&!t._executableFile&&this._scriptPath){const n=w.basename(this._scriptPath,w.extname(this._scriptPath));n!==this._name&&(e=o(a,`${n}-${t._name}`))}s=e||s}if(n=r.includes(w.extname(s)),"win32"!==E.platform?n?(e.unshift(s),e=$(E.execArgv).concat(e),i=D.spawn(E.argv[0],e,{stdio:"inherit"})):i=D.spawn(s,e,{stdio:"inherit"}):(e.unshift(s),e=$(E.execArgv).concat(e),i=D.spawn(E.execPath,e,{stdio:"inherit"})),!i.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((t=>{E.on(t,(()=>{!1===i.killed&&null===i.exitCode&&i.kill(t)}))}))}const u=this._exitCallback;u?i.on("close",(()=>{u(new A(E.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):i.on("close",E.exit.bind(E)),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 A(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e,u(t)}else E.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 B(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 I(this,e),this._dispatchSubcommand(this._defaultCommandName,t,e);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),I(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 B(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 E.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()}`,E.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}}))}_parseOptionsImplied(){const t=new T(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=F(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=F(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=>x(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=w.basename(t,w.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);B(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),B(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=N(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(t){this.outputHelp(t);let e=E.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 I(t,e){t._hasHelpOption&&e.find((e=>e===t._helpLongFlag||e===t._helpShortFlag))&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function $(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 B(t){const e=[];for(let n=t;n;n=n.parent)e.push(n);return e}d.Command=M,function(t,e){const{Argument:n}=l,{Command:r}=d,{CommanderError:o,InvalidArgumentError:i}=c,{Help:s}=h,{Option:a}=g;(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}(u,a);var R=a;const{program:L,createCommand:P,createArgument:j,createOption:z,CommanderError:V,InvalidArgumentError:H,InvalidOptionArgumentError:W,Command:q,Argument:U,Option:K,Help:J}=R;
2
2
  /*!
3
- * Vue.js v2.7.10
3
+ * Vue.js v2.7.14
4
4
  * (c) 2014-2022 Evan You
5
5
  * Released under the MIT License.
6
- */var tt=Object.freeze({}),et=Array.isArray;function nt(t){return null==t}function rt(t){return null!=t}function ot(t){return!0===t}function it(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function st(t){return"function"==typeof t}function at(t){return null!==t&&"object"==typeof t}var ut=Object.prototype.toString;function lt(t){return ut.call(t).slice(8,-1)}function ct(t){return"[object Object]"===ut.call(t)}function pt(t){return"[object RegExp]"===ut.call(t)}function ft(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function dt(t){return rt(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function ht(t){return null==t?"":Array.isArray(t)||ct(t)&&t.toString===ut?JSON.stringify(t,null,2):String(t)}function mt(t){var e=parseFloat(t);return isNaN(e)?t:e}function gt(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 vt=gt("slot,component",!0),yt=gt("key,ref,slot,slot-scope,is");function bt(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}var _t=Object.prototype.hasOwnProperty;function Dt(t,e){return _t.call(t,e)}function Et(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var wt=/-(\w)/g,Ct=Et((function(t){return t.replace(wt,(function(t,e){return e?e.toUpperCase():""}))})),kt=Et((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),At=/\B([A-Z])/g,xt=Et((function(t){return t.replace(At,"-$1").toLowerCase()}));var Ot=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 St(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function Nt(t,e){for(var n in e)t[n]=e[n];return t}function Tt(t){for(var e={},n=0;n<t.length;n++)t[n]&&Nt(e,t[n]);return e}function Ft(t,e,n){}var Mt=function(t,e,n){return!1},It=function(t){return t};function $t(t,e){if(t===e)return!0;var n=at(t),r=at(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 $t(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 $t(t[n],e[n])}))}catch(t){return!1}}function Bt(t,e){for(var n=0;n<t.length;n++)if($t(t[n],e))return n;return-1}function Rt(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function Lt(t,e){return t===e?0===t&&1/t!=1/e:t==t||e==e}var Pt=["component","directive","filter"],jt=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],zt={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:Mt,isReservedAttr:Mt,isUnknownElement:Mt,getTagNamespace:Ft,parsePlatformTagName:It,mustUseProp:Mt,async:!0,_lifecycleHooks:jt},Ht=/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 Vt(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function Wt(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var Ut=new RegExp("[^".concat(Ht.source,".$_\\d]"));var qt="__proto__"in{},Kt="undefined"!=typeof window,Jt=Kt&&window.navigator.userAgent.toLowerCase(),Gt=Jt&&/msie|trident/.test(Jt),Yt=Jt&&Jt.indexOf("msie 9.0")>0,Xt=Jt&&Jt.indexOf("edge/")>0;Jt&&Jt.indexOf("android");var Qt=Jt&&/iphone|ipad|ipod|ios/.test(Jt);Jt&&/chrome\/\d+/.test(Jt),Jt&&/phantomjs/.test(Jt);var Zt,te=Jt&&Jt.match(/firefox\/(\d+)/),ee={}.watch,ne=!1;if(Kt)try{var re={};Object.defineProperty(re,"passive",{get:function(){ne=!0}}),window.addEventListener("test-passive",null,re)}catch(t){}var oe=function(){return void 0===Zt&&(Zt=!Kt&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),Zt},ie=Kt&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(t){return"function"==typeof t&&/native code/.test(t.toString())}var ae,ue="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);ae="undefined"!=typeof Set&&se(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 le=null;function ce(t){void 0===t&&(t=null),t||le&&le._scope.off(),le=t,t&&t._scope.on()}var pe=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}(),fe=function(t){void 0===t&&(t="");var e=new pe;return e.text=t,e.isComment=!0,e};function de(t){return new pe(void 0,void 0,void 0,String(t))}function he(t){var e=new pe(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 me=function(){return me=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},me.apply(this,arguments)},ge=0,ve=function(){function t(){this.id=ge++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){bt(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(me({effect:t.target},e)))},t.prototype.notify=function(t){var e=this.subs.slice();"production"===process.env.NODE_ENV||zt.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(me({effect:e[n]},t))}e[n].update()}},t}();ve.target=null;var ye=[];function be(t){ye.push(t),ve.target=t}function _e(){ye.pop(),ve.target=ye[ye.length-1]}var De=Array.prototype,Ee=Object.create(De);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(t){var e=De[t];Wt(Ee,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 we=Object.getOwnPropertyNames(Ee),Ce={},ke=!0;function Ae(t){ke=t}var xe={notify:Ft,depend:Ft,addSub:Ft,removeSub:Ft},Oe=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?xe:new ve,this.vmCount=0,Wt(t,"__ob__",this),et(t)){if(!n)if(qt)t.__proto__=Ee;else for(var r=0,o=we.length;r<o;r++){Wt(t,s=we[r],Ee[s])}e||this.observeArray(t)}else{var i=Object.keys(t);for(r=0;r<i.length;r++){var s;Ne(t,s=i[r],Ce,void 0,e,n)}}}return t.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)Se(t[e],!1,this.mock)},t}();function Se(t,e,n){var r;if(!(!at(t)||Pe(t)||t instanceof pe))return Dt(t,"__ob__")&&t.__ob__ instanceof Oe?r=t.__ob__:!ke||!n&&oe()||!et(t)&&!ct(t)||!Object.isExtensible(t)||t.__v_skip||(r=new Oe(t,e,n)),r}function Ne(t,e,n,r,o,i){var s=new ve,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var u=a&&a.get,l=a&&a.set;u&&!l||n!==Ce&&2!==arguments.length||(n=t[e]);var c=!o&&Se(n,!1,i);return Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var r=u?u.call(t):n;return ve.target&&("production"!==process.env.NODE_ENV?s.depend({target:t,type:"get",key:e}):s.depend(),c&&(c.dep.depend(),et(r)&&Me(r))),Pe(r)&&!o?r.value:r},set:function(a){var p=u?u.call(t):n;if(Lt(p,a)){if("production"!==process.env.NODE_ENV&&r&&r(),l)l.call(t,a);else{if(u)return;if(!o&&Pe(p)&&!Pe(a))return void(p.value=a);n=a}c=!o&&Se(a,!1,i),"production"!==process.env.NODE_ENV?s.notify({type:"set",target:t,key:e,newValue:a,oldValue:p}):s.notify()}}}),s}}function Te(t,e,n){if("production"!==process.env.NODE_ENV&&(nt(t)||it(t))&&Hr("Cannot set reactive property on undefined, null, or primitive value: ".concat(t)),!Le(t)){var r=t.__ob__;return et(t)&&ft(e)?(t.length=Math.max(t.length,e),t.splice(e,1,n),r&&!r.shallow&&r.mock&&Se(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&&Hr("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),n):r?(Ne(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&&Hr('Set operation on key "'.concat(e,'" failed: target is readonly.'))}function Fe(t,e){if("production"!==process.env.NODE_ENV&&(nt(t)||it(t))&&Hr("Cannot delete reactive property on undefined, null, or primitive value: ".concat(t)),et(t)&&ft(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount?"production"!==process.env.NODE_ENV&&Hr("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):Le(t)?"production"!==process.env.NODE_ENV&&Hr('Delete operation on key "'.concat(e,'" failed: target is readonly.')):Dt(t,e)&&(delete t[e],n&&("production"!==process.env.NODE_ENV?n.dep.notify({type:"delete",target:t,key:e}):n.dep.notify()))}}function Me(t){for(var e=void 0,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),et(e)&&Me(e)}function Ie(t){return $e(t,!0),Wt(t,"__v_isShallow",!0),t}function $e(t,e){if(!Le(t)){if("production"!==process.env.NODE_ENV){et(t)&&Hr("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&&Hr("Target is already a ".concat(n.shallow?"":"non-","shallow reactive object, and cannot be converted to ").concat(e?"":"non-","shallow."))}var r=Se(t,e,oe());"production"===process.env.NODE_ENV||r||((null==t||it(t))&&Hr("value cannot be made reactive: ".concat(String(t))),("Map"===(o=lt(t))||"WeakMap"===o||"Set"===o||"WeakSet"===o)&&Hr("Vue 2 does not support reactive collection types such as Map or Set."))}var o}function Be(t){return Le(t)?Be(t.__v_raw):!(!t||!t.__ob__)}function Re(t){return!(!t||!t.__v_isShallow)}function Le(t){return!(!t||!t.__v_isReadonly)}function Pe(t){return!(!t||!0!==t.__v_isRef)}function je(t){return function(t,e){if(Pe(t))return t;var n={};return Wt(n,"__v_isRef",!0),Wt(n,"__v_isShallow",e),Wt(n,"dep",Ne(n,"value",t,null,e,oe())),n}(t,!1)}function ze(t){return Pe(t)?t.value:t}function He(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){var t=e[n];if(Pe(t))return t.value;var r=t&&t.__ob__;return r&&r.dep.depend(),t},set:function(t){var r=e[n];Pe(r)&&!Pe(t)?r.value=t:e[n]=t}})}function Ve(t,e,n){var r=t[e];if(Pe(r))return r;var o={get value(){var r=t[e];return void 0===r?n:r},set value(n){t[e]=n}};return Wt(o,"__v_isRef",!0),o}function We(t,e){var n,r,o=st(t);o?(n=t,r="production"!==process.env.NODE_ENV?function(){Hr("Write operation failed: computed value is readonly")}:Ft):(n=t.get,r=t.set);var i=oe()?null:new or(le,n,Ft,{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(),ve.target&&("production"!==process.env.NODE_ENV&&ve.target.onTrack&&ve.target.onTrack({effect:ve.target,target:s,type:"get",key:"value"}),i.depend()),i.value):n()},set value(t){r(t)}};return Wt(s,"__v_isRef",!0),Wt(s,"__v_isReadonly",o),s}var Ue,qe="".concat("watcher"," callback"),Ke="".concat("watcher"," getter"),Je="".concat("watcher"," cleanup"),Ge={};function Ye(t,e,n){return"production"!==process.env.NODE_ENV&&"function"!=typeof e&&Hr("`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?tt: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&&Hr('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==i&&Hr('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));var c,p,f=function(t){Hr("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.")},d=le,h=function(t,e,n){return void 0===n&&(n=null),Ln(t,null,n,d,e)},m=!1,g=!1;Pe(t)?(c=function(){return t.value},m=Re(t)):Be(t)?(c=function(){return t.__ob__.dep.depend(),t},i=!0):et(t)?(g=!0,m=t.some((function(t){return Be(t)||Re(t)})),c=function(){return t.map((function(t){return Pe(t)?t.value:Be(t)?Qn(t):st(t)?h(t,Ke):void("production"!==process.env.NODE_ENV&&f(t))}))}):st(t)?c=e?function(){return h(t,Ke)}:function(){if(!d||!d._isDestroyed)return p&&p(),h(t,"watcher",[y])}:(c=Ft,"production"!==process.env.NODE_ENV&&f(t));if(e&&i){var v=c;c=function(){return Qn(v())}}var y=function(t){p=b.onStop=function(){h(t,Je)}};if(oe())return y=Ft,e?o&&h(e,qe,[c(),g?[]:void 0,y]):c(),Ft;var b=new or(le,c,Ft,{lazy:!0});b.noRecurse=!e;var _=g?[]:Ge;b.run=function(){if(b.active)if(e){var t=b.get();(i||m||(g?t.some((function(t,e){return Lt(t,_[e])})):Lt(t,_)))&&(p&&p(),h(e,qe,[t,_===Ge?void 0:_,y]),_=t)}else b.get()},"sync"===a?b.update=b.run:"post"===a?(b.post=!0,b.update=function(){return Sr(b)}):b.update=function(){if(d&&d===le&&!d._isMounted){var t=d._preWatchers||(d._preWatchers=[]);t.indexOf(b)<0&&t.push(b)}else Sr(b)};"production"!==process.env.NODE_ENV&&(b.onTrack=u,b.onTrigger=l);e?o?b.run():_=b.get():"post"===a&&d?d.$once("hook:mounted",(function(){return b.get()})):b.get();return function(){b.teardown()}}(t,e,n)}var Xe=function(){function t(t){void 0===t&&(t=!1),this.active=!0,this.effects=[],this.cleanups=[],!t&&Ue&&(this.parent=Ue,this.index=(Ue.scopes||(Ue.scopes=[])).push(this)-1)}return t.prototype.run=function(t){if(this.active){var e=Ue;try{return Ue=this,t()}finally{Ue=e}}else"production"!==process.env.NODE_ENV&&Hr("cannot run an inactive effect scope.")},t.prototype.on=function(){Ue=this},t.prototype.off=function(){Ue=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 Qe=Et((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 Ze(t,e){function n(){var t=n.fns;if(!et(t))return Ln(t,null,arguments,e,"v-on handler");for(var r=t.slice(),o=0;o<r.length;o++)Ln(r[o],null,arguments,e,"v-on handler")}return n.fns=t,n}function tn(t,e,n,r,o,i){var s,a,u,l;for(s in t)a=t[s],u=e[s],l=Qe(s),nt(a)?"production"!==process.env.NODE_ENV&&Hr('Invalid handler for event "'.concat(l.name,'": got ')+String(a),i):nt(u)?(nt(a.fns)&&(a=t[s]=Ze(a,i)),ot(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)nt(t[s])&&r((l=Qe(s)).name,e[s],l.capture)}function en(t,e,n){var r;t instanceof pe&&(t=t.data.hook||(t.data.hook={}));var o=t[e];function i(){n.apply(this,arguments),bt(r.fns,i)}nt(o)?r=Ze([i]):rt(o.fns)&&ot(o.merged)?(r=o).fns.push(i):r=Ze([o,i]),r.merged=!0,t[e]=r}function nn(t,e,n,r,o){if(rt(e)){if(Dt(e,n))return t[n]=e[n],o||delete e[n],!0;if(Dt(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function rn(t){return it(t)?[de(t)]:et(t)?sn(t):void 0}function on(t){return rt(t)&&rt(t.text)&&!1===t.isComment}function sn(t,e){var n,r,o,i,s=[];for(n=0;n<t.length;n++)nt(r=t[n])||"boolean"==typeof r||(i=s[o=s.length-1],et(r)?r.length>0&&(on((r=sn(r,"".concat(e||"","_").concat(n)))[0])&&on(i)&&(s[o]=de(i.text+r[0].text),r.shift()),s.push.apply(s,r)):it(r)?on(i)?s[o]=de(i.text+r):""!==r&&s.push(de(r)):on(r)&&on(i)?s[o]=de(i.text+r.text):(ot(t._isVList)&&rt(r.tag)&&nt(r.key)&&rt(e)&&(r.key="__vlist".concat(e,"_").concat(n,"__")),s.push(r)));return s}function an(t,e){var n,r,o,i,s=null;if(et(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(at(t))if(ue&&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 rt(s)||(s=[]),s._isVList=!0,s}function un(t,e,n,r){var o,i=this.$scopedSlots[t];i?(n=n||{},r&&("production"===process.env.NODE_ENV||at(r)||Hr("slot v-bind without argument expects an Object",this),n=Nt(Nt({},r),n)),o=i(n)||(st(e)?e():e)):o=this.$slots[t]||(st(e)?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function ln(t){return eo(this.$options,"filters",t,!0)||It}function cn(t,e){return et(t)?-1===t.indexOf(e):t!==e}function pn(t,e,n,r,o){var i=zt.keyCodes[e]||n;return o&&r&&!zt.keyCodes[e]?cn(o,r):i?cn(i,t):r?xt(r)!==e:void 0===t}function fn(t,e,n,r,o){if(n)if(at(n)){et(n)&&(n=Tt(n));var i=void 0,s=function(s){if("class"===s||"style"===s||yt(s))i=t;else{var a=t.attrs&&t.attrs.type;i=r||zt.mustUseProp(e,a,s)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var u=Ct(s),l=xt(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&&Hr("v-bind without argument expects an Object or Array value",this);return t}function dn(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||mn(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),"__static__".concat(t),!1),r}function hn(t,e,n){return mn(t,"__once__".concat(e).concat(n?"_".concat(n):""),!0),t}function mn(t,e,n){if(et(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&gn(t[r],"".concat(e,"_").concat(r),n);else gn(t,e,n)}function gn(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function vn(t,e){if(e)if(ct(e)){var n=t.on=t.on?Nt({},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&&Hr("v-on without argument expects an Object value",this);return t}function yn(t,e,n,r){e=e||{$stable:!n};for(var o=0;o<t.length;o++){var i=t[o];et(i)?yn(i,e,n):i&&(i.proxy&&(i.fn.proxy=!0),e[i.key]=i.fn)}return r&&(e.$key=r),e}function bn(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&&Hr("Invalid value for dynamic directive argument (expected string or null): ".concat(r),this)}return t}function _n(t,e){return"string"==typeof t?e+t:t}function Dn(t){t._o=hn,t._n=mt,t._s=ht,t._l=an,t._t=un,t._q=$t,t._i=Bt,t._m=dn,t._f=ln,t._k=pn,t._b=fn,t._v=de,t._e=fe,t._u=yn,t._g=vn,t._d=bn,t._p=_n}function En(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(wn)&&delete n[l];return n}function wn(t){return t.isComment&&!t.asyncFactory||" "===t.text}function Cn(t){return t.isComment&&t.asyncFactory}function kn(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!==tt&&a===r.$key&&!i&&!r.$hasNormal)return r;for(var u in o={},e)e[u]&&"$"!==u[0]&&(o[u]=An(t,n,u,e[u]))}else o={};for(var l in n)l in o||(o[l]=xn(n,l));return e&&Object.isExtensible(e)&&(e._normalized=o),Wt(o,"$stable",s),Wt(o,"$key",a),Wt(o,"$hasNormal",i),o}function An(t,e,n,r){var o=function(){var e=le;ce(t);var n=arguments.length?r.apply(null,arguments):r({}),o=(n=n&&"object"==typeof n&&!et(n)?[n]:rn(n))&&n[0];return ce(e),n&&(!o||1===n.length&&o.isComment&&!Cn(o))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:o,enumerable:!0,configurable:!0}),o}function xn(t,e){return function(){return t[e]}}function On(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={};Wt(e,"_v_attr_proxy",!0),Sn(e,t.$attrs,tt,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||Sn(t._listenersProxy={},t.$listeners,tt,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||Tn(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:Ot(t.$emit,t),expose:function(n){"production"!==process.env.NODE_ENV&&(e&&Hr("expose() should be called only once per setup().",t),e=!0),n&&Object.keys(n).forEach((function(e){return He(t,n,e)}))}}}(t);ce(t),be();var o=Ln(n,null,[t._props||Ie({}),r],t,"setup");if(_e(),ce(),st(o))e.render=o;else if(at(o))if("production"!==process.env.NODE_ENV&&o instanceof pe&&Hr("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&&He(i,o,s)}else for(var s in o)Vt(s)?"production"!==process.env.NODE_ENV&&Hr("Avoid using variables that start with _ or $ in setup()."):He(t,o,s);else"production"!==process.env.NODE_ENV&&void 0!==o&&Hr("setup() should return an object. Received: ".concat(null===o?"null":typeof o))}}function Sn(t,e,n,r,o){var i=!1;for(var s in e)s in t?e[s]!==n[s]&&(i=!0):(i=!0,Nn(t,s,r,o));for(var s in t)s in e||(i=!0,delete t[s]);return i}function Nn(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function Tn(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var Fn=null;function Mn(t,e){return(t.__esModule||ue&&"Module"===t[Symbol.toStringTag])&&(t=t.default),at(t)?e.extend(t):t}function In(t){if(et(t))for(var e=0;e<t.length;e++){var n=t[e];if(rt(n)&&(rt(n.componentOptions)||Cn(n)))return n}}function $n(t,e,n,r,o,i){return(et(n)||it(n))&&(o=r,r=n,n=void 0),ot(i)&&(o=2),function(t,e,n,r,o){if(rt(n)&&rt(n.__ob__))return"production"!==process.env.NODE_ENV&&Hr("Avoid using observed data object as vnode data: ".concat(JSON.stringify(n),"\n")+"Always create fresh vnode data objects in each render!",t),fe();rt(n)&&rt(n.is)&&(e=n.is);if(!e)return fe();"production"!==process.env.NODE_ENV&&rt(n)&&rt(n.key)&&!it(n.key)&&Hr("Avoid using non-primitive value as key, use string/number value instead.",t);et(r)&&st(r[0])&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);2===o?r=rn(r):1===o&&(r=function(t){for(var e=0;e<t.length;e++)if(et(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||zt.getTagNamespace(e),zt.isReservedTag(e)?("production"!==process.env.NODE_ENV&&rt(n)&&rt(n.nativeOn)&&"component"!==n.tag&&Hr("The .native modifier for v-on is only valid on components but it was used on <".concat(e,">."),t),i=new pe(zt.parsePlatformTagName(e),n,r,void 0,void 0,t)):i=n&&n.pre||!rt(a=eo(t.$options,"components",e))?new pe(e,n,r,void 0,void 0,t):Lr(a,n,t,r,e)}else i=Lr(e,n,t,r);return et(i)?i:rt(i)?(rt(s)&&Bn(i,s),rt(n)&&function(t){at(t.style)&&Qn(t.style);at(t.class)&&Qn(t.class)}(n),i):fe()}(t,e,n,r,o)}function Bn(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),rt(t.children))for(var r=0,o=t.children.length;r<o;r++){var i=t.children[r];rt(i.tag)&&(nt(i.ns)||ot(n)&&"svg"!==i.tag)&&Bn(i,e,n)}}function Rn(t,e,n){be();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){Pn(t,r,"errorCaptured hook")}}Pn(t,e,n)}finally{_e()}}function Ln(t,e,n,r,o){var i;try{(i=n?t.apply(e,n):t.call(e))&&!i._isVue&&dt(i)&&!i._handled&&(i.catch((function(t){return Rn(t,r,o+" (Promise/async)")})),i._handled=!0)}catch(t){Rn(t,r,o)}return i}function Pn(t,e,n){if(zt.errorHandler)try{return zt.errorHandler.call(null,t,e,n)}catch(e){e!==t&&jn(e,null,"config.errorHandler")}jn(t,e,n)}function jn(t,e,n){if("production"!==process.env.NODE_ENV&&Hr("Error in ".concat(n,': "').concat(t.toString(),'"'),e),!Kt||"undefined"==typeof console)throw t;console.error(t)}var zn,Hn=!1,Vn=[],Wn=!1;function Un(){Wn=!1;var t=Vn.slice(0);Vn.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!=typeof Promise&&se(Promise)){var qn=Promise.resolve();zn=function(){qn.then(Un),Qt&&setTimeout(Ft)},Hn=!0}else if(Gt||"undefined"==typeof MutationObserver||!se(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())zn="undefined"!=typeof setImmediate&&se(setImmediate)?function(){setImmediate(Un)}:function(){setTimeout(Un,0)};else{var Kn=1,Jn=new MutationObserver(Un),Gn=document.createTextNode(String(Kn));Jn.observe(Gn,{characterData:!0}),zn=function(){Kn=(Kn+1)%2,Gn.data=String(Kn)},Hn=!0}function Yn(t,e){var n;if(Vn.push((function(){if(t)try{t.call(e)}catch(t){Rn(t,e,"nextTick")}else n&&n(e)})),Wn||(Wn=!0,zn()),!t&&"undefined"!=typeof Promise)return new Promise((function(t){n=t}))}var Xn=new ae;function Qn(t){return Zn(t,Xn),Xn.clear(),t}function Zn(t,e){var n,r,o=et(t);if(!(!o&&!at(t)||Object.isFrozen(t)||t instanceof pe)){if(t.__ob__){var i=t.__ob__.dep.id;if(e.has(i))return;e.add(i)}if(o)for(n=t.length;n--;)Zn(t[n],e);else if(Pe(t))Zn(t.value,e);else for(n=(r=Object.keys(t)).length;n--;)Zn(t[r[n]],e)}}var tr,er,nr,rr=0,or=function(){function t(t,e,n,r,o){var i,s;i=this,void 0===(s=Ue&&!Ue._vm?Ue:t?t._scope:void 0)&&(s=Ue),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=++rr,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ae,this.newDepIds=new ae,this.expression="production"!==process.env.NODE_ENV?e.toString():"",st(e)?this.getter=e:(this.getter=function(t){if(!Ut.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=Ft,"production"!==process.env.NODE_ENV&&Hr('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;be(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;Rn(t,e,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&Qn(t),_e(),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():Sr(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||at(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');Ln(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&&bt(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 ir=Kt&&window.performance;ir&&ir.mark&&ir.measure&&ir.clearMarks&&ir.clearMeasures&&(tr=function(t){return ir.mark(t)},er=function(t,e,n){ir.measure(t,e,n),ir.clearMarks(e),ir.clearMarks(n)})}function sr(t,e){nr.$on(t,e)}function ar(t,e){nr.$off(t,e)}function ur(t,e){var n=nr;return function r(){var o=e.apply(null,arguments);null!==o&&n.$off(t,r)}}function lr(t,e,n){nr=t,tn(e,n||{},sr,ar,ur,t),nr=void 0}var cr=null,pr=!1;function fr(t){var e=cr;return cr=t,function(){cr=e}}function dr(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function hr(t,e){if(e){if(t._directInactive=!1,dr(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++)hr(t.$children[n]);gr(t,"activated")}}function mr(t,e){if(!(e&&(t._directInactive=!0,dr(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)mr(t.$children[n]);gr(t,"deactivated")}}function gr(t,e,n,r){void 0===r&&(r=!0),be();var o=le;r&&ce(t);var i=t.$options[e],s="".concat(e," hook");if(i)for(var a=0,u=i.length;a<u;a++)Ln(i[a],t,n||null,t,s);t._hasHookEvent&&t.$emit("hook:"+e),r&&ce(o),_e()}var vr=[],yr=[],br={},_r={},Dr=!1,Er=!1,wr=0;var Cr=0,kr=Date.now;if(Kt&&!Gt){var Ar=window.performance;Ar&&"function"==typeof Ar.now&&kr()>document.createEvent("Event").timeStamp&&(kr=function(){return Ar.now()})}var xr=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Or(){var t,e;for(Cr=kr(),Er=!0,vr.sort(xr),wr=0;wr<vr.length;wr++)if((t=vr[wr]).before&&t.before(),e=t.id,br[e]=null,t.run(),"production"!==process.env.NODE_ENV&&null!=br[e]&&(_r[e]=(_r[e]||0)+1,_r[e]>100)){Hr("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=yr.slice(),r=vr.slice();wr=vr.length=yr.length=0,br={},"production"!==process.env.NODE_ENV&&(_r={}),Dr=Er=!1,function(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,hr(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&&gr(r,"updated")}}(r),ie&&zt.devtools&&ie.emit("flush")}function Sr(t){var e=t.id;if(null==br[e]&&(t!==ve.target||!t.noRecurse)){if(br[e]=!0,Er){for(var n=vr.length-1;n>wr&&vr[n].id>t.id;)n--;vr.splice(n+1,0,t)}else vr.push(t);if(!Dr){if(Dr=!0,"production"!==process.env.NODE_ENV&&!zt.async)return void Or();Yn(Or)}}}function Nr(t){var e=t.$options.provide;if(e){var n=st(e)?e.call(t):e;if(!at(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=ue?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 Tr(t,e){if(t){for(var n=Object.create(null),r=ue?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]=st(a)?a.call(e):a}else"production"!==process.env.NODE_ENV&&Hr('Injection "'.concat(i,'" not found'),e)}}return n}}function Fr(t,e,n,r,o){var i,s=this,a=o.options;Dt(r,"_uid")?(i=Object.create(r))._original=r:(i=r,r=r._original);var u=ot(a._compiled),l=!u;this.data=t,this.props=e,this.children=n,this.parent=r,this.listeners=t.on||tt,this.injections=Tr(a.inject,r),this.slots=function(){return s.$slots||kn(r,t.scopedSlots,s.$slots=En(n,r)),s.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return kn(r,t.scopedSlots,this.slots())}}),u&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=kn(r,t.scopedSlots,this.$slots)),a._scopeId?this._c=function(t,e,n,o){var s=$n(i,t,e,n,o,l);return s&&!et(s)&&(s.fnScopeId=a._scopeId,s.fnContext=r),s}:this._c=function(t,e,n,r){return $n(i,t,e,n,r,l)}}function Mr(t,e,n,r,o){var i=he(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 Ir(t,e){for(var n in e)t[Ct(n)]=e[n]}function $r(t){return t.name||t.__name||t._componentTag}Dn(Fr.prototype);var Br={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;Br.prepatch(n,n)}else{(t.componentInstance=function(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;rt(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,cr)).$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&&(pr=!0);var i=r.data.scopedSlots,s=t.$scopedSlots,a=!!(i&&!i.$stable||s!==tt&&!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||tt;t._attrsProxy&&Sn(t._attrsProxy,c,l.data&&l.data.attrs||tt,t,"$attrs")&&(u=!0),t.$attrs=c,n=n||tt;var p=t.$options._parentListeners;if(t._listenersProxy&&Sn(t._listenersProxy,n,p||tt,t,"$listeners"),t.$listeners=t.$options._parentListeners=n,lr(t,n,p),e&&t.$options.props){Ae(!1);for(var f=t._props,d=t.$options._propKeys||[],h=0;h<d.length;h++){var m=d[h],g=t.$options.props;f[m]=no(m,g,e,t)}Ae(!0),t.$options.propsData=e}u&&(t.$slots=En(o,r.context),t.$forceUpdate()),"production"!==process.env.NODE_ENV&&(pr=!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,gr(r,"mounted")),t.data.keepAlive&&(n._isMounted?((e=r)._inactive=!1,yr.push(e)):hr(r,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?mr(e,!0):e.$destroy())}},Rr=Object.keys(Br);function Lr(t,e,n,r,o){if(!nt(t)){var i=n.$options._base;if(at(t)&&(t=i.extend(t)),"function"==typeof t){var s;if(nt(t.cid)&&(t=function(t,e){if(ot(t.error)&&rt(t.errorComp))return t.errorComp;if(rt(t.resolved))return t.resolved;var n=Fn;if(n&&rt(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n),ot(t.loading)&&rt(t.loadingComp))return t.loadingComp;if(n&&!rt(t.owners)){var r=t.owners=[n],o=!0,i=null,s=null;n.$on("hook:destroyed",(function(){return bt(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=Rt((function(n){t.resolved=Mn(n,e),o?r.length=0:a(!0)})),l=Rt((function(e){"production"!==process.env.NODE_ENV&&Hr("Failed to resolve async component: ".concat(String(t))+(e?"\nReason: ".concat(e):"")),rt(t.errorComp)&&(t.error=!0,a(!0))})),c=t(u,l);return at(c)&&(dt(c)?nt(t.resolved)&&c.then(u,l):dt(c.component)&&(c.component.then(u,l),rt(c.error)&&(t.errorComp=Mn(c.error,e)),rt(c.loading)&&(t.loadingComp=Mn(c.loading,e),0===c.delay?t.loading=!0:i=setTimeout((function(){i=null,nt(t.resolved)&&nt(t.error)&&(t.loading=!0,a(!1))}),c.delay||200)),rt(c.timeout)&&(s=setTimeout((function(){s=null,nt(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=fe();return i.asyncFactory=t,i.asyncMeta={data:e,context:n,children:r,tag:o},i}(s,e,n,r,o);e=e||{},No(t),rt(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;rt(i)?(et(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(!nt(r)){var o={},i=t.attrs,s=t.props;if(rt(i)||rt(s))for(var a in r){var u=xt(a);if("production"!==process.env.NODE_ENV){var l=a.toLowerCase();a!==l&&i&&Dt(i,l)&&Vr('Prop "'.concat(l,'" is passed to component ')+"".concat(zr(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,'".'))}nn(o,s,a,u,!0)||nn(o,i,a,u,!1)}return o}}(e,t,o);if(ot(t.options.functional))return function(t,e,n,r,o){var i=t.options,s={},a=i.props;if(rt(a))for(var u in a)s[u]=no(u,a,e||tt);else rt(n.attrs)&&Ir(s,n.attrs),rt(n.props)&&Ir(s,n.props);var l=new Fr(n,s,o,r,t),c=i.render.call(null,l._c,l);if(c instanceof pe)return Mr(c,n,l.parent,i,l);if(et(c)){for(var p=rn(c)||[],f=new Array(p.length),d=0;d<p.length;d++)f[d]=Mr(p[d],n,l.parent,i,l);return f}}(t,a,e,n,r);var u=e.on;if(e.on=e.nativeOn,ot(t.options.abstract)){var l=e.slot;e={},l&&(e.slot=l)}!function(t){for(var e=t.hook||(t.hook={}),n=0;n<Rr.length;n++){var r=Rr[n],o=e[r],i=Br[r];o===i||o&&o._merged||(e[r]=o?Pr(i,o):i)}}(e);var c=$r(t.options)||o;return new pe("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&&Hr("Invalid Component definition: ".concat(String(t)),n)}}function Pr(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}var jr,zr,Hr=Ft,Vr=Ft;if("production"!==process.env.NODE_ENV){var Wr="undefined"!=typeof console,Ur=/(?:^|[-_])(\w)/g;Hr=function(t,e){void 0===e&&(e=le);var n=e?jr(e):"";zt.warnHandler?zt.warnHandler.call(null,t,e,n):Wr&&!zt.silent&&console.error("[Vue warn]: ".concat(t).concat(n))},Vr=function(t,e){Wr&&!zt.silent&&console.warn("[Vue tip]: ".concat(t)+(e?jr(e):""))},zr=function(t,e){if(t.$root===t)return"<Root>";var n=st(t)&&null!=t.cid?t.options:t._isVue?t.$options||t.constructor.options:t,r=$r(n),o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<".concat(r.replace(Ur,(function(t){return t.toUpperCase()})).replace(/[-_]/g,""),">"):"<Anonymous>")+(o&&!1!==e?" at ".concat(o):"")};jr=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(et(t)?"".concat(zr(t[0]),"... (").concat(t[1]," recursive calls)"):zr(t))})).join("\n")}return"\n\n(found in ".concat(zr(t),")")}}var qr=zt.optionMergeStrategies;function Kr(t,e){if(!e)return t;for(var n,r,o,i=ue?Reflect.ownKeys(e):Object.keys(e),s=0;s<i.length;s++)"__ob__"!==(n=i[s])&&(r=t[n],o=e[n],Dt(t,n)?r!==o&&ct(r)&&ct(o)&&Kr(r,o):Te(t,n,o));return t}function Jr(t,e,n){return n?function(){var r=st(e)?e.call(n,n):e,o=st(t)?t.call(n,n):t;return r?Kr(r,o):o}:e?t?function(){return Kr(st(e)?e.call(this,this):e,st(t)?t.call(this,this):t)}:e:t}function Gr(t,e){var n=e?t?t.concat(e):et(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 Yr(t,e,n,r){var o=Object.create(t||null);return e?("production"!==process.env.NODE_ENV&&Zr(r,e,n),Nt(o,e)):o}"production"!==process.env.NODE_ENV&&(qr.el=qr.propsData=function(t,e,n,r){return n||Hr('option "'.concat(r,'" can only be used during instance ')+"creation with the `new` keyword."),Xr(t,e)}),qr.data=function(t,e,n){return n?Jr(t,e,n):e&&"function"!=typeof e?("production"!==process.env.NODE_ENV&&Hr('The "data" option should be a function that returns a per-instance value in component definitions.',n),t):Jr(t,e)},jt.forEach((function(t){qr[t]=Gr})),Pt.forEach((function(t){qr[t+"s"]=Yr})),qr.watch=function(t,e,n,r){if(t===ee&&(t=void 0),e===ee&&(e=void 0),!e)return Object.create(t||null);if("production"!==process.env.NODE_ENV&&Zr(r,e,n),!t)return e;var o={};for(var i in Nt(o,t),e){var s=o[i],a=e[i];s&&!et(s)&&(s=[s]),o[i]=s?s.concat(a):et(a)?a:[a]}return o},qr.props=qr.methods=qr.inject=qr.computed=function(t,e,n,r){if(e&&"production"!==process.env.NODE_ENV&&Zr(r,e,n),!t)return e;var o=Object.create(null);return Nt(o,t),e&&Nt(o,e),o},qr.provide=Jr;var Xr=function(t,e){return void 0===e?t:e};function Qr(t){new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(Ht.source,"]*$")).test(t)||Hr('Invalid component name: "'+t+'". Component names should conform to valid custom element name in html5 specification.'),(vt(t)||zt.isReservedTag(t))&&Hr("Do not use built-in or reserved HTML elements as component id: "+t)}function Zr(t,e,n){ct(e)||Hr('Invalid value for option "'.concat(t,'": expected an Object, ')+"but got ".concat(lt(e),"."),n)}function to(t,e,n){if("production"!==process.env.NODE_ENV&&function(t){for(var e in t.components)Qr(e)}(e),st(e)&&(e=e.options),function(t,e){var n=t.props;if(n){var r,o,i={};if(et(n))for(r=n.length;r--;)"string"==typeof(o=n[r])?i[Ct(o)]={type:null}:"production"!==process.env.NODE_ENV&&Hr("props must be strings when using array syntax.");else if(ct(n))for(var s in n)o=n[s],i[Ct(s)]=ct(o)?o:{type:o};else"production"!==process.env.NODE_ENV&&Hr('Invalid value for option "props": expected an Array or an Object, '+"but got ".concat(lt(n),"."),e);t.props=i}}(e,n),function(t,e){var n=t.inject;if(n){var r=t.inject={};if(et(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(ct(n))for(var i in n){var s=n[i];r[i]=ct(s)?Nt({from:i},s):{from:s}}else"production"!==process.env.NODE_ENV&&Hr('Invalid value for option "inject": expected an Array or an Object, '+"but got ".concat(lt(n),"."),e)}}(e,n),function(t){var e=t.directives;if(e)for(var n in e){var r=e[n];st(r)&&(e[n]={bind:r,update:r})}}(e),!e._base&&(e.extends&&(t=to(t,e.extends,n)),e.mixins))for(var r=0,o=e.mixins.length;r<o;r++)t=to(t,e.mixins[r],n);var i,s={};for(i in t)a(i);for(i in e)Dt(t,i)||a(i);function a(r){var o=qr[r]||Xr;s[r]=o(t[r],e[r],n,r)}return s}function eo(t,e,n,r){if("string"==typeof n){var o=t[e];if(Dt(o,n))return o[n];var i=Ct(n);if(Dt(o,i))return o[i];var s=kt(i);if(Dt(o,s))return o[s];var a=o[n]||o[i]||o[s];return"production"!==process.env.NODE_ENV&&r&&!a&&Hr("Failed to resolve "+e.slice(0,-1)+": "+n),a}}function no(t,e,n,r){var o=e[t],i=!Dt(n,t),s=n[t],a=uo(Boolean,o.type);if(a>-1)if(i&&!Dt(o,"default"))s=!1;else if(""===s||s===xt(t)){var u=uo(String,o.type);(u<0||a<u)&&(s=!0)}if(void 0===s){s=function(t,e,n){if(!Dt(e,"default"))return;var r=e.default;"production"!==process.env.NODE_ENV&&at(r)&&Hr('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 st(r)&&"Function"!==so(e.type)?r.call(t):r}(r,o,t);var l=ke;Ae(!0),Se(s),Ae(l)}return"production"!==process.env.NODE_ENV&&function(t,e,n,r,o){if(t.required&&o)return void Hr('Missing required prop: "'+e+'"',r);if(null==n&&!t.required)return;var i=t.type,s=!i||!0===i,a=[];if(i){et(i)||(i=[i]);for(var u=0;u<i.length&&!s;u++){var l=oo(n,i[u],r);a.push(l.expectedType||""),s=l.valid}}var c=a.some((function(t){return t}));if(!s&&c)return void Hr(function(t,e,n){var r='Invalid prop: type check failed for prop "'.concat(t,'".')+" Expected ".concat(n.map(kt).join(", ")),o=n[0],i=lt(e);1===n.length&&fo(o)&&fo(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(lo(e,o)));r+=", got ".concat(i," "),fo(i)&&(r+="with value ".concat(lo(e,i),"."));return r}(e,n,a),r);var p=t.validator;p&&(p(n)||Hr('Invalid prop: custom validator check failed for prop "'+e+'".',r))}(o,t,s,r,i),s}var ro=/^(String|Number|Boolean|Function|Symbol|BigInt)$/;function oo(t,e,n){var r,o=so(e);if(ro.test(o)){var i=typeof t;(r=i===o.toLowerCase())||"object"!==i||(r=t instanceof e)}else if("Object"===o)r=ct(t);else if("Array"===o)r=et(t);else try{r=t instanceof e}catch(t){Hr('Invalid prop type: "'+String(e)+'" is not a constructor',n),r=!1}return{valid:r,expectedType:o}}var io=/^\s*function (\w+)/;function so(t){var e=t&&t.toString().match(io);return e?e[1]:""}function ao(t,e){return so(t)===so(e)}function uo(t,e){if(!et(e))return ao(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(ao(e[n],t))return n;return-1}function lo(t,e){return"String"===e?'"'.concat(t,'"'):"".concat("Number"===e?Number(t):t)}var co,po=["string","number","boolean"];function fo(t){return po.some((function(e){return t.toLowerCase()===e}))}if("production"!==process.env.NODE_ENV){var ho=gt("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"),mo=function(t,e){Hr('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)},go=function(t,e){Hr('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)},vo="undefined"!=typeof Proxy&&se(Proxy);if(vo){var yo=gt("stop,prevent,self,ctrl,shift,alt,meta,exact");zt.keyCodes=new Proxy(zt.keyCodes,{set:function(t,e,n){return yo(e)?(Hr("Avoid overwriting built-in modifier in config.keyCodes: .".concat(e)),!1):(t[e]=n,!0)}})}var bo={has:function(t,e){var n=e in t,r=ho(e)||"string"==typeof e&&"_"===e.charAt(0)&&!(e in t.$data);return n||r||(e in t.$data?go(t,e):mo(t,e)),n||!r}},_o={get:function(t,e){return"string"!=typeof e||e in t||(e in t.$data?go(t,e):mo(t,e)),t[e]}};co=function(t){if(vo){var e=t.$options,n=e.render&&e.render._withStripped?_o:bo;t._renderProxy=new Proxy(t,n)}else t._renderProxy=t}}var Do={enumerable:!0,configurable:!0,get:Ft,set:Ft};function Eo(t,e,n){Do.get=function(){return this[e][n]},Do.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Do)}function wo(t){var e=t.$options;if(e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=Ie({}),o=t.$options._propKeys=[],i=!t.$parent;i||Ae(!1);var s=function(s){o.push(s);var a=no(s,e,n,t);if("production"!==process.env.NODE_ENV){var u=xt(s);(yt(u)||zt.isReservedAttr(u))&&Hr('"'.concat(u,'" is a reserved attribute and cannot be used as component prop.'),t),Ne(r,s,a,(function(){i||pr||Hr("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 Ne(r,s,a);s in t||Eo(t,"_props",s)};for(var a in e)s(a);Ae(!0)}(t,e.props),On(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]&&Hr('Method "'.concat(r,'" has type "').concat(typeof e[r],'" in the component definition. ')+"Did you reference the function correctly?",t),n&&Dt(n,r)&&Hr('Method "'.concat(r,'" has already been defined as a prop.'),t),r in t&&Vt(r)&&Hr('Method "'.concat(r,'" conflicts with an existing Vue instance method. ')+"Avoid defining component methods that start with _ or $.")),t[r]="function"!=typeof e[r]?Ft:Ot(e[r],t)}(t,e.methods),e.data)!function(t){var e=t.$options.data;ct(e=t._data=st(e)?function(t,e){be();try{return t.call(e,e)}catch(t){return Rn(t,e,"data()"),{}}finally{_e()}}(e,t):e||{})||(e={},"production"!==process.env.NODE_ENV&&Hr("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&&Dt(o,s)&&Hr('Method "'.concat(s,'" has already been defined as a data property.'),t),r&&Dt(r,s)?"production"!==process.env.NODE_ENV&&Hr('The data property "'.concat(s,'" is already declared as a prop. ')+"Use prop default value instead.",t):Vt(s)||Eo(t,"_data",s)}var a=Se(e);a&&a.vmCount++}(t);else{var n=Se(t._data={});n&&n.vmCount++}e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=oe();for(var o in e){var i=e[o],s=st(i)?i:i.get;"production"!==process.env.NODE_ENV&&null==s&&Hr('Getter is missing for computed property "'.concat(o,'".'),t),r||(n[o]=new or(t,s||Ft,Ft,Co)),o in t?"production"!==process.env.NODE_ENV&&(o in t.$data?Hr('The computed property "'.concat(o,'" is already defined in data.'),t):t.$options.props&&o in t.$options.props?Hr('The computed property "'.concat(o,'" is already defined as a prop.'),t):t.$options.methods&&o in t.$options.methods&&Hr('The computed property "'.concat(o,'" is already defined as a method.'),t)):ko(t,o,i)}}(t,e.computed),e.watch&&e.watch!==ee&&function(t,e){for(var n in e){var r=e[n];if(et(r))for(var o=0;o<r.length;o++)Oo(t,n,r[o]);else Oo(t,n,r)}}(t,e.watch)}var Co={lazy:!0};function ko(t,e,n){var r=!oe();st(n)?(Do.get=r?Ao(e):xo(n),Do.set=Ft):(Do.get=n.get?r&&!1!==n.cache?Ao(e):xo(n.get):Ft,Do.set=n.set||Ft),"production"!==process.env.NODE_ENV&&Do.set===Ft&&(Do.set=function(){Hr('Computed property "'.concat(e,'" was assigned to but it has no setter.'),this)}),Object.defineProperty(t,e,Do)}function Ao(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),ve.target&&("production"!==process.env.NODE_ENV&&ve.target.onTrack&&ve.target.onTrack({effect:ve.target,target:this,type:"get",key:t}),e.depend()),e.value}}function xo(t){return function(){return t.call(this,this)}}function Oo(t,e,n,r){return ct(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var So=0;function No(t){var e=t.options;if(t.super){var n=No(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&&Nt(t.extendOptions,r),(e=t.options=to(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function To(t){"production"===process.env.NODE_ENV||this instanceof To||Hr("Vue is a constructor and should be called with the `new` keyword"),this._init(t)}function Fo(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=$r(t)||$r(n.options);"production"!==process.env.NODE_ENV&&i&&Qr(i);var s=function(t){this._init(t)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=e++,s.options=to(n.options,t),s.super=n,s.options.props&&function(t){var e=t.options.props;for(var n in e)Eo(t.prototype,"_props",n)}(s),s.options.computed&&function(t){var e=t.options.computed;for(var n in e)ko(t.prototype,n,e[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,Pt.forEach((function(t){s[t]=n[t]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=Nt({},s.options),o[r]=s,s}}function Mo(t){return t&&($r(t.Ctor.options)||t.tag)}function Io(t,e){return et(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!pt(t)&&t.test(e)}function $o(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)&&Bo(n,i,r,o)}}}function Bo(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,bt(n,e)}!function(t){t.prototype._init=function(t){var e,n,r=this;r._uid=So++,"production"!==process.env.NODE_ENV&&zt.performance&&tr&&(e="vue-perf-start:".concat(r._uid),n="vue-perf-end:".concat(r._uid),tr(e)),r._isVue=!0,r.__v_skip=!0,r._scope=new Xe(!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=to(No(r.constructor),t||{},r),"production"!==process.env.NODE_ENV?co(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&&lr(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=En(e._renderChildren,r),t.$scopedSlots=n?kn(t.$parent,n.data.scopedSlots,t.$slots):tt,t._c=function(e,n,r,o){return $n(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return $n(t,e,n,r,o,!0)};var o=n&&n.data;"production"!==process.env.NODE_ENV?(Ne(t,"$attrs",o&&o.attrs||tt,(function(){!pr&&Hr("$attrs is readonly.",t)}),!0),Ne(t,"$listeners",e._parentListeners||tt,(function(){!pr&&Hr("$listeners is readonly.",t)}),!0)):(Ne(t,"$attrs",o&&o.attrs||tt,null,!0),Ne(t,"$listeners",e._parentListeners||tt,null,!0))}(r),gr(r,"beforeCreate",void 0,!1),function(t){var e=Tr(t.$options.inject,t);e&&(Ae(!1),Object.keys(e).forEach((function(n){"production"!==process.env.NODE_ENV?Ne(t,n,e[n],(function(){Hr("Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. "+'injection being mutated: "'.concat(n,'"'),t)})):Ne(t,n,e[n])})),Ae(!0))}(r),wo(r),Nr(r),gr(r,"created"),"production"!==process.env.NODE_ENV&&zt.performance&&tr&&(r._name=zr(r,!1),tr(n),er("vue ".concat(r._name," init"),e,n)),r.$options.el&&r.$mount(r.$options.el)}}(To),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};"production"!==process.env.NODE_ENV&&(e.set=function(){Hr("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){Hr("$props is readonly.",this)}),Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Te,t.prototype.$delete=Fe,t.prototype.$watch=function(t,e,n){var r=this;if(ct(e))return Oo(r,t,e,n);(n=n||{}).user=!0;var o=new or(r,t,e,n);if(n.immediate){var i='callback for immediate watcher "'.concat(o.expression,'"');be(),Ln(e,r,[o.value],r,i),_e()}return function(){o.teardown()}}}(To),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(et(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(et(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]&&Vr('Event "'.concat(n,'" is emitted in component ')+"".concat(zr(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(xt(t),'" instead of "').concat(t,'".'))}var r=e._events[t];if(r){r=r.length>1?St(r):r;for(var o=St(arguments,1),i='event handler for "'.concat(t,'"'),s=0,a=r.length;s<a;s++)Ln(r[s],e,o,e,i)}return e}}(To),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,o=n._vnode,i=fr(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){gr(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||bt(e.$children,t),t._scope.stop(),t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),gr(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(To),function(t){Dn(t.prototype),t.prototype.$nextTick=function(t){return Yn(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,r=n.render,o=n._parentVnode;o&&e._isMounted&&(e.$scopedSlots=kn(e.$parent,o.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&Tn(e._slotsProxy,e.$scopedSlots)),e.$vnode=o;try{ce(e),Fn=e,t=r.call(e._renderProxy,e.$createElement)}catch(n){if(Rn(n,e,"render"),"production"!==process.env.NODE_ENV&&e.$options.renderError)try{t=e.$options.renderError.call(e._renderProxy,e.$createElement,n)}catch(n){Rn(n,e,"renderError"),t=e._vnode}else t=e._vnode}finally{Fn=null,ce()}return et(t)&&1===t.length&&(t=t[0]),t instanceof pe||("production"!==process.env.NODE_ENV&&et(t)&&Hr("Multiple root nodes returned from render function. Render function should return a single root node.",e),t=fe()),t.parent=o,t}}(To);var Ro=[String,RegExp,Array],Lo={name:"keep-alive",abstract:!0,props:{include:Ro,exclude:Ro,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:Mo(a),tag:i,componentInstance:s},n.push(o),this.max&&n.length>parseInt(this.max)&&Bo(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)Bo(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){$o(t,(function(t){return Io(e,t)}))})),this.$watch("exclude",(function(e){$o(t,(function(t){return!Io(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=In(t),n=e&&e.componentOptions;if(n){var r=Mo(n),o=this.include,i=this.exclude;if(o&&(!r||!Io(o,r))||i&&r&&Io(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,bt(a,u),a.push(u)):(this.vnodeToCache=e,this.keyToCache=u),e.data.keepAlive=!0}return e||t&&t[0]}},Po={KeepAlive:Lo};!function(t){var e={get:function(){return zt}};"production"!==process.env.NODE_ENV&&(e.set=function(){Hr("Do not replace the Vue.config object, set individual fields instead.")}),Object.defineProperty(t,"config",e),t.util={warn:Hr,extend:Nt,mergeOptions:to,defineReactive:Ne},t.set=Te,t.delete=Fe,t.nextTick=Yn,t.observable=function(t){return Se(t),t},t.options=Object.create(null),Pt.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,Nt(t.options.components,Po),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=St(arguments,1);return n.unshift(this),st(t.install)?t.install.apply(t,n):st(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=to(this.options,t),this}}(t),Fo(t),function(t){Pt.forEach((function(e){t[e]=function(t,n){return n?("production"!==process.env.NODE_ENV&&"component"===e&&Qr(t),"component"===e&&ct(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&st(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(To),Object.defineProperty(To.prototype,"$isServer",{get:oe}),Object.defineProperty(To.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(To,"FunctionalRenderContext",{value:Fr}),To.version="2.7.10";var jo=gt("style,class"),zo=gt("input,textarea,option,select,progress"),Ho=gt("contenteditable,draggable,spellcheck"),Vo=gt("events,caret,typing,plaintext-only"),Wo=gt("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"),Uo="http://www.w3.org/1999/xlink",qo=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Ko=function(t){return qo(t)?t.slice(6,t.length):""},Jo=function(t){return null==t||!1===t};function Go(t){for(var e=t.data,n=t,r=t;rt(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Yo(r.data,e));for(;rt(n=n.parent);)n&&n.data&&(e=Yo(e,n.data));return function(t,e){if(rt(t)||rt(e))return Xo(t,Qo(e));return""}(e.staticClass,e.class)}function Yo(t,e){return{staticClass:Xo(t.staticClass,e.staticClass),class:rt(t.class)?[t.class,e.class]:e.class}}function Xo(t,e){return t?e?t+" "+e:t:e||""}function Qo(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r<o;r++)rt(e=Qo(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):at(t)?function(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}var Zo={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},ti=gt("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=gt("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),ni=function(t){return ti(t)||ei(t)};var ri=Object.create(null);var oi=gt("text,number,password,search,email,tel,url");var ii=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(Zo[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,"")}}),si={create:function(t,e){ai(e)},update:function(t,e){t.data.ref!==e.data.ref&&(ai(t,!0),ai(e))},destroy:function(t){ai(t,!0)}};function ai(t,e){var n=t.data.ref;if(rt(n)){var r=t.context,o=t.componentInstance||t.elm,i=e?null:o,s=e?void 0:o;if(st(n))Ln(n,r,[i],r,"template ref function");else{var a=t.data.refInFor,u="string"==typeof n||"number"==typeof n,l=Pe(n),c=r.$refs;if(u||l)if(a){var p=u?c[n]:n.value;e?et(p)&&bt(p,o):et(p)?p.includes(o)||p.push(o):u?(c[n]=[o],ui(r,n,c[n])):n.value=[o]}else if(u){if(e&&c[n]!==o)return;c[n]=s,ui(r,n,i)}else if(l){if(e&&n.value!==o)return;n.value=i}else"production"!==process.env.NODE_ENV&&Hr("Invalid template ref type: ".concat(typeof n))}}}function ui(t,e,n){var r=t._setupState;r&&Dt(r,e)&&(Pe(r[e])?r[e].value=n:r[e]=n)}var li=new pe("",{},[]),ci=["create","activate","update","remove","destroy"];function pi(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&rt(t.data)===rt(e.data)&&function(t,e){if("input"!==t.tag)return!0;var n,r=rt(n=t.data)&&rt(n=n.attrs)&&n.type,o=rt(n=e.data)&&rt(n=n.attrs)&&n.type;return r===o||oi(r)&&oi(o)}(t,e)||ot(t.isAsyncPlaceholder)&&nt(e.asyncFactory.error))}function fi(t,e,n){var r,o,i={};for(r=e;r<=n;++r)rt(o=t[r].key)&&(i[o]=r);return i}var di={create:hi,update:hi,destroy:function(t){hi(t,li)}};function hi(t,e){(t.data.directives||e.data.directives)&&function(t,e){var n,r,o,i=t===li,s=e===li,a=gi(t.data.directives,t.context),u=gi(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,yi(o,"update",e,t),o.def&&o.def.componentUpdated&&c.push(o)):(yi(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++)yi(l[n],"inserted",e,t)};i?en(e,"insert",p):p()}c.length&&en(e,"postpatch",(function(){for(var n=0;n<c.length;n++)yi(c[n],"componentUpdated",e,t)}));if(!i)for(n in a)u[n]||yi(a[n],"unbind",t,t,s)}(t,e)}var mi=Object.create(null);function gi(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=mi),o[vi(r)]=r,e._setupState&&e._setupState.__sfc){var i=r.def||eo(e,"_setupState","v-"+r.name);r.def="function"==typeof i?{bind:i,update:i}:i}r.def=r.def||eo(e.$options,"directives",r.name,!0)}return o}function vi(t){return t.rawName||"".concat(t.name,".").concat(Object.keys(t.modifiers||{}).join("."))}function yi(t,e,n,r,o){var i=t.def&&t.def[e];if(i)try{i(n.elm,t,n,r,o)}catch(r){Rn(r,n.context,"directive ".concat(t.name," ").concat(e," hook"))}}var bi=[si,di];function _i(t,e){var n=e.componentOptions;if(!(rt(n)&&!1===n.Ctor.options.inheritAttrs||nt(t.data.attrs)&&nt(e.data.attrs))){var r,o,i=e.elm,s=t.data.attrs||{},a=e.data.attrs||{};for(r in(rt(a.__ob__)||ot(a._v_attr_proxy))&&(a=e.data.attrs=Nt({},a)),a)o=a[r],s[r]!==o&&Di(i,r,o,e.data.pre);for(r in(Gt||Xt)&&a.value!==s.value&&Di(i,"value",a.value),s)nt(a[r])&&(qo(r)?i.removeAttributeNS(Uo,Ko(r)):Ho(r)||i.removeAttribute(r))}}function Di(t,e,n,r){r||t.tagName.indexOf("-")>-1?Ei(t,e,n):Wo(e)?Jo(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Ho(e)?t.setAttribute(e,function(t,e){return Jo(e)||"false"===e?"false":"contenteditable"===t&&Vo(e)?e:"true"}(e,n)):qo(e)?Jo(n)?t.removeAttributeNS(Uo,Ko(e)):t.setAttributeNS(Uo,e,n):Ei(t,e,n)}function Ei(t,e,n){if(Jo(n))t.removeAttribute(e);else{if(Gt&&!Yt&&"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 wi={create:_i,update:_i};function Ci(t,e){var n=e.elm,r=e.data,o=t.data;if(!(nt(r.staticClass)&&nt(r.class)&&(nt(o)||nt(o.staticClass)&&nt(o.class)))){var i=Go(e),s=n._transitionClasses;rt(s)&&(i=Xo(i,Qo(s))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}}var ki,Ai={create:Ci,update:Ci};function xi(t,e,n){var r=ki;return function o(){var i=e.apply(null,arguments);null!==i&&Ni(t,o,n,r)}}var Oi=Hn&&!(te&&Number(te[1])<=53);function Si(t,e,n,r){if(Oi){var o=Cr,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)}}ki.addEventListener(t,e,ne?{capture:n,passive:r}:n)}function Ni(t,e,n,r){(r||ki).removeEventListener(t,e._wrapper||e,n)}function Ti(t,e){if(!nt(t.data.on)||!nt(e.data.on)){var n=e.data.on||{},r=t.data.on||{};ki=e.elm||t.elm,function(t){if(rt(t.__r)){var e=Gt?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}rt(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),tn(n,r,Si,Ni,xi,e.context),ki=void 0}}var Fi,Mi={create:Ti,update:Ti,destroy:function(t){return Ti(t,li)}};function Ii(t,e){if(!nt(t.data.domProps)||!nt(e.data.domProps)){var n,r,o=e.elm,i=t.data.domProps||{},s=e.data.domProps||{};for(n in(rt(s.__ob__)||ot(s._v_attr_proxy))&&(s=e.data.domProps=Nt({},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=nt(r)?"":String(r);$i(o,a)&&(o.value=a)}else if("innerHTML"===n&&ei(o.tagName)&&nt(o.innerHTML)){(Fi=Fi||document.createElement("div")).innerHTML="<svg>".concat(r,"</svg>");for(var u=Fi.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 $i(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(rt(r)){if(r.number)return mt(n)!==mt(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Bi={create:Ii,update:Ii},Ri=Et((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 Li(t){var e=Pi(t.style);return t.staticStyle?Nt(t.staticStyle,e):e}function Pi(t){return Array.isArray(t)?Tt(t):"string"==typeof t?Ri(t):t}var ji,zi=/^--/,Hi=/\s*!important$/,Vi=function(t,e,n){if(zi.test(e))t.style.setProperty(e,n);else if(Hi.test(n))t.style.setProperty(xt(e),n.replace(Hi,""),"important");else{var r=Ui(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}},Wi=["Webkit","Moz","ms"],Ui=Et((function(t){if(ji=ji||document.createElement("div").style,"filter"!==(t=Ct(t))&&t in ji)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Wi.length;n++){var r=Wi[n]+e;if(r in ji)return r}}));function qi(t,e){var n=e.data,r=t.data;if(!(nt(n.staticStyle)&&nt(n.style)&&nt(r.staticStyle)&&nt(r.style))){var o,i,s=e.elm,a=r.staticStyle,u=r.normalizedStyle||r.style||{},l=a||u,c=Pi(e.data.style)||{};e.data.normalizedStyle=rt(c.__ob__)?Nt({},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=Li(o.data))&&Nt(r,n);(n=Li(t.data))&&Nt(r,n);for(var i=t;i=i.parent;)i.data&&(n=Li(i.data))&&Nt(r,n);return r}(e,!0);for(i in l)nt(p[i])&&Vi(s,i,"");for(i in p)(o=p[i])!==l[i]&&Vi(s,i,null==o?"":o)}}var Ki={create:qi,update:qi},Ji=/\s+/;function Gi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ji).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 Yi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ji).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 Xi(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&Nt(e,Qi(t.name||"v")),Nt(e,t),e}return"string"==typeof t?Qi(t):void 0}}var Qi=Et((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")}})),Zi=Kt&&!Yt,ts="transition",es="transitionend",ns="animation",rs="animationend";Zi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ts="WebkitTransition",es="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ns="WebkitAnimation",rs="webkitAnimationEnd"));var is=Kt?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function ss(t){is((function(){is(t)}))}function as(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Gi(t,e))}function us(t,e){t._transitionClasses&&bt(t._transitionClasses,e),Yi(t,e)}function ls(t,e,n){var r=ps(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a="transition"===o?es:rs,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 cs=/\b(transform|all)(,|$)/;function ps(t,e){var n,r=window.getComputedStyle(t),o=(r[ts+"Delay"]||"").split(", "),i=(r[ts+"Duration"]||"").split(", "),s=fs(o,i),a=(r[ns+"Delay"]||"").split(", "),u=(r[ns+"Duration"]||"").split(", "),l=fs(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&&cs.test(r[ts+"Property"])}}function fs(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return ds(e)+ds(t[n])})))}function ds(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function hs(t,e){var n=t.elm;rt(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=Xi(t.data.transition);if(!nt(r)&&!rt(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,d=r.enter,h=r.afterEnter,m=r.enterCancelled,g=r.beforeAppear,v=r.appear,y=r.afterAppear,b=r.appearCancelled,_=r.duration,D=cr,E=cr.$vnode;E&&E.parent;)D=E.context,E=E.parent;var w=!D._isMounted||!t.isRootInsert;if(!w||v||""===v){var C=w&&l?l:s,k=w&&p?p:u,A=w&&c?c:a,x=w&&g||f,O=w&&st(v)?v:d,S=w&&y||h,N=w&&b||m,T=mt(at(_)?_.enter:_);"production"!==process.env.NODE_ENV&&null!=T&&gs(T,"enter",t);var F=!1!==o&&!Yt,M=ys(O),I=n._enterCb=Rt((function(){F&&(us(n,A),us(n,k)),I.cancelled?(F&&us(n,C),N&&N(n)):S&&S(n),n._enterCb=null}));t.data.show||en(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&&(as(n,C),as(n,k),ss((function(){us(n,C),I.cancelled||(as(n,A),M||(vs(T)?setTimeout(I,T):ls(n,i,I)))}))),t.data.show&&(e&&e(),O&&O(n,I)),F||M||I()}}}function ms(t,e){var n=t.elm;rt(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=Xi(t.data.transition);if(nt(r)||1!==n.nodeType)return e();if(!rt(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,d=r.delayLeave,h=r.duration,m=!1!==o&&!Yt,g=ys(c),v=mt(at(h)?h.leave:h);"production"!==process.env.NODE_ENV&&rt(v)&&gs(v,"leave",t);var y=n._leaveCb=Rt((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),m&&(us(n,a),us(n,u)),y.cancelled?(m&&us(n,s),f&&f(n)):(e(),p&&p(n)),n._leaveCb=null}));d?d(b):b()}function b(){y.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),l&&l(n),m&&(as(n,s),as(n,u),ss((function(){us(n,s),y.cancelled||(as(n,a),g||(vs(v)?setTimeout(y,v):ls(n,i,y)))}))),c&&c(n,y),m||g||y())}}function gs(t,e,n){"number"!=typeof t?Hr("<transition> explicit ".concat(e," duration is not a valid number - ")+"got ".concat(JSON.stringify(t),"."),n.context):isNaN(t)&&Hr("<transition> explicit ".concat(e," duration is NaN - ")+"the duration expression might be incorrect.",n.context)}function vs(t){return"number"==typeof t&&!isNaN(t)}function ys(t){if(nt(t))return!1;var e=t.fns;return rt(e)?ys(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function bs(t,e){!0!==e.data.show&&hs(e)}var _s=function(t){var e,n,r={},o=t.modules,i=t.nodeOps;for(e=0;e<ci.length;++e)for(r[ci[e]]=[],n=0;n<o.length;++n)rt(o[n][ci[e]])&&r[ci[e]].push(o[n][ci[e]]);function s(t){var e=i.parentNode(t);rt(e)&&i.removeChild(e,t)}function a(t,e){return!e&&!t.ns&&!(zt.ignoredElements.length&&zt.ignoredElements.some((function(e){return pt(e)?e.test(t.tag):e===t.tag})))&&zt.isUnknownElement(t.tag)}var u=0;function l(t,e,n,o,s,l,d){if(rt(t.elm)&&rt(l)&&(t=l[d]=he(t)),t.isRootInsert=!s,!function(t,e,n,o){var i=t.data;if(rt(i)){var s=rt(t.componentInstance)&&i.keepAlive;if(rt(i=i.hook)&&rt(i=i.init)&&i(t,!1),rt(t.componentInstance))return c(t,e),p(n,t.elm,o),ot(s)&&function(t,e,n,o){var i,s=t;for(;s.componentInstance;)if(rt(i=(s=s.componentInstance._vnode).data)&&rt(i=i.transition)){for(i=0;i<r.activate.length;++i)r.activate[i](li,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;rt(y)?("production"!==process.env.NODE_ENV&&(g&&g.pre&&u++,a(t,u)&&Hr("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),rt(g)&&h(t,e),p(n,t.elm,o),"production"!==process.env.NODE_ENV&&g&&g.pre&&u--):ot(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){rt(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,d(t)?(h(t,e),m(t)):(ai(t),e.push(t))}function p(t,e,n){rt(t)&&(rt(n)?i.parentNode(n)===t&&i.insertBefore(t,e,n):i.appendChild(t,e))}function f(t,e,n){if(et(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 it(t.text)&&i.appendChild(t.elm,i.createTextNode(String(t.text)))}function d(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return rt(t.tag)}function h(t,n){for(var o=0;o<r.create.length;++o)r.create[o](li,t);rt(e=t.data.hook)&&(rt(e.create)&&e.create(li,t),rt(e.insert)&&n.push(t))}function m(t){var e;if(rt(e=t.fnScopeId))i.setStyleScope(t.elm,e);else for(var n=t;n;)rt(e=n.context)&&rt(e=e.$options._scopeId)&&i.setStyleScope(t.elm,e),n=n.parent;rt(e=cr)&&e!==t.context&&e!==t.fnContext&&rt(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(rt(o))for(rt(e=o.hook)&&rt(e=e.destroy)&&e(t),e=0;e<r.destroy.length;++e)r.destroy[e](t);if(rt(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];rt(r)&&(rt(r.tag)?(b(r),v(r)):s(r.elm))}}function b(t,e){if(rt(e)||rt(t.data)){var n,o=r.remove.length+1;for(rt(e)?e.listeners+=o:e=function(t,e){function n(){0==--n.listeners&&s(t)}return n.listeners=e,n}(t.elm,o),rt(n=t.componentInstance)&&rt(n=n._vnode)&&rt(n.data)&&b(n,e),n=0;n<r.remove.length;++n)r.remove[n](t,e);rt(n=t.data.hook)&&rt(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;rt(o)&&(e[o]?Hr("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(rt(i)&&pi(t,i))return o}}function E(t,e,n,o,s,a){if(t!==e){rt(e.elm)&&rt(o)&&(e=o[s]=he(e));var u=e.elm=t.elm;if(ot(t.isAsyncPlaceholder))rt(e.asyncFactory.resolved)?A(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(ot(e.isStatic)&&ot(t.isStatic)&&e.key===t.key&&(ot(e.isCloned)||ot(e.isOnce)))e.componentInstance=t.componentInstance;else{var c,p=e.data;rt(p)&&rt(c=p.hook)&&rt(c=c.prepatch)&&c(t,e);var f=t.children,h=e.children;if(rt(p)&&d(e)){for(c=0;c<r.update.length;++c)r.update[c](t,e);rt(c=p.hook)&&rt(c=c.update)&&c(t,e)}nt(e.text)?rt(f)&&rt(h)?f!==h&&function(t,e,n,r,o){var s,a,u,c=0,p=0,f=e.length-1,d=e[0],h=e[f],m=n.length-1,v=n[0],b=n[m],w=!o;for("production"!==process.env.NODE_ENV&&_(n);c<=f&&p<=m;)nt(d)?d=e[++c]:nt(h)?h=e[--f]:pi(d,v)?(E(d,v,r,n,p),d=e[++c],v=n[++p]):pi(h,b)?(E(h,b,r,n,m),h=e[--f],b=n[--m]):pi(d,b)?(E(d,b,r,n,m),w&&i.insertBefore(t,d.elm,i.nextSibling(h.elm)),d=e[++c],b=n[--m]):pi(h,v)?(E(h,v,r,n,p),w&&i.insertBefore(t,h.elm,d.elm),h=e[--f],v=n[++p]):(nt(s)&&(s=fi(e,c,f)),nt(a=rt(v.key)?s[v.key]:D(v,e,c,f))?l(v,r,t,d.elm,!1,n,p):pi(u=e[a],v)?(E(u,v,r,n,p),e[a]=void 0,w&&i.insertBefore(t,u.elm,d.elm)):l(v,r,t,d.elm,!1,n,p),v=n[++p]);c>f?g(t,nt(n[m+1])?null:n[m+1].elm,n,p,m,r):p>m&&y(e,c,f)}(u,f,h,n,a):rt(h)?("production"!==process.env.NODE_ENV&&_(h),rt(t.text)&&i.setTextContent(u,""),g(u,null,h,0,h.length-1,n)):rt(f)?y(f,0,f.length-1):rt(t.text)&&i.setTextContent(u,""):t.text!==e.text&&i.setTextContent(u,e.text),rt(p)&&rt(c=p.hook)&&rt(c=c.postpatch)&&c(t,e)}}}function w(t,e,n){if(ot(n)&&rt(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=gt("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,ot(e.isComment)&&rt(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if("production"!==process.env.NODE_ENV&&!function(t,e,n){return rt(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(rt(s)&&(rt(o=s.hook)&&rt(o=o.init)&&o(e,!0),rt(o=e.componentInstance)))return c(e,n),!0;if(rt(i)){if(rt(u))if(t.hasChildNodes())if(rt(o=s)&&rt(o=o.domProps)&&rt(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,d=0;d<u.length;d++){if(!p||!A(p,u[d],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(rt(s)){var m=!1;for(var g in s)if(!k(g)){m=!0,h(e,n);break}!m&&s.class&&Qn(s.class)}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,o){if(!nt(e)){var s,a=!1,u=[];if(nt(t))a=!0,l(e,u);else{var c=rt(t.nodeType);if(!c&&pi(t,e))E(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),ot(n)){if(A(t,e,u))return w(e,u,!0),t;"production"!==process.env.NODE_ENV&&Hr("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 pe(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)),rt(e.parent))for(var h=e.parent,m=d(e);h;){for(var g=0;g<r.destroy.length;++g)r.destroy[g](h);if(h.elm=e.elm,m){for(var b=0;b<r.create.length;++b)r.create[b](li,h);var _=h.data.hook.insert;if(_.merged)for(var D=1;D<_.fns.length;D++)_.fns[D]()}else ai(h);h=h.parent}rt(f)?y([t],0,0):rt(t.tag)&&v(t)}}return w(e,u,a),e.elm}rt(t)&&v(t)}}({nodeOps:ii,modules:[wi,Ai,Mi,Bi,Ki,Kt?{create:bs,activate:bs,remove:function(t,e){!0!==t.data.show?ms(t,e):e()}}:{}].concat(bi)});Yt&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&Os(t,"input")}));var Ds={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?en(n,"postpatch",(function(){Ds.componentUpdated(t,e,n)})):Es(t,e,n.context),t._vOptions=[].map.call(t.options,ks)):("textarea"===n.tag||oi(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",As),t.addEventListener("compositionend",xs),t.addEventListener("change",xs),Yt&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Es(t,e,n.context);var r=t._vOptions,o=t._vOptions=[].map.call(t.options,ks);if(o.some((function(t,e){return!$t(t,r[e])})))(t.multiple?e.value.some((function(t){return Cs(t,o)})):e.value!==e.oldValue&&Cs(e.value,o))&&Os(t,"change")}}};function Es(t,e,n){ws(t,e,n),(Gt||Xt)&&setTimeout((function(){ws(t,e,n)}),0)}function ws(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=Bt(r,ks(s))>-1,s.selected!==i&&(s.selected=i);else if($t(ks(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}else"production"!==process.env.NODE_ENV&&Hr('<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 Cs(t,e){return e.every((function(e){return!$t(e,t)}))}function ks(t){return"_value"in t?t._value:t.value}function As(t){t.target.composing=!0}function xs(t){t.target.composing&&(t.target.composing=!1,Os(t.target,"input"))}function Os(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ss(t){return!t.componentInstance||t.data&&t.data.transition?t:Ss(t.componentInstance._vnode)}var Ns={bind:function(t,e,n){var r=e.value,o=(n=Ss(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,hs(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=Ss(n)).data&&n.data.transition?(n.data.show=!0,r?hs(n,(function(){t.style.display=t.__vOriginalDisplay})):ms(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)}},Ts={model:Ds,show:Ns},Fs={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 Ms(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ms(In(e.children)):t}function Is(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[Ct(r)]=o[r];return e}function $s(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Bs=function(t){return t.tag||Cn(t)},Rs=function(t){return"show"===t.name},Ls={name:"transition",props:Fs,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Bs)).length){"production"!==process.env.NODE_ENV&&n.length>1&&Hr("<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&&Hr("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=Ms(o);if(!i)return o;if(this._leaving)return $s(t,o);var s="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?s+"comment":s+i.tag:it(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var a=(i.data||(i.data={})).transition=Is(this),u=this._vnode,l=Ms(u);if(i.data.directives&&i.data.directives.some(Rs)&&(i.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,l)&&!Cn(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var c=l.data.transition=Nt({},a);if("out-in"===r)return this._leaving=!0,en(c,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),$s(t,o);if("in-out"===r){if(Cn(i))return u;var p,f=function(){p()};en(a,"afterEnter",f),en(a,"enterCancelled",f),en(c,"delayLeave",(function(t){p=t}))}}return o}}},Ps=Nt({tag:String,moveClass:String},Fs);delete Ps.mode;var js={props:Ps,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=fr(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=Is(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?$r(u.Ctor.options)||u.tag||"":f.tag;Hr("<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(zs),t.forEach(Hs),t.forEach(Vs),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,r=n.style;as(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(es,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(es,t),n._moveCb=null,us(n,e))})}})))},methods:{hasMove:function(t,e){if(!Zi)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){Yi(n,t)})),Gi(n,e),n.style.display="none",this.$el.appendChild(n);var r=ps(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function zs(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Hs(t){t.data.newPos=t.elm.getBoundingClientRect()}function Vs(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 Ws={Transition:Ls,TransitionGroup:js};function Us(t){this.content=t}function qs(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=qs(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function Ks(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=Ks(s.content,a.content,n-1,r-1);if(t)return t}n-=u,r-=u}else n-=u,r-=u}}To.config.mustUseProp=function(t,e,n){return"value"===n&&zo(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},To.config.isReservedTag=ni,To.config.isReservedAttr=jo,To.config.getTagNamespace=function(t){return ei(t)?"svg":"math"===t?"math":void 0},To.config.isUnknownElement=function(t){if(!Kt)return!0;if(ni(t))return!1;if(t=t.toLowerCase(),null!=ri[t])return ri[t];var e=document.createElement(t);return t.indexOf("-")>-1?ri[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ri[t]=/HTMLUnknownElement/.test(e.toString())},Nt(To.options.directives,Ts),Nt(To.options.components,Ws),To.prototype.__patch__=Kt?_s:Ft,To.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=fe,"production"!==process.env.NODE_ENV&&(t.$options.template&&"#"!==t.$options.template.charAt(0)||t.$options.el||e?Hr("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):Hr("Failed to mount component: template or render function not defined.",t))),gr(t,"beforeMount"),r="production"!==process.env.NODE_ENV&&zt.performance&&tr?function(){var e=t._name,r=t._uid,o="vue-perf-start:".concat(r),i="vue-perf-end:".concat(r);tr(o);var s=t._render();tr(i),er("vue ".concat(e," render"),o,i),tr(o),t._update(s,n),tr(i),er("vue ".concat(e," patch"),o,i)}:function(){t._update(t._render(),n)};var o={before:function(){t._isMounted&&!t._isDestroyed&&gr(t,"beforeUpdate")}};"production"!==process.env.NODE_ENV&&(o.onTrack=function(e){return gr(t,"renderTracked",[e])},o.onTrigger=function(e){return gr(t,"renderTriggered",[e])}),new or(t,r,Ft,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,gr(t,"mounted")),t}(this,t=t&&Kt?function(t){if("string"==typeof t){return document.querySelector(t)||("production"!==process.env.NODE_ENV&&Hr("Cannot find element: "+t),document.createElement("div"))}return t}(t):void 0,e)},Kt&&setTimeout((function(){zt.devtools&&(ie?ie.emit("init",To):"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!==zt.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),Us.prototype={constructor:Us,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 Us(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 Us(n)},addToStart:function(t,e){return new Us([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Us(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 Us(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=Us.from(t)).size?new Us(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Us.from(t)).size?new Us(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Us.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}},Us.from=function(t){if(t instanceof Us)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Us(e)};class Js{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 Js(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 Js(n,r)}cutByIndex(t,e){return t==e?Js.empty:0==t&&e==this.content.length?this:new Js(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 Js(r,o)}addToStart(t){return new Js([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Js(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 qs(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return Ks(this,t,e,n)}findIndex(t,e=-1){if(0==t)return Ys(0,t);if(t==this.size)return Ys(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?Ys(n+1,o):Ys(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 Js.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Js(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Js.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 Js(e||t,n)}static from(t){if(!t)return Js.empty;if(t instanceof Js)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Js([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Js.empty=new Js([],0);const Gs={index:0,offset:0};function Ys(t,e){return Gs.index=t,Gs.offset=e,Gs}function Xs(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(!Xs(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Xs(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class Qs{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&&Xs(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 Qs.none;if(t instanceof Qs)return[t];let e=t.slice();return e.sort(((t,e)=>t.type.rank-e.type.rank)),e}}Qs.none=[];class Zs extends Error{}class ta{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=na(this.content,t+this.openStart,e);return n&&new ta(n,this.openStart,this.openEnd)}removeBetween(t,e){return new ta(ea(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 ta.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 ta(Js.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 ta(t,n,r)}}function ea(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(ea(i.content,e-o-1,n-o-1)))}function na(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=na(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function ra(t,e,n){if(n.openStart>t.depth)throw new Zs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zs("Inconsistent open depths");return oa(t,e,n,0)}function oa(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=oa(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(Js.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return la(i,ca(t,o,s,e,r))}{let r=t.parent,o=r.content;return la(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return la(i,pa(t,e,r))}function ia(t,e){if(!e.type.compatibleContent(t.type))throw new Zs("Cannot join "+e.type.name+" onto "+t.type.name)}function sa(t,e,n){let r=t.node(n);return ia(r,e.node(n)),r}function aa(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 ua(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&&(aa(t.nodeAfter,r),i++));for(let t=i;t<s;t++)aa(o.child(t),r);e&&e.depth==n&&e.textOffset&&aa(e.nodeBefore,r)}function la(t,e){if(!t.type.validContent(e))throw new Zs("Invalid content for node "+t.type.name);return t.copy(e)}function ca(t,e,n,r,o){let i=t.depth>o&&sa(t,e,o+1),s=r.depth>o&&sa(n,r,o+1),a=[];return ua(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(ia(i,s),aa(la(i,ca(t,e,n,r,o+1)),a)):(i&&aa(la(i,pa(t,e,o+1)),a),ua(e,n,o,a),s&&aa(la(s,pa(n,r,o+1)),a)),ua(r,null,o,a),new Js(a)}function pa(t,e,n){let r=[];if(ua(null,t,n,r),t.depth>n){aa(la(sa(t,e,n+1),pa(t,e,n+1)),r)}return ua(e,null,n,r),new Js(r)}ta.empty=new ta(Js.empty,0,0);class fa{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 Qs.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 ga(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 fa(e,n,o)}static resolveCached(t,e){for(let n=0;n<da.length;n++){let r=da[n];if(r.pos==e&&r.doc==t)return r}let n=da[ha]=fa.resolve(t,e);return ha=(ha+1)%ma,n}}let da=[],ha=0,ma=12;class ga{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 va=Object.create(null);class ya{constructor(t,e,n,r=Qs.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||Js.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&&Xs(this.attrs,e||t.defaultAttrs||va)&&Qs.sameSet(this.marks,n||Qs.none)}copy(t=null){return t==this.content?this:new ya(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new ya(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 ta.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 ta(a,r.depth-i,o.depth-i)}replace(t,e,n){return ra(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 fa.resolveCached(this,t)}resolveNoCache(t){return fa.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()+")"),_a(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=Js.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=Qs.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!Qs.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=Js.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}ya.prototype.text=void 0;class ba extends ya{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):_a(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 ba(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ba(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 _a(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Da{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Ea(t,e);if(null==n.next)return Da.empty;let r=wa(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(Sa(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]);Sa(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new Da(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(Oa);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 Js.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")}}Da.empty=new Da(!0);class Ea{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 wa(t){let e=[];do{e.push(Ca(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Ca(t){let e=[];do{e.push(ka(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function ka(t){let e=function(t){if(t.eat("(")){let e=wa(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=xa(t,e)}return e}function Aa(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function xa(t,e){let n=Aa(t),r=n;return t.eat(",")&&(r="}"!=t.next?Aa(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Oa(t,e){return e-t}function Sa(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(Oa)}function Na(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 Ta(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 Fa(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Ia(t[n]);return e}class Ma{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=Fa(n.attrs),this.defaultAttrs=Na(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==Da.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:Ta(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ya(this,this.computeAttrs(t),Js.from(e),Qs.setFrom(n))}createChecked(t=null,e,n){if(e=Js.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new ya(this,this.computeAttrs(t),e,Qs.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=Js.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(Js.empty,!0);return o?new ya(this,t,e.append(o),Qs.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:Qs.none:t}static compile(t,e){let n=Object.create(null);t.forEach(((t,r)=>n[t]=new Ma(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 Ia{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class $a{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Fa(r.attrs),this.excluded=null;let o=Na(this.attrs);this.instance=o?new Qs(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Qs(this,Ta(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new $a(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 Ba{constructor(t){this.cached=Object.create(null),this.spec={nodes:Us.from(t.nodes),marks:Us.from(t.marks||{}),topNode:t.topNode},this.nodes=Ma.compile(this.spec.nodes,this),this.marks=$a.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]=Da.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?Ra(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?[]:Ra(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 Ma))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 ba(n,n.defaultAttrs,t,Qs.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return ya.fromJSON(this,t)}markFromJSON(t){return Qs.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Ra(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 La{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 Wa(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Wa(this,e,!0);return n.addAll(t,e.from,e.to),ta.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(Ua(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=qa(t)),t.mark=e}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=qa(t)),t.node=e}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new La(t,La.schemaRules(t)))}}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},ja={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},za={ol:!0,ul:!0};function Ha(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Va{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=Qs.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(Js.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=Js.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(Js.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):Ka(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&&!Pa.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Wa{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=Ha(null,e.preserveWhitespace,0)|(n?4:0);r=o?new Va(o.type,o.attrs,Qs.none,Qs.none,!0,e.topMatch||o.type.contentMatch,i):new Va(n?null:t.schema.topNodeType,null,Qs.none,Qs.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();za.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&&za.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:ja.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(Pa.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=Qs.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=Ha(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new Va(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 Ua(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function qa(t){let e={};for(let n in t)e[n]=t[n];return e}function Ka(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 Ja{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Ya(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}=Ja.renderSpec(Ya(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&&Ja.renderSpec(Ya(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}=Ja.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 Ja(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Ga(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return Ga(t.marks)}}function Ga(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ya(t){return t.document||window.document}const Xa=Math.pow(2,16);function Qa(t,e){return t+e*Xa}function Za(t){return 65535&t}class tu{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 eu{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&eu.empty)return eu.empty}recover(t){let e=0,n=Za(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))/Xa}(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:Qa(s/3,t-a),p=t==a?2:t==c?1:4;return(e<0?t!=a:t!=c)&&(p|=8),new tu(o,p,i)}r+=l-u}return n?t+r:new tu(t+r,0,null)}touches(t,e){let n=0,r=Za(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 eu(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?eu.empty:new eu(t<0?[0,-t,0]:[0,0,t])}}eu.empty=new eu([]);class nu{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 nu(this.maps,this.mirror,t,e)}copy(){return new nu(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 nu;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 tu(t,r,null)}}const ru=Object.create(null);class ou{getMap(){return eu.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=ru[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 ru)throw new RangeError("Duplicate use of step JSON ID "+t);return ru[t]=e,e.prototype.jsonID=t,e}}class iu{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new iu(t,null)}static fail(t){return new iu(null,t)}static fromReplace(t,e,n,r){try{return iu.ok(t.replace(e,n,r))}catch(t){if(t instanceof Zs)return iu.fail(t.message);throw t}}}function su(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(su(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return Js.fromArray(r)}class au extends ou{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 ta(su(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 iu.fromReplace(t,this.from,this.to,o)}invert(){return new uu(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 au(e.pos,n.pos,this.mark)}merge(t){return t instanceof au&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new au(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 au(e.from,e.to,t.markFromJSON(e.mark))}}ou.jsonID("addMark",au);class uu extends ou{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 ta(su(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return iu.fromReplace(t,this.from,this.to,n)}invert(){return new au(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 uu(e.pos,n.pos,this.mark)}merge(t){return t instanceof uu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new uu(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 uu(e.from,e.to,t.markFromJSON(e.mark))}}ou.jsonID("removeMark",uu);class lu extends ou{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&pu(t,this.from,this.to)?iu.fail("Structure replace would overwrite content"):iu.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new eu([this.from,this.to-this.from,this.slice.size])}invert(t){return new lu(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 lu(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof lu)||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?ta.empty:new ta(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new lu(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?ta.empty:new ta(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new lu(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 lu(e.from,e.to,ta.fromJSON(t,e.slice),!!e.structure)}}ou.jsonID("replace",lu);class cu extends ou{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&&(pu(t,this.from,this.gapFrom)||pu(t,this.gapTo,this.to)))return iu.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return iu.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?iu.fromReplace(t,this.from,this.to,n):iu.fail("Content does not fit in gap")}getMap(){return new eu([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 cu(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 cu(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 cu(e.from,e.to,e.gapFrom,e.gapTo,ta.fromJSON(t,e.slice),e.insert,!!e.structure)}}function pu(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 fu(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function du(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||!fu(r,o,i))break}return null}function hu(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(mu).concat({type:e,attrs:n}).concat(i.map(mu)):null}function mu(t){return{type:t,attrs:null}}function gu(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 vu(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 yu(t,e,n=e,r=ta.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return bu(o,i,r)?new lu(e,n,r):new _u(o,i,r).fit()}function bu(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}ou.jsonID("replaceAround",cu);class _u{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=Js.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=Js.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 ta(o,i,s);return t>-1?new cu(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new lu(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=wu(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(Js.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=wu(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new ta(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=wu(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new ta(Du(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new ta(Du(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(Cu(t.mark(p.allowedMarks(t.marks)),1==u?a:0,u==s.childCount?f:-1)))}let d=u==s.childCount;d||(f=-1),this.placed=Eu(this.placed,e,Js.from(l)),this.frontier[e].match=c,d&&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=d?0==t?ta.empty:new ta(Du(i.content,t-1,1),t-1,f<0?i.openEnd:t-1):new ta(Du(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||!ku(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=ku(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=ku(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=Eu(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=Eu(this.placed,this.depth,Js.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Js.empty,!0);t.childCount&&(this.placed=Eu(this.placed,this.frontier.length,t))}}function Du(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Du(t.firstChild.content,e-1,n)))}function Eu(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Eu(t.lastChild.content,e-1,n)))}function wu(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Cu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Cu(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(Js.empty,!0)))),t.copy(r)}function ku(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 Au(t){return t.spec.defining||t.spec.definingForContent}function xu(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(xu(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(Js.empty,!0))}return t}function Ou(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 Su=class extends Error{};Su=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Su.prototype=Object.create(Error.prototype)).constructor=Su,Su.prototype.name="TransformError";class Nu{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new nu}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Su(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=ta.empty){let r=yu(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new ta(Js.from(n),0,0))}delete(t,e){return this.replace(t,e,ta.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(bu(o,i,r))return t.step(new lu(e,n,r));let s=Ou(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=Au(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),d=o.index(l-1);if(f.canReplaceWith(d,d,p.type,p.marks))return t.replace(o.before(l),c?i.after(l):n,new ta(xu(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 ta(Js.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=Ou(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=Js.empty,p=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,c=Js.from(r.node(t).copy(c)),p++):u--;let f=Js.empty,d=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,f=Js.from(o.node(t).copy(f)),d++):l++;t.step(new cu(u,l,s,a,new ta(c.append(f),p,d),c.size-p,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new lu(e-n,e+n,ta.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=Js.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=Js.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new cu(o,i,o,i,new ta(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 cu(a,u,a+1,u-1,new ta(Js.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 cu(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new ta(Js.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=Js.empty,s=Js.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=Js.from(o.node(t).copy(i));let e=r&&r[a];s=Js.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new lu(e,e,new ta(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 uu(l,p,c[t])));i&&i.to==l?i.to=p:a.push(i=new au(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 $a){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 uu(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 uu(s,u,a.marks[e]))}else i.push(new lu(s,u,ta.empty));s=u}if(!r.validEnd){let e=r.fillBefore(Js.empty,!0);t.replace(s,s,new ta(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}const Tu=Object.create(null);class Fu{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Mu(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=ta.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?ta.empty:e),0==s&&Vu(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),Vu(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Bu(t):Hu(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?Hu(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):Hu(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 ju(t.node(0))}static atStart(t){return Hu(t,t,0,0,1)||new ju(t)}static atEnd(t){return Hu(t,t,t.content.size,t.childCount,-1)||new ju(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Tu[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 Tu)throw new RangeError("Duplicate use of selection JSON ID "+t);return Tu[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Bu.between(this.$anchor,this.$head).getBookmark()}}Fu.prototype.visible=!0;class Mu{constructor(t,e){this.$from=t,this.$to=e}}let Iu=!1;function $u(t){Iu||t.parent.inlineContent||(Iu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Bu extends Fu{constructor(t,e=t){$u(t),$u(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 Fu.near(n);let r=t.resolve(e.map(this.anchor));return new Bu(r.parent.inlineContent?r:n,n)}replace(t,e=ta.empty){if(super.replace(t,e),e==ta.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Bu&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ru(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 Bu(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=Fu.findFrom(e,n,!0)||Fu.findFrom(e,-n,!0);if(!t)return Fu.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Fu.findFrom(t,-n,!0)||Fu.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new Bu(t,e)}}Fu.jsonID("text",Bu);class Ru{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Ru(t.map(this.anchor),t.map(this.head))}resolve(t){return Bu.between(t.resolve(this.anchor),t.resolve(this.head))}}class Lu extends Fu{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?Fu.near(o):new Lu(o)}content(){return new ta(Js.from(this.node),0,0)}eq(t){return t instanceof Lu&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Pu(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Lu(t.resolve(e.anchor))}static create(t,e){return new Lu(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Lu.prototype.visible=!1,Fu.jsonID("node",Lu);class Pu{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new Ru(n,n):new Pu(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Lu.isSelectable(n)?new Lu(e):Fu.near(e)}}class ju extends Fu{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=ta.empty){if(e==ta.empty){t.delete(0,t.doc.content.size);let e=Fu.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new ju(t)}map(t){return new ju(t)}eq(t){return t instanceof ju}getBookmark(){return zu}}Fu.jsonID("all",ju);const zu={map(){return this},resolve:t=>new ju(t)};function Hu(t,e,n,r,o,i=!1){if(e.inlineContent)return Bu.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&&Lu.isSelectable(r))return Lu.create(t,n-(o<0?r.nodeSize:0))}else{let e=Hu(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function Vu(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof lu||i instanceof cu)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(Fu.near(t.doc.resolve(o),n)))}function Wu(t,e){return e&&t?t.bind(e):t}class Uu{constructor(t,e,n){this.name=t,this.init=Wu(e.init,n),this.apply=Wu(e.apply,n)}}function qu(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=qu(o,e,{})),n[r]=o}return n}new Uu("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Uu("selection",{init:(t,e)=>t.selection||Fu.atStart(e.doc),apply:t=>t.selection}),new Uu("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new Uu("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e});class Ku{constructor(t){this.spec=t,this.props={},t.props&&qu(t.props,this,this.props),this.key=t.key?t.key.key:Gu("plugin")}getState(t){return t[this.key]}}const Ju=Object.create(null);function Gu(t){return t in Ju?t+"$"+ ++Ju[t]:(Ju[t]=0,t+"$")}class Yu{constructor(t="key"){this.key=Gu(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Xu="undefined"!=typeof navigator?navigator:null,Qu="undefined"!=typeof document?document:null,Zu=Xu&&Xu.userAgent||"",tl=/Edge\/(\d+)/.exec(Zu),el=/MSIE \d/.exec(Zu),nl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zu),rl=!!(el||nl||tl),ol=el?document.documentMode:nl?+nl[1]:tl?+tl[1]:0,il=!rl&&/gecko\/(\d+)/i.test(Zu);il&&(/Firefox\/(\d+)/.exec(Zu)||[0,0])[1];const sl=!rl&&/Chrome\/(\d+)/.exec(Zu),al=!!sl,ul=sl?+sl[1]:0,ll=!rl&&!!Xu&&/Apple Computer/.test(Xu.vendor),cl=ll&&(/Mobile\/\w+/.test(Zu)||!!Xu&&Xu.maxTouchPoints>2),pl=cl||!!Xu&&/Mac/.test(Xu.platform),fl=/Android \d/.test(Zu),dl=!!Qu&&"webkitFontSmoothing"in Qu.documentElement.style,hl=dl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,ml=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},gl=/^(img|br|input|textarea|hr)$/i;function vl(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:yl(t))){let n=t.parentNode;if(!n||1!=n.nodeType||bl(t)||gl.test(t.nodeName)||"false"==t.contentEditable)return!1;e=ml(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?yl(t):0}}}function yl(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function bl(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 _l=function(t){let e=t.isCollapsed;return e&&al&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Dl(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function El(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(_l(n)){for(a=l;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Lu.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==yl(t);r||o;){if(t==n)return!0;let e=ml(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==yl(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;u=new Lu(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=Nl(t,a,l,"pointer"==e||t.state.selection.head<l.pos&&!i?1:-1)}return u}function wl(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 Cl(t,e=!1){let n=t.state.selection;if(function(t,e){if(e instanceof Lu){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Sl(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Sl(t)}(t,n),wl(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&al){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&&(vl(r,o,i,s,-1)||vl(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,ml(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&rl&&ol<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!kl||n instanceof Bu||(n.$from.parent.inlineContent||(r=Al(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=Al(t,n.to))),t.docView.setSelection(i,s,t.root,e),kl&&(r&&Ol(r),o&&Ol(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((()=>{wl(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const kl=ll||al&&ul<63;function Al(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(ll&&o&&"false"==o.contentEditable)return xl(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return xl(o);if(i)return xl(i)}}function xl(t){return t.contentEditable="true",ll&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Ol(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Sl(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Nl(t,e,n,r){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||Bu.between(e,n,r)}function Tl(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&&Fu.findFrom(i,e)}function Fl(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Ml(t,e,n){let r=t.state.selection;if(!(r instanceof Bu)){if(r instanceof Lu&&r.node.isInline)return Fl(t,new Bu(e>0?r.$to:r.$from));{let n=Tl(t.state,e);return!!n&&Fl(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=Tl(t.state,e);return!!(n&&n instanceof Lu)&&Fl(t,n)}if(!(pl&&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)&&(Lu.isSelectable(i)?Fl(t,new Lu(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!dl&&Fl(t,new Bu(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Il(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function $l(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Bl(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(il&&1==n.nodeType&&r<Il(n)&&$l(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if($l(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Ll(n))break;{let e=n.previousSibling;for(;e&&$l(e);)o=n.parentNode,i=ml(e),e=e.previousSibling;if(e)n=e,r=Il(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Pl(t,e,n,r):o&&Pl(t,e,o,i)}function Rl(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Il(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!$l(n.childNodes[r]))break;o=n,i=++r}else{if(Ll(n))break;{let e=n.nextSibling;for(;e&&$l(e);)o=e.parentNode,i=ml(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=Il(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&Pl(t,e,o,i)}function Ll(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Pl(t,e,n,r){if(_l(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&&Cl(t)}),50)}function jl(t,e,n){let r=t.state.selection;if(r instanceof Bu&&!r.empty||n.indexOf("s")>-1)return!1;if(pl&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Tl(t.state,e);if(n&&n instanceof Lu)return Fl(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof ju?Fu.near(n,e):Fu.findFrom(n,e);return!!s&&Fl(t,s)}return!1}function zl(t,e){if(!(t.state.selection instanceof Bu))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 Hl(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Vl(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||pl&&72==n&&"c"==r?zl(t,-1)||Bl(t):46==n||pl&&68==n&&"c"==r?zl(t,1)||Rl(t):13==n||27==n||(37==n||pl&&66==n&&"c"==r?Ml(t,-1,r)||Bl(t):39==n||pl&&70==n&&"c"==r?Ml(t,1,r)||Rl(t):38==n||pl&&80==n&&"c"==r?jl(t,-1,r)||Bl(t):40==n||pl&&78==n&&"c"==r?function(t){if(!ll||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;Hl(t,n,"true"),setTimeout((()=>Hl(t,n,"false")),20)}return!1}(t)||jl(t,1,r)||Rl(t):r==(pl?"m":"c")&&(66==n||73==n||89==n||90==n))}function Wl(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")||Ja.fromSchema(t.state.schema),a=tc(),u=a.createElement("div");u.appendChild(s.serializeFragment(r,{document:a}));let l,c=u.firstChild,p=0;for(;c&&1==c.nodeType&&(l=Ql[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 Ul(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 ta(Js.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):ta.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=Ja.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=tc().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&Ql[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),dl&&function(t){let e=t.querySelectorAll(al?"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")||La.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!u&&!c),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||ql.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=Js.from(e.create(n[t+1],o)),i++,s++}return new ta(o,i,s)}(Xl(s,+c[1],+c[2]),c[4]);else if(s=ta.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&&Jl(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=Gl(i[i.length-1],r.length));let e=Kl(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return Js.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=Xl(s,t,e)}return t.someProp("transformPasted",(t=>{s=t(s)})),s}const ql=/^(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 Kl(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Js.from(t));return t}function Jl(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Jl(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(Js.from(Kl(n,t,o+1))))}}function Gl(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,Gl(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Js.empty,!0);return t.copy(n.append(r))}function Yl(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return o<r-1&&(a=Yl(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(Js.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Xl(t,e,n){return e<t.openStart&&(t=new ta(Yl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ta(Yl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Ql={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 Zl=null;function tc(){return Zl||(Zl=document.implementation.createHTMLDocument("title"))}const ec={};let nc={};function rc(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function oc(t){return{left:t.clientX,top:t.clientY}}function ic(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 sc(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function ac(t,e,n,r,o){return ic(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 Lu&&(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(Lu.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&&(sc(t,Lu.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&&Lu.isSelectable(r))&&(sc(t,new Lu(n),"pointer"),!0)}(t,n))}function uc(t,e,n,r){return ic(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function lc(t,e,n,r){return ic(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&&(sc(t,Bu.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)sc(t,Bu.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Lu.isSelectable(n))continue;sc(t,Lu.create(r,i),"pointer")}return!0}}(t,n,r)}function cc(t){return vc(t)}nc.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!dc(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!fl||!al||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!cl||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Vl(t,n)?n.preventDefault():rc(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,Dl(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},nc.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},nc.keypress=(t,e)=>{let n=e;if(dc(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||pl&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Bu&&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 pc=pl?"metaKey":"ctrlKey";ec.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=cc(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[pc]&&("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(oc(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new fc(t,s,n,!!r)):("doubleClick"==i?uc:lc)(t,s.pos,s.inside,n)?n.preventDefault():rc(t,"pointer"))};class fc{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[pc],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 Lu&&u.from<=i&&u.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!il||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)),rc(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((()=>Cl(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(oc(t))),this.allowDefault||!e?rc(this.view,"pointer"):ac(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||ll&&this.mightDrag&&!this.mightDrag.node.isAtom||al&&!(this.view.state.selection instanceof Bu)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(sc(this.view,Fu.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):rc(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),rc(this.view,"pointer"),0==t.buttons&&this.done()}}function dc(t,e){return!!t.composing||!!(ll&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}ec.touchdown=t=>{cc(t),rc(t,"pointer")},ec.contextmenu=t=>cc(t);const hc=fl?5e3:-1;function mc(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>vc(t)),e))}function gc(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 vc(t,e=!1){if(!(fl&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),gc(t),e||t.docView&&t.docView.dirty){let e=El(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}nc.compositionstart=nc.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(),vc(t,!0),t.markCursor=null;else if(vc(t),il&&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}mc(t,hc)},nc.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,mc(t,20))};const yc=rl&&ol<15||cl&&hl<604;function bc(t,e,n,r){let o=Ul(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||ta.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}ec.copy=nc.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=yc?null:n.clipboardData,s=r.content(),{dom:a,text:u}=Wl(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"))},nc.paste=(t,e)=>{let n=e;if(t.composing&&!fl)return;let r=yc?null:n.clipboardData;r&&bc(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?bc(t,r.value,null,e):bc(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class _c{constructor(t,e){this.slice=t,this.move=e}}const Dc=pl?"altKey":"ctrlKey";ec.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(oc(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Lu?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Lu.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(Lu.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:u}=Wl(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(yc?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",yc||n.dataTransfer.setData("text/plain",u),t.dragging=new _c(s,!n[Dc])},ec.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},nc.dragover=nc.dragenter=(t,e)=>e.preventDefault(),nc.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(oc(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=Ul(t,n.dataTransfer.getData(yc?"Text":"text/plain"),yc?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Dc]);if(t.someProp("handleDrop",(e=>e(t,n,s||ta.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 d=l.doc.resolve(c);if(p&&Lu.isSelectable(s.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Lu(d));else{let e=l.mapping.map(u);l.mapping.maps[l.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),l.setSelection(Nl(t,d,l.doc.resolve(e)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))},ec.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())&&Cl(t)}),20))},ec.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)},ec.beforeinput=(t,e)=>{if(al&&fl&&"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,Dl(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 nc)ec[t]=nc[t];function Ec(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 wc{constructor(t,e){this.toDOM=t,this.spec=e||Oc,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 Ac(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof wc&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ec(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Cc{constructor(t,e){this.attrs=t,this.spec=e||Oc}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 Ac(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Cc&&Ec(this.attrs,t.attrs)&&Ec(this.spec,t.spec)}static is(t){return t.type instanceof Cc}destroy(){}}class kc{constructor(t,e){this.attrs=t,this.spec=e||Oc}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 Ac(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 kc&&Ec(this.attrs,t.attrs)&&Ec(this.spec,t.spec)}destroy(){}}class Ac{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new Ac(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 Ac(t,t,new wc(e,n))}static inline(t,e,n,r){return new Ac(t,e,new Cc(n,r))}static node(t,e,n,r){return new Ac(t,e,new kc(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Cc}}const xc=[],Oc={};class Sc{constructor(t,e){this.local=t.length?t:xc,this.children=e.length?e:xc}static create(t,e){return e.length?$c(e,t,0,Oc):Nc}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==Nc||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Oc)}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:d}=r.content.findIndex(c),h=r.maybeChild(f);if(h&&d==c&&d+h.nodeSize==p){let r=a[e+2].mapInner(n,h,u+1,t[e]+i+1,s);r!=Nc?(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=$c(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 Sc(e.sort(Bc),a)}(this.children,i||[],t,e,n,r,o):i?new Sc(i.sort(Bc),xc):Nc}add(t,e){return e.length?this==Nc?Sc.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=Mc(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,$c(s,t,a+1,Oc)),o+=3}}));let i=Fc(o?Ic(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new Sc(i.length?this.local.concat(i).sort(Bc):this.local,r||this.children)}remove(t){return 0==t.length||this==Nc?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!=Nc?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 Sc(r,n):Nc}forChild(t,e){if(this==Nc)return this;if(e.isLeaf)return Sc.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 Cc){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 Sc(r.sort(Bc),xc);return n?new Tc([t,n]):t}return n||Nc}eq(t){if(this==t)return!0;if(!(t instanceof Sc)||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 Rc(this.localsInner(t))}localsInner(t){if(this==Nc)return xc;if(t.inlineContent||!this.local.some(Cc.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof Cc||e.push(this.local[t]);return e}}Sc.empty=new Sc([],[]),Sc.removeOverlap=Rc;const Nc=Sc.empty;class Tc{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,Oc)));return Tc.from(n)}forChild(t,e){if(e.isLeaf)return Sc.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=Nc&&(o instanceof Tc?n=n.concat(o.members):n.push(o))}return Tc.from(n)}eq(t){if(!(t instanceof Tc)||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?Rc(n?e:e.sort(Bc)):xc}static from(t){switch(t.length){case 0:return Nc;case 1:return t[0];default:return new Tc(t)}}}function Fc(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 Ac(o.from+e,o.to+e,o.type))}return n}function Mc(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 Ic(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function $c(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=Mc(t,e,s+n);if(a){i=!0;let t=$c(a,e,n+s+1,r);t!=Nc&&o.push(s,s+e.nodeSize,t)}}));let s=Fc(i?Ic(t):t,-n).sort(Bc);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 Sc(s,o):Nc}function Bc(t,e){return t.from-e.from||t.to-e.to}function Rc(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),Lc(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),Lc(e,o+1,i.copy(r.to,i.to)))}}return e}function Lc(t,e,n){for(;e<t.length&&Bc(n,t[e])>0;)e++;t.splice(e,0,n)}for(var Pc={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"},jc={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"},zc="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Hc="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Vc="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Wc="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Uc="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),qc=zc&&(Wc||+zc[1]<57)||Vc&&Wc,Kc=0;Kc<10;Kc++)Pc[48+Kc]=Pc[96+Kc]=String(Kc);for(Kc=1;Kc<=24;Kc++)Pc[Kc+111]="F"+Kc;for(Kc=65;Kc<=90;Kc++)Pc[Kc]=String.fromCharCode(Kc+32),jc[Kc]=String.fromCharCode(Kc);for(var Jc in Pc)jc.hasOwnProperty(Jc)||(jc[Jc]=Pc[Jc]);const Gc="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Yc(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);Gc?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Xc(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 Qc(t){let e=function(t){let e=Object.create(null);for(let n in t)e[Yc(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!(qc&&(t.ctrlKey||t.altKey||t.metaKey)||(Hc||Uc)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?jc:Pc)[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[Xc(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=Pc[n.keyCode])&&r!=o){let o=e[Xc(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[Xc(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}function Zc(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 tp(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 ep(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 np(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 rp(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&&!vu(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=Js.empty;for(let t=r.length-1;t>=0;t--)a=Js.from(r[t].create(null,a));a=Js.from(i.copy(a));let u=t.tr.step(new cu(e.pos-1,o,e.pos,o,new ta(a,1,0),r.length,!0)),l=o+2*r.length;vu(u.doc,l)&&u.join(l),n(u.scrollIntoView())}return!0}let u=Fu.findFrom(e,1),l=u&&u.$from.blockRange(u.$to),c=l&&du(l);if(null!=c&&c>=e.depth)return n&&n(t.tr.lift(l,c).scrollIntoView()),!0;if(a&&Zc(s,"start",!0)&&Zc(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=Js.empty;for(let t=o.length-1;t>=0;t--)r=Js.from(o[t].copy(r));n(t.tr.step(new cu(e.pos-o.length,e.pos+s.nodeSize,e.pos+u,e.pos+s.nodeSize-u,new ta(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function op(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(Bu.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const ip=op(-1),sp=op(1);function ap(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 up(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 ga(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new ga(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let l=hu(u,t,e,s);return!!l&&(r&&r(function(t,e,n,r,o){let i=Js.empty;for(let t=n.length-1;t>=0;t--)i=Js.from(n[t].type.create(n[t].attrs,i));t.step(new cu(e.start-(r?2:0),e.end,e.start,e.end,new ta(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&&gu(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 lp(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 cu(i-1,s,i,s,new ta(Js.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ga(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));return e(o.lift(r,du(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?Js.empty:Js.from(o))))return!1;let p=i.pos,f=p+s.nodeSize;return r.step(new cu(p-(a?1:0),f+(u?1:0),p+1,f-1,new ta((a?Js.empty:Js.from(o.copy(Js.empty))).append(u?Js.empty:Js.from(o.copy(Js.empty))),a?0:1,u?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,i)))}}function cp(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 pp{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:cp({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 fp(t,e,n){if(void 0===t.config[e]&&t.parent)return fp(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?fp(t.parent,e,n):null})}return t.config[e]}function dp(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function hp(t){const e=[],{nodeExtensions:n,markExtensions:r}=dp(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=fp(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=fp(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 mp(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 gp(...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 vp(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)=>gp(t,e)),{})}function yp(t,e,...n){return function(t){return"function"==typeof t}(t)?e?t.bind(e)(...n):t(...n):t}function bp(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 _p(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 Dp(t){var e;const n=hp(t),{nodeExtensions:r,markExtensions:o}=dp(t),i=null===(e=r.find((t=>fp(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=_p({...t.reduce(((t,n)=>{const r=fp(n,"extendNodeSchema",o);return{...t,...r?r(e):{}}}),{}),content:yp(fp(e,"content",o)),marks:yp(fp(e,"marks",o)),group:yp(fp(e,"group",o)),inline:yp(fp(e,"inline",o)),atom:yp(fp(e,"atom",o)),selectable:yp(fp(e,"selectable",o)),draggable:yp(fp(e,"draggable",o)),code:yp(fp(e,"code",o)),defining:yp(fp(e,"defining",o)),isolating:yp(fp(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=yp(fp(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>bp(t,r))));const a=fp(e,"renderHTML",o);a&&(i.toDOM=t=>a({node:t,HTMLAttributes:vp(t,r)}));const u=fp(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=_p({...t.reduce(((t,n)=>{const r=fp(n,"extendMarkSchema",o);return{...t,...r?r(e):{}}}),{}),inclusive:yp(fp(e,"inclusive",o)),excludes:yp(fp(e,"excludes",o)),group:yp(fp(e,"group",o)),spanning:yp(fp(e,"spanning",o)),code:yp(fp(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=yp(fp(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>bp(t,r))));const a=fp(e,"renderHTML",o);return a&&(i.toDOM=t=>a({mark:t,HTMLAttributes:vp(t,r)})),[e.name,i]})));return new Ba({topNode:i,nodes:s,marks:a})}function Ep(t,e){return e.nodes[t]||e.marks[t]||null}function wp(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function Cp(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class kp{constructor(t){this.find=t.find,this.handler=t.handler}}function Ap(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(Cp(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=cp({state:u.state,transaction:s}),f={from:r-(e[0].length-i.length),to:o},{commands:d,chain:h,can:m}=new pp({editor:n,state:l});null!==t.handler({state:l,range:f,match:e,commands:d,chain:h,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),u.dispatch(s),c=!0)})),c}function xp(t){const{editor:e,rules:n}=t,r=new Ku({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)=>Ap({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&Ap({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&&Ap({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Op{constructor(t){this.find=t.find,this.handler=t.handler}}function Sp(t){const{editor:e,state:n,from:r,to:o,rule:i}=t,{commands:s,chain:a,can:u}=new pp({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(Cp(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 Np(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1;return n.map((t=>new Ku({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,d=cp({state:s,transaction:f});return Sp({editor:e,state:d,from:Math.max(c-1,0),to:p.b-1,rule:t})&&f.steps.length?f:void 0}})))}class Tp{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Tp.resolve(t),this.schema=Dp(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:Ep(t.name,this.schema)};if("mark"===t.type){(null===(e=yp(fp(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const r=fp(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=fp(t,"onCreate",n);o&&this.editor.on("create",o);const i=fp(t,"onUpdate",n);i&&this.editor.on("update",i);const s=fp(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=fp(t,"onTransaction",n);a&&this.editor.on("transaction",a);const u=fp(t,"onFocus",n);u&&this.editor.on("focus",u);const l=fp(t,"onBlur",n);l&&this.editor.on("blur",l);const c=fp(t,"onDestroy",n);c&&this.editor.on("destroy",c)}))}static resolve(t){const e=Tp.sort(Tp.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=fp(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=fp(t,"priority")||100,r=fp(e,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=fp(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Ep(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=Tp.sort([...this.extensions].reverse()),n=[],r=[],o=e.map((e=>{const o={name:e.name,options:e.options,storage:e.storage,editor:t,type:Ep(e.name,this.schema)},i=[],s=fp(e,"addKeyboardShortcuts",o);let a={};if("mark"===e.type&&e.config.exitable&&(a.ArrowRight=()=>sf.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 Ku({props:{handleKeyDown:Qc(a)}});i.push(u);const l=fp(e,"addInputRules",o);wp(e,t.options.enableInputRules)&&l&&n.push(...l());const c=fp(e,"addPasteRules",o);wp(e,t.options.enablePasteRules)&&c&&r.push(...c());const p=fp(e,"addProseMirrorPlugins",o);if(p){const t=p();i.push(...t)}return i})).flat();return[xp({editor:t,rules:n}),...Np({editor:t,rules:r}),...o]}get attributes(){return hp(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=dp(this.extensions);return Object.fromEntries(e.filter((t=>!!fp(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:mp(e.name,this.schema)},o=fp(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const u=vp(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:u,extension:e})}]})))}}function Fp(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function Mp(t,e){const n={...t};return Fp(t)&&Fp(e)&&Object.keys(e).forEach((r=>{Fp(e[r])?r in t?n[r]=Mp(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class Ip{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=yp(fp(this,"addOptions",{name:this.name}))),this.storage=yp(fp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ip(t)}configure(t={}){const e=this.extend();return e.options=Mp(this.options,t),e.storage=yp(fp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Ip(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=yp(fp(e,"addOptions",{name:e.name})),e.storage=yp(fp(e,"addStorage",{name:e.name,options:e.options})),e}}Ip.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ku({key:new Yu("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 $p(t,e,n={strict:!0}){const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:Cp(e[r])?e[r].test(t[r]):e[r]===t[r]))}function Bp(t,e,n={}){return t.find((t=>t.type===e&&$p(t.attrs,n)))}function Rp(t,e,n={}){return!!Bp(t,e,n)}function Lp(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=Bp([...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(Bp([...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&&Rp([...t.parent.child(a).marks],e,n);)u+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:u}}function Pp(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 jp(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function zp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Hp(t){const e=`<body>${t}</body>`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Vp(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)?Js.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Vp("",e,n)}if("string"==typeof t){const r=La.fromSchema(e);return n.slice?r.parseSlice(Hp(t),n.parseOptions).content:r.parse(Hp(t),n.parseOptions)}return Vp("",e,n)}function Wp(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Up(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?mp(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=>$p(t.node.attrs,n,{strict:!1})));if(i)return!!l.length;return l.reduce(((t,e)=>t+e.to-e.from),0)>=u}function qp(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Kp(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 Jp(t,e){const n=Pp(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 Gp(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 Yp(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 Xp(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 Qp(t,e){const{nodeExtensions:n}=dp(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=yp(fp(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}const Zp=(t,e)=>{const n=Xp((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)||!vu(t.doc,n.pos)||(t.join(n.pos),!0)},tf=(t,e)=>{const n=Xp((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)||!vu(t.doc,r)||(t.join(r),!0)};var ef=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=du(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 ju||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=np(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(Bu.create(s.doc,n+1)),e(s.scrollIntoView())}return!0})(t,e),deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=mp(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=np(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(Fu.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0})(t,e),extendMarkRange:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Pp(t,r.schema),{doc:s,selection:a}=n,{$from:u,from:l,to:c}=a;if(o){const t=Lp(u,i,e);if(t&&t.from<=l&&t.to>=c){const e=Bu.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=()=>{zp()&&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 Bu))return s(),!0;const a=function(t,e=null){if(!e)return null;const n=Fu.atStart(t),r=Fu.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?Bu.create(t,jp(0,o,i),jp(t.content.size,o,i)):Bu.create(t,jp(e,o,i),jp(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=Vp(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 lu||o instanceof cu))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(Fu.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=tp(r);if(!o){let n=r.blockRange(),o=n&&du(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&rp(t,o,e))return!0;if(0==r.parent.content.size&&(Zc(i,"end")||Lu.isSelectable(i))){let n=yu(t.doc,r.before(),r.after(),ta.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(Zc(i,"end")?Fu.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Lu.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=ep(r);if(!o)return!1;let i=o.nodeAfter;if(rp(t,o,e))return!0;if(0==r.parent.content.size&&(Zc(i,"start")||Lu.isSelectable(i))){let n=yu(t.doc,r.before(),r.after(),ta.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(Zc(i,"start")?Fu.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Lu.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}`);zp()||Wp()?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})=>!!Up(n,mp(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&du(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(gu(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&du(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)})(t,e),liftListItem:t=>({state:e,dispatch:n})=>lp(mp(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=qp("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=mp(t,r.schema)),"mark"===a&&(s=Pp(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,Kp(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(Kp(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=tp(r)}let s=i&&i.nodeBefore;return!(!s||!Lu.isSelectable(s)||(e&&e(t.tr.setSelection(Lu.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=ep(r)}let s=i&&i.nodeAfter;return!(!s||!Lu.isSelectable(s)||(e&&e(t.tr.setSelection(Lu.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(Lu.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>sp(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>ip(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=function(t,e,n={}){return Vp(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=Pp(t,r.schema);if(o)if(s){const t=Jp(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=mp(t,n.schema);return i.isTextblock?o().command((({commands:t})=>!!ap(i,e)(n)||t.clearNodes())).command((({state:t})=>ap(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=jp(t,0,n.content.size),o=Lu.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=Bu.atStart(n).from,s=Bu.atEnd(n).to,a=jp(r,i,s),u=jp(o,i,s),l=Bu.create(n,a,u);e.setSelection(l)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=mp(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=Js.from(n?o.create():null),s=new ta(Js.from(o.create(null,Js.from(a.type.create(null,r)))),n?3:1,0),l=i.start,c=i.end;e(t.tr.step(new cu(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=Gp(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Lu&&i.node.isBlock)return!(!a.parentOffset||!gu(s,a.pos))&&(r&&(t&&Yp(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 Bu&&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=gu(e.doc,e.mapping.map(a.pos),1,c);if(c||p||!gu(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&&Yp(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=mp(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=Js.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=Js.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=Gp(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(Js.from(s.createAndFill(null,u)||void 0));const l=a.before(a.depth-(n-1));e.replace(l,a.after(-r),new ta(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(Bu.near(e.doc.resolve(c))),e.scrollIntoView()}return!0}const f=u.pos===a.end()?c.contentMatchAt(0).defaultType:null,d=Gp(p,c.type.name,c.attrs),h=Gp(p,a.node().type.name,a.node().attrs);e.delete(a.pos,u.pos);const m=f?[{type:s,attrs:d},{type:f,attrs:h}]:[{type:s,attrs:d}];return!!gu(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=mp(t,o.schema),p=mp(e,o.schema),{selection:f}=o,{$from:d,$to:h}=f,m=d.blockRange(h);if(!m)return!1;const g=Xp((t=>Qp(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(Qp(g.node.type.name,l)&&c.validContent(g.node.content)&&i)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>Zp(r,c))).command((()=>tf(r,c))).run()}return s().command((()=>!!u().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>Zp(r,c))).command((()=>tf(r,c))).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Pp(t,r.schema),a=function(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Pp(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>$p(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=>$p(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=mp(t,r.schema),s=mp(e,r.schema);return Up(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=mp(t,n.schema);return Up(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=Pp(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=Lp(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=qp("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=mp(t,r.schema)),"mark"===a&&(s=Pp(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&&hu(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(mp(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>up(mp(t,n.schema),e)(n,r)});function nf(t,e){const n=qp("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=mp(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?Jp(t,e):{}}function rf(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 of(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach((e=>{const o=Lp(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}Ip.create({name:"commands",addCommands:()=>({...ef})}),Ip.create({name:"editable",addProseMirrorPlugins(){return[new Ku({key:new Yu("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ip.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ku({key:new Yu("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}}}})]}}),Ip.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=Fu.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 zp()||Wp()?o:r},addProseMirrorPlugins(){return[new Ku({key:new Yu("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=Fu.atStart(e.doc).from,a=Fu.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=cp({state:n,transaction:c}),{commands:f}=new pp({editor:this.editor,state:p});return f.clearNodes(),c.steps.length?c:void 0}})]}}),Ip.create({name:"tabindex",addProseMirrorPlugins(){return[new Ku({key:new Yu("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class sf{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=yp(fp(this,"addOptions",{name:this.name}))),this.storage=yp(fp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new sf(t)}configure(t={}){const e=this.extend();return e.options=Mp(this.options,t),e.storage=yp(fp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new sf(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=yp(fp(e,"addOptions",{name:e.name})),e.storage=yp(fp(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 af{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=yp(fp(this,"addOptions",{name:this.name}))),this.storage=yp(fp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new af(t)}configure(t={}){const e=this.extend();return e.options=Mp(this.options,t),e.storage=yp(fp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new af(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=yp(fp(e,"addOptions",{name:e.name})),e.storage=yp(fp(e,"addStorage",{name:e.name,options:e.options})),e}}function uf(t){return new Op({find:t.find,handler:({state:e,range:n,match:r})=>{const o=yp(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(of(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)}}})}const lf=af.create({name:"text",group:"inline"});var cf=function(){};cf.prototype.append=function(t){return t.length?(t=cf.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},cf.prototype.prepend=function(t){return t.length?cf.from(t).append(this):this},cf.prototype.appendInner=function(t){return new ff(this,t)},cf.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?cf.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},cf.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},cf.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)},cf.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},cf.from=function(t){return t instanceof cf?t:t&&t.length?new pf(t):cf.empty};var pf=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}(cf);cf.empty=new pf([]);var ff=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}(cf),df=cf;class hf{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 mf(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 mf(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 hf(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 mf(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>vf&&(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 hf(s.append(o),i)}remapping(t,e){let n=new nu;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 hf(this.items.append(t.map((t=>new mf(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 mf(u,i,l))}else n.push(new mf(u))}),r);let u=[];for(let t=e;t<i;t++)u.push(new mf(o.maps[t]));let l=this.items.slice(0,r).append(u).append(n),c=new hf(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 mf(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 hf(df.from(r.reverse()),o)}}hf.empty=new hf(df.empty,0);class mf{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 mf(e.getMap().invert(),e,this.selection)}}}class gf{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const vf=20;function yf(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function bf(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 _f(t,e,n,r){let o=wf(e),i=Cf.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 gf(r?u:s.remaining,r?s.remaining:u,null,0);n(s.transform.setSelection(a).setMeta(Cf,{redo:r,historyState:l}).scrollIntoView())}let Df=!1,Ef=null;function wf(t){let e=t.plugins;if(Ef!=e){Df=!1,Ef=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Df=!0;break}}return Df}const Cf=new Yu("history"),kf=new Yu("closeHistory");function Af(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ku({key:Cf,state:{init:()=>new gf(hf.empty,hf.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(Cf);if(i)return i.historyState;n.getMeta(kf)&&(t=new gf(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Cf))return s.getMeta(Cf).redo?new gf(t.done.addTransform(n,void 0,r,wf(e)),t.undone,yf(n.mapping.maps[n.steps.length-1]),t.prevTime):new gf(t.done,t.undone.addTransform(n,void 0,r,wf(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new gf(t.done.rebased(n,o),t.undone.rebased(n,o),bf(t.prevRanges,n.mapping),t.prevTime):new gf(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),bf(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?bf(t.prevRanges,n.mapping):yf(n.mapping.maps[n.steps.length-1]);return new gf(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,wf(e)),hf.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?xf:"historyRedo"==n?Of:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const xf=(t,e)=>{let n=Cf.getState(t);return!(!n||0==n.done.eventCount)&&(e&&_f(n,t,e,!1),!0)},Of=(t,e)=>{let n=Cf.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&_f(n,t,e,!0),!0)},Sf=Ip.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>xf(t,e),redo:()=>({state:t,dispatch:e})=>Of(t,e)}),addProseMirrorPlugins(){return[Af(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()}}});function Nf(t){return(...e)=>n=>t(n,...e)}function Tf(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 Ff(t){const e=Tf(t);return["span",e?{...e,class:"zw-style"}:{},0]}function Mf(t,...e){return({editor:n})=>(n.commands[t](...e),!0)}var If=Object.defineProperty,$f=(t,e,n)=>(((t,e,n)=>{e in t?If(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);function Bf(t,e){let n=!1;return function(){n||(t.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),e))}}function Rf(t){return t>1||t<-1?t/100:t}const Lf=t=>Number.parseFloat(t.toFixed(5).substr(0,5));function Pf(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 jf(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 zf(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=Lf(a[1]),l=Lf(a[2]);return{h:Math.floor(a[0]),s:u,v:l,a:t.a}}function Hf(t){const e=zf(Pf(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:Lf(s),l:Lf(i),a:o}}(e),r=Pf(t);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:n,hsva:e,hue:e.h,rgba:r}}function Vf(t,e,n="0"){return t+n.repeat(Math.max(0,e-t.length))}function Wf(t){return Hf(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?Vf(e,8,"F"):Vf(Vf(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}(t))}const Uf=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"}),qf="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",Kf=`[\\s|\\(]+(${qf})[,|\\s]+(${qf})[,|\\s]+(${qf})\\s*\\)?`,Jf=`[\\s|\\(]+(${qf})[,|\\s]+(${qf})[,|\\s]+(${qf})[,|\\s]+(${qf})\\s*\\)?`,Gf=Object.freeze({CSS_UNIT:new RegExp(qf),RGB:new RegExp(`rgb${Kf}`),RGBA:new RegExp(`rgba${Jf}`),HSL:new RegExp(`hsl${Kf}`),HSLA:new RegExp(`hsla${Jf}`),HSV:new RegExp(`hsv${Kf}`),HSVA:new RegExp(`hsva${Jf}`),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})$/}),Yf=Object.freeze({WINDOW:Symbol("window")});Yf.WINDOW;Yf.WINDOW,Yf.WINDOW,Bf(((t,e)=>{t(e)}),20);const Xf=class{static create(t){if(!t)return Xf.fromBlack();let e=t.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(Uf[e])e=Uf[e];else if(e===this.TRANSPARENT)return Xf.fromTransparent();const n=Gf.RGB.exec(e)||Gf.RGBA.exec(e);if(n){const t=void 0===n[4]?1:n[4];return Xf.fromRgba({r:Number.parseInt(n[1]),g:Number.parseInt(n[2]),b:Number.parseInt(n[3]),a:Number.parseFloat(t)})}const r=Gf.HSL.exec(e)||Gf.HSLA.exec(e);if(r){const t=void 0===r[4]?1:r[4];return Xf.fromHsla({h:Number.parseInt(r[1]),s:Number.parseFloat(r[2]),l:Number.parseFloat(r[3]),a:Number.parseFloat(t)})}const o=Gf.HSV.exec(e)||Gf.HSVA.exec(e);if(o){const t=void 0===o[4]?1:o[4];return Xf.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(t)})}return Gf.HEX8.exec(e)||Gf.HEX6.exec(e)||Gf.HEX4.exec(e)||Gf.HEX3.exec(e)?Xf.fromHex(e):Xf.fromBlack()}static fromHex(t){const{rgba:e}=Wf(t);return new Xf(e)}static fromRgba({r:t,g:e,b:n,a:r}){const o=Rf(r);return new Xf({r:t,g:e,b:n,a:o})}static fromHsla({h:t,s:e,l:n,a:r}){const o=Rf(e),i=Rf(n),s=Rf(r);return Xf.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:Lf(0===i?0:2-2*r/i),v:Lf(i),a:o}}({h:t,s:o,l:i,a:s}))}static fromHsva({h:t,s:e,v:n,a:r}){const o=jf({h:t,s:Rf(e),v:Rf(n),a:Rf(r)});return new Xf(o)}static fromTransparent(){return new Xf({r:0,g:0,b:0,a:0})}static fromWhite(){return new Xf({r:255,g:255,b:255,a:1})}static fromBlack(){return new Xf({r:0,g:0,b:0,a:1})}static isTransparent(t){return Xf.create(t).isTransparent()}static isDark(t){return Xf.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 zf(this.rgba)}_calcRgba(){return jf(this.hsva)}};let Qf=Xf;function Zf(t){const e=Qf.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}function td(t,e){if(!t.includes("em"))return parseInt(t);const n=Jh.getComputedStyle(e).fontSize,r=parseFloat(t)*parseFloat(n);return Math.round(r)}function ed(t,e,n){if(!t.includes("px"))return t;const r=function(t,e){return(t.firstElementChild||t).style.fontSize||Jh.getComputedStyle(e).fontSize}(e,n),o=td(r,n);return o?(parseInt(t)/o).toFixed(2):null}$f(Qf,"TRANSPARENT","transparent"),$f(Qf,"NONE","none");const nd=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),rd=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),od=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),id=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),sd=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]}}),ad=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,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),ud=Object.freeze({SETTINGS:"settings",ALL:"_"}),ld=Object.freeze({BLANK:"_blank",SELF:"_self"}),cd=Object.freeze({URL:"url",BLOCK:"block"}),pd={start:od.LEFT,end:od.RIGHT};const fd=(t,e,n,r)=>({from:Math.max(r,t.pos),to:Math.min(r+n.nodeSize,e.pos)});function dd(t,e){return t.resolve(e).depth+1}const hd=(t,e)=>t.eq(e);var md,gd,vd={exports:{}};
6
+ */var G=Object.freeze({}),Y=Array.isArray;function X(t){return null==t}function Z(t){return null!=t}function Q(t){return!0===t}function tt(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function et(t){return"function"==typeof t}function nt(t){return null!==t&&"object"==typeof t}var rt=Object.prototype.toString;function ot(t){return rt.call(t).slice(8,-1)}function it(t){return"[object Object]"===rt.call(t)}function st(t){return"[object RegExp]"===rt.call(t)}function at(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function ut(t){return Z(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function lt(t){return null==t?"":Array.isArray(t)||it(t)&&t.toString===rt?JSON.stringify(t,null,2):String(t)}function ct(t){var e=parseFloat(t);return isNaN(e)?t:e}function pt(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 ft=pt("slot,component",!0),dt=pt("key,ref,slot,slot-scope,is");function ht(t,e){var n=t.length;if(n){if(e===t[n-1])return void(t.length=n-1);var r=t.indexOf(e);if(r>-1)return t.splice(r,1)}}var mt=Object.prototype.hasOwnProperty;function gt(t,e){return mt.call(t,e)}function vt(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var yt=/-(\w)/g,bt=vt((function(t){return t.replace(yt,(function(t,e){return e?e.toUpperCase():""}))})),_t=vt((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),Dt=/\B([A-Z])/g,wt=vt((function(t){return t.replace(Dt,"-$1").toLowerCase()}));var kt=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 Et(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function Ct(t,e){for(var n in e)t[n]=e[n];return t}function xt(t){for(var e={},n=0;n<t.length;n++)t[n]&&Ct(e,t[n]);return e}function At(t,e,n){}var St=function(t,e,n){return!1},Ot=function(t){return t};function Nt(t,e){if(t===e)return!0;var n=nt(t),r=nt(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 Nt(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 Nt(t[n],e[n])}))}catch(t){return!1}}function Tt(t,e){for(var n=0;n<t.length;n++)if(Nt(t[n],e))return n;return-1}function Ft(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function Mt(t,e){return t===e?0===t&&1/t!=1/e:t==t||e==e}var It="data-server-rendered",$t=["component","directive","filter"],Bt=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],Rt={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:St,isReservedAttr:St,isUnknownElement:St,getTagNamespace:At,parsePlatformTagName:Ot,mustUseProp:St,async:!0,_lifecycleHooks:Bt},Lt=/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 Pt(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function jt(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var zt=new RegExp("[^".concat(Lt.source,".$_\\d]"));var Vt="__proto__"in{},Ht="undefined"!=typeof window,Wt=Ht&&window.navigator.userAgent.toLowerCase(),qt=Wt&&/msie|trident/.test(Wt),Ut=Wt&&Wt.indexOf("msie 9.0")>0,Kt=Wt&&Wt.indexOf("edge/")>0;Wt&&Wt.indexOf("android");var Jt,Gt=Wt&&/iphone|ipad|ipod|ios/.test(Wt),Yt=Wt&&Wt.match(/firefox\/(\d+)/),Xt={}.watch,Zt=!1;if(Ht)try{var Qt={};Object.defineProperty(Qt,"passive",{get:function(){Zt=!0}}),window.addEventListener("test-passive",null,Qt)}catch(t){}var te=function(){return void 0===Jt&&(Jt=!Ht&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),Jt},ee=Ht&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ne(t){return"function"==typeof t&&/native code/.test(t.toString())}var re,oe="undefined"!=typeof Symbol&&ne(Symbol)&&"undefined"!=typeof Reflect&&ne(Reflect.ownKeys);re="undefined"!=typeof Set&&ne(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 ie=null;function se(t){void 0===t&&(t=null),t||ie&&ie._scope.off(),ie=t,t&&t._scope.on()}var ae=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}(),ue=function(t){void 0===t&&(t="");var e=new ae;return e.text=t,e.isComment=!0,e};function le(t){return new ae(void 0,void 0,void 0,String(t))}function ce(t){var e=new ae(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 pe=function(){return pe=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},pe.apply(this,arguments)},fe=0,de=[],he=function(){function t(){this._pending=!1,this.id=fe++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,de.push(this))},t.prototype.depend=function(e){t.target&&(t.target.addDep(this),"production"!==process.env.NODE_ENV&&e&&t.target.onTrack&&t.target.onTrack(pe({effect:t.target},e)))},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));"production"===process.env.NODE_ENV||Rt.async||e.sort((function(t,e){return t.id-e.id}));for(var n=0,r=e.length;n<r;n++){var o=e[n];"production"!==process.env.NODE_ENV&&t&&o.onTrigger&&o.onTrigger(pe({effect:e[n]},t)),o.update()}},t}();he.target=null;var me=[];function ge(t){me.push(t),he.target=t}function ve(){me.pop(),he.target=me[me.length-1]}var ye=Array.prototype,be=Object.create(ye);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(t){var e=ye[t];jt(be,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 _e=Object.getOwnPropertyNames(be),De={},we=!0;function ke(t){we=t}var Ee={notify:At,depend:At,addSub:At,removeSub:At},Ce=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?Ee:new he,this.vmCount=0,jt(t,"__ob__",this),Y(t)){if(!n)if(Vt)t.__proto__=be;else for(var r=0,o=_e.length;r<o;r++){jt(t,s=_e[r],be[s])}e||this.observeArray(t)}else{var i=Object.keys(t);for(r=0;r<i.length;r++){var s;Ae(t,s=i[r],De,void 0,e,n)}}}return t.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)xe(t[e],!1,this.mock)},t}();function xe(t,e,n){return t&&gt(t,"__ob__")&&t.__ob__ instanceof Ce?t.__ob__:!we||!n&&te()||!Y(t)&&!it(t)||!Object.isExtensible(t)||t.__v_skip||Re(t)||t instanceof ae?void 0:new Ce(t,e,n)}function Ae(t,e,n,r,o,i){var s=new he,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var u=a&&a.get,l=a&&a.set;u&&!l||n!==De&&2!==arguments.length||(n=t[e]);var c=!o&&xe(n,!1,i);return Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var r=u?u.call(t):n;return he.target&&("production"!==process.env.NODE_ENV?s.depend({target:t,type:"get",key:e}):s.depend(),c&&(c.dep.depend(),Y(r)&&Ne(r))),Re(r)&&!o?r.value:r},set:function(a){var p=u?u.call(t):n;if(Mt(p,a)){if("production"!==process.env.NODE_ENV&&r&&r(),l)l.call(t,a);else{if(u)return;if(!o&&Re(p)&&!Re(a))return void(p.value=a);n=a}c=!o&&xe(a,!1,i),"production"!==process.env.NODE_ENV?s.notify({type:"set",target:t,key:e,newValue:a,oldValue:p}):s.notify()}}}),s}}function Se(t,e,n){if("production"!==process.env.NODE_ENV&&(X(t)||tt(t))&&zr("Cannot set reactive property on undefined, null, or primitive value: ".concat(t)),!$e(t)){var r=t.__ob__;return Y(t)&&at(e)?(t.length=Math.max(t.length,e),t.splice(e,1,n),r&&!r.shallow&&r.mock&&xe(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&&zr("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),n):r?(Ae(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&&zr('Set operation on key "'.concat(e,'" failed: target is readonly.'))}function Oe(t,e){if("production"!==process.env.NODE_ENV&&(X(t)||tt(t))&&zr("Cannot delete reactive property on undefined, null, or primitive value: ".concat(t)),Y(t)&&at(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount?"production"!==process.env.NODE_ENV&&zr("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):$e(t)?"production"!==process.env.NODE_ENV&&zr('Delete operation on key "'.concat(e,'" failed: target is readonly.')):gt(t,e)&&(delete t[e],n&&("production"!==process.env.NODE_ENV?n.dep.notify({type:"delete",target:t,key:e}):n.dep.notify()))}}function Ne(t){for(var e=void 0,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),Y(e)&&Ne(e)}function Te(t){return Fe(t,!0),jt(t,"__v_isShallow",!0),t}function Fe(t,e){if(!$e(t)){if("production"!==process.env.NODE_ENV){Y(t)&&zr("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&&zr("Target is already a ".concat(n.shallow?"":"non-","shallow reactive object, and cannot be converted to ").concat(e?"":"non-","shallow."))}var r=xe(t,e,te());"production"===process.env.NODE_ENV||r||((null==t||tt(t))&&zr("value cannot be made reactive: ".concat(String(t))),("Map"===(o=ot(t))||"WeakMap"===o||"Set"===o||"WeakSet"===o)&&zr("Vue 2 does not support reactive collection types such as Map or Set."))}var o}function Me(t){return $e(t)?Me(t.__v_raw):!(!t||!t.__ob__)}function Ie(t){return!(!t||!t.__v_isShallow)}function $e(t){return!(!t||!t.__v_isReadonly)}var Be="__v_isRef";function Re(t){return!(!t||!0!==t.__v_isRef)}function Le(t){return function(t,e){if(Re(t))return t;var n={};return jt(n,Be,!0),jt(n,"__v_isShallow",e),jt(n,"dep",Ae(n,"value",t,null,e,te())),n}(t,!1)}function Pe(t){return Re(t)?t.value:t}function je(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){var t=e[n];if(Re(t))return t.value;var r=t&&t.__ob__;return r&&r.dep.depend(),t},set:function(t){var r=e[n];Re(r)&&!Re(t)?r.value=t:e[n]=t}})}function ze(t,e,n){var r=t[e];if(Re(r))return r;var o={get value(){var r=t[e];return void 0===r?n:r},set value(n){t[e]=n}};return jt(o,Be,!0),o}function Ve(t,e){var n,r,o=et(t);o?(n=t,r="production"!==process.env.NODE_ENV?function(){zr("Write operation failed: computed value is readonly")}:At):(n=t.get,r=t.set);var i=te()?null:new rr(ie,n,At,{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(),he.target&&("production"!==process.env.NODE_ENV&&he.target.onTrack&&he.target.onTrack({effect:he.target,target:s,type:"get",key:"value"}),i.depend()),i.value):n()},set value(t){r(t)}};return jt(s,Be,!0),jt(s,"__v_isReadonly",o),s}var He,We="watcher",qe="".concat(We," callback"),Ue="".concat(We," getter"),Ke="".concat(We," cleanup"),Je={};function Ge(t,e,n){return"production"!==process.env.NODE_ENV&&"function"!=typeof e&&zr("`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?G: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&&zr('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==i&&zr('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));var c,p,f=function(t){zr("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.")},d=ie,h=function(t,e,n){return void 0===n&&(n=null),Rn(t,null,n,d,e)},m=!1,g=!1;Re(t)?(c=function(){return t.value},m=Ie(t)):Me(t)?(c=function(){return t.__ob__.dep.depend(),t},i=!0):Y(t)?(g=!0,m=t.some((function(t){return Me(t)||Ie(t)})),c=function(){return t.map((function(t){return Re(t)?t.value:Me(t)?Xn(t):et(t)?h(t,Ue):void("production"!==process.env.NODE_ENV&&f(t))}))}):et(t)?c=e?function(){return h(t,Ue)}:function(){if(!d||!d._isDestroyed)return p&&p(),h(t,We,[y])}:(c=At,"production"!==process.env.NODE_ENV&&f(t));if(e&&i){var v=c;c=function(){return Xn(v())}}var y=function(t){p=b.onStop=function(){h(t,Ke)}};if(te())return y=At,e?o&&h(e,qe,[c(),g?[]:void 0,y]):c(),At;var b=new rr(ie,c,At,{lazy:!0});b.noRecurse=!e;var _=g?[]:Je;b.run=function(){if(b.active)if(e){var t=b.get();(i||m||(g?t.some((function(t,e){return Mt(t,_[e])})):Mt(t,_)))&&(p&&p(),h(e,qe,[t,_===Je?void 0:_,y]),_=t)}else b.get()},"sync"===a?b.update=b.run:"post"===a?(b.post=!0,b.update=function(){return Sr(b)}):b.update=function(){if(d&&d===ie&&!d._isMounted){var t=d._preWatchers||(d._preWatchers=[]);t.indexOf(b)<0&&t.push(b)}else Sr(b)};"production"!==process.env.NODE_ENV&&(b.onTrack=u,b.onTrigger=l);e?o?b.run():_=b.get():"post"===a&&d?d.$once("hook:mounted",(function(){return b.get()})):b.get();return function(){b.teardown()}}(t,e,n)}var Ye=function(){function t(t){void 0===t&&(t=!1),this.detached=t,this.active=!0,this.effects=[],this.cleanups=[],this.parent=He,!t&&He&&(this.index=(He.scopes||(He.scopes=[])).push(this)-1)}return t.prototype.run=function(t){if(this.active){var e=He;try{return He=this,t()}finally{He=e}}else"production"!==process.env.NODE_ENV&&zr("cannot run an inactive effect scope.")},t.prototype.on=function(){He=this},t.prototype.off=function(){He=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.detached&&this.parent&&!t){var r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0,this.active=!1}},t}();var Xe=vt((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 Ze(t,e){function n(){var t=n.fns;if(!Y(t))return Rn(t,null,arguments,e,"v-on handler");for(var r=t.slice(),o=0;o<r.length;o++)Rn(r[o],null,arguments,e,"v-on handler")}return n.fns=t,n}function Qe(t,e,n,r,o,i){var s,a,u,l;for(s in t)a=t[s],u=e[s],l=Xe(s),X(a)?"production"!==process.env.NODE_ENV&&zr('Invalid handler for event "'.concat(l.name,'": got ')+String(a),i):X(u)?(X(a.fns)&&(a=t[s]=Ze(a,i)),Q(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)X(t[s])&&r((l=Xe(s)).name,e[s],l.capture)}function tn(t,e,n){var r;t instanceof ae&&(t=t.data.hook||(t.data.hook={}));var o=t[e];function i(){n.apply(this,arguments),ht(r.fns,i)}X(o)?r=Ze([i]):Z(o.fns)&&Q(o.merged)?(r=o).fns.push(i):r=Ze([o,i]),r.merged=!0,t[e]=r}function en(t,e,n,r,o){if(Z(e)){if(gt(e,n))return t[n]=e[n],o||delete e[n],!0;if(gt(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function nn(t){return tt(t)?[le(t)]:Y(t)?on(t):void 0}function rn(t){return Z(t)&&Z(t.text)&&!1===t.isComment}function on(t,e){var n,r,o,i,s=[];for(n=0;n<t.length;n++)X(r=t[n])||"boolean"==typeof r||(i=s[o=s.length-1],Y(r)?r.length>0&&(rn((r=on(r,"".concat(e||"","_").concat(n)))[0])&&rn(i)&&(s[o]=le(i.text+r[0].text),r.shift()),s.push.apply(s,r)):tt(r)?rn(i)?s[o]=le(i.text+r):""!==r&&s.push(le(r)):rn(r)&&rn(i)?s[o]=le(i.text+r.text):(Q(t._isVList)&&Z(r.tag)&&X(r.key)&&Z(e)&&(r.key="__vlist".concat(e,"_").concat(n,"__")),s.push(r)));return s}function sn(t,e){var n,r,o,i,s=null;if(Y(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(nt(t))if(oe&&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 Z(s)||(s=[]),s._isVList=!0,s}function an(t,e,n,r){var o,i=this.$scopedSlots[t];i?(n=n||{},r&&("production"===process.env.NODE_ENV||nt(r)||zr("slot v-bind without argument expects an Object",this),n=Ct(Ct({},r),n)),o=i(n)||(et(e)?e():e)):o=this.$slots[t]||(et(e)?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function un(t){return to(this.$options,"filters",t,!0)||Ot}function ln(t,e){return Y(t)?-1===t.indexOf(e):t!==e}function cn(t,e,n,r,o){var i=Rt.keyCodes[e]||n;return o&&r&&!Rt.keyCodes[e]?ln(o,r):i?ln(i,t):r?wt(r)!==e:void 0===t}function pn(t,e,n,r,o){if(n)if(nt(n)){Y(n)&&(n=xt(n));var i=void 0,s=function(s){if("class"===s||"style"===s||dt(s))i=t;else{var a=t.attrs&&t.attrs.type;i=r||Rt.mustUseProp(e,a,s)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var u=bt(s),l=wt(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&&zr("v-bind without argument expects an Object or Array value",this);return t}function fn(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||hn(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),"__static__".concat(t),!1),r}function dn(t,e,n){return hn(t,"__once__".concat(e).concat(n?"_".concat(n):""),!0),t}function hn(t,e,n){if(Y(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&mn(t[r],"".concat(e,"_").concat(r),n);else mn(t,e,n)}function mn(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function gn(t,e){if(e)if(it(e)){var n=t.on=t.on?Ct({},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&&zr("v-on without argument expects an Object value",this);return t}function vn(t,e,n,r){e=e||{$stable:!n};for(var o=0;o<t.length;o++){var i=t[o];Y(i)?vn(i,e,n):i&&(i.proxy&&(i.fn.proxy=!0),e[i.key]=i.fn)}return r&&(e.$key=r),e}function yn(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&&zr("Invalid value for dynamic directive argument (expected string or null): ".concat(r),this)}return t}function bn(t,e){return"string"==typeof t?e+t:t}function _n(t){t._o=dn,t._n=ct,t._s=lt,t._l=sn,t._t=an,t._q=Nt,t._i=Tt,t._m=fn,t._f=un,t._k=cn,t._b=pn,t._v=le,t._e=ue,t._u=vn,t._g=gn,t._d=yn,t._p=bn}function Dn(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(wn)&&delete n[l];return n}function wn(t){return t.isComment&&!t.asyncFactory||" "===t.text}function kn(t){return t.isComment&&t.asyncFactory}function En(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!==G&&a===r.$key&&!i&&!r.$hasNormal)return r;for(var u in o={},e)e[u]&&"$"!==u[0]&&(o[u]=Cn(t,n,u,e[u]))}else o={};for(var l in n)l in o||(o[l]=xn(n,l));return e&&Object.isExtensible(e)&&(e._normalized=o),jt(o,"$stable",s),jt(o,"$key",a),jt(o,"$hasNormal",i),o}function Cn(t,e,n,r){var o=function(){var e=ie;se(t);var n=arguments.length?r.apply(null,arguments):r({}),o=(n=n&&"object"==typeof n&&!Y(n)?[n]:nn(n))&&n[0];return se(e),n&&(!o||1===n.length&&o.isComment&&!kn(o))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:o,enumerable:!0,configurable:!0}),o}function xn(t,e){return function(){return t[e]}}function An(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={};jt(e,"_v_attr_proxy",!0),Sn(e,t.$attrs,G,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||Sn(t._listenersProxy={},t.$listeners,G,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||Nn(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:kt(t.$emit,t),expose:function(n){"production"!==process.env.NODE_ENV&&(e&&zr("expose() should be called only once per setup().",t),e=!0),n&&Object.keys(n).forEach((function(e){return je(t,n,e)}))}}}(t);se(t),ge();var o=Rn(n,null,[t._props||Te({}),r],t,"setup");if(ve(),se(),et(o))e.render=o;else if(nt(o))if("production"!==process.env.NODE_ENV&&o instanceof ae&&zr("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&&je(i,o,s)}else for(var s in o)Pt(s)?"production"!==process.env.NODE_ENV&&zr("Avoid using variables that start with _ or $ in setup()."):je(t,o,s);else"production"!==process.env.NODE_ENV&&void 0!==o&&zr("setup() should return an object. Received: ".concat(null===o?"null":typeof o))}}function Sn(t,e,n,r,o){var i=!1;for(var s in e)s in t?e[s]!==n[s]&&(i=!0):(i=!0,On(t,s,r,o));for(var s in t)s in e||(i=!0,delete t[s]);return i}function On(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function Nn(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var Tn=null;function Fn(t,e){return(t.__esModule||oe&&"Module"===t[Symbol.toStringTag])&&(t=t.default),nt(t)?e.extend(t):t}function Mn(t){if(Y(t))for(var e=0;e<t.length;e++){var n=t[e];if(Z(n)&&(Z(n.componentOptions)||kn(n)))return n}}function In(t,e,n,r,o,i){return(Y(n)||tt(n))&&(o=r,r=n,n=void 0),Q(i)&&(o=2),function(t,e,n,r,o){if(Z(n)&&Z(n.__ob__))return"production"!==process.env.NODE_ENV&&zr("Avoid using observed data object as vnode data: ".concat(JSON.stringify(n),"\n")+"Always create fresh vnode data objects in each render!",t),ue();Z(n)&&Z(n.is)&&(e=n.is);if(!e)return ue();"production"!==process.env.NODE_ENV&&Z(n)&&Z(n.key)&&!tt(n.key)&&zr("Avoid using non-primitive value as key, use string/number value instead.",t);Y(r)&&et(r[0])&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);2===o?r=nn(r):1===o&&(r=function(t){for(var e=0;e<t.length;e++)if(Y(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||Rt.getTagNamespace(e),Rt.isReservedTag(e)?("production"!==process.env.NODE_ENV&&Z(n)&&Z(n.nativeOn)&&"component"!==n.tag&&zr("The .native modifier for v-on is only valid on components but it was used on <".concat(e,">."),t),i=new ae(Rt.parsePlatformTagName(e),n,r,void 0,void 0,t)):i=n&&n.pre||!Z(a=to(t.$options,"components",e))?new ae(e,n,r,void 0,void 0,t):Rr(a,n,t,r,e)}else i=Rr(e,n,t,r);return Y(i)?i:Z(i)?(Z(s)&&$n(i,s),Z(n)&&function(t){nt(t.style)&&Xn(t.style);nt(t.class)&&Xn(t.class)}(n),i):ue()}(t,e,n,r,o)}function $n(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),Z(t.children))for(var r=0,o=t.children.length;r<o;r++){var i=t.children[r];Z(i.tag)&&(X(i.ns)||Q(n)&&"svg"!==i.tag)&&$n(i,e,n)}}function Bn(t,e,n){ge();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){Ln(t,r,"errorCaptured hook")}}Ln(t,e,n)}finally{ve()}}function Rn(t,e,n,r,o){var i;try{(i=n?t.apply(e,n):t.call(e))&&!i._isVue&&ut(i)&&!i._handled&&(i.catch((function(t){return Bn(t,r,o+" (Promise/async)")})),i._handled=!0)}catch(t){Bn(t,r,o)}return i}function Ln(t,e,n){if(Rt.errorHandler)try{return Rt.errorHandler.call(null,t,e,n)}catch(e){e!==t&&Pn(e,null,"config.errorHandler")}Pn(t,e,n)}function Pn(t,e,n){if("production"!==process.env.NODE_ENV&&zr("Error in ".concat(n,': "').concat(t.toString(),'"'),e),!Ht||"undefined"==typeof console)throw t;console.error(t)}var jn,zn=!1,Vn=[],Hn=!1;function Wn(){Hn=!1;var t=Vn.slice(0);Vn.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!=typeof Promise&&ne(Promise)){var qn=Promise.resolve();jn=function(){qn.then(Wn),Gt&&setTimeout(At)},zn=!0}else if(qt||"undefined"==typeof MutationObserver||!ne(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())jn="undefined"!=typeof setImmediate&&ne(setImmediate)?function(){setImmediate(Wn)}:function(){setTimeout(Wn,0)};else{var Un=1,Kn=new MutationObserver(Wn),Jn=document.createTextNode(String(Un));Kn.observe(Jn,{characterData:!0}),jn=function(){Un=(Un+1)%2,Jn.data=String(Un)},zn=!0}function Gn(t,e){var n;if(Vn.push((function(){if(t)try{t.call(e)}catch(t){Bn(t,e,"nextTick")}else n&&n(e)})),Hn||(Hn=!0,jn()),!t&&"undefined"!=typeof Promise)return new Promise((function(t){n=t}))}var Yn=new re;function Xn(t){return Zn(t,Yn),Yn.clear(),t}function Zn(t,e){var n,r,o=Y(t);if(!(!o&&!nt(t)||t.__v_skip||Object.isFrozen(t)||t instanceof ae)){if(t.__ob__){var i=t.__ob__.dep.id;if(e.has(i))return;e.add(i)}if(o)for(n=t.length;n--;)Zn(t[n],e);else if(Re(t))Zn(t.value,e);else for(n=(r=Object.keys(t)).length;n--;)Zn(t[r[n]],e)}}var Qn,tr,er,nr=0,rr=function(){function t(t,e,n,r,o){var i,s;i=this,void 0===(s=He&&!He._vm?He:t?t._scope:void 0)&&(s=He),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=++nr,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new re,this.newDepIds=new re,this.expression="production"!==process.env.NODE_ENV?e.toString():"",et(e)?this.getter=e:(this.getter=function(t){if(!zt.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=At,"production"!==process.env.NODE_ENV&&zr('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;ge(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;Bn(t,e,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&Xn(t),ve(),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():Sr(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||nt(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');Rn(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&&ht(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 or=Ht&&window.performance;or&&or.mark&&or.measure&&or.clearMarks&&or.clearMeasures&&(Qn=function(t){return or.mark(t)},tr=function(t,e,n){or.measure(t,e,n),or.clearMarks(e),or.clearMarks(n)})}function ir(t,e){er.$on(t,e)}function sr(t,e){er.$off(t,e)}function ar(t,e){var n=er;return function r(){var o=e.apply(null,arguments);null!==o&&n.$off(t,r)}}function ur(t,e,n){er=t,Qe(e,n||{},ir,sr,ar,t),er=void 0}var lr=null,cr=!1;function pr(t){var e=lr;return lr=t,function(){lr=e}}function fr(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function dr(t,e){if(e){if(t._directInactive=!1,fr(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++)dr(t.$children[n]);mr(t,"activated")}}function hr(t,e){if(!(e&&(t._directInactive=!0,fr(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)hr(t.$children[n]);mr(t,"deactivated")}}function mr(t,e,n,r){void 0===r&&(r=!0),ge();var o=ie;r&&se(t);var i=t.$options[e],s="".concat(e," hook");if(i)for(var a=0,u=i.length;a<u;a++)Rn(i[a],t,n||null,t,s);t._hasHookEvent&&t.$emit("hook:"+e),r&&se(o),ve()}var gr=[],vr=[],yr={},br={},_r=!1,Dr=!1,wr=0;var kr=0,Er=Date.now;if(Ht&&!qt){var Cr=window.performance;Cr&&"function"==typeof Cr.now&&Er()>document.createEvent("Event").timeStamp&&(Er=function(){return Cr.now()})}var xr=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Ar(){var t,e;for(kr=Er(),Dr=!0,gr.sort(xr),wr=0;wr<gr.length;wr++)if((t=gr[wr]).before&&t.before(),e=t.id,yr[e]=null,t.run(),"production"!==process.env.NODE_ENV&&null!=yr[e]&&(br[e]=(br[e]||0)+1,br[e]>100)){zr("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=vr.slice(),r=gr.slice();wr=gr.length=vr.length=0,yr={},"production"!==process.env.NODE_ENV&&(br={}),_r=Dr=!1,function(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,dr(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&&mr(r,"updated")}}(r),function(){for(var t=0;t<de.length;t++){var e=de[t];e.subs=e.subs.filter((function(t){return t})),e._pending=!1}de.length=0}(),ee&&Rt.devtools&&ee.emit("flush")}function Sr(t){var e=t.id;if(null==yr[e]&&(t!==he.target||!t.noRecurse)){if(yr[e]=!0,Dr){for(var n=gr.length-1;n>wr&&gr[n].id>t.id;)n--;gr.splice(n+1,0,t)}else gr.push(t);if(!_r){if(_r=!0,"production"!==process.env.NODE_ENV&&!Rt.async)return void Ar();Gn(Ar)}}}function Or(t){var e=t.$options.provide;if(e){var n=et(e)?e.call(t):e;if(!nt(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=oe?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(t,e){if(t){for(var n=Object.create(null),r=oe?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]=et(a)?a.call(e):a}else"production"!==process.env.NODE_ENV&&zr('Injection "'.concat(i,'" not found'),e)}}return n}}function Tr(t,e,n,r,o){var i,s=this,a=o.options;gt(r,"_uid")?(i=Object.create(r))._original=r:(i=r,r=r._original);var u=Q(a._compiled),l=!u;this.data=t,this.props=e,this.children=n,this.parent=r,this.listeners=t.on||G,this.injections=Nr(a.inject,r),this.slots=function(){return s.$slots||En(r,t.scopedSlots,s.$slots=Dn(n,r)),s.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return En(r,t.scopedSlots,this.slots())}}),u&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=En(r,t.scopedSlots,this.$slots)),a._scopeId?this._c=function(t,e,n,o){var s=In(i,t,e,n,o,l);return s&&!Y(s)&&(s.fnScopeId=a._scopeId,s.fnContext=r),s}:this._c=function(t,e,n,r){return In(i,t,e,n,r,l)}}function Fr(t,e,n,r,o){var i=ce(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 Mr(t,e){for(var n in e)t[bt(n)]=e[n]}function Ir(t){return t.name||t.__name||t._componentTag}_n(Tr.prototype);var $r={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;$r.prepatch(n,n)}else{(t.componentInstance=function(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;Z(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,lr)).$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&&(cr=!0);var i=r.data.scopedSlots,s=t.$scopedSlots,a=!!(i&&!i.$stable||s!==G&&!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||G;t._attrsProxy&&Sn(t._attrsProxy,c,l.data&&l.data.attrs||G,t,"$attrs")&&(u=!0),t.$attrs=c,n=n||G;var p=t.$options._parentListeners;if(t._listenersProxy&&Sn(t._listenersProxy,n,p||G,t,"$listeners"),t.$listeners=t.$options._parentListeners=n,ur(t,n,p),e&&t.$options.props){ke(!1);for(var f=t._props,d=t.$options._propKeys||[],h=0;h<d.length;h++){var m=d[h],g=t.$options.props;f[m]=eo(m,g,e,t)}ke(!0),t.$options.propsData=e}u&&(t.$slots=Dn(o,r.context),t.$forceUpdate()),"production"!==process.env.NODE_ENV&&(cr=!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,mr(r,"mounted")),t.data.keepAlive&&(n._isMounted?((e=r)._inactive=!1,vr.push(e)):dr(r,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?hr(e,!0):e.$destroy())}},Br=Object.keys($r);function Rr(t,e,n,r,o){if(!X(t)){var i=n.$options._base;if(nt(t)&&(t=i.extend(t)),"function"==typeof t){var s;if(X(t.cid)&&(t=function(t,e){if(Q(t.error)&&Z(t.errorComp))return t.errorComp;if(Z(t.resolved))return t.resolved;var n=Tn;if(n&&Z(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n),Q(t.loading)&&Z(t.loadingComp))return t.loadingComp;if(n&&!Z(t.owners)){var r=t.owners=[n],o=!0,i=null,s=null;n.$on("hook:destroyed",(function(){return ht(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=Ft((function(n){t.resolved=Fn(n,e),o?r.length=0:a(!0)})),l=Ft((function(e){"production"!==process.env.NODE_ENV&&zr("Failed to resolve async component: ".concat(String(t))+(e?"\nReason: ".concat(e):"")),Z(t.errorComp)&&(t.error=!0,a(!0))})),c=t(u,l);return nt(c)&&(ut(c)?X(t.resolved)&&c.then(u,l):ut(c.component)&&(c.component.then(u,l),Z(c.error)&&(t.errorComp=Fn(c.error,e)),Z(c.loading)&&(t.loadingComp=Fn(c.loading,e),0===c.delay?t.loading=!0:i=setTimeout((function(){i=null,X(t.resolved)&&X(t.error)&&(t.loading=!0,a(!1))}),c.delay||200)),Z(c.timeout)&&(s=setTimeout((function(){s=null,X(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=ue();return i.asyncFactory=t,i.asyncMeta={data:e,context:n,children:r,tag:o},i}(s,e,n,r,o);e=e||{},Oo(t),Z(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;Z(i)?(Y(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(!X(r)){var o={},i=t.attrs,s=t.props;if(Z(i)||Z(s))for(var a in r){var u=wt(a);if("production"!==process.env.NODE_ENV){var l=a.toLowerCase();a!==l&&i&&gt(i,l)&&Vr('Prop "'.concat(l,'" is passed to component ')+"".concat(jr(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,'".'))}en(o,s,a,u,!0)||en(o,i,a,u,!1)}return o}}(e,t,o);if(Q(t.options.functional))return function(t,e,n,r,o){var i=t.options,s={},a=i.props;if(Z(a))for(var u in a)s[u]=eo(u,a,e||G);else Z(n.attrs)&&Mr(s,n.attrs),Z(n.props)&&Mr(s,n.props);var l=new Tr(n,s,o,r,t),c=i.render.call(null,l._c,l);if(c instanceof ae)return Fr(c,n,l.parent,i,l);if(Y(c)){for(var p=nn(c)||[],f=new Array(p.length),d=0;d<p.length;d++)f[d]=Fr(p[d],n,l.parent,i,l);return f}}(t,a,e,n,r);var u=e.on;if(e.on=e.nativeOn,Q(t.options.abstract)){var l=e.slot;e={},l&&(e.slot=l)}!function(t){for(var e=t.hook||(t.hook={}),n=0;n<Br.length;n++){var r=Br[n],o=e[r],i=$r[r];o===i||o&&o._merged||(e[r]=o?Lr(i,o):i)}}(e);var c=Ir(t.options)||o;return new ae("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&&zr("Invalid Component definition: ".concat(String(t)),n)}}function Lr(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}var Pr,jr,zr=At,Vr=At;if("production"!==process.env.NODE_ENV){var Hr="undefined"!=typeof console,Wr=/(?:^|[-_])(\w)/g;zr=function(t,e){void 0===e&&(e=ie);var n=e?Pr(e):"";Rt.warnHandler?Rt.warnHandler.call(null,t,e,n):Hr&&!Rt.silent&&console.error("[Vue warn]: ".concat(t).concat(n))},Vr=function(t,e){Hr&&!Rt.silent&&console.warn("[Vue tip]: ".concat(t)+(e?Pr(e):""))},jr=function(t,e){if(t.$root===t)return"<Root>";var n=et(t)&&null!=t.cid?t.options:t._isVue?t.$options||t.constructor.options:t,r=Ir(n),o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<".concat(r.replace(Wr,(function(t){return t.toUpperCase()})).replace(/[-_]/g,""),">"):"<Anonymous>")+(o&&!1!==e?" at ".concat(o):"")};Pr=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(Y(t)?"".concat(jr(t[0]),"... (").concat(t[1]," recursive calls)"):jr(t))})).join("\n")}return"\n\n(found in ".concat(jr(t),")")}}var qr=Rt.optionMergeStrategies;function Ur(t,e,n){if(void 0===n&&(n=!0),!e)return t;for(var r,o,i,s=oe?Reflect.ownKeys(e):Object.keys(e),a=0;a<s.length;a++)"__ob__"!==(r=s[a])&&(o=t[r],i=e[r],n&&gt(t,r)?o!==i&&it(o)&&it(i)&&Ur(o,i):Se(t,r,i));return t}function Kr(t,e,n){return n?function(){var r=et(e)?e.call(n,n):e,o=et(t)?t.call(n,n):t;return r?Ur(r,o):o}:e?t?function(){return Ur(et(e)?e.call(this,this):e,et(t)?t.call(this,this):t)}:e:t}function Jr(t,e){var n=e?t?t.concat(e):Y(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 Gr(t,e,n,r){var o=Object.create(t||null);return e?("production"!==process.env.NODE_ENV&&Zr(r,e,n),Ct(o,e)):o}"production"!==process.env.NODE_ENV&&(qr.el=qr.propsData=function(t,e,n,r){return n||zr('option "'.concat(r,'" can only be used during instance ')+"creation with the `new` keyword."),Yr(t,e)}),qr.data=function(t,e,n){return n?Kr(t,e,n):e&&"function"!=typeof e?("production"!==process.env.NODE_ENV&&zr('The "data" option should be a function that returns a per-instance value in component definitions.',n),t):Kr(t,e)},Bt.forEach((function(t){qr[t]=Jr})),$t.forEach((function(t){qr[t+"s"]=Gr})),qr.watch=function(t,e,n,r){if(t===Xt&&(t=void 0),e===Xt&&(e=void 0),!e)return Object.create(t||null);if("production"!==process.env.NODE_ENV&&Zr(r,e,n),!t)return e;var o={};for(var i in Ct(o,t),e){var s=o[i],a=e[i];s&&!Y(s)&&(s=[s]),o[i]=s?s.concat(a):Y(a)?a:[a]}return o},qr.props=qr.methods=qr.inject=qr.computed=function(t,e,n,r){if(e&&"production"!==process.env.NODE_ENV&&Zr(r,e,n),!t)return e;var o=Object.create(null);return Ct(o,t),e&&Ct(o,e),o},qr.provide=function(t,e){return t?function(){var n=Object.create(null);return Ur(n,et(t)?t.call(this):t),e&&Ur(n,et(e)?e.call(this):e,!1),n}:e};var Yr=function(t,e){return void 0===e?t:e};function Xr(t){new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(Lt.source,"]*$")).test(t)||zr('Invalid component name: "'+t+'". Component names should conform to valid custom element name in html5 specification.'),(ft(t)||Rt.isReservedTag(t))&&zr("Do not use built-in or reserved HTML elements as component id: "+t)}function Zr(t,e,n){it(e)||zr('Invalid value for option "'.concat(t,'": expected an Object, ')+"but got ".concat(ot(e),"."),n)}function Qr(t,e,n){if("production"!==process.env.NODE_ENV&&function(t){for(var e in t.components)Xr(e)}(e),et(e)&&(e=e.options),function(t,e){var n=t.props;if(n){var r,o,i={};if(Y(n))for(r=n.length;r--;)"string"==typeof(o=n[r])?i[bt(o)]={type:null}:"production"!==process.env.NODE_ENV&&zr("props must be strings when using array syntax.");else if(it(n))for(var s in n)o=n[s],i[bt(s)]=it(o)?o:{type:o};else"production"!==process.env.NODE_ENV&&zr('Invalid value for option "props": expected an Array or an Object, '+"but got ".concat(ot(n),"."),e);t.props=i}}(e,n),function(t,e){var n=t.inject;if(n){var r=t.inject={};if(Y(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(it(n))for(var i in n){var s=n[i];r[i]=it(s)?Ct({from:i},s):{from:s}}else"production"!==process.env.NODE_ENV&&zr('Invalid value for option "inject": expected an Array or an Object, '+"but got ".concat(ot(n),"."),e)}}(e,n),function(t){var e=t.directives;if(e)for(var n in e){var r=e[n];et(r)&&(e[n]={bind:r,update:r})}}(e),!e._base&&(e.extends&&(t=Qr(t,e.extends,n)),e.mixins))for(var r=0,o=e.mixins.length;r<o;r++)t=Qr(t,e.mixins[r],n);var i,s={};for(i in t)a(i);for(i in e)gt(t,i)||a(i);function a(r){var o=qr[r]||Yr;s[r]=o(t[r],e[r],n,r)}return s}function to(t,e,n,r){if("string"==typeof n){var o=t[e];if(gt(o,n))return o[n];var i=bt(n);if(gt(o,i))return o[i];var s=_t(i);if(gt(o,s))return o[s];var a=o[n]||o[i]||o[s];return"production"!==process.env.NODE_ENV&&r&&!a&&zr("Failed to resolve "+e.slice(0,-1)+": "+n),a}}function eo(t,e,n,r){var o=e[t],i=!gt(n,t),s=n[t],a=ao(Boolean,o.type);if(a>-1)if(i&&!gt(o,"default"))s=!1;else if(""===s||s===wt(t)){var u=ao(String,o.type);(u<0||a<u)&&(s=!0)}if(void 0===s){s=function(t,e,n){if(!gt(e,"default"))return;var r=e.default;"production"!==process.env.NODE_ENV&&nt(r)&&zr('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 et(r)&&"Function"!==io(e.type)?r.call(t):r}(r,o,t);var l=we;ke(!0),xe(s),ke(l)}return"production"!==process.env.NODE_ENV&&function(t,e,n,r,o){if(t.required&&o)return void zr('Missing required prop: "'+e+'"',r);if(null==n&&!t.required)return;var i=t.type,s=!i||!0===i,a=[];if(i){Y(i)||(i=[i]);for(var u=0;u<i.length&&!s;u++){var l=ro(n,i[u],r);a.push(l.expectedType||""),s=l.valid}}var c=a.some((function(t){return t}));if(!s&&c)return void zr(function(t,e,n){var r='Invalid prop: type check failed for prop "'.concat(t,'".')+" Expected ".concat(n.map(_t).join(", ")),o=n[0],i=ot(e);1===n.length&&po(o)&&po(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(uo(e,o)));r+=", got ".concat(i," "),po(i)&&(r+="with value ".concat(uo(e,i),"."));return r}(e,n,a),r);var p=t.validator;p&&(p(n)||zr('Invalid prop: custom validator check failed for prop "'+e+'".',r))}(o,t,s,r,i),s}var no=/^(String|Number|Boolean|Function|Symbol|BigInt)$/;function ro(t,e,n){var r,o=io(e);if(no.test(o)){var i=typeof t;(r=i===o.toLowerCase())||"object"!==i||(r=t instanceof e)}else if("Object"===o)r=it(t);else if("Array"===o)r=Y(t);else try{r=t instanceof e}catch(t){zr('Invalid prop type: "'+String(e)+'" is not a constructor',n),r=!1}return{valid:r,expectedType:o}}var oo=/^\s*function (\w+)/;function io(t){var e=t&&t.toString().match(oo);return e?e[1]:""}function so(t,e){return io(t)===io(e)}function ao(t,e){if(!Y(e))return so(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(so(e[n],t))return n;return-1}function uo(t,e){return"String"===e?'"'.concat(t,'"'):"".concat("Number"===e?Number(t):t)}var lo,co=["string","number","boolean"];function po(t){return co.some((function(e){return t.toLowerCase()===e}))}if("production"!==process.env.NODE_ENV){var fo=pt("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"),ho=function(t,e){zr('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)},mo=function(t,e){zr('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)},go="undefined"!=typeof Proxy&&ne(Proxy);if(go){var vo=pt("stop,prevent,self,ctrl,shift,alt,meta,exact");Rt.keyCodes=new Proxy(Rt.keyCodes,{set:function(t,e,n){return vo(e)?(zr("Avoid overwriting built-in modifier in config.keyCodes: .".concat(e)),!1):(t[e]=n,!0)}})}var yo={has:function(t,e){var n=e in t,r=fo(e)||"string"==typeof e&&"_"===e.charAt(0)&&!(e in t.$data);return n||r||(e in t.$data?mo(t,e):ho(t,e)),n||!r}},bo={get:function(t,e){return"string"!=typeof e||e in t||(e in t.$data?mo(t,e):ho(t,e)),t[e]}};lo=function(t){if(go){var e=t.$options,n=e.render&&e.render._withStripped?bo:yo;t._renderProxy=new Proxy(t,n)}else t._renderProxy=t}}var _o={enumerable:!0,configurable:!0,get:At,set:At};function Do(t,e,n){_o.get=function(){return this[e][n]},_o.set=function(t){this[e][n]=t},Object.defineProperty(t,n,_o)}function wo(t){var e=t.$options;if(e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=Te({}),o=t.$options._propKeys=[],i=!t.$parent;i||ke(!1);var s=function(s){o.push(s);var a=eo(s,e,n,t);if("production"!==process.env.NODE_ENV){var u=wt(s);(dt(u)||Rt.isReservedAttr(u))&&zr('"'.concat(u,'" is a reserved attribute and cannot be used as component prop.'),t),Ae(r,s,a,(function(){i||cr||zr("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 Ae(r,s,a);s in t||Do(t,"_props",s)};for(var a in e)s(a);ke(!0)}(t,e.props),An(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]&&zr('Method "'.concat(r,'" has type "').concat(typeof e[r],'" in the component definition. ')+"Did you reference the function correctly?",t),n&&gt(n,r)&&zr('Method "'.concat(r,'" has already been defined as a prop.'),t),r in t&&Pt(r)&&zr('Method "'.concat(r,'" conflicts with an existing Vue instance method. ')+"Avoid defining component methods that start with _ or $.")),t[r]="function"!=typeof e[r]?At:kt(e[r],t)}(t,e.methods),e.data)!function(t){var e=t.$options.data;e=t._data=et(e)?function(t,e){ge();try{return t.call(e,e)}catch(t){return Bn(t,e,"data()"),{}}finally{ve()}}(e,t):e||{},it(e)||(e={},"production"!==process.env.NODE_ENV&&zr("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&&gt(o,s)&&zr('Method "'.concat(s,'" has already been defined as a data property.'),t),r&&gt(r,s)?"production"!==process.env.NODE_ENV&&zr('The data property "'.concat(s,'" is already declared as a prop. ')+"Use prop default value instead.",t):Pt(s)||Do(t,"_data",s)}var a=xe(e);a&&a.vmCount++}(t);else{var n=xe(t._data={});n&&n.vmCount++}e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=te();for(var o in e){var i=e[o],s=et(i)?i:i.get;"production"!==process.env.NODE_ENV&&null==s&&zr('Getter is missing for computed property "'.concat(o,'".'),t),r||(n[o]=new rr(t,s||At,At,ko)),o in t?"production"!==process.env.NODE_ENV&&(o in t.$data?zr('The computed property "'.concat(o,'" is already defined in data.'),t):t.$options.props&&o in t.$options.props?zr('The computed property "'.concat(o,'" is already defined as a prop.'),t):t.$options.methods&&o in t.$options.methods&&zr('The computed property "'.concat(o,'" is already defined as a method.'),t)):Eo(t,o,i)}}(t,e.computed),e.watch&&e.watch!==Xt&&function(t,e){for(var n in e){var r=e[n];if(Y(r))for(var o=0;o<r.length;o++)Ao(t,n,r[o]);else Ao(t,n,r)}}(t,e.watch)}var ko={lazy:!0};function Eo(t,e,n){var r=!te();et(n)?(_o.get=r?Co(e):xo(n),_o.set=At):(_o.get=n.get?r&&!1!==n.cache?Co(e):xo(n.get):At,_o.set=n.set||At),"production"!==process.env.NODE_ENV&&_o.set===At&&(_o.set=function(){zr('Computed property "'.concat(e,'" was assigned to but it has no setter.'),this)}),Object.defineProperty(t,e,_o)}function Co(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),he.target&&("production"!==process.env.NODE_ENV&&he.target.onTrack&&he.target.onTrack({effect:he.target,target:this,type:"get",key:t}),e.depend()),e.value}}function xo(t){return function(){return t.call(this,this)}}function Ao(t,e,n,r){return it(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var So=0;function Oo(t){var e=t.options;if(t.super){var n=Oo(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&&Ct(t.extendOptions,r),(e=t.options=Qr(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function No(t){"production"===process.env.NODE_ENV||this instanceof No||zr("Vue is a constructor and should be called with the `new` keyword"),this._init(t)}function To(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=Ir(t)||Ir(n.options);"production"!==process.env.NODE_ENV&&i&&Xr(i);var s=function(t){this._init(t)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=e++,s.options=Qr(n.options,t),s.super=n,s.options.props&&function(t){var e=t.options.props;for(var n in e)Do(t.prototype,"_props",n)}(s),s.options.computed&&function(t){var e=t.options.computed;for(var n in e)Eo(t.prototype,n,e[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,$t.forEach((function(t){s[t]=n[t]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=Ct({},s.options),o[r]=s,s}}function Fo(t){return t&&(Ir(t.Ctor.options)||t.tag)}function Mo(t,e){return Y(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!st(t)&&t.test(e)}function Io(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)&&$o(n,i,r,o)}}}function $o(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,ht(n,e)}!function(t){t.prototype._init=function(t){var e,n,r=this;r._uid=So++,"production"!==process.env.NODE_ENV&&Rt.performance&&Qn&&(e="vue-perf-start:".concat(r._uid),n="vue-perf-end:".concat(r._uid),Qn(e)),r._isVue=!0,r.__v_skip=!0,r._scope=new Ye(!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=Qr(Oo(r.constructor),t||{},r),"production"!==process.env.NODE_ENV?lo(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&&ur(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=Dn(e._renderChildren,r),t.$scopedSlots=n?En(t.$parent,n.data.scopedSlots,t.$slots):G,t._c=function(e,n,r,o){return In(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return In(t,e,n,r,o,!0)};var o=n&&n.data;"production"!==process.env.NODE_ENV?(Ae(t,"$attrs",o&&o.attrs||G,(function(){!cr&&zr("$attrs is readonly.",t)}),!0),Ae(t,"$listeners",e._parentListeners||G,(function(){!cr&&zr("$listeners is readonly.",t)}),!0)):(Ae(t,"$attrs",o&&o.attrs||G,null,!0),Ae(t,"$listeners",e._parentListeners||G,null,!0))}(r),mr(r,"beforeCreate",void 0,!1),function(t){var e=Nr(t.$options.inject,t);e&&(ke(!1),Object.keys(e).forEach((function(n){"production"!==process.env.NODE_ENV?Ae(t,n,e[n],(function(){zr("Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. "+'injection being mutated: "'.concat(n,'"'),t)})):Ae(t,n,e[n])})),ke(!0))}(r),wo(r),Or(r),mr(r,"created"),"production"!==process.env.NODE_ENV&&Rt.performance&&Qn&&(r._name=jr(r,!1),Qn(n),tr("vue ".concat(r._name," init"),e,n)),r.$options.el&&r.$mount(r.$options.el)}}(No),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};"production"!==process.env.NODE_ENV&&(e.set=function(){zr("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){zr("$props is readonly.",this)}),Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Se,t.prototype.$delete=Oe,t.prototype.$watch=function(t,e,n){var r=this;if(it(e))return Ao(r,t,e,n);(n=n||{}).user=!0;var o=new rr(r,t,e,n);if(n.immediate){var i='callback for immediate watcher "'.concat(o.expression,'"');ge(),Rn(e,r,[o.value],r,i),ve()}return function(){o.teardown()}}}(No),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Y(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(Y(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]&&Vr('Event "'.concat(n,'" is emitted in component ')+"".concat(jr(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(wt(t),'" instead of "').concat(t,'".'))}var r=e._events[t];if(r){r=r.length>1?Et(r):r;for(var o=Et(arguments,1),i='event handler for "'.concat(t,'"'),s=0,a=r.length;s<a;s++)Rn(r[s],e,o,e,i)}return e}}(No),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,o=n._vnode,i=pr(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){mr(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||ht(e.$children,t),t._scope.stop(),t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),mr(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(No),function(t){_n(t.prototype),t.prototype.$nextTick=function(t){return Gn(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,r=n.render,o=n._parentVnode;o&&e._isMounted&&(e.$scopedSlots=En(e.$parent,o.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&Nn(e._slotsProxy,e.$scopedSlots)),e.$vnode=o;try{se(e),Tn=e,t=r.call(e._renderProxy,e.$createElement)}catch(n){if(Bn(n,e,"render"),"production"!==process.env.NODE_ENV&&e.$options.renderError)try{t=e.$options.renderError.call(e._renderProxy,e.$createElement,n)}catch(n){Bn(n,e,"renderError"),t=e._vnode}else t=e._vnode}finally{Tn=null,se()}return Y(t)&&1===t.length&&(t=t[0]),t instanceof ae||("production"!==process.env.NODE_ENV&&Y(t)&&zr("Multiple root nodes returned from render function. Render function should return a single root node.",e),t=ue()),t.parent=o,t}}(No);var Bo=[String,RegExp,Array],Ro={name:"keep-alive",abstract:!0,props:{include:Bo,exclude:Bo,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:Fo(a),tag:i,componentInstance:s},n.push(o),this.max&&n.length>parseInt(this.max)&&$o(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)$o(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Io(t,(function(t){return Mo(e,t)}))})),this.$watch("exclude",(function(e){Io(t,(function(t){return!Mo(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Mn(t),n=e&&e.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 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,ht(a,u),a.push(u)):(this.vnodeToCache=e,this.keyToCache=u),e.data.keepAlive=!0}return e||t&&t[0]}},Lo={KeepAlive:Ro};!function(t){var e={get:function(){return Rt}};"production"!==process.env.NODE_ENV&&(e.set=function(){zr("Do not replace the Vue.config object, set individual fields instead.")}),Object.defineProperty(t,"config",e),t.util={warn:zr,extend:Ct,mergeOptions:Qr,defineReactive:Ae},t.set=Se,t.delete=Oe,t.nextTick=Gn,t.observable=function(t){return xe(t),t},t.options=Object.create(null),$t.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,Ct(t.options.components,Lo),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=Et(arguments,1);return n.unshift(this),et(t.install)?t.install.apply(t,n):et(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Qr(this.options,t),this}}(t),To(t),function(t){$t.forEach((function(e){t[e]=function(t,n){return n?("production"!==process.env.NODE_ENV&&"component"===e&&Xr(t),"component"===e&&it(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&et(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(No),Object.defineProperty(No.prototype,"$isServer",{get:te}),Object.defineProperty(No.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(No,"FunctionalRenderContext",{value:Tr}),No.version="2.7.14";var Po=pt("style,class"),jo=pt("input,textarea,option,select,progress"),zo=pt("contenteditable,draggable,spellcheck"),Vo=pt("events,caret,typing,plaintext-only"),Ho=pt("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"),Wo="http://www.w3.org/1999/xlink",qo=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Uo=function(t){return qo(t)?t.slice(6,t.length):""},Ko=function(t){return null==t||!1===t};function Jo(t){for(var e=t.data,n=t,r=t;Z(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Go(r.data,e));for(;Z(n=n.parent);)n&&n.data&&(e=Go(e,n.data));return function(t,e){if(Z(t)||Z(e))return Yo(t,Xo(e));return""}(e.staticClass,e.class)}function Go(t,e){return{staticClass:Yo(t.staticClass,e.staticClass),class:Z(t.class)?[t.class,e.class]:e.class}}function Yo(t,e){return t?e?t+" "+e:t:e||""}function Xo(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r<o;r++)Z(e=Xo(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):nt(t)?function(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}var Zo={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Qo=pt("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"),ti=pt("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),ei=function(t){return Qo(t)||ti(t)};var ni=Object.create(null);var ri=pt("text,number,password,search,email,tel,url");var oi=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(Zo[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,"")}}),ii={create:function(t,e){si(e)},update:function(t,e){t.data.ref!==e.data.ref&&(si(t,!0),si(e))},destroy:function(t){si(t,!0)}};function si(t,e){var n=t.data.ref;if(Z(n)){var r=t.context,o=t.componentInstance||t.elm,i=e?null:o,s=e?void 0:o;if(et(n))Rn(n,r,[i],r,"template ref function");else{var a=t.data.refInFor,u="string"==typeof n||"number"==typeof n,l=Re(n),c=r.$refs;if(u||l)if(a){var p=u?c[n]:n.value;e?Y(p)&&ht(p,o):Y(p)?p.includes(o)||p.push(o):u?(c[n]=[o],ai(r,n,c[n])):n.value=[o]}else if(u){if(e&&c[n]!==o)return;c[n]=s,ai(r,n,i)}else if(l){if(e&&n.value!==o)return;n.value=i}else"production"!==process.env.NODE_ENV&&zr("Invalid template ref type: ".concat(typeof n))}}}function ai(t,e,n){var r=t._setupState;r&&gt(r,e)&&(Re(r[e])?r[e].value=n:r[e]=n)}var ui=new ae("",{},[]),li=["create","activate","update","remove","destroy"];function ci(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&Z(t.data)===Z(e.data)&&function(t,e){if("input"!==t.tag)return!0;var n,r=Z(n=t.data)&&Z(n=n.attrs)&&n.type,o=Z(n=e.data)&&Z(n=n.attrs)&&n.type;return r===o||ri(r)&&ri(o)}(t,e)||Q(t.isAsyncPlaceholder)&&X(e.asyncFactory.error))}function pi(t,e,n){var r,o,i={};for(r=e;r<=n;++r)Z(o=t[r].key)&&(i[o]=r);return i}var fi={create:di,update:di,destroy:function(t){di(t,ui)}};function di(t,e){(t.data.directives||e.data.directives)&&function(t,e){var n,r,o,i=t===ui,s=e===ui,a=mi(t.data.directives,t.context),u=mi(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,vi(o,"update",e,t),o.def&&o.def.componentUpdated&&c.push(o)):(vi(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++)vi(l[n],"inserted",e,t)};i?tn(e,"insert",p):p()}c.length&&tn(e,"postpatch",(function(){for(var n=0;n<c.length;n++)vi(c[n],"componentUpdated",e,t)}));if(!i)for(n in a)u[n]||vi(a[n],"unbind",t,t,s)}(t,e)}var hi=Object.create(null);function mi(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=hi),o[gi(r)]=r,e._setupState&&e._setupState.__sfc){var i=r.def||to(e,"_setupState","v-"+r.name);r.def="function"==typeof i?{bind:i,update:i}:i}r.def=r.def||to(e.$options,"directives",r.name,!0)}return o}function gi(t){return t.rawName||"".concat(t.name,".").concat(Object.keys(t.modifiers||{}).join("."))}function vi(t,e,n,r,o){var i=t.def&&t.def[e];if(i)try{i(n.elm,t,n,r,o)}catch(r){Bn(r,n.context,"directive ".concat(t.name," ").concat(e," hook"))}}var yi=[ii,fi];function bi(t,e){var n=e.componentOptions;if(!(Z(n)&&!1===n.Ctor.options.inheritAttrs||X(t.data.attrs)&&X(e.data.attrs))){var r,o,i=e.elm,s=t.data.attrs||{},a=e.data.attrs||{};for(r in(Z(a.__ob__)||Q(a._v_attr_proxy))&&(a=e.data.attrs=Ct({},a)),a)o=a[r],s[r]!==o&&_i(i,r,o,e.data.pre);for(r in(qt||Kt)&&a.value!==s.value&&_i(i,"value",a.value),s)X(a[r])&&(qo(r)?i.removeAttributeNS(Wo,Uo(r)):zo(r)||i.removeAttribute(r))}}function _i(t,e,n,r){r||t.tagName.indexOf("-")>-1?Di(t,e,n):Ho(e)?Ko(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):zo(e)?t.setAttribute(e,function(t,e){return Ko(e)||"false"===e?"false":"contenteditable"===t&&Vo(e)?e:"true"}(e,n)):qo(e)?Ko(n)?t.removeAttributeNS(Wo,Uo(e)):t.setAttributeNS(Wo,e,n):Di(t,e,n)}function Di(t,e,n){if(Ko(n))t.removeAttribute(e);else{if(qt&&!Ut&&"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 wi={create:bi,update:bi};function ki(t,e){var n=e.elm,r=e.data,o=t.data;if(!(X(r.staticClass)&&X(r.class)&&(X(o)||X(o.staticClass)&&X(o.class)))){var i=Jo(e),s=n._transitionClasses;Z(s)&&(i=Yo(i,Xo(s))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}}var Ei,Ci={create:ki,update:ki},xi="__r",Ai="__c";function Si(t,e,n){var r=Ei;return function o(){var i=e.apply(null,arguments);null!==i&&Ti(t,o,n,r)}}var Oi=zn&&!(Yt&&Number(Yt[1])<=53);function Ni(t,e,n,r){if(Oi){var o=kr,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)}}Ei.addEventListener(t,e,Zt?{capture:n,passive:r}:n)}function Ti(t,e,n,r){(r||Ei).removeEventListener(t,e._wrapper||e,n)}function Fi(t,e){if(!X(t.data.on)||!X(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Ei=e.elm||t.elm,function(t){if(Z(t[xi])){var e=qt?"change":"input";t[e]=[].concat(t[xi],t[e]||[]),delete t[xi]}Z(t[Ai])&&(t.change=[].concat(t[Ai],t.change||[]),delete t[Ai])}(n),Qe(n,r,Ni,Ti,Si,e.context),Ei=void 0}}var Mi,Ii={create:Fi,update:Fi,destroy:function(t){return Fi(t,ui)}};function $i(t,e){if(!X(t.data.domProps)||!X(e.data.domProps)){var n,r,o=e.elm,i=t.data.domProps||{},s=e.data.domProps||{};for(n in(Z(s.__ob__)||Q(s._v_attr_proxy))&&(s=e.data.domProps=Ct({},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=X(r)?"":String(r);Bi(o,a)&&(o.value=a)}else if("innerHTML"===n&&ti(o.tagName)&&X(o.innerHTML)){(Mi=Mi||document.createElement("div")).innerHTML="<svg>".concat(r,"</svg>");for(var u=Mi.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 Bi(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(Z(r)){if(r.number)return ct(n)!==ct(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Ri={create:$i,update:$i},Li=vt((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 Pi(t){var e=ji(t.style);return t.staticStyle?Ct(t.staticStyle,e):e}function ji(t){return Array.isArray(t)?xt(t):"string"==typeof t?Li(t):t}var zi,Vi=/^--/,Hi=/\s*!important$/,Wi=function(t,e,n){if(Vi.test(e))t.style.setProperty(e,n);else if(Hi.test(n))t.style.setProperty(wt(e),n.replace(Hi,""),"important");else{var r=Ui(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}},qi=["Webkit","Moz","ms"],Ui=vt((function(t){if(zi=zi||document.createElement("div").style,"filter"!==(t=bt(t))&&t in zi)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<qi.length;n++){var r=qi[n]+e;if(r in zi)return r}}));function Ki(t,e){var n=e.data,r=t.data;if(!(X(n.staticStyle)&&X(n.style)&&X(r.staticStyle)&&X(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=Z(c.__ob__)?Ct({},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=Pi(o.data))&&Ct(r,n);(n=Pi(t.data))&&Ct(r,n);for(var i=t;i=i.parent;)i.data&&(n=Pi(i.data))&&Ct(r,n);return r}(e,!0);for(i in l)X(p[i])&&Wi(s,i,"");for(i in p)(o=p[i])!==l[i]&&Wi(s,i,null==o?"":o)}}var Ji={create:Ki,update:Ki},Gi=/\s+/;function Yi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Gi).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 Xi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Gi).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 Zi(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&Ct(e,Qi(t.name||"v")),Ct(e,t),e}return"string"==typeof t?Qi(t):void 0}}var Qi=vt((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")}})),ts=Ht&&!Ut,es="transition",ns="animation",rs="transition",is="transitionend",ss="animation",as="animationend";ts&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(rs="WebkitTransition",is="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ss="WebkitAnimation",as="webkitAnimationEnd"));var us=Ht?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function ls(t){us((function(){us(t)}))}function cs(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Yi(t,e))}function ps(t,e){t._transitionClasses&&ht(t._transitionClasses,e),Xi(t,e)}function fs(t,e,n){var r=hs(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a=o===es?is:as,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 ds=/\b(transform|all)(,|$)/;function hs(t,e){var n,r=window.getComputedStyle(t),o=(r[rs+"Delay"]||"").split(", "),i=(r[rs+"Duration"]||"").split(", "),s=ms(o,i),a=(r[ss+"Delay"]||"").split(", "),u=(r[ss+"Duration"]||"").split(", "),l=ms(a,u),c=0,p=0;return e===es?s>0&&(n=es,c=s,p=i.length):e===ns?l>0&&(n=ns,c=l,p=u.length):p=(n=(c=Math.max(s,l))>0?s>l?es:ns:null)?n===es?i.length:u.length:0,{type:n,timeout:c,propCount:p,hasTransform:n===es&&ds.test(r[rs+"Property"])}}function ms(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return gs(e)+gs(t[n])})))}function gs(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function vs(t,e){var n=t.elm;Z(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=Zi(t.data.transition);if(!X(r)&&!Z(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,d=r.enter,h=r.afterEnter,m=r.enterCancelled,g=r.beforeAppear,v=r.appear,y=r.afterAppear,b=r.appearCancelled,_=r.duration,D=lr,w=lr.$vnode;w&&w.parent;)D=w.context,w=w.parent;var k=!D._isMounted||!t.isRootInsert;if(!k||v||""===v){var E=k&&l?l:s,C=k&&p?p:u,x=k&&c?c:a,A=k&&g||f,S=k&&et(v)?v:d,O=k&&y||h,N=k&&b||m,T=ct(nt(_)?_.enter:_);"production"!==process.env.NODE_ENV&&null!=T&&bs(T,"enter",t);var F=!1!==o&&!Ut,M=Ds(S),I=n._enterCb=Ft((function(){F&&(ps(n,x),ps(n,C)),I.cancelled?(F&&ps(n,E),N&&N(n)):O&&O(n),n._enterCb=null}));t.data.show||tn(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(),S&&S(n,I)})),A&&A(n),F&&(cs(n,E),cs(n,C),ls((function(){ps(n,E),I.cancelled||(cs(n,x),M||(_s(T)?setTimeout(I,T):fs(n,i,I)))}))),t.data.show&&(e&&e(),S&&S(n,I)),F||M||I()}}}function ys(t,e){var n=t.elm;Z(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=Zi(t.data.transition);if(X(r)||1!==n.nodeType)return e();if(!Z(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,d=r.delayLeave,h=r.duration,m=!1!==o&&!Ut,g=Ds(c),v=ct(nt(h)?h.leave:h);"production"!==process.env.NODE_ENV&&Z(v)&&bs(v,"leave",t);var y=n._leaveCb=Ft((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),m&&(ps(n,a),ps(n,u)),y.cancelled?(m&&ps(n,s),f&&f(n)):(e(),p&&p(n)),n._leaveCb=null}));d?d(b):b()}function b(){y.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),l&&l(n),m&&(cs(n,s),cs(n,u),ls((function(){ps(n,s),y.cancelled||(cs(n,a),g||(_s(v)?setTimeout(y,v):fs(n,i,y)))}))),c&&c(n,y),m||g||y())}}function bs(t,e,n){"number"!=typeof t?zr("<transition> explicit ".concat(e," duration is not a valid number - ")+"got ".concat(JSON.stringify(t),"."),n.context):isNaN(t)&&zr("<transition> explicit ".concat(e," duration is NaN - ")+"the duration expression might be incorrect.",n.context)}function _s(t){return"number"==typeof t&&!isNaN(t)}function Ds(t){if(X(t))return!1;var e=t.fns;return Z(e)?Ds(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function ws(t,e){!0!==e.data.show&&vs(e)}var ks=function(t){var e,n,r={},o=t.modules,i=t.nodeOps;for(e=0;e<li.length;++e)for(r[li[e]]=[],n=0;n<o.length;++n)Z(o[n][li[e]])&&r[li[e]].push(o[n][li[e]]);function s(t){var e=i.parentNode(t);Z(e)&&i.removeChild(e,t)}function a(t,e){return!e&&!t.ns&&!(Rt.ignoredElements.length&&Rt.ignoredElements.some((function(e){return st(e)?e.test(t.tag):e===t.tag})))&&Rt.isUnknownElement(t.tag)}var u=0;function l(t,e,n,o,s,l,d){if(Z(t.elm)&&Z(l)&&(t=l[d]=ce(t)),t.isRootInsert=!s,!function(t,e,n,o){var i=t.data;if(Z(i)){var s=Z(t.componentInstance)&&i.keepAlive;if(Z(i=i.hook)&&Z(i=i.init)&&i(t,!1),Z(t.componentInstance))return c(t,e),p(n,t.elm,o),Q(s)&&function(t,e,n,o){var i,s=t;for(;s.componentInstance;)if(Z(i=(s=s.componentInstance._vnode).data)&&Z(i=i.transition)){for(i=0;i<r.activate.length;++i)r.activate[i](ui,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;Z(y)?("production"!==process.env.NODE_ENV&&(g&&g.pre&&u++,a(t,u)&&zr("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),Z(g)&&h(t,e),p(n,t.elm,o),"production"!==process.env.NODE_ENV&&g&&g.pre&&u--):Q(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){Z(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,d(t)?(h(t,e),m(t)):(si(t),e.push(t))}function p(t,e,n){Z(t)&&(Z(n)?i.parentNode(n)===t&&i.insertBefore(t,e,n):i.appendChild(t,e))}function f(t,e,n){if(Y(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 tt(t.text)&&i.appendChild(t.elm,i.createTextNode(String(t.text)))}function d(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return Z(t.tag)}function h(t,n){for(var o=0;o<r.create.length;++o)r.create[o](ui,t);Z(e=t.data.hook)&&(Z(e.create)&&e.create(ui,t),Z(e.insert)&&n.push(t))}function m(t){var e;if(Z(e=t.fnScopeId))i.setStyleScope(t.elm,e);else for(var n=t;n;)Z(e=n.context)&&Z(e=e.$options._scopeId)&&i.setStyleScope(t.elm,e),n=n.parent;Z(e=lr)&&e!==t.context&&e!==t.fnContext&&Z(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(Z(o))for(Z(e=o.hook)&&Z(e=e.destroy)&&e(t),e=0;e<r.destroy.length;++e)r.destroy[e](t);if(Z(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];Z(r)&&(Z(r.tag)?(b(r),v(r)):s(r.elm))}}function b(t,e){if(Z(e)||Z(t.data)){var n,o=r.remove.length+1;for(Z(e)?e.listeners+=o:e=function(t,e){function n(){0==--n.listeners&&s(t)}return n.listeners=e,n}(t.elm,o),Z(n=t.componentInstance)&&Z(n=n._vnode)&&Z(n.data)&&b(n,e),n=0;n<r.remove.length;++n)r.remove[n](t,e);Z(n=t.data.hook)&&Z(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;Z(o)&&(e[o]?zr("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(Z(i)&&ci(t,i))return o}}function w(t,e,n,o,s,a){if(t!==e){Z(e.elm)&&Z(o)&&(e=o[s]=ce(e));var u=e.elm=t.elm;if(Q(t.isAsyncPlaceholder))Z(e.asyncFactory.resolved)?x(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(Q(e.isStatic)&&Q(t.isStatic)&&e.key===t.key&&(Q(e.isCloned)||Q(e.isOnce)))e.componentInstance=t.componentInstance;else{var c,p=e.data;Z(p)&&Z(c=p.hook)&&Z(c=c.prepatch)&&c(t,e);var f=t.children,h=e.children;if(Z(p)&&d(e)){for(c=0;c<r.update.length;++c)r.update[c](t,e);Z(c=p.hook)&&Z(c=c.update)&&c(t,e)}X(e.text)?Z(f)&&Z(h)?f!==h&&function(t,e,n,r,o){var s,a,u,c=0,p=0,f=e.length-1,d=e[0],h=e[f],m=n.length-1,v=n[0],b=n[m],k=!o;for("production"!==process.env.NODE_ENV&&_(n);c<=f&&p<=m;)X(d)?d=e[++c]:X(h)?h=e[--f]:ci(d,v)?(w(d,v,r,n,p),d=e[++c],v=n[++p]):ci(h,b)?(w(h,b,r,n,m),h=e[--f],b=n[--m]):ci(d,b)?(w(d,b,r,n,m),k&&i.insertBefore(t,d.elm,i.nextSibling(h.elm)),d=e[++c],b=n[--m]):ci(h,v)?(w(h,v,r,n,p),k&&i.insertBefore(t,h.elm,d.elm),h=e[--f],v=n[++p]):(X(s)&&(s=pi(e,c,f)),X(a=Z(v.key)?s[v.key]:D(v,e,c,f))?l(v,r,t,d.elm,!1,n,p):ci(u=e[a],v)?(w(u,v,r,n,p),e[a]=void 0,k&&i.insertBefore(t,u.elm,d.elm)):l(v,r,t,d.elm,!1,n,p),v=n[++p]);c>f?g(t,X(n[m+1])?null:n[m+1].elm,n,p,m,r):p>m&&y(e,c,f)}(u,f,h,n,a):Z(h)?("production"!==process.env.NODE_ENV&&_(h),Z(t.text)&&i.setTextContent(u,""),g(u,null,h,0,h.length-1,n)):Z(f)?y(f,0,f.length-1):Z(t.text)&&i.setTextContent(u,""):t.text!==e.text&&i.setTextContent(u,e.text),Z(p)&&Z(c=p.hook)&&Z(c=c.postpatch)&&c(t,e)}}}function k(t,e,n){if(Q(n)&&Z(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}var E=!1,C=pt("attrs,class,staticClass,staticStyle,key");function x(t,e,n,r){var o,i=e.tag,s=e.data,u=e.children;if(r=r||s&&s.pre,e.elm=t,Q(e.isComment)&&Z(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if("production"!==process.env.NODE_ENV&&!function(t,e,n){return Z(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(Z(s)&&(Z(o=s.hook)&&Z(o=o.init)&&o(e,!0),Z(o=e.componentInstance)))return c(e,n),!0;if(Z(i)){if(Z(u))if(t.hasChildNodes())if(Z(o=s)&&Z(o=o.domProps)&&Z(o=o.innerHTML)){if(o!==t.innerHTML)return"production"===process.env.NODE_ENV||"undefined"==typeof console||E||(E=!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,d=0;d<u.length;d++){if(!p||!x(p,u[d],n,r)){l=!1;break}p=p.nextSibling}if(!l||p)return"production"===process.env.NODE_ENV||"undefined"==typeof console||E||(E=!0,console.warn("Parent: ",t),console.warn("Mismatching childNodes vs. VNodes: ",t.childNodes,u)),!1}else f(e,u,n);if(Z(s)){var m=!1;for(var g in s)if(!C(g)){m=!0,h(e,n);break}!m&&s.class&&Xn(s.class)}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,o){if(!X(e)){var s,a=!1,u=[];if(X(t))a=!0,l(e,u);else{var c=Z(t.nodeType);if(!c&&ci(t,e))w(t,e,u,null,null,o);else{if(c){if(1===t.nodeType&&t.hasAttribute(It)&&(t.removeAttribute(It),n=!0),Q(n)){if(x(t,e,u))return k(e,u,!0),t;"production"!==process.env.NODE_ENV&&zr("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 ae(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)),Z(e.parent))for(var h=e.parent,m=d(e);h;){for(var g=0;g<r.destroy.length;++g)r.destroy[g](h);if(h.elm=e.elm,m){for(var b=0;b<r.create.length;++b)r.create[b](ui,h);var _=h.data.hook.insert;if(_.merged)for(var D=1;D<_.fns.length;D++)_.fns[D]()}else si(h);h=h.parent}Z(f)?y([t],0,0):Z(t.tag)&&v(t)}}return k(e,u,a),e.elm}Z(t)&&v(t)}}({nodeOps:oi,modules:[wi,Ci,Ii,Ri,Ji,Ht?{create:ws,activate:ws,remove:function(t,e){!0!==t.data.show?ys(t,e):e()}}:{}].concat(yi)});Ut&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&Ts(t,"input")}));var Es={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?tn(n,"postpatch",(function(){Es.componentUpdated(t,e,n)})):Cs(t,e,n.context),t._vOptions=[].map.call(t.options,Ss)):("textarea"===n.tag||ri(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",Os),t.addEventListener("compositionend",Ns),t.addEventListener("change",Ns),Ut&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Cs(t,e,n.context);var r=t._vOptions,o=t._vOptions=[].map.call(t.options,Ss);if(o.some((function(t,e){return!Nt(t,r[e])})))(t.multiple?e.value.some((function(t){return As(t,o)})):e.value!==e.oldValue&&As(e.value,o))&&Ts(t,"change")}}};function Cs(t,e,n){xs(t,e,n),(qt||Kt)&&setTimeout((function(){xs(t,e,n)}),0)}function xs(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=Tt(r,Ss(s))>-1,s.selected!==i&&(s.selected=i);else if(Nt(Ss(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}else"production"!==process.env.NODE_ENV&&zr('<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 As(t,e){return e.every((function(e){return!Nt(e,t)}))}function Ss(t){return"_value"in t?t._value:t.value}function Os(t){t.target.composing=!0}function Ns(t){t.target.composing&&(t.target.composing=!1,Ts(t.target,"input"))}function Ts(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Fs(t){return!t.componentInstance||t.data&&t.data.transition?t:Fs(t.componentInstance._vnode)}var Ms={bind:function(t,e,n){var r=e.value,o=(n=Fs(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,vs(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=Fs(n)).data&&n.data.transition?(n.data.show=!0,r?vs(n,(function(){t.style.display=t.__vOriginalDisplay})):ys(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)}},Is={model:Es,show:Ms},$s={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 Bs(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Bs(Mn(e.children)):t}function Rs(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[bt(r)]=o[r];return e}function Ls(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Ps=function(t){return t.tag||kn(t)},js=function(t){return"show"===t.name},zs={name:"transition",props:$s,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Ps)).length){"production"!==process.env.NODE_ENV&&n.length>1&&zr("<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&&zr("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=Bs(o);if(!i)return o;if(this._leaving)return Ls(t,o);var s="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?s+"comment":s+i.tag:tt(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var a=(i.data||(i.data={})).transition=Rs(this),u=this._vnode,l=Bs(u);if(i.data.directives&&i.data.directives.some(js)&&(i.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,l)&&!kn(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var c=l.data.transition=Ct({},a);if("out-in"===r)return this._leaving=!0,tn(c,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Ls(t,o);if("in-out"===r){if(kn(i))return u;var p,f=function(){p()};tn(a,"afterEnter",f),tn(a,"enterCancelled",f),tn(c,"delayLeave",(function(t){p=t}))}}return o}}},Vs=Ct({tag:String,moveClass:String},$s);delete Vs.mode;var Hs={props:Vs,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=pr(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=Rs(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?Ir(u.Ctor.options)||u.tag||"":f.tag;zr("<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(Ws),t.forEach(qs),t.forEach(Us),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,r=n.style;cs(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(is,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(is,t),n._moveCb=null,ps(n,e))})}})))},methods:{hasMove:function(t,e){if(!ts)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){Xi(n,t)})),Yi(n,e),n.style.display="none",this.$el.appendChild(n);var r=hs(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Ws(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function qs(t){t.data.newPos=t.elm.getBoundingClientRect()}function Us(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 Ks={Transition:zs,TransitionGroup:Hs};function Js(t){this.content=t}function Gs(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=Gs(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function Ys(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=Ys(s.content,a.content,n-1,r-1);if(t)return t}n-=u,r-=u}else n-=u,r-=u}}No.config.mustUseProp=function(t,e,n){return"value"===n&&jo(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},No.config.isReservedTag=ei,No.config.isReservedAttr=Po,No.config.getTagNamespace=function(t){return ti(t)?"svg":"math"===t?"math":void 0},No.config.isUnknownElement=function(t){if(!Ht)return!0;if(ei(t))return!1;if(t=t.toLowerCase(),null!=ni[t])return ni[t];var e=document.createElement(t);return t.indexOf("-")>-1?ni[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ni[t]=/HTMLUnknownElement/.test(e.toString())},Ct(No.options.directives,Is),Ct(No.options.components,Ks),No.prototype.__patch__=Ht?ks:At,No.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=ue,"production"!==process.env.NODE_ENV&&(t.$options.template&&"#"!==t.$options.template.charAt(0)||t.$options.el||e?zr("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):zr("Failed to mount component: template or render function not defined.",t))),mr(t,"beforeMount"),r="production"!==process.env.NODE_ENV&&Rt.performance&&Qn?function(){var e=t._name,r=t._uid,o="vue-perf-start:".concat(r),i="vue-perf-end:".concat(r);Qn(o);var s=t._render();Qn(i),tr("vue ".concat(e," render"),o,i),Qn(o),t._update(s,n),Qn(i),tr("vue ".concat(e," patch"),o,i)}:function(){t._update(t._render(),n)};var o={before:function(){t._isMounted&&!t._isDestroyed&&mr(t,"beforeUpdate")}};"production"!==process.env.NODE_ENV&&(o.onTrack=function(e){return mr(t,"renderTracked",[e])},o.onTrigger=function(e){return mr(t,"renderTriggered",[e])}),new rr(t,r,At,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,mr(t,"mounted")),t}(this,t=t&&Ht?function(t){if("string"==typeof t){return document.querySelector(t)||("production"!==process.env.NODE_ENV&&zr("Cannot find element: "+t),document.createElement("div"))}return t}(t):void 0,e)},Ht&&setTimeout((function(){Rt.devtools&&(ee?ee.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!==Rt.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),Js.prototype={constructor:Js,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 Js(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 Js(n)},addToStart:function(t,e){return new Js([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Js(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 Js(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=Js.from(t)).size?new Js(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Js.from(t)).size?new Js(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Js.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}},Js.from=function(t){if(t instanceof Js)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Js(e)};class Xs{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 Xs(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 Xs(n,r)}cutByIndex(t,e){return t==e?Xs.empty:0==t&&e==this.content.length?this:new Xs(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 Xs(r,o)}addToStart(t){return new Xs([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Xs(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 Gs(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return Ys(this,t,e,n)}findIndex(t,e=-1){if(0==t)return Qs(0,t);if(t==this.size)return Qs(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?Qs(n+1,o):Qs(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 Xs.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Xs(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Xs.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 Xs(e||t,n)}static from(t){if(!t)return Xs.empty;if(t instanceof Xs)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Xs([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Xs.empty=new Xs([],0);const Zs={index:0,offset:0};function Qs(t,e){return Zs.index=t,Zs.offset=e,Zs}function ta(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(!ta(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!ta(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ea=class{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&&ta(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 ea.none;if(t instanceof ea)return[t];let e=t.slice();return e.sort(((t,e)=>t.type.rank-e.type.rank)),e}};ea.none=[];class na extends Error{}class ra{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=ia(this.content,t+this.openStart,e);return n&&new ra(n,this.openStart,this.openEnd)}removeBetween(t,e){return new ra(oa(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 ra.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 ra(Xs.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 ra(t,n,r)}}function oa(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(oa(i.content,e-o-1,n-o-1)))}function ia(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=ia(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function sa(t,e,n){if(n.openStart>t.depth)throw new na("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new na("Inconsistent open depths");return aa(t,e,n,0)}function aa(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=aa(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(Xs.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return fa(i,da(t,o,s,e,r))}{let r=t.parent,o=r.content;return fa(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return fa(i,ha(t,e,r))}function ua(t,e){if(!e.type.compatibleContent(t.type))throw new na("Cannot join "+e.type.name+" onto "+t.type.name)}function la(t,e,n){let r=t.node(n);return ua(r,e.node(n)),r}function ca(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 pa(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&&(ca(t.nodeAfter,r),i++));for(let t=i;t<s;t++)ca(o.child(t),r);e&&e.depth==n&&e.textOffset&&ca(e.nodeBefore,r)}function fa(t,e){if(!t.type.validContent(e))throw new na("Invalid content for node "+t.type.name);return t.copy(e)}function da(t,e,n,r,o){let i=t.depth>o&&la(t,e,o+1),s=r.depth>o&&la(n,r,o+1),a=[];return pa(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(ua(i,s),ca(fa(i,da(t,e,n,r,o+1)),a)):(i&&ca(fa(i,ha(t,e,o+1)),a),pa(e,n,o,a),s&&ca(fa(s,ha(n,r,o+1)),a)),pa(r,null,o,a),new Xs(a)}function ha(t,e,n){let r=[];if(pa(null,t,n,r),t.depth>n){ca(fa(la(t,e,n+1),ha(t,e,n+1)),r)}return pa(e,null,n,r),new Xs(r)}ra.empty=new ra(Xs.empty,0,0);class ma{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 ea.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 ba(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 ma(e,n,o)}static resolveCached(t,e){for(let n=0;n<ga.length;n++){let r=ga[n];if(r.pos==e&&r.doc==t)return r}let n=ga[va]=ma.resolve(t,e);return va=(va+1)%ya,n}}let ga=[],va=0,ya=12;class ba{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 _a=Object.create(null);let Da=class{constructor(t,e,n,r=ea.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||Xs.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&&ta(this.attrs,e||t.defaultAttrs||_a)&&ea.sameSet(this.marks,n||ea.none)}copy(t=null){return t==this.content?this:new Da(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Da(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 ra.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 ra(a,r.depth-i,o.depth-i)}replace(t,e,n){return sa(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 ma.resolveCached(this,t)}resolveNoCache(t){return ma.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()+")"),ka(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=Xs.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=ea.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!ea.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=Xs.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}};Da.prototype.text=void 0;class wa extends Da{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):ka(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 wa(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new wa(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 ka(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ea{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Ca(t,e);if(null==n.next)return Ea.empty;let r=xa(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(Fa(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]);Fa(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new Ea(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(Ta);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 Xs.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")}}Ea.empty=new Ea(!0);class Ca{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 xa(t){let e=[];do{e.push(Aa(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Aa(t){let e=[];do{e.push(Sa(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Sa(t){let e=function(t){if(t.eat("(")){let e=xa(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=Na(t,e)}return e}function Oa(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Na(t,e){let n=Oa(t),r=n;return t.eat(",")&&(r="}"!=t.next?Oa(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Ta(t,e){return e-t}function Fa(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(Ta)}function Ma(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 Ia(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 $a(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Ra(t[n]);return e}let Ba=class{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=$a(n.attrs),this.defaultAttrs=Ma(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==Ea.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:Ia(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Da(this,this.computeAttrs(t),Xs.from(e),ea.setFrom(n))}createChecked(t=null,e,n){if(e=Xs.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new Da(this,this.computeAttrs(t),e,ea.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=Xs.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(Xs.empty,!0);return o?new Da(this,t,e.append(o),ea.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:ea.none:t}static compile(t,e){let n=Object.create(null);t.forEach(((t,r)=>n[t]=new Ba(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 Ra{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class La{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=$a(r.attrs),this.excluded=null;let o=Ma(this.attrs);this.instance=o?new ea(this,o):null}create(t=null){return!t&&this.instance?this.instance:new ea(this,Ia(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new La(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 Pa{constructor(t){this.cached=Object.create(null),this.spec={nodes:Js.from(t.nodes),marks:Js.from(t.marks||{}),topNode:t.topNode},this.nodes=Ba.compile(this.spec.nodes,this),this.marks=La.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]=Ea.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?ja(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?[]:ja(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 Ba))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 wa(n,n.defaultAttrs,t,ea.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return Da.fromJSON(this,t)}markFromJSON(t){return ea.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function ja(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}let za=class{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 Ka(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Ka(this,e,!0);return n.addAll(t,e.from,e.to),ra.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(Ja(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=Ga(t)),t.mark=e}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=Ga(t)),t.node=e}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new za(t,za.schemaRules(t)))}};const Va={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},Ha={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wa={ol:!0,ul:!0};function qa(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Ua{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=ea.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(Xs.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=Xs.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(Xs.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):Ya(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&&!Va.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Ka{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=qa(null,e.preserveWhitespace,0)|(n?4:0);r=o?new Ua(o.type,o.attrs,ea.none,ea.none,!0,e.topMatch||o.type.contentMatch,i):new Ua(n?null:t.schema.topNodeType,null,ea.none,ea.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();Wa.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&&Wa.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:Ha.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(Va.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=ea.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=qa(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new Ua(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 Ja(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ga(t){let e={};for(let n in t)e[n]=t[n];return e}function Ya(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 Xa{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Qa(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}=Xa.renderSpec(Qa(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&&Xa.renderSpec(Qa(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}=Xa.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 Xa(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Za(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return Za(t.marks)}}function Za(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Qa(t){return t.document||window.document}const tu=Math.pow(2,16);function eu(t,e){return t+e*tu}function nu(t){return 65535&t}class ru{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 ou{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&ou.empty)return ou.empty}recover(t){let e=0,n=nu(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))/tu}(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:eu(s/3,t-a),p=t==a?2:t==c?1:4;return(e<0?t!=a:t!=c)&&(p|=8),new ru(o,p,i)}r+=l-u}return n?t+r:new ru(t+r,0,null)}touches(t,e){let n=0,r=nu(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 ou(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?ou.empty:new ou(t<0?[0,-t,0]:[0,0,t])}}ou.empty=new ou([]);class iu{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 iu(this.maps,this.mirror,t,e)}copy(){return new iu(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 iu;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 ru(t,r,null)}}const su=Object.create(null);class au{getMap(){return ou.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=su[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 su)throw new RangeError("Duplicate use of step JSON ID "+t);return su[t]=e,e.prototype.jsonID=t,e}}class uu{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new uu(t,null)}static fail(t){return new uu(null,t)}static fromReplace(t,e,n,r){try{return uu.ok(t.replace(e,n,r))}catch(t){if(t instanceof na)return uu.fail(t.message);throw t}}}function lu(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(lu(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return Xs.fromArray(r)}class cu extends au{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 ra(lu(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 uu.fromReplace(t,this.from,this.to,o)}invert(){return new pu(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 cu(e.pos,n.pos,this.mark)}merge(t){return t instanceof cu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new cu(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 cu(e.from,e.to,t.markFromJSON(e.mark))}}au.jsonID("addMark",cu);class pu extends au{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 ra(lu(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return uu.fromReplace(t,this.from,this.to,n)}invert(){return new cu(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 pu(e.pos,n.pos,this.mark)}merge(t){return t instanceof pu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new pu(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 pu(e.from,e.to,t.markFromJSON(e.mark))}}au.jsonID("removeMark",pu);class fu extends au{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return uu.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return uu.fromReplace(t,this.pos,this.pos+1,new ra(Xs.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new fu(this.pos,e.marks[n]);return new fu(this.pos,this.mark)}}return new du(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new fu(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new fu(e.pos,t.markFromJSON(e.mark))}}au.jsonID("addNodeMark",fu);class du extends au{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return uu.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return uu.fromReplace(t,this.pos,this.pos+1,new ra(Xs.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new fu(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new du(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new du(e.pos,t.markFromJSON(e.mark))}}au.jsonID("removeNodeMark",du);class hu extends au{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&gu(t,this.from,this.to)?uu.fail("Structure replace would overwrite content"):uu.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new ou([this.from,this.to-this.from,this.slice.size])}invert(t){return new hu(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 hu(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof hu)||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?ra.empty:new ra(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new hu(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?ra.empty:new ra(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new hu(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 hu(e.from,e.to,ra.fromJSON(t,e.slice),!!e.structure)}}au.jsonID("replace",hu);class mu extends au{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&&(gu(t,this.from,this.gapFrom)||gu(t,this.gapTo,this.to)))return uu.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return uu.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?uu.fromReplace(t,this.from,this.to,n):uu.fail("Content does not fit in gap")}getMap(){return new ou([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 mu(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 mu(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 mu(e.from,e.to,e.gapFrom,e.gapTo,ra.fromJSON(t,e.slice),e.insert,!!e.structure)}}function gu(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 vu(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function yu(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||!vu(r,o,i))break}return null}function bu(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(_u).concat({type:e,attrs:n}).concat(i.map(_u)):null}function _u(t){return{type:t,attrs:null}}function Du(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 wu(t,e){let n=t.resolve(e),r=n.index();return ku(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ku(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function Eu(t,e,n=-1){let r=t.resolve(e);for(let t=r.depth;;t--){let o,i,s=r.index(t);if(t==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(t+1),s++,i=r.node(t).maybeChild(s)):(o=r.node(t).maybeChild(s-1),i=r.node(t+1)),o&&!o.isTextblock&&ku(o,i)&&r.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function Cu(t,e,n=e,r=ra.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return xu(o,i,r)?new hu(e,n,r):new Au(o,i,r).fit()}function xu(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}au.jsonID("replaceAround",mu);class Au{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=Xs.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=Xs.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 ra(o,i,s);return t>-1?new mu(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new hu(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=Nu(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(Xs.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=Nu(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new ra(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=Nu(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new ra(Su(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new ra(Su(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(Tu(t.mark(p.allowedMarks(t.marks)),1==u?a:0,u==s.childCount?f:-1)))}let d=u==s.childCount;d||(f=-1),this.placed=Ou(this.placed,e,Xs.from(l)),this.frontier[e].match=c,d&&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=d?0==t?ra.empty:new ra(Su(i.content,t-1,1),t-1,f<0?i.openEnd:t-1):new ra(Su(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||!Fu(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=Fu(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=Fu(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=Ou(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=Ou(this.placed,this.depth,Xs.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Xs.empty,!0);t.childCount&&(this.placed=Ou(this.placed,this.frontier.length,t))}}function Su(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Su(t.firstChild.content,e-1,n)))}function Ou(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ou(t.lastChild.content,e-1,n)))}function Nu(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Tu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Tu(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(Xs.empty,!0)))),t.copy(r)}function Fu(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 Mu(t){return t.spec.defining||t.spec.definingForContent}function Iu(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Iu(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(Xs.empty,!0))}return t}function $u(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}class Bu extends au{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return uu.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return uu.fromReplace(t,this.pos,this.pos+1,new ra(Xs.from(r),0,e.isLeaf?0:1))}getMap(){return ou.empty}invert(t){return new Bu(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 Bu(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bu(e.pos,e.attr,e.value)}}au.jsonID("attr",Bu);let Ru=class extends Error{};Ru=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Ru.prototype=Object.create(Error.prototype)).constructor=Ru,Ru.prototype.name="TransformError";class Lu{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new iu}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ru(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=ra.empty){let r=Cu(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new ra(Xs.from(n),0,0))}delete(t,e){return this.replace(t,e,ra.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(xu(o,i,r))return t.step(new hu(e,n,r));let s=$u(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=Mu(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),d=o.index(l-1);if(f.canReplaceWith(d,d,p.type,p.marks))return t.replace(o.before(l),c?i.after(l):n,new ra(Iu(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 ra(Xs.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=$u(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=Xs.empty,p=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,c=Xs.from(r.node(t).copy(c)),p++):u--;let f=Xs.empty,d=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,f=Xs.from(o.node(t).copy(f)),d++):l++;t.step(new mu(u,l,s,a,new ra(c.append(f),p,d),c.size-p,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new hu(e-n,e+n,ra.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=Xs.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=Xs.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new mu(o,i,o,i,new ra(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 mu(a,u,a+1,u-1,new ra(Xs.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 mu(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new ra(Xs.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new Bu(t,e,n)),this}addNodeMark(t,e){return this.step(new fu(t,e)),this}removeNodeMark(t,e){if(!(e instanceof ea)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new du(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=Xs.empty,s=Xs.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=Xs.from(o.node(t).copy(i));let e=r&&r[a];s=Xs.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new hu(e,e,new ra(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 pu(l,p,c[t])));i&&i.to==l?i.to=p:a.push(i=new cu(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 La){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 pu(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 pu(s,u,a.marks[e]))}else i.push(new hu(s,u,ra.empty));s=u}if(!r.validEnd){let e=r.fillBefore(Xs.empty,!0);t.replace(s,s,new ra(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}const Pu=Object.create(null);class ju{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new zu(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=ra.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?ra.empty:e),0==s&&Xu(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),Xu(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Wu(t):Yu(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?Yu(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):Yu(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 Ju(t.node(0))}static atStart(t){return Yu(t,t,0,0,1)||new Ju(t)}static atEnd(t){return Yu(t,t,t.content.size,t.childCount,-1)||new Ju(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Pu[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 Pu)throw new RangeError("Duplicate use of selection JSON ID "+t);return Pu[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Wu.between(this.$anchor,this.$head).getBookmark()}}ju.prototype.visible=!0;class zu{constructor(t,e){this.$from=t,this.$to=e}}let Vu=!1;function Hu(t){Vu||t.parent.inlineContent||(Vu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Wu extends ju{constructor(t,e=t){Hu(t),Hu(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 ju.near(n);let r=t.resolve(e.map(this.anchor));return new Wu(r.parent.inlineContent?r:n,n)}replace(t,e=ra.empty){if(super.replace(t,e),e==ra.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Wu&&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 Wu(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=ju.findFrom(e,n,!0)||ju.findFrom(e,-n,!0);if(!t)return ju.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(ju.findFrom(t,-n,!0)||ju.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new Wu(t,e)}}ju.jsonID("text",Wu);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 Wu.between(t.resolve(this.anchor),t.resolve(this.head))}}class Uu extends ju{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?ju.near(o):new Uu(o)}content(){return new ra(Xs.from(this.node),0,0)}eq(t){return t instanceof Uu&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ku(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Uu(t.resolve(e.anchor))}static create(t,e){return new Uu(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Uu.prototype.visible=!1,ju.jsonID("node",Uu);class Ku{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new qu(n,n):new Ku(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Uu.isSelectable(n)?new Uu(e):ju.near(e)}}class Ju extends ju{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=ra.empty){if(e==ra.empty){t.delete(0,t.doc.content.size);let e=ju.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ju(t)}map(t){return new Ju(t)}eq(t){return t instanceof Ju}getBookmark(){return Gu}}ju.jsonID("all",Ju);const Gu={map(){return this},resolve:t=>new Ju(t)};function Yu(t,e,n,r,o,i=!1){if(e.inlineContent)return Wu.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&&Uu.isSelectable(r))return Uu.create(t,n-(o<0?r.nodeSize:0))}else{let e=Yu(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function Xu(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof hu||i instanceof mu)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(ju.near(t.doc.resolve(o),n)))}function Zu(t,e){return e&&t?t.bind(e):t}class Qu{constructor(t,e,n){this.name=t,this.init=Zu(e.init,n),this.apply=Zu(e.apply,n)}}function tl(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=tl(o,e,{})),n[r]=o}return n}new Qu("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Qu("selection",{init:(t,e)=>t.selection||ju.atStart(e.doc),apply:t=>t.selection}),new Qu("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new Qu("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e});class el{constructor(t){this.spec=t,this.props={},t.props&&tl(t.props,this,this.props),this.key=t.key?t.key.key:rl("plugin")}getState(t){return t[this.key]}}const nl=Object.create(null);function rl(t){return t in nl?t+"$"+ ++nl[t]:(nl[t]=0,t+"$")}class ol{constructor(t="key"){this.key=rl(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const il=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},sl=function(t,e,n,r){return n&&(ul(t,e,n,r,-1)||ul(t,e,n,r,1))},al=/^(img|br|input|textarea|hr)$/i;function ul(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:ll(t))){let n=t.parentNode;if(!n||1!=n.nodeType||cl(t)||al.test(t.nodeName)||"false"==t.contentEditable)return!1;e=il(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?ll(t):0}}}function ll(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function cl(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 pl=function(t){return t.focusNode&&sl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function fl(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const dl="undefined"!=typeof navigator?navigator:null,hl="undefined"!=typeof document?document:null,ml=dl&&dl.userAgent||"",gl=/Edge\/(\d+)/.exec(ml),vl=/MSIE \d/.exec(ml),yl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ml),bl=!!(vl||yl||gl),_l=vl?document.documentMode:yl?+yl[1]:gl?+gl[1]:0,Dl=!bl&&/gecko\/(\d+)/i.test(ml);Dl&&(/Firefox\/(\d+)/.exec(ml)||[0,0])[1];const wl=!bl&&/Chrome\/(\d+)/.exec(ml),kl=!!wl,El=wl?+wl[1]:0,Cl=!bl&&!!dl&&/Apple Computer/.test(dl.vendor),xl=Cl&&(/Mobile\/\w+/.test(ml)||!!dl&&dl.maxTouchPoints>2),Al=xl||!!dl&&/Mac/.test(dl.platform),Sl=/Android \d/.test(ml),Ol=!!hl&&"webkitFontSmoothing"in hl.documentElement.style,Nl=Ol?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Tl(t,e=null){let n=t.domSelectionRange(),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(pl(n)){for(a=l;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Uu.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==ll(t);r||o;){if(t==n)return!0;let e=il(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==ll(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;u=new Uu(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.domSelectionRange();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 Uu){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&&kl){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&sl(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}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,il(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&bl&&_l<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!Il||n instanceof Wu||(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.domSelectionRange(),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=Cl||kl&&El<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(Cl&&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",Cl&&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)))||Wu.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&&ju.findFrom(i,e)}function zl(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Vl(t,e,n){let r=t.state.selection;if(!(r instanceof Wu)){if(r instanceof Uu&&r.node.isInline)return zl(t,new Wu(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 Uu)&&zl(t,n)}if(!(Al&&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)&&(Uu.isSelectable(i)?zl(t,new Uu(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Ol&&zl(t,new Wu(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Hl(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 ql(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(Dl&&1==n.nodeType&&r<Hl(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=il(e),e=e.previousSibling;if(e)n=e,r=Hl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Jl(t,n,r):o&&Jl(t,o,i)}function Ul(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Hl(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=il(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=Hl(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&Jl(t,o,i)}function Kl(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Jl(t,e,n){let r=t.domSelection();if(pl(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,n);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 Wu&&!r.empty||n.indexOf("s")>-1)return!1;if(Al&&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 Uu)return zl(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Ju?ju.near(n,e):ju.findFrom(n,e);return!!s&&zl(t,s)}return!1}function Yl(t,e){if(!(t.state.selection instanceof Wu))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 Zl(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||Al&&72==n&&"c"==r?Yl(t,-1)||ql(t):46==n||Al&&68==n&&"c"==r?Yl(t,1)||Ul(t):13==n||27==n||(37==n||Al&&66==n&&"c"==r?Vl(t,-1,r)||ql(t):39==n||Al&&70==n&&"c"==r?Vl(t,1,r)||Ul(t):38==n||Al&&80==n&&"c"==r?Gl(t,-1,r)||ql(t):40==n||Al&&78==n&&"c"==r?function(t){if(!Cl||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();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)||Ul(t):r==(Al?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ql(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));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")||Xa.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",(n=>n(e,t)))||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",(n=>{e=n(e,a||r,t)})),a)return e?new ra(Xs.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):ra.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,o,r,t)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=Xa.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",(e=>{n=e(n,t)})),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),Ol&&function(t){let e=t.querySelectorAll(kl?"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;t--){let t=i.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||za.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=Xs.from(e.create(n[t+1],o)),i++,s++}return new ra(o,i,s)}(sc(s,+c[1],+c[2]),c[4]);else if(s=ra.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 Xs.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",(e=>{s=e(s,t)})),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,Xs.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(Xs.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(Xs.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(Xs.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function sc(t,e,n){return e<t.openStart&&(t=new ra(ic(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ra(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={},pc={};function fc(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function dc(t){return{left:t.clientX,top:t.clientY}}function hc(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 hc(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 Uu&&(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(Uu.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,Uu.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&&Uu.isSelectable(r))&&(mc(t,new Uu(n),"pointer"),!0)}(t,n))}function vc(t,e,n,r){return hc(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function yc(t,e,n,r){return hc(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,Wu.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,Wu.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Uu.isSelectable(n))continue;mc(t,Uu.create(r,i),"pointer")}return!0}}(t,n,r)}function bc(t){return xc(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(),!Sl||!kl||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!xl||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Zl(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,fl(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||Al&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Wu&&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=Al?"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(dc(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 Uu&&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(dc(t))),this.updateAllowDefault(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||Cl&&this.mightDrag&&!this.mightDrag.node.isAtom||kl&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(mc(this.view,ju.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):fc(this.view,"pointer")}move(t){this.updateAllowDefault(t),fc(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function wc(t,e){return!!t.composing||!!(Cl&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}cc.touchstart=t=>{t.input.lastTouch=Date.now(),bc(t),fc(t,"pointer")},cc.touchmove=t=>{t.input.lastTouch=Date.now(),fc(t,"pointer")},cc.contextmenu=t=>bc(t);const kc=Sl?5e3:-1;function Ec(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>xc(t)),e))}function Cc(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 xc(t,e=!1){if(!(Sl&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Cc(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(),xc(t,!0),t.markCursor=null;else if(xc(t),Dl&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}Ec(t,kc)},pc.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,Ec(t,20))};const Ac=bl&&_l<15||xl&&Nl<604;function Sc(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||ra.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=Ac?null:n.clipboardData,s=r.content(),{dom:a,text:u}=Ql(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&&!Sl)return;let r=Ac?null:n.clipboardData;r&&Sc(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?Sc(t,r.value,null,e):Sc(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class Oc{constructor(t,e){this.slice=t,this.move=e}}const Nc=Al?"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(dc(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Uu?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Uu.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(Uu.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:u}=Ql(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Ac?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ac||n.dataTransfer.setData("text/plain",u),t.dragging=new Oc(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(dc(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=tc(t,n.dataTransfer.getData(Ac?"Text":"text/plain"),Ac?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Nc]);if(t.someProp("handleDrop",(e=>e(t,n,s||ra.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 d=l.doc.resolve(c);if(p&&Uu.isSelectable(s.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Uu(d));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,d,l.doc.resolve(e)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))},cc.focus=t=>{t.input.lastFocus=Date.now(),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.domSelectionRange())&&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(kl&&Sl&&"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,fl(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();for(let t=0,e=i;t<n.maps.length;t++){let r=0;n.maps[t].forEach(((t,n,i,s)=>{let u=s-i-(n-t);for(let s=0;s<a.length;s+=3){let l=a[s+1];if(l<0||t>l+e-r)continue;let c=a[s]+e-r;n>=c?a[s+1]=t<=c?-2:-1:i>=o&&u&&(a[s]+=u,a[s+1]+=u)}r+=u})),e=n.maps[t].map(e,-1)}let u=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){u=!0,a[e+1]=-1;continue}let l=n.map(t[e]+i),c=l-o;if(c<0||c>=r.content.size){u=!0;continue}let p=n.map(t[e+1]+i,-1)-o,{index:f,offset:d}=r.content.findIndex(c),h=r.maybeChild(f);if(h&&d==c&&d+h.nodeSize==p){let r=a[e+2].mapInner(n,h,l+1,t[e]+i+1,s);r!=Pc?(a[e]=c,a[e+1]=p,a[e+2]=r):(a[e+1]=-2,u=!0)}else u=!0}if(u){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(qc),a)}(this.children,i||[],t,e,n,r,o):i?new Lc(i.sort(qc),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=Vc(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?Hc(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(qc):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(qc),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 Uc(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=Uc;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?Uc(n?e:e.sort(qc)):Bc}static from(t){switch(t.length){case 0:return Pc;case 1:return t[0];default:return new jc(t.every((t=>t instanceof Lc))?t:t.reduce(((t,e)=>t.concat(e instanceof Lc?e:e.members)),[]))}}}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 Vc(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 Hc(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=Vc(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?Hc(t):t,-n).sort(qc);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 qc(t,e){return t.from-e.from||t.to-e.to}function Uc(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&&qc(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),Zc="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Qc="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&&(Qc||+Yc[1]<57)||Zc&&Qc,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&&!wu(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=Xs.empty;for(let t=r.length-1;t>=0;t--)a=Xs.from(r[t].create(null,a));a=Xs.from(i.copy(a));let u=t.tr.step(new mu(e.pos-1,o,e.pos,o,new ra(a,1,0),r.length,!0)),l=o+2*r.length;wu(u.doc,l)&&u.join(l),n(u.scrollIntoView())}return!0}let u=ju.findFrom(e,1),l=u&&u.$from.blockRange(u.$to),c=l&&yu(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=Xs.empty;for(let t=o.length-1;t>=0;t--)r=Xs.from(o[t].copy(r));n(t.tr.step(new mu(e.pos-o.length,e.pos+s.nodeSize,e.pos+u,e.pos+s.nodeSize-u,new ra(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function dp(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(Wu.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const hp=dp(-1),mp=dp(1);function gp(t,e=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,t,e)}r(o.scrollIntoView())}return!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 ba(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new ba(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let l=bu(u,t,e,s);return!!l&&(r&&r(function(t,e,n,r,o){let i=Xs.empty;for(let t=n.length-1;t>=0;t--)i=Xs.from(n[t].type.create(n[t].attrs,i));t.step(new mu(e.start-(r?2:0),e.end,e.start,e.end,new ra(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&&Du(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 mu(i-1,s,i,s,new ra(Xs.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ba(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=yu(r);if(null==a)return!1;o.lift(r,a);let u=o.mapping.map(i,-1)-1;wu(o.doc,u)&&o.join(u);return e(o.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?Xs.empty:Xs.from(o))))return!1;let p=i.pos,f=p+s.nodeSize;return r.step(new mu(p-(a?1:0),f+(u?1:0),p+1,f-1,new ra((a?Xs.empty:Xs.from(o.copy(Xs.empty))).append(u?Xs.empty:Xs.from(o.copy(Xs.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 kp(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};(null==r?void 0:r.isRequired)&&void 0===(null==r?void 0:r.default)&&delete o.default,e.push({type:t.name,name:n,attribute:o})}))})),e}function Ep(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 Cp(...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 xp(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)=>Cp(t,e)),{})}function Ap(t,e,...n){return function(t){return"function"==typeof t}(t)?e?t.bind(e)(...n):t(...n):t}function Sp(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 Op(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=kp(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=Op({...t.reduce(((t,n)=>{const r=Dp(n,"extendNodeSchema",o);return{...t,...r?r(e):{}}}),{}),content:Ap(Dp(e,"content",o)),marks:Ap(Dp(e,"marks",o)),group:Ap(Dp(e,"group",o)),inline:Ap(Dp(e,"inline",o)),atom:Ap(Dp(e,"atom",o)),selectable:Ap(Dp(e,"selectable",o)),draggable:Ap(Dp(e,"draggable",o)),code:Ap(Dp(e,"code",o)),defining:Ap(Dp(e,"defining",o)),isolating:Ap(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=Ap(Dp(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>Sp(t,r))));const a=Dp(e,"renderHTML",o);a&&(i.toDOM=t=>a({node:t,HTMLAttributes:xp(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=Op({...t.reduce(((t,n)=>{const r=Dp(n,"extendMarkSchema",o);return{...t,...r?r(e):{}}}),{}),inclusive:Ap(Dp(e,"inclusive",o)),excludes:Ap(Dp(e,"excludes",o)),group:Ap(Dp(e,"group",o)),spanning:Ap(Dp(e,"spanning",o)),code:Ap(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=Ap(Dp(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>Sp(t,r))));const a=Dp(e,"renderHTML",o);return a&&(i.toDOM=t=>a({mark:t,HTMLAttributes:xp(t,r)})),[e.name,i]})));return new Pa({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="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,((t,e,o,i)=>{var s,a;const u=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:e,parent:o,index:i}))||t.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-e))})),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:d,chain:h,can:m}=new _p({editor:n,state:l});null!==t.handler({state:l,range:f,match:e,commands:d,chain:h,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 el({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 el({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,d=bp({state:s,transaction:f});return Lp({editor:e,state:d,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=Ap(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=()=>gf.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 el({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 kp(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:Ep(e.name,this.schema)},o=Dp(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const u=xp(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 Vp(t,e){const n={...t};return zp(t)&&zp(e)&&Object.keys(e).forEach((r=>{zp(e[r])?r in t?n[r]=Vp(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class Hp{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=Ap(Dp(this,"addOptions",{name:this.name}))),this.storage=Ap(Dp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Hp(t)}configure(t={}){const e=this.extend();return e.options=Vp(this.options,t),e.storage=Ap(Dp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Hp(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=Ap(Dp(e,"addOptions",{name:e.name})),e.storage=Ap(Dp(e,"addStorage",{name:e.name,options:e.options})),e}}Hp.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new el({key:new ol("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 qp(t,e,n={}){return t.find((t=>t.type===e&&Wp(t.attrs,n)))}function Up(t,e,n={}){return!!qp(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=qp([...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(qp([...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&&Up([...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){return t instanceof Wu}function Yp(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Xp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Zp(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)?Xs.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=za.fromSchema(e);return n.slice?r.parseSlice(Zp(t),n.parseOptions).content:r.parse(Zp(t),n.parseOptions)}return Qp("",e,n)}function tf(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function ef(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?Ep(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 nf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function rf(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 of(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 sf(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 af(t,e){const n=nf("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=Ep(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?sf(t,e):{}}function uf(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 lf(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}function cf(t,e){const{nodeExtensions:n}=wp(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=Ap(Dp(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function pf(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 ff(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)}}const df=(t,e)=>{const n=of((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)||!wu(t.doc,n.pos)||(t.join(n.pos),!0)},hf=(t,e)=>{const n=of((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)||!wu(t.doc,r)||(t.join(r),!0)};var mf=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=yu(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 Ju||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(Wu.create(s.doc,n+1)),e(s.scrollIntoView())}return!0})(t,e),deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let n=o.depth;n>0;n-=1){if(o.node(n).type===r.type){if(e){const e=o.before(n),r=o.after(n);t.delete(e,r).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=Ep(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(ju.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=Wu.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=()=>{Xp()&&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&&!Gp(n.state.selection))return s(),!0;const a=function(t,e=null){if(!e)return null;const n=ju.atStart(t),r=ju.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?Wu.create(t,Yp(0,o,i),Yp(t.content.size,o,i)):Wu.create(t,Yp(e,o,i),Yp(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 hu||o instanceof mu))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(ju.near(t.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinUp:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection,o=r instanceof Uu;if(o){if(r.node.isTextblock||!wu(t.doc,r.from))return!1;n=r.from}else if(n=Eu(t.doc,r.from,-1),null==n)return!1;if(e){let r=t.tr.join(n);o&&r.setSelection(Uu.create(r.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0})(t,e),joinDown:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection;if(r instanceof Uu){if(r.node.isTextblock||!wu(t.doc,r.to))return!1;n=r.to}else if(n=Eu(t.doc,r.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(t,e),joinBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let o=lp(r);if(!o){let n=r.blockRange(),o=n&&yu(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")||Uu.isSelectable(i))){let n=Cu(t.doc,r.before(),r.after(),ra.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(up(i,"end")?ju.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Uu.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 r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}(t,n);if(!r)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")||Uu.isSelectable(i))){let n=Cu(t.doc,r.before(),r.after(),ra.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(up(i,"start")?ju.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Uu.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}`);Xp()||tf()?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})=>!!ef(n,Ep(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&yu(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(Du(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&yu(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)})(t,e),liftListItem:t=>({state:e,dispatch:n})=>yp(Ep(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=nf("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=Ep(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,rf(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(rf(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||!Uu.isSelectable(s)||(e&&e(t.tr.setSelection(Uu.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||!Uu.isSelectable(s)||(e&&e(t.tr.setSelection(Uu.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(Uu.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>mp(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>hp(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=sf(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 function(t,e,n){var r;const{selection:o}=e;let i=null;if(Gp(o)&&(i=o.$cursor),i){const e=null!==(r=t.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:s}=o;return s.some((({$from:e,$to:r})=>{let o=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,r.pos,((t,e,r)=>{if(o)return!1;if(t.isInline){const e=!r||r.type.allowsMarkType(n),i=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));o=e&&i}return!o})),o}))}(r,n,u)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=Ep(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=Yp(t,0,n.content.size),o=Uu.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=Wu.atStart(n).from,s=Wu.atEnd(n).to,a=Yp(r,i,s),u=Yp(o,i,s),l=Wu.create(n,a,u);e.setSelection(l)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=Ep(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=Xs.from(n?o.create():null),s=new ra(Xs.from(o.create(null,Xs.from(a.type.create(null,r)))),n?3:1,0),l=i.start,c=i.end;e(t.tr.step(new mu(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=pf(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Uu&&i.node.isBlock)return!(!a.parentOffset||!Du(s,a.pos))&&(r&&(t&&ff(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 Wu&&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=Du(e.doc,e.mapping.map(a.pos),1,c);if(c||p||!Du(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&&ff(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=Ep(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=Xs.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=Xs.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=pf(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(Xs.from(s.createAndFill(null,u)||void 0));const l=a.before(a.depth-(n-1));e.replace(l,a.after(-r),new ra(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(Wu.near(e.doc.resolve(c))),e.scrollIntoView()}return!0}const f=u.pos===a.end()?c.contentMatchAt(0).defaultType:null,d=pf(p,c.type.name,c.attrs),h=pf(p,a.node().type.name,a.node().attrs);e.delete(a.pos,u.pos);const m=f?[{type:s,attrs:d},{type:f,attrs:h}]:[{type:s,attrs:d}];return!!Du(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=Ep(t,o.schema),p=Ep(e,o.schema),{selection:f}=o,{$from:d,$to:h}=f,m=d.blockRange(h);if(!m)return!1;const g=of((t=>cf(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(cf(g.node.type.name,l)&&c.validContent(g.node.content)&&i)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>df(r,c))).command((()=>hf(r,c))).run()}return s().command((()=>!!u().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>df(r,c))).command((()=>hf(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=Ep(t,r.schema),s=Ep(e,r.schema);return ef(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=Ep(t,n.schema);return ef(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=nf("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=Ep(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&&bu(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Ep(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>vp(Ep(t,n.schema),e)(n,r)});Hp.create({name:"commands",addCommands:()=>({...mf})}),Hp.create({name:"editable",addProseMirrorPlugins(){return[new el({key:new ol("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Hp.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new el({key:new ol("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}}}})]}}),Hp.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=ju.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.deleteCurrentNode(),()=>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 Xp()||tf()?o:r},addProseMirrorPlugins(){return[new el({key:new ol("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=ju.atStart(e.doc).from,a=ju.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}})]}}),Hp.create({name:"tabindex",addProseMirrorPlugins(){return[new el({key:new ol("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class gf{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=Ap(Dp(this,"addOptions",{name:this.name}))),this.storage=Ap(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=Vp(this.options,t),e.storage=Ap(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=Ap(Dp(e,"addOptions",{name:e.name})),e.storage=Ap(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 vf{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=Ap(Dp(this,"addOptions",{name:this.name}))),this.storage=Ap(Dp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new vf(t)}configure(t={}){const e=this.extend();return e.options=Vp(this.options,t),e.storage=Ap(Dp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new vf(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=Ap(Dp(e,"addOptions",{name:e.name})),e.storage=Ap(Dp(e,"addStorage",{name:e.name,options:e.options})),e}}function yf(t){return new Rp({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Ap(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(lf(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)}}})}const bf=vf.create({name:"text",group:"inline"});var _f=200,Df=function(){};Df.prototype.append=function(t){return t.length?(t=Df.from(t),!this.length&&t||t.length<_f&&this.leafAppend(t)||this.length<_f&&t.leafPrepend(this)||this.appendInner(t)):this},Df.prototype.prepend=function(t){return t.length?Df.from(t).append(this):this},Df.prototype.appendInner=function(t){return new kf(this,t)},Df.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Df.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Df.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Df.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)},Df.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},Df.from=function(t){return t instanceof Df?t:t&&t.length?new wf(t):Df.empty};var wf=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<=_f)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=_f)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}(Df);Df.empty=new wf([]);var kf=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}(Df),Ef=Df;class Cf{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 xf(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 xf(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 Cf(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 xf(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>Sf&&(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 Cf(s.append(o),i)}remapping(t,e){let n=new iu;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 Cf(this.items.append(t.map((t=>new xf(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 xf(u,i,l))}else n.push(new xf(u))}),r);let u=[];for(let t=e;t<i;t++)u.push(new xf(o.maps[t]));let l=this.items.slice(0,r).append(u).append(n),c=new Cf(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 xf(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 Cf(Ef.from(r.reverse()),o)}}Cf.empty=new Cf(Ef.empty,0);class xf{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 xf(e.getMap().invert(),e,this.selection)}}}class Af{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const Sf=20;function Of(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function Nf(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 Tf(t,e,n,r){let o=If(e),i=$f.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 Af(r?u:s.remaining,r?s.remaining:u,null,0);n(s.transform.setSelection(a).setMeta($f,{redo:r,historyState:l}).scrollIntoView())}let Ff=!1,Mf=null;function If(t){let e=t.plugins;if(Mf!=e){Ff=!1,Mf=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ff=!0;break}}return Ff}const $f=new ol("history"),Bf=new ol("closeHistory");function Rf(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new el({key:$f,state:{init:()=>new Af(Cf.empty,Cf.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta($f);if(i)return i.historyState;n.getMeta(Bf)&&(t=new Af(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta($f))return s.getMeta($f).redo?new Af(t.done.addTransform(n,void 0,r,If(e)),t.undone,Of(n.mapping.maps[n.steps.length-1]),t.prevTime):new Af(t.done,t.undone.addTransform(n,void 0,r,If(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Af(t.done.rebased(n,o),t.undone.rebased(n,o),Nf(t.prevRanges,n.mapping),t.prevTime):new Af(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Nf(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?Nf(t.prevRanges,n.mapping):Of(n.mapping.maps[n.steps.length-1]);return new Af(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,If(e)),Cf.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Lf:"historyRedo"==n?Pf:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const Lf=(t,e)=>{let n=$f.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Tf(n,t,e,!1),!0)},Pf=(t,e)=>{let n=$f.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Tf(n,t,e,!0),!0)},jf=Hp.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Lf(t,e),redo:()=>({state:t,dispatch:e})=>Pf(t,e)}),addProseMirrorPlugins(){return[Rf(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()}}});function zf(t){return(...e)=>n=>t(n,...e)}function Vf(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 Hf(t){const e=Vf(t);return["span",e?{...e,class:"zw-style"}:{},0]}function Wf(t,...e){return({editor:n})=>(n.commands[t](...e),!0)}var qf=Object.defineProperty,Uf=(t,e,n)=>(((t,e,n)=>{e in t?qf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);function Kf(t,e){let n=!1;return function(){n||(t.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),e))}}function Jf(t){return t>1||t<-1?t/100:t}const Gf=t=>Number.parseFloat(t.toFixed(5).substr(0,5));function Yf(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 Xf(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 Zf(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=Gf(a[1]),l=Gf(a[2]);return{h:Math.floor(a[0]),s:u,v:l,a:t.a}}function Qf(t){const e=Zf(Yf(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:Gf(s),l:Gf(i),a:o}}(e),r=Yf(t);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:n,hsva:e,hue:e.h,rgba:r}}function td(t,e,n="0"){return t+n.repeat(Math.max(0,e-t.length))}function ed(t){return Qf(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?td(e,8,"F"):td(td(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}(t))}const nd=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"}),rd="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",od=`[\\s|\\(]+(${rd})[,|\\s]+(${rd})[,|\\s]+(${rd})\\s*\\)?`,id=`[\\s|\\(]+(${rd})[,|\\s]+(${rd})[,|\\s]+(${rd})[,|\\s]+(${rd})\\s*\\)?`,sd=Object.freeze({CSS_UNIT:new RegExp(rd),RGB:new RegExp(`rgb${od}`),RGBA:new RegExp(`rgba${id}`),HSL:new RegExp(`hsl${od}`),HSLA:new RegExp(`hsla${id}`),HSV:new RegExp(`hsv${od}`),HSVA:new RegExp(`hsva${id}`),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})$/}),ad=Object.freeze({WINDOW:Symbol("window")});ad.WINDOW;ad.WINDOW,ad.WINDOW,Kf(((t,e)=>{t(e)}),20);const ud=class{static create(t){if(!t)return ud.fromBlack();let e=t.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(nd[e])e=nd[e];else if(e===this.TRANSPARENT)return ud.fromTransparent();const n=sd.RGB.exec(e)||sd.RGBA.exec(e);if(n){const t=void 0===n[4]?1:n[4];return ud.fromRgba({r:Number.parseInt(n[1]),g:Number.parseInt(n[2]),b:Number.parseInt(n[3]),a:Number.parseFloat(t)})}const r=sd.HSL.exec(e)||sd.HSLA.exec(e);if(r){const t=void 0===r[4]?1:r[4];return ud.fromHsla({h:Number.parseInt(r[1]),s:Number.parseFloat(r[2]),l:Number.parseFloat(r[3]),a:Number.parseFloat(t)})}const o=sd.HSV.exec(e)||sd.HSVA.exec(e);if(o){const t=void 0===o[4]?1:o[4];return ud.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(t)})}return sd.HEX8.exec(e)||sd.HEX6.exec(e)||sd.HEX4.exec(e)||sd.HEX3.exec(e)?ud.fromHex(e):ud.fromBlack()}static fromHex(t){const{rgba:e}=ed(t);return new ud(e)}static fromRgba({r:t,g:e,b:n,a:r}){const o=Jf(r);return new ud({r:t,g:e,b:n,a:o})}static fromHsla({h:t,s:e,l:n,a:r}){const o=Jf(e),i=Jf(n),s=Jf(r);return ud.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:Gf(0===i?0:2-2*r/i),v:Gf(i),a:o}}({h:t,s:o,l:i,a:s}))}static fromHsva({h:t,s:e,v:n,a:r}){const o=Xf({h:t,s:Jf(e),v:Jf(n),a:Jf(r)});return new ud(o)}static fromTransparent(){return new ud({r:0,g:0,b:0,a:0})}static fromWhite(){return new ud({r:255,g:255,b:255,a:1})}static fromBlack(){return new ud({r:0,g:0,b:0,a:1})}static isTransparent(t){return ud.create(t).isTransparent()}static isDark(t){return ud.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 Zf(this.rgba)}_calcRgba(){return Xf(this.hsva)}};let ld=ud;function cd(t){const e=ld.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}function pd(t,e){if(!t.includes("em"))return parseInt(t);const n=Rm.getComputedStyle(e).fontSize,r=parseFloat(t)*parseFloat(n);return Math.round(r)}function fd(t,e,n){if(!t.includes("px"))return t;const r=function(t,e){return(t.firstElementChild||t).style.fontSize||Rm.getComputedStyle(e).fontSize}(e,n),o=pd(r,n);return o?(parseInt(t)/o).toFixed(2):null}Uf(ld,"TRANSPARENT","transparent"),Uf(ld,"NONE","none");const dd=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),hd=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),md=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),gd=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),vd=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]}}),yd=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,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),bd=Object.freeze({SETTINGS:"settings",ALL:"_"}),_d=Object.freeze({BLANK:"_blank",SELF:"_self"}),Dd=Object.freeze({URL:"url",BLOCK:"block"}),wd={start:md.LEFT,end:md.RIGHT};const kd=(t,e,n,r)=>({from:Math.max(r,t.pos),to:Math.min(r+n.nodeSize,e.pos)});function Ed(t,e){return t.resolve(e).depth+1}const Cd=(t,e)=>t.eq(e);var xd,Ad,Sd={};function Od(t){return t.type.create(Sd.cloneDeep(t.attrs))}
7
7
  /**
8
8
  * @license
9
9
  * Lodash <https://lodash.com/>
@@ -11,4 +11,5 @@
11
11
  * Released under MIT license <https://lodash.com/license>
12
12
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
13
13
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
14
- */function yd(t){return t.type.create(vd.exports.cloneDeep(t.attrs))}md=vd,gd=vd.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,d=4294967295,h=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",i],["partialRight",s],["rearg",u]],m="[object Arguments]",g="[object Array]",v="[object Boolean]",y="[object Date]",b="[object Error]",_="[object Function]",D="[object GeneratorFunction]",E="[object Map]",w="[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*$/,dt=/^[-+]0x[0-9a-f]+$/i,ht=/^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",Et="\\u2700-\\u27bf",wt="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="["+wt+"]",It="[^\\ud800-\\udfff"+At+Tt+Et+wt+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[m]=re[g]=re[T]=re[v]=re[F]=re[y]=re[b]=re[_]=re[E]=re[w]=re[C]=re[A]=re[x]=re[O]=re[N]=!1;var oe={};oe[m]=oe[g]=oe[T]=oe[F]=oe[v]=oe[y]=oe[M]=oe[I]=oe[$]=oe[B]=oe[R]=oe[E]=oe[w]=oe[C]=oe[A]=oe[x]=oe[O]=oe[S]=oe[L]=oe[P]=oe[j]=oe[z]=!0,oe[b]=oe[_]=oe[N]=!1;var ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ae=parseInt,ue="object"==typeof f&&f&&f.Object===Object&&f,le="object"==typeof self&&self&&self.Object===Object&&self,ce=ue||le||Function("return this")(),pe=gd&&!gd.nodeType&&gd,fe=pe&&md&&!md.nodeType&&md,de=fe&&fe.exports===pe,he=de&&ue.process,me=function(){try{var t=fe&&fe.require&&fe.require("util").types;return t||he&&he.binding&&he.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 Ee(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 we(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 dn=Ve({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hn=function f(ot){var Dt=(ot=null==ot?ce:hn.defaults(ce.Object(),ot,hn.pick(ce,ee))).Array,Et=ot.Date,wt=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=de?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=di(At,"defineProperty");return t({},"",{}),t}catch(t){}}(),pe=ot.clearTimeout!==ce.clearTimeout&&ot.clearTimeout,fe=Et&&Et.now!==ce.Date.now&&Et.now,he=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=Et.now,En=ot.parseInt,wn=kt.random,Cn=Nt.reverse,kn=di(ot,"DataView"),An=di(ot,"Map"),xn=di(ot,"Promise"),On=di(ot,"Set"),Sn=di(ot,"WeakMap"),Nn=di(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__=d,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 dr(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),d=f==_||f==D;if(Ys(e))return ko(e,u);if(f==C||f==m||d&&!i){if(a=l||d?{}: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,hi(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 v:case y: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 E:return new o;case w: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 h=s.get(e);if(h)return h;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 g=p?t:(c?l?si:ii:l?Ia:Ma)(e);return Ce(g||e,(function(t,o){g&&(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 dr=$o(Dr),hr=$o(Er,!0);function mr(t,e){var n=!0;return dr(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 dr(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 Er(t,e){return t&&_r(t,e,Ma)}function wr(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,d=u[0];t:for(;++f<i&&c.length<l;){var h=p[f],m=n?n(h):h;if(h=r||0!==h?h:0,!(d?Ye(d,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}d&&d.push(m),c.push(h)}}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:Ee(o,e,r)}function Fr(t){return ra(t)&&Ar(t)==m}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?g:gi(e),c=u?g:gi(n),p=(l=l==m?C:l)==C,f=(c=c==m?C:c)==C,d=l==c;if(d&&Ys(e)){if(!Ys(n))return!1;a=!0,p=!1}if(d&&!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 v:case y:case w:return Hs(+t,+e);case b:return t.name==e.name&&t.message==e.message;case A:case O:return t==e+"";case E: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 h=p&&$t.call(e,"__wrapped__"),_=f&&$t.call(n,"__wrapped__");if(h||_){var D=h?e.value():e,k=_?n.value():n;return s||(s=new Yn),i(D,k,r,o,s)}}return!!d&&(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 d=s.get(e),h=s.get(n);if(d&&h)return d==n&&h==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 d=o(c,p,l,e,n,f);if(!(d===t?Mr(p,c,3,o,f):d))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):hu(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 dr(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 Ei(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 d=qs(l),h=!d&&Ys(l),m=!d&&!h&&pa(l);p=l,d||h||m?qs(u)?p=u:Gs(u)?p=To(u):h?(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(wn()*(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 dr(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]),d=f!==t,h=null===f,m=f==f,g=ca(f);if(a)var v=o||m;else v=c?m&&(o||d):u?m&&d&&(o||!h):l?m&&d&&!h&&(o||!g):!h&&!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:Ei(t,e)?[t]:Li(_a(t))}var Eo=Xr;function wo(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 d=o;++u<l;)p[d+u]=e[u];for(;++s<a;)(f||o<i)&&(p[d+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)?we: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?wo(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&&wi(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ui(c[0])].apply(u,c[3]):1==a.length&&wi(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,d=1&n,h=2&n,m=24&n,g=512&n,v=h?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 E=an(y,_);return Go(e,n,Ho,t.placeholder,r,y,E,l,c,p-a)}var w=d?r:this,C=h?w[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(w,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 Ee(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)?wo(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 d=8&n;n|=d?i:s,4&(n&=~(d?s:i))||(n&=-4);var h=[e,n,a,d?u:t,d?l:t,d?t:u,d?t:l,c,p,f],m=r.apply(t,h);return wi(e)&&Fi(m,h),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==E?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,d,h,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),h=h===t?h:bn(ga(h),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,d,h,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)E=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):Ee(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 Ee(p,o?n:this,c)}}(n,l,c,p);else var E=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)(E,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,d=!0,h=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;d=!1;break}if(h){if(!Ie(n,(function(t,e){if(!Ye(h,e)&&(m===t||i(m,t,r,o,s)))return h.push(e)}))){d=!1;break}}else if(m!==g&&!i(m,g,r,o,s)){d=!1;break}}return s.delete(e),s.delete(n),d}function oi(e){return Ii(Oi(e,t,Ki),e+"")}function ii(t){return kr(t,Ma,hi)}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 di(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return $r(r)?r:t}var hi=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,hi(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 Ei(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 wi(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)!=E||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 E;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),Ee(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=he||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 Ee(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),ds=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 hs(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:dr)(t,ci(e,3))}function Ds(t,e){return(qs(t)?ke:hr)(t,ci(e,3))}var Es=Mo((function(t,e,n){$t.call(t,n)?t[n].push(e):sr(t,n,[e])})),ws=Xr((function(t,e,n){var r=-1,o="function"==typeof e,i=Js(t)?Dt(t.length):[];return dr(t,(function(t){i[++r]=o?Ee(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,d=!1,h=!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||d&&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 d?_n(e,a-(t-p)):e}(t))}function b(e){return l=t,h&&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(d)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=(d="maxWait"in o)?bn(ya(o.maxWait)||0,r):a,h="trailing"in o?!!o.trailing:h),_.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=Eo((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 Ee(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)==y};function Qs(t){if(!ra(t))return!1;var e=Ar(t);return e==b||"[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==_||e==D||"[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)==E};function ia(t){return"number"==typeof t||ra(t)&&Ar(t)==w}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),da=Jo((function(t,e){return t<=e}));function ha(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==E?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,d):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=ht.test(t);return n||gt.test(t)?ae(t.slice(2),n?2:8):dt.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])})),Ea=Io((function(t,e){Fo(e,Ia(e),t)})),wa=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),Ee(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 Ee(e,t,n)}catch(t){return Qs(t)?t:new wt(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=wr(e,r);null!=n||na(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=wr(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),du=Uo(Ie);function hu(t){return Ei(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"),Eu=Wo((function(t,e){return t/e}),1),wu=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=Ea,zn.assignInWith=wa,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=hs,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(Ee(o[0],this,e))return Ee(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?[]:wr(t,Ma(t))},zn.functionsIn=function(t){return null==t?[]:wr(t,Ia(t))},zn.groupBy=Es,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=ws,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=du,zn.partial=Ps,zn.partialRight=js,zn.partition=As,zn.pick=La,zn.pickBy=Pa,zn.property=hu,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?d:r>>>0)?(e=_a(e))&&("string"==typeof n||null!=n&&!aa(n))&&!(n=co(n))&&rn(e)?wo(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=wo(e,0,n);return r&&Te(o,r),Ee(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=ha,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=ds,zn.entries=ja,zn.entriesIn=za,zn.extend=Ea,zn.extendWith=wa,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=Eu,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),Er)},zn.floor=wu,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&&Er(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)==v},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==E||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 wt("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=da,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),En(_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=wn();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,dr)},zn.reduceRight=function(t,e,n){var r=qs(t)?Me:We,o=arguments.length<3;return r(t,ci(e,4),n,o,hr)},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=f,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==E||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=wa({},n,o,ti);var i,s,a=wa({},n.imports,o.imports,ti),u=Ma(a),l=Ge(a,u),c=0,p=n.interpolate||bt,f="__p += '",d=xt((n.escape||bt).source+"|"+p.source+"|"+(p===X?pt:bt).source+"|"+(n.evaluate||bt).source+"|$","g"),h="//# sourceURL="+($t.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ne+"]")+"\n";e.replace(d,(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 wt("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,h+"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=d,r=_n(t,d);e=ci(e),t-=d;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 wo(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 wo(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 wo(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?wo(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 d=l.lastIndexOf(i);d>-1&&(l=l.slice(0,d))}return l+o},zn.unescape=function(t){return(t=_a(t))&&K.test(t)?t.replace(U,dn):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,d),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(d)},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__,d=!!this.__actions__.length,h=s&&!f,m=u&&!d;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 h&&m?e.apply(this,a):(g=this.thru(p),h?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,d=_n(u,this.__takeCount__);if(!n||!r&&o==u&&d==u)return go(t,this.__actions__);var h=[];t:for(;u--&&f<d;){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}}h[f++]=g}return h},zn.prototype.at=gs,zn.prototype.chain=function(){return hs(this)},zn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},zn.prototype.next=function(){this.__values__===t&&(this.__values__=ha(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=hn)._=hn,pe._=hn):ce._=hn}.call(f);class bd extends ou{static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new bd(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 iu.fail("No node at mark step's position");const n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks)),r=new ta(Js.from(n),0,e.isLeaf?0:1);return iu.fromReplace(t,this.pos,this.pos+1,r)}invert(t){const e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new _d(this.pos,this.mark):this}map(t){const e=t.mapResult(this.pos,1);return e.deletedAfter?null:new bd(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}ou.jsonID("removeNodeMark",bd);class _d extends ou{static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new _d(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 iu.fail("No node at mark step's position");const n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks)),r=new ta(Js.from(n),0,e.isLeaf?0:1);return iu.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 _d(this.pos,n);return new _d(this.pos,this.mark)}}return new bd(this.pos,this.mark)}map(t){const e=t.mapResult(this.pos,1);return e.deletedAfter?null:new _d(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}ou.jsonID("addNodeMark",_d);class Dd extends ou{static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Dd(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 iu.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 ta(Js.from(r),0,e.isLeaf?0:1);return iu.fromReplace(t,this.pos,this.pos+1,o)}getMap(){return eu.empty}invert(t){return new Dd(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 Dd(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}ou.jsonID("attr",Dd);const Ed=Ip.create({name:"node_processor",addCommands:()=>({setBlockAttributes:Nf((({commands:t,state:e},n,r,o={})=>{const i=ze(t.getBlockAttributes(n))??{},{doc:s,tr:a}=e,{from:u,to:l}=a.selection;s.nodesBetween(u,l,((t,e)=>{id.blocks.includes(t.type.name)&&a.step(new Dd(e,n,{...o,...i,...r}))}))})),getBlockAttributes:Nf((({editor:t},e,n)=>We((()=>{let r=Object.assign({},n||{});for(const n of id.blocks)Object.assign(r,t.getAttributes(n)?.[e]||{});return Object.keys(r).length?r:null})))),removeBlockAttributes:Nf((({commands:t},e)=>{for(const n of id.blocks)t.resetAttributes(n,e)})),applyMark:Nf((({state:t,commands:e},n,r,o={})=>{const{tr:i,doc:s,schema:a}=t,{$from:u,$to:l}=i.selection,c=Pp(ad.LINK,a),p=Pp(n,a);if(!(p.spec.group||"").includes(ud.SETTINGS))return e.setMark(n,r);if(u.pos===l.pos)return;s.nodesBetween(u.pos,l.pos,((t,s)=>{if(t.type.name===id.LIST)return;const a=function(t,e){const n="string"==typeof e?e:e.name;return t.find((t=>t.type.name===n))}(t.marks,n),f=p.create({...a?.attrs||{},...r}),d=fd(u,l,t,s),h=!c.isInSet(t.marks)&&function(t,e,n,r=hd){const o=t.resolve(e).path.reverse();for(const t of o)if("number"!=typeof t)for(const e of t.marks)if(r(e,n))return!0;return!1}(i.doc,s,f,o.isAppliedToParent);if(h)return(t=>{if(!o.onAppliedToParent||!1===o.onAppliedToParent(t)){const{tr:n,node:r,position:o,mark:i}=t;e._removeNodeMark({tr:n,node:r,position:o,mark:i.type})}})({tr:i,node:t,position:s,mark:f});t.isText?i.addMark(d.from,d.to,f):function(t,e,n,r){const o=dd(t,r),i=e.from-o<=r,s=e.to+o>=n.nodeSize+r;return i&&s}(i.doc,i.selection,t,s)&&i.step(new _d(s,f))}))})),getMarks:Nf((({editor:t},e)=>{const n=Ve(t,"state");return We((()=>{const{selection:t,doc:r}=ze(n),{from:o,to:i}=ze(t),s=[];return r.nodesBetween(o,i,(t=>{for(const n of t.marks)n.type.name===e&&s.unshift(n.attrs)})),s}))})),getMark:Nf((({commands:t},e)=>{const n=t.getMarks(e);return We((()=>ze(n)[0]??null))})),hasMark:Nf((({commands:t},e)=>{const n=t.getMark(e);return We((()=>!!ze(n)))})),getCommonSettingMark:Nf((({commands:t},e,n)=>{const r=t.getMark(e);return We((()=>ze(r)?.value??ze(n)))})),getDeviceSettingMark:Nf((({commands:t},e,n)=>{const r=t.getMarks(e),o=t.getDevice();return We((()=>{for(const t of ze(r)){const e=t[ze(o)];if(e)return e}return ze(n)}))})),removeAllMarks:Nf((({state:t,commands:e})=>{const{tr:n,doc:r}=t,{from:o,to:i}=n.selection;r.nodesBetween(o,i,((t,r)=>{for(const o of t.marks)e._removeNodeMark({tr:n,node:t,position:r,mark:o})}))})),removeMarks:Nf((({state:t,commands:e},n)=>{const{tr:r,doc:o}=t,{from:i,to:s}=r.selection;o.nodesBetween(i,s,((t,o)=>{const i=t.marks.filter((t=>n.includes(t.type.name)));for(const n of i)e._removeNodeMark({tr:r,node:t,position:o,mark:n})}))})),_removeNodeMark:Nf(((t,{tr:e,node:n,position:r,mark:o})=>n.isText?e.removeMark(r,r+n.nodeSize,o):e.step(new bd(r,o))))})}),wd=Ip.create({name:"text_processor",addCommands:()=>({getSelectedText:Nf((({state:t})=>{const{from:e,to:n}=t.selection;return t.doc.textBetween(e,n," ")})),transformText:Nf((({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=fd(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)}))}))})}),Cd=Ip.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:Nf((({state:t})=>{this.storage.selection=t.selection})),restoreSelection:Nf((({commands:t})=>{this.storage.selection&&t.setTextSelection(this.storage.selection)})),expandSelection:Nf((({tr:t,commands:e},n)=>{let r=t.selection.from,o=t.selection.to;t.doc.nodesBetween(r,o,((e,i,s)=>{if(n({node:e,parent:s})){const n=e.isText?0:dd(t.doc,i);r=Math.min(r,i+n),o=Math.max(o,i+e.nodeSize-n)}})),e.setTextSelection({from:r,to:o})})),expandSelectionToBlock:Nf((({commands:t})=>{t.expandSelection((({parent:t})=>t.type.name===id.DOCUMENT))}))}}}),kd=af.create({name:"doc",topNode:!0,content:"block+"}).extend({marks:ud.SETTINGS}),Ad=af.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",gp(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),xd=Ad.extend({marks:ud.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),Od=af.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]}`,gp(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 kp({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=yp(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}})))}}),Sd=Od.extend({marks:ud.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})});class Nd{static create(t,e){const n=new this(t,e||{});return new Ku({key:new Yu(this.name),props:n.buildProps()})}constructor(t,e){this.options=e,this.editor=t}buildProps(){return{}}}class Td extends Nd{buildProps(){return{transformPastedHTML:this._transformPastedHTML.bind(this),handlePaste:this._handlePaste.bind(this)}}_transformPastedHTML(t){if(t.includes("data-pm-slice")&&t.includes("zw-style"))return t;const e=Kh.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===id.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}}class Fd extends Nd{buildProps(){return{decorations:this.#t.bind(this)}}#t({doc:t}){const e=[];return this.editor.isEditable?t.childCount>1?void 0:(t.descendants(((t,n)=>{if(!t.childCount){const r=Ac.node(n,n+t.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});e.push(r)}return!1})),Sc.create(t,e)):null}}const Md=Ip.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[Td.create(this.editor),Fd.create(this.editor)]}}),Id=sf.create({name:ad.FONT_FAMILY,group:ud.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:Nf((({commands:t},e)=>{t.applyMark(this.name,{value:e});const n=t.findFontByName(e);let r=ze(t.getFontWeight());n.isWeightSupported(r)||(r=n.findClosestWeight(r),t.applyFontWeight(r)),n.isItalicSupported(r)||t.removeItalic()})),getFont:Nf((({commands:t})=>{const e=ze(this.options.defaultPreset),n=t.findFontByName(e.common.font_family),r=t.getFontFamily();return We((()=>t.findFontByName(ze(r))||n))})),findFontByName:Nf(((t,e)=>this.options.fonts.find((t=>t.name===e)))),getFontFamily:Nf((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontFamily()))),getDefaultFontFamily:Nf((({commands:t})=>{const e=t.getPreset();return We((()=>ze(e).common.font_family))}))}},parseHTML(){const t=t=>({value:t.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:t},{style:"font-family",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ff({font_family:t.value?`"${t.value}"`:null})}),$d=Ip.create({name:ad.STYLE_PRESET,addGlobalAttributes(){return[{types:[id.PARAGRAPH,id.HEADING],attributes:{preset:{isRequired:!1,default:{id:this.options.defaultId},parseHTML:t=>{const e=ze(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=this.options.styleRenderer.makePresetCssClass({id:n});if(t.matches(e))return{id:n};if(t.tagName===`H${r?.level}`)return{id:n}}return"P"===t.tagName?{id:this.options.defaultId}:null},renderHTML:t=>t.preset?{class:this.options.styleRenderer.makePresetHtmlClass(t.preset)}: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:Nf((()=>We((()=>this.options.presets.filter((t=>!t.hidden)))))),getPreset:Nf((({commands:n})=>{const r=n.getBlockAttributes("preset",{id:this.options.defaultId}),o=n.getPresetList(),i=n.isLink(),s=n.getLinkPreset();return We((()=>{const n=t(ze(o),ze(r).id);if(!ze(i))return n;const a=ze(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:Nf((({commands:e,chain:n},r)=>{const o=t(ze(e.getPresetList()),r),i=o.node?.type??id.PARAGRAPH,s={preset:{id:r}};o.node&&(s.level=o.node.level);for(const t of ad.attributes)s[t]=ze(e.getBlockAttributes(t));n().removeList().setNode(i,s).run()})),applyDefaultPreset:Nf((({commands:t})=>{t.applyPreset(this.options.defaultId)})),removePreset:Nf((({commands:t})=>{t.setNode(id.PARAGRAPH,{preset:null})})),getPresetCustomization:Nf((({editor:t,commands:e})=>{const n=Ve(t,"state");return We((()=>{const{selection:t,doc:r}=ze(n),{from:o,to:i}=t;return e._getSettingCustomization(r,o,i)}))})),isSettingCustomized:Nf((({commands:t},e)=>{const n=t.getPresetCustomization(),r=ad.attributes.includes(e)?"attributes":"marks";return We((()=>ze(n)[r]?.includes(e)??!1))})),getContentCustomization:Nf((({editor:t,commands:e})=>{const n=Ve(t,"state");return We((()=>{const{doc:t}=ze(n);return e._getSettingCustomization(t,0,t.content.size)}))})),_getSettingCustomization:Nf(((t,e,n,r)=>{const o=new Set,i=new Set;return e.nodesBetween(n,r,(t=>{for(const[e,n]of Object.entries(t.attrs)){ad.attributes.includes(e)&&n&&i.add(e)}for(const{type:e}of t.marks)ad.marks.includes(e.name)&&o.add(e.name)})),{attributes:Array.from(i),marks:Array.from(o)}})),removePresetCustomization:Nf((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(ad.marks).resetAttributes(id.PARAGRAPH,ad.attributes).resetAttributes(id.HEADING,ad.attributes).restoreSelection().run()})),removeFormat:Nf((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()}))}},onCreate(){this.options.styleRenderer.inject(Jh.head,this.options.presets)}}),Bd=sf.create({name:ad.FONT_WEIGHT,group:ud.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:Nf((({commands:t},e)=>{t.applyMark(this.name,{value:e});ze(t.getFont()).isItalicSupported(e)||t.removeItalic()})),toggleBold:Nf((({commands:t})=>{const e=ze(t.getFontWeight()),n=ze(t.getFont()),r=Number(e)>=600?"400":"700",o=n.findClosestWeight(r);t.applyFontWeight(o)})),getFontWeight:Nf((({commands:t})=>{const e=t.getCommonSettingMark(this.name,t.getDefaultFontWeight()),n=t.getFont();return We((()=>{const t=ze(e),r=ze(n);return r.isWeightSupported(t)?t:r.findClosestWeight(t)}))})),getDefaultFontWeight:Nf((({commands:t})=>{const e=t.getPreset();return We((()=>ze(e).common.font_weight))}))}},addKeyboardShortcuts:()=>({"Mod-b":Mf("toggleBold"),"Mod-B":Mf("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})=>Ff({font_weight:t.value})}),Rd=sf.create({name:ad.FONT_SIZE,group:ud.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getFontSize:Nf((({commands:t})=>t.getDeviceSettingMark(this.name,t.getDefaultFontSize()))),getDefaultFontSize:Nf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return We((()=>ze(n)[ze(e)].font_size.replace("px","")))})),applyFontSize:Nf((({commands:t},e)=>{const n=ze(t.getDevice());t.applyMark(this.name,{[n]:e},{isAppliedToParent:(t,e)=>t.type.name===e.type.name&&t.attrs[n]===e.attrs[n],onAppliedToParent:({tr:t,node:e,position:r,mark:o})=>{const i={...o.attrs,[n]:null},s=!Object.values(i).some((t=>!!t));if(s)return!1;const a=o.type.create(i);e.isText?t.addMark(r,r+e.nodeSize,a):t.step(new _d(r,a))}})})),increaseFontSize:Nf((({commands:t})=>{const e=Number(ze(t.getFontSize())),n=Math.min(e+1,this.options.maxSize);t.applyFontSize(String(n))})),decreaseFontSize:Nf((({commands:t})=>{const e=Number(ze(t.getFontSize())),n=Math.max(e-1,this.options.minSize);t.applyFontSize(String(n))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Mf("increaseFontSize"),"Mod-Shift--":Mf("decreaseFontSize")}),parseHTML(){const t=t=>{if(!t)return null;const e=td(t,ze(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 Ff({font_size_mobile:e(t.mobile),font_size_tablet:e(t.tablet),font_size_desktop:e(t.desktop)})}}),Ld=sf.create({name:ad.FONT_COLOR,group:ud.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:Nf((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontColor()))),getDefaultFontColor:Nf((({commands:t})=>{const e=t.getPreset();return We((()=>ze(e).common.color))})),applyFontColor:Nf((({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})=>Ff({font_color:t.value})}),Pd=sf.create({name:ad.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:Nf((({commands:t})=>t.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)"))),applyBackgroundColor:Nf((({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})=>Ff({background_color:t.value})}),jd=Ip.create({name:"device_manager",addCommands(){return{getDevice:Nf((()=>Ve(this.options,"device")))}}}),zd=sf.create({name:ad.FONT_STYLE,group:ud.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:Nf((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultFontStyle();return We((()=>ze(e)?.italic??ze(n).italic))})),isItalicAvailable:Nf((({commands:t})=>{const e=t.getFont(),n=t.getFontWeight();return We((()=>{const t=ze(e),r=ze(n);return t.isItalicSupported(r)&&!t.isWeightItalicOnly(r)}))})),getDefaultFontStyle:Nf((({commands:t})=>{const e=t.getPreset();return We((()=>({italic:"italic"===ze(e).common.font_style})))})),toggleItalic:Nf((({commands:t})=>{ze(t.isItalicAvailable())&&(ze(t.isItalic())?t.removeItalic():t.applyItalic())})),applyItalic:Nf((({commands:t})=>{t.applyMark(this.name,{italic:!0})})),removeItalic:Nf((({commands:t})=>{t.applyMark(this.name,{italic:!1})}))}},addKeyboardShortcuts:()=>({"Mod-i":Mf("toggleItalic"),"Mod-I":Mf("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})=>Ff({font_style:t.italic?"italic":"normal"})}),Hd=sf.create({name:ad.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:Nf((({commands:t})=>{const e=t.getTextDecoration();return We((()=>ze(e).underline))})),isStrikeThrough:Nf((({commands:t})=>{const e=t.getTextDecoration();return We((()=>ze(e).strike_through))})),getTextDecoration:Nf((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultTextDecoration();return We((()=>{const t=ze(e)??{},r=ze(n);return{underline:t.underline||r.underline,strike_through:t.strike_through||r.strike_through}}))})),isUnderlineCustomized:Nf((({commands:t})=>{const e=t.isUnderline(),n=t.getDefaultTextDecoration();return We((()=>ze(e)!==ze(n).underline))})),getDefaultTextDecoration:Nf((({commands:t})=>{const e=t.getPreset();return We((()=>{const{text_decoration:t}=ze(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:Nf((({commands:t})=>{t.toggleTextDecoration("underline")})),toggleStrikeThrough:Nf((({commands:t})=>{t.toggleTextDecoration("strike_through")})),toggleTextDecoration:Nf((({commands:t},e,n=null)=>{const r=ze(t.getTextDecoration()),o=n??!r[e];t.applyMark(this.name,{[e]:o})})),applyTextDecoration:Nf((({commands:t},e)=>{t.toggleTextDecoration(e,!0)})),removeTextDecoration:Nf((({commands:t},e)=>{t.toggleTextDecoration(e,!1)}))}},addKeyboardShortcuts:()=>({"Mod-u":Mf("toggleUnderline"),"Mod-U":Mf("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"),Ff({text_decoration:e.join(" ")})}}),Vd=Ip.create({name:"case_style",addCommands:()=>({applyCaseStyle:Nf((({commands:t},e)=>{switch(e){case rd.CAPITALIZE:return t.applyCapitalize();case rd.LOWERCASE:return t.applyLowerCase();case rd.UPPERCASE:return t.applyUpperCase()}})),applyCapitalize:Nf((({commands:t})=>{t.transformText((({text:t})=>function(t){return t.toLowerCase().replace(/(?:^|\s)\S/g,(t=>t.toUpperCase()))}(t)))})),applyLowerCase:Nf((({commands:t})=>{t.transformText((({text:t})=>t.toLowerCase()))})),applyUpperCase:Nf((({commands:t})=>{t.transformText((({text:t})=>t.toUpperCase()))}))})}),Wd={mobile:null,tablet:null,desktop:null},Ud=Ip.create({name:ad.ALIGNMENT,addGlobalAttributes:()=>[{types:[id.PARAGRAPH,id.HEADING],attributes:{[ad.ALIGNMENT]:{isRequired:!1,parseHTML({style:t}){const e=function(t){const e=pd[t]||t;return od.values.includes(e)?e:null}(t.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const n=t.getPropertyValue("--zw-alignment-mobile")||null,r=t.getPropertyValue("--zw-alignment-tablet")||null,o=t.getPropertyValue("--zw-alignment-desktop")||null;return n||r||o?{desktop:o,tablet:r,mobile:n}:null},renderHTML:t=>t.alignment?Tf({alignment_mobile:t.alignment.mobile,alignment_tablet:t.alignment.tablet,alignment_desktop:t.alignment.desktop}):null}}}],addCommands(){return{toggleAlignment:Nf((({commands:t},e)=>{ze(t.getAlignment())===e?t.removeAlignment():t.applyAlignment(e)})),applyAlignment:Nf((({commands:t},e)=>{const n=ze(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},Wd)})),removeAlignment:Nf((({commands:t})=>t.removeBlockAttributes(this.name))),getAlignment:Nf((({commands:t})=>{const e=t.getBlockAttributes(this.name,Wd),n=t.getDevice(),r=t.getDefaultAlignment();return We((()=>ze(e)?.[ze(n)]??ze(r)))})),getDefaultAlignment:Nf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return We((()=>ze(n)[ze(e)].alignment))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Mf("applyAlignment",od.LEFT),"Mod-Shift-e":Mf("applyAlignment",od.CENTER),"Mod-Shift-r":Mf("applyAlignment",od.RIGHT),"Mod-Shift-j":Mf("applyAlignment",od.JUSTIFY)})}),qd={mobile:null,tablet:null,desktop:null},Kd=Ip.create({name:ad.LINE_HEIGHT,addGlobalAttributes(){return[{types:[id.PARAGRAPH,id.HEADING],attributes:{[ad.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=ed(e,t,ze(this.options.wrapperRef));return n?{desktop:n,tablet:n,mobile:null}:null},renderHTML:t=>t.line_height?Tf({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:Nf((({commands:t})=>{const e=t.getBlockAttributes(this.name,qd),n=t.getDevice(),r=t.getDefaultLineHeight();return We((()=>ze(e)?.[ze(n)]??ze(r)))})),getDefaultLineHeight:Nf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return We((()=>ze(n)[ze(e)].line_height))})),applyLineHeight:Nf((({commands:t},e)=>{const n=ze(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},qd)}))}}}),Jd=af.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",gp(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:id.LIST_ITEM,marks:ud.SETTINGS,addCommands(){const t=({selection:t})=>t.$cursor.before(t.$cursor.depth-1);return{listItemNewline:Nf((({commands:e,tr:n})=>{const r=n.doc.nodeAt(t(n));if(!n.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=t(n);for(const t of r.marks)n.step(new _d(o,yd(t)));return!0}))}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:t=>{const{state:e,commands:n}=t.editor,r=e.selection.$cursor?.path.some((t=>t.type?.name===id.LIST));if(r)return n.listItemNewline()}})}),Gd=af.create({name:id.LIST,content:`${id.LIST_ITEM}+`,group:"block list",marks:ud.SETTINGS,addExtensions:()=>[Jd],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:sd.DISC}}}),parseHTML(){const t={a:sd.ROMAN,i:sd.LATIN,1:sd.DECIMAL},e=e=>{for(const n of sd.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)||sd.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||sd.DISC}})}]},renderHTML({HTMLAttributes:t}){const e=[this.options.baseClass+t.bullet.type,this.options.presetClass];return[sd.ordered.includes(t.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands:()=>({getListType:Nf((({commands:t})=>{const e=t.getBlockAttributes("bullet",{type:null});return We((()=>ze(e).type??null))})),applyList:Nf((({commands:t,chain:e},n)=>{if(ze(t.getListType())!==n)return e().applyDefaultPreset().toggleList(id.LIST,id.LIST_ITEM).setBlockAttributes("bullet",{type:n}).command((({commands:t,tr:e})=>t._bubbleListItemMarks(e))).run();t.removeList()})),_bubbleListItemMarks:Nf(((t,e)=>{const{doc:n,selection:r}=e,o=r.$from.start(),i=r.$to.end();function s(t,e){if(ad.inlineMarks.includes(e.type))return!1;if(e.type.isInSet(t.marks))return!1;for(const n of t.content.content)if(n.childCount){if(!n.marks)return!1;if(!e.isInSet(n.marks))return!1}return!0}n.nodesBetween(o,i,((t,n)=>{if(t.type.name===id.LIST)return;if(t.type.name!==id.LIST_ITEM)return!1;const r=[];return t.forEach((o=>{for(const i of o.marks)i.isInSet(r)?e.step(new bd(n+1,i)):s(t,i)&&(e.step(new bd(n+1,i)),e.step(new _d(n,yd(i))),r.push(i))})),!1}))})),removeList:Nf((({commands:t,state:e})=>{const{tr:n,doc:r,selection:o}=e,i=o.$from.start(),s=o.$to.end();r.nodesBetween(i,s,((t,e,r)=>{if([id.LIST,id.LIST_ITEM].includes(t.type.name))return;if(r.type.name!==id.LIST_ITEM)return!1;const o=r.marks.filter((function(e){return!e.type.isInSet(t.marks)}));for(const t of o)n.step(new _d(e,yd(t)));return!1})),t.liftListItem(id.LIST_ITEM)}))}),addInputRules(){const t=(t,e)=>function(t){return new kp({find:t.find,handler:({state:e,range:n,match:r})=>{const o=yp(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),s=i.doc.resolve(n.from).blockRange(),a=s&&hu(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&&vu(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(sd.DISC,/^\s*([-+*])\s$/),t(sd.DECIMAL,/^(\d+)\.\s$/),t(sd.LATIN,/^([ivx]{1,3})\.\s$/i),t(sd.ROMAN,/^([a-z])\.\s$/i)]}});function Yd(t){this.j={},this.jr=[],this.jd=null,this.t=t}Yd.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=Xd();var o=eh(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 Xd=function(){return new Yd},Qd=function(t){return new Yd(t)},Zd=function(t,e,n){t.j[e]||(t.j[e]=n)},th=function(t,e,n){t.jr.push([e,n])},eh=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},nh=function(t,e,n){for(var r=0;r<e.length;r++)Zd(t,e[r],n)},rh=function(t,e){for(var n=0;n<e.length;n++){var r=e[n][0],o=e[n][1];Zd(t,r,o)}},oh=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(),Zd(t,e[i],o),t=o,i++;Zd(t,e[s-1],n)},ih="DOMAIN",sh="TLD",ah="NUM",uh="AT",lh="DOT",ch="SLASH",ph=Object.freeze({__proto__:null,DOMAIN:ih,LOCALHOST:"LOCALHOST",TLD:sh,NUM:ah,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:uh,BACKSLASH:"BACKSLASH",BACKTICK:"BACKTICK",CARET:"CARET",COLON:"COLON",COMMA:"COMMA",DOLLAR:"DOLLAR",DOT:lh,EQUALS:"EQUALS",EXCLAMATION:"EXCLAMATION",HYPHEN:"HYPHEN",PERCENT:"PERCENT",PIPE:"PIPE",PLUS:"PLUS",POUND:"POUND",QUERY:"QUERY",QUOTE:"QUOTE",SEMI:"SEMI",SLASH:ch,TILDE:"TILDE",UNDERSCORE:"UNDERSCORE",SYM:"SYM"}),fh="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(" "),dh=/(?:[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])/,hh=/(?:[#\*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])/,mh=/\uFE0F/,gh=/\d/,vh=/\s/;function yh(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=Xd(),n=Qd(ah),r=Qd(ih),o=Xd(),i=Qd("WS"),s=[[gh,r],[dh,r],[hh,r],[mh,r]],a=function(){var t=Qd(ih);return t.j={"-":o},t.jr=[].concat(s),t},u=function(t){var e=a();return e.t=t,e};rh(e,[["'",Qd("APOSTROPHE")],["{",Qd("OPENBRACE")],["[",Qd("OPENBRACKET")],["<",Qd("OPENANGLEBRACKET")],["(",Qd("OPENPAREN")],["}",Qd("CLOSEBRACE")],["]",Qd("CLOSEBRACKET")],[">",Qd("CLOSEANGLEBRACKET")],[")",Qd("CLOSEPAREN")],["&",Qd("AMPERSAND")],["*",Qd("ASTERISK")],["@",Qd(uh)],["`",Qd("BACKTICK")],["^",Qd("CARET")],[":",Qd("COLON")],[",",Qd("COMMA")],["$",Qd("DOLLAR")],[".",Qd(lh)],["=",Qd("EQUALS")],["!",Qd("EXCLAMATION")],["-",Qd("HYPHEN")],["%",Qd("PERCENT")],["|",Qd("PIPE")],["+",Qd("PLUS")],["#",Qd("POUND")],["?",Qd("QUERY")],['"',Qd("QUOTE")],["/",Qd(ch)],[";",Qd("SEMI")],["~",Qd("TILDE")],["_",Qd("UNDERSCORE")],["\\",Qd("BACKSLASH")]]),Zd(e,"\n",Qd("NL")),th(e,vh,i),Zd(i,"\n",Xd()),th(i,vh,i);for(var l=0;l<fh.length;l++)oh(e,fh[l],u(sh),a);var c=a(),p=a(),f=a(),d=a();oh(e,"file",c,a),oh(e,"ftp",p,a),oh(e,"http",f,a),oh(e,"mailto",d,a);var h=a(),m=Qd("PROTOCOL"),g=Qd("MAILTO");Zd(p,"s",h),Zd(p,":",m),Zd(f,"s",h),Zd(f,":",m),Zd(c,":",m),Zd(h,":",m),Zd(d,":",g);for(var v=a(),y=0;y<t.length;y++)oh(e,t[y],v,a);return Zd(v,":",m),oh(e,"localhost",u("LOCALHOST"),a),th(e,gh,n),th(e,dh,r),th(e,hh,r),th(e,mh,r),th(n,gh,n),th(n,dh,r),th(n,hh,r),th(n,mh,r),Zd(n,"-",o),Zd(r,"-",o),Zd(o,"-",o),th(r,gh,r),th(r,dh,r),th(r,hh,r),th(r,mh,r),th(o,gh,r),th(o,dh,r),th(o,hh,r),th(o,mh,r),e.jd=Qd("SYM"),e}var bh={defaultProtocol:"http",events:null,format:_h,formatHref:_h,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function _h(t){return t}function Dh(){}function Eh(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}(Dh,n,e),n}Dh.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]:bh.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}}};var wh=Eh("email",{isLink:!0}),Ch=Eh("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),kh=Eh("text"),Ah=Eh("nl"),xh=Eh("url",{isLink:!0,toHref:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bh.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===ch;)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}}),Oh=Object.freeze({__proto__:null,MultiToken:Dh,Base:Dh,createTokenClass:Eh,MailtoEmail:wh,Email:Ch,Text:kh,Nl:Ah,Url:xh});function Sh(){var t=Xd(),e=Xd(),n=Xd(),r=Xd(),o=Xd(),i=Xd(),s=Xd(),a=Qd(xh),u=Xd(),l=Qd(xh),c=Qd(xh),p=Xd(),f=Xd(),d=Xd(),h=Xd(),m=Xd(),g=Qd(xh),v=Qd(xh),y=Qd(xh),b=Qd(xh),_=Xd(),D=Xd(),E=Xd(),w=Xd(),C=Xd(),k=Xd(),A=Qd(Ch),x=Xd(),O=Qd(Ch),S=Qd(wh),N=Xd(),T=Xd(),F=Xd(),M=Xd(),I=Qd(Ah);Zd(t,"NL",I),Zd(t,"PROTOCOL",e),Zd(t,"MAILTO",n),Zd(e,ch,r),Zd(r,ch,o),Zd(t,sh,i),Zd(t,ih,i),Zd(t,"LOCALHOST",a),Zd(t,ah,i),Zd(o,sh,c),Zd(o,ih,c),Zd(o,ah,c),Zd(o,"LOCALHOST",c),Zd(i,lh,s),Zd(C,lh,k),Zd(s,sh,a),Zd(s,ih,i),Zd(s,ah,i),Zd(s,"LOCALHOST",i),Zd(k,sh,A),Zd(k,ih,C),Zd(k,ah,C),Zd(k,"LOCALHOST",C),Zd(a,lh,s),Zd(A,lh,k),Zd(a,"COLON",u),Zd(a,ch,c),Zd(u,ah,l),Zd(l,ch,c),Zd(A,"COLON",x),Zd(x,ah,O);var $=["AMPERSAND","ASTERISK",uh,"BACKSLASH","BACKTICK","CARET","DOLLAR",ih,"EQUALS","HYPHEN","LOCALHOST",ah,"PERCENT","PIPE","PLUS","POUND","PROTOCOL",ch,"SYM","TILDE",sh,"UNDERSCORE"],B=["APOSTROPHE","CLOSEANGLEBRACKET","CLOSEBRACE","CLOSEBRACKET","CLOSEPAREN","COLON","COMMA",lh,"EXCLAMATION","OPENANGLEBRACKET","OPENBRACE","OPENBRACKET","OPENPAREN","QUERY","QUOTE","SEMI"];Zd(c,"OPENBRACE",f),Zd(c,"OPENBRACKET",d),Zd(c,"OPENANGLEBRACKET",h),Zd(c,"OPENPAREN",m),Zd(p,"OPENBRACE",f),Zd(p,"OPENBRACKET",d),Zd(p,"OPENANGLEBRACKET",h),Zd(p,"OPENPAREN",m),Zd(f,"CLOSEBRACE",c),Zd(d,"CLOSEBRACKET",c),Zd(h,"CLOSEANGLEBRACKET",c),Zd(m,"CLOSEPAREN",c),Zd(g,"CLOSEBRACE",c),Zd(v,"CLOSEBRACKET",c),Zd(y,"CLOSEANGLEBRACKET",c),Zd(b,"CLOSEPAREN",c),Zd(_,"CLOSEBRACE",c),Zd(D,"CLOSEBRACKET",c),Zd(E,"CLOSEANGLEBRACKET",c),Zd(w,"CLOSEPAREN",c),nh(f,$,g),nh(d,$,v),nh(h,$,y),nh(m,$,b),nh(f,B,_),nh(d,B,D),nh(h,B,E),nh(m,B,w),nh(g,$,g),nh(v,$,v),nh(y,$,y),nh(b,$,b),nh(g,B,g),nh(v,B,v),nh(y,B,y),nh(b,B,b),nh(_,$,g),nh(D,$,v),nh(E,$,y),nh(w,$,b),nh(_,B,_),nh(D,B,D),nh(E,B,E),nh(w,B,w),nh(c,$,c),nh(p,$,c),nh(c,B,p),nh(p,B,p),Zd(n,sh,S),Zd(n,ih,S),Zd(n,ah,S),Zd(n,"LOCALHOST",S),nh(S,$,S),nh(S,B,N),nh(N,$,S),nh(N,B,N);var R=["AMPERSAND","APOSTROPHE","ASTERISK","BACKSLASH","BACKTICK","CARET","CLOSEBRACE","DOLLAR",ih,"EQUALS","HYPHEN",ah,"OPENBRACE","PERCENT","PIPE","PLUS","POUND","QUERY",ch,"SYM","TILDE",sh,"UNDERSCORE"];return nh(i,R,T),Zd(i,uh,F),nh(a,R,T),Zd(a,uh,F),nh(s,R,T),nh(T,R,T),Zd(T,uh,F),Zd(T,lh,M),nh(M,R,T),Zd(F,sh,C),Zd(F,ih,C),Zd(F,ah,C),Zd(F,"LOCALHOST",A),t}function Nh(t,e,n){var r=n[0].s,o=n[n.length-1].e;return new t(e.substr(r,o-r),n)}var Th="undefined"!=typeof console&&console&&console.warn||function(){},Fh={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function Mh(t){if(Fh.initialized&&Th('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");Fh.customProtocols.push(t)}function Ih(t){return Fh.initialized||function(){Fh.scanner={start:yh(Fh.customProtocols),tokens:ph},Fh.parser={start:Sh(),tokens:Oh};for(var t={createTokenClass:Eh},e=0;e<Fh.pluginQueue.length;e++)Fh.pluginQueue[e][1]({scanner:Fh.scanner,parser:Fh.parser,utils:t});Fh.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=eh(a,n[o].t));)s.push(n[o++]);for(;o<r&&(l=u||eh(a,n[o].t));)u=null,(a=l).accepts()?(f=0,p=a):f>=0&&f++,o++,c++;if(f<0)for(var d=o-c;d<o;d++)s.push(n[d]);else{s.length>0&&(i.push(Nh(kh,e,s)),s=[]),o-=f,c-=f;var h=p.t,m=n.slice(o-c,o);i.push(Nh(h,e,m))}}return s.length>0&&i.push(Nh(kh,e,s)),i}(Fh.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=eh(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}(Fh.scanner.start,t))}function $h(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Ih(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 Bh(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Ih(t);return 1===n.length&&n[0].isLink&&(!e||n[0].t===e)}function Rh(t){return new Ku({key:new Yu("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 Nu(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}})}))})),rf(r)}(a);return l.forEach((({oldRange:e,newRange:o})=>{of(e.from,e.to,n.doc).filter((e=>e.mark.type===t.type)).forEach((e=>{const o=of(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=Bh(a),p=Bh(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=>{$h(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 Lh=sf.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(Mh)},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",gp(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[uf({find:t=>$h(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(Rh({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new Ku({key:new Yu("handleClickLink"),props:{handleClick:(t,n,r)=>{var o;const i=nf(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 Ku({key:new Yu("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=$h(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}}),Ph=Lh.extend({name:ad.LINK,addOptions(){return{...this.parent?.(),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:ld.SELF,parseHTML:t=>t.getAttribute("target")||ld.SELF},destination:{default:cd.URL,parseHTML:t=>{const e=t.getAttribute("href");if(!e.startsWith("#"))return cd.URL;const n=e.replace("#","");return ze(this.options.pageBlocks).find((t=>t.id===parseInt(n)))?cd.BLOCK:cd.URL}}}},addCommands(){return{...this.parent?.(),applyLink:Nf((({commands:t,chain:e},n)=>t.getSelectedText()?e().applyMark(this.name,n).expandSelectionToLink().command((({tr:t})=>(t.insertText(n.text,t.selection.from,t.selection.to),!0))).run():t.insertContent(Yh.text(n.text,[Yh.mark(ad.LINK,n)])))),expandSelectionToLink:Nf((({commands:t})=>{t.expandSelection((({node:t})=>this.type.isInSet(t.marks)))})),isLink:Nf((({commands:t})=>t.hasMark(this.name))),getLinkPreset:Nf((()=>We((()=>this.options.preset))))}},renderHTML({HTMLAttributes:t}){const e=t.destination===cd.BLOCK?`#${t.href}`:t.href,n=`${ze(this.options.basePresetClass)+ze(this.options.preset).id} zw-style`;return["a",{href:e,target:t.target,class:n},0]}}),jh=sf.create({name:ad.SUPERSCRIPT,addCommands(){return{applySuperscript:Nf((({commands:t})=>{t.setMark(this.name)})),removeSuperscript:Nf((({commands:t})=>{t.unsetMark(this.name)})),toggleSuperscript:Nf((({commands:t})=>{ze(t.isSuperscript())?t.removeSuperscript():t.applySuperscript()})),isSuperscript:Nf((({commands:t})=>{const e=t.getMark(this.name);return We((()=>!!ze(e)))}))}},parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML:()=>["sup",{class:"zw-superscript"},0]}),zh=Ip.create({name:ad.MARGIN,addGlobalAttributes:()=>[{types:[id.PARAGRAPH,id.HEADING],attributes:{[ad.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?Tf({margin:t.margin.value}):null}}}]});function Hh(t){const e=e=>t.presetsRef.value.find((t=>t.id===e)),n=function(t){return $e(t,!1),t}({default:null,link:null});return Ye(t.presetsRef,(()=>{n.default=e(t.defaultPresetId),n.link=e(t.linkPresetId)}),{immediate:!0}),[kd,xd,Sd,lf,Sf,Ed,wd,Cd,Md].concat([$d.configure({presets:t.presetsRef,defaultId:t.defaultPresetId,styleRenderer:new Xh({baseClass:t.basePresetClass,makeVariable:t.makePresetVariable,linkPresetId:t.linkPresetId})}),Gd.configure({baseClass:t.baseListClass,presetClass:t.basePresetClass+t.defaultPresetId}),jd.configure({device:t.deviceRef}),Rd.configure({minSize:t.minFontSize,maxSize:t.maxFontSize,wrapperRef:t.wrapperRef}),Id.configure({fonts:t.fonts,defaultPreset:Ve(n,"default")}),Bd,Ld,Pd,zd,Hd,Vd,jh,Ud,Kd.configure({wrapperRef:t.wrapperRef}),Ph.configure({preset:Ve(n,"link"),basePresetClass:t.basePresetClass,pageBlocks:t.pageBlocksRef}),zh])}class Vh{#e=new DOMParser;types=window;parse(t){return this.#e.parseFromString(t,"text/html")}}class Wh{content;constructor({content:t}){this.content=t}normalize(){throw new Error("Implement abstract method")}}class Uh extends Wh{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=Uh.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];#n;constructor({content:t,parser:e}){super({content:t}),this.#n=e,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this.#n.parse(this.content.replace(/(\r)?\n/g,"")),this.#r(),this.#o(),this.#i(this.#s,(t=>"BR"===t.tagName)),this.#i(this.#a,this.#u),this.#i(this.#l,(t=>"LI"===t.tagName)),this.#c(),this.#p()}get normalizedHTML(){return this.dom.body.innerHTML}get#f(){return this.#n.types.NodeFilter}get#d(){return this.#n.types.Node}#r(){const t=this.#h(this.#f.SHOW_COMMENT);this.#m(t,(t=>t.remove()))}#o(){const t=Array.from(this.dom.body.childNodes),e=this.dom.createDocumentFragment();let n;for(const r of t)this.#g(r)?(e.append(r),n=null):(n||(n=this.dom.createElement("p"),e.append(n)),n.append(r));this.dom.body.innerHTML="",this.dom.body.append(e)}#h(t,e){return this.dom.createNodeIterator(this.dom.body,t,e)}#i(t,e=(()=>!0)){const n=t=>"BODY"!==t.tagName&&e.call(this,t),r=this.#h(this.#f.SHOW_ELEMENT,{acceptNode:t=>n(t)?this.#f.FILTER_ACCEPT:this.#f.FILTER_REJECT});this.#m(r,t)}#m(t,e){let n=t.nextNode();for(;n;)e.call(this,n),n=t.nextNode()}#a(t){t.innerHTML.trim()||t.remove()}#l(t){const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes);let r,o;const i=n=>{this.#v(n,t,Uh.BLOCK_STYLES),e.append(n)};this.#v(t,t.parentElement,Uh.BLOCK_STYLES);for(const t of n)if(this.#u(t))i(t),r=null,o=t;else if("BR"===t.tagName&&o&&"BR"!==o?.tagName)t.remove(),o=t;else if("BR"!==t.tagName)r||(r=this.dom.createElement("p"),i(r)),r.append(t),o=t;else{const e=this.dom.createElement("p");e.append(t),i(e),r=null,o=t}t.append(e),this.#y(t,Uh.BLOCK_STYLES)}#u(t){return Uh.BLOCK_NODE_NAMES.includes(t.tagName)}#g(t){return Uh.ROOT_NODE_NAMES.includes(t.tagName)}#v(t,e,n){for(const r of n){const n=e.style.getPropertyValue(r);n&&!t.style.getPropertyValue(r)&&t.style.setProperty(r,n)}}#y(t,e){for(const n of e)t.style.removeProperty(n);0===t.style.length&&t.removeAttribute("style")}#s({parentElement:t}){if(!this.#u(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 i=n=>{this.#v(n,t,Uh.BLOCK_STYLES),e.append(n)};for(const t of n)"BR"!==t.tagName?o.append(t):(i(o),o=r.cloneNode());e.append(o),t.replaceWith(e)}#c(){const t=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this.#b(e)}#b(t){const e=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=this.#D(t,n),o=this.#_(r),i={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(i).filter((([,t])=>t)).map((([t])=>t.replace("_","-"))).join(" ")}}#_(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")}}#p(){const t=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this.#E(e)}#E(t){const e=t.style.backgroundColor;t.style.removeProperty("background-color"),t.style.cssText||t.removeAttribute("style");for(const n of t.childNodes){const r=this.#D(t,n),o=r.style.backgroundColor||e;r.style.backgroundColor=o}}#D(t,e){if(e.nodeType!==this.#d.TEXT_NODE)return e;const n=this.dom.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}}class qh extends Wh{normalize(){return this.#i(this.#w),this.content}#i(t){this.#C(this.content,t)}#C(t,e){for(const n of t.content)n.content&&this.#C(n,e),e.call(this,n)}#w(t){if(t.content&&t.type!==id.LIST)for(const e of t.content)if(e.marks)for(const n of e.marks.slice())this.#k(t,n)?this.#A(e,n):this.#x(t,n)&&(this.#A(e,n),this.#O(t,n))}#x(t,e){if(ad.inlineMarks.includes(e.type))return!1;if(this.#S(t,e.type))return!1;for(const n of t.content)if(n.content||t.type!==id.LIST_ITEM){if(!n.marks)return!1;if(!this.#k(n,e))return!1}return!0}#k(t,e){return t.marks?.some((t=>vd.exports.isEqual(t,e)))??!1}#S(t,e){return t.marks?.some((t=>t.type===e))??!1}#A(t,e){if(!t.marks)return;const n=this.#N(t,e.type);n>=0&&t.marks.splice(n,1),t.marks.length||delete t.marks}#O(t,e){this.#A(t,e),t.marks??=[],t.marks.push(e)}#N(t,e){return t.marks?.findIndex((t=>t.type===e))??null}}class Kh{static build(t,e={}){return"string"==typeof t?this.#T(t,e):this.#F(t)}static#T(t,e){return new Uh({content:t,parser:e.parser||new Vh})}static#F(t){return new qh({content:t})}static normalize(t,e={}){return Kh.build(t,e).normalize()}}class Jh{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 Gh{static build({config:t,nodeDomParser:e}){const n=function(t){return Dp(Tp.resolve(t))}(Hh({fonts:t.fonts,minFontSize:0,maxFontSize:0,presetsRef:je(t.presets),defaultPresetId:t.defaultPresetId,linkPresetId:t.linkPresetId,makePresetVariable:()=>"",basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:je(nd.DESKTOP),pageBlocksRef:je([]),wrapperRef:Jh.document.createElement("p")}));return new Gh({schema:n,domParser:La.fromSchema(n),nodeDomParser:e})}#M;#e;#I;constructor({schema:t,domParser:e,nodeDomParser:n}){this.#M=t,this.#e=e,this.#I=n}toJSON(t){const e=Kh.build(t,{parser:this.#I});return e.normalizeHTML(),this.#e.parse(e.dom.body).toJSON()}}class Yh{static doc(t){return{type:id.DOCUMENT,content:t}}static list(t,e){return{type:id.LIST,attrs:{bullet:{type:t}},content:e.map((t=>t.type===id.LIST_ITEM?t:this.listItem([].concat(t))))}}static listItem(...t){const{attrs:e,content:n,marks:r}=this.#$(t);return{type:id.LIST_ITEM,...e?{attrs:e}:{},...r?{marks:r}:{},content:[].concat(n).map((t=>"string"==typeof t?this.paragraph(t):t))}}static heading(t,...e){const n=this.#B(e,this.text);return n.attrs??={},n.attrs.level=t,{type:id.HEADING,...n}}static paragraph(...t){return{type:id.PARAGRAPH,...this.#B(t,this.text)}}static#B(t){const{attrs:e,content:n,marks:r}=this.#$(t);return{content:"string"==typeof n?[this.text(n)]:n,...e?{attrs:e}:{},...r?{marks:r}:{}}}static#$(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]}}static text(t,e){return{type:id.TEXT,...e?{marks:e}:{},text:t}}static mark(t,e){return{type:t,attrs:e}}static populateAllDevices(t){return{mobile:t,tablet:t,desktop:t}}}class Xh{#R;#L;#P;constructor({baseClass:t,makeVariable:e,linkPresetId:n}){this.#R=t,this.#L=e,this.#P=n}inject(t,e){let n=t.querySelector("[data-zw-styles]");n||(n=Jh.document.createElement("style"),n.dataset.zwStyles="",n.innerHTML=this.render(e),t.append(n))}render(t){let e="";for(const n of t){const t=n.id===this.#P;e+=` ${this.makePresetCssClass(n)} {`;for(const r of nd.values)for(const o of Object.keys(n[r])){const i=this.#L({device:r,preset:n,property:o}),s=this.#j(o,r);if(e+=`${s}: var(${i}, inherit);`,t){e+=`${s.replace("preset-","")}: var(${s});`}}e+="}"}return e}#j(t,e){return`--zw-preset-${"color"===t?"font-color":t.replace(/_/i,"-")}${e===nd.COMMON?"":`-${e}`}`}makePresetHtmlClass(t){return this.#R+t.id}makePresetCssClass(t){return this.makePresetHtmlClass(t).split(" ").map((t=>`.${t}`)).join("")}}class Qh{static createWindow(){return(new i.JSDOM).window}types;parse(t){const{window:e}=new i.JSDOM(t);return this.types=e,e.document}}class Zh{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(t){if(!this.name)throw new Error('Command "name" is required');let e=t.command(this.name);if(this.description&&(e=e.description(this.description)),this.argument&&(e=e.argument(this.argument)),this.options.length)for(const t of this.options)e=e.option(t.flags,t.description,t.default);e.action(this.doCommand.bind(this))}output(t){console.log(t)}}const tm=new Y,em=[class extends Zh{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:n.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(t,{config:e,format:r}){Jh.use(Qh.createWindow());const o=n.resolve(process.cwd(),e),i=Gh.build({config:require(o).editor,nodeDomParser:new Qh}),s=t.map((t=>i.toJSON(this.#z(t)))),a=1===s.length?s[0]:s,u=this.#H(a);this.output("rb"===r?this.#V(u):u)}#z(t){return t.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,((t,e)=>t.replace(e,parseFloat(e)/100)))}#H(t){return JSON.stringify(t,((t,e)=>null===e?void 0:e),2)}#V(t){return t.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,(t=>t.replace(/"/g,""))).replace(/: "(.+)"([,\n])/g,": '$1'$2")}},class extends Zh{name="version";description="display cli version";doCommand(){this.output("3.1.0-2")}}];for(const t of em)(new t).install(tm);tm.parse();
14
+ */
15
+ xd={get exports(){return Sd},set exports(t){Sd=t}},Ad=Sd,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",o=16,i=32,a=64,u=128,l=256,c=1/0,p=9007199254740991,f=NaN,d=4294967295,h=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",i],["partialRight",a],["rearg",l]],m="[object Arguments]",g="[object Array]",v="[object Boolean]",y="[object Date]",b="[object Error]",_="[object Function]",D="[object GeneratorFunction]",w="[object Map]",k="[object Number]",E="[object Object]",C="[object Promise]",x="[object RegExp]",A="[object Set]",S="[object String]",O="[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]",V=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,K=RegExp(q.source),J=RegExp(U.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\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*$/,dt=/^[-+]0x[0-9a-f]+$/i,ht=/^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="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",kt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",xt="\\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",St="['’]",Ot="["+Dt+"]",Nt="["+At+"]",Tt="["+wt+"]",Ft="\\d+",Mt="["+kt+"]",It="["+Et+"]",$t="[^"+Dt+At+Ft+kt+Et+Ct+"]",Bt="\\ud83c[\\udffb-\\udfff]",Rt="[^"+Dt+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",Pt="[\\ud800-\\udbff][\\udc00-\\udfff]",jt="["+Ct+"]",zt="\\u200d",Vt="(?:"+It+"|"+$t+")",Ht="(?:"+jt+"|"+$t+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ut="(?:"+Tt+"|"+Bt+")?",Kt="["+xt+"]?",Jt=Kt+Ut+"(?:"+zt+"(?:"+[Rt,Lt,Pt].join("|")+")"+Kt+Ut+")*",Gt="(?:"+[Mt,Lt,Pt].join("|")+")"+Jt,Yt="(?:"+[Rt+Tt+"?",Tt,Lt,Pt,Ot].join("|")+")",Xt=RegExp(St,"g"),Zt=RegExp(Tt,"g"),Qt=RegExp(Bt+"(?="+Bt+")|"+Yt+Jt,"g"),te=RegExp([jt+"?"+It+"+"+Wt+"(?="+[Nt,jt,"$"].join("|")+")",Ht+"+"+qt+"(?="+[Nt,jt+Vt,"$"].join("|")+")",jt+"?"+Vt+"+"+Wt,jt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ft,Gt].join("|"),"g"),ee=RegExp("["+zt+Dt+wt+xt+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,re=["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"],oe=-1,ie={};ie[M]=ie[I]=ie[$]=ie[B]=ie[R]=ie[L]=ie[P]=ie[j]=ie[z]=!0,ie[m]=ie[g]=ie[T]=ie[v]=ie[F]=ie[y]=ie[b]=ie[_]=ie[w]=ie[k]=ie[E]=ie[x]=ie[A]=ie[S]=ie[N]=!1;var se={};se[m]=se[g]=se[T]=se[F]=se[v]=se[y]=se[M]=se[I]=se[$]=se[B]=se[R]=se[w]=se[k]=se[E]=se[x]=se[A]=se[S]=se[O]=se[L]=se[P]=se[j]=se[z]=!0,se[b]=se[_]=se[N]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,le=parseInt,ce="object"==typeof s&&s&&s.Object===Object&&s,pe="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||pe||Function("return this")(),de=Ad&&!Ad.nodeType&&Ad,he=de&&xd&&!xd.nodeType&&xd,me=he&&he.exports===de,ge=me&&ce.process,ve=function(){try{var t=he&&he.require&&he.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=ve&&ve.isArrayBuffer,be=ve&&ve.isDate,_e=ve&&ve.isMap,De=ve&&ve.isRegExp,we=ve&&ve.isSet,ke=ve&&ve.isTypedArray;function Ee(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 Ce(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 xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Se(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 Oe(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 Ne(t,e){return!(null==t||!t.length)&&je(t,e,0)>-1}function Te(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 Fe(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 Me(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Ie(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 $e(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 Be(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 Re=We("length");function Le(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function Pe(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 je(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):Pe(t,Ve,n)}function ze(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Ve(t){return t!=t}function He(t,e){var n=null==t?0:t.length;return n?Ke(t,e)/n:f}function We(e){return function(n){return null==n?t:n[e]}}function qe(e){return function(n){return null==e?t:e[n]}}function Ue(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function Ke(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 Je(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ge(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function Ye(t){return function(e){return t(e)}}function Xe(t,e){return Fe(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function Qe(t,e){for(var n=-1,r=t.length;++n<r&&je(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length;n--&&je(e,t[n],0)>-1;);return n}function en(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var nn=qe({"À":"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"}),rn=qe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function on(t){return"\\"+ae[t]}function sn(t){return ee.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function un(t,e){return function(n){return t(e(n))}}function ln(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 cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function pn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function fn(t){return sn(t)?function(t){for(var e=Qt.lastIndex=0;Qt.test(t);)++e;return e}(t):Re(t)}function dn(t){return sn(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var mn=qe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),gn=function s(ot){var Dt=(ot=null==ot?fe:gn.defaults(fe.Object(),ot,gn.pick(fe,re))).Array,wt=ot.Date,kt=ot.Error,Et=ot.Function,Ct=ot.Math,xt=ot.Object,At=ot.RegExp,St=ot.String,Ot=ot.TypeError,Nt=Dt.prototype,Tt=Et.prototype,Ft=xt.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(xt),jt=fe._,zt=At("^"+It.call($t).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=me?ot.Buffer:t,Ht=ot.Symbol,Wt=ot.Uint8Array,qt=Vt?Vt.allocUnsafe:t,Ut=un(xt.getPrototypeOf,xt),Kt=xt.create,Jt=Ft.propertyIsEnumerable,Gt=Nt.splice,Yt=Ht?Ht.isConcatSpreadable:t,Qt=Ht?Ht.iterator:t,ee=Ht?Ht.toStringTag:t,ae=function(){try{var t=di(xt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ce=ot.clearTimeout!==fe.clearTimeout&&ot.clearTimeout,pe=wt&&wt.now!==fe.Date.now&&wt.now,de=ot.setTimeout!==fe.setTimeout&&ot.setTimeout,he=Ct.ceil,ge=Ct.floor,ve=xt.getOwnPropertySymbols,Re=Vt?Vt.isBuffer:t,qe=ot.isFinite,vn=Nt.join,yn=un(xt.keys,xt),bn=Ct.max,_n=Ct.min,Dn=wt.now,wn=ot.parseInt,kn=Ct.random,En=Nt.reverse,Cn=di(ot,"DataView"),xn=di(ot,"Map"),An=di(ot,"Promise"),Sn=di(ot,"Set"),On=di(ot,"WeakMap"),Nn=di(xt,"create"),Tn=On&&new On,Fn={},Mn=ji(Cn),In=ji(xn),$n=ji(An),Bn=ji(Sn),Rn=ji(On),Ln=Ht?Ht.prototype:t,Pn=Ln?Ln.valueOf:t,jn=Ln?Ln.toString:t;function zn(t){if(ra(t)&&!Us(t)&&!(t instanceof qn)){if(t instanceof Wn)return t;if($t.call(t,"__wrapped__"))return zi(t)}return new Wn(t)}var Vn=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 Hn(){}function Wn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function qn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Un(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=Us(t),r=!n&&qs(t),o=!n&&!r&&Ys(t),i=!n&&!r&&!o&&pa(t),s=n||r||o||i,a=s?Je(t.length,St):[],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 Zn(e){var n=e.length;return n?e[Gr(0,n-1)]:t}function Qn(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&&!Vs(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)&&Vs(o,r)&&(r!==t||n in e)||sr(e,n,r)}function rr(t,e){for(var n=t.length;n--;)if(Vs(t[n][0],e))return n;return-1}function or(t,e,n,r){return dr(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&&ae?ae(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:Sa(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=Us(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),d=f==_||f==D;if(Ys(e))return Co(e,u);if(f==E||f==m||d&&!i){if(a=l||d?{}: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,hi(t),e)}(e,ir(a,e))}else{if(!se[f])return i?e:{};a=function(t,e,n){var r,o=t.constructor;switch(e){case T:return xo(t);case v:case y:return new o(+t);case F:return function(t,e){var n=e?xo(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 Ao(t,n);case w:return new o;case k:case S:return new o(t);case x:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case A:return new o;case O:return r=t,Pn?xt(Pn.call(r)):{}}}(e,f,u)}}s||(s=new Yn);var h=s.get(e);if(h)return h;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 g=p?t:(c?l?si:ii:l?Ia:Ma)(e);return xe(g||e,(function(t,o){g&&(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=xt(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 Ot(e);return Mi((function(){n.apply(t,o)}),r)}function fr(t,e,n,r){var o=-1,i=Ne,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;n&&(e=Fe(e,Ye(n))),r?(i=Te,s=!1):e.length>=200&&(i=Ze,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=Hn.prototype,zn.prototype.constructor=zn,Wn.prototype=Vn(Hn.prototype),Wn.prototype.constructor=Wn,qn.prototype=Vn(Hn.prototype),qn.prototype.constructor=qn,Un.prototype.clear=function(){this.__data__=Nn?Nn(null):{},this.size=0},Un.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Un.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},Un.prototype.has=function(e){var n=this.__data__;return Nn?n[e]!==t:$t.call(n,e)},Un.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():Gt.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 Un,map:new(xn||Kn),string:new Un}},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(!xn||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 dr=$o(Dr),hr=$o(wr,!0);function mr(t,e){var n=!0;return dr(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 dr(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):Me(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 kr(t,e){return Oe(e,(function(e){return Qs(t[e])}))}function Er(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 Cr(t,e,n){var r=e(t);return Us(t)?r:Me(r,n(t))}function xr(e){return null==e?e===t?"[object Undefined]":"[object Null]":ee&&ee in xt(e)?function(e){var n=$t.call(e,ee),r=e[ee];try{e[ee]=t;var o=!0}catch(t){}var i=Lt.call(e);return o&&(n?e[ee]=r:delete e[ee]),i}(e):function(t){return Lt.call(t)}(e)}function Ar(t,e){return t>e}function Sr(t,e){return null!=t&&$t.call(t,e)}function Or(t,e){return null!=t&&e in xt(t)}function Nr(e,n,r){for(var o=r?Te:Ne,i=e[0].length,s=e.length,a=s,u=Dt(s),l=1/0,c=[];a--;){var p=e[a];a&&n&&(p=Fe(p,Ye(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,d=u[0];t:for(;++f<i&&c.length<l;){var h=p[f],m=n?n(h):h;if(h=r||0!==h?h:0,!(d?Ze(d,m):o(c,m,r))){for(a=s;--a;){var g=u[a];if(!(g?Ze(g,m):o(e[a],m,r)))continue t}d&&d.push(m),c.push(h)}}return c}function Tr(e,n,r){var o=null==(e=Oi(e,n=Do(n,e)))?e:e[Pi(Zi(n))];return null==o?t:Ee(o,e,r)}function Fr(t){return ra(t)&&xr(t)==m}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=Us(e),u=Us(n),l=a?g:gi(e),c=u?g:gi(n),p=(l=l==m?E:l)==E,f=(c=c==m?E:c)==E,d=l==c;if(d&&Ys(e)){if(!Ys(n))return!1;a=!0,p=!1}if(d&&!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 v:case y:case k:return Vs(+t,+e);case b:return t.name==e.name&&t.message==e.message;case x:case S:return t==e+"";case w:var a=an;case A:var u=1&r;if(a||(a=cn),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 O:if(Pn)return Pn.call(t)==Pn.call(e)}return!1}(e,n,l,r,o,i,s);if(!(1&r)){var h=p&&$t.call(e,"__wrapped__"),_=f&&$t.call(n,"__wrapped__");if(h||_){var D=h?e.value():e,C=_?n.value():n;return s||(s=new Yn),i(D,C,r,o,s)}}return!!d&&(s||(s=new Yn),function(e,n,r,o,i,s){var a=1&r,u=ii(e),l=u.length,c=ii(n),p=c.length;if(l!=p&&!a)return!1;for(var f=l;f--;){var d=u[f];if(!(a?d in n:$t.call(n,d)))return!1}var h=s.get(e),m=s.get(n);if(h&&m)return h==n&&m==e;var g=!0;s.set(e,n),s.set(n,e);for(var v=a;++f<l;){var y=e[d=u[f]],b=n[d];if(o)var _=a?o(b,y,d,n,e,s):o(y,b,d,e,n,s);if(!(_===t?y===b||i(y,b,r,o,s):_)){g=!1;break}v||(v="constructor"==d)}if(g&&!v){var D=e.constructor,w=n.constructor;D==w||!("constructor"in e)||!("constructor"in n)||"function"==typeof D&&D instanceof D&&"function"==typeof w&&w instanceof w||(g=!1)}return s.delete(e),s.delete(n),g}(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=xt(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 d=o(c,p,l,e,n,f);if(!(d===t?Mr(p,c,3,o,f):d))return!1}}return!0}function $r(t){return!(!na(t)||(e=t,Rt&&Rt in e))&&(Qs(t)?zt:mt).test(ji(t));var e}function Br(t){return"function"==typeof t?t:null==t?iu:"object"==typeof t?Us(t)?Vr(t[0],t[1]):zr(t):hu(t)}function Rr(t){if(!Ci(t))return yn(t);var e=[];for(var n in xt(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 xt(t))e.push(n);return e}(t);var e=Ci(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 dr(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]?Ai(e[0][0],e[0][1]):function(n){return n===t||Ir(n,t,e)}}function Vr(e,n){return wi(e)&&xi(n)?Ai(Pi(e),n):function(r){var o=Sa(r,e);return o===t&&o===n?Oa(r,e):Mr(n,o,3)}}function Hr(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 d=Us(l),h=!d&&Ys(l),m=!d&&!h&&pa(l);p=l,d||h||m?Us(u)?p=u:Gs(u)?p=To(u):h?(f=!1,p=Co(l,!0)):m?(f=!1,p=Ao(l,!0)):p=[]:sa(l)||qs(l)?(p=u,qs(u)?p=ba(u):na(u)&&!Qs(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,Hr,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 qr(t,e,n){e=e.length?Fe(e,(function(t){return Us(t)?function(e){return Er(e,1===t.length?t[0]:t)}:t})):[iu];var r=-1;e=Fe(e,Ye(ci()));var o=jr(t,(function(t,n,o){var i=Fe(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=So(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 Ur(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var s=e[r],a=Er(t,s);n(a,s)&&to(i,Do(s,t),a)}return i}function Kr(t,e,n,r){var o=r?ze:je,i=-1,s=e.length,a=t;for(t===e&&(e=To(e)),n&&(a=Fe(t,Ye(n)));++i<s;)for(var u=0,l=e[i],c=n?n(l):l;(u=o(a,c,u,r))>-1;)a!==t&&Gt.call(a,u,1),Gt.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)?Gt.call(t,o,1):fo(t,o)}}return t}function Gr(t,e){return t+ge(kn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>p)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Ii(Si(t,e,iu),t+"")}function Zr(t){return Zn(Va(t))}function Qr(t,e){var n=Va(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=ae?function(t,e){return ae(t,"toString",{configurable:!0,enumerable:!1,value:nu(e),writable:!0})}:iu;function ro(t){return Ri(Va(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 dr(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=ge((i+s)/2),f=r(e[p]),d=f!==t,h=null===f,m=f==f,g=ca(f);if(a)var v=o||m;else v=c?m&&(o||d):u?m&&d&&(o||!h):l?m&&d&&!h&&(o||!g):!h&&!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||!Vs(a,u)){var u=a;i[o++]=0===s?0:s}}return i}function lo(t){return"number"==typeof t?t:ca(t)?f:+t}function co(t){if("string"==typeof t)return t;if(Us(t))return Fe(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=Ne,i=t.length,s=!0,a=[],u=a;if(n)s=!1,o=Te;else if(i>=200){var l=e?null:Xo(t);if(l)return cn(l);s=!1,o=Ze,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=Oi(t,e=Do(e,t)))||delete t[Pi(Zi(e))]}function ho(t,e,n,r){return to(t,e,n(Er(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 qn&&(n=n.value()),Ie(e,(function(t,e){return e.func.apply(e.thisArg,Me([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 Us(t)?t:wi(t,e)?[t]:Li(_a(t))}var wo=Xr;function ko(e,n,r){var o=e.length;return r=r===t?o:r,!n&&r>=o?e:oo(e,n,r)}var Eo=ce||function(t){return fe.clearTimeout(t)};function Co(t,e){if(e)return t.slice();var n=t.length,r=qt?qt(n):new t.constructor(n);return t.copy(r),r}function xo(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Ao(t,e){var n=e?xo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function So(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 Oo(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 d=o;++u<l;)p[d+u]=e[u];for(;++s<a;)(f||o<i)&&(p[d+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=Us(n)?Ce: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=xt(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=xt(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=xt(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=sn(n=_a(n))?dn(n):t,o=r?r[0]:n.charAt(0),i=r?ko(r,1).join(""):n.slice(1);return o[e]()+i}}function Lo(t){return function(e){return Ie(Qa(qa(e).replace(Xt,"")),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=Vn(t.prototype),r=t.apply(n,e);return na(r)?r:n}}function jo(e){return function(n,r,o){var i=xt(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 Ot(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&&ki(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ui(c[0])].apply(u,c[3]):1==a.length&&ki(a)?u[l]():u.thru(a)}return function(){var t=arguments,e=t[0];if(u&&1==t.length&&Us(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 Vo(e,n,r,o,i,s,a,l,c,p){var f=n&u,d=1&n,h=2&n,m=24&n,g=512&n,v=h?t:Po(e);return function t(){for(var u=arguments.length,y=Dt(u),b=u;b--;)y[b]=arguments[b];if(m)var _=li(t),D=en(y,_);if(o&&(y=Oo(y,o,i,m)),s&&(y=No(y,s,a,m)),u-=D,m&&u<p){var w=ln(y,_);return Go(e,n,Vo,t.placeholder,r,y,w,l,c,p-u)}var k=d?r:this,E=h?k[e]:e;return u=y.length,l?y=Ni(y,l):g&&u>1&&y.reverse(),f&&c<u&&(y.length=c),this&&this!==fe&&this instanceof t&&(E=v||Po(E)),E.apply(k,y)}}function Ho(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 qo(t){return oi((function(e){return e=Fe(e,Ye(ci())),Xr((function(n){var r=this;return t(e,(function(t){return Ee(t,r,n)}))}))}))}function Uo(e,n){var r=(n=n===t?" ":co(n)).length;if(r<2)return r?Yr(n,e):n;var o=Yr(n,he(e/fn(n)));return sn(n)?ko(dn(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(he((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,s,u,l,c,p,f){var d=8&n;n|=d?i:a,4&(n&=~(d?a:i))||(n&=-4);var h=[e,n,s,d?u:t,d?l:t,d?t:u,d?t:l,c,p,f],m=r.apply(t,h);return ki(e)&&Fi(m,h),m.placeholder=o,$i(m,e,n)}function Yo(t){var e=Ct[t];return function(t,n){if(t=ya(t),(n=null==n?0:_n(ga(n),292))&&qe(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=Sn&&1/cn(new Sn([,-0]))[1]==c?function(t){return new Sn(t)}:cu;function Zo(t){return function(e){var n=gi(e);return n==w?an(e):n==A?pn(e):function(t,e){return Fe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Qo(n,s,c,p,f,d,h,m){var g=2&s;if(!g&&"function"!=typeof n)throw new Ot(e);var v=p?p.length:0;if(v||(s&=-97,p=f=t),h=h===t?h:bn(ga(h),0),m=m===t?m:ga(m),v-=f?f.length:0,s&a){var y=p,b=f;p=f=t}var _=g?t:ai(n),D=[n,s,c,p,f,y,b,d,h,m];if(_&&function(t,e){var n=t[1],o=e[1],i=n|o,s=i<131,a=o==u&&8==n||o==u&&n==l&&t[7].length<=e[8]||384==o&&e[7].length<=e[8]&&8==n;if(!s&&!a)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?Oo(p,c,e[4]):c,t[4]=p?ln(t[3],r):e[4]}(c=e[5])&&(p=t[5],t[5]=p?No(p,c,e[6]):c,t[6]=p?ln(t[5],r):e[6]),(c=e[7])&&(t[7]=c),o&u&&(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],s=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&s&&(s&=-25),s&&1!=s)w=8==s||s==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?[]:ln(a,l);return(s-=c.length)<r?Go(e,n,Vo,i.placeholder,t,a,c,t,t,r-s):Ee(this&&this!==fe&&this instanceof i?o:e,this,a)}}(n,s,m):s!=i&&33!=s||f.length?Vo.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!==fe&&this instanceof e?i:t;++u<l;)c[u]=r[u];for(;a--;)c[u++]=arguments[++s];return Ee(p,o?n:this,c)}}(n,s,c,p);else var w=function(t,e,n){var r=1&e,o=Po(t);return function e(){return(this&&this!==fe&&this instanceof e?o:t).apply(r?n:this,arguments)}}(n,s,c);return $i((_?eo:Fi)(w,D),n,s)}function ti(e,n,r,o){return e===t||Vs(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),Hr(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,d=!0,h=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;d=!1;break}if(h){if(!Be(n,(function(t,e){if(!Ze(h,e)&&(m===t||i(m,t,r,o,s)))return h.push(e)}))){d=!1;break}}else if(m!==g&&!i(m,g,r,o,s)){d=!1;break}}return s.delete(e),s.delete(n),d}function oi(e){return Ii(Si(e,t,Ki),e+"")}function ii(t){return Cr(t,Ma,hi)}function si(t){return Cr(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,xi(o)]}return e}function di(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return $r(r)?r:t}var hi=ve?function(t){return null==t?[]:(t=xt(t),Oe(ve(t),(function(e){return Jt.call(t,e)})))}:vu,mi=ve?function(t){for(var e=[];t;)Me(e,hi(t)),t=Ut(t);return e}:vu,gi=xr;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)&&(Us(t)||qs(t))}function yi(t){return"function"!=typeof t.constructor||Ci(t)?{}:Vn(Ut(t))}function bi(t){return Us(t)||qs(t)||!!(Yt&&t&&t[Yt])}function _i(t,e){var n=typeof t;return!!(e=null==e?p: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)&&Vs(n[e],t)}function wi(t,e){if(Us(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ca(t))||Q.test(t)||!Z.test(t)||null!=e&&t in xt(e)}function ki(t){var e=ui(t),n=zn[e];if("function"!=typeof n||!(e in qn.prototype))return!1;if(t===n)return!0;var r=ai(n);return!!r&&t===r[0]}(Cn&&gi(new Cn(new ArrayBuffer(1)))!=F||xn&&gi(new xn)!=w||An&&gi(An.resolve())!=C||Sn&&gi(new Sn)!=A||On&&gi(new On)!=N)&&(gi=function(e){var n=xr(e),r=n==E?e.constructor:t,o=r?ji(r):"";if(o)switch(o){case Mn:return F;case In:return w;case $n:return C;case Bn:return A;case Rn:return N}return n});var Ei=Mt?Qs:yu;function Ci(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ft)}function xi(t){return t==t&&!na(t)}function Ai(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in xt(r))}}function Si(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),Ee(e,this,a)}}function Oi(t,e){return e.length<2?t:Er(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 fe.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 xe(h,(function(n){var r="_."+n[0];e&n[1]&&!Ne(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 qn)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 Vi=Xr((function(t,e){return Gs(t)?fr(t,yr(e,1,Gs,!0)):[]})),Hi=Xr((function(e,n){var r=Zi(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=Zi(n);return Gs(r)&&(r=t),Gs(e)?fr(e,yr(n,1,Gs,!0),t,r):[]}));function qi(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)),Pe(t,ci(e,3),o)}function Ui(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)),Pe(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=Fe(t,bo);return e.length&&e[0]===t[0]?Nr(e):[]})),Yi=Xr((function(e){var n=Zi(e),r=Fe(e,bo);return n===Zi(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Nr(r,ci(n,2)):[]})),Xi=Xr((function(e){var n=Zi(e),r=Fe(e,bo);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Nr(r,t,n):[]}));function Zi(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Qi=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,Fe(e,(function(t){return _i(t,n)?+t:t})).sort(So)),r}));function ns(t){return null==t?t:En.call(t)}var rs=Xr((function(t){return po(yr(t,1,Gs,!0))})),os=Xr((function(e){var n=Zi(e);return Gs(n)&&(n=t),po(yr(e,1,Gs,!0),ci(n,2))})),is=Xr((function(e){var n=Zi(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=Oe(t,(function(t){if(Gs(t))return e=bn(t.length,e),!0})),Je(e,(function(e){return Fe(t,We(e))}))}function as(e,n){if(!e||!e.length)return[];var r=ss(e);return null==n?r:Fe(r,(function(e){return Ee(n,t,e)}))}var us=Xr((function(t,e){return Gs(t)?fr(t,e):[]})),ls=Xr((function(t){return vo(Oe(t,Gs))})),cs=Xr((function(e){var n=Zi(e);return Gs(n)&&(n=t),vo(Oe(e,Gs),ci(n,2))})),ps=Xr((function(e){var n=Zi(e);return n="function"==typeof n?n:t,vo(Oe(e,Gs),t,n)})),fs=Xr(ss),ds=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 hs(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 qn&&_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(qi),bs=jo(Ui);function _s(t,e){return(Us(t)?xe:dr)(t,ci(e,3))}function Ds(t,e){return(Us(t)?Ae:hr)(t,ci(e,3))}var ws=Mo((function(t,e,n){$t.call(t,n)?t[n].push(e):sr(t,n,[e])})),ks=Xr((function(t,e,n){var r=-1,o="function"==typeof e,i=Js(t)?Dt(t.length):[];return dr(t,(function(t){i[++r]=o?Ee(e,t,n):Tr(t,e,n)})),i})),Es=Mo((function(t,e,n){sr(t,n,e)}));function Cs(t,e){return(Us(t)?Fe:jr)(t,ci(e,3))}var xs=Mo((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),As=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]]),qr(t,yr(e,1),[])})),Ss=pe||function(){return fe.Date.now()};function Os(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Qo(e,u,t,t,t,t,n)}function Ns(n,r){var o;if("function"!=typeof r)throw new Ot(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=ln(n,li(Ts));r|=i}return Qo(t,r,e,n,o)})),Fs=Xr((function(t,e,n){var r=3;if(n.length){var o=ln(n,li(Fs));r|=i}return Qo(e,r,t,n,o)}));function Ms(n,r,o){var i,s,a,u,l,c,p=0,f=!1,d=!1,h=!0;if("function"!=typeof n)throw new Ot(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||d&&e-p>=a}function y(){var t=Ss();if(v(t))return b(t);l=Mi(y,function(t){var e=r-(t-c);return d?_n(e,a-(t-p)):e}(t))}function b(e){return l=t,h&&i?m(e):(i=s=t,u)}function _(){var e=Ss(),n=v(e);if(i=arguments,s=this,c=e,n){if(l===t)return g(c);if(d)return Eo(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=(d="maxWait"in o)?bn(ya(o.maxWait)||0,r):a,h="trailing"in o?!!o.trailing:h),_.cancel=function(){l!==t&&Eo(l),p=0,i=c=s=l=t},_.flush=function(){return l===t?u:b(Ss())},_}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 Ot(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 Ot(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&&Us(e[0])?Fe(e[0],Ye(ci())):Fe(yr(e,1),Ye(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 Ee(t,this,r)}))})),Ps=Xr((function(e,n){var r=ln(n,li(Ps));return Qo(e,i,t,n,r)})),js=Xr((function(e,n){var r=ln(n,li(js));return Qo(e,a,t,n,r)})),zs=oi((function(e,n){return Qo(e,l,t,t,t,n)}));function Vs(t,e){return t===e||t!=t&&e!=e}var Hs=Jo(Ar),Ws=Jo((function(t,e){return t>=e})),qs=Fr(function(){return arguments}())?Fr:function(t){return ra(t)&&$t.call(t,"callee")&&!Jt.call(t,"callee")},Us=Dt.isArray,Ks=ye?Ye(ye):function(t){return ra(t)&&xr(t)==T};function Js(t){return null!=t&&ea(t.length)&&!Qs(t)}function Gs(t){return ra(t)&&Js(t)}var Ys=Re||yu,Xs=be?Ye(be):function(t){return ra(t)&&xr(t)==y};function Zs(t){if(!ra(t))return!1;var e=xr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Qs(t){if(!na(t))return!1;var e=xr(t);return e==_||e==D||"[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<=p}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=_e?Ye(_e):function(t){return ra(t)&&gi(t)==w};function ia(t){return"number"==typeof t||ra(t)&&xr(t)==k}function sa(t){if(!ra(t)||xr(t)!=E)return!1;var e=Ut(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=De?Ye(De):function(t){return ra(t)&&xr(t)==x},ua=we?Ye(we):function(t){return ra(t)&&gi(t)==A};function la(t){return"string"==typeof t||!Us(t)&&ra(t)&&xr(t)==S}function ca(t){return"symbol"==typeof t||ra(t)&&xr(t)==O}var pa=ke?Ye(ke):function(t){return ra(t)&&ea(t.length)&&!!ie[xr(t)]},fa=Jo(Pr),da=Jo((function(t,e){return t<=e}));function ha(t){if(!t)return[];if(Js(t))return la(t)?dn(t):To(t);if(Qt&&t[Qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Qt]());var e=gi(t);return(e==w?an:e==A?cn:Va)(t)}function ma(t){return t?(t=ya(t))===c||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,d):0}function ya(t){if("number"==typeof t)return t;if(ca(t))return f;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=Ge(t);var n=ht.test(t);return n||gt.test(t)?le(t.slice(2),n?2:8):dt.test(t)?f:+t}function ba(t){return Fo(t,Ia(t))}function _a(t){return null==t?"":co(t)}var Da=Io((function(t,e){if(Ci(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)})),ka=Io((function(t,e,n,r){Fo(e,Ia(e),t,r)})),Ea=Io((function(t,e,n,r){Fo(e,Ma(e),t,r)})),Ca=oi(ar),xa=Xr((function(e,n){e=xt(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||Vs(p,Ft[c])&&!$t.call(e,c))&&(e[c]=s[c])}return e})),Aa=Xr((function(e){return e.push(t,ei),Ee(Ba,t,e)}));function Sa(e,n,r){var o=null==e?t:Er(e,n);return o===t?r:o}function Oa(t,e){return null!=t&&vi(t,e,Or)}var Na=Ho((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),nu(iu)),Ta=Ho((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){Hr(t,e,n)})),Ba=Io((function(t,e,n,r){Hr(t,e,n,r)})),Ra=oi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Fe(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 Ur(t,e,(function(e,n){return Oa(t,n)}))}(t,e)}));function Pa(t,e){if(null==t)return{};var n=Fe(si(t),(function(t){return[t]}));return e=ci(e),Ur(t,n,(function(t,n){return e(t,n[0])}))}var ja=Zo(Ma),za=Zo(Ia);function Va(t){return null==t?[]:Xe(t,Ma(t))}var Ha=Lo((function(t,e,n){return e=e.toLowerCase(),t+(n?Wa(e):e)}));function Wa(t){return Za(_a(t).toLowerCase())}function qa(t){return(t=_a(t))&&t.replace(yt,nn).replace(Zt,"")}var Ua=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?" ":"")+Za(e)})),Xa=Lo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Za=Ro("toUpperCase");function Qa(e,n,r){return e=_a(e),(n=r?t:n)===t?function(t){return ne.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(n)||[]}var tu=Xr((function(e,n){try{return Ee(e,t,n)}catch(t){return Zs(t)?t:new kt(t)}})),eu=oi((function(t,e){return xe(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=kr(e,r);null!=n||na(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=kr(e,Ma(e)));var i=!(na(n)&&"chain"in n&&!n.chain),s=Qs(t);return xe(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,Me([this.value()],arguments))})})),t}function cu(){}var pu=qo(Fe),fu=qo(Se),du=qo(Be);function hu(t){return wi(t)?We(Pi(t)):function(t){return function(e){return Er(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),ku=Yo("floor"),Eu=Wo((function(t,e){return t*e}),1),Cu=Yo("round"),xu=Wo((function(t,e){return t-e}),0);return zn.after=function(t,n){if("function"!=typeof n)throw new Ot(e);return t=ga(t),function(){if(--t<1)return n.apply(this,arguments)}},zn.ary=Os,zn.assign=Da,zn.assignIn=wa,zn.assignInWith=ka,zn.assignWith=Ea,zn.at=Ca,zn.before=Ns,zn.bind=Ts,zn.bindAll=eu,zn.bindKey=Fs,zn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Us(t)?t:[t]},zn.chain=hs,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(he(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 Me(Us(n)?To(n):[n],yr(e,1))},zn.cond=function(t){var n=null==t?0:t.length,r=ci();return t=n?Fe(t,(function(t){if("function"!=typeof t[1])throw new Ot(e);return[r(t[0]),t[1]]})):[],Xr((function(e){for(var r=-1;++r<n;){var o=t[r];if(Ee(o[0],this,e))return Ee(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=Vn(t);return null==e?n:ir(n,e)},zn.curry=function e(n,r,o){var i=Qo(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=Qo(n,o,t,t,t,t,t,r=i?t:r);return s.placeholder=e.placeholder,s},zn.debounce=Ms,zn.defaults=xa,zn.defaultsDeep=Aa,zn.defer=Is,zn.delay=$s,zn.difference=Vi,zn.differenceBy=Hi,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(Us(t)?Oe:vr)(t,ci(e,3))},zn.flatMap=function(t,e){return yr(Cs(t,e),1)},zn.flatMapDeep=function(t,e){return yr(Cs(t,e),c)},zn.flatMapDepth=function(e,n,r){return r=r===t?1:ga(r),yr(Cs(e,n),r)},zn.flatten=Ki,zn.flattenDeep=function(t){return null!=t&&t.length?yr(t,c):[]},zn.flattenDepth=function(e,n){return null!=e&&e.length?yr(e,n=n===t?1:ga(n)):[]},zn.flip=function(t){return Qo(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?[]:kr(t,Ma(t))},zn.functionsIn=function(t){return null==t?[]:kr(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=ks,zn.iteratee=su,zn.keyBy=Es,zn.keys=Ma,zn.keysIn=Ia,zn.map=Cs,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 Vr(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?[]:(Us(n)||(n=null==n?[]:[n]),Us(r=o?t:r)||(r=null==r?[]:[r]),qr(e,n,r))},zn.over=pu,zn.overArgs=Ls,zn.overEvery=fu,zn.overSome=du,zn.partial=Ps,zn.partialRight=js,zn.partition=xs,zn.pick=La,zn.pickBy=Pa,zn.property=hu,zn.propertyOf=function(e){return function(n){return null==e?t:Er(e,n)}},zn.pull=Qi,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(Us(t)?Oe: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 Ot(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),(Us(e)?Qn:Qr)(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(Us(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=As,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?d:r>>>0)?(e=_a(e))&&("string"==typeof n||null!=n&&!aa(n))&&!(n=co(n))&&sn(e)?ko(dn(e),0,r):e.split(n,r):[]},zn.spread=function(t,n){if("function"!=typeof t)throw new Ot(e);return n=null==n?0:bn(ga(n),0),Xr((function(e){var r=e[n],o=ko(e,0,n);return r&&Me(o,r),Ee(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 Ot(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=ha,zn.toPairs=ja,zn.toPairsIn=za,zn.toPath=function(t){return Us(t)?Fe(t,Pi):ca(t)?[t]:To(Li(_a(t)))},zn.toPlainObject=ba,zn.transform=function(t,e,n){var r=Us(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)&&Qs(i)?Vn(Ut(t)):{}}return(o?xe:Dr)(t,(function(t,r,o){return e(n,t,r,o)})),n},zn.unary=function(t){return Os(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=Va,zn.valuesIn=function(t){return null==t?[]:Xe(t,Ia(t))},zn.without=us,zn.words=Qa,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=ds,zn.entries=ja,zn.entriesIn=za,zn.extend=wa,zn.extendWith=ka,lu(zn,zn),zn.add=_u,zn.attempt=tu,zn.camelCase=Ha,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=qa,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=Vs,zn.escape=function(t){return(t=_a(t))&&J.test(t)?t.replace(U,rn):t},zn.escapeRegExp=function(t){return(t=_a(t))&&nt.test(t)?t.replace(et,"\\$&"):t},zn.every=function(e,n,r){var o=Us(e)?Se:mr;return r&&Di(e,n,r)&&(n=t),o(e,ci(n,3))},zn.find=ys,zn.findIndex=qi,zn.findKey=function(t,e){return Le(t,ci(e,3),Dr)},zn.findLast=bs,zn.findLastIndex=Ui,zn.findLastKey=function(t,e){return Le(t,ci(e,3),wr)},zn.floor=ku,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=Sa,zn.gt=Hs,zn.gte=Ws,zn.has=function(t,e){return null!=t&&vi(t,e,Sr)},zn.hasIn=Oa,zn.head=Ji,zn.identity=iu,zn.includes=function(t,e,n,r){t=Js(t)?t:Va(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&&je(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)),je(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=qs,zn.isArray=Us,zn.isArrayBuffer=Ks,zn.isArrayLike=Js,zn.isArrayLikeObject=Gs,zn.isBoolean=function(t){return!0===t||!1===t||ra(t)&&xr(t)==v},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)&&(Us(t)||"string"==typeof t||"function"==typeof t.splice||Ys(t)||pa(t)||qs(t)))return!t.length;var e=gi(t);if(e==w||e==A)return!t.size;if(Ci(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=Zs,zn.isFinite=function(t){return"number"==typeof t&&qe(t)},zn.isFunction=Qs,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(Ei(t))throw new kt("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<=p},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]"==xr(t)},zn.join=function(t,e){return null==t?"":vn.call(t,e)},zn.kebabCase=Ua,zn.last=Zi,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):Pe(e,Ve,i,!0)},zn.lowerCase=Ka,zn.lowerFirst=Ja,zn.lt=fa,zn.lte=da,zn.max=function(e){return e&&e.length?gr(e,iu,Ar):t},zn.maxBy=function(e,n){return e&&e.length?gr(e,ci(n,2),Ar):t},zn.mean=function(t){return He(t,iu)},zn.meanBy=function(t,e){return He(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=Eu,zn.nth=function(e,n){return e&&e.length?Wr(e,ga(n)):t},zn.noConflict=function(){return fe._===this&&(fe._=jt),this},zn.noop=cu,zn.now=Ss,zn.pad=function(t,e,n){t=_a(t);var r=(e=ga(e))?fn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Uo(ge(o),n)+t+Uo(he(o),n)},zn.padEnd=function(t,e,n){t=_a(t);var r=(e=ga(e))?fn(t):0;return e&&r<e?t+Uo(e-r,n):t},zn.padStart=function(t,e,n){t=_a(t);var r=(e=ga(e))?fn(t):0;return e&&r<e?Uo(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=kn();return _n(e+i*(n-e+ue("1e-"+((i+"").length-1))),n)}return Gr(e,n)},zn.reduce=function(t,e,n){var r=Us(t)?Ie:Ue,o=arguments.length<3;return r(t,ci(e,4),n,o,dr)},zn.reduceRight=function(t,e,n){var r=Us(t)?$e:Ue,o=arguments.length<3;return r(t,ci(e,4),n,o,hr)},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=Qs(s)?s.call(e):s}return e},zn.round=Cu,zn.runInContext=s,zn.sample=function(t){return(Us(t)?Zn:Zr)(t)},zn.size=function(t){if(null==t)return 0;if(Js(t))return la(t)?fn(t):t.length;var e=gi(t);return e==w||e==A?t.size:Rr(t).length},zn.snakeCase=Ga,zn.some=function(e,n,r){var o=Us(e)?Be: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&&Vs(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(Vs(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=xu,zn.sum=function(t){return t&&t.length?Ke(t,iu):0},zn.sumBy=function(t,e){return t&&t.length?Ke(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=ka({},n,o,ti);var i,s,a=ka({},n.imports,o.imports,ti),u=Ma(a),l=Xe(a,u),c=0,p=n.interpolate||bt,f="__p += '",d=At((n.escape||bt).source+"|"+p.source+"|"+(p===X?pt:bt).source+"|"+(n.evaluate||bt).source+"|$","g"),h="//# sourceURL="+($t.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";e.replace(d,(function(t,n,r,o,a,u){return r||(r=o),f+=e.slice(c,u).replace(_t,on),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 kt("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(s?f.replace(V,""):f).replace(H,"$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 Et(u,h+"return "+f).apply(t,l)}));if(g.source=f,Zs(g))throw g;return g},zn.times=function(t,e){if((t=ga(t))<1||t>p)return[];var n=d,r=_n(t,d);e=ci(e),t-=d;for(var o=Je(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,p):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 Ge(e);if(!e||!(n=co(n)))return e;var o=dn(e),i=dn(n);return ko(o,Qe(o,i),tn(o,i)+1).join("")},zn.trimEnd=function(e,n,r){if((e=_a(e))&&(r||n===t))return e.slice(0,hn(e)+1);if(!e||!(n=co(n)))return e;var o=dn(e);return ko(o,0,tn(o,dn(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=dn(e);return ko(o,Qe(o,dn(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(sn(e)){var a=dn(e);s=a.length}if(r>=s)return e;var u=r-fn(o);if(u<1)return o;var l=a?ko(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=At(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 d=l.lastIndexOf(i);d>-1&&(l=l.slice(0,d))}return l+o},zn.unescape=function(t){return(t=_a(t))&&K.test(t)?t.replace(q,mn):t},zn.uniqueId=function(t){var e=++Bt;return _a(t)+e},zn.upperCase=Xa,zn.upperFirst=Za,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",xe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){zn[t].placeholder=zn})),xe(["drop","take"],(function(e,n){qn.prototype[e]=function(r){r=r===t?1:bn(ga(r),0);var o=this.__filtered__&&!n?new qn(this):this.clone();return o.__filtered__?o.__takeCount__=_n(r,o.__takeCount__):o.__views__.push({size:_n(r,d),type:e+(o.__dir__<0?"Right":"")}),o},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),xe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;qn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ci(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),xe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");qn.prototype[t]=function(){return this[n](1).value()[0]}})),xe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");qn.prototype[t]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(iu)},qn.prototype.find=function(t){return this.filter(t).head()},qn.prototype.findLast=function(t){return this.reverse().find(t)},qn.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new qn(this):this.map((function(n){return Tr(n,t,e)}))})),qn.prototype.reject=function(t){return this.filter(Rs(ci(t)))},qn.prototype.slice=function(e,n){e=ga(e);var r=this;return r.__filtered__&&(e>0||n<0)?new qn(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)},qn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},qn.prototype.toArray=function(){return this.take(d)},Dr(qn.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 qn,l=a[0],c=u||Us(n),p=function(t){var e=i.apply(zn,Me([t],a));return o&&f?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,d=!!this.__actions__.length,h=s&&!f,m=u&&!d;if(!s&&c){n=m?n:new qn(this);var g=e.apply(n,a);return g.__actions__.push({func:ms,args:[p],thisArg:t}),new Wn(g,f)}return h&&m?e.apply(this,a):(g=this.thru(p),h?o?g.value()[0]:g.value():g)})})),xe(["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(Us(o)?o:[],t)}return this[n]((function(n){return e.apply(Us(n)?n:[],t)}))}})),Dr(qn.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[Vo(t,2).name]=[{name:"wrapper",func:t}],qn.prototype.clone=function(){var t=new qn(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},qn.prototype.reverse=function(){if(this.__filtered__){var t=new qn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},qn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Us(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,d=_n(u,this.__takeCount__);if(!n||!r&&o==u&&d==u)return go(t,this.__actions__);var h=[];t:for(;u--&&f<d;){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}}h[f++]=g}return h},zn.prototype.at=gs,zn.prototype.chain=function(){return hs(this)},zn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},zn.prototype.next=function(){this.__values__===t&&(this.__values__=ha(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 Hn;){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 qn){var n=e;return this.__actions__.length&&(n=new qn(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,Qt&&(zn.prototype[Qt]=function(){return this}),zn}();he?((he.exports=gn)._=gn,de._=gn):fe._=gn}.call(s);const Nd=Hp.create({name:"node_processor",addCommands:()=>({setBlockAttributes:zf((({commands:t,state:e},n,r,o={})=>{const i=Pe(t.getBlockAttributes(n))??{},{doc:s,tr:a}=e,{from:u,to:l}=a.selection;s.nodesBetween(u,l,((t,e)=>{gd.blocks.includes(t.type.name)&&a.setNodeAttribute(e,n,{...o,...i,...r})}))})),getBlockAttributes:zf((({editor:t},e,n)=>Ve((()=>{let r=Object.assign({},n||{});for(const n of gd.blocks)Object.assign(r,t.getAttributes(n)?.[e]||{});return Object.keys(r).length?r:null})))),removeBlockAttributes:zf((({commands:t},e)=>{for(const n of gd.blocks)t.resetAttributes(n,e)})),applyMark:zf((({state:t,commands:e},n,r,o={})=>{const{tr:i,doc:s,schema:a}=t,{$from:u,$to:l}=i.selection,c=Jp(yd.LINK,a),p=Jp(n,a);if(!(p.spec.group||"").includes(bd.SETTINGS))return e.setMark(n,r);if(u.pos===l.pos)return;s.nodesBetween(u.pos,l.pos,((t,s)=>{if(t.type.name===gd.LIST)return;const a=function(t,e){const n="string"==typeof e?e:e.name;return t.find((t=>t.type.name===n))}(t.marks,n),f=p.create({...a?.attrs||{},...r}),d=kd(u,l,t,s),h=!c.isInSet(t.marks)&&function(t,e,n,r=Cd){const o=t.resolve(e).path.reverse();for(const t of o)if("number"!=typeof t)for(const e of t.marks)if(r(e,n))return!0;return!1}(i.doc,s,f,o.isAppliedToParent);if(h)return(t=>{if(!o.onAppliedToParent||!1===o.onAppliedToParent(t)){const{tr:n,node:r,position:o,mark:i}=t;e._removeNodeMark({tr:n,node:r,position:o,mark:i.type})}})({tr:i,node:t,position:s,mark:f});t.isText?i.addMark(d.from,d.to,f):function(t,e,n,r){const o=Ed(t,r),i=e.from-o<=r,s=e.to+o>=n.nodeSize+r;return i&&s}(i.doc,i.selection,t,s)&&i.addNodeMark(s,f)}))})),getMarks:zf((({editor:t},e)=>{const n=ze(t,"state");return Ve((()=>{const{selection:t,doc:r}=Pe(n),{from:o,to:i}=Pe(t),s=[];return r.nodesBetween(o,i,(t=>{for(const n of t.marks)n.type.name===e&&s.unshift(n.attrs)})),s}))})),getMark:zf((({commands:t},e)=>{const n=t.getMarks(e);return Ve((()=>Pe(n)[0]??null))})),hasMark:zf((({commands:t},e)=>{const n=t.getMark(e);return Ve((()=>!!Pe(n)))})),getCommonSettingMark:zf((({commands:t},e,n)=>{const r=t.getMark(e);return Ve((()=>Pe(r)?.value??Pe(n)))})),getDeviceSettingMark:zf((({commands:t},e,n)=>{const r=t.getMarks(e),o=t.getDevice();return Ve((()=>{for(const t of Pe(r)){const e=t[Pe(o)];if(e)return e}return Pe(n)}))})),removeAllMarks:zf((({state:t,commands:e})=>{const{tr:n,doc:r}=t,{from:o,to:i}=n.selection;r.nodesBetween(o,i,((t,r)=>{for(const o of t.marks)e._removeNodeMark({tr:n,node:t,position:r,mark:o})}))})),removeMarks:zf((({state:t,commands:e},n)=>{const{tr:r,doc:o}=t,{from:i,to:s}=r.selection;o.nodesBetween(i,s,((t,o)=>{const i=t.marks.filter((t=>n.includes(t.type.name)));for(const n of i)e._removeNodeMark({tr:r,node:t,position:o,mark:n})}))})),_removeNodeMark:zf(((t,{tr:e,node:n,position:r,mark:o})=>n.isText?e.removeMark(r,r+n.nodeSize,o):e.removeNodeMark(r,o)))})}),Td=Hp.create({name:"text_processor",addCommands:()=>({getSelectedText:zf((({state:t})=>{const{from:e,to:n}=t.selection;return t.doc.textBetween(e,n," ")})),transformText:zf((({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=kd(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)}))}))})}),Fd=Hp.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:zf((({state:t})=>{this.storage.selection=t.selection})),restoreSelection:zf((({commands:t})=>{this.storage.selection&&t.setTextSelection(this.storage.selection)})),expandSelection:zf((({tr:t,commands:e},n)=>{let r=t.selection.from,o=t.selection.to;t.doc.nodesBetween(r,o,((e,i,s)=>{if(n({node:e,parent:s})){const n=e.isText?0:Ed(t.doc,i);r=Math.min(r,i+n),o=Math.max(o,i+e.nodeSize-n)}})),e.setTextSelection({from:r,to:o})})),expandSelectionToBlock:zf((({commands:t})=>{t.expandSelection((({parent:t})=>t.type.name===gd.DOCUMENT))}))}}}),Md=vf.create({name:"doc",topNode:!0,content:"block+"}).extend({marks:bd.SETTINGS,onCreate(){this.editor.view.dom.addEventListener("click",(t=>{t.target.closest("a")&&t.preventDefault()}))}}),Id=vf.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Cp(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),$d=Id.extend({marks:bd.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),Bd=vf.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]}`,Cp(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=Ap(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}})))}}),Rd=Bd.extend({marks:bd.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})});class Ld{static create(t,e){const n=new this(t,e||{});return new el({key:new ol(this.name),props:n.buildProps()})}constructor(t,e){this.options=e,this.editor=t}buildProps(){return{}}}class Pd extends Ld{buildProps(){return{transformPastedHTML:this._transformPastedHTML.bind(this),handlePaste:this._handlePaste.bind(this)}}_transformPastedHTML(t){if(t.includes("data-pm-slice")&&t.includes("zw-style"))return t;const e=Bm.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===gd.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}}class jd extends Ld{buildProps(){return{decorations:this._buildDecorations.bind(this)}}_buildDecorations({doc:t}){const e=[];return this.editor.isEditable?t.childCount>1?void 0:(t.descendants(((t,n)=>{if(!t.childCount){const r=$c.node(n,n+t.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});e.push(r)}return!1})),Lc.create(t,e)):null}}const zd=Hp.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[Pd.create(this.editor),jd.create(this.editor)]}}),Vd=gf.create({name:yd.FONT_FAMILY,group:bd.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:zf((({commands:t},e)=>{t.applyMark(this.name,{value:e});const n=t.findFontByName(e);let r=Pe(t.getFontWeight());n.isWeightSupported(r)||(r=n.findClosestWeight(r),t.applyFontWeight(r)),n.isItalicSupported(r)||t.removeItalic()})),getFont:zf((({commands:t})=>{const e=Pe(this.options.defaultPreset),n=t.findFontByName(e.common.font_family),r=t.getFontFamily();return Ve((()=>t.findFontByName(Pe(r))||n))})),findFontByName:zf(((t,e)=>this.options.fonts.find((t=>t.name===e)))),getFontFamily:zf((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontFamily()))),getDefaultFontFamily:zf((({commands:t})=>{const e=t.getPreset();return Ve((()=>Pe(e).common.font_family))}))}},parseHTML(){const t=t=>({value:t.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:t},{style:"font-family",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Hf({font_family:t.value?`"${t.value}"`:null})}),Hd=Hp.create({name:yd.STYLE_PRESET,addGlobalAttributes(){return[{types:[gd.PARAGRAPH,gd.HEADING],attributes:{preset:{isRequired:!1,default:{id:this.options.defaultId},parseHTML:t=>{const e=Pe(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=this.options.styleRenderer.makePresetCssClass({id:n});if(t.matches(e))return{id:n};if(t.tagName===`H${r?.level}`)return{id:n}}return"P"===t.tagName?{id:this.options.defaultId}:null},renderHTML:t=>t.preset?{class:this.options.styleRenderer.makePresetHtmlClass(t.preset)}: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:zf((()=>Ve((()=>this.options.presets.filter((t=>!t.hidden)))))),getPreset:zf((({commands:n})=>{const r=n.getBlockAttributes("preset",{id:this.options.defaultId}),o=n.getPresetList(),i=n.isLink(),s=n.getLinkPreset();return Ve((()=>{const n=t(Pe(o),Pe(r).id);if(!Pe(i))return n;const a=Pe(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:zf((({commands:e,chain:n},r)=>{const o=t(Pe(e.getPresetList()),r),i=o.node?.type??gd.PARAGRAPH,s={preset:{id:r}};o.node&&(s.level=o.node.level);for(const t of yd.attributes)s[t]=Pe(e.getBlockAttributes(t));n().removeList().setNode(i,s).run()})),applyDefaultPreset:zf((({commands:t})=>{t.applyPreset(this.options.defaultId)})),removePreset:zf((({commands:t})=>{t.setNode(gd.PARAGRAPH,{preset:null})})),getPresetCustomization:zf((({editor:t,commands:e})=>{const n=ze(t,"state");return Ve((()=>{const{selection:t,doc:r}=Pe(n),{from:o,to:i}=t;return e._getSettingCustomization(r,o,i)}))})),isSettingCustomized:zf((({commands:t},e)=>{const n=t.getPresetCustomization(),r=yd.attributes.includes(e)?"attributes":"marks";return Ve((()=>Pe(n)[r]?.includes(e)??!1))})),getContentCustomization:zf((({editor:t,commands:e})=>{const n=ze(t,"state");return Ve((()=>{const{doc:t}=Pe(n);return e._getSettingCustomization(t,0,t.content.size)}))})),_getSettingCustomization:zf(((t,e,n,r)=>{const o=new Set,i=new Set;return e.nodesBetween(n,r,(t=>{for(const[e,n]of Object.entries(t.attrs)){yd.attributes.includes(e)&&n&&i.add(e)}for(const{type:e}of t.marks)yd.marks.includes(e.name)&&o.add(e.name)})),{attributes:Array.from(i),marks:Array.from(o)}})),removePresetCustomization:zf((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(yd.marks).resetAttributes(gd.PARAGRAPH,yd.attributes).resetAttributes(gd.HEADING,yd.attributes).restoreSelection().run()})),removeFormat:zf((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()}))}},onCreate(){this.options.styleRenderer.inject(Rm.head,this.options.presets)}}),Wd=gf.create({name:yd.FONT_WEIGHT,group:bd.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:zf((({commands:t},e)=>{t.applyMark(this.name,{value:e});Pe(t.getFont()).isItalicSupported(e)||t.removeItalic()})),toggleBold:zf((({commands:t})=>{const e=Pe(t.getFontWeight()),n=Pe(t.getFont()),r=Number(e)>=600?"400":"700",o=n.findClosestWeight(r);t.applyFontWeight(o)})),getFontWeight:zf((({commands:t})=>{const e=t.getCommonSettingMark(this.name,t.getDefaultFontWeight()),n=t.getFont();return Ve((()=>{const t=Pe(e),r=Pe(n);return r.isWeightSupported(t)?t:r.findClosestWeight(t)}))})),getDefaultFontWeight:zf((({commands:t})=>{const e=t.getPreset();return Ve((()=>Pe(e).common.font_weight))}))}},addKeyboardShortcuts:()=>({"Mod-b":Wf("toggleBold"),"Mod-B":Wf("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})=>Hf({font_weight:t.value})}),qd=gf.create({name:yd.FONT_SIZE,group:bd.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getFontSize:zf((({commands:t})=>t.getDeviceSettingMark(this.name,t.getDefaultFontSize()))),getDefaultFontSize:zf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Ve((()=>Pe(n)[Pe(e)].font_size.replace("px","")))})),applyFontSize:zf((({commands:t},e)=>{const n=Pe(t.getDevice());t.applyMark(this.name,{[n]:e},{isAppliedToParent:(t,e)=>t.type.name===e.type.name&&t.attrs[n]===e.attrs[n],onAppliedToParent:({tr:t,node:e,position:r,mark:o})=>{const i={...o.attrs,[n]:null},s=!Object.values(i).some((t=>!!t));if(s)return!1;const a=o.type.create(i);e.isText?t.addMark(r,r+e.nodeSize,a):t.addNodeMark(r,a)}})})),increaseFontSize:zf((({commands:t})=>{const e=Number(Pe(t.getFontSize())),n=Math.min(e+1,this.options.maxSize);t.applyFontSize(String(n))})),decreaseFontSize:zf((({commands:t})=>{const e=Number(Pe(t.getFontSize())),n=Math.max(e-1,this.options.minSize);t.applyFontSize(String(n))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Wf("increaseFontSize"),"Mod-Shift--":Wf("decreaseFontSize")}),parseHTML(){const t=t=>{if(!t)return null;const e=pd(t,Pe(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 Hf({font_size_mobile:e(t.mobile),font_size_tablet:e(t.tablet),font_size_desktop:e(t.desktop)})}}),Ud=gf.create({name:yd.FONT_COLOR,group:bd.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:zf((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontColor()))),getDefaultFontColor:zf((({commands:t})=>{const e=t.getPreset();return Ve((()=>Pe(e).common.color))})),applyFontColor:zf((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:cd(t)});return[{style:"--zw-font-color",getAttrs:t},{style:"color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Hf({font_color:t.value})}),Kd=gf.create({name:yd.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:zf((({commands:t})=>t.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)"))),applyBackgroundColor:zf((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:cd(t)});return[{style:"--zw-background-color",getAttrs:t},{style:"background-color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Hf({background_color:t.value})}),Jd=Hp.create({name:"device_manager",addCommands(){return{getDevice:zf((()=>ze(this.options,"device")))}}}),Gd=gf.create({name:yd.FONT_STYLE,group:bd.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:zf((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultFontStyle();return Ve((()=>Pe(e)?.italic??Pe(n).italic))})),isItalicAvailable:zf((({commands:t})=>{const e=t.getFont(),n=t.getFontWeight();return Ve((()=>{const t=Pe(e),r=Pe(n);return t.isItalicSupported(r)&&!t.isWeightItalicOnly(r)}))})),getDefaultFontStyle:zf((({commands:t})=>{const e=t.getPreset();return Ve((()=>({italic:"italic"===Pe(e).common.font_style})))})),toggleItalic:zf((({commands:t})=>{Pe(t.isItalicAvailable())&&(Pe(t.isItalic())?t.removeItalic():t.applyItalic())})),applyItalic:zf((({commands:t})=>{t.applyMark(this.name,{italic:!0})})),removeItalic:zf((({commands:t})=>{t.applyMark(this.name,{italic:!1})}))}},addKeyboardShortcuts:()=>({"Mod-i":Wf("toggleItalic"),"Mod-I":Wf("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})=>Hf({font_style:t.italic?"italic":"normal"})}),Yd=gf.create({name:yd.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:zf((({commands:t})=>{const e=t.getTextDecoration();return Ve((()=>Pe(e).underline))})),isStrikeThrough:zf((({commands:t})=>{const e=t.getTextDecoration();return Ve((()=>Pe(e).strike_through))})),getTextDecoration:zf((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultTextDecoration();return Ve((()=>{const t=Pe(e)??{},r=Pe(n);return{underline:t.underline||r.underline,strike_through:t.strike_through||r.strike_through}}))})),isUnderlineCustomized:zf((({commands:t})=>{const e=t.isUnderline(),n=t.getDefaultTextDecoration();return Ve((()=>Pe(e)!==Pe(n).underline))})),getDefaultTextDecoration:zf((({commands:t})=>{const e=t.getPreset();return Ve((()=>{const{text_decoration:t}=Pe(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:zf((({commands:t})=>{t.toggleTextDecoration("underline")})),toggleStrikeThrough:zf((({commands:t})=>{t.toggleTextDecoration("strike_through")})),toggleTextDecoration:zf((({commands:t},e,n=null)=>{const r=Pe(t.getTextDecoration()),o=n??!r[e];t.applyMark(this.name,{[e]:o})})),applyTextDecoration:zf((({commands:t},e)=>{t.toggleTextDecoration(e,!0)})),removeTextDecoration:zf((({commands:t},e)=>{t.toggleTextDecoration(e,!1)}))}},addKeyboardShortcuts:()=>({"Mod-u":Wf("toggleUnderline"),"Mod-U":Wf("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"),Hf({text_decoration:e.join(" ")})}}),Xd=Hp.create({name:"case_style",addCommands:()=>({applyCaseStyle:zf((({commands:t},e)=>{switch(e){case hd.CAPITALIZE:return t.applyCapitalize();case hd.LOWERCASE:return t.applyLowerCase();case hd.UPPERCASE:return t.applyUpperCase()}})),applyCapitalize:zf((({commands:t})=>{t.transformText((({text:t})=>function(t){return t.toLowerCase().replace(/(?:^|\s)\S/g,(t=>t.toUpperCase()))}(t)))})),applyLowerCase:zf((({commands:t})=>{t.transformText((({text:t})=>t.toLowerCase()))})),applyUpperCase:zf((({commands:t})=>{t.transformText((({text:t})=>t.toUpperCase()))}))})}),Zd={mobile:null,tablet:null,desktop:null},Qd=Hp.create({name:yd.ALIGNMENT,addGlobalAttributes:()=>[{types:[gd.PARAGRAPH,gd.HEADING],attributes:{[yd.ALIGNMENT]:{isRequired:!1,parseHTML({style:t}){const e=function(t){const e=wd[t]||t;return md.values.includes(e)?e:null}(t.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const n=t.getPropertyValue("--zw-alignment-mobile")||null,r=t.getPropertyValue("--zw-alignment-tablet")||null,o=t.getPropertyValue("--zw-alignment-desktop")||null;return n||r||o?{desktop:o,tablet:r,mobile:n}:null},renderHTML:t=>t.alignment?Vf({alignment_mobile:t.alignment.mobile,alignment_tablet:t.alignment.tablet,alignment_desktop:t.alignment.desktop}):null}}}],addCommands(){return{toggleAlignment:zf((({commands:t},e)=>{Pe(t.getAlignment())===e?t.removeAlignment():t.applyAlignment(e)})),applyAlignment:zf((({commands:t},e)=>{const n=Pe(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},Zd)})),removeAlignment:zf((({commands:t})=>t.removeBlockAttributes(this.name))),getAlignment:zf((({commands:t})=>{const e=t.getBlockAttributes(this.name,Zd),n=t.getDevice(),r=t.getDefaultAlignment();return Ve((()=>Pe(e)?.[Pe(n)]??Pe(r)))})),getDefaultAlignment:zf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Ve((()=>Pe(n)[Pe(e)].alignment))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Wf("applyAlignment",md.LEFT),"Mod-Shift-e":Wf("applyAlignment",md.CENTER),"Mod-Shift-r":Wf("applyAlignment",md.RIGHT),"Mod-Shift-j":Wf("applyAlignment",md.JUSTIFY)})}),th={mobile:null,tablet:null,desktop:null},eh=Hp.create({name:yd.LINE_HEIGHT,addGlobalAttributes(){return[{types:[gd.PARAGRAPH,gd.HEADING],attributes:{[yd.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=fd(e,t,Pe(this.options.wrapperRef));return n?{desktop:n,tablet:n,mobile:null}:null},renderHTML:t=>t.line_height?Vf({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:zf((({commands:t})=>{const e=t.getBlockAttributes(this.name,th),n=t.getDevice(),r=t.getDefaultLineHeight();return Ve((()=>Pe(e)?.[Pe(n)]??Pe(r)))})),getDefaultLineHeight:zf((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Ve((()=>Pe(n)[Pe(e)].line_height))})),applyLineHeight:zf((({commands:t},e)=>{const n=Pe(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},th)}))}}}),nh=vf.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Cp(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:gd.LIST_ITEM,marks:bd.SETTINGS,addCommands(){const t=({selection:t})=>t.$cursor.before(t.$cursor.depth-1);return{listItemNewline:zf((({commands:e,tr:n})=>{const r=n.doc.nodeAt(t(n));if(!n.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=t(n);for(const t of r.marks)n.addNodeMark(o,Od(t));return!0}))}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:t=>{const{state:e,commands:n}=t.editor,r=e.selection.$cursor?.path.some((t=>t.type?.name===gd.LIST));if(r)return n.listItemNewline()}})}),rh=vf.create({name:gd.LIST,content:`${gd.LIST_ITEM}+`,group:"block list",marks:bd.SETTINGS,addExtensions:()=>[nh],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:vd.DISC}}}),parseHTML(){const t={a:vd.ROMAN,i:vd.LATIN,1:vd.DECIMAL},e=e=>{for(const n of vd.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)||vd.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||vd.DISC}})}]},renderHTML({HTMLAttributes:t}){const e=[this.options.baseClass+t.bullet.type,this.options.presetClass];return[vd.ordered.includes(t.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands:()=>({getListType:zf((({commands:t})=>{const e=t.getBlockAttributes("bullet",{type:null});return Ve((()=>Pe(e).type??null))})),applyList:zf((({commands:t,chain:e},n)=>{if(Pe(t.getListType())!==n)return e().applyDefaultPreset().toggleList(gd.LIST,gd.LIST_ITEM).setBlockAttributes("bullet",{type:n}).command((({commands:t,tr:e})=>t._bubbleListItemMarks(e))).run();t.removeList()})),_bubbleListItemMarks:zf(((t,e)=>{const{doc:n,selection:r}=e,o=r.$from.start(),i=r.$to.end();function s(t,e){if(yd.inlineMarks.includes(e.type))return!1;if(e.type.isInSet(t.marks))return!1;for(const n of t.content.content)if(n.childCount){if(!n.marks)return!1;if(!e.isInSet(n.marks))return!1}return!0}n.nodesBetween(o,i,((t,n)=>{if(t.type.name===gd.LIST)return;if(t.type.name!==gd.LIST_ITEM)return!1;const r=[];return t.forEach((o=>{for(const i of o.marks)i.isInSet(r)?e.removeNodeMark(n+1,i):s(t,i)&&(e.removeNodeMark(n+1,i),e.addNodeMark(n,Od(i)),r.push(i))})),!1}))})),removeList:zf((({commands:t,state:e})=>{const{tr:n,doc:r,selection:o}=e,i=o.$from.start(),s=o.$to.end();r.nodesBetween(i,s,((t,e,r)=>{if([gd.LIST,gd.LIST_ITEM].includes(t.type.name))return;if(r.type.name!==gd.LIST_ITEM)return!1;const o=r.marks.filter((function(e){return!e.type.isInSet(t.marks)}));for(const t of o)n.addNodeMark(e,Od(t));return!1})),t.liftListItem(gd.LIST_ITEM)}))}),addInputRules(){const t=(t,e)=>function(t){return new Ip({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Ap(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),s=i.doc.resolve(n.from).blockRange(),a=s&&bu(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&&wu(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(vd.DISC,/^\s*([-+*])\s$/),t(vd.DECIMAL,/^(\d+)\.\s$/),t(vd.LATIN,/^([ivx]{1,3})\.\s$/i),t(vd.ROMAN,/^([a-z])\.\s$/i)]}});function oh(t){this.j={},this.jr=[],this.jd=null,this.t=t}oh.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=ih();var o=lh(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 ih=function(){return new oh},sh=function(t){return new oh(t)},ah=function(t,e,n){t.j[e]||(t.j[e]=n)},uh=function(t,e,n){t.jr.push([e,n])},lh=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},ch=function(t,e,n){for(var r=0;r<e.length;r++)ah(t,e[r],n)},ph=function(t,e){for(var n=0;n<e.length;n++){var r=e[n][0],o=e[n][1];ah(t,r,o)}},fh=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(),ah(t,e[i],o),t=o,i++;ah(t,e[s-1],n)},dh="DOMAIN",hh="LOCALHOST",mh="TLD",gh="NUM",vh="PROTOCOL",yh="MAILTO",bh="WS",_h="NL",Dh="OPENBRACE",wh="OPENBRACKET",kh="OPENANGLEBRACKET",Eh="OPENPAREN",Ch="CLOSEBRACE",xh="CLOSEBRACKET",Ah="CLOSEANGLEBRACKET",Sh="CLOSEPAREN",Oh="AMPERSAND",Nh="APOSTROPHE",Th="ASTERISK",Fh="AT",Mh="BACKSLASH",Ih="BACKTICK",$h="CARET",Bh="COLON",Rh="COMMA",Lh="DOLLAR",Ph="DOT",jh="EQUALS",zh="EXCLAMATION",Vh="HYPHEN",Hh="PERCENT",Wh="PIPE",qh="PLUS",Uh="POUND",Kh="QUERY",Jh="QUOTE",Gh="SEMI",Yh="SLASH",Xh="TILDE",Zh="UNDERSCORE",Qh="SYM",tm=Object.freeze({__proto__:null,DOMAIN:dh,LOCALHOST:hh,TLD:mh,NUM:gh,PROTOCOL:vh,MAILTO:yh,WS:bh,NL:_h,OPENBRACE:Dh,OPENBRACKET:wh,OPENANGLEBRACKET:kh,OPENPAREN:Eh,CLOSEBRACE:Ch,CLOSEBRACKET:xh,CLOSEANGLEBRACKET:Ah,CLOSEPAREN:Sh,AMPERSAND:Oh,APOSTROPHE:Nh,ASTERISK:Th,AT:Fh,BACKSLASH:Mh,BACKTICK:Ih,CARET:$h,COLON:Bh,COMMA:Rh,DOLLAR:Lh,DOT:Ph,EQUALS:jh,EXCLAMATION:zh,HYPHEN:Vh,PERCENT:Hh,PIPE:Wh,PLUS:qh,POUND:Uh,QUERY:Kh,QUOTE:Jh,SEMI:Gh,SLASH:Yh,TILDE:Xh,UNDERSCORE:Zh,SYM:Qh}),em="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(" "),nm=/(?:[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])/,rm=/(?:[#\*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])/,om=/\uFE0F/,im=/\d/,sm=/\s/;function am(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=ih(),n=sh(gh),r=sh(dh),o=ih(),i=sh(bh),s=[[im,r],[nm,r],[rm,r],[om,r]],a=function(){var t=sh(dh);return t.j={"-":o},t.jr=[].concat(s),t},u=function(t){var e=a();return e.t=t,e};ph(e,[["'",sh(Nh)],["{",sh(Dh)],["[",sh(wh)],["<",sh(kh)],["(",sh(Eh)],["}",sh(Ch)],["]",sh(xh)],[">",sh(Ah)],[")",sh(Sh)],["&",sh(Oh)],["*",sh(Th)],["@",sh(Fh)],["`",sh(Ih)],["^",sh($h)],[":",sh(Bh)],[",",sh(Rh)],["$",sh(Lh)],[".",sh(Ph)],["=",sh(jh)],["!",sh(zh)],["-",sh(Vh)],["%",sh(Hh)],["|",sh(Wh)],["+",sh(qh)],["#",sh(Uh)],["?",sh(Kh)],['"',sh(Jh)],["/",sh(Yh)],[";",sh(Gh)],["~",sh(Xh)],["_",sh(Zh)],["\\",sh(Mh)]]),ah(e,"\n",sh(_h)),uh(e,sm,i),ah(i,"\n",ih()),uh(i,sm,i);for(var l=0;l<em.length;l++)fh(e,em[l],u(mh),a);var c=a(),p=a(),f=a(),d=a();fh(e,"file",c,a),fh(e,"ftp",p,a),fh(e,"http",f,a),fh(e,"mailto",d,a);var h=a(),m=sh(vh),g=sh(yh);ah(p,"s",h),ah(p,":",m),ah(f,"s",h),ah(f,":",m),ah(c,":",m),ah(h,":",m),ah(d,":",g);for(var v=a(),y=0;y<t.length;y++)fh(e,t[y],v,a);return ah(v,":",m),fh(e,"localhost",u(hh),a),uh(e,im,n),uh(e,nm,r),uh(e,rm,r),uh(e,om,r),uh(n,im,n),uh(n,nm,r),uh(n,rm,r),uh(n,om,r),ah(n,"-",o),ah(r,"-",o),ah(o,"-",o),uh(r,im,r),uh(r,nm,r),uh(r,rm,r),uh(r,om,r),uh(o,im,r),uh(o,nm,r),uh(o,rm,r),uh(o,om,r),e.jd=sh(Qh),e}var um={defaultProtocol:"http",events:null,format:lm,formatHref:lm,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function lm(t){return t}function cm(){}function pm(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}(cm,n,e),n}cm.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]:um.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}}};var fm=pm("email",{isLink:!0}),dm=pm("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),hm=pm("text"),mm=pm("nl"),gm=pm("url",{isLink:!0,toHref:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:um.defaultProtocol,e=this.tk,n=!1,r=!1,o=[],i=0;e[i].t===vh;)n=!0,o.push(e[i].v),i++;for(;e[i].t===Yh;)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 this.tk[0].t===vh}}),vm=Object.freeze({__proto__:null,MultiToken:cm,Base:cm,createTokenClass:pm,MailtoEmail:fm,Email:dm,Text:hm,Nl:mm,Url:gm});function ym(){var t=ih(),e=ih(),n=ih(),r=ih(),o=ih(),i=ih(),s=ih(),a=sh(gm),u=ih(),l=sh(gm),c=sh(gm),p=ih(),f=ih(),d=ih(),h=ih(),m=ih(),g=sh(gm),v=sh(gm),y=sh(gm),b=sh(gm),_=ih(),D=ih(),w=ih(),k=ih(),E=ih(),C=ih(),x=sh(dm),A=ih(),S=sh(dm),O=sh(fm),N=ih(),T=ih(),F=ih(),M=ih(),I=sh(mm);ah(t,_h,I),ah(t,vh,e),ah(t,yh,n),ah(e,Yh,r),ah(r,Yh,o),ah(t,mh,i),ah(t,dh,i),ah(t,hh,a),ah(t,gh,i),ah(o,mh,c),ah(o,dh,c),ah(o,gh,c),ah(o,hh,c),ah(i,Ph,s),ah(E,Ph,C),ah(s,mh,a),ah(s,dh,i),ah(s,gh,i),ah(s,hh,i),ah(C,mh,x),ah(C,dh,E),ah(C,gh,E),ah(C,hh,E),ah(a,Ph,s),ah(x,Ph,C),ah(a,Bh,u),ah(a,Yh,c),ah(u,gh,l),ah(l,Yh,c),ah(x,Bh,A),ah(A,gh,S);var $=[Oh,Th,Fh,Mh,Ih,$h,Lh,dh,jh,Vh,hh,gh,Hh,Wh,qh,Uh,vh,Yh,Qh,Xh,mh,Zh],B=[Nh,Ah,Ch,xh,Sh,Bh,Rh,Ph,zh,kh,Dh,wh,Eh,Kh,Jh,Gh];ah(c,Dh,f),ah(c,wh,d),ah(c,kh,h),ah(c,Eh,m),ah(p,Dh,f),ah(p,wh,d),ah(p,kh,h),ah(p,Eh,m),ah(f,Ch,c),ah(d,xh,c),ah(h,Ah,c),ah(m,Sh,c),ah(g,Ch,c),ah(v,xh,c),ah(y,Ah,c),ah(b,Sh,c),ah(_,Ch,c),ah(D,xh,c),ah(w,Ah,c),ah(k,Sh,c),ch(f,$,g),ch(d,$,v),ch(h,$,y),ch(m,$,b),ch(f,B,_),ch(d,B,D),ch(h,B,w),ch(m,B,k),ch(g,$,g),ch(v,$,v),ch(y,$,y),ch(b,$,b),ch(g,B,g),ch(v,B,v),ch(y,B,y),ch(b,B,b),ch(_,$,g),ch(D,$,v),ch(w,$,y),ch(k,$,b),ch(_,B,_),ch(D,B,D),ch(w,B,w),ch(k,B,k),ch(c,$,c),ch(p,$,c),ch(c,B,p),ch(p,B,p),ah(n,mh,O),ah(n,dh,O),ah(n,gh,O),ah(n,hh,O),ch(O,$,O),ch(O,B,N),ch(N,$,O),ch(N,B,N);var R=[Oh,Nh,Th,Mh,Ih,$h,Ch,Lh,dh,jh,Vh,gh,Dh,Hh,Wh,qh,Uh,Kh,Yh,Qh,Xh,mh,Zh];return ch(i,R,T),ah(i,Fh,F),ch(a,R,T),ah(a,Fh,F),ch(s,R,T),ch(T,R,T),ah(T,Fh,F),ah(T,Ph,M),ch(M,R,T),ah(F,mh,E),ah(F,dh,E),ah(F,gh,E),ah(F,hh,x),t}function bm(t,e,n){var r=n[0].s,o=n[n.length-1].e;return new t(e.substr(r,o-r),n)}var _m="undefined"!=typeof console&&console&&console.warn||function(){},Dm={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function wm(t){if(Dm.initialized&&_m('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");Dm.customProtocols.push(t)}function km(t){return Dm.initialized||function(){Dm.scanner={start:am(Dm.customProtocols),tokens:tm},Dm.parser={start:ym(),tokens:vm};for(var t={createTokenClass:pm},e=0;e<Dm.pluginQueue.length;e++)Dm.pluginQueue[e][1]({scanner:Dm.scanner,parser:Dm.parser,utils:t});Dm.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=lh(a,n[o].t));)s.push(n[o++]);for(;o<r&&(l=u||lh(a,n[o].t));)u=null,(a=l).accepts()?(f=0,p=a):f>=0&&f++,o++,c++;if(f<0)for(var d=o-c;d<o;d++)s.push(n[d]);else{s.length>0&&(i.push(bm(hm,e,s)),s=[]),o-=f,c-=f;var h=p.t,m=n.slice(o-c,o);i.push(bm(h,e,m))}}return s.length>0&&i.push(bm(hm,e,s)),i}(Dm.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=lh(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}(Dm.scanner.start,t))}function Em(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=km(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 Cm(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=km(t);return 1===n.length&&n[0].isLink&&(!e||n[0].t===e)}function xm(t){return new el({key:new ol("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 Lu(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}})}))})),uf(r)}(a);return l.forEach((({oldRange:e,newRange:o})=>{lf(e.from,e.to,n.doc).filter((e=>e.mark.type===t.type)).forEach((e=>{const o=lf(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=Cm(a),p=Cm(l);c&&!p&&s.removeMark(i.from,i.to,t.type)}));const i=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));let a,l;if(i.length>1?(a=i[0],l=r.doc.textBetween(a.pos,a.pos+a.node.nodeSize,void 0," ")):i.length&&r.doc.textBetween(o.from,o.to," "," ").endsWith(" ")&&(a=i[0],l=r.doc.textBetween(a.pos,o.to,void 0," ")),a&&l){const e=l.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],r=a.pos+l.lastIndexOf(n);if(!n)return!1;Em(n).filter((t=>t.isLink)).filter((e=>!t.validate||t.validate(e.value))).map((t=>({...t,from:r+t.start+1,to:r+t.end+1}))).forEach((e=>{s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}})),s.steps.length?s:void 0}})}const Am=gf.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(wm)},onDestroy(){Dm.scanner=null,Dm.parser=null,Dm.pluginQueue=[],Dm.customProtocols=[],Dm.initialized=!1},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",Cp(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[yf({find:t=>Em(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(xm({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new el({key:new ol("handleClickLink"),props:{handleClick:(t,n,r)=>{var o;const i=af(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 el({key:new ol("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=Em(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}}),Sm=Am.extend({name:yd.LINK,addOptions(){return{...this.parent?.(),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:_d.SELF,parseHTML:t=>t.getAttribute("target")||_d.SELF},destination:{default:Dd.URL,parseHTML:t=>{const e=t.getAttribute("href");if(!e.startsWith("#"))return Dd.URL;const n=e.replace("#","");return Pe(this.options.pageBlocks).find((t=>t.id===parseInt(n)))?Dd.BLOCK:Dd.URL}}}},addCommands(){return{...this.parent?.(),applyLink:zf((({commands:t,chain:e},n)=>(t.setMeta("preventAutolink",!0),t.getSelectedText()?e().applyMark(this.name,n).expandSelectionToLink().command((({tr:t})=>(t.insertText(n.text,t.selection.from,t.selection.to),!0))).run():t.insertContent(Pm.text(n.text,[Pm.mark(yd.LINK,n)]))))),expandSelectionToLink:zf((({commands:t})=>{t.expandSelection((({node:t})=>this.type.isInSet(t.marks)))})),isLink:zf((({commands:t})=>t.hasMark(this.name))),getLinkPreset:zf((()=>Ve((()=>this.options.preset))))}},renderHTML({HTMLAttributes:t}){const e=t.destination===Dd.BLOCK?`#${t.href}`:t.href,n=`${Pe(this.options.basePresetClass)+Pe(this.options.preset).id} zw-style`;return["a",{href:e,target:t.target,class:n},0]}}),Om=gf.create({name:yd.SUPERSCRIPT,addCommands(){return{applySuperscript:zf((({commands:t})=>{t.setMark(this.name)})),removeSuperscript:zf((({commands:t})=>{t.unsetMark(this.name)})),toggleSuperscript:zf((({commands:t})=>{Pe(t.isSuperscript())?t.removeSuperscript():t.applySuperscript()})),isSuperscript:zf((({commands:t})=>{const e=t.getMark(this.name);return Ve((()=>!!Pe(e)))}))}},parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML:()=>["sup",{class:"zw-superscript"},0]}),Nm=Hp.create({name:yd.MARGIN,addGlobalAttributes:()=>[{types:[gd.PARAGRAPH,gd.HEADING],attributes:{[yd.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?Vf({margin:t.margin.value}):null}}}]});function Tm(t){const e=e=>t.presetsRef.value.find((t=>t.id===e)),n=function(t){return Fe(t,!1),t}({default:null,link:null});return Ge(t.presetsRef,(()=>{n.default=e(t.defaultPresetId),n.link=e(t.linkPresetId)}),{immediate:!0}),[Md,$d,Rd,bf,jf,Nd,Td,Fd,zd].concat([Hd.configure({presets:t.presetsRef,defaultId:t.defaultPresetId,styleRenderer:new jm({baseClass:t.basePresetClass,makeVariable:t.makePresetVariable,linkPresetId:t.linkPresetId})}),rh.configure({baseClass:t.baseListClass,presetClass:t.basePresetClass+t.defaultPresetId}),Jd.configure({device:t.deviceRef}),qd.configure({minSize:t.minFontSize,maxSize:t.maxFontSize,wrapperRef:t.wrapperRef}),Vd.configure({fonts:t.fonts,defaultPreset:ze(n,"default")}),Wd,Ud,Kd,Gd,Yd,Xd,Om,Qd,eh.configure({wrapperRef:t.wrapperRef}),Sm.configure({preset:ze(n,"link"),basePresetClass:t.basePresetClass,pageBlocks:t.pageBlocksRef}),Nm])}class Fm{_domParser=new DOMParser;types=window;parse(t){return this._domParser.parseFromString(t,"text/html")}}class Mm{content;constructor({content:t}){this.content=t}normalize(){throw new Error("Implement abstract method")}}class Im extends Mm{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=Im.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:t,parser:e}){super({content:t}),this._parser=e,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,(t=>"BR"===t.tagName)),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,(t=>"LI"===t.tagName)),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const t=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(t,(t=>t.remove()))}_normalizeRootTags(){const t=Array.from(this.dom.body.childNodes),e=this.dom.createDocumentFragment();let n;for(const r of t)this._isRootNode(r)?(e.append(r),n=null):(n||(n=this.dom.createElement("p"),e.append(n)),n.append(r));this.dom.body.innerHTML="",this.dom.body.append(e)}_createNodeIterator(t,e){return this.dom.createNodeIterator(this.dom.body,t,e)}_iterateNodes(t,e=(()=>!0)){const n=t=>"BODY"!==t.tagName&&e.call(this,t),r=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:t=>n(t)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(r,t)}_runIterator(t,e){let n=t.nextNode();for(;n;)e.call(this,n),n=t.nextNode()}_removeEmptyNodes(t){t.innerHTML.trim()||t.remove()}_normalizeListItems(t){const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes);let r,o;const i=n=>{this._assignElementProperties(n,t,Im.BLOCK_STYLES),e.append(n)};this._assignElementProperties(t,t.parentElement,Im.BLOCK_STYLES);for(const t of n)if(this._isBlockNode(t))i(t),r=null,o=t;else if("BR"===t.tagName&&o&&"BR"!==o?.tagName)t.remove(),o=t;else if("BR"!==t.tagName)r||(r=this.dom.createElement("p"),i(r)),r.append(t),o=t;else{const e=this.dom.createElement("p");e.append(t),i(e),r=null,o=t}t.append(e),this._removeStyleProperties(t,Im.BLOCK_STYLES)}_isBlockNode(t){return Im.BLOCK_NODE_NAMES.includes(t.tagName)}_isRootNode(t){return Im.ROOT_NODE_NAMES.includes(t.tagName)}_assignElementProperties(t,e,n){for(const r of n){const n=e.style.getPropertyValue(r);n&&!t.style.getPropertyValue(r)&&t.style.setProperty(r,n)}}_removeStyleProperties(t,e){for(const n of e)t.style.removeProperty(n);0===t.style.length&&t.removeAttribute("style")}_normalizeBreakLines({parentElement:t}){if(!this._isBlockNode(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 i=n=>{this._assignElementProperties(n,t,Im.BLOCK_STYLES),e.append(n)};for(const t of n)"BR"!==t.tagName?o.append(t):(i(o),o=r.cloneNode());e.append(o),t.replaceWith(e)}_normalizeBlockTextDecoration(){const t=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveTextDecorationToChildren(e)}_moveTextDecorationToChildren(t){const e=this._parseTextDecoration(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=this._wrapTextNode(t,n),o=this._parseTextDecoration(r),i={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(i).filter((([,t])=>t)).map((([t])=>t.replace("_","-"))).join(" ")}}_parseTextDecoration(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")}}_normalizeBlockBackgroundColor(){const t=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveBackgroundColorToChildren(e)}_moveBackgroundColorToChildren(t){const e=t.style.backgroundColor;t.style.removeProperty("background-color"),t.style.cssText||t.removeAttribute("style");for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=r.style.backgroundColor||e;r.style.backgroundColor=o}}_wrapTextNode(t,e){if(e.nodeType!==this._Node.TEXT_NODE)return e;const n=this.dom.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}}class $m extends Mm{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(t){this._iterateChildNodes(this.content,t)}_iterateChildNodes(t,e){for(const n of t.content)n.content&&this._iterateChildNodes(n,e),e.call(this,n)}_bubbleMarks(t){if(t.content&&t.type!==gd.LIST)for(const e of t.content)if(e.marks)for(const n of e.marks.slice())this._includesMark(t,n)?this._removeMark(e,n):this._canBubbleMark(t,n)&&(this._removeMark(e,n),this._addMark(t,n))}_canBubbleMark(t,e){if(yd.inlineMarks.includes(e.type))return!1;if(this._includesMarkType(t,e.type))return!1;for(const n of t.content)if(n.content||t.type!==gd.LIST_ITEM){if(!n.marks)return!1;if(!this._includesMark(n,e))return!1}return!0}_includesMark(t,e){return t.marks?.some((t=>Sd.isEqual(t,e)))??!1}_includesMarkType(t,e){return t.marks?.some((t=>t.type===e))??!1}_removeMark(t,e){if(!t.marks)return;const n=this._findMarkIndexByType(t,e.type);n>=0&&t.marks.splice(n,1),t.marks.length||delete t.marks}_addMark(t,e){this._removeMark(t,e),t.marks??=[],t.marks.push(e)}_findMarkIndexByType(t,e){return t.marks?.findIndex((t=>t.type===e))??null}}class Bm{static build(t,e={}){return"string"==typeof t?this._buildHtml(t,e):this._buildJson(t)}static _buildHtml(t,e){return new Im({content:t,parser:e.parser||new Fm})}static _buildJson(t){return new $m({content:t})}static normalize(t,e={}){return Bm.build(t,e).normalize()}}class Rm{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 Lm{static build({config:t,nodeDomParser:e}){const n=function(t){return Np(jp.resolve(t))}(Tm({fonts:t.fonts,minFontSize:0,maxFontSize:0,presetsRef:Le(t.presets),defaultPresetId:t.defaultPresetId,linkPresetId:t.linkPresetId,makePresetVariable:()=>"",basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:Le(dd.DESKTOP),pageBlocksRef:Le([]),wrapperRef:Rm.document.createElement("p")}));return new Lm({schema:n,domParser:za.fromSchema(n),nodeDomParser:e})}_schema;_domParser;_nodeDomParser;constructor({schema:t,domParser:e,nodeDomParser:n}){this._schema=t,this._domParser=e,this._nodeDomParser=n}toJSON(t){const e=Bm.build(t,{parser:this._nodeDomParser});return e.normalizeHTML(),this._domParser.parse(e.dom.body).toJSON()}}class Pm{static doc(t){return{type:gd.DOCUMENT,content:t}}static list(t,e){return{type:gd.LIST,attrs:{bullet:{type:t}},content:e.map((t=>t.type===gd.LIST_ITEM?t:this.listItem([].concat(t))))}}static listItem(...t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{type:gd.LIST_ITEM,...e?{attrs:e}:{},...r?{marks:r}:{},content:[].concat(n).map((t=>"string"==typeof t?this.paragraph(t):t))}}static heading(t,...e){const n=this._textBlock(e,this.text);return n.attrs??={},n.attrs.level=t,{type:gd.HEADING,...n}}static paragraph(...t){return{type:gd.PARAGRAPH,...this._textBlock(t,this.text)}}static _textBlock(t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{content:"string"==typeof n?[this.text(n)]:n,...e?{attrs:e}:{},...r?{marks:r}:{}}}static _normalizeTextBlockArgs(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]}}static text(t,e){return{type:gd.TEXT,...e?{marks:e}:{},text:t}}static mark(t,e){return{type:t,attrs:e}}static populateAllDevices(t){return{mobile:t,tablet:t,desktop:t}}}class jm{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:t,makeVariable:e,linkPresetId:n}){this._baseClass=t,this._makeVariable=e,this._linkPresetId=n}inject(t,e){let n=t.querySelector("[data-zw-styles]");n||(n=Rm.document.createElement("style"),n.dataset.zwStyles="",n.innerHTML=this.render(e),t.append(n))}render(t){let e="";for(const n of t){const t=n.id===this._linkPresetId;e+=` ${this.makePresetCssClass(n)} {`;for(const r of dd.values)for(const o of Object.keys(n[r])){const i=this._makeVariable({device:r,preset:n,property:o}),s=this._makeInternalVariableName(o,r);if(e+=`${s}: var(${i}, inherit);`,t){e+=`${s.replace("preset-","")}: var(${s});`}}e+="}"}return e}_makeInternalVariableName(t,e){return`--zw-preset-${"color"===t?"font-color":t.replace(/_/i,"-")}${e===dd.COMMON?"":`-${e}`}`}makePresetHtmlClass(t){return this._baseClass+t.id}makePresetCssClass(t){return this.makePresetHtmlClass(t).split(" ").map((t=>`.${t}`)).join("")}}class zm{static createWindow(){return(new i.JSDOM).window}types;parse(t){const{window:e}=new i.JSDOM(t);return this.types=e,e.document}}class Vm{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(t){if(!this.name)throw new Error('Command "name" is required');let e=t.command(this.name);if(this.description&&(e=e.description(this.description)),this.argument&&(e=e.argument(this.argument)),this.options.length)for(const t of this.options)e=e.option(t.flags,t.description,t.default);e.action(this.doCommand.bind(this))}output(t){console.log(t)}}const Hm=new q,Wm=[class extends Vm{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:n.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(t,{config:e,format:r}){Rm.use(zm.createWindow());const o=n.resolve(process.cwd(),e),i=Lm.build({config:require(o).editor,nodeDomParser:new zm}),s=t.map((t=>i.toJSON(this._formatInputHtml(t)))),a=1===s.length?s[0]:s,u=this._stringifyContent(a);this.output("rb"===r?this._formatOutputRb(u):u)}_formatInputHtml(t){return t.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,((t,e)=>t.replace(e,parseFloat(e)/100)))}_stringifyContent(t){return JSON.stringify(t,((t,e)=>null===e?void 0:e),2)}_formatOutputRb(t){return t.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,(t=>t.replace(/"/g,""))).replace(/: "(.+)"([,\n])/g,": '$1'$2")}},class extends Vm{name="version";description="display cli version";doCommand(){this.output("3.1.1")}}];for(const t of Wm)(new t).install(Hm);Hm.parse();