PageSourceSearch

https://baskadia.com/_next/static/chunks/1c3f3ec3-fd500da7ca1f9daf.js

js baskadia.com collected 2026-09-24 09:03:57 UTC 66,444 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7333],{44573:function(t,e,s){s.d(e,{AOx:function(){return q},Ao0:function(){return ee},IGC:function(){return Q},JZE:function(){return $},QR:function(){return F},WDe:function(){return z},ZQL:function(){return se},_y:function(){return J},cx:function(){return H},gQe:function(){return zt},i8b:function(){return Z},nNj:function(){return V},uS7:function(){return B},w9d:function(){return Y}});var n=s(57555),r=s(378),o=s(31857),i=s(33937),a=s(47650),c=s(61082),d=s(13017),l=s(48776),u=s(12806),h=s(2376),p=s(27784),m=s(25804),g=s(84348),f=s(36912),y=s(82696),v=s(69400),S=s(84799),x=s(48111),k=s(45298),E=Object.defineProperty,b=Object.getOwnPropertyDescriptor,M=(t,e,s,n)=>{for(var r,o=n>1?void 0:n?b(e,s):e,i=t.length-1;i>=0;i--)(r=t[i])&&(o=(n?r(e,s,o):r(o))||o);return n&&o&&E(e,s,o),o},w=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},O=(t,e,s)=>(w(t,e,"read from private field"),s?s.call(t):e.get(t)),A=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},P=(t,e,s,n)=>(w(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s);function C(t,e){return t===e}function N(t){const{previousOptions:e,update:s,equals:r=C}=t,o=(0,n.vV)({...e,...s}),i=(0,n.Ry)(),a=(0,n.XP)(e);for(const n of a){const t=e[n],s=o[n];r(t,s)?i[n]={changed:!1}:i[n]={changed:!0,previousValue:t,value:s}}return{changes:(0,n.vV)(i),options:o,pickChanged:t=>{const e=(0,n.Ry)();for(const s of t){const t=i[s];(null==t?void 0:t.changed)&&(e[s]=t.value)}return e}}}var T={[r.mA.DUPLICATE_HELPER_NAMES]:"helper method",[r.mA.DUPLICATE_COMMAND_NAMES]:"command method"};function R(t){const{name:e,set:s,code:r}=t,o=T[r];(0,n.kG)(!s.has(e),{code:r,message:`There is a naming conflict for the name: ${e} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),s.add(e)}function H(...t){return(0,n.Nb)((0,c.cx)(...t).split(" ")).join(" ")}var _="__IGNORE__",K="__ALL__",D=class{constructor(t,...[e]){this["~O"]={},this._mappedHandlers=(0,n.Ry)(),this.populateMappedHandlers(),this._options=this._initialOptions=(0,n.RH)(t,this.constructor.defaultOptions,e??(0,n.Ry)(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const t=[],{customHandlerKeys:e,handlerKeys:s,staticKeys:r}=this.constructor;for(const o of(0,n.XP)(this._options))r.includes(o)||s.includes(o)||e.includes(o)||t.push(o);return t}ensureAllKeysAreDynamic(t){if(i.NZ.isProduction)return;const e=[];for(const s of(0,n.XP)(t))this._dynamicKeys.includes(s)||e.push(s);(0,n.kG)((0,n.yD)(e),{code:r.mA.INVALID_SET_EXTENSION_OPTIONS,message:`Invalid properties passed into the 'setOptions()' method: ${JSON.stringify(e)}.`})}setOptions(t){var e;const s=this.getDynamicOptions();this.ensureAllKeysAreDynamic(t);const{changes:n,options:r,pickChanged:o}=N({previousOptions:s,update:t});this.updateDynamicOptions(r),null==(e=this.onSetOptions)||e.call(this,{reason:"set",changes:n,options:r,pickChanged:o,initialOptions:this._initialOptions})}resetOptions(){var t;const e=this.getDynamicOptions(),{changes:s,options:n,pickChanged:r}=N({previousOptions:e,update:this._initialOptions});this.updateDynamicOptions(n),null==(t=this.onSetOptions)||t.call(this,{reason:"reset",options:n,changes:s,pickChanged:r,initialOptions:this._initialOptions})}getDynamicOptions(){return a(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(t){this._options={...this._options,...t}}populateMappedHandlers(){for(const t of this.constructor.handlerKeys)this._mappedHandlers[t]=[]}createDefaultHandlerOptions(){const t=(0,n.Ry)();for(const e of this.constructor.handlerKeys)t[e]=(...t)=>{var s;const{handlerKeyOptions:n}=this.constructor,r=null==(s=n[e])?void 0:s.reducer;let o=null==r?void 0:r.getDefault(...t);for(const[,i]of this._mappedHandlers[e]){const s=i(...t);if(o=r?r.accumulator(o,s,...t):s,I(n,o,e))return o}return o};return t}addHandler(t,e,s=r.xV.Default){return this._mappedHandlers[t].push([s,e]),this.sortHandlers(t),()=>this._mappedHandlers[t]=this._mappedHandlers[t].filter((([,t])=>t!==e))}hasHandlers(t){return(this._mappedHandlers[t]??[]).length>0}sortHandlers(t){this._mappedHandlers[t]=(0,n.DY)(this._mappedHandlers[t],(([t],[e])=>e-t))}addCustomHandler(t,e){var s;return(null==(s=this.onAddCustomHandler)?void 0:s.call(this,{[t]:e}))??n.ZT}};function I(t,e,s){const{[K]:r}=t,o=t[s];return!(!r&&!o)&&(!(!o||o.earlyReturnValue===_||((0,n.mf)(o.earlyReturnValue)?!0!==o.earlyReturnValue(e):e!==o.earlyReturnValue))||!(!r||r.earlyReturnValue===_||((0,n.mf)(r.earlyReturnValue)?!0!==r.earlyReturnValue(e):e!==r.earlyReturnValue)))}D.defaultOptions={},D.staticKeys=[],D.handlerKeys=[],D.handlerKeyOptions={},D.customHandlerKeys=[];var L=class extends D{constructor(...t){super(U,...t),this["~E"]={},this._extensions=(0,n.uw)(this.createExtensions(),(t=>t.constructor)),this.extensionMap=new Map;for(const e of this._extensions)this.extensionMap.set(e.constructor,e)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${(0,o.Ho)(this.name)}Extension`}
1get store(){return(0,n.kG)(this._store,{code:r.mA.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),(0,n.vV)(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(t,e){this.extensionMap.has(t)&&(this.extensionMap.set(t,e),this._extensions=this.extensions.map((s=>e.constructor===t?e:s)))}createExtensions(){return[]}getExtension(t){const e=this.extensionMap.get(t);return(0,n.kG)(e,{code:r.mA.INVALID_GET_EXTENSION,message:`'${t.name}' does not exist within the preset: '${this.name}'`}),e}isOfType(t){return this.constructor===t}setStore(t){this._store||(this._store=t)}clone(...t){return new this.constructor(...t)}setPriority(t){this.priorityOverride=t}};L.defaultPriority=r.xV.Default;var V=class extends L{static get[r.By](){return r.lk.PlainExtensionConstructor}get[r.By](){return r.lk.PlainExtension}},B=class extends L{static get[r.By](){return r.lk.MarkExtensionConstructor}get[r.By](){return r.lk.MarkExtension}get type(){return(0,n.fp)(this.store.schema.marks,this.name)}constructor(...t){super(...t)}};B.disableExtraAttributes=!1;var F=class extends L{static get[r.By](){return r.lk.NodeExtensionConstructor}get[r.By](){return r.lk.NodeExtension}get type(){return(0,n.fp)(this.store.schema.nodes,this.name)}constructor(...t){super(...t)}};F.disableExtraAttributes=!1;var U={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function W(t){return(0,i.gf)(t)&&(0,i.pI)(t,[r.lk.PlainExtension,r.lk.MarkExtension,r.lk.NodeExtension])}function G(t){return(0,i.gf)(t)&&(0,i.pI)(t,r.lk.PlainExtension)}function $(t){return(0,i.gf)(t)&&(0,i.pI)(t,r.lk.NodeExtension)}function j(t){return(0,i.gf)(t)&&(0,i.pI)(t,r.lk.MarkExtension)}function q(t){return e=>{const{defaultOptions:s,customHandlerKeys:r,handlerKeys:o,staticKeys:i,defaultPriority:a,handlerKeyOptions:c,...d}=t,l=(0,n.RF)(e);s&&(l.defaultOptions=s),a&&(l.defaultPriority=a),c&&(l.handlerKeyOptions=c),l.staticKeys=i??[],l.handlerKeys=o??[],l.customHandlerKeys=r??[];for(const[t,n]of Object.entries(d))l[t]||(l[t]=n);return(0,n.RF)(l)}}var X=class extends V{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=(0,n.Ry)(),this.updateAttributes=(t=!0)=>{this.transformAttributes(),t&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var t,e,s;if(this.attributeObject=(0,n.Ry)(),null==(t=this.store.managerSettings.exclude)?void 0:t.attributes)this.store.setStoreKey("attributes",this.attributeObject);else{this.attributeList=[];for(const t of this.store.extensions){if(null==(e=t.options.exclude)?void 0:e.attributes)continue;const n=null==(s=t.createAttributes)?void 0:s.call(t),r={...n,class:H(...t.classNames??[],null==n?void 0:n.class)};this.attributeList.unshift(r)}for(const t of this.attributeList)this.attributeObject={...this.attributeObject,...t,class:H(this.attributeObject.class,t.class)};this.store.setStoreKey("attributes",this.attributeObject)}}};function J(t={}){return(e,s,n)=>{(e.decoratedHelpers??(e.decoratedHelpers={}))[s]=t}}function z(t={}){return(e,s,n)=>{(e.decoratedCommands??(e.decoratedCommands={}))[s]=t}}function Q(t){return(e,s,n)=>{(e.decoratedKeybindings??(e.decoratedKeybindings={}))[s]=t}}function Y(t){const{type:e,attrs:s,range:o,selection:a}=t;return t=>{const{dispatch:c,tr:d,state:l}=t,u=(0,n.HD)(e)?l.schema.marks[e]:e;if((0,n.kG)(u,{code:r.mA.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),o||a){const{from:t,to:n}=(0,i.b0)(a??o??d.selection,d.doc);return(0,i.yw)({trState:d,type:e,...o})?null==c||c(d.removeMark(t,n,u)):null==c||c(d.addMark(t,n,u.create(s))),!0}return(0,p.A_)((0,m.w9)(u,s))(t)}}var Z=class extends V{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(t,...e)=>{const{forcedUpdates:s}=this.getCommandMeta(t);return this.setCommandMeta(t,{forcedUpdates:(0,n.Nb)([...s,...e])}),t}}get name(){return"commands"}get transaction(){const t=this.store.getState();this._transaction||(this._transaction=t.tr);const e=this._transaction.before.eq(t.doc),s=!(0,n.yD)(this._transaction.steps);if(!e){const e=t.tr;if(s)for(const t of this._transaction.steps)e.step(t);this._transaction=e}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(t){var e;const{extensions:s,helpers:r}=this.store,o=(0,n.Ry)(),i=new Set;let a=(0,n.Ry)();const c=e=>{var s;const r=(0,n.Ry)(),i=()=>e??this.transaction;let d=[];const l=()=>d;for(const[t,n]of Object.entries(o))(null==(s=a[t])?void 0:s.disableChaining)||(r[t]=this.chainedFactory({chain:r,command:n.original,getTr:i,getChain:l}));const u=t=>{(0,n.kG)(t===i(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return r.run=(e={})=>{const s=d;d=[];for(const t of s)if(!t(u)&&e.exitEarly)return;t.dispatch(i())},r.tr=()=>{const t=d;d=[];for(const e of t)e(u);return i()},r.enabled=()=>{for(const t of d)if(!t())return!1;return!0},r.new=t=>c(t),r};for(const l of s){const t=(null==(e=l.createCommands)?void 0:e.call(l))??{},s=l.decoratedCommands??{},c={};a={...a,decoratedCommands:s};for(const[e,o]of Object.entries(s)){const s=(0,n.HD)(o.shortcut)&&o.shortcut.startsWith("_|")?{shortcut:r.getNamedShortcut(o.shortcut,l.options)}:void 0;this.updateDecorated(e,{...o,name:l.name,...s}),t[e]=l[e].bind(l),o.active&&(c[e]=()=>{var t;return(null==(t=o.active)?void 0:t.call(o,l.options,this.store))??!1})}(0,n.Qr)(t)||this.addCommands({active:c,names:i,commands:o,extensionCommands:t})}const d=c();for(const[n,l]of Object.entries(d))c[n]=l;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",c),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",c)}onStateUpdate({state:t}){this._transaction=t.tr}createPlugin(){return{}}customDispatch(t){return t}insertText(t,e={}){return(0,n.HD)(t)?function(t,e={}){return({tr:s,dispatch:r,state:o})=>{const i=o.schema,a=s.selection,{from:c=a.from,to:d=c??a.to,marks:l={}}=e;if(!r)return!0;s.insertText(t,c,d);const u=(0,n.fp)(s.steps,s.steps.length-1).getMap().map(d);for(const[t,e]of(0,n.qh)(l))s.addMark(c,u,(0,n.fp)(i.marks,t).create(e));return r(s),!0}}(t,e):this.store.createPlaceholderCommand({promise:t,placeholder:{type:"inline"},onSuccess:(t,s,n)=>this.insertText(t,{...e,...s})(n)}).generateCommand()}selectText(t,e={}){return({tr:s,dispatch:n})=>{const r=(0,i.b0)(t,s.doc);return!(s.selection.anchor===r.anchor&&s.selection.head===r.head&&!e.forceUpdate)&&(null==n||n(s.setSelection(r)),!0)}}selectMark(t){return e=>{const{tr:s}=e,n=(0,i.IH)(s.selection.$from,t);return!!n&&this.store.commands.selectText.original({from:n.from,to:n.to})(e)}}delete(t){return({tr:e,dispatch:s})=>{const{from:n,to:r}=t??e.selection;return null==s||s(e.delete(n,r)),!0}}emptyUpdate(t){return({tr:e,dispatch:s})=>(s&&(null==t||t(),s(e)),!0)}forceUpdate(...t){return({tr:e,dispatch:s})=>(null==s||s(this.forceUpdateTransaction(e,...t)),!0)}updateNodeAttributes(t,e){return({tr:s,dispatch:n})=>(null==n||n(s.setNodeMarkup(t,void 0,e)),!0)}setContent(t,e){return s=>{const{tr:n,dispatch:r}=s,o=this.store.manager.createState({content:t,selection:e});return!!o&&(null==r||r(n.replaceRangeWith(0,n.doc.nodeSize-2,o.doc)),!0)}}resetContent(){return t=>{const{tr:e,dispatch:s}=t,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(t):(null==s||s(e.delete(0,e.doc.nodeSize)),!0)}}emptySelection(){return({tr:t,dispatch:e})=>!t.selection.empty&&(null==e||e(t.setSelection(h.Bs.near(t.selection.$anchor))),!0)}insertNewLine(){return({dispatch:t,tr:e})=>!!(0,i.hT)(e.selection)&&(null==t||t(e.insertText("\n")),!0)}insertNode(t,e={}){return({dispatch:s,tr:o,state:a})=>{var c;const{attrs:d,range:l,selection:h,replaceEmptyParentBlock:p=!1}=e,{from:m,to:g,$from:f}=(0,i.b0)(h??l??o.selection,o.doc);if((0,i.PH)(t)||(0,i.mt)(t)){const e=f.before(f.depth);return null==s||s(p&&m===g&&(0,i.mp)(f.parent)?o.replaceWith(e,e+f.parent.nodeSize,t):o.replaceWith(m,g,t)),!0}const y=(0,n.HD)(t)?a.schema.nodes[t]:t;(0,n.kG)(y,{code:r.mA.SCHEMA,message:`The requested node type ${t} does not exist in the schema.`});const v=null==(c=e.marks)?void 0:c.map((t=>{if(t instanceof u.vc)return t;const e=(0,n.HD)(t)?a.schema.marks[t]:t;return(0,n.kG)(e,{code:r.mA.SCHEMA,message:`The requested mark type ${t} does not exist in the schema.`}),e.create()})),S=y.createAndFill(d,(0,n.HD)(e.content)?a.schema.text(e.content):e.content,v);if(!S)return!1;return null==s||s(m!==g?o.replaceRangeWith(m,g,S):o.insert(m,S)),!0}}focus(t){return e=>{const{dispatch:s,tr:n}=e,{view:r}=this.store;if(!1===t)return!1;if(r.hasFocus()&&(void 0===t||!0===t))return!1;if(void 0===t||!0===t){const{from:e=0,to:s=e}=n.selection;t={from:e,to:s}}return s&&this.delayedFocus(),this.selectText(t)(e)}}blur(t){return e=>{const{view:s}=this.store;return!!s.hasFocus()&&(requestAnimationFrame((()=>{s.dom.blur()})),!t||this.selectText(t)(e))}}setBlockNodeType(t,e,s,n=!0){return(0,i.uJ)(t,e,s,n)}toggleWrappingNode(t,e,s){return(0,i.bm)(t,e,s)}toggleBlockNodeItem(t){return(0,i.zU)(t)}wrapInNode(t,e,s){return(0,i.ym)(t,e,s)}applyMark(t,e,s){return function(t,e,s){return({tr:o,dispatch:a,state:c})=>{const d=(0,i.b0)(s??o.selection,o.doc),l=(0,i.Lp)(d),u=(0,n.HD)(t)?c.schema.marks[t]:t;if((0,n.kG)(u,{code:r.mA.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),d.empty&&!l||!function(t,e,s){for(const{$from:n,$to:r}of s){let s=0===n.depth&&e.type.allowsMarkType(t);if(e.nodesBetween(n.pos,r.pos,(e=>{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(t)})),s)return!0}return!1}(u,o.doc,d.ranges))return!1;if(!a)return!0;
1if(l)return o.removeStoredMark(u),e&&o.addStoredMark(u.create(e)),a(o),!0;let h=!1;for(const{$from:t,$to:e}of d.ranges){if(h)break;h=o.doc.rangeHasMark(t.pos,e.pos,u)}for(const{$from:t,$to:s}of d.ranges)h&&o.removeMark(t.pos,s.pos,u),e&&o.addMark(t.pos,s.pos,u.create(e));return a(o),!0}}(t,e,s)}toggleMark(t){return Y(t)}removeMark(t){return(0,i.P9)(t)}setMeta(t,e){return({tr:s})=>(s.setMeta(t,e),!0)}selectAll(){return this.selectText("all")}copy(){return t=>!t.tr.selection.empty&&(t.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var t;return(null==(t=navigator.clipboard)?void 0:t.readText)?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(t,e,s)=>this.insertNode((0,i.OC)({content:t,schema:s.state.schema}),{selection:e})(s)}).generateCommand()}cut(){return t=>!t.tr.selection.empty&&(t.dispatch&&document.execCommand("cut"),!0)}replaceText(t){return(0,i.lp)(t)}getAllCommandOptions(){const t={};for(const[e,s]of this.decorated)(0,n.Qr)(s)||(t[e]=s);return t}getCommandOptions(t){return this.decorated.get(t)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(t,e){if(!e)return void this.decorated.delete(t);const s=this.decorated.get(t)??{name:""};this.decorated.set(t,{...s,...e})}handleIosFocus(){i.NZ.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame((()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())}))}getForcedUpdates(t){return this.getCommandMeta(t).forcedUpdates}getCommandMeta(t){const e=t.getMeta(this.pluginKey)??{};return{...tt,...e}}setCommandMeta(t,e){const s=this.getCommandMeta(t);t.setMeta(this.pluginKey,{...s,...e})}addCommands(t){const{extensionCommands:e,commands:s,names:o,active:i}=t;for(const[a,c]of(0,n.qh)(e))R({name:a,set:o,code:r.mA.DUPLICATE_COMMAND_NAMES}),(0,n.kG)(!et.has(a),{code:r.mA.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),s[a]=this.createUnchainedCommand(c,i[a])}unchainedFactory(t){return(...e)=>{const{shouldDispatch:s=!0,command:n}=t,{view:r}=this.store,{state:o}=r;let i;return s&&(i=r.dispatch),n(...e)({state:o,dispatch:i,view:r,tr:o.tr})}}createUnchainedCommand(t,e){const s=this.unchainedFactory({command:t});return s.enabled=this.unchainedFactory({command:t,shouldDispatch:!1}),s.isEnabled=s.enabled,s.original=t,s.active=e,s}chainedFactory(t){return(...e)=>{const{chain:s,command:n,getTr:r,getChain:o}=t,i=o(),{view:a}=this.store,{state:c}=a;return i.push((t=>n(...e)({state:c,dispatch:t,view:a,tr:r()}))),s}}};M([z()],Z.prototype,"customDispatch",1),M([z()],Z.prototype,"insertText",1),M([z()],Z.prototype,"selectText",1),M([z()],Z.prototype,"selectMark",1),M([z()],Z.prototype,"delete",1),M([z()],Z.prototype,"emptyUpdate",1),M([z()],Z.prototype,"forceUpdate",1),M([z()],Z.prototype,"updateNodeAttributes",1),M([z()],Z.prototype,"setContent",1),M([z()],Z.prototype,"resetContent",1),M([z()],Z.prototype,"emptySelection",1),M([z()],Z.prototype,"insertNewLine",1),M([z()],Z.prototype,"insertNode",1),M([z()],Z.prototype,"focus",1),M([z()],Z.prototype,"blur",1),M([z()],Z.prototype,"setBlockNodeType",1),M([z()],Z.prototype,"toggleWrappingNode",1),M([z()],Z.prototype,"toggleBlockNodeItem",1),M([z()],Z.prototype,"wrapInNode",1),M([z()],Z.prototype,"applyMark",1),M([z()],Z.prototype,"toggleMark",1),M([z()],Z.prototype,"removeMark",1),M([z()],Z.prototype,"setMeta",1),M([z({description:({t:t})=>t(l.Vb.SELECT_ALL_DESCRIPTION),label:({t:t})=>t(l.Vb.SELECT_ALL_LABEL),shortcut:r.vO.SelectAll})],Z.prototype,"selectAll",1),M([z({description:({t:t})=>t(l.Vb.COPY_DESCRIPTION),label:({t:t})=>t(l.Vb.COPY_LABEL),shortcut:r.vO.Copy,icon:"fileCopyLine"})],Z.prototype,"copy",1),M([z({description:({t:t})=>t(l.Vb.PASTE_DESCRIPTION),label:({t:t})=>t(l.Vb.PASTE_LABEL),shortcut:r.vO.Paste,icon:"clipboardLine"})],Z.prototype,"paste",1),M([z({description:({t:t})=>t(l.Vb.CUT_DESCRIPTION),label:({t:t})=>t(l.Vb.CUT_LABEL),shortcut:r.vO.Cut,icon:"scissorsFill"})],Z.prototype,"cut",1),M([z()],Z.prototype,"replaceText",1),M([J()],Z.prototype,"getAllCommandOptions",1),M([J()],Z.prototype,"getCommandOptions",1),M([J()],Z.prototype,"getCommandPro
1p",1),Z=M([q({defaultPriority:r.xV.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],Z);var tt={forcedUpdates:[]},et=new Set(["run","chain","original","raw","enabled","tr","new"]),st=class extends V{constructor(){super(...arguments),this.placeholders=g.EH.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=t=>{const e=(0,n.EL)(),{promise:s,placeholder:r,onFailure:o,onSuccess:i}=t;return new class{constructor(t){this.promiseCreator=t,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let e=!0;const{view:s,tr:n,dispatch:r}=t;if(!s)return!1;for(const o of this.validateHandlers)if(!o({...t,dispatch:()=>{}})){e=!1;break}return r&&e?(this.promiseCreator(t).then((t=>{this.runHandlers(this.successHandlers,{value:t,state:s.state,tr:s.state.tr,dispatch:s.dispatch,view:s})})).catch((t=>{this.runHandlers(this.failureHandlers,{error:t,state:s.state,tr:s.state.tr,dispatch:s.dispatch,view:s})})),r(n),!0):e}}validate(t,e="push"){return this.validateHandlers[e](t),this}success(t,e="push"){return this.successHandlers[e](t),this}failure(t,e="push"){return this.failureHandlers[e](t),this}runHandlers(t,e){var s;for(const n of t)if(!n({...e,dispatch:()=>{}}))break;null==(s=e.dispatch)||s.call(e,e.tr)}}(s).validate((t=>this.addPlaceholder(e,r)(t))).success((t=>{const{state:s,tr:n,dispatch:r,view:a,value:c}=t,d=this.store.helpers.findPlaceholder(e);if(!d){const t=new Error("The placeholder has been removed");return(null==o?void 0:o({error:t,state:s,tr:n,dispatch:r,view:a}))??!1}return this.removePlaceholder(e)({state:s,tr:n,view:a,dispatch:()=>{}}),i(c,d,{state:s,tr:n,dispatch:r,view:a})})).failure((t=>(this.removePlaceholder(e)({...t,dispatch:()=>{}}),(null==o?void 0:o(t))??!1)))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:t=>{var e,s,n,r,o,i;const{added:a,clearTrackers:c,removed:d,updated:l}=this.getMeta(t);if(c){this.placeholders=g.EH.empty;for(const[,t]of this.placeholderWidgets)null==(s=(e=t.spec).onDestroy)||s.call(e,this.store.view,t.spec.element);this.placeholderWidgets.clear()}else{this.placeholders=this.placeholders.map(t.mapping,t.doc,{onRemove:t=>{var e,s;const n=this.placeholderWidgets.get(t.id);n&&(null==(s=(e=n.spec).onDestroy)||s.call(e,this.store.view,n.spec.element))}});for(const[,t]of this.placeholderWidgets)null==(r=(n=t.spec).onUpdate)||r.call(n,this.store.view,t.from,t.spec.element,t.spec.data);for(const e of a)"inline"!==e.type?"node"!==e.type?"widget"!==e.type||this.addWidgetPlaceholder(e,t):this.addNodePlaceholder(e,t):this.addInlinePlaceholder(e,t);for(const{id:e,data:s}of l){const n=this.placeholderWidgets.get(e);if(!n)continue;const r=g.p.widget(n.from,n.spec.element,{...n.spec,data:s});this.placeholders=this.placeholders.remove([n]).add(t.doc,[r]),this.placeholderWidgets.set(e,r)}for(const t of d){const e=this.placeholders.find(void 0,void 0,(e=>e.id===t&&e.__type===rt)),s=this.placeholderWidgets.get(t);s&&(null==(i=(o=s.spec).onDestroy)||i.call(o,this.store.view,s.spec.element)),this.placeholders=this.placeholders.remove(e),this.placeholderWidgets.delete(t)}}}},props:{decorations:t=>{let e=this.options.decorations(t);e=e.add(t.doc,this.placeholders.find());for(const s of this.store.extensions){if(!s.createDecorations)continue;const n=s.createDecorations(t).find();e=e.add(t.doc,n)}return e},handleDOMEvents:{blur:t=>(this.options.persistentSelectionClass&&t.dispatch(t.state.tr.setMeta(ot,!1)),!1),focus:t=>(this.options.persistentSelectionClass&&t.dispatch(t.state.tr.setMeta(ot,!0)),!1)}}}}updateDecorations(){return({tr:t,dispatch:e})=>(null==e||e(t),!0)}addPlaceholder(t,e,s){return({dispatch:n,tr:r})=>!!this.addPlaceholderTransaction(t,e,r,!n)&&(null==n||n(s?r.deleteSelection():r),!0)}updatePlaceholder(t,e){return({dispatch:s,tr:n})=>!!this.updatePlaceholderTransaction({id:t,data:e,tr:n,checkOnly:!s})&&(null==s||s(n),!0)}removePlaceholder(t){return({dispatch:e,tr:s})=>!!this.removePlaceholderTransaction({id:t,tr:s,checkOnly:!e})&&(null==e||e(s),!0)}clearPlaceholders(){return({tr:t,dispatch:e})=>!!this.clearPlaceholdersTransaction({tr:t,checkOnly:!e})&&(null==e||e(t),!0)}findPlaceholder(t){return this.findAllPlaceholders().get(t)}findAllPlaceholders(){const t=new Map,e=this.placeholders.find(void 0,void 0,(t=>t.__type===rt));for(const s of e)t.set(s.spec.id,{from:s.from,to:s.to});return t}createDecorations(t){var e,s,r;const{persistentSelectionClass:o}=this.options;return!o||(null==(e=this.store.view)?void 0:e.hasFocus())||(null==(r=(s=this.store.helpers).isInteracting)?void 0:r.call(s))?g.EH.empty:function(t,e,s){const{selection:n,doc:r}=t;if(n.empty)return e;const{from:o,to:a}=n,c=(0,i.EG)(n)?g.p.node(o,a,s):g.p.inline(o,a,s);return e.add(r,[c])}(t,g.EH.empty,{class:(0,n.HD)(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(t,e){const{pos:s,createElement:n,onDestroy:r,onUpdate:o,className:i,nodeName:a,id:c,t
1ype:d}=t,l=(null==n?void 0:n(this.store.view,s))??document.createElement(a);l.classList.add(i);const u=g.p.widget(s,l,{id:c,__type:rt,type:d,element:l,onDestroy:r,onUpdate:o});this.placeholderWidgets.set(c,u),this.placeholders=this.placeholders.add(e.doc,[u])}addInlinePlaceholder(t,e){const{from:s=e.selection.from,to:n=e.selection.to,className:r,nodeName:o,id:i,type:a}=t;let c;if(s===n){const t=document.createElement(o);t.classList.add(r),c=g.p.widget(s,t,{id:i,type:a,__type:rt,widget:t})}else c=g.p.inline(s,n,{nodeName:o,class:r},{id:i,__type:rt});this.placeholders=this.placeholders.add(e.doc,[c])}addNodePlaceholder(t,e){const{pos:s,className:r,nodeName:o,id:a}=t,c=(0,n.hj)(s)?e.doc.resolve(s):e.selection.$from,d=(0,n.hj)(s)?c.nodeAfter?{pos:s,end:c.nodeAfter.nodeSize}:void 0:(0,i.hK)(c);if(!d)return;const l=g.p.node(d.pos,d.end,{nodeName:o,class:r},{id:a,__type:rt});this.placeholders=this.placeholders.add(e.doc,[l])}withRequiredBase(t,e){const{placeholderNodeName:s,placeholderClassName:n}=this.options,{nodeName:r=s,className:o,...i}=e;return{nodeName:r,className:(o?[n,o]:[n]).join(" "),...i,id:t}}getMeta(t){const e=t.getMeta(this.pluginKey)??{};return{...nt,...e}}setMeta(t,e){const s=this.getMeta(t);t.setMeta(this.pluginKey,{...s,...e})}addPlaceholderTransaction(t,e,s,n=!1){if(this.findPlaceholder(t))return!1;if(n)return!0;const{added:r}=this.getMeta(s);return this.setMeta(s,{added:[...r,this.withRequiredBase(t,e)]}),!0}updatePlaceholderTransaction(t){const{id:e,tr:s,checkOnly:r=!1,data:o}=t;if(!this.findPlaceholder(e))return!1;if(r)return!0;const{updated:i}=this.getMeta(s);return this.setMeta(s,{updated:(0,n.Nb)([...i,{id:e,data:o}])}),!0}removePlaceholderTransaction(t){const{id:e,tr:s,checkOnly:r=!1}=t;if(!this.findPlaceholder(e))return!1;if(r)return!0;const{removed:o}=this.getMeta(s);return this.setMeta(s,{removed:(0,n.Nb)([...o,e])}),!0}clearPlaceholdersTransaction(t){const{tr:e,checkOnly:s=!1}=t;return this.getPluginState()!==g.EH.empty&&(s||this.setMeta(e,{clearTrackers:!0}),!0)}};M([z()],st.prototype,"updateDecorations",1),M([z()],st.prototype,"addPlaceholder",1),M([z()],st.prototype,"updatePlaceholder",1),M([z()],st.prototype,"removePlaceholder",1),M([z()],st.prototype,"clearPlaceholders",1),M([J()],st.prototype,"findPlaceholder",1),M([J()],st.prototype,"findAllPlaceholders",1),st=M([q({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(t,e,s)=>t.add(s.doc,e.find()),getDefault:()=>g.EH.empty}}},defaultPriority:r.xV.Low})],st);var nt={added:[],updated:[],clearTrackers:!1,removed:[]},rt="placeholderDecoration",ot="persistentSelectionFocus";var it=class extends V{get name(){return"docChanged"}onStateUpdate(t){const{firstUpdate:e,transactions:s,tr:n}=t;e||(s??[n]).some((t=>null==t?void 0:t.docChanged))&&this.options.docChanged(t)}};it=M([q({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:r.xV.Lowest})],it);var at=class extends V{get name(){return"helpers"}onCreate(){var t;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",i.OC);const e=(0,n.Ry)(),s=(0,n.Ry)(),o=(0,n.Ry)(),a=new Set;for(const c of this.store.extensions){$(c)&&(s[c.name]=t=>(0,i.Ig)({state:this.store.getState(),type:c.type,attrs:t}),o[c.name]=t=>{var e;return null==(e=(0,i.EM)({state:this.store.getState(),type:c.type,attrs:t}))?void 0:e.node.attrs}),j(c)&&(s[c.name]=t=>(0,i.yw)({trState:this.store.getState(),type:c.type,attrs:t}),o[c.name]=t=>{const e=(0,i.IH)(this.store.getState().selection.$from,c.type);return e&&t?(0,i.V1)(e.mark,t)?e.mark.attrs:void 0:null==e?void 0:e.mark.attrs});const d=(null==(t=c.createHelpers)?void 0:t.call(c))??{};for(const t of Object.keys(c.decoratedHelpers??{}))d[t]=c[t].bind(c);if(!(0,n.Qr)(d))for(const[t,s]of(0,n.qh)(d))R({name:t,set:a,code:r.mA.DUPLICATE_HELPER_NAMES}),e[t]=s}this.store.setStoreKey("attrs",o),this.store.setStoreKey("active",s),this.store.setStoreKey("helpers",e),this.store.setExtensionStore("attrs",o),this.store.setExtensionStore("active",s),this.store.setExtensionStore("helpers",e)}isSelectionEmpty(t=this.store.getState()){return(0,i.Ab)(t)}isViewEditable(t=this.store.getState()){var e,s;return(null==(s=(e=this.store.view.props).editable)?void 0:s.call(e,t))??!1}getStateJSON(t=this.store.getState()){return t.toJSON()}getJSON(t=this.store.getState()){return t.doc.toJSON()}getRemirrorJSON(t=this.store.getState()){return this.getJSON(t)}insertHtml(t,e){return s=>{const{state:n}=s,r=(0,i.OC)({content:t,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(r,e)(s)}}getText({lineBreakDivider:t="\n\n",state:e=this.store.getState()}={}){return e.doc.textBetween(0,e.doc.content.size,t,r.Vp)}
1getTextBetween(t,e,s=this.store.getState().doc){return s.textBetween(t,e,"\n\n",r.Vp)}getHTML(t=this.store.getState()){return(0,i.Em)(t.doc,this.store.document)}textToProsemirrorNode(t){const e=`<pre>${t.content}</pre>`;return this.store.stringHandlers.html({...t,content:e})}};M([J()],at.prototype,"isSelectionEmpty",1),M([J()],at.prototype,"isViewEditable",1),M([J()],at.prototype,"getStateJSON",1),M([J()],at.prototype,"getJSON",1),M([J()],at.prototype,"getRemirrorJSON",1),M([z()],at.prototype,"insertHtml",1),M([J()],at.prototype,"getText",1),M([J()],at.prototype,"getTextBetween",1),M([J()],at.prototype,"getHTML",1),at=M([q({})],at);var ct=class extends V{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var t,e;const s=[],n=this.store.markTags[r.eX.ExcludeInputRules];for(const r of this.store.extensions)if(!(null==(t=this.store.managerSettings.exclude)?void 0:t.inputRules)&&r.createInputRules&&!(null==(e=r.options.exclude)?void 0:e.inputRules))for(const t of r.createInputRules())t.shouldSkip=this.options.shouldSkipInputRule,t.invalidMarks=n,s.push(t);return(0,f.Hw)({rules:s})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};ct=M([q({defaultPriority:r.xV.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],ct);var dt=class extends V{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:t})=>{var e,s;if(t)return this.extraKeyBindings=[...this.extraKeyBindings,t],null==(s=(e=this.store).rebuildKeymap)||s.call(e),()=>{var e,s;this.extraKeyBindings=this.extraKeyBindings.filter((e=>e!==t)),null==(s=(e=this.store).rebuildKeymap)||s.call(e)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:t}=this.options;return(0,n.HD)(t)?mt[t]:t}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var t;return(null==(t=this.store.managerSettings.exclude)?void 0:t.keymap)?[]:(this.setupKeydownHandler(),[new h.Sy({props:{handleKeyDown:(t,e)=>{var s;return null==(s=this.keydownHandler)?void 0:s.call(this,t,e)}}})])}setupKeydownHandler(){const t=this.generateKeymapBindings();this.keydownHandler=(0,y.$)(t)}generateKeymapBindings(){var t;const e=[],s=this.shortcutMap,o=this.store.getExtension(Z),a=t=>e=>lt({shortcut:e,map:s,store:this.store,options:t.options});for(const i of this.store.extensions){const c=i.decoratedKeybindings??{};if(!(null==(t=i.options.exclude)?void 0:t.keymap)){i.createKeymap&&e.push(ht(i.createKeymap(a(i)),s));for(const[t,a]of(0,n.qh)(c)){if(a.isActive&&!a.isActive(i.options,this.store))continue;const c=i[t].bind(i),d=lt({shortcut:a.shortcut,map:s,options:i.options,store:this.store}),l=(0,n.mf)(a.priority)?a.priority(i.options,this.store):a.priority??r.xV.Low,u=(0,n.Ry)();for(const t of d)u[t]=c;e.push([l,u]),a.command&&o.updateDecorated(a.command,{shortcut:d})}}}const c=this.sortKeymaps([...this.extraKeyBindings,...e]);return(0,i.bk)(c)}arrowRightShortcut(t){const e=this.store.markTags[r.eX.PreventExits],s=this.store.nodeTags[r.eX.PreventExits];return this.exitMarkForwards(e,s)(t)}arrowLeftShortcut(t){const e=this.store.markTags[r.eX.PreventExits],s=this.store.nodeTags[r.eX.PreventExits];return(0,i.Q2)(this.exitNodeBackwards(s),this.exitMarkBackwards(e,s))(t)}backspace(t){const e=this.store.markTags[r.eX.PreventExits],s=this.store.nodeTags[r.eX.PreventExits];return(0,i.Q2)(this.exitNodeBackwards(s,!0),this.exitMarkBackwards(e,s,!0))(t)}createKeymap(){const{selectParentNodeOnEscape:t,undoInputRuleOnBackspace:e,excludeBaseKeymap:s}=this.options,o=(0,n.Ry)();if(!s)for(const[r,i]of(0,n.qh)(m.YR))o[r]=(0,p.A_)(i);return e&&m.YR.Backspace&&(o.Backspace=(0,p.A_)((0,m.QF)(f.dU,m.YR.Backspace))),t&&(o.Escape=(0,p.A_)(m.N0)),[r.xV.Low,o]}getNamedShortcut(t,e={}){return t.startsWith("_|")?lt({shortcut:t,map:this.shortcutMap,store:this.store,options:e}):[t]}onSetOptions(t){var e,s;const{changes:n}=t;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&(null==(s=(e=this.store).rebuildKeymap)||s.call(e))}sortKeymaps(t){return(0,n.DY)(t.map((t=>(0,n.kJ)(t)?t:[r.xV.Default,t])),((t,e)=>e[0]-t[0])).map((t=>t[1]))}exitMarkForwards(t,e){return s=>{const{tr:r,dispatch:o}=s;if(!(0,i.OA)(r.selection))return!1;if((0,i.Tr)({selection:r.selection,types:e}))return!1;const a=r.selection.$from.marks().filter((e=>
1!t.includes(e.type.name)));if((0,n.yD)(a))return!1;if(!o)return!0;for(const t of a)r.removeStoredMark(t);return o(r.insertText(" ",r.selection.from)),!0}}exitNodeBackwards(t,e=!1){return s=>{const{tr:n}=s;if(!(e?i.GK:i.sg)(n.selection))return!1;const r=n.selection.$anchor.node();return!(!(0,i.mp)(r)||(0,i.xN)(r)||t.includes(r.type.name))&&this.store.commands.toggleBlockNodeItem.original({type:r.type})(s)}}exitMarkBackwards(t,e,s=!1){return r=>{const{tr:o,dispatch:a}=r;if(!(s?i.GK:i.sg)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if((0,i.Tr)({selection:o.selection,types:e}))return!1;const c=[...o.storedMarks??[],...o.selection.$from.marks()].filter((e=>!t.includes(e.type.name)));if((0,n.yD)(c))return!1;if(!a)return!0;for(const t of c)o.removeStoredMark(t);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),a(o),!0}}};function lt({shortcut:t,map:e,options:s,store:r}){return(0,n.HD)(t)?[ut(t,e)]:(0,n.kJ)(t)?t.map((t=>ut(t,e))):lt({shortcut:t=t(s,r),map:e,options:s,store:r})}function ut(t,e){return function(t){return(0,n.q9)((0,n.VO)(r.vO),t)}(t)?e[t]:t}function ht(t,e){const s={};let r,o;(0,n.kJ)(t)?[o,r]=t:r=t;for(const[i,a]of(0,n.qh)(r))s[ut(i,e)]=a;return(0,n.o8)(o)?s:[o,s]}M([Q({shortcut:"ArrowRight",isActive:t=>t.exitMarksOnArrowPress})],dt.prototype,"arrowRightShortcut",1),M([Q({shortcut:"ArrowLeft",isActive:t=>t.exitMarksOnArrowPress})],dt.prototype,"arrowLeftShortcut",1),M([Q({shortcut:"Backspace",isActive:t=>t.exitMarksOnArrowPress})],dt.prototype,"backspace",1),M([J()],dt.prototype,"getNamedShortcut",1),dt=M([q({defaultPriority:r.xV.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],dt);var pt={[r.vO.Copy]:"Mod-c",[r.vO.Cut]:"Mod-x",[r.vO.Paste]:"Mod-v",[r.vO.PastePlain]:"Mod-Shift-v",[r.vO.SelectAll]:"Mod-a",[r.vO.Undo]:"Mod-z",[r.vO.Redo]:i.NZ.isMac?"Shift-Mod-z":"Mod-y",[r.vO.Bold]:"Mod-b",[r.vO.Italic]:"Mod-i",[r.vO.Underline]:"Mod-u",[r.vO.Strike]:"Mod-d",[r.vO.Code]:"Mod-`",[r.vO.Paragraph]:"Mod-Shift-0",[r.vO.H1]:"Mod-Shift-1",[r.vO.H2]:"Mod-Shift-2",[r.vO.H3]:"Mod-Shift-3",[r.vO.H4]:"Mod-Shift-4",[r.vO.H5]:"Mod-Shift-5",[r.vO.H6]:"Mod-Shift-6",[r.vO.TaskList]:"Mod-Shift-7",[r.vO.BulletList]:"Mod-Shift-8",[r.vO.OrderedList]:"Mod-Shift-9",[r.vO.Quote]:"Mod->",[r.vO.Divider]:"Mod-Shift-|",[r.vO.Codeblock]:"Mod-Shift-~",[r.vO.ClearFormatting]:"Mod-Shift-C",[r.vO.Superscript]:"Mod-.",[r.vO.Subscript]:"Mod-,",[r.vO.LeftAlignment]:"Mod-Shift-L",[r.vO.CenterAlignment]:"Mod-Shift-E",[r.vO.RightAlignment]:"Mod-Shift-R",[r.vO.JustifyAlignment]:"Mod-Shift-J",[r.vO.InsertLink]:"Mod-k",[r.vO.Find]:"Mod-f",[r.vO.FindBackwards]:"Mod-Shift-f",[r.vO.FindReplace]:"Mod-Shift-H",[r.vO.AddFootnote]:"Mod-Alt-f",[r.vO.AddComment]:"Mod-Alt-m",[r.vO.ContextMenu]:"Mod-Shift-\\",[r.vO.IncreaseFontSize]:"Mod-Shift-.",[r.vO.DecreaseFontSize]:"Mod-Shift-,",[r.vO.IncreaseIndent]:"Tab",[r.vO.DecreaseIndent]:"Shift-Tab",[r.vO.Shortcuts]:"Mod-/",[r.vO.Format]:i.NZ.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},mt={default:pt,googleDoc:{...pt,[r.vO.Strike]:"Mod-Shift-S",[r.vO.Code]:"Mod-Shift-M",[r.vO.Paragraph]:"Mod-Alt-0",[r.vO.H1]:"Mod-Alt-1",[r.vO.H2]:"Mod-Alt-2",[r.vO.H3]:"Mod-Alt-3",[r.vO.H4]:"Mod-Alt-4",[r.vO.H5]:"Mod-Alt-5",[r.vO.H6]:"Mod-Alt-6",[r.vO.OrderedList]:"Mod-Alt-7",[r.vO.BulletList]:"Mod-Alt-8",[r.vO.Quote]:"Mod-Alt-9",[r.vO.ClearFormatting]:"Mod-\\",[r.vO.IncreaseIndent]:"Mod-[",[r.vO.DecreaseIndent]:"Mod-]"}},gt=class extends V{get name(){return"nodeViews"}createPlugin(){const t=[],e=(0,n.Ry)();for(const s of this.store.extensions){if(!s.createNodeViews)continue;const e=s.createNodeViews();t.unshift((0,n.mf)(e)?{[s.name]:e}:e)}t.unshift(this.store.managerSettings.nodeViews??{});for(const s of t)Object.assign(e,s);return{props:{nodeViews:e}}}},ft=class extends V{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var t,e;const s=[];for(const r of this.store.extensions){if((null==(t=this.store.managerSettings.exclude)?void 0:t.pasteRules)||!r.createPasteRules||(null==(e=r.options.exclude)?void 0:e.pasteRules))continue;const o=r.createPasteRules(),i=(0,n.kJ)(o)?o:[o];s.push(...i)}
1return(0,v.N)(s)}},yt=class extends V{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=(0,n.Ry)(),this.stateGetters=new Map,this.getPluginStateCreator=t=>e=>t.getState(e??this.store.getState()),this.getStateByName=t=>{const e=this.stateGetters.get(t);return(0,n.kG)(e,{message:"No plugin exists for the requested extension name."}),e()}}get name(){return"plugins"}onCreate(){const{setStoreKey:t,setExtensionStore:e,managerSettings:s,extensions:n}=this.store;this.updateExtensionStore();const{plugins:r=[]}=s;this.updatePlugins(r,this.managerPlugins);for(const o of n)o.onApplyState&&this.applyStateHandlers.push(o.onApplyState.bind(o)),o.onInitState&&this.initStateHandlers.push(o.onInitState.bind(o)),o.onAppendTransaction&&this.appendTransactionHandlers.push(o.onAppendTransaction.bind(o)),this.extractExtensionPlugins(o);this.managerPlugins=r,this.store.setStoreKey("plugins",this.plugins),t("pluginKeys",this.pluginKeys),t("getPluginState",this.getStateByName),e("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(t,e,s)=>{const n=s.tr,r={previousState:e,tr:n,transactions:t,state:s};for(const o of this.appendTransactionHandlers)o(r);return this.options.appendTransaction(r),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(t,e)=>{for(const s of this.initStateHandlers)s(e)},apply:(t,e,s,n)=>{const r={previousState:s,state:n,tr:t};for(const o of this.applyStateHandlers)o(r);this.options.applyState(r)}}}}extractExtensionPlugins(t){var e,s;if(!(!t.createPlugin&&!t.createExternalPlugins||(null==(e=this.store.managerSettings.exclude)?void 0:e.plugins)||(null==(s=t.options.exclude)?void 0:s.plugins))){if(t.createPlugin){const e=new h.H$(t.name);this.pluginKeys[t.name]=e;const s=this.getPluginStateCreator(e);t.pluginKey=e,t.getPluginState=s,this.stateGetters.set(t.name,s),this.stateGetters.set(t.constructor,s);const n={...t.createPlugin(),key:e},r=new h.Sy(n);this.updatePlugins([r],t.plugin?[t.plugin]:void 0),t.plugin=r}if(t.createExternalPlugins){const e=t.createExternalPlugins();this.updatePlugins(e,t.externalPlugins),t.externalPlugins=e}}}updatePlugins(t,e){if(!e||(0,n.yD)(e))return void(this.plugins=[...this.plugins,...t]);if(t.length!==e.length)return void(this.plugins=[...this.plugins.filter((t=>!e.includes(t))),...t]);const s=new Map;for(const[r,o]of t.entries())s.set((0,n.fp)(e,r),o);this.plugins=this.plugins.map((t=>e.includes(t)?s.get(t):t))}updateExtensionStore(){const{setExtensionStore:t}=this.store;t("updatePlugins",this.updatePlugins.bind(this)),t("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),t("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(t){const e=W(t)?t:function(t){return(0,i.gf)(t)&&(0,i.pI)(t,[r.lk.PlainExtensionConstructor,r.lk.MarkExtensionConstructor,r.lk.NodeExtensionConstructor])}(t)?this.store.manager.getExtension(t):this.store.extensions.find((e=>e.name===t));(0,n.kG)(e,{code:r.mA.INVALID_MANAGER_EXTENSION,message:`The extension ${t} does not exist within the editor.`}),this.extractExtensionPlugins(e),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){(0,n.kG)(this.store.phase>=r.RC.EditorView,{code:r.mA.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:t,updateState:e}=this.store;e(t.state.reconfigure({plugins:this.plugins}))}};yt=M([q({defaultPriority:r.xV.Highest,handlerKeys:["applyState","appendTransaction"]})],yt);var vt=class extends V{constructor(){super(...arguments),this.dynamicAttributes={marks:(0,n.Ry)(),nodes:(0,n.Ry)()}}get name(){return"schema"}onCreate(){const{managerSettings:t,tags:e,markNames:s,nodeNames:o,extensions:i}=this.store,{defaultBlockNode:a,disableExtraAttributes:c,nodeOverride:d,markOverride:l}=t;if(t.schema){const{nodes:e,marks:s}=function(t){const e=(0,n.Ry)(),s=(0,n.Ry)();for(const[n,r]of Object.entries(t.nodes))e[n]=r.spec;for(const[n,r]of Object.entries(t.marks))s[n]=r.spec;return{nodes:e,marks:s}}(t.schema);return void this.addSchema(t.schema,e,s)}const h=(p=a)&&e[r.eX.Block].includes(p)?{doc:(0,n.Ry)(),[a]:(0,n.Ry)()}:(0,n.Ry)();var p;const m=(0,n.Ry)(),g=function(t){const{settings:e,gatheredSchemaAttributes:s,nodeNames:r,markNames:o,tags:i}=t,a=(0,n.Ry)();if(e.disableExtraAttributes)return a;const c=[...s,...e.extraAttributes??[]];for(const n of c??[]){const t=St({identifiers:n.identifiers,nodeNames:r,markNames:o,tags:i});for(const e of t){const t=a[e]??{};a[e]={...t,...n.attributes}}}return a}({settings:t,gatheredSchemaAttributes:this.gatherExtraAttributes(i),nodeNames:o,markNames:s,tags:e});for(const r of i){g[r.name]={...g[r.name],...r.options.extraAttributes};const t=!0===c||!0===r.options.disableExtraAttributes||!0===r.constructor.disableExtraAttributes;if($(r)){const{spec:e,dynamic:s}=xt({createExtensionSpec:(t,e)=>r.createNodeSpec(t,e),extraAttributes:(0,n.fp)(g,r.name),override:{...d,...r.options.nodeOverride},ignoreExtraAttributes:t,name:r.constructorName,tags:r.tags});r.spec=e,h[r.name]=e,Object.keys(s).length>0&&(this.dynamicAttributes.nodes[r.name]=s)}if(j(r)){const{spec:e,dynamic:s}=xt({createExtensionSpec:(t,e)=>r.createMarkSpec(t,e),extraAttributes:(0,n.fp)(g,r.name),override:{...l,...r.options.markOverride},ignoreExtraAttributes:t,name:r.constructorName,tags:r.tags??[]});
1r.spec=e,m[r.name]=e,Object.keys(s).length>0&&(this.dynamicAttributes.marks[r.name]=s)}}const f=new u.V_({nodes:h,marks:m,topNode:"doc"});this.addSchema(f,h,m)}createPlugin(){return{appendTransaction:(t,e,s)=>{const{tr:n}=s;return t.some((t=>t.docChanged))?0===Object.keys(this.dynamicAttributes.nodes).length&&0===Object.keys(this.dynamicAttributes.marks).length?null:(n.doc.descendants(((t,e)=>(this.checkAndUpdateDynamicNodes(t,e,n),this.checkAndUpdateDynamicMarks(t,e,n),!0))),n.steps.length>0?n:null):null}}}addSchema(t,e,s){this.store.setStoreKey("nodes",e),this.store.setStoreKey("marks",s),this.store.setStoreKey("schema",t),this.store.setExtensionStore("schema",t),this.store.setStoreKey("defaultBlockNode",(0,i.JN)(t).name);for(const n of Object.values(t.nodes))if("doc"!==n.name&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(t,e,s){for(const[r,o]of(0,n.qh)(this.dynamicAttributes.nodes))if(t.type.name===r)for(const[i,a]of(0,n.qh)(o)){if(!(0,n.le)(t.attrs[i]))continue;const r={...t.attrs,[i]:a(t)};s.setNodeMarkup(e,void 0,r),(0,S.gn)(s)}}checkAndUpdateDynamicMarks(t,e,s){for(const[r,o]of(0,n.qh)(this.dynamicAttributes.marks)){const a=(0,n.fp)(this.store.schema.marks,r),c=t.marks.find((t=>t.type.name===r));if(c)for(const[t,r]of(0,n.qh)(o)){if(!(0,n.le)(c.attrs[t]))continue;const o=(0,i.IH)(s.doc.resolve(e),a);if(!o)continue;const{from:d,to:l}=o,u=a.create({...c.attrs,[t]:r(c)});s.removeMark(d,l,a).addMark(d,l,u),(0,S.gn)(s)}}}gatherExtraAttributes(t){const e=[];for(const s of t)s.createSchemaAttributes&&e.push(...s.createSchemaAttributes());return e}};function St(t){const{identifiers:e,nodeNames:s,markNames:o,tags:i}=t;if("nodes"===e)return s;if("marks"===e)return o;if("all"===e)return[...s,...o];if((0,n.kJ)(e))return e;var a;(0,n.kG)((a=e,(0,n.PO)(a)&&(0,n.kJ)(a.tags)),{code:r.mA.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:c=[],names:d=[],behavior:l="any",excludeNames:u,excludeTags:h,type:p}=e,m=new Set,g="mark"===p?o:"node"===p?s:[...o,...s],f=t=>g.includes(t)&&!(null==u?void 0:u.includes(t));for(const n of d)f(n)&&m.add(n);const y=new Map;for(const n of c)if(!(null==h?void 0:h.includes(n)))for(const t of i[n]){if(!f(t))continue;if("any"===l){m.add(t);continue}const e=y.get(t)??new Set;e.add(n),y.set(t,e)}for(const[n,r]of y)r.size===c.length&&m.add(n);return[...m]}function xt(t){var e;const{createExtensionSpec:s,extraAttributes:o,ignoreExtraAttributes:a,name:c,tags:d,override:l}=t,u=(0,n.Ry)();let h=!1;const p=function(t,e,s,r){return()=>{s();const o=(0,n.Ry)();if(e)return o;for(const[e,s]of(0,n.qh)(t)){let t=kt(s).default;(0,n.mf)(t)&&(r(e,t),t=null),o[e]=void 0===t?{}:{default:t}}return o}}(o,a,(function(){h=!0}),(function(t,e){u[t]=e})),m=function(t,e){return s=>{const r=(0,n.Ry)();if(e)return r;for(const[e,o]of(0,n.qh)(t)){const{parseDOM:t,...a}=kt(o);(0,i.jd)(s)&&((0,n.le)(t)?r[e]=s.getAttribute(e)??a.default:(0,n.mf)(t)?r[e]=t(s)??a.default:r[e]=s.getAttribute(t)??a.default)}return r}}(o,a),g=function(t,e){return s=>{const r=(0,n.Ry)();if(e)return r;function o(t,e){if(t)if((0,n.HD)(t))r[e]=t;else if((0,n.kJ)(t)){const[n,o]=t;r[n]=o??s.attrs[e]}else for(const[s,o]of(0,n.qh)(t))r[s]=o}for(const[e,i]of(0,n.qh)(t)){const{toDOM:t,parseDOM:a}=kt(i);if((0,n.le)(t)){const t=(0,n.HD)(a)?a:e;r[t]=s.attrs[e]}else(0,n.mf)(t)?o(t(s.attrs,Et(s)),e):o(t,e)}return r}}(o,a),f=s({defaults:p,parse:m,dom:g},l);return(0,n.kG)(a||h,{code:r.mA.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${c}' to 'true'.`}),f.group=[...(null==(e=f.group)?void 0:e.split(" "))??[],...d].join(" ")||void 0,{spec:f,dynamic:u}}function kt(t){return(0,n.HD)(t)||(0,n.mf)(t)?{default:t}:((0,n.kG)(t,{message:`${(0,n.BB)(t)} is not supported`,code:r.mA.EXTENSION_EXTRA_ATTRIBUTES}),t)}function Et(t){return(0,i.PH)(t)?{node:t}:(0,i.K_)(t)?{mark:t}:{}}vt=M([q({defaultPriority:r.xV.Highest})],vt);var bt=class extends V{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:t})=>{var e;if(t&&!(null==(e=this.store.managerSettings.exclude)?void 0:e.suggesters))return(0,S.Ek)(this.store.getState(),t)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",(t=>(0,S.Ek)(this.store.getState(),t))),this.store.setExtensionStore("removeSuggester",(t=>(0,S.C$)(this.store.getState(),t)))}createExternalPlugins(){var t,e;const s=[];for(const r of this.store.extensions){if(null==(t=this.store.managerSettings.exclude)?void 0:t.suggesters)break;if(!r.createSuggesters||(null==(e=r.options.exclude)?void 0:e.suggesters))continue;const o=r.createSuggesters(),i=(0,n.kJ)(o)?o:[o];s.push(...i)}return[(0,S.D7)(...s)]}getSuggestState(t){return(0,S.hu)(t??this.store.getState())}getSuggestMethods(){const{addIgnored:t,clearIgnored:e,removeIgnored:s,ignoreNextExit:n,setMarkRemoved:r,findMatchAtPosition:o,findNextTextSelection:i,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:t,clearIgnored:e,removeIgnored:s,ignoreNextExit:n,setMarkRemoved:r,findMatchAtPosition:o,findNextTextSelection:i,setLastChangeFromAppend:a}}
1isSuggesterActive(t){var e;return(0,n.q9)((0,n.kJ)(t)?t:[t],null==(e=this.getSuggestState().match)?void 0:e.suggester.name)}};M([J()],bt.prototype,"getSuggestState",1),M([J()],bt.prototype,"getSuggestMethods",1),M([J()],bt.prototype,"isSuggesterActive",1),bt=M([q({customHandlerKeys:["suggester"]})],bt);var Mt=class extends V{constructor(){super(...arguments),this.allTags=(0,n.Ry)(),this.plainTags=(0,n.Ry)(),this.markTags=(0,n.Ry)(),this.nodeTags=(0,n.Ry)()}get name(){return"tags"}onCreate(){this.resetTags();for(const t of this.store.extensions)this.updateTagForExtension(t);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const t=(0,n.Ry)(),e=(0,n.Ry)(),s=(0,n.Ry)(),o=(0,n.Ry)();for(const i of(0,n.VO)(r.eX))t[i]=[],e[i]=[],s[i]=[],o[i]=[];this.allTags=t,this.plainTags=e,this.markTags=s,this.nodeTags=o}updateTagForExtension(t){var e,s;const o=new Set([...t.tags??[],...(null==(e=t.createTags)?void 0:e.call(t))??[],...t.options.extraTags??[],...(null==(s=this.store.managerSettings.extraTags)?void 0:s[t.name])??[]]);for(const a of o)(0,n.kG)((i=a,(0,n.q9)((0,n.VO)(r.eX),i)),{code:r.mA.EXTENSION,message:`The tag provided by the extension: ${t.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[a].push(t.name),G(t)&&this.plainTags[a].push(t.name),j(t)&&this.markTags[a].push(t.name),$(t)&&this.nodeTags[a].push(t.name);var i;t.tags=[...o]}};Mt=M([q({defaultPriority:r.xV.Highest})],Mt);var wt=new h.H$("remirrorFilePlaceholderPlugin");function Ot(){const t=new h.Sy({key:wt,state:{init:()=>({set:g.EH.empty,payloads:new Map}),apply(e,{set:s,payloads:n}){s=s.map(e.mapping,e.doc);const r=e.getMeta(t);if(r)if(0===r.type){const t=document.createElement("placeholder"),o=g.p.widget(r.pos,t,{id:r.id});s=s.add(e.doc,[o]),n.set(r.id,r.payload)}else 1===r.type&&(s=s.remove(s.find(void 0,void 0,(t=>t.id===r.id))),n.delete(r.id));return{set:s,payloads:n}}},props:{decorations(e){var s;return(null==(s=t.getState(e))?void 0:s.set)??null}}});return t}var At=class extends V{get name(){return"upload"}createExternalPlugins(){return[Ot()]}};function Pt(t={}){t={...{exitMarksOnArrowPress:dt.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:dt.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:dt.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:dt.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:st.defaultOptions.persistentSelectionClass},...t};const e=d(t,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),s=d(t,["persistentSelectionClass"]);return[new Mt,new vt,new X,new yt,new ct,new ft,new gt,new bt,new Z,new at,new dt(e),new it,new At,new st(s)]}var Ct,Nt,Tt,Rt,Ht,_t,Kt,Dt=class extends V{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),this.options.capture)for(const t of this.store.extensions)this.captureCommands(t),this.captureKeybindings(t)}createPlugin(){return{}}captureCommands(t){const e=t.decoratedCommands??{},s=t.createCommands;for(const n of Object.keys(e)){const e=t[n];t[n]=(...s)=>r=>{var o;const i=e(...s)(r);return r.dispatch&&i&&this.setCommandMeta(r.tr,{type:"command",chain:r.dispatch!==(null==(o=r.view)?void 0:o.dispatch),name:n,extension:t.name,decorated:!0}),i}}s&&(t.createCommands=()=>{const e=s();for(const[s,n]of Object.entries(e))e[s]=(...e)=>r=>{var o;const i=n(...e)(r);return r.dispatch&&i&&this.setCommandMeta(r.tr,{type:"command",chain:r.dispatch!==(null==(o=r.view)?void 0:o.dispatch),name:s,extension:t.name,decorated:!1}),i};return e})}captureKeybindings(t){}getCommandMeta(t){return t.getMeta(this.pluginKey)??[]}setCommandMeta(t,e){const s=this.getCommandMeta(t);t.setMeta(this.pluginKey,[...s,e])}};Dt=M([q({defaultOptions:{capture:i.NZ.isDevelopment},staticKeys:["capture"],defaultPriority:r.xV.Highest})],Dt);var It,Lt,Vt,Bt,Ft,Ut,Wt,Gt,$t,jt,qt,Xt,Jt,zt=class{constructor(t){A(this,Ct,(0,n.EL)()),A(this,Nt,void 0),A(this,Tt,void 0),A(this,Rt,!0),A(this,Ht,(0,x.i)()),A(this,_t,void 0),A(this,Kt,void 0),this.get
1State=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=t=>{var e,s;(0,n.kG)(!this.manager.destroyed,{code:r.mA.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),t=(null==(s=(e=this.props).onDispatchTransaction)?void 0:s.call(e,t,this.getState()))??t;const o=this.getState(),{state:i,transactions:a}=o.applyTransaction(t);P(this,Tt,o),this.updateState({state:i,tr:t,transactions:a});const c=this.manager.store.getForcedUpdates(t);(0,n.yD)(c)||this.updateViewProps(...c)},this.onChange=(t=(0,n.Ry)())=>{var e,s;const r=this.eventListenerProps(t);O(this,Rt)&&P(this,Rt,!1),null==(s=(e=this.props).onChange)||s.call(e,r)},this.onBlur=t=>{var e,s;const n=this.eventListenerProps();null==(s=(e=this.props).onBlur)||s.call(e,n,t),O(this,Ht).emit("blur",n,t)},this.onFocus=t=>{var e,s;const n=this.eventListenerProps();null==(s=(e=this.props).onFocus)||s.call(e,n,t),O(this,Ht).emit("focus",n,t)},this.setContent=(t,{triggerChange:e=!1}={})=>{const{doc:s}=this.manager.createState({content:t}),n=this.getState(),{state:r}=this.getState().applyTransaction(n.tr.replaceRangeWith(0,n.doc.nodeSize-2,s));if(e)return this.updateState({state:r,triggerChange:e});this.view.updateState(r)},this.clearContent=({triggerChange:t=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:t})},this.createStateFromContent=(t,e)=>this.manager.createState({content:t,selection:e}),this.focus=t=>{this.manager.store.commands.focus(t)},this.blur=t=>{this.manager.store.commands.blur(t)};const{getProps:e,initialEditorState:s,element:o}=t;if(P(this,Nt,e),P(this,Kt,s),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const i=this.createView(s,o);this.manager.addView(i)}get addHandler(){return O(this,_t)??P(this,_t,O(this,Ht).on.bind(O(this,Ht)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return O(this,Rt)}get props(){return O(this,Nt).call(this)}get previousState(){return this.previousStateOverride??O(this,Tt)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return O(this,Ct)}get initialEditorState(){return O(this,Kt)}updateListener(t){const{state:e,tr:s}=t;return O(this,Ht).emit("updated",this.eventListenerProps({state:e,tr:s}))}update(t){const{getProps:e}=t;return P(this,Nt,e),this}updateViewProps(...t){const e=d(this.updatableViewProps,t);this.view.setProps({...this.view.props,...e})}getAttributes(t){var e;const{attributes:s,autoFocus:r,classNames:o=[],label:i,editable:a}=this.props,c=null==(e=this.manager.store)?void 0:e.attributes,d=(0,n.mf)(s)?s(this.eventListenerProps()):s;let l={};(r||(0,n.hj)(r))&&(l=t?{autoFocus:!0}:{autofocus:"true"});const u=(0,n.Nb)(H(t&&"Prosemirror","remirror-editor",null==c?void 0:c.class,...o).split(" ")).join(" "),h={role:"textbox",...l,"aria-multiline":"true",...a??1?{}:{"aria-readonly":"true"},"aria-label":i??"",...c,class:u};return(0,n.Yc)({...h,...d})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){O(this,Ht).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(t=(0,n.Ry)()){const{state:e,tr:s,transactions:r}=t;return{tr:s,transactions:r,internalUpdate:!s,view:this.view,firstRender:O(this,Rt),state:e??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:O(this,Ct),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};function Qt(t,e){var s;const{gatheredExtensions:o,duplicateMap:i,parentExtensions:a,settings:c}=t,{extension:d,parentExtension:l}=e;let{names:u=[]}=e;(0,n.kG)(W(d),{code:r.mA.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${d} was provided to the [[\`RemirrorManager\`]].`});const h=d.extensions;
1if(d.setPriority(null==(s=c.priority)?void 0:s[d.name]),o.push(d),function(t){const{duplicateMap:e,extension:s,parentExtension:n}=t,r=s.constructor,o=e.get(r),i=n?[n]:[];e.set(r,o?[...o,...i]:i)}({duplicateMap:i,extension:d,parentExtension:l}),0!==h.length)if(u.includes(d.name))(0,k.Z)(!1,`Circular dependency encountered when loading extensions: ${u.join(" > ")} > ${d.name}`);else{u=[...u,d.name],a.push(d);for(const e of h)Qt(t,{names:u,extension:e,parentExtension:d})}}function Yt(t){const{extension:e,found:s,missing:n}=t;if(e.requiredExtensions)for(const r of e.requiredExtensions??[])s.has(r)||n.push({Constructor:r,extension:e})}function Zt(t){var e,s,n,r;const{extension:o,nodeNames:i,markNames:a,plainNames:c,store:d,handlers:l}=t;o.setStore(d);const u=null==(e=o.onCreate)?void 0:e.bind(o),h=null==(s=o.onView)?void 0:s.bind(o),p=null==(n=o.onStateUpdate)?void 0:n.bind(o),m=null==(r=o.onDestroy)?void 0:r.bind(o);u&&l.create.push(u),h&&l.view.push(h),p&&l.update.push(p),m&&l.destroy.push(m),j(o)&&a.push(o.name),$(o)&&"doc"!==o.name&&i.push(o.name),G(o)&&c.push(o.name)}Ct=new WeakMap,Nt=new WeakMap,Tt=new WeakMap,Rt=new WeakMap,Ht=new WeakMap,_t=new WeakMap,Kt=new WeakMap;var te=class{constructor(t,e={}){A(this,It,void 0),A(this,Lt,(0,n.Ry)()),A(this,Vt,(0,n.Ry)()),A(this,Bt,void 0),A(this,Ft,void 0),A(this,Ut,r.RC.None),A(this,Wt,void 0),A(this,Gt,!0),A(this,$t,{create:[],view:[],update:[],destroy:[]}),A(this,jt,[]),A(this,qt,(0,x.i)()),A(this,Xt,void 0),A(this,Jt,void 0),this.getState=()=>{var t;return O(this,Ut)>=r.RC.EditorView?this.view.state:((0,n.kG)(O(this,Xt),{code:r.mA.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),null==(t=O(this,Xt))?void 0:t.initialEditorState)},this.updateState=t=>{const e=this.getState();this.view.updateState(t),this.onStateUpdate({previousState:e,state:t})};const{extensions:s,extensionMap:o}=function(t,e){const s=[],o=new WeakMap,i=new WeakMap;let a=[];const c={duplicateMap:i,parentExtensions:[],gatheredExtensions:a,settings:e};for(const n of t)Qt(c,{extension:n});a=(0,n.DY)(a,((t,e)=>e.priority-t.priority));const d=new WeakSet,l=new Set;for(const h of a){const t=h.constructor,e=h.name,a=i.get(t);(0,n.kG)(a,{message:`No entries were found for the ExtensionConstructor ${h.name}`,code:r.mA.INTERNAL}),d.has(t)||l.has(e)||(d.add(t),l.add(e),s.push(h),o.set(t,h),a.forEach((e=>null==e?void 0:e.replaceChildExtension(t,h))))}const u=[];for(const n of s)Yt({extension:n,found:d,missing:u});return(0,n.kG)((0,n.yD)(u),{code:r.mA.MISSING_REQUIRED_EXTENSION,message:u.map((({Constructor:t,extension:e})=>`The extension '${e.name}' requires '${t.name} in order to run correctly.`)).join("\n")}),{extensions:s,extensionMap:o}}(t,e);P(this,Wt,e),P(this,Bt,(0,n.vV)(s)),P(this,Ft,o),P(this,It,this.createExtensionStore()),P(this,Ut,r.RC.Create),this.setupLifecycleHandlers();for(const n of O(this,$t).create){const t=n();t&&O(this,jt).push(t)}}static create(t,e={}){return new te([...(0,n.r2)(t),...Pt(e.builtin)],e)}get[r.By](){return r.lk.Manager}get destroyed(){return O(this,Ut)===r.RC.Destroy}get mounted(){return O(this,Ut)>=r.RC.EditorView&&O(this,Ut)<r.RC.Destroy}get output(){var t;return null==(t=O(this,Xt))?void 0:t.frameworkOutput}get frameworkAttached(){return!!O(this,Xt)}get extensions(){return O(this,Bt)}get stringHandlers(){return O(this,Lt)}get store(){return(0,n.vV)(O(this,Vt))}get extensionStore(){return(0,n.vV)(O(this,It))}get tr(){return this.getExtension(Z).transaction}get nodes(){return O(this,Vt).nodes}get marks(){return O(this,Vt).marks}get schema(){return O(this,Vt).schema}get extensionTags(){return O(this,Vt).tags}get view(){return O(this,Vt).view}get settings(){return O(this,Wt)}get document(){return O(this,Wt).document??(0,i.Me)()}setupLifecycleHandlers(){const t=O(this,It),e=O(this,$t),s=[],n=[],r=[];t.nodeNames=s,t.markNames=n,t.plainNames=r;for(const o of O(this,Bt))Zt({extension:o,nodeNames:s,markNames:n,plainNames:r,handlers:e,store:t})}setStringHandler(t,e){O(this,Lt)[t]=e}setStoreKey(t,e){O(this,Vt)[t]=e}getStoreKey(t){const e=O(this,Vt)[t];return(0,n.kG)(!(0,n.le)(e),{code:r.mA.MANAGER_PHASE_ERROR,message:"`getStoreKey` should not be called before the values are available."}),e}setExtensionStore(t,e){(0,n.kG)(O(this,Ut)<=r.RC.EditorView,{code:r.mA.MANAGER_PHASE_ERROR,message:"`setExtensionStore` should only be called during the `onCreate` lifecycle hook. Make sure to only call it within the returned methods."}),O(this,It)[t]=e}createExtensionStore(){const t=(0,n.Ry)(),e=!0;let s,r;return Object.defineProperties(t,{extensions:{get:()=>O(this,Bt),enumerable:e},phase:{get:()=>O(this,Ut),enumerable:e},view:{get:()=>this.view,enumerable:e},managerSettings:{get:()=>(0,n.vV)(O(this,Wt)),enumerable:e},getState:{value:this.getState,enumerable:e},updateState:{value:this.updateState,enumerable:e},isMounted:{value:()=>this.mounted,enumerable:e},getExtension:{value:this.getExtension.bind(this),enumerable:e},manager:{get:()=>this,enumerable:e},document:{get:()=>this.document,enumerable:e},stringHandlers:{get:()=>O(this,Lt),enumerable:e},currentState:{get:()=>s??(s=this.getState()),set:t=>{s=t},enumerable:e},previousState:{get:()=>r,set:t=>{r=t},enumerable:e}}),t.getStoreKey=this.getStoreKey.bind(this),t.setStoreKey=this.setStoreKey.bind(this),t.setExtensionStore=this.setExtensionStore.bind(this),t.setStringHandler=this.setStringHandler.bind(this),t}addView(t){if(O(this,Ut)>=r.RC.EditorView)return this;P(this,Gt,!0),P(this,Ut,r.RC.EditorView),O(this,Vt).view=t;
1for(const e of O(this,$t).view){const s=e(t);s&&O(this,jt).push(s)}return this}attachFramework(t,e){var s;O(this,Xt)!==t&&(O(this,Xt)&&(O(this,Xt).destroy(),null==(s=O(this,Jt))||s.call(this)),P(this,Xt,t),P(this,Jt,this.addHandler("stateUpdate",e)))}createEmptyDoc(){var t;const e=null==(t=this.schema.nodes.doc)?void 0:t.createAndFill();return(0,n.kG)(e,{code:r.mA.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),e}createState(t={}){const{onError:e,defaultSelection:s="end"}=this.settings,{content:r=this.createEmptyDoc(),selection:o=s,stringHandler:a=this.settings.stringHandler}=t,{schema:c,plugins:d}=this.store,l=(0,i.EP)({stringHandler:(0,n.HD)(a)?this.stringHandlers[a]:a,document:this.document,content:r,onError:e,schema:c,selection:o});return h.yy.create({schema:c,doc:l,plugins:d,selection:(0,i.b0)(o,l)})}addHandler(t,e){return O(this,qt).on(t,e)}onStateUpdate(t){const e=O(this,Gt);O(this,It).currentState=t.state,O(this,It).previousState=t.previousState,e&&(P(this,Ut,r.RC.Runtime),P(this,Gt,!1));const s={...t,firstUpdate:e};for(const n of O(this,$t).update)n(s);O(this,qt).emit("stateUpdate",s)}getExtension(t){const e=O(this,Ft).get(t);return(0,n.kG)(e,{code:r.mA.INVALID_MANAGER_EXTENSION,message:`'${t.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),e}hasExtension(t){return!!O(this,Ft).get(t)}clone(){const t=O(this,Bt).map((t=>t.clone(t.options))),e=te.create((()=>t),O(this,Wt));return O(this,qt).emit("clone",e),e}recreate(t=[],e={}){const s=O(this,Bt).map((t=>t.clone(t.initialOptions))),n=te.create((()=>[...s,...t]),e);return O(this,qt).emit("recreate",n),n}destroy(){var t,e,s,n,o,i;P(this,Ut,r.RC.Destroy);for(const r of(null==(t=this.view)?void 0:t.state.plugins)??[])null==(s=null==(e=r.getState(this.view.state))?void 0:e.destroy)||s.call(e);null==(n=O(this,Xt))||n.destroy(),null==(o=O(this,Jt))||o.call(this);for(const r of O(this,jt))r();for(const r of O(this,$t).destroy)r();null==(i=this.view)||i.destroy(),O(this,qt).emit("destroy")}includes(t){const e=[],s=[];for(const n of O(this,Bt))e.push(n.name,n.constructorName),s.push(n.constructor);return t.every((t=>(0,n.HD)(t)?(0,n.q9)(e,t):(0,n.q9)(s,t)))}},ee=te;function se(t,e){return!(!(0,i.gf)(t)||!(0,i.pI)(t,r.lk.Manager))&&(!e||t.includes(e))}It=new WeakMap,Lt=new WeakMap,Vt=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,$t=new WeakMap,jt=new WeakMap,qt=new WeakMap,Xt=new WeakMap,Jt=new WeakMap}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.