PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.0-beta1
Elementor Website Builder – more than just a page builder v3.34.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
← All changes | assets/js/packages/editor-controls/editor-controls.min.js +27 -17 4.2.3 → 3.34.0-beta1 View file →
@@ -1,13 +1,23 @@
1 1 /*! For license information please see editor-controls.min.js.LICENSE.txt */
2 -!function(){var r={2020:function(r){"use strict";r.exports=window.elementorV2.editorProps},5067:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Paragraph:()=>E,default:()=>w}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k="&nbsp;",E=b.Node.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},parseMarkdown:(r,o)=>{const i=r.tokens||[];if(1===i.length&&"image"===i[0].type)return o.parseChildren([i[0]]);const a=o.parseInline(i);return 1!==a.length||"text"!==a[0].type||a[0].text!==k&&" "!==a[0].text?o.createNode("paragraph",void 0,a):o.createNode("paragraph",void 0,[])},renderMarkdown:(r,o)=>{if(!r)return"";const i=Array.isArray(r.content)?r.content:[];return 0===i.length?k:o.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),w=E},5527:function(r){"use strict";r.exports=window.elementorV2.editorV1Adapters},5820:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Subscript:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Mark.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(r){return"sub"===r&&null}}]},renderHTML({HTMLAttributes:r}){return["sub",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},addCommands(){return{setSubscript:()=>({commands:r})=>r.setMark(this.name),toggleSubscript:()=>({commands:r})=>r.toggleMark(this.name),unsetSubscript:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),E=k},14841:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Superscript:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Mark.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(r){return"super"===r&&null}}]},renderHTML({HTMLAttributes:r}){return["sup",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},addCommands(){return{setSuperscript:()=>({commands:r})=>r.setMark(this.name),toggleSuperscript:()=>({commands:r})=>r.toggleMark(this.name),unsetSuperscript:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),E=k},18998:function(r){"use strict";r.exports=window.elementorV2.httpClient},19721:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Underline:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Mark.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:r=>!!r.includes("underline")&&{}}]},renderHTML({HTMLAttributes:r}){return["u",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},parseMarkdown(r,o){return o.applyMark(this.name||"underline",o.parseInline(r.tokens||[]))},renderMarkdown(r,o){return`++${o.renderChildren(r)}++`},markdownTokenizer:{name:"underline",level:"inline",start(r){return r.indexOf("++")},tokenize(r,o,i){const a=/^(\+\+)([\s\S]+?)(\+\+)/.exec(r);if(!a)return;const c=a[2].trim();return{type:"underline",raw:a[0],text:c,tokens:i.inlineTokens(c)}}},addCommands(){return{setUnderline:()=>({commands:r})=>r.setMark(this.name),toggleUnderline:()=>({commands:r})=>r.toggleMark(this.name),unsetUnderline:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),E=k},19888:function(r,o,i){"use strict";r.exports=i(58493)},21020:function(r,o,i){"use strict";var a=i(97557),c=Symbol.for("react.element"),u=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,g=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function q(r,o,i){var a,u={},b=null,k=null;for(a in void 0!==i&&(b=""+i),void 0!==o.key&&(b=""+o.key),void 0!==o.ref&&(k=o.ref),o)p.call(o,a)&&!v.hasOwnProperty(a)&&(u[a]=o[a]);if(r&&r.defaultProps)for(a in o=r.defaultProps)void 0===u[a]&&(u[a]=o[a]);return{$$typeof:c,type:r,key:b,ref:k,props:u,_owner:g.current}}o.Fragment=u,o.jsx=q,o.jsxs=q},21765:function(r){"use strict";var o,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,p={};function Fragment(r){return r.children}((r,o)=>{for(var a in o)i(r,a,{get:o[a],enumerable:!0})})(p,{Fragment:()=>Fragment,createElement:()=>h,h:()=>h,jsx:()=>h,jsxDEV:()=>h,jsxs:()=>h}),r.exports=(o=p,((r,o,p,g)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of c(o))u.call(r,v)||v===p||i(r,v,{get:()=>o[v],enumerable:!(g=a(o,v))||g.enumerable});return r})(i({},"__esModule",{value:!0}),o));var h=(r,o)=>{if("slot"===r)return 0;if(r instanceof Function)return r(o);const{children:i,...a}=null!=o?o:{};if("svg"===r)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[r,a,i]}},22162:function(r,o,i){"use strict";var a=i(97557),c=i(19888);var u="function"==typeof Object.is?Object.is:function is(r,o){return r===o&&(0!==r||1/r==1/o)||r!=r&&o!=o},p=c.useSyncExternalStore,g=a.useRef,v=a.useEffect,b=a.useMemo,k=a.useDebugValue;o.useSyncExternalStoreWithSelector=function(r,o,i,a,c){var E=g(null);if(null===E.current){var w={hasValue:!1,value:null};E.current=w}else w=E.current;E=b(function(){function memoizedSelector(o){if(!g){if(g=!0,r=o,o=a(o),void 0!==c&&w.hasValue){var i=w.value;if(c(i,o))return p=i}return p=o}if(i=p,u(r,o))return i;var v=a(o);return void 0!==c&&c(i,v)?(r=o,i):(r=o,p=v)}var r,p,g=!1,v=void 0===i?null:i;return[function(){return memoizedSelector(o())},null===v?void 0:function(){return memoizedSelector(v())}]},[o,i,a,c]);var x=p(r,E[0],E[1]);return v(function(){w.hasValue=!0,w.value=x},[x]),k(x),x}},22444:function(r){"use strict";r.exports=window.elementorV2.utils},24007:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(57449))},24413:function(r){"use strict";r.exports=window.elementorV2.icons},26401:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(36553))},27096:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Bold:()=>_,default:()=>T,starInputRegex:()=>E,starPasteRegex:()=>w,underscoreInputRegex:()=>x,underscorePasteRegex:()=>C}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=i(38882),E=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,w=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,x=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,C=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,_=b.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>"normal"!==r.style.fontWeight&&null},{style:"font-weight=400",clearMark:r=>r.type.name===this.name},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return(0,k.jsx)("strong",{...(0,b.mergeAttributes)(this.options.HTMLAttributes,r),children:(0,k.jsx)("slot",{})})},markdownTokenName:"strong",parseMarkdown:(r,o)=>o.applyMark("bold",o.parseInline(r.tokens||[])),renderMarkdown:(r,o)=>`**${o.renderChildren(r)}**`,addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,b.markInputRule)({find:E,type:this.type}),(0,b.markInputRule)({find:x,type:this.type})]},addPasteRules(){return[(0,b.markPasteRule)({find:w,type:this.type}),(0,b.markPasteRule)({find:C,type:this.type})]}}),T=_},27723:function(r){"use strict";r.exports=window.wp.i18n},29656:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{HardBreak:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Node.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",(0,b.mergeAttributes)(this.options.HTMLAttributes,r)]},renderText(){return"\n"},renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:r,chain:o,state:i,editor:a})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:r,storedMarks:c}=i;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:p}=a.extensionManager,g=c||r.$to.parentOffset&&r.$from.marks();return o().insertContent({type:this.name}).command(({tr:r,dispatch:o})=>{if(o&&g&&u){const o=g.filter(r=>p.includes(r.type.name));r.ensureMarks(o)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),E=k},32386:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(77712))},33176:function(r){"use strict";r.exports=window.elementorV2.events},34243:function(r,o,i){"use strict";var a=i(36553),c=i(77712),u=i(37820),p=["ol",0],g=["ul",0],v=["li",0],b={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:function getAttrs(r){return{order:r.hasAttribute("start")?+r.getAttribute("start"):1}}}],toDOM:function toDOM(r){return 1==r.attrs.order?p:["ol",{start:r.attrs.order},0]}},k={parseDOM:[{tag:"ul"}],toDOM:function toDOM(){return g}},E={parseDOM:[{tag:"li"}],toDOM:function toDOM(){return v},defining:!0};function add(r,o){var i={};for(var a in r)i[a]=r[a];for(var c in o)i[c]=o[c];return i}function wrapRangeInList(r,o,i){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,p=!1,g=o,v=o.$from.doc;if(o.depth>=2&&o.$from.node(o.depth-1).type.compatibleContent(i)&&0==o.startIndex){if(0==o.$from.index(o.depth-1))return!1;var b=v.resolve(o.start-2);g=new c.NodeRange(b,b,o.depth),o.endIndex<o.parent.childCount&&(o=new c.NodeRange(o.$from,v.resolve(o.$to.end(o.depth)),o.depth)),p=!0}var k=a.findWrapping(g,i,u,o);return!!k&&(r&&function doWrapInList(r,o,i,u,p){for(var g=c.Fragment.empty,v=i.length-1;v>=0;v--)g=c.Fragment.from(i[v].type.create(i[v].attrs,g));r.step(new a.ReplaceAroundStep(o.start-(u?2:0),o.end,o.start,o.end,new c.Slice(g,0,0),i.length,!0));for(var b=0,k=0;k<i.length;k++)i[k].type==p&&(b=k+1);for(var E=i.length-b,w=o.start+i.length-(u?2:0),x=o.parent,C=o.startIndex,_=o.endIndex,T=!0;C<_;C++,T=!1)!T&&a.canSplit(r.doc,w,E)&&(r.split(w,E),w+=2*E),w+=x.child(C).nodeSize;return r}(r,o,k,p,i),!0)}function splitListItem(r,o){return function(i,p){var g=i.selection,v=g.$from,b=g.$to,k=g.node;if(k&&k.isBlock||v.depth<2||!v.sameParent(b))return!1;var E=v.node(-1);if(E.type!=r)return!1;if(0==v.parent.content.size&&v.node(-1).childCount==v.indexAfter(-1)){if(3==v.depth||v.node(-3).type!=r||v.index(-2)!=v.node(-2).childCount-1)return!1;if(p){for(var w=c.Fragment.empty,x=v.index(-1)?1:v.index(-2)?2:3,C=v.depth-x;C>=v.depth-3;C--)w=c.Fragment.from(v.node(C).copy(w));var _=v.indexAfter(-1)<v.node(-2).childCount?1:v.indexAfter(-2)<v.node(-3).childCount?2:3;w=w.append(c.Fragment.from(r.createAndFill()));var T=v.before(v.depth-(x-1)),P=i.tr.replace(T,v.after(-_),new c.Slice(w,4-x,0)),A=-1;P.doc.nodesBetween(T,P.doc.content.size,function(r,o){if(A>-1)return!1;r.isTextblock&&0==r.content.size&&(A=o+1)}),A>-1&&P.setSelection(u.Selection.near(P.doc.resolve(A))),p(P.scrollIntoView())}return!0}var N=b.pos==v.end()?E.contentMatchAt(0).defaultType:null,R=i.tr.delete(v.pos,b.pos),I=N?[o?{type:r,attrs:o}:null,{type:N}]:void 0;return!!a.canSplit(R.doc,v.pos,2,I)&&(p&&p(R.split(v.pos,2,I).scrollIntoView()),!0)}}o.addListNodes=function addListNodes(r,o,i){return r.append({ordered_list:add(b,{content:"list_item+",group:i}),bullet_list:add(k,{content:"list_item+",group:i}),list_item:add(E,{content:o})})},o.bulletList=k,o.liftListItem=function liftListItem(r){return function(o,i){var u=o.selection,p=u.$from,g=u.$to,v=p.blockRange(g,function(o){return o.childCount>0&&o.firstChild.type==r});return!!v&&(!i||(p.node(v.depth-1).type==r?function liftToOuterList(r,o,i,u){var p=r.tr,g=u.end,v=u.$to.end(u.depth);g<v&&(p.step(new a.ReplaceAroundStep(g-1,v,g,v,new c.Slice(c.Fragment.from(i.create(null,u.parent.copy())),1,0),1,!0)),u=new c.NodeRange(p.doc.resolve(u.$from.pos),p.doc.resolve(v),u.depth));var b=a.liftTarget(u);if(null==b)return!1;p.lift(u,b);var k=p.doc.resolve(p.mapping.map(g,-1)-1);a.canJoin(p.doc,k.pos)&&k.nodeBefore.type==k.nodeAfter.type&&p.join(k.pos);return o(p.scrollIntoView()),!0}(o,i,r,v):function liftOutOfList(r,o,i){for(var u=r.tr,p=i.parent,g=i.end,v=i.endIndex-1,b=i.startIndex;v>b;v--)g-=p.child(v).nodeSize,u.delete(g-1,g+1);var k=u.doc.resolve(i.start),E=k.nodeAfter;if(u.mapping.map(i.end)!=i.start+k.nodeAfter.nodeSize)return!1;var w=0==i.startIndex,x=i.endIndex==p.childCount,C=k.node(-1),_=k.index(-1);if(!C.canReplace(_+(w?0:1),_+1,E.content.append(x?c.Fragment.empty:c.Fragment.from(p))))return!1;var T=k.pos,P=T+E.nodeSize;return u.step(new a.ReplaceAroundStep(T-(w?1:0),P+(x?1:0),T+1,P-1,new c.Slice((w?c.Fragment.empty:c.Fragment.from(p.copy(c.Fragment.empty))).append(x?c.Fragment.empty:c.Fragment.from(p.copy(c.Fragment.empty))),w?0:1,x?0:1),w?0:1)),o(u.scrollIntoView()),!0}(o,i,v)))}},o.listItem=E,o.orderedList=b,o.sinkListItem=function sinkListItem(r){return function(o,i){var u=o.selection,p=u.$from,g=u.$to,v=p.blockRange(g,function(o){return o.childCount>0&&o.firstChild.type==r});if(!v)return!1;var b=v.startIndex;if(0==b)return!1;var k=v.parent,E=k.child(b-1);if(E.type!=r)return!1;if(i){var w=E.lastChild&&E.lastChild.type==k.type,x=c.Fragment.from(w?r.create():null),C=new c.Slice(c.Fragment.from(r.create(null,c.Fragment.from(k.type.create(null,x)))),w?3:1,0),_=v.start,T=v.end;i(o.tr.step(new a.ReplaceAroundStep(_-(w?3:1),T,_,T,C,1,!0)).scrollIntoView())}return!0}},o.splitListItem=splitListItem,o.splitListItemKeepMarks=function splitListItemKeepMarks(r,o){var i=splitListItem(r,o);return function(r,o){return i(r,o&&function(i){var a=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();a&&i.ensureMarks(a),o(i)})}},o.wrapInList=function wrapInList(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(i,a){var c=i.selection,u=c.$from,p=c.$to,g=u.blockRange(p);if(!g)return!1;var v=a?i.tr:null;return!!wrapRangeInList(v,g,r,o)&&(a&&a(v.scrollIntoView()),!0)}},o.wrapRangeInList=wrapRangeInList},35423:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(34243))},36553:function(r,o,i){"use strict";function _wrapNativeSuper(r){var o="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(r){if(null===r||!function _isNativeFunction(r){try{return-1!==Function.toString.call(r).indexOf("[native code]")}catch(o){return"function"==typeof r}}(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(r))return o.get(r);o.set(r,Wrapper)}function Wrapper(){return _construct(r,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(r.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,r)},_wrapNativeSuper(r)}function _construct(r,o,i){return _construct=_isNativeReflectConstruct()?Reflect.construct.bind():function _construct(r,o,i){var a=[null];a.push.apply(a,o);var c=new(Function.bind.apply(r,a));return i&&_setPrototypeOf(c,i.prototype),c},_construct.apply(null,arguments)}function _inherits(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),o&&_setPrototypeOf(r,o)}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _createSuper(r){var o=_isNativeReflectConstruct();return function _createSuperInternal(){var i,a=_getPrototypeOf(r);if(o){var c=_getPrototypeOf(this).constructor;i=Reflect.construct(a,arguments,c)}else i=a.apply(this,arguments);return function _possibleConstructorReturn(r,o){if(o&&("object"===_typeof(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,i)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,_toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _toPropertyKey(r){var o=function _toPrimitive(r,o){if("object"!==_typeof(r)||null===r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"===_typeof(o)?o:String(o)}var a=i(77712),c=Math.pow(2,16);function makeRecover(r,o){return r+o*c}function recoverIndex(r){return 65535&r}var u=function(){function MapResult(r,o,i){_classCallCheck(this,MapResult),this.pos=r,this.delInfo=o,this.recover=i}return _createClass(MapResult,[{key:"deleted",get:function get(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function get(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function get(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function get(){return(4&this.delInfo)>0}}]),MapResult}(),p=function(){function StepMap(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(_classCallCheck(this,StepMap),this.ranges=r,this.inverted=o,!r.length&&StepMap.empty)return StepMap.empty}return _createClass(StepMap,[{key:"recover",value:function recover(r){var o=0,i=recoverIndex(r);if(!this.inverted)for(var a=0;a<i;a++)o+=this.ranges[3*a+2]-this.ranges[3*a+1];return this.ranges[3*i]+o+function recoverOffset(r){return(r-(65535&r))/c}(r)}},{key:"mapResult",value:function mapResult(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(r,o,!1)}},{key:"map",value:function map(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(r,o,!0)}},{key:"_map",value:function _map(r,o,i){for(var a=0,c=this.inverted?2:1,p=this.inverted?1:2,g=0;g<this.ranges.length;g+=3){var v=this.ranges[g]-(this.inverted?a:0);if(v>r)break;var b=this.ranges[g+c],k=this.ranges[g+p],E=v+b;if(r<=E){var w=v+a+((b?r==v?-1:r==E?1:o:o)<0?0:k);if(i)return w;var x=r==(o<0?v:E)?null:makeRecover(g/3,r-v),C=r==v?2:r==E?1:4;return(o<0?r!=v:r!=E)&&(C|=8),new u(w,C,x)}a+=k-b}return i?r+a:new u(r+a,0,null)}},{key:"touches",value:function touches(r,o){for(var i=0,a=recoverIndex(o),c=this.inverted?2:1,u=this.inverted?1:2,p=0;p<this.ranges.length;p+=3){var g=this.ranges[p]-(this.inverted?i:0);if(g>r)break;var v=this.ranges[p+c];if(r<=g+v&&p==3*a)return!0;i+=this.ranges[p+u]-v}return!1}},{key:"forEach",value:function forEach(r){for(var o=this.inverted?2:1,i=this.inverted?1:2,a=0,c=0;a<this.ranges.length;a+=3){var u=this.ranges[a],p=u-(this.inverted?c:0),g=u+(this.inverted?0:c),v=this.ranges[a+o],b=this.ranges[a+i];r(p,p+v,g,g+b),c+=b-v}}},{key:"invert",value:function invert(){return new StepMap(this.ranges,!this.inverted)}},{key:"toString",value:function toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function offset(r){return 0==r?StepMap.empty:new StepMap(r<0?[0,-r,0]:[0,0,r])}}]),StepMap}();p.empty=new p([]);var g=function(){function Mapping(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r?r.length:0;_classCallCheck(this,Mapping),this.mirror=o,this.from=i,this.to=a,this._maps=r||[],this.ownData=!(r||o)}return _createClass(Mapping,[{key:"maps",get:function get(){return this._maps}},{key:"slice",value:function slice(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new Mapping(this._maps,this.mirror,r,o)}},{key:"appendMap",value:function appendMap(r,o){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(r),null!=o&&this.setMirror(this._maps.length-1,o)}},{key:"appendMapping",value:function appendMapping(r){for(var o=0,i=this._maps.length;o<r._maps.length;o++){var a=r.getMirror(o);this.appendMap(r._maps[o],null!=a&&a<o?i+a:void 0)}}},{key:"getMirror",value:function getMirror(r){if(this.mirror)for(var o=0;o<this.mirror.length;o++)if(this.mirror[o]==r)return this.mirror[o+(o%2?-1:1)]}},{key:"setMirror",value:function setMirror(r,o){this.mirror||(this.mirror=[]),this.mirror.push(r,o)}},{key:"appendMappingInverted",value:function appendMappingInverted(r){for(var o=r.maps.length-1,i=this._maps.length+r._maps.length;o>=0;o--){var a=r.getMirror(o);this.appendMap(r._maps[o].invert(),null!=a&&a>o?i-a-1:void 0)}}},{key:"invert",value:function invert(){var r=new Mapping;return r.appendMappingInverted(this),r}},{key:"map",value:function map(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(r,o,!0);for(var i=this.from;i<this.to;i++)r=this._maps[i].map(r,o);return r}},{key:"mapResult",value:function mapResult(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(r,o,!1)}},{key:"_map",value:function _map(r,o,i){for(var a=0,c=this.from;c<this.to;c++){var p=this._maps[c].mapResult(r,o);if(null!=p.recover){var g=this.getMirror(c);if(null!=g&&g>c&&g<this.to){c=g,r=this._maps[g].recover(p.recover);continue}}a|=p.delInfo,r=p.pos}return i?r:new u(r,a,null)}}]),Mapping}(),v=Object.create(null),b=function(){function Step(){_classCallCheck(this,Step)}return _createClass(Step,[{key:"getMap",value:function getMap(){return p.empty}},{key:"merge",value:function merge(r){return null}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o||!o.stepType)throw new RangeError("Invalid input for Step.fromJSON");var i=v[o.stepType];if(!i)throw new RangeError("No step type ".concat(o.stepType," defined"));return i.fromJSON(r,o)}},{key:"jsonID",value:function jsonID(r,o){if(r in v)throw new RangeError("Duplicate use of step JSON ID "+r);return v[r]=o,o.prototype.jsonID=r,o}}]),Step}(),k=function(){function StepResult(r,o){_classCallCheck(this,StepResult),this.doc=r,this.failed=o}return _createClass(StepResult,null,[{key:"ok",value:function ok(r){return new StepResult(r,null)}},{key:"fail",value:function fail(r){return new StepResult(null,r)}},{key:"fromReplace",value:function fromReplace(r,o,i,c){try{return StepResult.ok(r.replace(o,i,c))}catch(r){if(r instanceof a.ReplaceError)return StepResult.fail(r.message);throw r}}}]),StepResult}();function mapFragment(r,o,i){for(var c=[],u=0;u<r.childCount;u++){var p=r.child(u);p.content.size&&(p=p.copy(mapFragment(p.content,o,p))),p.isInline&&(p=o(p,i,u)),c.push(p)}return a.Fragment.fromArray(c)}var E=function(r){_inherits(AddMarkStep,r);var o=_createSuper(AddMarkStep);function AddMarkStep(r,i,a){var c;return _classCallCheck(this,AddMarkStep),(c=o.call(this)).from=r,c.to=i,c.mark=a,c}return _createClass(AddMarkStep,[{key:"apply",value:function apply(r){var o=this,i=r.slice(this.from,this.to),c=r.resolve(this.from),u=c.node(c.sharedDepth(this.to)),p=new a.Slice(mapFragment(i.content,function(r,i){return r.isAtom&&i.type.allowsMarkType(o.mark.type)?r.mark(o.mark.addToSet(r.marks)):r},u),i.openStart,i.openEnd);return k.fromReplace(r,this.from,this.to,p)}},{key:"invert",value:function invert(){return new w(this.from,this.to,this.mark)}},{key:"map",value:function map(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new AddMarkStep(o.pos,i.pos,this.mark)}},{key:"merge",value:function merge(r){return r instanceof AddMarkStep&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from?new AddMarkStep(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark):null}},{key:"toJSON",value:function toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.from||"number"!=typeof o.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new AddMarkStep(o.from,o.to,r.markFromJSON(o.mark))}}]),AddMarkStep}(b);b.jsonID("addMark",E);var w=function(r){_inherits(RemoveMarkStep,r);var o=_createSuper(RemoveMarkStep);function RemoveMarkStep(r,i,a){var c;return _classCallCheck(this,RemoveMarkStep),(c=o.call(this)).from=r,c.to=i,c.mark=a,c}return _createClass(RemoveMarkStep,[{key:"apply",value:function apply(r){var o=this,i=r.slice(this.from,this.to),c=new a.Slice(mapFragment(i.content,function(r){return r.mark(o.mark.removeFromSet(r.marks))},r),i.openStart,i.openEnd);return k.fromReplace(r,this.from,this.to,c)}},{key:"invert",value:function invert(){return new E(this.from,this.to,this.mark)}},{key:"map",value:function map(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new RemoveMarkStep(o.pos,i.pos,this.mark)}},{key:"merge",value:function merge(r){return r instanceof RemoveMarkStep&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from?new RemoveMarkStep(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark):null}},{key:"toJSON",value:function toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.from||"number"!=typeof o.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new RemoveMarkStep(o.from,o.to,r.markFromJSON(o.mark))}}]),RemoveMarkStep}(b);b.jsonID("removeMark",w);var x=function(r){_inherits(AddNodeMarkStep,r);var o=_createSuper(AddNodeMarkStep);function AddNodeMarkStep(r,i){var a;return _classCallCheck(this,AddNodeMarkStep),(a=o.call(this)).pos=r,a.mark=i,a}return _createClass(AddNodeMarkStep,[{key:"apply",value:function apply(r){var o=r.nodeAt(this.pos);if(!o)return k.fail("No node at mark step's position");var i=o.type.create(o.attrs,null,this.mark.addToSet(o.marks));return k.fromReplace(r,this.pos,this.pos+1,new a.Slice(a.Fragment.from(i),0,o.isLeaf?0:1))}},{key:"invert",value:function invert(r){var o=r.nodeAt(this.pos);if(o){var i=this.mark.addToSet(o.marks);if(i.length==o.marks.length){for(var a=0;a<o.marks.length;a++)if(!o.marks[a].isInSet(i))return new AddNodeMarkStep(this.pos,o.marks[a]);return new AddNodeMarkStep(this.pos,this.mark)}}return new C(this.pos,this.mark)}},{key:"map",value:function map(r){var o=r.mapResult(this.pos,1);return o.deletedAfter?null:new AddNodeMarkStep(o.pos,this.mark)}},{key:"toJSON",value:function toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new AddNodeMarkStep(o.pos,r.markFromJSON(o.mark))}}]),AddNodeMarkStep}(b);b.jsonID("addNodeMark",x);var C=function(r){_inherits(RemoveNodeMarkStep,r);var o=_createSuper(RemoveNodeMarkStep);function RemoveNodeMarkStep(r,i){var a;return _classCallCheck(this,RemoveNodeMarkStep),(a=o.call(this)).pos=r,a.mark=i,a}return _createClass(RemoveNodeMarkStep,[{key:"apply",value:function apply(r){var o=r.nodeAt(this.pos);if(!o)return k.fail("No node at mark step's position");var i=o.type.create(o.attrs,null,this.mark.removeFromSet(o.marks));return k.fromReplace(r,this.pos,this.pos+1,new a.Slice(a.Fragment.from(i),0,o.isLeaf?0:1))}},{key:"invert",value:function invert(r){var o=r.nodeAt(this.pos);return o&&this.mark.isInSet(o.marks)?new x(this.pos,this.mark):this}},{key:"map",value:function map(r){var o=r.mapResult(this.pos,1);return o.deletedAfter?null:new RemoveNodeMarkStep(o.pos,this.mark)}},{key:"toJSON",value:function toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new RemoveNodeMarkStep(o.pos,r.markFromJSON(o.mark))}}]),RemoveNodeMarkStep}(b);b.jsonID("removeNodeMark",C);var _=function(r){_inherits(ReplaceStep,r);var o=_createSuper(ReplaceStep);function ReplaceStep(r,i,a){var c,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return _classCallCheck(this,ReplaceStep),(c=o.call(this)).from=r,c.to=i,c.slice=a,c.structure=u,c}return _createClass(ReplaceStep,[{key:"apply",value:function apply(r){return this.structure&&contentBetween(r,this.from,this.to)?k.fail("Structure replace would overwrite content"):k.fromReplace(r,this.from,this.to,this.slice)}},{key:"getMap",value:function getMap(){return new p([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function invert(r){return new ReplaceStep(this.from,this.from+this.slice.size,r.slice(this.from,this.to))}},{key:"map",value:function map(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deletedAcross&&i.deletedAcross?null:new ReplaceStep(o.pos,Math.max(o.pos,i.pos),this.slice,this.structure)}},{key:"merge",value:function merge(r){if(!(r instanceof ReplaceStep)||r.structure||this.structure)return null;if(this.from+this.slice.size!=r.from||this.slice.openEnd||r.slice.openStart){if(r.to!=this.from||this.slice.openStart||r.slice.openEnd)return null;var o=this.slice.size+r.slice.size==0?a.Slice.empty:new a.Slice(r.slice.content.append(this.slice.content),r.slice.openStart,this.slice.openEnd);return new ReplaceStep(r.from,this.to,o,this.structure)}var i=this.slice.size+r.slice.size==0?a.Slice.empty:new a.Slice(this.slice.content.append(r.slice.content),this.slice.openStart,r.slice.openEnd);return new ReplaceStep(this.from,this.to+(r.to-r.from),i,this.structure)}},{key:"toJSON",value:function toJSON(){var r={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.from||"number"!=typeof o.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ReplaceStep(o.from,o.to,a.Slice.fromJSON(r,o.slice),!!o.structure)}}]),ReplaceStep}(b);b.jsonID("replace",_);var T=function(r){_inherits(ReplaceAroundStep,r);var o=_createSuper(ReplaceAroundStep);function ReplaceAroundStep(r,i,a,c,u,p){var g,v=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return _classCallCheck(this,ReplaceAroundStep),(g=o.call(this)).from=r,g.to=i,g.gapFrom=a,g.gapTo=c,g.slice=u,g.insert=p,g.structure=v,g}return _createClass(ReplaceAroundStep,[{key:"apply",value:function apply(r){if(this.structure&&(contentBetween(r,this.from,this.gapFrom)||contentBetween(r,this.gapTo,this.to)))return k.fail("Structure gap-replace would overwrite content");var o=r.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return k.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?k.fromReplace(r,this.from,this.to,i):k.fail("Content does not fit in gap")}},{key:"getMap",value:function getMap(){return new p([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function invert(r){var o=this.gapTo-this.gapFrom;return new ReplaceAroundStep(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,r.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function map(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),a=this.from==this.gapFrom?o.pos:r.map(this.gapFrom,-1),c=this.to==this.gapTo?i.pos:r.map(this.gapTo,1);return o.deletedAcross&&i.deletedAcross||a<o.pos||c>i.pos?null:new ReplaceAroundStep(o.pos,i.pos,a,c,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function toJSON(){var r={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.from||"number"!=typeof o.to||"number"!=typeof o.gapFrom||"number"!=typeof o.gapTo||"number"!=typeof o.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ReplaceAroundStep(o.from,o.to,o.gapFrom,o.gapTo,a.Slice.fromJSON(r,o.slice),o.insert,!!o.structure)}}]),ReplaceAroundStep}(b);function contentBetween(r,o,i){for(var a=r.resolve(o),c=i-o,u=a.depth;c>0&&u>0&&a.indexAfter(u)==a.node(u).childCount;)u--,c--;if(c>0)for(var p=a.node(u).maybeChild(a.indexAfter(u));c>0;){if(!p||p.isLeaf)return!0;p=p.firstChild,c--}return!1}function _clearIncompatible(r,o,i){for(var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.contentMatch,u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],p=r.doc.nodeAt(o),g=[],v=o+1,b=0;b<p.childCount;b++){var k=p.child(b),E=v+k.nodeSize,x=c.matchType(k.type);if(x){c=x;for(var C=0;C<k.marks.length;C++)i.allowsMarkType(k.marks[C].type)||r.step(new w(v,E,k.marks[C]));if(u&&k.isText&&"pre"!=i.whitespace)for(var T=void 0,P=/\r?\n|\r/g,A=void 0;T=P.exec(k.text);)A||(A=new a.Slice(a.Fragment.from(i.schema.text(" ",i.allowedMarks(k.marks))),0,0)),g.push(new _(v+T.index,v+T.index+T[0].length,A))}else g.push(new _(v,E,a.Slice.empty));v=E}if(!c.validEnd){var N=c.fillBefore(a.Fragment.empty,!0);r.replace(v,v,new a.Slice(N,0,0))}for(var R=g.length-1;R>=0;R--)r.step(g[R])}function canCut(r,o,i){return(0==o||r.canReplace(o,r.childCount))&&(i==r.childCount||r.canReplace(0,i))}function withAttrs(r){return{type:r,attrs:null}}function replaceNewlines(r,o,i,a){o.forEach(function(c,u){if(c.isText)for(var p,g=/\r?\n|\r/g;p=g.exec(c.text);){var v=r.mapping.slice(a).map(i+1+u+p.index);r.replaceWith(v,v+1,o.type.schema.linebreakReplacement.create())}})}function replaceLinebreaks(r,o,i,a){o.forEach(function(c,u){if(c.type==c.type.schema.linebreakReplacement){var p=r.mapping.slice(a).map(i+1+u);r.replaceWith(p,p+1,o.type.schema.text("\n"))}})}function joinable(r,o){return!(!r||!o||r.isLeaf||!function canAppendWithSubstitutedLinebreaks(r,o){o.content.size||r.type.compatibleContent(o.type);for(var i=r.contentMatchAt(r.childCount),a=r.type.schema.linebreakReplacement,c=0;c<o.childCount;c++){var u=o.child(c),p=u.type==a?r.type.schema.nodes.text:u.type;if(!(i=i.matchType(p)))return!1;if(!r.type.allowsMarks(u.marks))return!1}return i.validEnd}(r,o))}function insertPoint(r,o,i){var a=r.resolve(o);if(a.parent.canReplaceWith(a.index(),a.index(),i))return o;if(0==a.parentOffset)for(var c=a.depth-1;c>=0;c--){var u=a.index(c);if(a.node(c).canReplaceWith(u,u,i))return a.before(c+1);if(u>0)return null}if(a.parentOffset==a.parent.content.size)for(var p=a.depth-1;p>=0;p--){var g=a.indexAfter(p);if(a.node(p).canReplaceWith(g,g,i))return a.after(p+1);if(g<a.node(p).childCount)return null}return null}function replaceStep(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.Slice.empty;if(o==i&&!c.size)return null;var u=r.resolve(o),p=r.resolve(i);return fitsTrivially(u,p,c)?new _(o,i,c):new P(u,p,c).fit()}function fitsTrivially(r,o,i){return!i.openStart&&!i.openEnd&&r.start()==o.start()&&r.parent.canReplace(r.index(),o.index(),i.content)}b.jsonID("replaceAround",T);var P=function(){function Fitter(r,o,i){_classCallCheck(this,Fitter),this.$from=r,this.$to=o,this.unplaced=i,this.frontier=[],this.placed=a.Fragment.empty;for(var c=0;c<=r.depth;c++){var u=r.node(c);this.frontier.push({type:u.type,match:u.contentMatchAt(r.indexAfter(c))})}for(var p=r.depth;p>0;p--)this.placed=a.Fragment.from(r.node(p).copy(this.placed))}return _createClass(Fitter,[{key:"depth",get:function get(){return this.frontier.length-1}},{key:"fit",value:function fit(){for(;this.unplaced.size;){var fit=this.findFittable();fit?this.placeNodes(fit):this.openMore()||this.dropNode()}var r=this.mustMoveInline(),o=this.placed.size-this.depth-this.$from.depth,i=this.$from,c=this.close(r<0?this.$to:i.doc.resolve(r));if(!c)return null;for(var u=this.placed,p=i.depth,g=c.depth;p&&g&&1==u.childCount;)u=u.firstChild.content,p--,g--;var v=new a.Slice(u,p,g);return r>-1?new T(i.pos,r,this.$to.pos,this.$to.end(),v,o):v.size||i.pos!=this.$to.pos?new _(i.pos,c.pos,v):null}},{key:"findFittable",value:function findFittable(){for(var r=this.unplaced.openStart,o=this.unplaced.content,i=0,c=this.unplaced.openEnd;i<r;i++){var u=o.firstChild;if(o.childCount>1&&(c=0),u.type.spec.isolating&&c<=i){r=i;break}o=u.content}for(var p=1;p<=2;p++)for(var g=1==p?r:this.unplaced.openStart;g>=0;g--)for(var v=null,b=(g?(v=contentAt(this.unplaced.content,g-1).firstChild).content:this.unplaced.content).firstChild,k=this.depth;k>=0;k--){var E=this.frontier[k],w=E.type,x=E.match,C=void 0,_=null;if(1==p&&(b?x.matchType(b.type)||(_=x.fillBefore(a.Fragment.from(b),!1)):v&&w.compatibleContent(v.type)))return{sliceDepth:g,frontierDepth:k,parent:v,inject:_};if(2==p&&b&&(C=x.findWrapping(b.type)))return{sliceDepth:g,frontierDepth:k,parent:v,wrap:C};if(v&&x.matchType(v.type))break}}},{key:"openMore",value:function openMore(){var r=this.unplaced,o=r.content,i=r.openStart,c=r.openEnd,u=contentAt(o,i);return!(!u.childCount||u.firstChild.isLeaf)&&(this.unplaced=new a.Slice(o,i+1,Math.max(c,u.size+i>=o.size-c?i+1:0)),!0)}},{key:"dropNode",value:function dropNode(){var r=this.unplaced,o=r.content,i=r.openStart,c=r.openEnd,u=contentAt(o,i);if(u.childCount<=1&&i>0){var p=o.size-i<=i+u.size;this.unplaced=new a.Slice(dropFromFragment(o,i-1,1),i-1,p?i-1:c)}else this.unplaced=new a.Slice(dropFromFragment(o,i,1),i,c)}},{key:"placeNodes",value:function placeNodes(r){for(var o=r.sliceDepth,i=r.frontierDepth,c=r.parent,u=r.inject,p=r.wrap;this.depth>i;)this.closeFrontierNode();if(p)for(var g=0;g<p.length;g++)this.openFrontierNode(p[g]);var v=this.unplaced,b=c?c.content:v.content,k=v.openStart-o,E=0,w=[],x=this.frontier[i],C=x.match,_=x.type;if(u){for(var T=0;T<u.childCount;T++)w.push(u.child(T));C=C.matchFragment(u)}for(var P=b.size+o-(v.content.size-v.openEnd);E<b.childCount;){var A=b.child(E),N=C.matchType(A.type);if(!N)break;(++E>1||0==k||A.content.size)&&(C=N,w.push(closeNodeStart(A.mark(_.allowedMarks(A.marks)),1==E?k:0,E==b.childCount?P:-1)))}var R=E==b.childCount;R||(P=-1),this.placed=addToFragment(this.placed,i,a.Fragment.from(w)),this.frontier[i].match=C,R&&P<0&&c&&c.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var I=0,L=b;I<P;I++){var z=L.lastChild;this.frontier.push({type:z.type,match:z.contentMatchAt(z.childCount)}),L=z.content}this.unplaced=R?0==o?a.Slice.empty:new a.Slice(dropFromFragment(v.content,o-1,1),o-1,P<0?v.openEnd:o-1):new a.Slice(dropFromFragment(v.content,o,E),v.openStart,v.openEnd)}},{key:"mustMoveInline",value:function mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;var r,o=this.frontier[this.depth];if(!o.type.isTextblock||!contentAfterFits(this.$to,this.$to.depth,o.type,o.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;for(var i=this.$to.depth,a=this.$to.after(i);i>1&&a==this.$to.end(--i);)++a;return a}},{key:"findCloseLevel",value:function findCloseLevel(r){e:for(var o=Math.min(this.depth,r.depth);o>=0;o--){var i=this.frontier[o],a=i.match,c=i.type,u=o<r.depth&&r.end(o+1)==r.pos+(r.depth-(o+1)),p=contentAfterFits(r,o,c,a,u);if(p){for(var g=o-1;g>=0;g--){var v=this.frontier[g],b=v.match,k=contentAfterFits(r,g,v.type,b,!0);if(!k||k.childCount)continue e}return{depth:o,fit:p,move:u?r.doc.resolve(r.after(o+1)):r}}}}},{key:"close",value:function close(r){var close=this.findCloseLevel(r);if(!close)return null;for(;this.depth>close.depth;)this.closeFrontierNode();close.fit.childCount&&(this.placed=addToFragment(this.placed,close.depth,close.fit)),r=close.move;for(var o=close.depth+1;o<=r.depth;o++){var i=r.node(o),a=i.type.contentMatch.fillBefore(i.content,!0,r.index(o));this.openFrontierNode(i.type,i.attrs,a)}return r}},{key:"openFrontierNode",value:function openFrontierNode(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,c=this.frontier[this.depth];c.match=c.match.matchType(r),this.placed=addToFragment(this.placed,this.depth,a.Fragment.from(r.create(o,i))),this.frontier.push({type:r,match:r.contentMatch})}},{key:"closeFrontierNode",value:function closeFrontierNode(){var r=this.frontier.pop().match.fillBefore(a.Fragment.empty,!0);r.childCount&&(this.placed=addToFragment(this.placed,this.frontier.length,r))}}]),Fitter}();function dropFromFragment(r,o,i){return 0==o?r.cutByIndex(i,r.childCount):r.replaceChild(0,r.firstChild.copy(dropFromFragment(r.firstChild.content,o-1,i)))}function addToFragment(r,o,i){return 0==o?r.append(i):r.replaceChild(r.childCount-1,r.lastChild.copy(addToFragment(r.lastChild.content,o-1,i)))}function contentAt(r,o){for(var i=0;i<o;i++)r=r.firstChild.content;return r}function closeNodeStart(r,o,i){if(o<=0)return r;var c=r.content;return o>1&&(c=c.replaceChild(0,closeNodeStart(c.firstChild,o-1,1==c.childCount?i-1:0))),o>0&&(c=r.type.contentMatch.fillBefore(c).append(c),i<=0&&(c=c.append(r.type.contentMatch.matchFragment(c).fillBefore(a.Fragment.empty,!0)))),r.copy(c)}function contentAfterFits(r,o,i,a,c){var u=r.node(o),p=c?r.indexAfter(o):r.index(o);if(p==u.childCount&&!i.compatibleContent(u.type))return null;var g=a.fillBefore(u.content,!0,p);return g&&!function invalidMarks(r,o,i){for(var a=i;a<o.childCount;a++)if(!r.allowsMarks(o.child(a).marks))return!0;return!1}(i,u.content,p)?g:null}function definesContent(r){return r.spec.defining||r.spec.definingForContent}function closeFragment(r,o,i,c,u){if(o<i){var p=r.firstChild;r=r.replaceChild(0,p.copy(closeFragment(p.content,o+1,i,c,p)))}if(o>c){var g=u.contentMatchAt(0),v=g.fillBefore(r).append(r);r=v.append(g.matchFragment(v).fillBefore(a.Fragment.empty,!0))}return r}function coveredDepths(r,o){for(var i=[],a=Math.min(r.depth,o.depth);a>=0;a--){var c=r.start(a);if(c<r.pos-(r.depth-a)||o.end(a)>o.pos+(o.depth-a)||r.node(a).type.spec.isolating||o.node(a).type.spec.isolating)break;(c==o.start(a)||a==r.depth&&a==o.depth&&r.parent.inlineContent&&o.parent.inlineContent&&a&&o.start(a-1)==c-1)&&i.push(a)}return i}var A=function(r){_inherits(AttrStep,r);var o=_createSuper(AttrStep);function AttrStep(r,i,a){var c;return _classCallCheck(this,AttrStep),(c=o.call(this)).pos=r,c.attr=i,c.value=a,c}return _createClass(AttrStep,[{key:"apply",value:function apply(r){var o=r.nodeAt(this.pos);if(!o)return k.fail("No node at attribute step's position");var i=Object.create(null);for(var c in o.attrs)i[c]=o.attrs[c];i[this.attr]=this.value;var u=o.type.create(i,null,o.marks);return k.fromReplace(r,this.pos,this.pos+1,new a.Slice(a.Fragment.from(u),0,o.isLeaf?0:1))}},{key:"getMap",value:function getMap(){return p.empty}},{key:"invert",value:function invert(r){return new AttrStep(this.pos,this.attr,r.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function map(r){var o=r.mapResult(this.pos,1);return o.deletedAfter?null:new AttrStep(o.pos,this.attr,this.value)}},{key:"toJSON",value:function toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.pos||"string"!=typeof o.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new AttrStep(o.pos,o.attr,o.value)}}]),AttrStep}(b);b.jsonID("attr",A);var N=function(r){_inherits(DocAttrStep,r);var o=_createSuper(DocAttrStep);function DocAttrStep(r,i){var a;return _classCallCheck(this,DocAttrStep),(a=o.call(this)).attr=r,a.value=i,a}return _createClass(DocAttrStep,[{key:"apply",value:function apply(r){var o=Object.create(null);for(var i in r.attrs)o[i]=r.attrs[i];o[this.attr]=this.value;var a=r.type.create(o,r.content,r.marks);return k.ok(a)}},{key:"getMap",value:function getMap(){return p.empty}},{key:"invert",value:function invert(r){return new DocAttrStep(this.attr,r.attrs[this.attr])}},{key:"map",value:function map(r){return this}},{key:"toJSON",value:function toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("string"!=typeof o.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new DocAttrStep(o.attr,o.value)}}]),DocAttrStep}(b);b.jsonID("docAttr",N),o.TransformError=function(r){_inherits(TransformError,r);var o=_createSuper(TransformError);function TransformError(){return _classCallCheck(this,TransformError),o.apply(this,arguments)}return _createClass(TransformError)}(_wrapNativeSuper(Error)),o.TransformError=function TransformError(r){var o=Error.call(this,r);return o.__proto__=TransformError.prototype,o},o.TransformError.prototype=Object.create(Error.prototype),o.TransformError.prototype.constructor=o.TransformError,o.TransformError.prototype.name="TransformError";var R=function(){function Transform(r){_classCallCheck(this,Transform),this.doc=r,this.steps=[],this.docs=[],this.mapping=new g}return _createClass(Transform,[{key:"before",get:function get(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function step(r){var i=this.maybeStep(r);if(i.failed)throw new o.TransformError(i.failed);return this}},{key:"maybeStep",value:function maybeStep(r){var o=r.apply(this.doc);return o.failed||this.addStep(r,o.doc),o}},{key:"docChanged",get:function get(){return this.steps.length>0}},{key:"changedRange",value:function changedRange(){for(var r=1e9,o=-1e9,i=0;i<this.mapping.maps.length;i++){var a=this.mapping.maps[i];i&&(r=a.map(r,1),o=a.map(o,-1)),a.forEach(function(i,a,c,u){r=Math.min(r,c),o=Math.max(o,u)})}return 1e9==r?null:{from:r,to:o}}},{key:"addStep",value:function addStep(r,o){this.docs.push(this.doc),this.steps.push(r),this.mapping.appendMap(r.getMap()),this.doc=o}},{key:"replace",value:function replace(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.Slice.empty,c=replaceStep(this.doc,r,o,i);return c&&this.step(c),this}},{key:"replaceWith",value:function replaceWith(r,o,i){return this.replace(r,o,new a.Slice(a.Fragment.from(i),0,0))}},{key:"delete",value:function _delete(r,o){return this.replace(r,o,a.Slice.empty)}},{key:"insert",value:function insert(r,o){return this.replaceWith(r,r,o)}},{key:"replaceRange",value:function replaceRange(r,o,i){return function _replaceRange(r,o,i,c){if(!c.size)return r.deleteRange(o,i);var u=r.doc.resolve(o),p=r.doc.resolve(i);if(fitsTrivially(u,p,c))return r.step(new _(o,i,c));var g=coveredDepths(u,p);0==g[g.length-1]&&g.pop();var v=-(u.depth+1);g.unshift(v);for(var b=u.depth,k=u.pos-1;b>0;b--,k--){var E=u.node(b).type.spec;if(E.defining||E.definingAsContext||E.isolating)break;g.indexOf(b)>-1?v=b:u.before(b)==k&&g.splice(1,0,-b)}for(var w=g.indexOf(v),x=[],C=c.openStart,T=c.content,P=0;;P++){var A=T.firstChild;if(x.push(A),P==c.openStart)break;T=A.content}for(var N=C-1;N>=0;N--){var R=x[N],I=definesContent(R.type);if(I&&!R.sameMarkup(u.node(Math.abs(v)-1)))C=N;else if(I||!R.type.isTextblock)break}for(var L=c.openStart;L>=0;L--){var z=(L+C+1)%(c.openStart+1),j=x[z];if(j)for(var B=0;B<g.length;B++){var V=g[(B+w)%g.length],U=!0;V<0&&(U=!1,V=-V);var H=u.node(V-1),W=u.index(V-1);if(H.canReplaceWith(W,W,j.type,j.marks))return r.replace(u.before(V),U?p.after(V):i,new a.Slice(closeFragment(c.content,0,c.openStart,z),z,c.openEnd))}}for(var K=r.steps.length,G=g.length-1;G>=0&&(r.replace(o,i,c),!(r.steps.length>K));G--){var J=g[G];J<0||(o=u.before(J),i=p.after(J))}}(this,r,o,i),this}},{key:"replaceRangeWith",value:function replaceRangeWith(r,o,i){return function _replaceRangeWith(r,o,i,c){if(!c.isInline&&o==i&&r.doc.resolve(o).parent.content.size){var u=insertPoint(r.doc,o,c.type);null!=u&&(o=i=u)}r.replaceRange(o,i,new a.Slice(a.Fragment.from(c),0,0))}(this,r,o,i),this}},{key:"deleteRange",value:function deleteRange(r,o){return function _deleteRange(r,o,i){for(var a=r.doc.resolve(o),c=r.doc.resolve(i),u=coveredDepths(a,c),p=0;p<u.length;p++){var g=u[p],v=p==u.length-1;if(v&&0==g||a.node(g).type.contentMatch.validEnd)return r.delete(a.start(g),c.end(g));if(g>0&&(v||a.node(g-1).canReplace(a.index(g-1),c.indexAfter(g-1))))return r.delete(a.before(g),c.after(g))}for(var b=1;b<=a.depth&&b<=c.depth;b++)if(o-a.start(b)==a.depth-b&&i>a.end(b)&&c.end(b)-i!=c.depth-b&&a.start(b-1)==c.start(b-1)&&a.node(b-1).canReplace(a.index(b-1),c.index(b-1)))return r.delete(a.before(b),i);r.delete(o,i)}(this,r,o),this}},{key:"lift",value:function lift(r,o){return function _lift(r,o,i){for(var c=o.$from,u=o.$to,p=o.depth,g=c.before(p+1),v=u.after(p+1),b=g,k=v,E=a.Fragment.empty,w=0,x=p,C=!1;x>i;x--)C||c.index(x)>0?(C=!0,E=a.Fragment.from(c.node(x).copy(E)),w++):b--;for(var _=a.Fragment.empty,P=0,A=p,N=!1;A>i;A--)N||u.after(A+1)<u.end(A)?(N=!0,_=a.Fragment.from(u.node(A).copy(_)),P++):k++;r.step(new T(b,k,g,v,new a.Slice(E.append(_),w,P),E.size-w,!0))}(this,r,o),this}},{key:"join",value:function join(r){return function _join(r,o,i){var c=null,u=r.doc.type.schema.linebreakReplacement,p=r.doc.resolve(o-i),g=p.node().type;if(u&&g.inlineContent){var v="pre"==g.whitespace,b=!!g.contentMatch.matchType(u);v&&!b?c=!1:!v&&b&&(c=!0)}var k=r.steps.length;if(!1===c){var E=r.doc.resolve(o+i);replaceLinebreaks(r,E.node(),E.before(),k)}g.inlineContent&&_clearIncompatible(r,o+i-1,g,p.node().contentMatchAt(p.index()),null==c);var w=r.mapping.slice(k),x=w.map(o-i);if(r.step(new _(x,w.map(o+i,-1),a.Slice.empty,!0)),!0===c){var C=r.doc.resolve(x);replaceNewlines(r,C.node(),C.before(),r.steps.length)}return r}(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this}},{key:"wrap",value:function wrap(r,o){return function _wrap2(r,o,i){for(var c=a.Fragment.empty,u=i.length-1;u>=0;u--){if(c.size){var p=i[u].type.contentMatch.matchFragment(c);if(!p||!p.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}c=a.Fragment.from(i[u].type.create(i[u].attrs,c))}var g=o.start,v=o.end;r.step(new T(g,v,g,v,new a.Slice(c,0,0),i.length,!0))}(this,r,o),this}},{key:"setBlockType",value:function setBlockType(r){return function _setBlockType(r,o,i,c,u){if(!c.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var p=r.steps.length;r.doc.nodesBetween(o,i,function(o,i){var g="function"==typeof u?u(o):u;if(o.isTextblock&&!o.hasMarkup(c,g)&&function canChangeType(r,o,i){var a=r.resolve(o),c=a.index();return a.parent.canReplaceWith(c,c+1,i)}(r.doc,r.mapping.slice(p).map(i),c)){var v=null;if(c.schema.linebreakReplacement){var b="pre"==c.whitespace,k=!!c.contentMatch.matchType(c.schema.linebreakReplacement);b&&!k?v=!1:!b&&k&&(v=!0)}!1===v&&replaceLinebreaks(r,o,i,p),_clearIncompatible(r,r.mapping.slice(p).map(i,1),c,void 0,null===v);var E=r.mapping.slice(p),w=E.map(i,1),x=E.map(i+o.nodeSize,1);return r.step(new T(w,x,w+1,x-1,new a.Slice(a.Fragment.from(c.create(g,null,o.marks)),0,0),1,!0)),!0===v&&replaceNewlines(r,o,i,p),!1}})}(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,arguments.length>2?arguments[2]:void 0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null),this}},{key:"setNodeMarkup",value:function setNodeMarkup(r,o){return function _setNodeMarkup(r,o,i,c,u){var p=r.doc.nodeAt(o);if(!p)throw new RangeError("No node at given position");i||(i=p.type);var g=i.create(c,null,u||p.marks);if(p.isLeaf)return r.replaceWith(o,o+p.nodeSize,g);if(!i.validContent(p.content))throw new RangeError("Invalid content for node type "+i.name);r.step(new T(o,o+p.nodeSize,o+1,o+p.nodeSize-1,new a.Slice(a.Fragment.from(g),0,0),1,!0))}(this,r,o,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0),this}},{key:"setNodeAttribute",value:function setNodeAttribute(r,o,i){return this.step(new A(r,o,i)),this}},{key:"setDocAttribute",value:function setDocAttribute(r,o){return this.step(new N(r,o)),this}},{key:"addNodeMark",value:function addNodeMark(r,o){return this.step(new x(r,o)),this}},{key:"removeNodeMark",value:function removeNodeMark(r,o){var i=this.doc.nodeAt(r);if(!i)throw new RangeError("No node at position "+r);if(o instanceof a.Mark)o.isInSet(i.marks)&&this.step(new C(r,o));else{for(var c,u=i.marks,p=[];c=o.isInSet(u);)p.push(new C(r,c)),u=c.removeFromSet(u);for(var g=p.length-1;g>=0;g--)this.step(p[g])}return this}},{key:"split",value:function split(r){return function _split(r,o){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,c=arguments.length>3?arguments[3]:void 0,u=r.doc.resolve(o),p=a.Fragment.empty,g=a.Fragment.empty,v=u.depth,b=u.depth-i,k=i-1;v>b;v--,k--){p=a.Fragment.from(u.node(v).copy(p));var E=c&&c[k];g=a.Fragment.from(E?E.type.create(E.attrs,g):u.node(v).copy(g))}r.step(new _(o,o,new a.Slice(p.append(g),i,i),!0))}(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0),this}},{key:"addMark",value:function addMark(r,o,i){return function _addMark(r,o,i,a){var c,u,p=[],g=[];r.doc.nodesBetween(o,i,function(r,v,b){if(r.isInline){var k=r.marks;if(!a.isInSet(k)&&b.type.allowsMarkType(a.type)){for(var x=Math.max(v,o),C=Math.min(v+r.nodeSize,i),_=a.addToSet(k),T=0;T<k.length;T++)k[T].isInSet(_)||(c&&c.to==x&&c.mark.eq(k[T])?c.to=C:p.push(c=new w(x,C,k[T])));u&&u.to==x?u.to=C:g.push(u=new E(x,C,a))}}}),p.forEach(function(o){return r.step(o)}),g.forEach(function(o){return r.step(o)})}(this,r,o,i),this}},{key:"removeMark",value:function removeMark(r,o,i){return function _removeMark(r,o,i,c){var u=[],p=0;r.doc.nodesBetween(o,i,function(r,g){if(r.isInline){p++;var v=null;if(c instanceof a.MarkType)for(var b,k=r.marks;b=c.isInSet(k);)(v||(v=[])).push(b),k=b.removeFromSet(k);else c?c.isInSet(r.marks)&&(v=[c]):v=r.marks;if(v&&v.length)for(var E=Math.min(g+r.nodeSize,i),w=0;w<v.length;w++){for(var x=v[w],C=void 0,_=0;_<u.length;_++){var T=u[_];T.step==p-1&&x.eq(u[_].style)&&(C=T)}C?(C.to=E,C.step=p):u.push({style:x,from:Math.max(g,o),to:E,step:p})}}}),u.forEach(function(o){return r.step(new w(o.from,o.to,o.style))})}(this,r,o,i),this}},{key:"clearIncompatible",value:function clearIncompatible(r,o,i){return _clearIncompatible(this,r,o,i),this}}]),Transform}();o.AddMarkStep=E,o.AddNodeMarkStep=x,o.AttrStep=A,o.DocAttrStep=N,o.MapResult=u,o.Mapping=g,o.RemoveMarkStep=w,o.RemoveNodeMarkStep=C,o.ReplaceAroundStep=T,o.ReplaceStep=_,o.Step=b,o.StepMap=p,o.StepResult=k,o.Transform=R,o.canJoin=function canJoin(r,o){var i=r.resolve(o),a=i.index();return joinable(i.nodeBefore,i.nodeAfter)&&i.parent.canReplace(a,a+1)},o.canSplit=function canSplit(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,c=r.resolve(o),u=c.depth-i,p=a&&a[a.length-1]||c.parent;if(u<0||c.parent.type.spec.isolating||!c.parent.canReplace(c.index(),c.parent.childCount)||!p.type.validContent(c.parent.content.cutByIndex(c.index(),c.parent.childCount)))return!1;for(var g=c.depth-1,v=i-2;g>u;g--,v--){var b=c.node(g),k=c.index(g);if(b.type.spec.isolating)return!1;var E=b.content.cutByIndex(k,b.childCount),w=a&&a[v+1];w&&(E=E.replaceChild(0,w.type.create(w.attrs)));var x=a&&a[v]||b;if(!b.canReplace(k+1,b.childCount)||!x.type.validContent(E))return!1}var C=c.indexAfter(u),_=a&&a[0];return c.node(u).canReplaceWith(C,C,_?_.type:c.node(u+1).type)},o.dropPoint=function dropPoint(r,o,i){var a=r.resolve(o);if(!i.content.size)return o;for(var c=i.content,u=0;u<i.openStart;u++)c=c.firstChild.content;for(var p=1;p<=(0==i.openStart&&i.size?2:1);p++)for(var g=a.depth;g>=0;g--){var v=g==a.depth?0:a.pos<=(a.start(g+1)+a.end(g+1))/2?-1:1,b=a.index(g)+(v>0?1:0),k=a.node(g),E=!1;if(1==p)E=k.canReplace(b,b,c);else{var w=k.contentMatchAt(b).findWrapping(c.firstChild.type);E=w&&k.canReplaceWith(b,b,w[0])}if(E)return 0==v?a.pos:v<0?a.before(g+1):a.after(g+1)}return null},o.findWrapping=function findWrapping(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r,c=function findWrappingOutside(r,o){var i=r.parent,a=r.startIndex,c=r.endIndex,u=i.contentMatchAt(a).findWrapping(o);if(!u)return null;var p=u.length?u[0]:o;return i.canReplaceWith(a,c,p)?u:null}(r,o),u=c&&function findWrappingInside(r,o){var i=r.parent,a=r.startIndex,c=r.endIndex,u=i.child(a),p=o.contentMatch.findWrapping(u.type);if(!p)return null;for(var g=(p.length?p[p.length-1]:o).contentMatch,v=a;g&&v<c;v++)g=g.matchType(i.child(v).type);return g&&g.validEnd?p:null}(a,o);return u?c.map(withAttrs).concat({type:o,attrs:i}).concat(u.map(withAttrs)):null},o.insertPoint=insertPoint,o.joinPoint=function joinPoint(r,o){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=r.resolve(o),c=a.depth;;c--){var u=void 0,p=void 0,g=a.index(c);if(c==a.depth?(u=a.nodeBefore,p=a.nodeAfter):i>0?(u=a.node(c+1),g++,p=a.node(c).maybeChild(g)):(u=a.node(c).maybeChild(g-1),p=a.node(c+1)),u&&!u.isTextblock&&joinable(u,p)&&a.node(c).canReplace(g,g+1))return o;if(0==c)break;o=i<0?a.before(c):a.after(c)}},o.liftTarget=function liftTarget(r){for(var o=r.parent.content.cutByIndex(r.startIndex,r.endIndex),i=r.depth,a=0,c=0;;--i){var u=r.$from.node(i),p=r.$from.index(i)+a,g=r.$to.indexAfter(i)-c;if(i<r.depth&&u.canReplace(p,g,o))return i;if(0==i||u.type.spec.isolating||!canCut(u,p,g))break;p&&(a=1),g<u.childCount&&(c=1)}return null},o.replaceStep=replaceStep},37112:function(r,o,i){"use strict";i.r(o),i.d(o,{Mention:function(){return Oe}});var a=i(97557),c=i.n(a);function _arrayLikeToArray$2(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function _unsupportedIterableToArray$2(r,o){if(r){if("string"==typeof r)return _arrayLikeToArray$2(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray$2(r,o):void 0}}function _slicedToArray(r,o){return function _arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function _iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||_unsupportedIterableToArray$2(r,o)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function classNames(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(o){for(var a=[],c=0;c<o.length;c++){var u=o[c];if(u){var p=_typeof(u);if("string"===p||"number"===p)a.push(u);else if("object"===p){var g=Array.isArray(u)?u:Object.entries(u).map(function(r){var o=_slicedToArray(r,2),i=o[0];return o[1]?i:null});a=g.length?a.concat(g.filter(function(r){return!!r})):a}}}return a.join(" ").trim()}}function _toConsumableArray(r){return function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray$2(r)}(r)||function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||_unsupportedIterableToArray$2(r)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function toPropertyKey(r){var o=function toPrimitive(r,o){if("object"!=_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==_typeof(o)?o:o+""}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _defineProperty(r,o,i){return(o=toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function _createForOfIteratorHelper$1(r,o){var i="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function _unsupportedIterableToArray$1(r,o){if(r){if("string"==typeof r)return _arrayLikeToArray$1(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray$1(r,o):void 0}}(r))||o&&r&&"number"==typeof r.length){i&&(r=i);var a=0,c=function F(){};return{s:c,n:function n(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function e(r){throw r},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,p=!0,g=!1;return{s:function s(){i=i.call(r)},n:function n(){var r=i.next();return p=r.done,r},e:function e(r){g=!0,u=r},f:function f(){try{p||null==i.return||i.return()}finally{if(g)throw u}}}}function _arrayLikeToArray$1(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}var u=function(){function DomHandler(){_classCallCheck(this,DomHandler)}return _createClass(DomHandler,null,[{key:"innerWidth",value:function innerWidth(r){if(r){var o=r.offsetWidth,i=getComputedStyle(r);return o+=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)}return 0}},{key:"width",value:function width(r){if(r){var o=r.offsetWidth,i=getComputedStyle(r);return o-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)}return 0}},{key:"getBrowserLanguage",value:function getBrowserLanguage(){return navigator.userLanguage||navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"en"}},{key:"getWindowScrollTop",value:function getWindowScrollTop(){var r=document.documentElement;return(window.pageYOffset||r.scrollTop)-(r.clientTop||0)}},{key:"getWindowScrollLeft",value:function getWindowScrollLeft(){var r=document.documentElement;return(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)}},{key:"getOuterWidth",value:function getOuterWidth(r,o){if(r){var i=r.getBoundingClientRect().width||r.offsetWidth;if(o){var a=getComputedStyle(r);i+=parseFloat(a.marginLeft)+parseFloat(a.marginRight)}return i}return 0}},{key:"getOuterHeight",value:function getOuterHeight(r,o){if(r){var i=r.getBoundingClientRect().height||r.offsetHeight;if(o){var a=getComputedStyle(r);i+=parseFloat(a.marginTop)+parseFloat(a.marginBottom)}return i}return 0}},{key:"getClientHeight",value:function getClientHeight(r,o){if(r){var i=r.clientHeight;if(o){var a=getComputedStyle(r);i+=parseFloat(a.marginTop)+parseFloat(a.marginBottom)}return i}return 0}},{key:"getClientWidth",value:function getClientWidth(r,o){if(r){var i=r.clientWidth;if(o){var a=getComputedStyle(r);i+=parseFloat(a.marginLeft)+parseFloat(a.marginRight)}return i}return 0}},{key:"getViewport",value:function getViewport(){var r=window,o=document,i=o.documentElement,a=o.getElementsByTagName("body")[0];return{width:r.innerWidth||i.clientWidth||a.clientWidth,height:r.innerHeight||i.clientHeight||a.clientHeight}}},{key:"getOffset",value:function getOffset(r){if(r){var o=r.getBoundingClientRect();return{top:o.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:o.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}},{key:"index",value:function index(r){if(r)for(var o=r.parentNode.childNodes,i=0,a=0;a<o.length;a++){if(o[a]===r)return i;1===o[a].nodeType&&i++}return-1}},{key:"addMultipleClasses",value:function addMultipleClasses(r,o){if(r&&o)if(r.classList)for(var i=o.split(" "),a=0;a<i.length;a++)r.classList.add(i[a]);else for(var c=o.split(" "),u=0;u<c.length;u++)r.className=r.className+" "+c[u]}},{key:"removeMultipleClasses",value:function removeMultipleClasses(r,o){if(r&&o)if(r.classList)for(var i=o.split(" "),a=0;a<i.length;a++)r.classList.remove(i[a]);else for(var c=o.split(" "),u=0;u<c.length;u++)r.className=r.className.replace(new RegExp("(^|\\b)"+c[u].split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"addClass",value:function addClass(r,o){r&&o&&(r.classList?r.classList.add(o):r.className=r.className+" "+o)}},{key:"removeClass",value:function removeClass(r,o){r&&o&&(r.classList?r.classList.remove(o):r.className=r.className.replace(new RegExp("(^|\\b)"+o.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function hasClass(r,o){return!!r&&(r.classList?r.classList.contains(o):new RegExp("(^| )"+o+"( |$)","gi").test(r.className))}},{key:"addStyles",value:function addStyles(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r&&Object.entries(o).forEach(function(o){var i=_slicedToArray(o,2),a=i[0],c=i[1];return r.style[a]=c})}},{key:"find",value:function find(r,o){return r?Array.from(r.querySelectorAll(o)):[]}},{key:"findSingle",value:function findSingle(r,o){return r?r.querySelector(o):null}},{key:"setAttributes",value:function setAttributes(r){var o=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r){var a=function computedStyles(o,i){var c,u,p=null!=r&&null!==(c=r.$attrs)&&void 0!==c&&c[o]?[null==r||null===(u=r.$attrs)||void 0===u?void 0:u[o]]:[];return[i].flat().reduce(function(r,i){if(null!=i){var c=_typeof(i);if("string"===c||"number"===c)r.push(i);else if("object"===c){var u=Array.isArray(i)?a(o,i):Object.entries(i).map(function(r){var i=_slicedToArray(r,2),a=i[0],c=i[1];return"style"!==o||!c&&0!==c?c?a:void 0:"".concat(a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(c)});r=u.length?r.concat(u.filter(function(r){return!!r})):r}}return r},p)};Object.entries(i).forEach(function(i){var c=_slicedToArray(i,2),u=c[0],p=c[1];if(null!=p){var g=u.match(/^on(.+)/);g?r.addEventListener(g[1].toLowerCase(),p):"p-bind"===u?o.setAttributes(r,p):(p="class"===u?_toConsumableArray(new Set(a("class",p))).join(" ").trim():"style"===u?a("style",p).join(";").trim():p,(r.$attrs=r.$attrs||{})&&(r.$attrs[u]=p),r.setAttribute(u,p))}})}}},{key:"getAttribute",value:function getAttribute(r,o){if(r){var i=r.getAttribute(o);return isNaN(i)?"true"===i||"false"===i?"true"===i:i:+i}}},{key:"isAttributeEquals",value:function isAttributeEquals(r,o,i){return!!r&&this.getAttribute(r,o)===i}},{key:"isAttributeNotEquals",value:function isAttributeNotEquals(r,o,i){return!this.isAttributeEquals(r,o,i)}},{key:"getHeight",value:function getHeight(r){if(r){var o=r.offsetHeight,i=getComputedStyle(r);return o-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth)}return 0}},{key:"getWidth",value:function getWidth(r){if(r){var o=r.offsetWidth,i=getComputedStyle(r);return o-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth)}return 0}},{key:"alignOverlay",value:function alignOverlay(r,o,i){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];r&&o&&("self"===i?this.relativePosition(r,o):(a&&(r.style.minWidth=DomHandler.getOuterWidth(o)+"px"),this.absolutePosition(r,o)))}},{key:"absolutePosition",value:function absolutePosition(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left";if(r&&o){var a,c,u=r.offsetParent?{width:r.offsetWidth,height:r.offsetHeight}:this.getHiddenElementDimensions(r),p=u.height,g=u.width,v=o.offsetHeight,b=o.offsetWidth,k=o.getBoundingClientRect(),E=this.getWindowScrollTop(),w=this.getWindowScrollLeft(),x=this.getViewport();k.top+v+p>x.height?((a=k.top+E-p)<0&&(a=E),r.style.transformOrigin="bottom"):(a=v+k.top+E,r.style.transformOrigin="top");var C=k.left;c="left"===i?C+g>x.width?Math.max(0,C+w+b-g):C+w:C+b-g<0?w:C+b-g+w,r.style.top=a+"px",r.style.left=c+"px"}}},{key:"relativePosition",value:function relativePosition(r,o){if(r&&o){var i,a,c=r.offsetParent?{width:r.offsetWidth,height:r.offsetHeight}:this.getHiddenElementDimensions(r),u=o.offsetHeight,p=o.getBoundingClientRect(),g=this.getViewport();p.top+u+c.height>g.height?(i=-1*c.height,p.top+i<0&&(i=-1*p.top),r.style.transformOrigin="bottom"):(i=u,r.style.transformOrigin="top"),a=c.width>g.width?-1*p.left:p.left+c.width>g.width?-1*(p.left+c.width-g.width):0,r.style.top=i+"px",r.style.left=a+"px"}}},{key:"flipfitCollision",value:function flipfitCollision(r,o){var i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left top",c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left bottom",u=arguments.length>4?arguments[4]:void 0;if(r&&o){var p=o.getBoundingClientRect(),g=this.getViewport(),v=a.split(" "),b=c.split(" "),k=function getPositionValue(r,o){return o?+r.substring(r.search(/(\+|-)/g))||0:r.substring(0,r.search(/(\+|-)/g))||r},E={my:{x:k(v[0]),y:k(v[1]||v[0]),offsetX:k(v[0],!0),offsetY:k(v[1]||v[0],!0)},at:{x:k(b[0]),y:k(b[1]||b[0]),offsetX:k(b[0],!0),offsetY:k(b[1]||b[0],!0)}},w={left:function left(){return E.my.offsetX+E.at.offsetX+p.left+("left"===E.my.x?0:-1*("center"===E.my.x?i.getOuterWidth(r)/2:i.getOuterWidth(r)))},top:function top(){return E.my.offsetY+E.at.offsetY+p.top+("top"===E.my.y?0:-1*("center"===E.my.y?i.getOuterHeight(r)/2:i.getOuterHeight(r)))}},x={count:{x:0,y:0},left:function left(){var left=w.left(),o=DomHandler.getWindowScrollLeft();r.style.left=left+o+"px",2===this.count.x?(r.style.left=o+"px",this.count.x=0):left<0&&(this.count.x++,E.my.x="left",E.at.x="right",E.my.offsetX*=-1,E.at.offsetX*=-1,this.right())},right:function right(){var i=w.left()+DomHandler.getOuterWidth(o),a=DomHandler.getWindowScrollLeft();r.style.left=i+a+"px",2===this.count.x?(r.style.left=g.width-DomHandler.getOuterWidth(r)+a+"px",this.count.x=0):i+DomHandler.getOuterWidth(r)>g.width&&(this.count.x++,E.my.x="right",E.at.x="left",E.my.offsetX*=-1,E.at.offsetX*=-1,this.left())},top:function top(){var top=w.top(),o=DomHandler.getWindowScrollTop();r.style.top=top+o+"px",2===this.count.y?(r.style.left=o+"px",this.count.y=0):top<0&&(this.count.y++,E.my.y="top",E.at.y="bottom",E.my.offsetY*=-1,E.at.offsetY*=-1,this.bottom())},bottom:function bottom(){var i=w.top()+DomHandler.getOuterHeight(o),a=DomHandler.getWindowScrollTop();r.style.top=i+a+"px",2===this.count.y?(r.style.left=g.height-DomHandler.getOuterHeight(r)+a+"px",this.count.y=0):i+DomHandler.getOuterHeight(o)>g.height&&(this.count.y++,E.my.y="bottom",E.at.y="top",E.my.offsetY*=-1,E.at.offsetY*=-1,this.top())},center:function center(i){if("y"===i){var a=w.top()+DomHandler.getOuterHeight(o)/2;r.style.top=a+DomHandler.getWindowScrollTop()+"px",a<0?this.bottom():a+DomHandler.getOuterHeight(o)>g.height&&this.top()}else{var c=w.left()+DomHandler.getOuterWidth(o)/2;r.style.left=c+DomHandler.getWindowScrollLeft()+"px",c<0?this.left():c+DomHandler.getOuterWidth(r)>g.width&&this.right()}}};x[E.at.x]("x"),x[E.at.y]("y"),this.isFunction(u)&&u(E)}}},{key:"findCollisionPosition",value:function findCollisionPosition(r){if(r){var o="left"===r?"right":"left";return"top"===r||"bottom"===r?{axis:"y",my:"center ".concat("top"===r?"bottom":"top"),at:"center ".concat(r)}:{axis:"x",my:"".concat(o," center"),at:"".concat(r," center")}}}},{key:"getParents",value:function getParents(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===r.parentNode?o:this.getParents(r.parentNode,o.concat([r.parentNode]))}},{key:"getScrollableParents",value:function getScrollableParents(r){var o=this,i=[];if(r){var a,c=this.getParents(r),u=/(auto|scroll)/,p=function overflowCheck(r){var o=r?getComputedStyle(r):null;return o&&(u.test(o.getPropertyValue("overflow"))||u.test(o.getPropertyValue("overflow-x"))||u.test(o.getPropertyValue("overflow-y")))},g=function addScrollableParent(r){i.push("BODY"===r.nodeName||"HTML"===r.nodeName||o.isDocument(r)?window:r)},v=_createForOfIteratorHelper$1(c);try{for(v.s();!(a=v.n()).done;){var b,k=a.value,E=1===k.nodeType&&(null===(b=k.dataset)||void 0===b?void 0:b.scrollselectors);if(E){var w,x=_createForOfIteratorHelper$1(E.split(","));try{for(x.s();!(w=x.n()).done;){var C=w.value,_=this.findSingle(k,C);_&&p(_)&&g(_)}}catch(r){x.e(r)}finally{x.f()}}1===k.nodeType&&p(k)&&g(k)}}catch(r){v.e(r)}finally{v.f()}}return i}},{key:"getHiddenElementOuterHeight",value:function getHiddenElementOuterHeight(r){if(r){r.style.visibility="hidden",r.style.display="block";var o=r.offsetHeight;return r.style.display="none",r.style.visibility="visible",o}return 0}},{key:"getHiddenElementOuterWidth",value:function getHiddenElementOuterWidth(r){if(r){r.style.visibility="hidden",r.style.display="block";var o=r.offsetWidth;return r.style.display="none",r.style.visibility="visible",o}return 0}},{key:"getHiddenElementDimensions",value:function getHiddenElementDimensions(r){var o={};return r&&(r.style.visibility="hidden",r.style.display="block",o.width=r.offsetWidth,o.height=r.offsetHeight,r.style.display="none",r.style.visibility="visible"),o}},{key:"fadeIn",value:function fadeIn(r,o){if(r){r.style.opacity=0;var i=+new Date,a=0,c=function tick(){a=+r.style.opacity+((new Date).getTime()-i)/o,r.style.opacity=a,i=+new Date,+a<1&&(window.requestAnimationFrame&&requestAnimationFrame(c)||setTimeout(c,16))};c()}}},{key:"fadeOut",value:function fadeOut(r,o){if(r)var i=1,a=50/o,c=setInterval(function(){(i-=a)<=0&&(i=0,clearInterval(c)),r.style.opacity=i},50)}},{key:"getUserAgent",value:function getUserAgent(){return navigator.userAgent}},{key:"isIOS",value:function isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function isAndroid(){return/(android)/i.test(navigator.userAgent)}},{key:"isChrome",value:function isChrome(){return/(chrome)/i.test(navigator.userAgent)}},{key:"isClient",value:function isClient(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"isTouchDevice",value:function isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function isFunction(r){return!!(r&&r.constructor&&r.call&&r.apply)}},{key:"appendChild",value:function appendChild(r,o){if(this.isElement(o))o.appendChild(r);else{if(!o.el||!o.el.nativeElement)throw new Error("Cannot append "+o+" to "+r);o.el.nativeElement.appendChild(r)}}},{key:"removeChild",value:function removeChild(r,o){if(this.isElement(o))o.removeChild(r);else{if(!o.el||!o.el.nativeElement)throw new Error("Cannot remove "+r+" from "+o);o.el.nativeElement.removeChild(r)}}},{key:"isElement",value:function isElement(r){return"object"===("undefined"==typeof HTMLElement?"undefined":_typeof(HTMLElement))?r instanceof HTMLElement:r&&"object"===_typeof(r)&&null!==r&&1===r.nodeType&&"string"==typeof r.nodeName}},{key:"isDocument",value:function isDocument(r){return"object"===("undefined"==typeof Document?"undefined":_typeof(Document))?r instanceof Document:r&&"object"===_typeof(r)&&null!==r&&9===r.nodeType}},{key:"scrollInView",value:function scrollInView(r,o){var i=getComputedStyle(r).getPropertyValue("border-top-width"),a=i?parseFloat(i):0,c=getComputedStyle(r).getPropertyValue("padding-top"),u=c?parseFloat(c):0,p=r.getBoundingClientRect(),g=o.getBoundingClientRect().top+document.body.scrollTop-(p.top+document.body.scrollTop)-a-u,v=r.scrollTop,b=r.clientHeight,k=this.getOuterHeight(o);g<0?r.scrollTop=v+g:g+k>b&&(r.scrollTop=v+g-b+k)}},{key:"clearSelection",value:function clearSelection(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(r){}}},{key:"calculateScrollbarWidth",value:function calculateScrollbarWidth(r){if(r){var o=getComputedStyle(r);return r.offsetWidth-r.clientWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.borderRightWidth)}if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var i=document.createElement("div");i.className="p-scrollbar-measure",document.body.appendChild(i);var a=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),this.calculatedScrollbarWidth=a,a}},{key:"calculateBodyScrollbarWidth",value:function calculateBodyScrollbarWidth(){return window.innerWidth-document.documentElement.offsetWidth}},{key:"getBrowser",value:function getBrowser(){if(!this.browser){var r=this.resolveUserAgent();this.browser={},r.browser&&(this.browser[r.browser]=!0,this.browser.version=r.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function resolveUserAgent(){var r=navigator.userAgent.toLowerCase(),o=/(chrome)[ ]([\w.]+)/.exec(r)||/(webkit)[ ]([\w.]+)/.exec(r)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(r)||/(msie) ([\w.]+)/.exec(r)||r.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(r)||[];return{browser:o[1]||"",version:o[2]||"0"}}},{key:"blockBodyScroll",value:function blockBodyScroll(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";!!!document.body.style.getPropertyValue("--scrollbar-width")&&document.body.style.setProperty("--scrollbar-width",this.calculateBodyScrollbarWidth()+"px"),this.addClass(document.body,r)}},{key:"unblockBodyScroll",value:function unblockBodyScroll(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,r)}},{key:"isVisible",value:function isVisible(r){return r&&(0!==r.clientHeight||0!==r.getClientRects().length||"none"!==getComputedStyle(r).display)}},{key:"isExist",value:function isExist(r){return!(null==r||!r.nodeName||!r.parentNode)}},{key:"getFocusableElements",value:function getFocusableElements(r){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=[],c=_createForOfIteratorHelper$1(DomHandler.find(r,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(i,',\n [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i)));try{for(c.s();!(o=c.n()).done;){var u=o.value;"none"!==getComputedStyle(u).display&&"hidden"!==getComputedStyle(u).visibility&&a.push(u)}}catch(r){c.e(r)}finally{c.f()}return a}},{key:"getFirstFocusableElement",value:function getFirstFocusableElement(r,o){var i=DomHandler.getFocusableElements(r,o);return i.length>0?i[0]:null}},{key:"getLastFocusableElement",value:function getLastFocusableElement(r,o){var i=DomHandler.getFocusableElements(r,o);return i.length>0?i[i.length-1]:null}},{key:"focus",value:function focus(r,o){var i=void 0===o||!o;r&&document.activeElement!==r&&r.focus({preventScroll:i})}},{key:"focusFirstElement",value:function focusFirstElement(r,o){if(r){var i=DomHandler.getFirstFocusableElement(r);return i&&DomHandler.focus(i,o),i}}},{key:"getCursorOffset",value:function getCursorOffset(r,o,i,a){if(r){var c=getComputedStyle(r),u=document.createElement("div");u.style.position="absolute",u.style.top="0px",u.style.left="0px",u.style.visibility="hidden",u.style.pointerEvents="none",u.style.overflow=c.overflow,u.style.width=c.width,u.style.height=c.height,u.style.padding=c.padding,u.style.border=c.border,u.style.overflowWrap=c.overflowWrap,u.style.whiteSpace=c.whiteSpace,u.style.lineHeight=c.lineHeight,u.innerHTML=o.replace(/\r\n|\r|\n/g,"<br />");var p=document.createElement("span");p.textContent=a,u.appendChild(p);var g=document.createTextNode(i);u.appendChild(g),document.body.appendChild(u);var v=p.offsetLeft,b=p.offsetTop,k=p.clientHeight;return document.body.removeChild(u),{left:Math.abs(v-r.scrollLeft),top:Math.abs(b-r.scrollTop)+k}}return{top:"auto",left:"auto"}}},{key:"invokeElementMethod",value:function invokeElementMethod(r,o,i){r[o].apply(r,i)}},{key:"isClickable",value:function isClickable(r){var o=r.nodeName,i=r.parentElement&&r.parentElement.nodeName;return"INPUT"===o||"TEXTAREA"===o||"BUTTON"===o||"A"===o||"INPUT"===i||"TEXTAREA"===i||"BUTTON"===i||"A"===i||this.hasClass(r,"p-button")||this.hasClass(r.parentElement,"p-button")||this.hasClass(r.parentElement,"p-checkbox")||this.hasClass(r.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function applyStyle(r,o){if("string"==typeof o)r.style.cssText=o;else for(var i in o)r.style[i]=o[i]}},{key:"exportCSV",value:function exportCSV(r,o){var i=new Blob([r],{type:"application/csv;charset=utf-8;"});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(i,o+".csv"):DomHandler.saveAs({name:o+".csv",src:URL.createObjectURL(i)})||(r="data:text/csv;charset=utf-8,"+r,window.open(encodeURI(r)))}},{key:"saveAs",value:function saveAs(r){if(r){var o=document.createElement("a");if(void 0!==o.download){var i=r.name,a=r.src;return o.setAttribute("href",a),o.setAttribute("download",i),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),!0}}return!1}},{key:"createInlineStyle",value:function createInlineStyle(r,o){var i=document.createElement("style");return DomHandler.addNonce(i,r),o||(o=document.head),o.appendChild(i),i}},{key:"removeInlineStyle",value:function removeInlineStyle(r){if(this.isExist(r)){try{r.parentNode.removeChild(r)}catch(r){}r=null}return r}},{key:"addNonce",value:function addNonce(r,o){try{o||(o=process.env.REACT_APP_CSS_NONCE)}catch(r){}o&&r.setAttribute("nonce",o)}},{key:"getTargetElement",value:function getTargetElement(r){if(!r)return null;if("document"===r)return document;if("window"===r)return window;if("object"===_typeof(r)&&r.hasOwnProperty("current"))return this.isExist(r.current)?r.current:null;var o=function isFunction(r){return!!(r&&r.constructor&&r.call&&r.apply)}(r)?r():r;return this.isDocument(o)||this.isExist(o)?o:null}},{key:"getAttributeNames",value:function getAttributeNames(r){var o,i,a;for(i=[],a=r.attributes,o=0;o<a.length;++o)i.push(a[o].nodeName);return i.sort(),i}},{key:"isEqualElement",value:function isEqualElement(r,o){var i,a,c,u,p;if(i=DomHandler.getAttributeNames(r),a=DomHandler.getAttributeNames(o),i.join(",")!==a.join(","))return!1;for(var g=0;g<i.length;++g)if("style"===(c=i[g]))for(var v=r.style,b=o.style,k=/^\d+$/,E=0,w=Object.keys(v);E<w.length;E++){var x=w[E];if(!k.test(x)&&v[x]!==b[x])return!1}else if(r.getAttribute(c)!==o.getAttribute(c))return!1;for(u=r.firstChild,p=o.firstChild;u&&p;u=u.nextSibling,p=p.nextSibling){if(u.nodeType!==p.nodeType)return!1;if(1===u.nodeType){if(!DomHandler.isEqualElement(u,p))return!1}else if(u.nodeValue!==p.nodeValue)return!1}return!u&&!p}},{key:"hasCSSAnimation",value:function hasCSSAnimation(r){if(r){var o=getComputedStyle(r);return parseFloat(o.getPropertyValue("animation-duration")||"0")>0}return!1}},{key:"hasCSSTransition",value:function hasCSSTransition(r){if(r){var o=getComputedStyle(r);return parseFloat(o.getPropertyValue("transition-duration")||"0")>0}return!1}}])}();function _createForOfIteratorHelper(r,o){var i="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function _unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return _arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(r,o):void 0}}(r))||o&&r&&"number"==typeof r.length){i&&(r=i);var a=0,c=function F(){};return{s:c,n:function n(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function e(r){throw r},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,p=!0,g=!1;return{s:function s(){i=i.call(r)},n:function n(){var r=i.next();return p=r.done,r},e:function e(r){g=!0,u=r},f:function f(){try{p||null==i.return||i.return()}finally{if(g)throw u}}}}function _arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}_defineProperty(u,"DATA_PROPS",["data-"]),_defineProperty(u,"ARIA_PROPS",["aria","focus-target"]);var p=function(){function ObjectUtils(){_classCallCheck(this,ObjectUtils)}return _createClass(ObjectUtils,null,[{key:"equals",value:function equals(r,o,i){return i&&r&&"object"===_typeof(r)&&o&&"object"===_typeof(o)?this.deepEquals(this.resolveFieldData(r,i),this.resolveFieldData(o,i)):this.deepEquals(r,o)}},{key:"deepEquals",value:function deepEquals(r,o){if(r===o)return!0;if(r&&o&&"object"===_typeof(r)&&"object"===_typeof(o)){var i,a,c,u=Array.isArray(r),p=Array.isArray(o);if(u&&p){if((a=r.length)!==o.length)return!1;for(i=a;0!==i--;)if(!this.deepEquals(r[i],o[i]))return!1;return!0}if(u!==p)return!1;var g=r instanceof Date,v=o instanceof Date;if(g!==v)return!1;if(g&&v)return r.getTime()===o.getTime();var b=r instanceof RegExp,k=o instanceof RegExp;if(b!==k)return!1;if(b&&k)return r.toString()===o.toString();var E=Object.keys(r);if((a=E.length)!==Object.keys(o).length)return!1;for(i=a;0!==i--;)if(!Object.prototype.hasOwnProperty.call(o,E[i]))return!1;for(i=a;0!==i--;)if(c=E[i],!this.deepEquals(r[c],o[c]))return!1;return!0}return r!=r&&o!=o}},{key:"resolveFieldData",value:function resolveFieldData(r,o){if(!r||!o)return null;try{var i=r[o];if(this.isNotEmpty(i))return i}catch(r){}if(Object.keys(r).length){if(this.isFunction(o))return o(r);if(this.isNotEmpty(r[o]))return r[o];if(-1===o.indexOf("."))return r[o];for(var a=o.split("."),c=r,u=0,p=a.length;u<p;++u){if(null==c)return null;c=c[a[u]]}return c}return null}},{key:"findDiffKeys",value:function findDiffKeys(r,o){return r&&o?Object.keys(r).filter(function(r){return!o.hasOwnProperty(r)}).reduce(function(o,i){return o[i]=r[i],o},{}):{}}},{key:"reduceKeys",value:function reduceKeys(r,o){var i={};return r&&o&&0!==o.length?(Object.keys(r).filter(function(r){return o.some(function(o){return r.startsWith(o)})}).forEach(function(o){i[o]=r[o],delete r[o]}),i):i}},{key:"reorderArray",value:function reorderArray(r,o,i){r&&o!==i&&(i>=r.length&&(i%=r.length,o%=r.length),r.splice(i,0,r.splice(o,1)[0]))}},{key:"findIndexInList",value:function findIndexInList(r,o,i){var a=this;return o?i?o.findIndex(function(o){return a.equals(o,r,i)}):o.findIndex(function(o){return o===r}):-1}},{key:"getJSXElement",value:function getJSXElement(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return this.isFunction(r)?r.apply(void 0,i):r}},{key:"getItemValue",value:function getItemValue(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return this.isFunction(r)?r.apply(void 0,i):r}},{key:"getProp",value:function getProp(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r?r[o]:void 0;return void 0===a?i[o]:a}},{key:"getPropCaseInsensitive",value:function getPropCaseInsensitive(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=this.toFlatCase(o);for(var c in r)if(r.hasOwnProperty(c)&&this.toFlatCase(c)===a)return r[c];for(var u in i)if(i.hasOwnProperty(u)&&this.toFlatCase(u)===a)return i[u]}},{key:"getMergedProps",value:function getMergedProps(r,o){return Object.assign({},o,r)}},{key:"getDiffProps",value:function getDiffProps(r,o){return this.findDiffKeys(r,o)}},{key:"getPropValue",value:function getPropValue(r){if(!this.isFunction(r))return r;for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];if(1===i.length){var c=i[0];return r(Array.isArray(c)?c[0]:c)}return r.apply(void 0,i)}},{key:"getComponentProp",value:function getComponentProp(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.isNotEmpty(r)?this.getProp(r.props,o,i):void 0}},{key:"getComponentProps",value:function getComponentProps(r,o){return this.isNotEmpty(r)?this.getMergedProps(r.props,o):void 0}},{key:"getComponentDiffProps",value:function getComponentDiffProps(r,o){return this.isNotEmpty(r)?this.getDiffProps(r.props,o):void 0}},{key:"isValidChild",value:function isValidChild(r,o,i){if(r){var a,c=this.getComponentProp(r,"__TYPE")||(r.type?r.type.displayName:void 0);!c&&null!=r&&null!==(a=r.type)&&void 0!==a&&null!==(a=a._payload)&&void 0!==a&&a.value&&(c=r.type._payload.value.find(function(r){return r===o}));var u=c===o;try{0}catch(r){}return u}return!1}},{key:"getRefElement",value:function getRefElement(r){return r?"object"===_typeof(r)&&r.hasOwnProperty("current")?r.current:r:null}},{key:"combinedRefs",value:function combinedRefs(r,o){r&&o&&("function"==typeof o?o(r.current):o.current=r.current)}},{key:"removeAccents",value:function removeAccents(r){return r&&r.search(/[\xC0-\xFF]/g)>-1&&(r=r.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),r}},{key:"toFlatCase",value:function toFlatCase(r){return this.isNotEmpty(r)&&this.isString(r)?r.replace(/(-|_)/g,"").toLowerCase():r}},{key:"toCapitalCase",value:function toCapitalCase(r){return this.isNotEmpty(r)&&this.isString(r)?r[0].toUpperCase()+r.slice(1):r}},{key:"trim",value:function trim(r){return this.isNotEmpty(r)&&this.isString(r)?r.trim():r}},{key:"isEmpty",value:function isEmpty(r){return null==r||""===r||Array.isArray(r)&&0===r.length||!(r instanceof Date)&&"object"===_typeof(r)&&0===Object.keys(r).length}},{key:"isNotEmpty",value:function isNotEmpty(r){return!this.isEmpty(r)}},{key:"isFunction",value:function isFunction(r){return!!(r&&r.constructor&&r.call&&r.apply)}},{key:"isObject",value:function isObject(r){return null!==r&&r instanceof Object&&r.constructor===Object}},{key:"isDate",value:function isDate(r){return null!==r&&r instanceof Date&&r.constructor===Date}},{key:"isArray",value:function isArray(r){return null!==r&&Array.isArray(r)}},{key:"isString",value:function isString(r){return null!==r&&"string"==typeof r}},{key:"isPrintableCharacter",value:function isPrintableCharacter(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.isNotEmpty(r)&&1===r.length&&r.match(/\S| /)}},{key:"isLetter",value:function isLetter(r){return/^[a-zA-Z\u00C0-\u017F]$/.test(r)}},{key:"isScalar",value:function isScalar(r){return null!=r&&("string"==typeof r||"number"==typeof r||"bigint"==typeof r||"boolean"==typeof r)}},{key:"findLast",value:function findLast(r,o){var i;if(this.isNotEmpty(r))try{i=r.findLast(o)}catch(a){i=_toConsumableArray(r).reverse().find(o)}return i}},{key:"findLastIndex",value:function findLastIndex(r,o){var i=-1;if(this.isNotEmpty(r))try{i=r.findLastIndex(o)}catch(a){i=r.lastIndexOf(_toConsumableArray(r).reverse().find(o))}return i}},{key:"sort",value:function sort(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=this.compare(r,o,a,i),p=i;return(this.isEmpty(r)||this.isEmpty(o))&&(p=1===c?i:c),p*u}},{key:"compare",value:function compare(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,c=this.isEmpty(r),u=this.isEmpty(o);return c&&u?0:c?a:u?-a:"string"==typeof r&&"string"==typeof o?i(r,o):r<o?-1:r>o?1:0}},{key:"localeComparator",value:function localeComparator(r){return new Intl.Collator(r,{numeric:!0}).compare}},{key:"findChildrenByKey",value:function findChildrenByKey(r,o){var i,a=_createForOfIteratorHelper(r);try{for(a.s();!(i=a.n()).done;){var c=i.value;if(c.key===o)return c.children||[];if(c.children){var u=this.findChildrenByKey(c.children,o);if(u.length>0)return u}}}catch(r){a.e(r)}finally{a.f()}return[]}},{key:"mutateFieldData",value:function mutateFieldData(r,o,i){if("object"===_typeof(r)&&"string"==typeof o)for(var a=o.split("."),c=r,u=0,p=a.length;u<p;++u){if(u+1-p===0){c[a[u]]=i;break}c[a[u]]||(c[a[u]]={}),c=c[a[u]]}}},{key:"getNestedValue",value:function getNestedValue(r,o){return o.split(".").reduce(function(r,o){return r&&void 0!==r[o]?r[o]:void 0},r)}},{key:"absoluteCompare",value:function absoluteCompare(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!r||!o)return!0;if(a>i)return!0;if(_typeof(r)!==_typeof(o))return!1;var c=Object.keys(r),u=Object.keys(o);if(c.length!==u.length)return!1;for(var p=0,g=c;p<g.length;p++){var v=g[p],b=r[v],k=o[v],E=ObjectUtils.isObject(b)&&ObjectUtils.isObject(k),w=ObjectUtils.isFunction(b)&&ObjectUtils.isFunction(k);if((E||w)&&!this.absoluteCompare(b,k,i,a+1))return!1;if(!E&&b!==k)return!1}return!0}},{key:"selectiveCompare",value:function selectiveCompare(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(r===o)return!0;if(!r||!o||"object"!==_typeof(r)||"object"!==_typeof(o))return!1;if(!i)return this.absoluteCompare(r,o,1);var c,u=_createForOfIteratorHelper(i);try{for(u.s();!(c=u.n()).done;){var p=c.value,g=this.getNestedValue(r,p),v=this.getNestedValue(o,p),b="object"===_typeof(g)&&null!==g&&"object"===_typeof(v)&&null!==v;if(b&&!this.absoluteCompare(g,v,a))return!1;if(!b&&g!==v)return!1}}catch(r){u.e(r)}finally{u.f()}return!0}}])}(),g=0;function UniqueComponentId(){return g++,"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pr_id_").concat(g)}function ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function _objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(i),!0).forEach(function(o){_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}function mergeProps(r){if(r){var o=function isFunction(r){return"function"==typeof r},i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).classNameMergeFunction,a=o(i);return r.reduce(function(r,c){if(!c)return r;var u=function _loop(){var u=c[p];if("style"===p)r.style=_objectSpread(_objectSpread({},r.style),c.style);else if("className"===p){var g="";g=a?i(r.className,c.className):[r.className,c.className].join(" ").trim(),r.className=g||void 0}else if(o(u)){var v=r[p];r[p]=v?function(){v.apply(void 0,arguments),u.apply(void 0,arguments)}:u}else r[p]=u};for(var p in c)u();return r},{})}}var v=function handler(){var r=[],o=function getLastZIndex(o,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _toConsumableArray(r).reverse().find(function(r){return!!i||r.key===o})||{key:o,value:a}};return{get:function getZIndex(r){return r&&parseInt(r.style.zIndex,10)||0},set:function set(i,a,c,u){a&&(a.style.zIndex=String(function generateZIndex(i,a){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,u=o(i,a,c),p=u.value+(u.key===i?0:c)+1;return r.push({key:i,value:p}),p}(i,c,u)))},clear:function clear(o){o&&(!function revertZIndex(o){r=r.filter(function(r){return r.value!==o})}(v.get(o)),o.style.zIndex="")},getCurrent:function getCurrent(r,i){return function getCurrentZIndex(r,i){return o(r,i).value}(r,i)}}}(),b=Object.freeze({STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",NOT_IN:"notIn",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter",CUSTOM:"custom"});Object.freeze({AND:"and",OR:"or"});function api_esm_typeof(r){return api_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},api_esm_typeof(r)}function api_esm_toPropertyKey(r){var o=function api_esm_toPrimitive(r,o){if("object"!=api_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=api_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==api_esm_typeof(o)?o:o+""}function api_esm_defineProperty(r,o,i){return(o=api_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function api_esm_defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,api_esm_toPropertyKey(a.key),a)}}function api_esm_createClass(r,o,i){return o&&api_esm_defineProperties(r.prototype,o),i&&api_esm_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}var k=api_esm_createClass(function PrimeReact(){!function api_esm_classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}(this,PrimeReact)});api_esm_defineProperty(k,"ripple",!1),api_esm_defineProperty(k,"inputStyle","outlined"),api_esm_defineProperty(k,"locale","en"),api_esm_defineProperty(k,"appendTo",null),api_esm_defineProperty(k,"cssTransition",!0),api_esm_defineProperty(k,"autoZIndex",!0),api_esm_defineProperty(k,"hideOverlaysOnDocumentScrolling",!1),api_esm_defineProperty(k,"nonce",null),api_esm_defineProperty(k,"nullSortOrder",1),api_esm_defineProperty(k,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200}),api_esm_defineProperty(k,"pt",void 0),api_esm_defineProperty(k,"filterMatchModeOptions",{text:[b.STARTS_WITH,b.CONTAINS,b.NOT_CONTAINS,b.ENDS_WITH,b.EQUALS,b.NOT_EQUALS],numeric:[b.EQUALS,b.NOT_EQUALS,b.LESS_THAN,b.LESS_THAN_OR_EQUAL_TO,b.GREATER_THAN,b.GREATER_THAN_OR_EQUAL_TO],date:[b.DATE_IS,b.DATE_IS_NOT,b.DATE_BEFORE,b.DATE_AFTER]}),api_esm_defineProperty(k,"changeTheme",function(r,o,i,a){var c,u=document.getElementById(i);if(!u)throw Error("Element with id ".concat(i," not found."));var p=u.getAttribute("href").replace(r,o),g=document.createElement("link");g.setAttribute("rel","stylesheet"),g.setAttribute("id",i),g.setAttribute("href",p),g.addEventListener("load",function(){a&&a()}),null===(c=u.parentNode)||void 0===c||c.replaceChild(g,u)});Object.freeze({SUCCESS:"success",INFO:"info",WARN:"warn",ERROR:"error",SECONDARY:"secondary",CONTRAST:"contrast"}),Object.freeze({ADDRESS_BOOK:"pi pi-address-book",ALIGN_CENTER:"pi pi-align-center",ALIGN_JUSTIFY:"pi pi-align-justify",ALIGN_LEFT:"pi pi-align-left",ALIGN_RIGHT:"pi pi-align-right",AMAZON:"pi pi-amazon",ANDROID:"pi pi-android",ANGLE_DOUBLE_DOWN:"pi pi-angle-double-down",ANGLE_DOUBLE_LEFT:"pi pi-angle-double-left",ANGLE_DOUBLE_RIGHT:"pi pi-angle-double-right",ANGLE_DOUBLE_UP:"pi pi-angle-double-up",ANGLE_DOWN:"pi pi-angle-down",ANGLE_LEFT:"pi pi-angle-left",ANGLE_RIGHT:"pi pi-angle-right",ANGLE_UP:"pi pi-angle-up",APPLE:"pi pi-apple",ARROW_CIRCLE_DOWN:"pi pi-arrow-circle-down",ARROW_CIRCLE_LEFT:"pi pi-arrow-circle-left",ARROW_CIRCLE_RIGHT:"pi pi-arrow-circle-right",ARROW_CIRCLE_UP:"pi pi-arrow-circle-up",ARROW_DOWN_LEFT_AND_ARROW_UP_RIGHT_TO_CENTER:"pi pi-arrow-down-left-and-arrow-up-right-to-center",ARROW_DOWN_LEFT:"pi pi-arrow-down-left",ARROW_DOWN_RIGHT:"pi pi-arrow-down-right",ARROW_DOWN:"pi pi-arrow-down",ARROW_LEFT:"pi pi-arrow-left",ARROW_RIGHT_ARROW_LEFT:"pi pi-arrow-right-arrow-left",ARROW_RIGHT:"pi pi-arrow-right",ARROW_UP_LEFT:"pi pi-arrow-up-left",ARROW_UP_RIGHT_AND_ARROW_DOWN_LEFT_FROM_CENTER:"pi pi-arrow-up-right-and-arrow-down-left-from-center",ARROW_UP_RIGHT:"pi pi-arrow-up-right",ARROW_UP:"pi pi-arrow-up",ARROWS_ALT:"pi pi-arrows-alt",ARROWS_H:"pi pi-arrows-h",ARROWS_V:"pi pi-arrows-v",ASTERISK:"pi pi-asterisk",AT:"pi pi-at",BACKWARD:"pi pi-backward",BAN:"pi pi-ban",BARCODE:"pi pi-barcode",BARS:"pi pi-bars",BELL_SLASH:"pi pi-bell-slash",BELL:"pi pi-bell",BITCOIN:"pi pi-bitcoin",BOLT:"pi pi-bolt",BOOK:"pi pi-book",BOOKMARK_FILL:"pi pi-bookmark-fill",BOOKMARK:"pi pi-bookmark",BOX:"pi pi-box",BRIEFCASE:"pi pi-briefcase",BUILDING_COLUMNS:"pi pi-building-columns",BUILDING:"pi pi-building",BULLSEYE:"pi pi-bullseye",CALCULATOR:"pi pi-calculator",CALENDAR_CLOCK:"pi pi-calendar-clock",CALENDAR_MINUS:"pi pi-calendar-minus",CALENDAR_PLUS:"pi pi-calendar-plus",CALENDAR_TIMES:"pi pi-calendar-times",CALENDAR:"pi pi-calendar",CAMERA:"pi pi-camera",CAR:"pi pi-car",CARET_DOWN:"pi pi-caret-down",CARET_LEFT:"pi pi-caret-left",CARET_RIGHT:"pi pi-caret-right",CARET_UP:"pi pi-caret-up",CART_ARROW_DOWN:"pi pi-cart-arrow-down",CART_MINUS:"pi pi-cart-minus",CART_PLUS:"pi pi-cart-plus",CHART_BAR:"pi pi-chart-bar",CHART_LINE:"pi pi-chart-line",CHART_PIE:"pi pi-chart-pie",CHART_SCATTER:"pi pi-chart-scatter",CHECK_CIRCLE:"pi pi-check-circle",CHECK_SQUARE:"pi pi-check-square",CHECK:"pi pi-check",CHEVRON_CIRCLE_DOWN:"pi pi-chevron-circle-down",CHEVRON_CIRCLE_LEFT:"pi pi-chevron-circle-left",CHEVRON_CIRCLE_RIGHT:"pi pi-chevron-circle-right",CHEVRON_CIRCLE_UP:"pi pi-chevron-circle-up",CHEVRON_DOWN:"pi pi-chevron-down",CHEVRON_LEFT:"pi pi-chevron-left",CHEVRON_RIGHT:"pi pi-chevron-right",CHEVRON_UP:"pi pi-chevron-up",CIRCLE_FILL:"pi pi-circle-fill",CIRCLE_OFF:"pi pi-circle-off",CIRCLE_ON:"pi pi-circle-on",CIRCLE:"pi pi-circle",CLIPBOARD:"pi pi-clipboard",CLOCK:"pi pi-clock",CLONE:"pi pi-clone",CLOUD_DOWNLOAD:"pi pi-cloud-download",CLOUD_UPLOAD:"pi pi-cloud-upload",CLOUD:"pi pi-cloud",CODE:"pi pi-code",COG:"pi pi-cog",COMMENT:"pi pi-comment",COMMENTS:"pi pi-comments",COMPASS:"pi pi-compass",COPY:"pi pi-copy",CREDIT_CARD:"pi pi-credit-card",CROWN:"pi pi-crown",DATABASE:"pi pi-database",DELETE_LEFT:"pi pi-delete-left",DESKTOP:"pi pi-desktop",DIRECTIONS_ALT:"pi pi-directions-alt",DIRECTIONS:"pi pi-directions",DISCORD:"pi pi-discord",DOLLAR:"pi pi-dollar",DOWNLOAD:"pi pi-download",EJECT:"pi pi-eject",ELLIPSIS_H:"pi pi-ellipsis-h",ELLIPSIS_V:"pi pi-ellipsis-v",ENVELOPE:"pi pi-envelope",EQUALS:"pi pi-equals",ERASER:"pi pi-eraser",ETHEREUM:"pi pi-ethereum",EURO:"pi pi-euro",EXCLAMATION_CIRCLE:"pi pi-exclamation-circle",EXCLAMATION_TRIANGLE:"pi pi-exclamation-triangle",EXPAND:"pi pi-expand",EXTERNAL_LINK:"pi pi-external-link",EYE_SLASH:"pi pi-eye-slash",EYE:"pi pi-eye",FACE_SMILE:"pi pi-face-smile",FACEBOOK:"pi pi-facebook",FAST_BACKWARD:"pi pi-fast-backward",FAST_FORWARD:"pi pi-fast-forward",FILE_ARROW_UP:"pi pi-file-arrow-up",FILE_CHECK:"pi pi-file-check",FILE_EDIT:"pi pi-file-edit",FILE_EXCEL:"pi pi-file-excel",FILE_EXPORT:"pi pi-file-export",FILE_IMPORT:"pi pi-file-import",FILE_O:"pi pi-file-o",FILE_PDF:"pi pi-file-pdf",FILE_PLUS:"pi pi-file-plus",FILE_WORD:"pi pi-file-word",FILE:"pi pi-file",FILTER_FILL:"pi pi-filter-fill",FILTER_SLASH:"pi pi-filter-slash",FILTER:"pi pi-filter",FLAG_FILL:"pi pi-flag-fill",FLAG:"pi pi-flag",FOLDER_OPEN:"pi pi-folder-open",FOLDER_PLUS:"pi pi-folder-plus",FOLDER:"pi pi-folder",FORWARD:"pi pi-forward",GAUGE:"pi pi-gauge",GIFT:"pi pi-gift",GITHUB:"pi pi-github",GLOBE:"pi pi-globe",GOOGLE:"pi pi-google",GRADUATION_CAP:"pi pi-graduation-cap",HAMMER:"pi pi-hammer",HASHTAG:"pi pi-hashtag",HEADPHONES:"pi pi-headphones",HEART_FILL:"pi pi-heart-fill",HEART:"pi pi-heart",HISTORY:"pi pi-history",HOME:"pi pi-home",HOURGLASS:"pi pi-hourglass",ID_CARD:"pi pi-id-card",IMAGE:"pi pi-image",IMAGES:"pi pi-images",INBOX:"pi pi-inbox",INDIAN_RUPEE:"pi pi-indian-rupee",INFO_CIRCLE:"pi pi-info-circle",INFO:"pi pi-info",INSTAGRAM:"pi pi-instagram",KEY:"pi pi-key",LANGUAGE:"pi pi-language",LIGHTBULB:"pi pi-lightbulb",LINK:"pi pi-link",LINKEDIN:"pi pi-linkedin",LIST_CHECK:"pi pi-list-check",LIST:"pi pi-list",LOCK_OPEN:"pi pi-lock-open",LOCK:"pi pi-lock",MAP_MARKER:"pi pi-map-marker",MAP:"pi pi-map",MARS:"pi pi-mars",MEGAPHONE:"pi pi-megaphone",MICROCHIP_AI:"pi pi-microchip-ai",MICROCHIP:"pi pi-microchip",MICROPHONE:"pi pi-microphone",MICROSOFT:"pi pi-microsoft",MINUS_CIRCLE:"pi pi-minus-circle",MINUS:"pi pi-minus",MOBILE:"pi pi-mobile",MONEY_BILL:"pi pi-money-bill",MOON:"pi pi-moon",OBJECTS_COLUMN:"pi pi-objects-column",PALETTE:"pi pi-palette",PAPERCLIP:"pi pi-paperclip",PAUSE_CIRCLE:"pi pi-pause-circle",PAUSE:"pi pi-pause",PAYPAL:"pi pi-paypal",PEN_TO_SQUARE:"pi pi-pen-to-square",PENCIL:"pi pi-pencil",PERCENTAGE:"pi pi-percentage",PHONE:"pi pi-phone",PINTEREST:"pi pi-pinterest",PLAY_CIRCLE:"pi pi-play-circle",PLAY:"pi pi-play",PLUS_CIRCLE:"pi pi-plus-circle",PLUS:"pi pi-plus",POUND:"pi pi-pound",POWER_OFF:"pi pi-power-off",PRIME:"pi pi-prime",PRINT:"pi pi-print",QRCODE:"pi pi-qrcode",QUESTION_CIRCLE:"pi pi-question-circle",QUESTION:"pi pi-question",RECEIPT:"pi pi-receipt",REDDIT:"pi pi-reddit",REFRESH:"pi pi-refresh",REPLAY:"pi pi-replay",REPLY:"pi pi-reply",SAVE:"pi pi-save",SEARCH_MINUS:"pi pi-search-minus",SEARCH_PLUS:"pi pi-search-plus",SEARCH:"pi pi-search",SEND:"pi pi-send",SERVER:"pi pi-server",SHARE_ALT:"pi pi-share-alt",SHIELD:"pi pi-shield",SHOP:"pi pi-shop",SHOPPING_BAG:"pi pi-shopping-bag",SHOPPING_CART:"pi pi-shopping-cart",SIGN_IN:"pi pi-sign-in",SIGN_OUT:"pi pi-sign-out",SITEMAP:"pi pi-sitemap",SLACK:"pi pi-slack",SLIDERS_H:"pi pi-sliders-h",SLIDERS_V:"pi pi-sliders-v",SORT_ALPHA_DOWN_ALT:"pi pi-sort-alpha-down-alt",SORT_ALPHA_DOWN:"pi pi-sort-alpha-down",SORT_ALPHA_UP_ALT:"pi pi-sort-alpha-up-alt",SORT_ALPHA_UP:"pi pi-sort-alpha-up",SORT_ALT_SLASH:"pi pi-sort-alt-slash",SORT_ALT:"pi pi-sort-alt",SORT_AMOUNT_DOWN_ALT:"pi pi-sort-amount-down-alt",SORT_AMOUNT_DOWN:"pi pi-sort-amount-down",SORT_AMOUNT_UP_ALT:"pi pi-sort-amount-up-alt",SORT_AMOUNT_UP:"pi pi-sort-amount-up",SORT_DOWN_FILL:"pi pi-sort-down-fill",SORT_DOWN:"pi pi-sort-down",SORT_NUMERIC_DOWN_ALT:"pi pi-sort-numeric-down-alt",SORT_NUMERIC_DOWN:"pi pi-sort-numeric-down",SORT_NUMERIC_UP_ALT:"pi pi-sort-numeric-up-alt",SORT_NUMERIC_UP:"pi pi-sort-numeric-up",SORT_UP_FILL:"pi pi-sort-up-fill",SORT_UP:"pi pi-sort-up",SORT:"pi pi-sort",SPARKLES:"pi pi-sparkles",SPINNER_DOTTED:"pi pi-spinner-dotted",SPINNER:"pi pi-spinner",STAR_FILL:"pi pi-star-fill",STAR_HALF_FILL:"pi pi-star-half-fill",STAR_HALF:"pi pi-star-half",STAR:"pi pi-star",STEP_BACKWARD_ALT:"pi pi-step-backward-alt",STEP_BACKWARD:"pi pi-step-backward",STEP_FORWARD_ALT:"pi pi-step-forward-alt",STEP_FORWARD:"pi pi-step-forward",STOP_CIRCLE:"pi pi-stop-circle",STOP:"pi pi-stop",STOPWATCH:"pi pi-stopwatch",SUN:"pi pi-sun",SYNC:"pi pi-sync",TABLE:"pi pi-table",TABLET:"pi pi-tablet",TAG:"pi pi-tag",TAGS:"pi pi-tags",TELEGRAM:"pi pi-telegram",TH_LARGE:"pi pi-th-large",THUMBS_DOWN_FILL:"pi pi-thumbs-down-fill",THUMBS_DOWN:"pi pi-thumbs-down",THUMBS_UP_FILL:"pi pi-thumbs-up-fill",THUMBS_UP:"pi pi-thumbs-up",THUMBTACK:"pi pi-thumbtack",TICKET:"pi pi-ticket",TIKTOK:"pi pi-tiktok",TIMES_CIRCLE:"pi pi-times-circle",TIMES:"pi pi-times",TRASH:"pi pi-trash",TROPHY:"pi pi-trophy",TRUCK:"pi pi-truck",TURKISH_LIRA:"pi pi-turkish-lira",TWITCH:"pi pi-twitch",TWITTER:"pi pi-twitter",UNDO:"pi pi-undo",UNLOCK:"pi pi-unlock",UPLOAD:"pi pi-upload",USER_EDIT:"pi pi-user-edit",USER_MINUS:"pi pi-user-minus",USER_PLUS:"pi pi-user-plus",USER:"pi pi-user",USERS:"pi pi-users",VENUS:"pi pi-venus",VERIFIED:"pi pi-verified",VIDEO:"pi pi-video",VIMEO:"pi pi-vimeo",VOLUME_DOWN:"pi pi-volume-down",VOLUME_OFF:"pi pi-volume-off",VOLUME_UP:"pi pi-volume-up",WALLET:"pi pi-wallet",WAREHOUSE:"pi pi-warehouse",WAVE_PULSE:"pi pi-wave-pulse",WHATSAPP:"pi pi-whatsapp",WIFI:"pi pi-wifi",WINDOW_MAXIMIZE:"pi pi-window-maximize",WINDOW_MINIMIZE:"pi pi-window-minimize",WRENCH:"pi pi-wrench",YOUTUBE:"pi pi-youtube"}),Object.freeze({DESC:-1,UNSORTED:0,ASC:1});var E=c().createContext(),w=k;function hooks_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function hooks_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return hooks_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?hooks_esm_arrayLikeToArray(r,o):void 0}}function hooks_esm_slicedToArray(r,o){return function hooks_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function hooks_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||hooks_esm_unsupportedIterableToArray(r,o)||function hooks_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var x=function usePrevious(r){var o=a.useRef(null);return a.useEffect(function(){return o.current=r,function(){o.current=null}},[r]),o.current},C=function useUnmountEffect(r){return a.useEffect(function(){return r},[])},_=function useEventListener(r){var o=r.target,i=void 0===o?"document":o,c=r.type,g=r.listener,v=r.options,b=r.when,k=void 0===b||b,E=a.useRef(null),w=a.useRef(null),_=x(g),T=x(v),P=function bind(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.target;p.isNotEmpty(o)&&(A(),(r.when||k)&&(E.current=u.getTargetElement(o))),!w.current&&E.current&&(w.current=function(r){return g&&g(r)},E.current.addEventListener(c,w.current,v))},A=function unbind(){w.current&&(E.current.removeEventListener(c,w.current,v),w.current=null)},N=function dispose(){A(),_=null,T=null},R=a.useCallback(function(){k?E.current=u.getTargetElement(i):(A(),E.current=null)},[i,k]);return a.useEffect(function(){R()},[R]),a.useEffect(function(){var r="".concat(_)!=="".concat(g),o=T!==v,i=w.current;i&&(r||o)?(A(),k&&P()):i||N()},[g,v,k]),C(function(){N()}),[P,A]},T={};function hooks_esm_toConsumableArray(r){return function hooks_esm_arrayWithoutHoles(r){if(Array.isArray(r))return hooks_esm_arrayLikeToArray(r)}(r)||function hooks_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||hooks_esm_unsupportedIterableToArray(r)||function hooks_esm_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var P=1200,A={escKeyListeners:new Map,onGlobalKeyDown:function onGlobalKeyDown(r){if("Escape"===r.code){var o=A.escKeyListeners,i=Math.max.apply(Math,hooks_esm_toConsumableArray(o.keys())),a=o.get(i),c=Math.max.apply(Math,hooks_esm_toConsumableArray(a.keys()));a.get(c)(r)}},refreshGlobalKeyDownListener:function refreshGlobalKeyDownListener(){var r=u.getTargetElement("document");this.escKeyListeners.size>0?r.addEventListener("keydown",this.onGlobalKeyDown):r.removeEventListener("keydown",this.onGlobalKeyDown)},addListener:function addListener(r,o){var i=this,a=hooks_esm_slicedToArray(o,2),c=a[0],u=a[1],p=this.escKeyListeners;p.has(c)||p.set(c,new Map);var g=p.get(c);if(g.has(u))throw new Error("Unexpected: global esc key listener with priority [".concat(c,", ").concat(u,"] already exists."));return g.set(u,r),this.refreshGlobalKeyDownListener(),function(){g.delete(u),0===g.size&&p.delete(c),i.refreshGlobalKeyDownListener()}}},N=function useMergeProps(){var r=(0,a.useContext)(E);return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return mergeProps(i,null==r?void 0:r.ptOptions)}},R=function useMountEffect(r){var o=a.useRef(!1);return a.useEffect(function(){if(!o.current)return o.current=!0,r&&r()},[])};var I=function useOverlayScrollListener(r){var o=r.target,i=r.listener,c=r.options,g=r.when,v=void 0===g||g,b=a.useContext(E),k=a.useRef(null),_=a.useRef(null),T=a.useRef([]),P=x(i),A=x(c),N=function bind(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(p.isNotEmpty(r.target)&&(R(),(r.when||v)&&(k.current=u.getTargetElement(r.target))),!_.current&&k.current){var o=b?b.hideOverlaysOnDocumentScrolling:w.hideOverlaysOnDocumentScrolling,a=T.current=u.getScrollableParents(k.current);a.some(function(r){return r===document.body||r===window})||a.push(o?window:document.body),_.current=function(r){return i&&i(r)},a.forEach(function(r){return r.addEventListener("scroll",_.current,c)})}},R=function unbind(){_.current&&(T.current.forEach(function(r){return r.removeEventListener("scroll",_.current,c)}),_.current=null)},I=function dispose(){R(),T.current=null,P=null,A=null},L=a.useCallback(function(){v?k.current=u.getTargetElement(o):(R(),k.current=null)},[o,v]);return a.useEffect(function(){L()},[L]),a.useEffect(function(){var r="".concat(P)!=="".concat(i),o=A!==c,a=_.current;a&&(r||o)?(R(),v&&N()):a||I()},[i,c,v]),C(function(){I()}),[N,R]},L=function useResizeListener(r){var o=r.listener,i=r.when;return _({target:"window",type:"resize",listener:o,when:void 0===i||i})},z=0,j=function useStyle(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=hooks_esm_slicedToArray((0,a.useState)(!1),2),c=i[0],p=i[1],g=(0,a.useRef)(null),v=(0,a.useContext)(E),b=u.isClient()?window.document:void 0,k=o.document,x=void 0===k?b:k,C=o.manual,_=void 0!==C&&C,T=o.name,P=void 0===T?"style_".concat(++z):T,A=o.id,N=void 0===A?void 0:A,R=o.media,I=void 0===R?void 0:R,L=function load(){if(x&&!c){var o=(null==v?void 0:v.styleContainer)||x.head;g.current=function getCurrentStyleRef(r){var o=r.querySelector('style[data-primereact-style-id="'.concat(P,'"]'));if(o)return o;if(void 0!==N){var i=x.getElementById(N);if(i)return i}return x.createElement("style")}(o),g.current.isConnected||(g.current.type="text/css",N&&(g.current.id=N),I&&(g.current.media=I),u.addNonce(g.current,v&&v.nonce||w.nonce),o.appendChild(g.current),P&&g.current.setAttribute("data-primereact-style-id",P)),g.current.textContent=r,p(!0)}};return(0,a.useEffect)(function(){_||L()},[_]),{id:N,name:P,update:function update(o){c&&r!==o&&(g.current.textContent=o)},unload:function unload(){x&&g.current&&(u.removeInlineStyle(g.current),p(!1))},load:L,isLoaded:c}},B=function useUpdateEffect(r,o){var i=a.useRef(!1);return a.useEffect(function(){if(i.current)return r&&r();i.current=!0},o)};function componentbase_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function componentbase_esm_toConsumableArray(r){return function componentbase_esm_arrayWithoutHoles(r){if(Array.isArray(r))return componentbase_esm_arrayLikeToArray(r)}(r)||function componentbase_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function componentbase_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return componentbase_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?componentbase_esm_arrayLikeToArray(r,o):void 0}}(r)||function componentbase_esm_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function componentbase_esm_typeof(r){return componentbase_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},componentbase_esm_typeof(r)}function componentbase_esm_toPropertyKey(r){var o=function componentbase_esm_toPrimitive(r,o){if("object"!=componentbase_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=componentbase_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==componentbase_esm_typeof(o)?o:o+""}function componentbase_esm_defineProperty(r,o,i){return(o=componentbase_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function componentbase_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function componentbase_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?componentbase_esm_ownKeys(Object(i),!0).forEach(function(o){componentbase_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):componentbase_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var V="\n@layer primereact {\n .p-component, .p-component * {\n box-sizing: border-box;\n }\n\n .p-hidden {\n display: none;\n }\n\n .p-hidden-space {\n visibility: hidden;\n }\n\n .p-reset {\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n text-decoration: none;\n font-size: 100%;\n list-style: none;\n }\n\n .p-disabled, .p-disabled * {\n cursor: default;\n pointer-events: none;\n user-select: none;\n }\n\n .p-component-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n .p-unselectable-text {\n user-select: none;\n }\n\n .p-scrollbar-measure {\n width: 100px;\n height: 100px;\n overflow: scroll;\n position: absolute;\n top: -9999px;\n }\n\n @-webkit-keyframes p-fadein {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n @keyframes p-fadein {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n\n .p-link {\n text-align: left;\n background-color: transparent;\n margin: 0;\n padding: 0;\n border: none;\n cursor: pointer;\n user-select: none;\n }\n\n .p-link:disabled {\n cursor: default;\n }\n\n /* Non react overlay animations */\n .p-connected-overlay {\n opacity: 0;\n transform: scaleY(0.8);\n transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-connected-overlay-visible {\n opacity: 1;\n transform: scaleY(1);\n }\n\n .p-connected-overlay-hidden {\n opacity: 0;\n transform: scaleY(1);\n transition: opacity .1s linear;\n }\n\n /* React based overlay animations */\n .p-connected-overlay-enter {\n opacity: 0;\n transform: scaleY(0.8);\n }\n\n .p-connected-overlay-enter-active {\n opacity: 1;\n transform: scaleY(1);\n transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-connected-overlay-enter-done {\n transform: none;\n }\n\n .p-connected-overlay-exit {\n opacity: 1;\n }\n\n .p-connected-overlay-exit-active {\n opacity: 0;\n transition: opacity .1s linear;\n }\n\n /* Toggleable Content */\n .p-toggleable-content-enter {\n max-height: 0;\n }\n\n .p-toggleable-content-enter-active {\n overflow: hidden;\n max-height: 1000px;\n transition: max-height 1s ease-in-out;\n }\n\n .p-toggleable-content-enter-done {\n transform: none;\n }\n\n .p-toggleable-content-exit {\n max-height: 1000px;\n }\n\n .p-toggleable-content-exit-active {\n overflow: hidden;\n max-height: 0;\n transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);\n }\n\n /* @todo Refactor */\n .p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n ".concat("\n.p-button {\n margin: 0;\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n align-items: center;\n vertical-align: bottom;\n text-align: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-button-label {\n flex: 1 1 auto;\n}\n\n.p-button-icon {\n pointer-events: none;\n}\n\n.p-button-icon-right {\n order: 1;\n}\n\n.p-button:disabled {\n cursor: default;\n}\n\n.p-button-icon-only {\n justify-content: center;\n}\n\n.p-button-icon-only .p-button-label {\n visibility: hidden;\n width: 0;\n flex: 0 0 auto;\n}\n\n.p-button-vertical {\n flex-direction: column;\n}\n\n.p-button-icon-bottom {\n order: 2;\n}\n\n.p-button-group .p-button {\n margin: 0;\n}\n\n.p-button-group .p-button:not(:last-child) {\n border-right: 0 none;\n}\n\n.p-button-group .p-button:not(:first-of-type):not(:last-of-type) {\n border-radius: 0;\n}\n\n.p-button-group .p-button:first-of-type {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.p-button-group .p-button:last-of-type {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.p-button-group .p-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.p-button-group-single .p-button:first-of-type {\n border-top-right-radius: var(--border-radius) !important;\n border-bottom-right-radius: var(--border-radius) !important;\n}\n\n.p-button-group-single .p-button:last-of-type {\n border-top-left-radius: var(--border-radius) !important;\n border-bottom-left-radius: var(--border-radius) !important;\n}\n","\n ").concat("\n.p-inputtext {\n margin: 0;\n}\n\n.p-fluid .p-inputtext {\n width: 100%;\n}\n\n/* InputGroup */\n.p-inputgroup {\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n\n.p-inputgroup-addon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-inputgroup .p-float-label {\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n\n.p-inputgroup .p-inputtext,\n.p-fluid .p-inputgroup .p-inputtext,\n.p-inputgroup .p-inputwrapper,\n.p-fluid .p-inputgroup .p-input {\n flex: 1 1 auto;\n width: 1%;\n}\n\n/* Floating Label */\n.p-float-label {\n display: block;\n position: relative;\n}\n\n.p-float-label label {\n position: absolute;\n pointer-events: none;\n top: 50%;\n margin-top: -0.5rem;\n transition-property: all;\n transition-timing-function: ease;\n line-height: 1;\n}\n\n.p-float-label textarea ~ label,\n.p-float-label .p-mention ~ label {\n top: 1rem;\n}\n\n.p-float-label input:focus ~ label,\n.p-float-label input:-webkit-autofill ~ label,\n.p-float-label input.p-filled ~ label,\n.p-float-label textarea:focus ~ label,\n.p-float-label textarea.p-filled ~ label,\n.p-float-label .p-inputwrapper-focus ~ label,\n.p-float-label .p-inputwrapper-filled ~ label,\n.p-float-label .p-tooltip-target-wrapper ~ label {\n top: -0.75rem;\n font-size: 12px;\n}\n\n.p-float-label .p-placeholder,\n.p-float-label input::placeholder,\n.p-float-label .p-inputtext::placeholder {\n opacity: 0;\n transition-property: all;\n transition-timing-function: ease;\n}\n\n.p-float-label .p-focus .p-placeholder,\n.p-float-label input:focus::placeholder,\n.p-float-label .p-inputtext:focus::placeholder {\n opacity: 1;\n transition-property: all;\n transition-timing-function: ease;\n}\n\n.p-input-icon-left,\n.p-input-icon-right {\n position: relative;\n display: inline-block;\n}\n\n.p-input-icon-left > i,\n.p-input-icon-right > i,\n.p-input-icon-left > svg,\n.p-input-icon-right > svg,\n.p-input-icon-left > .p-input-prefix,\n.p-input-icon-right > .p-input-suffix {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n\n.p-fluid .p-input-icon-left,\n.p-fluid .p-input-icon-right {\n display: block;\n width: 100%;\n}\n","\n ").concat("\n.p-icon {\n display: inline-block;\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\nsvg.p-icon {\n pointer-events: auto;\n}\n\nsvg.p-icon g,\n.p-disabled svg.p-icon {\n pointer-events: none;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n","\n}\n"),U={cProps:void 0,cParams:void 0,cName:void 0,defaultProps:{pt:void 0,ptOptions:void 0,unstyled:!1},context:{},globalCSS:void 0,classes:{},styles:"",extend:function extend(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.css,i=componentbase_esm_objectSpread(componentbase_esm_objectSpread({},r.defaultProps),U.defaultProps),a={},c=function getPTValue(){var r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];o.hasOwnProperty("pt")&&void 0!==o.pt&&(o=o.pt);var u=i,g=/./g.test(u)&&!!a[u.split(".")[0]],v=g?p.toFlatCase(u.split(".")[1]):p.toFlatCase(u),b=a.hostName&&p.toFlatCase(a.hostName)||a.props&&a.props.__TYPE&&p.toFlatCase(a.props.__TYPE)||"",k="transition"===v,E="data-pc-",w=function getHostInstance(r){return null!=r&&r.props?r.hostName?r.props.__TYPE===r.hostName?r.props:w(r.parent):r.parent:void 0};U.cParams=a,U.cName=b;var x=function getPropValue(r){var o,i;return(null===(o=a.props)||void 0===o?void 0:o[r])||(null===(i=w(a))||void 0===i?void 0:i[r])}("ptOptions")||U.context.ptOptions||{},C=x.mergeSections,_=void 0===C||C,T=x.mergeProps,P=void 0!==T&&T,A=function getPTClassValue(){var r=H.apply(void 0,arguments);return Array.isArray(r)?{className:classNames.apply(void 0,componentbase_esm_toConsumableArray(r))}:p.isString(r)?{className:r}:null!=r&&r.hasOwnProperty("className")&&Array.isArray(r.className)?{className:classNames.apply(void 0,componentbase_esm_toConsumableArray(r.className))}:r},N=c?g?G(A,u,a):J(A,u,a):void 0,R=g?void 0:K(W(o,b),A,u,a),I=!k&&componentbase_esm_objectSpread(componentbase_esm_objectSpread({},"root"===v&&componentbase_esm_defineProperty({},"".concat(E,"name"),a.props&&a.props.__parentMetadata?p.toFlatCase(a.props.__TYPE):b)),{},componentbase_esm_defineProperty({},"".concat(E,"section"),v));return _||!_&&R?P?mergeProps([N,R,Object.keys(I).length?I:{}],{classNameMergeFunction:null===(r=U.context.ptOptions)||void 0===r?void 0:r.classNameMergeFunction}):componentbase_esm_objectSpread(componentbase_esm_objectSpread(componentbase_esm_objectSpread({},N),R),Object.keys(I).length?I:{}):componentbase_esm_objectSpread(componentbase_esm_objectSpread({},R),Object.keys(I).length?I:{})};return componentbase_esm_objectSpread(componentbase_esm_objectSpread({getProps:function getProps(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return U.context=o,U.cProps=r,p.getMergedProps(r,i)},getOtherProps:function getOtherProps(r){return p.getDiffProps(r,i)},setMetaData:function setMetaData(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.props,u=r.state,p=function isUnstyled(){return U.context.unstyled||w.unstyled||i.unstyled};return{ptm:function ptm(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c((i||{}).pt,o,componentbase_esm_objectSpread(componentbase_esm_objectSpread({},r),a))},ptmo:function ptmo(){return c(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},!1)},sx:function sx(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){var p,g=H(o&&o.inlineStyles,r,componentbase_esm_objectSpread({props:i,state:u},c));return mergeProps([H(a,r,componentbase_esm_objectSpread({props:i,state:u},c)),g],{classNameMergeFunction:null===(p=U.context.ptOptions)||void 0===p?void 0:p.classNameMergeFunction})}},cx:function cx(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p()?void 0:H(o&&o.classes,r,componentbase_esm_objectSpread({props:i,state:u},a))},isUnstyled:p}}},r),{},{defaultProps:i})}},H=function getOptionValue(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=String(p.toFlatCase(o)).split("."),c=a.shift(),u=p.isNotEmpty(r)?Object.keys(r).find(function(r){return p.toFlatCase(r)===c}):"";return c?p.isObject(r)?H(p.getItemValue(r[u],i),a.join("."),i):void 0:p.getItemValue(r,i)},W=function _getPT(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,a=null==r?void 0:r._usept,c=function getValue(r){var a,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=i?i(r):r,g=p.toFlatCase(o);return null!==(a=c?g!==U.cName?null==u?void 0:u[g]:void 0:null==u?void 0:u[g])&&void 0!==a?a:u};return p.isNotEmpty(a)?{_usept:a,originalValue:c(r.originalValue),value:c(r.value)}:c(r,!0)},K=function _usePT(r,o,i,a){var c=function fn(r){return o(r,i,a)};if(null!=r&&r.hasOwnProperty("_usept")){var u=r._usept||U.context.ptOptions||{},g=u.mergeSections,v=void 0===g||g,b=u.mergeProps,k=void 0!==b&&b,E=u.classNameMergeFunction,w=c(r.originalValue),x=c(r.value);if(void 0===w&&void 0===x)return;return p.isString(x)?x:p.isString(w)?w:v||!v&&x?k?mergeProps([w,x],{classNameMergeFunction:E}):componentbase_esm_objectSpread(componentbase_esm_objectSpread({},w),x):x}return c(r)},G=function _useGlobalPT(r,o,i){return K(function getGlobalPT(){return W(U.context.pt||w.pt,void 0,function(r){return p.getItemValue(r,U.cParams)})}(),r,o,i)},J=function _useDefaultPT(r,o,i){return K(function getDefaultPT(){return W(U.context.pt||w.pt,void 0,function(r){return H(r,U.cName,U.cParams)||p.getItemValue(r,U.cParams)})}(),r,o,i)},Y=function useHandleStyle(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2?arguments[2]:void 0,a=i.name,c=i.styled,u=void 0!==c&&c,g=i.hostName,v=void 0===g?"":g,b=G(H,"global.css",U.cParams),k=p.toFlatCase(a),E=j("\n.p-hidden-accessible {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n opacity: 0;\n overflow: hidden;\n padding: 0;\n pointer-events: none;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.p-overflow-hidden {\n overflow: hidden;\n padding-right: var(--scrollbar-width);\n}\n",{name:"base",manual:!0}).load,w=j(V,{name:"common",manual:!0}).load,x=j(b,{name:"global",manual:!0}).load,_=j(r,{name:a,manual:!0}).load,T=function hook(r){if(!v){var o=K(W((U.cProps||{}).pt,k),H,"hooks.".concat(r)),i=J(H,"hooks.".concat(r));null==o||o(),null==i||i()}};T("useMountEffect"),R(function(){E(),x(),o()||(w(),u||_())}),B(function(){T("useUpdateEffect")}),C(function(){T("useUnmountEffect")})};function extends_extends(){return extends_extends=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var a in i)({}).hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},extends_extends.apply(null,arguments)}function _objectWithoutPropertiesLoose(r,o){if(null==r)return{};var i={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(-1!==o.indexOf(a))continue;i[a]=r[a]}return i}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _inheritsLoose(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,_setPrototypeOf(r,o)}function replaceClassName(r,o){return r.replace(new RegExp("(^|\\s)"+o+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var X=i(43617),Q=i.n(X),Z=!1,ee=c().createContext(null),te=function forceReflow(r){return r.scrollTop},ne="unmounted",re="exited",oe="entering",ie="entered",ae="exiting",se=function(r){function Transition(o,i){var a;a=r.call(this,o,i)||this;var c,u=i&&!i.isMounting?o.enter:o.appear;return a.appearStatus=null,o.in?u?(c=re,a.appearStatus=oe):c=ie:c=o.unmountOnExit||o.mountOnEnter?ne:re,a.state={status:c},a.nextCallback=null,a}_inheritsLoose(Transition,r),Transition.getDerivedStateFromProps=function getDerivedStateFromProps(r,o){return r.in&&o.status===ne?{status:re}:null};var o=Transition.prototype;return o.componentDidMount=function componentDidMount(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function componentDidUpdate(r){var o=null;if(r!==this.props){var i=this.state.status;this.props.in?i!==oe&&i!==ie&&(o=oe):i!==oe&&i!==ie||(o=ae)}this.updateStatus(!1,o)},o.componentWillUnmount=function componentWillUnmount(){this.cancelNextCallback()},o.getTimeouts=function getTimeouts(){var r,o,i,a=this.props.timeout;return r=o=i=a,null!=a&&"number"!=typeof a&&(r=a.exit,o=a.enter,i=void 0!==a.appear?a.appear:o),{exit:r,enter:o,appear:i}},o.updateStatus=function updateStatus(r,o){if(void 0===r&&(r=!1),null!==o)if(this.cancelNextCallback(),o===oe){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Q().findDOMNode(this);i&&te(i)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===re&&this.setState({status:ne})},o.performEnter=function performEnter(r){var o=this,i=this.props.enter,a=this.context?this.context.isMounting:r,c=this.props.nodeRef?[a]:[Q().findDOMNode(this),a],u=c[0],p=c[1],g=this.getTimeouts(),v=a?g.appear:g.enter;!r&&!i||Z?this.safeSetState({status:ie},function(){o.props.onEntered(u)}):(this.props.onEnter(u,p),this.safeSetState({status:oe},function(){o.props.onEntering(u,p),o.onTransitionEnd(v,function(){o.safeSetState({status:ie},function(){o.props.onEntered(u,p)})})}))},o.performExit=function performExit(){var r=this,o=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:Q().findDOMNode(this);o&&!Z?(this.props.onExit(a),this.safeSetState({status:ae},function(){r.props.onExiting(a),r.onTransitionEnd(i.exit,function(){r.safeSetState({status:re},function(){r.props.onExited(a)})})})):this.safeSetState({status:re},function(){r.props.onExited(a)})},o.cancelNextCallback=function cancelNextCallback(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function safeSetState(r,o){o=this.setNextCallback(o),this.setState(r,o)},o.setNextCallback=function setNextCallback(r){var o=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,o.nextCallback=null,r(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},o.onTransitionEnd=function onTransitionEnd(r,o){this.setNextCallback(o);var i=this.props.nodeRef?this.props.nodeRef.current:Q().findDOMNode(this),a=null==r&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],u=c[0],p=c[1];this.props.addEndListener(u,p)}null!=r&&setTimeout(this.nextCallback,r)}else setTimeout(this.nextCallback,0)},o.render=function render(){var r=this.state.status;if(r===ne)return null;var o=this.props,i=o.children,a=(o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef,_objectWithoutPropertiesLoose(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return c().createElement(ee.Provider,{value:null},"function"==typeof i?i(r,a):c().cloneElement(c().Children.only(i),a))},Transition}(c().Component);function noop(){}se.contextType=ee,se.propTypes={},se.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop,onEntering:noop,onEntered:noop,onExit:noop,onExiting:noop,onExited:noop},se.UNMOUNTED=ne,se.EXITED=re,se.ENTERING=oe,se.ENTERED=ie,se.EXITING=ae;var le=se,ce=function removeClass(r,o){return r&&o&&o.split(" ").forEach(function(o){return function removeClass_removeClass(r,o){r.classList?r.classList.remove(o):"string"==typeof r.className?r.className=replaceClassName(r.className,o):r.setAttribute("class",replaceClassName(r.className&&r.className.baseVal||"",o))}(r,o)})},ue=function(r){function CSSTransition(){for(var o,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];return(o=r.call.apply(r,[this].concat(a))||this).appliedClasses={appear:{},enter:{},exit:{}},o.onEnter=function(r,i){var a=o.resolveArguments(r,i),c=a[0],u=a[1];o.removeClasses(c,"exit"),o.addClass(c,u?"appear":"enter","base"),o.props.onEnter&&o.props.onEnter(r,i)},o.onEntering=function(r,i){var a=o.resolveArguments(r,i),c=a[0],u=a[1]?"appear":"enter";o.addClass(c,u,"active"),o.props.onEntering&&o.props.onEntering(r,i)},o.onEntered=function(r,i){var a=o.resolveArguments(r,i),c=a[0],u=a[1]?"appear":"enter";o.removeClasses(c,u),o.addClass(c,u,"done"),o.props.onEntered&&o.props.onEntered(r,i)},o.onExit=function(r){var i=o.resolveArguments(r)[0];o.removeClasses(i,"appear"),o.removeClasses(i,"enter"),o.addClass(i,"exit","base"),o.props.onExit&&o.props.onExit(r)},o.onExiting=function(r){var i=o.resolveArguments(r)[0];o.addClass(i,"exit","active"),o.props.onExiting&&o.props.onExiting(r)},o.onExited=function(r){var i=o.resolveArguments(r)[0];o.removeClasses(i,"exit"),o.addClass(i,"exit","done"),o.props.onExited&&o.props.onExited(r)},o.resolveArguments=function(r,i){return o.props.nodeRef?[o.props.nodeRef.current,r]:[r,i]},o.getClassNames=function(r){var i=o.props.classNames,a="string"==typeof i,c=a?""+(a&&i?i+"-":"")+r:i[r];return{baseClassName:c,activeClassName:a?c+"-active":i[r+"Active"],doneClassName:a?c+"-done":i[r+"Done"]}},o}_inheritsLoose(CSSTransition,r);var o=CSSTransition.prototype;return o.addClass=function addClass(r,o,i){var a=this.getClassNames(o)[i+"ClassName"],c=this.getClassNames("enter").doneClassName;"appear"===o&&"done"===i&&c&&(a+=" "+c),"active"===i&&r&&te(r),a&&(this.appliedClasses[o][i]=a,function addClass(r,o){r&&o&&o.split(" ").forEach(function(o){return function addClass_addClass(r,o){r.classList?r.classList.add(o):function hasClass(r,o){return r.classList?!!o&&r.classList.contains(o):-1!==(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+o+" ")}(r,o)||("string"==typeof r.className?r.className=r.className+" "+o:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+o))}(r,o)})}(r,a))},o.removeClasses=function removeClasses(r,o){var i=this.appliedClasses[o],a=i.base,c=i.active,u=i.done;this.appliedClasses[o]={},a&&ce(r,a),c&&ce(r,c),u&&ce(r,u)},o.render=function render(){var r=this.props,o=(r.classNames,_objectWithoutPropertiesLoose(r,["classNames"]));return c().createElement(le,extends_extends({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},CSSTransition}(c().Component);ue.defaultProps={classNames:""},ue.propTypes={};var pe=ue;function csstransition_esm_typeof(r){return csstransition_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},csstransition_esm_typeof(r)}function csstransition_esm_toPropertyKey(r){var o=function csstransition_esm_toPrimitive(r,o){if("object"!=csstransition_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=csstransition_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==csstransition_esm_typeof(o)?o:o+""}function csstransition_esm_defineProperty(r,o,i){return(o=csstransition_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}var de={defaultProps:{__TYPE:"CSSTransition",children:void 0},getProps:function getProps(r){return p.getMergedProps(r,de.defaultProps)},getOtherProps:function getOtherProps(r){return p.getDiffProps(r,de.defaultProps)}};function csstransition_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function csstransition_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?csstransition_esm_ownKeys(Object(i),!0).forEach(function(o){csstransition_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):csstransition_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var fe=a.forwardRef(function(r,o){var i=de.getProps(r),c=a.useContext(E),u=i.disabled||i.options&&i.options.disabled||c&&!c.cssTransition||!w.cssTransition,g=function onEnter(r,o){i.onEnter&&i.onEnter(r,o),i.options&&i.options.onEnter&&i.options.onEnter(r,o)},v=function onEntering(r,o){i.onEntering&&i.onEntering(r,o),i.options&&i.options.onEntering&&i.options.onEntering(r,o)},b=function onEntered(r,o){i.onEntered&&i.onEntered(r,o),i.options&&i.options.onEntered&&i.options.onEntered(r,o)},k=function onExit(r){i.onExit&&i.onExit(r),i.options&&i.options.onExit&&i.options.onExit(r)},x=function onExiting(r){i.onExiting&&i.onExiting(r),i.options&&i.options.onExiting&&i.options.onExiting(r)},C=function onExited(r){i.onExited&&i.onExited(r),i.options&&i.options.onExited&&i.options.onExited(r)};if(B(function(){if(u){var r=p.getRefElement(i.nodeRef);i.in?(g(r,!0),v(r,!0),b(r,!0)):(k(r),x(r),C(r))}},[i.in]),u)return i.in?i.children:null;var _={nodeRef:i.nodeRef,in:i.in,appear:i.appear,onEnter:g,onEntering:v,onEntered:b,onExit:k,onExiting:x,onExited:C},T=csstransition_esm_objectSpread(csstransition_esm_objectSpread(csstransition_esm_objectSpread({},{classNames:i.classNames,timeout:i.timeout,unmountOnExit:i.unmountOnExit}),i.options||{}),_);return a.createElement(pe,T,i.children)});function keyfilter_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function keyfilter_esm_toConsumableArray(r){return function keyfilter_esm_arrayWithoutHoles(r){if(Array.isArray(r))return keyfilter_esm_arrayLikeToArray(r)}(r)||function keyfilter_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function keyfilter_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return keyfilter_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?keyfilter_esm_arrayLikeToArray(r,o):void 0}}(r)||function keyfilter_esm_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}fe.displayName="CSSTransition";var he={DEFAULT_MASKS:{pint:/[\d]/,int:/[\d\-]/,pnum:/[\d\.]/,money:/[\d\.\s,]/,num:/[\d\-\.]/,hex:/[0-9a-f]/i,email:/[a-z0-9_\.\-@]/i,alpha:/[a-z_]/i,alphanum:/[a-z0-9_]/i},getRegex:function getRegex(r){return he.DEFAULT_MASKS[r]?he.DEFAULT_MASKS[r]:r},onBeforeInput:function onBeforeInput(r,o,i){!i&&u.isAndroid()&&this.validateKey(r,r.data,o)},onKeyPress:function onKeyPress(r,o,i){i||u.isAndroid()||r.ctrlKey||r.altKey||r.metaKey||this.validateKey(r,r.key,o)},onPaste:function onPaste(r,o,i){if(!i){var a=this.getRegex(o);keyfilter_esm_toConsumableArray(r.clipboardData.getData("text")).forEach(function(o){if(!a.test(o))return r.preventDefault(),!1})}},validateKey:function validateKey(r,o,i){null!=o&&(o.length<=2&&(this.getRegex(i).test(o)||r.preventDefault()))},validate:function validate(r,o){var i=r.target.value,a=!0,c=this.getRegex(o);return i&&!c.test(i)&&(a=!1),a}};function portal_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function portal_esm_slicedToArray(r,o){return function portal_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function portal_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||function portal_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return portal_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?portal_esm_arrayLikeToArray(r,o):void 0}}(r,o)||function portal_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var me={defaultProps:{__TYPE:"Portal",element:null,appendTo:null,visible:!1,onMounted:null,onUnmounted:null,children:void 0},getProps:function getProps(r){return p.getMergedProps(r,me.defaultProps)},getOtherProps:function getOtherProps(r){return p.getDiffProps(r,me.defaultProps)}},ge=a.memo(function(r){var o=me.getProps(r),i=a.useContext(E),c=portal_esm_slicedToArray(a.useState(o.visible&&u.isClient()),2),g=c[0],v=c[1];R(function(){u.isClient()&&!g&&(v(!0),o.onMounted&&o.onMounted())}),B(function(){o.onMounted&&o.onMounted()},[g]),C(function(){o.onUnmounted&&o.onUnmounted()});var b=o.element||o.children;if(b&&g){var k=o.appendTo||i&&i.appendTo||w.appendTo;return p.isFunction(k)&&(k=k()),k||(k=document.body),"self"===k?b:Q().createPortal(b,k)}return null});function tooltip_esm_extends(){return tooltip_esm_extends=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var a in i)({}).hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},tooltip_esm_extends.apply(null,arguments)}function tooltip_esm_typeof(r){return tooltip_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},tooltip_esm_typeof(r)}function tooltip_esm_toPropertyKey(r){var o=function tooltip_esm_toPrimitive(r,o){if("object"!=tooltip_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=tooltip_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==tooltip_esm_typeof(o)?o:o+""}function tooltip_esm_defineProperty(r,o,i){return(o=tooltip_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function tooltip_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function tooltip_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return tooltip_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?tooltip_esm_arrayLikeToArray(r,o):void 0}}function tooltip_esm_toConsumableArray(r){return function tooltip_esm_arrayWithoutHoles(r){if(Array.isArray(r))return tooltip_esm_arrayLikeToArray(r)}(r)||function tooltip_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||tooltip_esm_unsupportedIterableToArray(r)||function tooltip_esm_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tooltip_esm_slicedToArray(r,o){return function tooltip_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function tooltip_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||tooltip_esm_unsupportedIterableToArray(r,o)||function tooltip_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}ge.displayName="Portal";var ve={root:function root(r){var o=r.positionState,i=r.classNameState;return classNames("p-tooltip p-component",tooltip_esm_defineProperty({},"p-tooltip-".concat(o),!0),i)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},ye=U.extend({defaultProps:{__TYPE:"Tooltip",appendTo:null,at:null,autoHide:!0,autoZIndex:!0,baseZIndex:0,className:null,closeOnEscape:!1,content:null,disabled:!1,event:null,hideDelay:0,hideEvent:"mouseleave",id:null,mouseTrack:!1,mouseTrackLeft:5,mouseTrackTop:5,my:null,onBeforeHide:null,onBeforeShow:null,onHide:null,onShow:null,position:"right",showDelay:0,showEvent:"mouseenter",showOnDisabled:!1,style:null,target:null,updateDelay:0,children:void 0},css:{classes:ve,styles:"\n@layer primereact {\n .p-tooltip {\n position: absolute;\n padding: .25em .5rem;\n /* #3687: Tooltip prevent scrollbar flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-tooltip.p-tooltip-right,\n .p-tooltip.p-tooltip-left {\n padding: 0 .25rem;\n }\n \n .p-tooltip.p-tooltip-top,\n .p-tooltip.p-tooltip-bottom {\n padding:.25em 0;\n }\n \n .p-tooltip .p-tooltip-text {\n white-space: pre-line;\n word-break: break-word;\n }\n \n .p-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n \n .p-tooltip-right .p-tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -.25rem;\n border-width: .25em .25em .25em 0;\n }\n \n .p-tooltip-left .p-tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -.25rem;\n border-width: .25em 0 .25em .25rem;\n }\n \n .p-tooltip.p-tooltip-top {\n padding: .25em 0;\n }\n \n .p-tooltip-top .p-tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: .25em .25em 0;\n }\n \n .p-tooltip-bottom .p-tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: 0 .25em .25rem;\n }\n\n .p-tooltip-target-wrapper {\n display: inline-flex;\n }\n}\n",inlineStyles:{arrow:function arrow(r){var o=r.context;return{top:o.bottom?"0":o.right||o.left||!o.right&&!o.left&&!o.top&&!o.bottom?"50%":null,bottom:o.top?"0":null,left:!o.right&&(o.right||o.left||o.top||o.bottom)?o.top||o.bottom?"50%":null:"0",right:o.left?"0":null}}}}});function tooltip_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function tooltip_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?tooltip_esm_ownKeys(Object(i),!0).forEach(function(o){tooltip_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):tooltip_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var be=a.memo(a.forwardRef(function(r,o){var i=N(),c=a.useContext(E),g=ye.getProps(r,c),b=tooltip_esm_slicedToArray(a.useState(!1),2),k=b[0],x=b[1],_=tooltip_esm_slicedToArray(a.useState(g.position||"right"),2),z=_[0],j=_[1],V=tooltip_esm_slicedToArray(a.useState(""),2),U=V[0],H=V[1],W=tooltip_esm_slicedToArray(a.useState(!1),2),K=W[0],G=W[1],J=k&&g.closeOnEscape,X=function useDisplayOrder(r){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=hooks_esm_slicedToArray(a.useState(function(){return UniqueComponentId()}),1)[0],c=hooks_esm_slicedToArray(a.useState(0),2),u=c[0],g=c[1];return a.useEffect(function(){if(o){T[r]||(T[r]=[]);var a=T[r].push(i);return g(a),function(){delete T[r][a-1];var o=T[r].length-1,i=p.findLastIndex(T[r],function(r){return void 0!==r});i!==o&&T[r].splice(i+1),g(void 0)}}},[r,i,o]),u}("tooltip",J),Q={props:g,state:{visible:k,position:z,className:U},context:{right:"right"===z,left:"left"===z,top:"top"===z,bottom:"bottom"===z}},Z=ye.setMetaData(Q),ee=Z.ptm,te=Z.cx,ne=Z.sx,re=Z.isUnstyled;Y(ye.css.styles,re,{name:"tooltip"}),function useGlobalOnEscapeKey(r){var o=r.callback,i=r.when,c=r.priority;(0,a.useEffect)(function(){if(i)return A.addListener(o,c)},[o,i,c])}({callback:function callback(){Ae()},when:J,priority:[P,X]});var oe=a.useRef(null),ie=a.useRef(null),ae=a.useRef(null),se=a.useRef(null),le=a.useRef(!0),ce=a.useRef({}),ue=a.useRef(null),pe=tooltip_esm_slicedToArray(L({listener:function listener(r){!u.isTouchDevice()&&Ae(r)}}),2),de=pe[0],fe=pe[1],he=tooltip_esm_slicedToArray(I({target:ae.current,listener:function listener(r){Ae(r)},when:k}),2),me=he[0],ve=he[1],be=function isMouseTrack(r){return we(r,"mousetrack")||g.mouseTrack},ke=function isDisabled(r){return"true"===we(r,"disabled")||xe(r,"disabled")||g.disabled},Ee=function isShowOnDisabled(r){return we(r,"showondisabled")||g.showOnDisabled},Se=function isAutoHide(){return we(ae.current,"autohide")||g.autoHide},we=function getTargetOption(r,o){return xe(r,"data-pr-".concat(o))?r.getAttribute("data-pr-".concat(o)):null},xe=function hasTargetOption(r,o){return r&&r.hasAttribute(o)},Ce=function getEvents(r){var o=[we(r,"showevent")||g.showEvent],i=[we(r,"hideevent")||g.hideEvent];if(be(r))o=["mousemove"],i=["mouseleave"];else{var a=we(r,"event")||g.event;"focus"===a&&(o=["focus"],i=["blur"]),"both"===a&&(o=["focus","mouseenter"],i=K?["blur"]:["mouseleave","blur"])}return{showEvents:o,hideEvents:i}},_e=function getPosition(r){return we(r,"position")||z},Te=function updateText(r,o){if(ie.current){var i=we(r,"tooltip")||g.content;i?(ie.current.innerHTML="",ie.current.appendChild(document.createTextNode(i)),o()):g.children&&o()}},Oe=function updateTooltipState(r){Te(ae.current,function(){var o=ue.current,i=o.pageX,a=o.pageY;g.autoZIndex&&!v.get(oe.current)&&v.set("tooltip",oe.current,c&&c.autoZIndex||w.autoZIndex,g.baseZIndex||c&&c.zIndex.tooltip||w.zIndex.tooltip),oe.current.style.left="",oe.current.style.top="",Se()&&(oe.current.style.pointerEvents="none");var p=be(ae.current)||"mouse"===r;(p&&!se.current||p)&&(se.current={width:u.getOuterWidth(oe.current),height:u.getOuterHeight(oe.current)}),Me(ae.current,{x:i,y:a},r)})},Pe=function show(r){r.type&&"focus"===r.type&&G(!0),ae.current=r.currentTarget;var o=ke(ae.current);(function isContentEmpty(r){return!(g.content||we(r,"tooltip")||g.children)})(Ee(ae.current)&&o?ae.current.firstChild:ae.current)||o||(ue.current=r,k?Le("updateDelay",Oe):Fe(g.onBeforeShow,{originalEvent:r,target:ae.current})&&Le("showDelay",function(){x(!0),Fe(g.onShow,{originalEvent:r,target:ae.current})}))},Ae=function hide(r){(r&&"blur"===r.type&&G(!1),ze(),k)?Fe(g.onBeforeHide,{originalEvent:r,target:ae.current})&&Le("hideDelay",function(){(Se()||!1!==le.current)&&(v.clear(oe.current),u.removeClass(oe.current,"p-tooltip-active"),x(!1),Fe(g.onHide,{originalEvent:r,target:ae.current}))}):g.onBeforeHide||De("hideDelay")||x(!1)},Me=function align(r,o,i){var a=0,c=0,p=i||z;if((be(r)||"mouse"==p)&&o){var v={width:u.getOuterWidth(oe.current),height:u.getOuterHeight(oe.current)};a=o.x,c=o.y;var b=function getMouseTrackPosition(r){return{top:we(r,"mousetracktop")||g.mouseTrackTop,left:we(r,"mousetrackleft")||g.mouseTrackLeft}}(r),k=b.top,E=b.left;switch(p){case"left":a-=v.width+E,c-=v.height/2-k;break;case"right":case"mouse":a+=E,c-=v.height/2-k;break;case"top":a-=v.width/2-E,c-=v.height+k;break;case"bottom":a-=v.width/2-E,c+=k}a<=0||se.current.width>v.width?(oe.current.style.left="0px",oe.current.style.right=window.innerWidth-v.width-a+"px"):(oe.current.style.right="",oe.current.style.left=a+"px"),oe.current.style.top=c+"px",u.addClass(oe.current,"p-tooltip-active")}else{var w=u.findCollisionPosition(p),x=we(r,"my")||g.my||w.my,C=we(r,"at")||g.at||w.at;oe.current.style.padding="0px",u.flipfitCollision(oe.current,r,x,C,function(r){var o=r.at,i=o.x,a=o.y,c=r.my.x,p=g.at?"center"!==i&&i!==c?i:a:r.at["".concat(w.axis)];oe.current.style.padding="",j(p),Ne(p),u.addClass(oe.current,"p-tooltip-active")})}},Ne=function updateContainerPosition(r){if(oe.current){var o=getComputedStyle(oe.current);"left"===r?oe.current.style.left=parseFloat(o.left)-2*parseFloat(o.paddingLeft)+"px":"top"===r&&(oe.current.style.top=parseFloat(o.top)-2*parseFloat(o.paddingTop)+"px")}},Re=function bindTargetEvent(r){if(r){var o=Ce(r),i=o.showEvents,a=o.hideEvents,c=je(r);i.forEach(function(r){return null==c?void 0:c.addEventListener(r,Pe)}),a.forEach(function(r){return null==c?void 0:c.addEventListener(r,Ae)})}},Ie=function unbindTargetEvent(r){if(r){var o=Ce(r),i=o.showEvents,a=o.hideEvents,c=je(r);i.forEach(function(r){return null==c?void 0:c.removeEventListener(r,Pe)}),a.forEach(function(r){return null==c?void 0:c.removeEventListener(r,Ae)})}},De=function getDelay(r){return we(ae.current,r.toLowerCase())||g[r]},Le=function applyDelay(r,o){ze();var i=De(r);i?ce.current["".concat(r)]=setTimeout(function(){return o()},i):o()},Fe=function sendCallback(r){if(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];var c=r.apply(void 0,i);return void 0===c&&(c=!0),c}return!0},ze=function clearTimeouts(){Object.values(ce.current).forEach(function(r){return clearTimeout(r)})},je=function getTarget(r){if(r){if(Ee(r)){if(!r.hasWrapper){var o=document.createElement("div");return"INPUT"===r.nodeName?u.addMultipleClasses(o,"p-tooltip-target-wrapper p-inputwrapper"):u.addClass(o,"p-tooltip-target-wrapper"),r.parentNode.insertBefore(o,r),o.appendChild(r),r.hasWrapper=!0,o}return r.parentElement}var i;return r.hasWrapper&&((i=r.parentElement).replaceWith.apply(i,tooltip_esm_toConsumableArray(r.parentElement.childNodes)),delete r.hasWrapper),r}return null},Be=function updateTargetEvents(r){$e(r),Ve(r)},Ve=function loadTargetEvents(r){Ue(r||g.target,Re)},$e=function unloadTargetEvents(r){Ue(r||g.target,Ie)},Ue=function setTargetEventOperations(r,o){if(r=p.getRefElement(r))if(u.isElement(r))o(r);else{var i=function setEvent(r){u.find(document,r).forEach(function(r){o(r)})};r instanceof Array?r.forEach(function(r){i(r)}):i(r)}};R(function(){k&&ae.current&&ke(ae.current)&&Ae()}),B(function(){return Ve(),function(){$e()}},[Pe,Ae,g.target]),B(function(){if(k){var r=_e(ae.current),o=we(ae.current,"classname");j(r),H(o),Oe(r),de(),me()}else j(g.position||"right"),H(""),ae.current=null,se.current=null,le.current=!0;return function(){fe(),ve()}},[k]),B(function(){var r=_e(ae.current);k&&"mouse"!==r&&Le("updateDelay",function(){Te(ae.current,function(){Me(ae.current)})})},[g.content]),C(function(){Ae(),v.clear(oe.current)}),a.useImperativeHandle(o,function(){return{props:g,updateTargetEvents:Be,loadTargetEvents:Ve,unloadTargetEvents:$e,show:Pe,hide:Ae,getElement:function getElement(){return oe.current},getTarget:function getTarget(){return ae.current}}});if(k){var He=function createElement(){var r=function isTargetContentEmpty(r){return!(g.content||we(r,"tooltip"))}(ae.current),o=i({id:g.id,className:classNames(g.className,te("root",{positionState:z,classNameState:U})),style:g.style,role:"tooltip","aria-hidden":k,onMouseEnter:function onMouseEnter(r){return function onMouseEnter(){Se()||(le.current=!1)}()},onMouseLeave:function onMouseLeave(r){return function onMouseLeave(r){Se()||(le.current=!0,Ae(r))}(r)}},ye.getOtherProps(g),ee("root")),c=i({className:te("arrow"),style:ne("arrow",tooltip_esm_objectSpread({},Q))},ee("arrow")),u=i({className:te("text")},ee("text"));return a.createElement("div",tooltip_esm_extends({ref:oe},o),a.createElement("div",c),a.createElement("div",tooltip_esm_extends({ref:ie},u),r&&g.children))}();return a.createElement(ge,{element:He,appendTo:g.appendTo,visible:!0})}return null}));be.displayName="Tooltip";var ke=function EventBus(){var r=new Map;return{on:function on(o,i){var a=r.get(o);a?a.push(i):a=[i],r.set(o,a)},off:function off(o,i){var a=r.get(o);a&&a.splice(a.indexOf(i)>>>0,1)},emit:function emit(o,i){var a=r.get(o);a&&a.slice().forEach(function(r){return r(i)})}}}();function ripple_esm_extends(){return ripple_esm_extends=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var a in i)({}).hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},ripple_esm_extends.apply(null,arguments)}function ripple_esm_typeof(r){return ripple_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ripple_esm_typeof(r)}function ripple_esm_toPropertyKey(r){var o=function ripple_esm_toPrimitive(r,o){if("object"!=ripple_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=ripple_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==ripple_esm_typeof(o)?o:o+""}function ripple_esm_defineProperty(r,o,i){return(o=ripple_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function ripple_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function ripple_esm_slicedToArray(r,o){return function ripple_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function ripple_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||function ripple_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return ripple_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ripple_esm_arrayLikeToArray(r,o):void 0}}(r,o)||function ripple_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ee=U.extend({defaultProps:{__TYPE:"Ripple",children:void 0},css:{styles:"\n@layer primereact {\n .p-ripple {\n overflow: hidden;\n position: relative;\n }\n \n .p-ink {\n display: block;\n position: absolute;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 100%;\n transform: scale(0);\n }\n \n .p-ink-active {\n animation: ripple 0.4s linear;\n }\n \n .p-ripple-disabled .p-ink {\n display: none;\n }\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n\n",classes:{root:"p-ink"}},getProps:function getProps(r){return p.getMergedProps(r,Ee.defaultProps)},getOtherProps:function getOtherProps(r){return p.getDiffProps(r,Ee.defaultProps)}});function ripple_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}var Se=a.memo(a.forwardRef(function(r,o){var i=ripple_esm_slicedToArray(a.useState(!1),2),c=i[0],p=i[1],g=a.useRef(null),v=a.useRef(null),b=N(),k=a.useContext(E),x=Ee.getProps(r,k),_=k&&k.ripple||w.ripple,T={props:x};j(Ee.css.styles,{name:"ripple",manual:!_});var P=Ee.setMetaData(function ripple_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ripple_esm_ownKeys(Object(i),!0).forEach(function(o){ripple_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):ripple_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}({},T)),A=P.ptm,I=P.cx,L=function getTarget(){return g.current&&g.current.parentElement},z=function bindEvents(){v.current&&v.current.addEventListener("pointerdown",V)},V=function onPointerDown(r){var o=u.getOffset(v.current),i=r.pageX-o.left+document.body.scrollTop-u.getWidth(g.current)/2,a=r.pageY-o.top+document.body.scrollLeft-u.getHeight(g.current)/2;U(i,a)},U=function activateRipple(r,o){g.current&&"none"!==getComputedStyle(g.current,null).display&&(u.removeClass(g.current,"p-ink-active"),H(),g.current.style.top=o+"px",g.current.style.left=r+"px",u.addClass(g.current,"p-ink-active"))},H=function setDimensions(){if(g.current&&!u.getHeight(g.current)&&!u.getWidth(g.current)){var r=Math.max(u.getOuterWidth(v.current),u.getOuterHeight(v.current));g.current.style.height=r+"px",g.current.style.width=r+"px"}};if(a.useImperativeHandle(o,function(){return{props:x,getInk:function getInk(){return g.current},getTarget:function getTarget(){return v.current}}}),R(function(){p(!0)}),B(function(){c&&g.current&&(v.current=L(),H(),z())},[c]),B(function(){g.current&&!v.current&&(v.current=L(),H(),z())}),C(function(){g.current&&(v.current=null,function unbindEvents(){v.current&&v.current.removeEventListener("pointerdown",V)}())}),!_)return null;var W=b({"aria-hidden":!0,className:classNames(I("root"))},Ee.getOtherProps(x),A("root"));return a.createElement("span",ripple_esm_extends({role:"presentation",ref:g},W,{onAnimationEnd:function onAnimationEnd(r){u.removeClass(r.currentTarget,"p-ink-active")}}))}));function mention_esm_extends(){return mention_esm_extends=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var a in i)({}).hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},mention_esm_extends.apply(null,arguments)}function mention_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function mention_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return mention_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?mention_esm_arrayLikeToArray(r,o):void 0}}function mention_esm_toConsumableArray(r){return function mention_esm_arrayWithoutHoles(r){if(Array.isArray(r))return mention_esm_arrayLikeToArray(r)}(r)||function mention_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||mention_esm_unsupportedIterableToArray(r)||function mention_esm_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mention_esm_typeof(r){return mention_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},mention_esm_typeof(r)}function mention_esm_toPropertyKey(r){var o=function mention_esm_toPrimitive(r,o){if("object"!=mention_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=mention_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==mention_esm_typeof(o)?o:o+""}function mention_esm_defineProperty(r,o,i){return(o=mention_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function mention_esm_slicedToArray(r,o){return function mention_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function mention_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||mention_esm_unsupportedIterableToArray(r,o)||function mention_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Se.displayName="Ripple";var we={root:function root(r){var o=r.props,i=r.context,a=r.isFilled;return classNames("p-inputtextarea p-inputtext p-component",{"p-disabled":o.disabled,"p-filled":a,"p-inputtextarea-resizable":o.autoResize,"p-invalid":o.invalid,"p-variant-filled":o.variant?"filled"===o.variant:i&&"filled"===i.inputStyle})}},xe=U.extend({defaultProps:{__TYPE:"InputTextarea",__parentMetadata:null,autoResize:!1,invalid:!1,variant:null,keyfilter:null,onBlur:null,onFocus:null,onBeforeInput:null,onInput:null,onKeyDown:null,onKeyUp:null,onPaste:null,tooltip:null,tooltipOptions:null,validateOnly:!1,children:void 0,className:null},css:{classes:we,styles:"\n@layer primereact {\n .p-inputtextarea-resizable {\n overflow: hidden;\n resize: none;\n }\n \n .p-fluid .p-inputtextarea {\n width: 100%;\n }\n}\n"}});function mention_esm_ownKeys$1(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function mention_esm_objectSpread$1(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?mention_esm_ownKeys$1(Object(i),!0).forEach(function(o){mention_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):mention_esm_ownKeys$1(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var Ce=a.memo(a.forwardRef(function(r,o){var i=N(),c=a.useContext(E),g=xe.getProps(r,c),v=a.useRef(o),b=a.useRef(0),k=xe.setMetaData(mention_esm_objectSpread$1(mention_esm_objectSpread$1({props:g},g.__parentMetadata),{},{context:{disabled:g.disabled}})),w=k.ptm,x=k.cx,C=k.isUnstyled;Y(xe.css.styles,C,{name:"inputtextarea"});var _=function resize(r){var o=v.current;o&&T()&&(b.current||(b.current=o.scrollHeight,o.style.overflow="hidden"),(b.current!==o.scrollHeight||r)&&(o.style.height="",o.style.height=o.scrollHeight+"px",parseFloat(o.style.height)>=parseFloat(o.style.maxHeight)?(o.style.overflowY="scroll",o.style.height=o.style.maxHeight):o.style.overflow="hidden",b.current=o.scrollHeight))},T=function isVisible(){if(u.isVisible(v.current)){var r=v.current.getBoundingClientRect();return r.width>0&&r.height>0}return!1};a.useEffect(function(){p.combinedRefs(v,o)},[v,o]),a.useEffect(function(){g.autoResize&&_(!0)},[g.autoResize,g.value]);var P=a.useMemo(function(){return p.isNotEmpty(g.value)||p.isNotEmpty(g.defaultValue)},[g.value,g.defaultValue]),A=p.isNotEmpty(g.tooltip),R=i({ref:v,className:classNames(g.className,x("root",{context:c,isFilled:P})),onFocus:function onFocus(r){g.autoResize&&_(),g.onFocus&&g.onFocus(r)},onBlur:function onBlur(r){g.autoResize&&_(),g.onBlur&&g.onBlur(r)},onKeyUp:function onKeyUp(r){g.autoResize&&_(),g.onKeyUp&&g.onKeyUp(r)},onKeyDown:function onKeyDown(r){g.onKeyDown&&g.onKeyDown(r),g.keyfilter&&he.onKeyPress(r,g.keyfilter,g.validateOnly)},onBeforeInput:function onBeforeInput(r){g.onBeforeInput&&g.onBeforeInput(r),g.keyfilter&&he.onBeforeInput(r,g.keyfilter,g.validateOnly)},onInput:function onInput(r){var o=r.target;g.autoResize&&_(p.isEmpty(o.value)),g.onInput&&g.onInput(r),p.isNotEmpty(o.value)?u.addClass(o,"p-filled"):u.removeClass(o,"p-filled")},onPaste:function onPaste(r){g.onPaste&&g.onPaste(r),g.keyfilter&&he.onPaste(r,g.keyfilter,g.validateOnly)}},xe.getOtherProps(g),w("root"));return a.createElement(a.Fragment,null,a.createElement("textarea",R),A&&a.createElement(be,mention_esm_extends({target:v,content:g.tooltip,pt:w("tooltip")},g.tooltipOptions)))}));Ce.displayName="InputTextarea";var _e={item:function item(r){return classNames("p-mention-item",{"p-highlight":r.isSelected})},items:"p-mention-items",panel:function panel(r){return classNames("p-mention-panel p-component",r.props.panelClassName)},input:function input(r){return classNames("p-mention-input",r.props.inputClassName)},root:function root(r){return r.props,classNames("p-mention p-component p-inputwrapper",{"p-inputwrapper-filled":r.isFilled,"p-inputwrapper-focus":r.focusedState})},transition:"p-connected-overlay"},Te=U.extend({defaultProps:{__TYPE:"Mention",autoHighlight:!0,autoResize:!1,className:null,delay:0,field:null,footerTemplate:null,headerTemplate:null,id:null,inputClassName:null,inputId:null,inputRef:null,inputStyle:null,itemTemplate:null,onBlur:null,onChange:null,onFocus:null,onHide:null,onInput:null,onSearch:null,onSelect:null,onShow:null,panelClassName:null,panelStyle:null,scrollHeight:"200px",style:null,suggestions:null,transitionOptions:null,trigger:"@",variant:null,children:void 0},css:{classes:_e,styles:"\n@layer primereact {\n .p-mention {\n display: inline-flex;\n position: relative;\n }\n \n .p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-mention .p-mention-panel {\n min-width: 100%;\n }\n \n .p-mention-panel {\n position: absolute;\n top: 0;\n left: 0;\n overflow: auto;\n }\n \n .p-mention-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-mention-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n }\n \n .p-fluid .p-mention {\n display: flex;\n }\n}\n"}});function mention_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function mention_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?mention_esm_ownKeys(Object(i),!0).forEach(function(o){mention_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):mention_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var Oe=a.memo(a.forwardRef(function(r,o){var i=N(),c=a.useContext(E),g=Te.getProps(r,c),b=mention_esm_slicedToArray(a.useState(!1),2),k=b[0],x=b[1],T=mention_esm_slicedToArray(a.useState(!1),2),P=T[0],A=T[1],R=mention_esm_slicedToArray(a.useState(!1),2),z=R[0],j=R[1],V=mention_esm_slicedToArray(a.useState(null),2),U=V[0],H=V[1],W=mention_esm_slicedToArray(a.useState([]),2),K=W[0],G=W[1],J=a.useRef(null),X=a.useRef(null),Q=a.useRef(g.inputRef),Z=a.useRef(null),ee=a.useRef(null),te={props:g,state:{overlayVisible:k,focused:P,searching:z,trigger:U}},ne=Te.setMetaData(te),re=ne.ptm,oe=ne.cx;ne.sx;var ie=ne.isUnstyled;Y(Te.css.styles,ie,{name:"mention"});var ae=function useOverlayListener(r){var o=r.target,i=r.overlay,c=r.listener,p=r.when,g=void 0===p||p,v=r.type,b=void 0===v?"click":v,k=a.useRef(null),E=a.useRef(null),w=hooks_esm_slicedToArray(_({target:"window",type:b,listener:function listener(r){c&&c(r,{type:"outside",valid:3!==r.which&&H(r)})},when:g}),2),x=w[0],T=w[1],P=hooks_esm_slicedToArray(L({listener:function listener(r){c&&c(r,{type:"resize",valid:!u.isTouchDevice()})},when:g}),2),A=P[0],N=P[1],R=hooks_esm_slicedToArray(_({target:"window",type:"orientationchange",listener:function listener(r){c&&c(r,{type:"orientationchange",valid:!0})},when:g}),2),z=R[0],j=R[1],B=hooks_esm_slicedToArray(I({target:o,listener:function listener(r){c&&c(r,{type:"scroll",valid:!0})},when:g}),2),V=B[0],U=B[1],H=function isOutsideClicked(r){return k.current&&!(k.current.isSameNode(r.target)||k.current.contains(r.target)||E.current&&E.current.contains(r.target))},W=function unbind(){T(),N(),j(),U()};return a.useEffect(function(){g?(k.current=u.getTargetElement(o),E.current=u.getTargetElement(i)):(W(),k.current=E.current=null)},[o,i,g]),C(function(){W()}),[function bind(){x(),A(),z(),V()},W]}({target:J,overlay:X,listener:function listener(r,o){var i=o.valid,a=o.type;i&&(c.hideOverlaysOnDocumentScrolling||"outside"===a?pe():u.isDocument(r.target)||be())},when:k}),se=mention_esm_slicedToArray(ae,2),le=se[0],ce=se[1],ue=function show(){x(!0)},pe=function hide(){x(!1),j(!1),H(null)},de=function onOverlayEnter(){v.set("overlay",X.current,c&&c.autoZIndex||w.autoZIndex,c&&c.zIndex.overlay||w.zIndex.overlay),u.addStyles(X.current,{position:"absolute",top:"0",left:"0"}),be()},he=function onOverlayEntering(){g.autoHighlight&&g.suggestions&&g.suggestions.length&&G(function(r){var o=mention_esm_toConsumableArray(r);return o[0]=!0,o})},me=function onOverlayEntered(){le(),g.onShow&&g.onShow()},ve=function onOverlayExit(){ce()},ye=function onOverlayExited(){v.clear(X.current),g.onHide&&g.onHide()},be=function alignOverlay(){if(U){var r=U.key,o=U.index,i=Q.current.value,a=u.getCursorOffset(Q.current,i.substring(0,o-1),i.substring(o),r);X.current.style.transformOrigin="top",X.current.style.left="calc(".concat(a.left,"px + 1rem)"),X.current.style.top="calc(".concat(a.top,"px + 1.2rem)")}},Ee=function onPanelClick(r){ke.emit("overlay-click",{originalEvent:r,target:J.current})},we=function getLatestTrigger(r,o){if(Array.isArray(g.trigger)){var i={};return g.trigger.forEach(function(a){var c=r.substring(0,o).lastIndexOf(a);-1!==c&&(c>i.index||!i.index)&&(i={key:a,index:-1!==c?c+1:-1})}),i}var a=r.substring(0,o).lastIndexOf(g.trigger);return{key:g.trigger,index:-1!==a?a+1:-1}},xe=function onSearch(r){ee.current&&clearTimeout(ee.current);var o=r.target,i=o.value,a=o.selectionStart,c=i.substring(a-1,a);if(" "!==c){var u=function getTrigger(r,o,i){if(!U){var a=Array.isArray(g.trigger)?g.trigger.find(function(r){return r===o}):g.trigger===o?g.trigger:null;if(a)return{key:a,index:i};var c=r.substring(0,i).lastIndexOf(" "),u=we(r,i);if(u.index>c)return u}return U}(i,c,a);if(u&&u.index>-1){var p=i.substring(u.index,a);ee.current=setTimeout(function(){_e(r,p,u)},g.delay)}}else pe()},_e=function search(r,o,i){g.onSearch&&(j(!0),H(i),g.onSearch({originalEvent:r,trigger:i.key,query:o}))},Oe=function selectItem(r,o){var i=Q.current,a=i.value,c=i.selectionStart,u=a.indexOf(" ",U.index),p=a.substring(U.index,u>-1?u:c),v=Pe(o).replace(/\s+/g,"");if(p.trim()!==v){var b=a.substring(0,U.index),k=a.substring(u>-1?c:U.index+p.length);Q.current.value=" "===k[0]?"".concat(b).concat(v).concat(k):"".concat(b).concat(v," ").concat(k),r.target=Q.current,g.onChange&&g.onChange(r)}var E=U.index+v.length+1;Q.current.setSelectionRange(E,E),pe(),g.onSelect&&g.onSelect({originalEvent:r,suggestion:o})},Pe=function formatValue(r){if(r){var o=Array.isArray(g.field)?g.field[g.trigger.findIndex(function(r){return r===U.key})]:g.field;return o?p.resolveFieldData(r,o):r}return""},Ae=Q.current&&Q.current.value,Me=a.useMemo(function(){return p.isNotEmpty(g.value)||p.isNotEmpty(g.defaultValue)||p.isNotEmpty(Ae)},[g.value,g.defaultValue,Ae]);a.useImperativeHandle(o,function(){return{props:g,show:ue,hide:pe,focus:function focus(){return u.focus(Q.current)},getElement:function getElement(){return J.current},getOverlay:function getOverlay(){return X.current},getInput:function getInput(){return Q.current}}}),a.useEffect(function(){p.combinedRefs(Q,g.inputRef)},[Q,g.inputRef]),B(function(){var r=g.suggestions&&g.suggestions.length;if(r){var o=g.suggestions.map(function(){return!1});G(o)}z&&(r?ue():pe(),k&&be(),j(!1))},[g.suggestions]),B(function(){var r=ie(),o=r?u.isAttributeEquals(J.current,"data-p-inputwrapper-filled",!0):u.hasClass(J.current,"p-inputwrapper-filled");!Me&&o&&(r?u.setAttributes(J.current,{"data-p-inputwrapper-filled":!1}):u.removeClass(J.current,"p-inputwrapper-filled"))},[Me]),C(function(){v.clear(X.current)});var Ne=function createItem(r,o){var c=o+"_item",v=g.itemTemplate?p.getJSXElement(g.itemTemplate,r,{trigger:U?U.key:"",index:o}):Pe(r),b=K[o],k=i({className:oe("item",{isSelected:b}),onClick:function onClick(o){return function onItemClick(r,o){u.focus(Q.current),Oe(r,o)}(o,r)},"data-p-highlight":b},function getPTOptions(r,o,i){return re(o,{context:{trigger:U?U.key:""},state:mention_esm_objectSpread({},i)})}(0,"item",{selected:b}));return a.createElement("li",mention_esm_extends({},k,{key:c}),v,a.createElement(Se,null))},Re=Te.getOtherProps(g),Ie=function createPanel(){var r=p.getJSXElement(g.headerTemplate,g),o=p.getJSXElement(g.footerTemplate,g),c=function createList(){var r=i({ref:Z,className:oe("items")},re("items"));if(g.suggestions){var o=g.suggestions.map(Ne);return a.createElement("ul",r,o)}return null}(),u=i({ref:X,className:oe("panel"),style:mention_esm_objectSpread({maxHeight:g.scrollHeight},g.panelStyle),onClick:Ee},re("panel")),v=i({classNames:oe("transition"),in:k,timeout:{enter:120,exit:100},options:g.transitionOptions,unmountOnExit:!0,onEnter:de,onEntering:he,onEntered:me,onExit:ve,onExited:ye},re("transition")),b=a.createElement(fe,mention_esm_extends({nodeRef:X},v),a.createElement("div",u,r,c,o));return a.createElement(ge,{element:b,appendTo:"self"})}(),De=i(mention_esm_objectSpread(mention_esm_objectSpread({ref:Q,id:g.inputId,className:oe("input"),style:g.inputStyle},Re),{},{unstyled:g.unstyled,variant:g.variant,autoResize:g.autoResize,onFocus:function onFocus(r){A(!0),g.onFocus&&g.onFocus(r)},onBlur:function onBlur(r){A(!1),g.onBlur&&g.onBlur(r)},onKeyDown:function onKeyDown(r){if(k){var o=u.findSingle(X.current,'li[data-p-highlight="true"]');switch(r.which){case 40:if(o){var i=o.nextElementSibling;if(i){var a=u.index(i),c=u.index(o);G(function(r){var o=mention_esm_toConsumableArray(r);return o[a]=!0,o[c]=!1,o}),u.scrollInView(X.current,i)}}else if(o=u.findSingle(X.current,"li")){var p=u.index(o);G(function(r){var o=mention_esm_toConsumableArray(r);return o[p]=!0,o})}r.preventDefault();break;case 38:if(o){var v=o.previousElementSibling;if(v){var b=u.index(v),E=u.index(o);G(function(r){var o=mention_esm_toConsumableArray(r);return o[b]=!0,o[E]=!1,o}),u.scrollInView(X.current,v)}}r.preventDefault();break;case 8:var w=r.target,x=w.value,C=w.selectionStart;x.substring(C-1,C)===U.key&&pe();break;case 13:o&&Oe(r,g.suggestions[u.index(o)]),r.preventDefault();break;case 27:pe(),r.preventDefault()}}},onInput:function onInput(r){g.onInput&&g.onInput(r);var o=r.target.value.length>0;ie()?u.setAttributes(J.current,{"data-p-inputwrapper-filled":o}):o?u.addClass(J.current,"p-inputwrapper-filled"):u.removeClass(J.current,"p-inputwrapper-filled")},onKeyUp:function onKeyUp(r){37!==r.which&&39!==r.which||xe(r)},onChange:function onChange(r){g.onChange&&g.onChange(r),xe(r)},__parentMetadata:{parent:te}}),re("input")),Le=i({ref:J,id:g.id,className:classNames(g.className,oe("root",{focusedState:P,isFilled:Me})),style:g.style},Te.getOtherProps(g),re("root"));return a.createElement("div",Le,a.createElement(Ce,De),Ie)}));Oe.displayName="Mention"},37820:function(r,o,i){"use strict";function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(r,o,i){var a=function _superPropBase(r,o){for(;!Object.prototype.hasOwnProperty.call(r,o)&&null!==(r=_getPrototypeOf(r)););return r}(r,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(arguments.length<3?r:i):c.value}},_get.apply(this,arguments)}function _inherits(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),o&&_setPrototypeOf(r,o)}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _createSuper(r){var o=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}();return function _createSuperInternal(){var i,a=_getPrototypeOf(r);if(o){var c=_getPrototypeOf(this).constructor;i=Reflect.construct(a,arguments,c)}else i=a.apply(this,arguments);return function _possibleConstructorReturn(r,o){if(o&&("object"===_typeof(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,i)}}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,_toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _toPropertyKey(r){var o=function _toPrimitive(r,o){if("object"!==_typeof(r)||null===r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"===_typeof(o)?o:String(o)}var a=i(77712),c=i(36553),u=Object.create(null),p=function(){function Selection(r,o,i){_classCallCheck(this,Selection),this.$anchor=r,this.$head=o,this.ranges=i||[new g(r.min(o),r.max(o))]}return _createClass(Selection,[{key:"anchor",get:function get(){return this.$anchor.pos}},{key:"head",get:function get(){return this.$head.pos}},{key:"from",get:function get(){return this.$from.pos}},{key:"to",get:function get(){return this.$to.pos}},{key:"$from",get:function get(){return this.ranges[0].$from}},{key:"$to",get:function get(){return this.ranges[0].$to}},{key:"empty",get:function get(){for(var r=this.ranges,o=0;o<r.length;o++)if(r[o].$from.pos!=r[o].$to.pos)return!1;return!0}},{key:"content",value:function content(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function replace(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Slice.empty,i=o.content.lastChild,c=null,u=0;u<o.openEnd;u++)c=i,i=i.lastChild;for(var p=r.steps.length,g=this.ranges,v=0;v<g.length;v++){var b=g[v],k=b.$from,E=b.$to,w=r.mapping.slice(p);r.replaceRange(w.map(k.pos),w.map(E.pos),v?a.Slice.empty:o),0==v&&selectionToInsertionEnd(r,p,(i?i.isInline:c&&c.isTextblock)?-1:1)}}},{key:"replaceWith",value:function replaceWith(r,o){for(var i=r.steps.length,a=this.ranges,c=0;c<a.length;c++){var u=a[c],p=u.$from,g=u.$to,v=r.mapping.slice(i),b=v.map(p.pos),k=v.map(g.pos);c?r.deleteRange(b,k):(r.replaceRangeWith(b,k,o),selectionToInsertionEnd(r,i,o.isInline?-1:1))}}},{key:"getBookmark",value:function getBookmark(){return b.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function findFrom(r,o){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=r.parent.inlineContent?new b(r):findSelectionIn(r.node(0),r.parent,r.pos,r.index(),o,i);if(a)return a;for(var c=r.depth-1;c>=0;c--){var u=o<0?findSelectionIn(r.node(0),r.node(c),r.before(c+1),r.index(c),o,i):findSelectionIn(r.node(0),r.node(c),r.after(c+1),r.index(c)+1,o,i);if(u)return u}return null}},{key:"near",value:function near(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(r,o)||this.findFrom(r,-o)||new x(r.node(0))}},{key:"atStart",value:function atStart(r){return findSelectionIn(r,r,0,0,1)||new x(r)}},{key:"atEnd",value:function atEnd(r){return findSelectionIn(r,r,r.content.size,r.childCount,-1)||new x(r)}},{key:"fromJSON",value:function fromJSON(r,o){if(!o||!o.type)throw new RangeError("Invalid input for Selection.fromJSON");var i=u[o.type];if(!i)throw new RangeError("No selection type ".concat(o.type," defined"));return i.fromJSON(r,o)}},{key:"jsonID",value:function jsonID(r,o){if(r in u)throw new RangeError("Duplicate use of selection JSON ID "+r);return u[r]=o,o.prototype.jsonID=r,o}}]),Selection}();p.prototype.visible=!0;var g=_createClass(function SelectionRange(r,o){_classCallCheck(this,SelectionRange),this.$from=r,this.$to=o}),v=!1;function checkTextSelection(r){v||r.parent.inlineContent||(v=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}var b=function(r){_inherits(TextSelection,r);var o=_createSuper(TextSelection);function TextSelection(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;return _classCallCheck(this,TextSelection),checkTextSelection(r),checkTextSelection(i),o.call(this,r,i)}return _createClass(TextSelection,[{key:"$cursor",get:function get(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function map(r,o){var i=r.resolve(o.map(this.head));if(!i.parent.inlineContent)return p.near(i);var a=r.resolve(o.map(this.anchor));return new TextSelection(a.parent.inlineContent?a:i,i)}},{key:"replace",value:function replace(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Slice.empty;if(_get(_getPrototypeOf(TextSelection.prototype),"replace",this).call(this,r,o),o==a.Slice.empty){var i=this.$from.marksAcross(this.$to);i&&r.ensureMarks(i)}}},{key:"eq",value:function eq(r){return r instanceof TextSelection&&r.anchor==this.anchor&&r.head==this.head}},{key:"getBookmark",value:function getBookmark(){return new k(this.anchor,this.head)}},{key:"toJSON",value:function toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.anchor||"number"!=typeof o.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new TextSelection(r.resolve(o.anchor),r.resolve(o.head))}},{key:"create",value:function create(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,a=r.resolve(o);return new this(a,i==o?a:r.resolve(i))}},{key:"between",value:function between(r,o,i){var a=r.pos-o.pos;if(i&&!a||(i=a>=0?1:-1),!o.parent.inlineContent){var c=p.findFrom(o,i,!0)||p.findFrom(o,-i,!0);if(!c)return p.near(o,i);o=c.$head}return r.parent.inlineContent||(0==a||(r=(p.findFrom(r,-i,!0)||p.findFrom(r,i,!0)).$anchor).pos<o.pos!=a<0)&&(r=o),new TextSelection(r,o)}}]),TextSelection}(p);p.jsonID("text",b);var k=function(){function TextBookmark(r,o){_classCallCheck(this,TextBookmark),this.anchor=r,this.head=o}return _createClass(TextBookmark,[{key:"map",value:function map(r){return new TextBookmark(r.map(this.anchor),r.map(this.head))}},{key:"resolve",value:function resolve(r){return b.between(r.resolve(this.anchor),r.resolve(this.head))}}]),TextBookmark}(),E=function(r){_inherits(NodeSelection,r);var o=_createSuper(NodeSelection);function NodeSelection(r){var i;_classCallCheck(this,NodeSelection);var a=r.nodeAfter,c=r.node(0).resolve(r.pos+a.nodeSize);return(i=o.call(this,r,c)).node=a,i}return _createClass(NodeSelection,[{key:"map",value:function map(r,o){var i=o.mapResult(this.anchor),a=i.deleted,c=i.pos,u=r.resolve(c);return a?p.near(u):new NodeSelection(u)}},{key:"content",value:function content(){return new a.Slice(a.Fragment.from(this.node),0,0)}},{key:"eq",value:function eq(r){return r instanceof NodeSelection&&r.anchor==this.anchor}},{key:"toJSON",value:function toJSON(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function getBookmark(){return new w(this.anchor)}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new NodeSelection(r.resolve(o.anchor))}},{key:"create",value:function create(r,o){return new NodeSelection(r.resolve(o))}},{key:"isSelectable",value:function isSelectable(r){return!r.isText&&!1!==r.type.spec.selectable}}]),NodeSelection}(p);E.prototype.visible=!1,p.jsonID("node",E);var w=function(){function NodeBookmark(r){_classCallCheck(this,NodeBookmark),this.anchor=r}return _createClass(NodeBookmark,[{key:"map",value:function map(r){var o=r.mapResult(this.anchor),i=o.deleted,a=o.pos;return i?new k(a,a):new NodeBookmark(a)}},{key:"resolve",value:function resolve(r){var o=r.resolve(this.anchor),i=o.nodeAfter;return i&&E.isSelectable(i)?new E(o):p.near(o)}}]),NodeBookmark}(),x=function(r){_inherits(AllSelection,r);var o=_createSuper(AllSelection);function AllSelection(r){return _classCallCheck(this,AllSelection),o.call(this,r.resolve(0),r.resolve(r.content.size))}return _createClass(AllSelection,[{key:"replace",value:function replace(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Slice.empty;if(o==a.Slice.empty){r.delete(0,r.doc.content.size);var i=p.atStart(r.doc);i.eq(r.selection)||r.setSelection(i)}else _get(_getPrototypeOf(AllSelection.prototype),"replace",this).call(this,r,o)}},{key:"toJSON",value:function toJSON(){return{type:"all"}}},{key:"map",value:function map(r){return new AllSelection(r)}},{key:"eq",value:function eq(r){return r instanceof AllSelection}},{key:"getBookmark",value:function getBookmark(){return C}}],[{key:"fromJSON",value:function fromJSON(r){return new AllSelection(r)}}]),AllSelection}(p);p.jsonID("all",x);var C={map:function map(){return this},resolve:function resolve(r){return new x(r)}};function findSelectionIn(r,o,i,a,c){var u=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(o.inlineContent)return b.create(r,i);for(var p=a-(c>0?0:1);c>0?p<o.childCount:p>=0;p+=c){var g=o.child(p);if(g.isAtom){if(!u&&E.isSelectable(g))return E.create(r,i-(c<0?g.nodeSize:0))}else{var v=findSelectionIn(r,g,i+c,c<0?g.childCount:0,c,u);if(v)return v}i+=g.nodeSize*c}return null}function selectionToInsertionEnd(r,o,i){var a=r.steps.length-1;if(!(a<o)){var u,g=r.steps[a];if(g instanceof c.ReplaceStep||g instanceof c.ReplaceAroundStep)r.mapping.maps[a].forEach(function(r,o,i,a){null==u&&(u=a)}),r.setSelection(p.near(r.doc.resolve(u),i))}}var _=function(r){_inherits(Transaction,r);var o=_createSuper(Transaction);function Transaction(r){var i;return _classCallCheck(this,Transaction),(i=o.call(this,r.doc)).curSelectionFor=0,i.updated=0,i.meta=Object.create(null),i.time=Date.now(),i.curSelection=r.selection,i.storedMarks=r.storedMarks,i}return _createClass(Transaction,[{key:"selection",get:function get(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function setSelection(r){if(r.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=r,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}},{key:"selectionSet",get:function get(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function setStoredMarks(r){return this.storedMarks=r,this.updated|=2,this}},{key:"ensureMarks",value:function ensureMarks(r){return a.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),r)||this.setStoredMarks(r),this}},{key:"addStoredMark",value:function addStoredMark(r){return this.ensureMarks(r.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function removeStoredMark(r){return this.ensureMarks(r.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function get(){return(2&this.updated)>0}},{key:"addStep",value:function addStep(r,o){_get(_getPrototypeOf(Transaction.prototype),"addStep",this).call(this,r,o),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function setTime(r){return this.time=r,this}},{key:"replaceSelection",value:function replaceSelection(r){return this.selection.replace(this,r),this}},{key:"replaceSelectionWith",value:function replaceSelectionWith(r){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.selection;return o&&(r=r.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||a.Mark.none))),i.replaceWith(this,r),this}},{key:"deleteSelection",value:function deleteSelection(){return this.selection.replace(this),this}},{key:"insertText",value:function insertText(r,o,i){var a=this.doc.type.schema;if(null==o)return r?this.replaceSelectionWith(a.text(r),!0):this.deleteSelection();if(null==i&&(i=o),!r)return this.deleteRange(o,i);var c=this.storedMarks;if(!c){var u=this.doc.resolve(o);c=i==o?u.marks():u.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(o,i,a.text(r,c)),this.selection.empty||this.selection.to!=o+r.length||this.setSelection(p.near(this.selection.$to)),this}},{key:"setMeta",value:function setMeta(r,o){return this.meta["string"==typeof r?r:r.key]=o,this}},{key:"getMeta",value:function getMeta(r){return this.meta["string"==typeof r?r:r.key]}},{key:"isGeneric",get:function get(){for(var r in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function scrollIntoView(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function get(){return(4&this.updated)>0}}]),Transaction}(c.Transform);function bind(r,o){return o&&r?r.bind(o):r}var T=_createClass(function FieldDesc(r,o,i){_classCallCheck(this,FieldDesc),this.name=r,this.init=bind(o.init,i),this.apply=bind(o.apply,i)}),P=[new T("doc",{init:function init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply:function apply(r){return r.doc}}),new T("selection",{init:function init(r,o){return r.selection||p.atStart(o.doc)},apply:function apply(r){return r.selection}}),new T("storedMarks",{init:function init(r){return r.storedMarks||null},apply:function apply(r,o,i,a){return a.selection.$cursor?r.storedMarks:null}}),new T("scrollToSelection",{init:function init(){return 0},apply:function apply(r,o){return r.scrolledIntoView?o+1:o}})],A=_createClass(function Configuration(r,o){var i=this;_classCallCheck(this,Configuration),this.schema=r,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=P.slice(),o&&o.forEach(function(r){if(i.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");i.plugins.push(r),i.pluginsByKey[r.key]=r,r.spec.state&&i.fields.push(new T(r.key,r.spec.state,r))})}),N=function(){function EditorState(r){_classCallCheck(this,EditorState),this.config=r}return _createClass(EditorState,[{key:"schema",get:function get(){return this.config.schema}},{key:"plugins",get:function get(){return this.config.plugins}},{key:"apply",value:function apply(r){return this.applyTransaction(r).state}},{key:"filterTransaction",value:function filterTransaction(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=0;i<this.config.plugins.length;i++)if(i!=o){var a=this.config.plugins[i];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,r,this))return!1}return!0}},{key:"applyTransaction",value:function applyTransaction(r){if(!this.filterTransaction(r))return{state:this,transactions:[]};for(var o=[r],i=this.applyInner(r),a=null;;){for(var c=!1,u=0;u<this.config.plugins.length;u++){var p=this.config.plugins[u];if(p.spec.appendTransaction){var g=a?a[u].n:0,v=a?a[u].state:this,b=g<o.length&&p.spec.appendTransaction.call(p,g?o.slice(g):o,v,i);if(b&&i.filterTransaction(b,u)){if(b.setMeta("appendedTransaction",r),!a){a=[];for(var k=0;k<this.config.plugins.length;k++)a.push(k<u?{state:i,n:o.length}:{state:this,n:0})}o.push(b),i=i.applyInner(b),c=!0}a&&(a[u]={state:i,n:o.length})}}if(!c)return{state:i,transactions:o}}}},{key:"applyInner",value:function applyInner(r){if(!r.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var o=new EditorState(this.config),i=this.config.fields,a=0;a<i.length;a++){var c=i[a];o[c.name]=c.apply(r,this[c.name],this,o)}return o}},{key:"tr",get:function get(){return new _(this)}},{key:"reconfigure",value:function reconfigure(r){for(var o=new A(this.schema,r.plugins),i=o.fields,a=new EditorState(o),c=0;c<i.length;c++){var u=i[c].name;a[u]=this.hasOwnProperty(u)?this[u]:i[c].init(r,a)}return a}},{key:"toJSON",value:function toJSON(r){var o={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(o.storedMarks=this.storedMarks.map(function(r){return r.toJSON()})),r&&"object"==_typeof(r))for(var i in r){if("doc"==i||"selection"==i)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var a=r[i],c=a.spec.state;c&&c.toJSON&&(o[i]=c.toJSON.call(a,this[a.key]))}return o}}],[{key:"create",value:function create(r){for(var o=new A(r.doc?r.doc.type.schema:r.schema,r.plugins),i=new EditorState(o),a=0;a<o.fields.length;a++)i[o.fields[a].name]=o.fields[a].init(r,i);return i}},{key:"fromJSON",value:function fromJSON(r,o,i){if(!o)throw new RangeError("Invalid input for EditorState.fromJSON");if(!r.schema)throw new RangeError("Required config field 'schema' missing");var c=new A(r.schema,r.plugins),u=new EditorState(c);return c.fields.forEach(function(c){if("doc"==c.name)u.doc=a.Node.fromJSON(r.schema,o.doc);else if("selection"==c.name)u.selection=p.fromJSON(u.doc,o.selection);else if("storedMarks"==c.name)o.storedMarks&&(u.storedMarks=o.storedMarks.map(r.schema.markFromJSON));else{if(i)for(var g in i){var v=i[g],b=v.spec.state;if(v.key==c.name&&b&&b.fromJSON&&Object.prototype.hasOwnProperty.call(o,g))return void(u[c.name]=b.fromJSON.call(v,r,o[g],u))}u[c.name]=c.init(r,u)}}),u}}]),EditorState}();function bindProps(r,o,i){for(var a in r){var c=r[a];c instanceof Function?c=c.bind(o):"handleDOMEvents"==a&&(c=bindProps(c,o,{})),i[a]=c}return i}var R=function(){function Plugin(r){_classCallCheck(this,Plugin),this.spec=r,this.props={},r.props&&bindProps(r.props,this,this.props),this.key=r.key?r.key.key:createKey("plugin")}return _createClass(Plugin,[{key:"getState",value:function getState(r){return r[this.key]}}]),Plugin}(),I=Object.create(null);function createKey(r){return r in I?r+"$"+ ++I[r]:(I[r]=0,r+"$")}var L=function(){function PluginKey(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";_classCallCheck(this,PluginKey),this.key=createKey(r)}return _createClass(PluginKey,[{key:"get",value:function get(r){return r.config.pluginsByKey[this.key]}},{key:"getState",value:function getState(r){return r[this.key]}}]),PluginKey}();o.AllSelection=x,o.EditorState=N,o.NodeSelection=E,o.Plugin=R,o.PluginKey=L,o.Selection=p,o.SelectionRange=g,o.TextSelection=b,o.Transaction=_},38393:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Strike:()=>w,default:()=>x,inputRegex:()=>k,pasteRegex:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,E=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,w=b.Mark.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>!!r.includes("line-through")&&{}}]},renderHTML({HTMLAttributes:r}){return["s",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},markdownTokenName:"del",parseMarkdown:(r,o)=>o.applyMark("strike",o.parseInline(r.tokens||[])),renderMarkdown:(r,o)=>`~~${o.renderChildren(r)}~~`,addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,b.markInputRule)({find:k,type:this.type})]},addPasteRules(){return[(0,b.markPasteRule)({find:E,type:this.type})]}}),x=w},38882:function(r,o,i){r.exports=i(21765)},39007:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Italic:()=>C,default:()=>_,starInputRegex:()=>k,starPasteRegex:()=>E,underscoreInputRegex:()=>w,underscorePasteRegex:()=>x}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,E=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,w=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,x=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,C=b.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>"normal"!==r.style.fontStyle&&null},{style:"font-style=normal",clearMark:r=>r.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(r,o)=>o.applyMark("italic",o.parseInline(r.tokens||[])),renderMarkdown:(r,o)=>`*${o.renderChildren(r)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,b.markInputRule)({find:k,type:this.type}),(0,b.markInputRule)({find:w,type:this.type})]},addPasteRules(){return[(0,b.markPasteRule)({find:E,type:this.type}),(0,b.markPasteRule)({find:x,type:this.type})]}}),_=C},40002:function(r,o,i){"use strict";var a,c=Object.create,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,__copyProps=(r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of g(o))b.call(r,c)||c===i||u(r,c,{get:()=>o[c],enumerable:!(a=p(o,c))||a.enumerable});return r},__toESM=(r,o,i)=>(i=null!=r?c(v(r)):{},__copyProps(!o&&r&&r.__esModule?i:u(i,"default",{value:r,enumerable:!0}),r)),k={};((r,o)=>{for(var i in o)u(r,i,{get:o[i],enumerable:!0})})(k,{AspectRatioControl:()=>us,AttachmentTypeControl:()=>Kd,AttributesControl:()=>yf,BackgroundControl:()=>Bl,BoxShadowRepeaterControl:()=>cr,ChipsControl:()=>io,ClearIconButton:()=>ClearIconButton,ColorControl:()=>Ft,ControlActions:()=>ControlActions,ControlActionsProvider:()=>ControlActionsProvider,ControlAdornments:()=>ControlAdornments,ControlAdornmentsProvider:()=>ControlAdornmentsProvider,ControlFormLabel:()=>ControlFormLabel,ControlReplacementsProvider:()=>ControlReplacementsProvider,ControlToggleButtonGroup:()=>ControlToggleButtonGroup,DateRangeControl:()=>Dp,DateTimeControl:()=>wp,DisplayConditionsControl:()=>pf,EmailFormActionControl:()=>$d,EqualUnequalSizesControl:()=>EqualUnequalSizesControl,FilterRepeaterControl:()=>Jr,FontFamilyControl:()=>Oi,GapControl:()=>GapControl,GridSpanControl:()=>Xd,HtmlTagControl:()=>Aa,ImageControl:()=>Oe,InlineEditingControl:()=>vd,InlineEditor:()=>gd,InlineEditorToolbar:()=>InlineEditorToolbar,ItemSelector:()=>ItemSelector,KeyValueControl:()=>Ql,LinkControl:()=>ga,LinkedDimensionsControl:()=>LinkedDimensionsControl,MentionTextAreaControl:()=>$e,NumberControl:()=>xo,NumberInput:()=>dt,PopoverContent:()=>PopoverContent,PopoverGridContainer:()=>or,PositionControl:()=>PositionControl,PromotionTrigger:()=>lf,PropKeyProvider:()=>PropKeyProvider,PropProvider:()=>PropProvider,QueryChipsControl:()=>Fa,QueryControl:()=>ua,QueryFilterRepeaterControl:()=>Wa,RepeatableControl:()=>ql,Repeater:()=>Repeater3,SelectControl:()=>_e,SelectControlWrapper:()=>Zr,SizeComponent:()=>SizeComponent,SizeControl:()=>_t,StrokeControl:()=>jt,StyledToggleButton:()=>go,StyledToggleButtonGroup:()=>mo,SvgMediaControl:()=>Is,SwitchControl:()=>ha,TextAreaControl:()=>Le,TextControl:()=>Ne,TimeRangeControl:()=>Wp,TimeStringControl:()=>jp,ToggleButtonGroupUi:()=>vo,ToggleControl:()=>ko,TransformRepeaterControl:()=>Lu,TransformSettingsControl:()=>TransformSettingsControl,TransitionRepeaterControl:()=>vp,UnstableSizeControl:()=>mi,UnstableSizeField:()=>UnstableSizeField,UrlControl:()=>Ni,VideoMediaControl:()=>$s,createControl:()=>createControl,createControlReplacementsRegistry:()=>createControlReplacementsRegistry,enqueueFont:()=>enqueueFont,getControlReplacements:()=>re,injectIntoRepeaterItemActions:()=>Mn,injectIntoRepeaterItemIcon:()=>Tn,injectIntoRepeaterItemLabel:()=>Pn,isUnitExtendedOption:()=>isUnitExtendedOption,registerControlReplacement:()=>ne,trackUpgradePromotionClick:()=>trackUpgradePromotionClick,trackViewPromotion:()=>trackViewPromotion,transitionProperties:()=>Zu,transitionsItemsList:()=>ep,useBoundProp:()=>useBoundProp,useControlActions:()=>useControlActions,useControlReplacement:()=>useControlReplacement,useFontFamilies:()=>useFontFamilies,useSyncExternalState:()=>useSyncExternalState,useTypingBuffer:()=>useTypingBuffer}),r.exports=(a=k,__copyProps(u({},"__esModule",{value:!0}),a));var E=__toESM(i(97557)),w=i(2020),x=i(79513),C=i(27723),_=__toESM(i(97557)),T=i(97557),P=i(22444),A=(0,P.createError)({code:"missing_prop_provider_prop_type",message:"Prop type is missing"}),N=(0,P.createError)({code:"unsupported_prop_provider_prop_type",message:"Parent prop type is not supported"}),R=(0,P.createError)({code:"hook_outside_provider",message:"Hook used outside of provider"}),I=(0,T.createContext)(null),PropProvider=({children:r,value:o,setValue:i,propType:a,placeholder:c,baseValue:u,isDisabled:p})=>_.createElement(I.Provider,{value:{value:o,propType:a,setValue:i,placeholder:c,baseValue:u,isDisabled:p}},r),usePropContext=()=>{const r=(0,T.useContext)(I);if(!r)throw new R({context:{hook:"usePropContext",provider:"PropProvider"}});return r},L=__toESM(i(97557)),z=i(97557),j=(0,z.createContext)(null),PropKeyProvider=({children:r,bind:o})=>{const{propType:i}=usePropContext();if(!i)throw new A({context:{bind:o}});if("array"===i.kind)return L.createElement(ArrayPropKeyProvider,{bind:o},r);if("object"===i.kind)return L.createElement(ObjectPropKeyProvider,{bind:o},r);throw new N({context:{propType:i}})},ObjectPropKeyProvider=({children:r,bind:o})=>{const i=usePropContext(),{path:a}=(0,z.useContext)(j)??{},c=i.value?.[o],u=i.placeholder?.[o],p=i.baseValue?.[o],g=i.propType.shape[o];return L.createElement(j.Provider,{value:{...i,value:c,setValue:(r,a,c)=>{const u={...i.value??i.baseValue,[o]:r};return i?.setValue(u,a,{...c,bind:o})},placeholder:u,baseValue:p,bind:o,propType:g,path:[...a??[],o]}},r)},ArrayPropKeyProvider=({children:r,bind:o})=>{const i=usePropContext(),{path:a}=(0,z.useContext)(j)??{},c=i.value?.[Number(o)],u=i.placeholder?.[Number(o)],p=i.baseValue?.[Number(o)],g=i.propType.item_prop_type;return L.createElement(j.Provider,{value:{...i,value:c,setValue:(r,a)=>{const c=[...i.value??i.baseValue??[]];return c[Number(o)]=r,i?.setValue(c,a,{bind:o})},bind:o,propType:g,path:[...a??[],o],placeholder:u??void 0,baseValue:p??void 0}},r)},usePropKeyContext=()=>{const r=(0,z.useContext)(j);if(!r)throw new R({context:{hook:"usePropKeyContext",provider:"PropKeyProvider"}});return r},B=i(97557);function useBoundProp(r){const o=usePropKeyContext(),{isValid:i,validate:a,restoreValue:c}=useValidation(o.propType),u=o.isDisabled?.(o.propType),resetValue=()=>{o.setValue(o.propType.initial_value??null)};if(!r)return{...o,disabled:u,resetValue:resetValue};const p=resolveUnionPropType(o.propType,r.key),g=void 0!==o.baseValue&&null!==o.baseValue?null:p.default,v=r.extract(o.value??g??null),b=r.extract(o.baseValue??null),k=r.extract(o.placeholder??o.baseValue??null);return{...o,propType:p,setValue:function setValue(i,c,u){if(a(i,u?.validation))return null===i?o?.setValue(null,c,u):o?.setValue(r?.create(i,c),{},u)},value:i?v:null,restoreValue:c,placeholder:k,baseValue:b,disabled:u,resetValue:resetValue}}var useValidation=r=>{const[o,i]=(0,B.useState)(!0);return{isValid:o,setIsValid:i,validate:(o,a)=>{let c=!0;return r.settings.required&&null===o&&(c=!1),a&&!a(o)&&(c=!1),i(c),c},restoreValue:()=>i(!0)}},resolveUnionPropType=(r,o)=>{let i=r;if("union"===r.kind&&(i=r.prop_types[o]),!i)throw new A({context:{key:o}});return i},V=__toESM(i(97557)),U=i(79513),ControlFormLabel=r=>V.createElement(U.FormLabel,{size:"tiny",...r}),H=__toESM(i(97557)),W=i(79513),K=__toESM(i(97557)),G=__toESM(i(97557)),J=i(97557),Y=(0,J.createContext)(null),ControlAdornmentsProvider=({children:r,items:o})=>G.createElement(Y.Provider,{value:{items:o}},r),useControlAdornments=()=>{const r=(0,J.useContext)(Y);return r?.items??[]};function ControlAdornments({customContext:r}){const o=useControlAdornments();return 0===o?.length?null:K.createElement(K.Fragment,null,o.map(({Adornment:o,id:i})=>K.createElement(o,{key:i,customContext:r})))}var ControlLabel=({children:r,...o})=>H.createElement(W.Stack,{direction:"row",alignItems:"center",justifyItems:"start",gap:.25},H.createElement(ControlFormLabel,{...o},r),H.createElement(ControlAdornments,null)),X=__toESM(i(97557)),Q=i(79513),Z=__toESM(i(97557)),ee=i(97557),te=(0,ee.createContext)([]),ControlReplacementsProvider=({replacements:r,children:o})=>Z.createElement(te.Provider,{value:r},o),useControlReplacement=r=>{const{value:o,placeholder:i}=useBoundProp(),a=(0,ee.useContext)(te);try{const c=a.find(r=>r.condition({value:o,placeholder:i}));return{ControlToRender:c?.component??r,OriginalControl:r,isReplaced:!!c}}catch{return{ControlToRender:r,OriginalControl:r}}},createControlReplacementsRegistry=()=>{const r=[];return{registerControlReplacement:function registerControlReplacement2(o){r.push(o)},getControlReplacements:function getControlReplacements2(){return r}}},{registerControlReplacement:ne,getControlReplacements:re}=createControlReplacementsRegistry();function createControl(r){return o=>{const{ControlToRender:i,OriginalControl:a,isReplaced:c}=useControlReplacement(r),u=c?{...o,OriginalControl:a}:o;return X.createElement(Q.ErrorBoundary,{fallback:null},X.createElement(i,{...u}))}}var oe=i(45643),ie=i(18998),ae="elementor/v1/settings",apiClient_getElementorSetting=r=>(0,ie.httpService)().get(`${ae}/${r}`).then(r=>formatSettingResponse(r.data)),apiClient_updateElementorSetting=(r,o)=>(0,ie.httpService)().put(`${ae}/${r}`,{value:o}),formatSettingResponse=r=>r.data.value,se="elementor_unfiltered_files_upload",le={queryKey:[se]},useUnfilteredFilesUpload=()=>(0,oe.useQuery)({...le,queryFn:()=>apiClient_getElementorSetting(se).then(r=>formatResponse(r)),staleTime:1/0});var formatResponse=r=>Boolean("1"===r),ce=__toESM(i(97557)),ue=i(2020),pe=i(24413),de=i(79513),fe=i(84792),he=i(27723),me=__toESM(i(97557)),ge=i(70374),ve=__toESM(i(97557)),ye=i(97557),be=(0,ye.createContext)(null),ControlActionsProvider=({children:r,items:o})=>ve.createElement(be.Provider,{value:{items:o}},r),useControlActions=()=>{const r=(0,ye.useContext)(be);if(!r)throw new Error("useControlActions must be used within a ControlActionsProvider");return r};function ControlActions({children:r}){const{items:o}=useControlActions(),{disabled:i}=useBoundProp();if(0===o.length||i)return r;const a=o.map(({MenuItem:r,id:o})=>me.createElement(r,{key:o}));return me.createElement(ge.FloatingActionsBar,{actions:a},r)}var ke=createControl(({mediaTypes:r=["image"]})=>{const{value:o,setValue:i,propType:a,placeholder:c}=useBoundProp(ue.imageSrcPropTypeUtil),{id:u,url:p}=o??{},{data:g,isFetching:v}=(0,fe.useWpMediaAttachment)(u?.value||null),{data:b}=(0,fe.useWpMediaAttachment)(c?.id?.value||null),k=g?.url??p?.value??b?.url??null,E=ue.imageSrcPropTypeUtil.extract(a.default??null)?.url?.value,w=p?.value&&p.value!==E?p.value:void 0,x=o?.alt?.value,{open:C}=(0,fe.useWpMediaFrame)({mediaTypes:r,multiple:!1,selected:u?.value||null,allowUrlImport:!0,onSelect:r=>{i({id:{$$type:"image-attachment-id",value:r.id},url:null})},onSelectUrl:(r,o)=>{i({id:null,url:ue.urlPropTypeUtil.create(r),alt:o?ue.stringPropTypeUtil.create(o):null})}});return ce.createElement(ControlActions,null,ce.createElement(de.Card,{variant:"outlined"},ce.createElement(de.CardMedia,{image:k,sx:{height:a.meta.isDynamic?134:150}},v?ce.createElement(de.Stack,{justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},ce.createElement(de.CircularProgress,null)):ce.createElement(ce.Fragment,null)),ce.createElement(de.CardOverlay,null,ce.createElement(de.Stack,{gap:1},ce.createElement(de.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>C({mode:"browse"})},(0,he.__)("Select image","elementor")),ce.createElement(de.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:ce.createElement(pe.UploadIcon,null),onClick:()=>C({mode:"upload"})},(0,he.__)("Upload","elementor")),ce.createElement(de.Button,{size:"tiny",variant:"text",color:"inherit",onClick:()=>C({mode:"url",currentUrl:w,currentAlt:x})},(0,he.__)("Insert from URL","elementor"))))))}),Ee=__toESM(i(97557)),Se=i(2020),we=i(70374),xe=i(79513),Ce={MenuListProps:{sx:{maxHeight:"160px"}}},_e=createControl(({options:r=[],groups:o=[],onChange:i,MenuProps:a=Ce,ariaLabel:c})=>{const{value:u,setValue:p,disabled:g,placeholder:v}=useBoundProp(Se.stringPropTypeUtil),b=function flattenGroupedOptions(r,o){if(!o.length)return r;return o.flatMap(r=>r.options)}(r,o),k=g||0===b.length;return Ee.createElement(ControlActions,null,Ee.createElement(xe.Select,{sx:{overflow:"hidden"},displayEmpty:!0,size:"tiny",MenuProps:a,"aria-label":c||v,renderValue:r=>getSelectRenderValue(b,v,r),value:u??"",onChange:r=>{const o=r.target.value||null;i?.(o,u),p(o)},disabled:k,fullWidth:!0},o.length?o.flatMap(r=>function renderGroup(r){return[Ee.createElement(xe.MenuSubheader,{key:`group-${r.label}`,sx:{fontWeight:400,color:"text.tertiary"}},r.label),...r.options.map(r=>renderOption(r,!0))]}(r)):r.map(r=>renderOption(r))))}),Te=3.5;function renderOption({label:r,...o},i=!1){return Ee.createElement(we.MenuListItem,{key:o.value,...o,value:o.value??"",sx:i?{pl:Te}:void 0},r)}function getSelectRenderValue(r,o,i){const optionWithValue=o=>r.find(({value:r})=>r===o);if(!isUnsetSelectValue(i))return optionWithValue(i)?.label??i;if(o){const r=optionWithValue(o)?.label??o;return Ee.createElement(xe.Typography,{component:"span",variant:"inherit",color:"text.tertiary"},r)}return r.find(({value:r})=>isUnsetSelectValue(r))?.label??""}function isUnsetSelectValue(r){return null==r||""===r}var Oe=createControl(({sizes:r,label:o=(0,C.__)("Image","elementor")})=>{const i=useBoundProp(w.imagePropTypeUtil);return E.createElement(PropProvider,{...i},E.createElement(x.Stack,{gap:1.5},E.createElement(ControlLabel,null,o),E.createElement(ImageSrcControl,null),E.createElement(x.Grid,{container:!0,gap:1.5,alignItems:"center",flexWrap:"nowrap"},E.createElement(x.Grid,{item:!0,xs:6},E.createElement(ControlFormLabel,null,(0,C.__)("Resolution","elementor"))),E.createElement(x.Grid,{item:!0,xs:6,sx:{overflow:"hidden"}},E.createElement(ImageSizeControl,{sizes:r})))))}),ImageSrcControl=()=>{const{data:r}=useUnfilteredFilesUpload(),o=r?["image","svg"]:["image"];return E.createElement(PropKeyProvider,{bind:"src"},E.createElement(ke,{mediaTypes:o}))},ImageSizeControl=({sizes:r})=>E.createElement(PropKeyProvider,{bind:"size"},E.createElement(_e,{options:r})),Pe=__toESM(i(97557)),Ae=i(2020),Me=i(79513),Ne=createControl(({placeholder:r,error:o,inputValue:i,inputDisabled:a,helperText:c,sx:u,ariaLabel:p})=>{const{value:g,setValue:v,disabled:b,placeholder:k}=useBoundProp(Ae.stringPropTypeUtil),E=r??k??void 0;return Pe.createElement(ControlActions,null,Pe.createElement(Me.TextField,{size:"tiny",fullWidth:!0,disabled:a??b,value:i??g??"",onChange:r=>v(r.target.value),placeholder:E,error:o,helperText:c,sx:u,inputProps:{...p?{"aria-label":p}:{}}}))}),Re=__toESM(i(97557)),Ie=i(2020),De=i(79513),Le=createControl(({placeholder:r,ariaLabel:o})=>{const{value:i,setValue:a,disabled:c,placeholder:u}=useBoundProp(Ie.stringPropTypeUtil),p=r??u??void 0;return Re.createElement(ControlActions,null,Re.createElement(De.TextField,{size:"tiny",multiline:!0,fullWidth:!0,minRows:5,disabled:c,value:i??"",onChange:r=>{a(r.target.value)},placeholder:p,inputProps:{...o?{"aria-label":o}:{}}}))}),Fe=__toESM(i(97557)),ze=i(97557),je=i(37112),Be=i(2020),Ve=(0,i(79513).styled)("div")(({theme:r})=>({position:"relative","& .p-mention":{width:"100%",position:"relative"},"& textarea":{width:"100%",boxSizing:"border-box",fontFamily:"inherit",fontSize:r.typography.pxToRem(12),lineHeight:1.4375,padding:"4px 8px",borderRadius:r.shape.borderRadius,border:`1px solid ${r.palette.divider}`,backgroundColor:"transparent",color:"inherit",resize:"vertical",outline:"none",transition:"border-color 150ms ease-in-out","&:hover":{borderColor:r.palette.action.active},"&:focus":{borderColor:r.palette.primary.main,borderWidth:2,padding:"3px 7px"},"&:disabled":{opacity:.38,cursor:"default"},"&::placeholder":{color:"inherit",opacity:.5}},"& .p-mention-panel":{fontFamily:"inherit",fontSize:r.typography.pxToRem(12),backgroundColor:r.palette.background.paper,border:`1px solid ${r.palette.divider}`,borderRadius:r.shape.borderRadius,boxShadow:r.shadows[4],maxHeight:"200px",overflow:"auto",zIndex:r.zIndex.modal,maxWidth:"100%",right:0,left:"auto !important"},"& .p-mention-items":{listStyle:"none",margin:0,padding:"4px 0"},"& .p-mention-item":{padding:"6px 12px",cursor:"pointer",color:r.palette.text.primary,"&:hover":{backgroundColor:r.palette.action.hover},"&.p-highlight":{backgroundColor:r.palette.action.selected}},'&[data-single-line="true"] textarea':{resize:"none"}}));function createMentionPattern(r,o){const i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`${"start"===o?"^":""}@${i}(?=\\s|$|[^a-zA-Z0-9_-])`,"g")}var $e=createControl(({placeholder:r,ariaLabel:o,suggestions:i,rows:a=5,triggerPosition:c="auto"})=>{const{value:u,setValue:p,disabled:g}=useBoundProp(Be.stringPropTypeUtil),[v,b]=(0,ze.useState)([]),k=(0,ze.useCallback)(r=>{let o=r;for(const r of i){const i=createMentionPattern(r.value,c);o=o.replace(i,`[${r.value}]`)}return o},[i,c]),E=(0,ze.useCallback)(r=>{const o=r.target.value,i=k(o);p(i)},[p,k]),w=(0,ze.useCallback)(r=>{if("start"===c){if(0!==r.originalEvent.target.selectionStart-r.query.length-r.trigger.length)return void b([])}const o=r.query.toLowerCase(),a=i.filter(r=>r.label.toLowerCase().includes(o)||r.value.toLowerCase().includes(o));b(a)},[i,c]);return Fe.createElement(ControlActions,null,Fe.createElement(Ve,{"data-single-line":1===a?"true":void 0},Fe.createElement(je.Mention,{value:u??"",onChange:E,suggestions:v,onSearch:w,field:"value",trigger:"@",rows:a,disabled:g,placeholder:r,itemTemplate:SuggestionItem,...o?{"aria-label":o}:{}})))}),SuggestionItem=r=>Fe.createElement("span",null,r.label),Ue=__toESM(i(97557)),He=i(97557),We=i(2020),qe=i(74518),Ke=i(79513),Ge=__toESM(i(97557)),Je=i(24413),Ye=i(79513),Xe=i(97557);function useTypingBuffer(r={}){const{limit:o=3,timeout:i=600}=r,a=(0,Xe.useRef)(""),c=(0,Xe.useRef)(null);return(0,Xe.useEffect)(()=>()=>{a.current="",c.current&&(clearTimeout(c.current),c.current=null)},[]),{buffer:a.current,appendKey:r=>(a.current=(a.current+r).slice(-o),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{a.current="",c.current=null},i),a.current),startsWith:(r,o)=>!(3<r.length&&2>o.length)&&r.startsWith(o)}}var Qe=["px","%","em","rem","vw","vh","ch"],Ze="px",et=NaN,nt=["auto","custom"];function isUnitExtendedOption(r){return nt.includes(r)}var rt=__toESM(i(97557)),ot=i(97557),it=i(2020),at=i(70374),st=i(79513),lt=__toESM(i(97557)),ct=i(97557),ut=i(79513),pt=["e","E","+"],dt=(0,ct.forwardRef)((r,o)=>{const[i,a]=(0,ct.useState)(0);return lt.createElement(ut.TextField,{...r,ref:o,key:i,onKeyDown:o=>{!function blockRestrictedKeys(r,o){const i=[...pt];o>=0&&i.push("-");i.includes(r.key)&&r.preventDefault()}(o,r.inputProps?.min),r.onKeyDown?.(o)},onBlur:o=>{r.onBlur?.(o);const{valid:i}=o.target.validity;i||a(r=>r+1)}})});var ft=(0,ot.forwardRef)(({placeholder:r,type:o,value:i,onChange:a,onBlur:c,onKeyDown:u,onKeyUp:p,InputProps:g,inputProps:v,disabled:b,isPopoverOpen:k,id:E},w)=>{const{placeholder:x}=useBoundProp(it.sizePropTypeUtil);return rt.createElement(dt,{ref:w,sx:{input:{cursor:g.readOnly?"default !important":void 0}},size:"tiny",fullWidth:!0,type:o,value:i,onInput:a,onKeyDown:u,onKeyUp:p,disabled:b,onBlur:c,focused:!!k||void 0,placeholder:r??(String(x?.size??"")||void 0),InputProps:g,inputProps:v,id:E})}),SelectionEndAdornment=({options:r,alternativeOptionLabels:o={},onClick:i,value:a,menuItemsAttributes:c={},disabled:u})=>{const p=(0,st.usePopupState)({variant:"popover",popupId:(0,ot.useId)()}),{placeholder:g,showPrimaryColor:v}=function useUnitPlaceholder(r){const{value:o,placeholder:i}=useBoundProp(it.sizePropTypeUtil),a=o?.size,c=o?.unit,u="custom"===r&&Boolean(a),p="auto"===r,g=p||u||Boolean(a);if(!i)return{placeholder:null,showPrimaryColor:g};const v=!c&&r===Ze;return{placeholder:v?i.unit:void 0,showPrimaryColor:g}}(a),b={display:"flex",flexDirection:"column",justifyContent:"center"};return rt.createElement(st.InputAdornment,{position:"end"},rt.createElement(ht,{isPrimaryColor:v,size:"small",disabled:u,...(0,st.bindTrigger)(p)},g??o[a]??a),rt.createElement(st.Menu,{MenuListProps:{dense:!0},...(0,st.bindMenu)(p)},r.map((a,u)=>rt.createElement(at.MenuListItem,{key:a,onClick:()=>(o=>{i(r[o]),p.close()})(u),...c?.[a],primaryTypographyProps:{variant:"caption",sx:{...b,lineHeight:"1"}},menuItemTextProps:{sx:b}},o[a]??a.toUpperCase()))))};var ht=(0,st.styled)(st.Button,{shouldForwardProp:r=>"isPrimaryColor"!==r})(({isPrimaryColor:r,theme:o})=>({color:r?o.palette.text.primary:o.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),SizeInput=({units:r,handleUnitChange:o,handleSizeChange:i,placeholder:a,startIcon:c,onBlur:u,onFocus:p,onClick:g,size:v,unit:b,popupState:k,disabled:E,min:w,id:x,ariaLabel:C})=>{const{appendKey:_,startsWith:T}=useTypingBuffer(),P=isUnitExtendedOption(b)?"text":"number",A=!isUnitExtendedOption(b)&&Number.isNaN(v)?"":v??"",N={"aria-controls":k.isOpen?k.popupId:void 0,"aria-haspopup":!0},R=r.includes("custom")?{custom:N}:void 0,I={custom:Ge.createElement(Je.MathFunctionIcon,{fontSize:"tiny"})},L={...N,readOnly:isUnitExtendedOption(b),autoComplete:"off",onClick:g,onFocus:p,startAdornment:c?Ge.createElement(Ye.InputAdornment,{position:"start",disabled:E},c):void 0,endAdornment:Ge.createElement(SelectionEndAdornment,{disabled:E,options:r,onClick:o,value:b,alternativeOptionLabels:I,menuItemsAttributes:R})};return Ge.createElement(ControlActions,null,Ge.createElement(Ye.Box,null,Ge.createElement(ft,{disabled:E,placeholder:a,type:P,value:A,onChange:i,onKeyDown:i=>{const{key:a,altKey:c,ctrlKey:u,metaKey:p}=i;if(c||u||p)return;if(isUnitExtendedOption(b)&&!isNaN(Number(a))){const i=r?.[0];return void(i&&o(i))}if(!/^[a-zA-Z%]$/.test(a))return;i.preventDefault();const g=a.toLowerCase(),v=_(g),k=r.find(r=>T(r,v));k&&o(k)},onBlur:u,InputProps:L,inputProps:{min:w,step:"any","aria-label":C},isPopoverOpen:k.isOpen,id:x})))},mt=__toESM(i(97557)),gt=i(97557),vt=i(70374),yt=i(24413),bt=i(79513),kt=i(27723),TextFieldPopover=r=>{const{popupState:o,restoreValue:i,anchorRef:a,value:c,onChange:u}=r,p=(0,gt.useRef)(null);(0,gt.useEffect)(()=>{o.isOpen&&requestAnimationFrame(()=>{p.current&&p.current.focus()})},[o.isOpen]);const handleClose=()=>{i(),o.close()};return mt.createElement(bt.Popover,{disablePortal:!0,slotProps:{paper:{sx:{borderRadius:2,width:a.current?.offsetWidth+"px"}}},...(0,bt.bindPopover)(o),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onClose:handleClose},mt.createElement(vt.PopoverHeader,{title:(0,kt.__)("CSS function","elementor"),onClose:handleClose,icon:mt.createElement(yt.MathFunctionIcon,{fontSize:"tiny"})}),mt.createElement(bt.TextField,{value:c,onChange:u,onKeyPress:r=>{"enter"===r.key.toLowerCase()&&handleClose()},size:"tiny",type:"text",fullWidth:!0,inputProps:{ref:p},sx:{pt:0,pr:1.5,pb:1.5,pl:1.5}}))},Et=i(97557);var St=i(97557),useSyncExternalState=({external:r,setExternal:o,persistWhen:i,fallback:a})=>{function toInternal(r,o){return r||a(o)}const[c,u]=(0,St.useState)(toInternal(r,null));(0,St.useEffect)(()=>{u(o=>toInternal(r,o))},[r]);return[c,(r,a,p)=>{const g=("function"==typeof r?r:()=>r)(c);u(g),o(function toExternal(r){return i(r)?r:null}(g),a,p)}]},getPropTypeSettings=r=>r.settings,wt={length:"px",angle:"deg",time:"ms"},xt={length:[...Qe],angle:["deg","rad","grad","turn"],time:["s","ms"]},Ct="fx",_t=createControl(({variant:r="length",defaultUnit:o,units:i,placeholder:a,startIcon:c,anchorRef:u,extendedOptions:p,disableCustom:g,min:v=0,enablePropTypeUnits:b=!1,id:k,ariaLabel:E})=>{const{value:w,setValue:x,disabled:C,restoreValue:_,placeholder:T,propType:P}=useBoundProp(We.sizePropTypeUtil),A=o??T?.unit??wt[r],N=(0,qe.useActiveBreakpoint)(),R=function useSizeExtendedOptions(r,o){return(0,Et.useMemo)(()=>{const i=[...r];return o||i.includes("custom")?r.includes("custom")&&i.splice(i.indexOf("custom"),1):i.push("custom"),i},[r,o])}(p||[],g??!1),I=function resolveUnits(r,o,i,a,c){const u=[...xt[i]];if(!o)return[...a??u,...c||[]];return getPropTypeSettings(r)?.available_units??u}(P,b,r,i,R),L=(0,Ke.usePopupState)({variant:"popover"}),z=(0,He.useMemo)(()=>function createStateFromSizeProp(r,o,i="",a=""){const c=r?.unit??o,u=r?.size??i;return{numeric:isUnitExtendedOption(c)||isNaN(Number(u))||!u&&0!==u?et:Number(u),custom:"custom"===c?String(u):a,unit:c}}(w,A),[w,A]),[j,B]=useSyncExternalState({external:z,setExternal:(r,o,i)=>x(extractValueFromState(r),o,i),persistWhen:r=>!!extractValueFromState(r),fallback:r=>({unit:r?.unit??A,numeric:r?.numeric??et,custom:r?.custom??""})}),{size:V=et,unit:U=A}=extractValueFromState(j,!0)||{},handleSizeChange=r=>{const o=r.target.value,i=r.target.validity.valid;"auto"!==U?B(r=>({...r,["custom"===U?"custom":"numeric"]:formatSize(o,U),unit:U}),void 0,{validation:()=>i}):B(r=>({...r,unit:U}))},H=(0,He.useCallback)(()=>{L&&L.isOpen&&L.close()},[L]);return(0,He.useEffect)(()=>{H()},[N]),Ue.createElement(Ue.Fragment,null,Ue.createElement(SizeInput,{disabled:C,size:V,unit:U,units:[...I],placeholder:a,startIcon:c,handleSizeChange:handleSizeChange,handleUnitChange:r=>{"custom"===r&&L.open(u?.current),B(o=>({...o,unit:r}))},onBlur:_,onClick:r=>{r.target.closest("input")&&"custom"===j.unit&&L.open(u?.current)},popupState:L,min:v,id:k,ariaLabel:E}),u?.current&&L.isOpen&&Ue.createElement(TextFieldPopover,{popupState:L,anchorRef:u,restoreValue:_,value:V,onChange:handleSizeChange}))});function formatSize(r,o){return isUnitExtendedOption(o)?"auto"===o?"":String(r??""):r||0===r?Number(r):NaN}function extractValueFromState(r,o=!1){if(!r)return null;if(!r?.unit)return{size:et,unit:Ze};const{unit:i}=r;if("auto"===i)return{size:"",unit:i};if("custom"===i)return{size:r.custom??"",unit:"custom"};const a=r.numeric;return o||null!=a&&!Number.isNaN(a)?{size:a,unit:i}:null}var Tt=__toESM(i(97557)),Ot=i(97557),Pt=i(2020),At=i(79513),Mt=i(27723),Nt=__toESM(i(97557)),Rt=i(79513),SectionContent=({gap:r=.5,sx:o,children:i})=>Nt.createElement(Rt.Stack,{gap:r,sx:{...o}},i),It=__toESM(i(97557)),Dt=i(2020),Lt=i(79513),Ft=createControl(({propTypeUtil:r=Dt.colorPropTypeUtil,anchorEl:o,slotProps:i={},id:a,...c})=>{const{value:u,setValue:p,placeholder:g,disabled:v}=useBoundProp(r),b=c.placeholder??g;return It.createElement(ControlActions,null,It.createElement(Lt.UnstableColorField,{id:a,size:"tiny",fullWidth:!0,value:u??"",placeholder:b??"",onChange:r=>{p(r||null)},...c,disabled:v,slotProps:{...i,colorPicker:{anchorEl:o,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:-10},slotProps:{colorIndicator:{value:u??b??""},colorBox:{value:u??b??""}}}}}))}),zt=["px","em","rem"],jt=createControl(()=>{const r=useBoundProp(Pt.strokePropTypeUtil),o=(0,Ot.useRef)(null);return Tt.createElement(PropProvider,{...r},Tt.createElement(SectionContent,{gap:2},Tt.createElement(Bt,{bind:"width",label:(0,Mt.__)("Stroke width","elementor"),ref:o},Tt.createElement(_t,{units:zt,anchorRef:o})),Tt.createElement(Bt,{bind:"color",label:(0,Mt.__)("Stroke color","elementor")},Tt.createElement(Ft,null))))}),Bt=(0,Ot.forwardRef)(({bind:r,label:o,children:i},a)=>Tt.createElement(PropKeyProvider,{bind:r},Tt.createElement(At.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap",ref:a},Tt.createElement(At.Grid,{item:!0,xs:6},Tt.createElement(ControlFormLabel,null,o)),Tt.createElement(At.Grid,{item:!0,xs:6},i)))),Vt=__toESM(i(97557)),$t=i(97557),Ut=i(2020),Ht=i(79513),Wt=i(27723),qt=__toESM(i(97557)),Kt=i(24413),Gt=i(79513),Jt=i(27723),Yt=__toESM(i(97557)),Xt=i(97557),Qt=i(79513),Zt=i(97557),en=i(74518),usePopoverDismiss=({isOpen:r,onClose:o})=>{const i=(0,Zt.useRef)(o);i.current=o;const a=(0,en.useActiveBreakpoint)(),c=(0,en.useBreakpoints)(),u=(0,Zt.useMemo)(()=>(r=>r.map(r=>[r.id,r.width??"",r.type??""].join(":")).join("|"))(c),[c]),p=(0,Zt.useRef)(void 0),g=(0,Zt.useRef)(null);(0,Zt.useEffect)(()=>{if(!r)return p.current=a,void(g.current=u);const o=p.current,c=g.current;(void 0!==o&&o!==a||null!==c&&c!==u)&&i.current(),p.current=a,g.current=u},[a,u,r]),(0,Zt.useEffect)(()=>{if(!r)return;const onKeyDown=r=>{"Escape"!==r.key||r.defaultPrevented||i.current()};return document.addEventListener("keydown",onKeyDown),()=>{document.removeEventListener("keydown",onKeyDown)}},[r])},tn=new class{listeners=new Map;subscribe(r,o){this.listeners.has(r)||this.listeners.set(r,new Set);const i=this.listeners.get(r);i&&i.add(o)}unsubscribe(r,o){const i=this.listeners.get(r);i&&(i.delete(o),0===i.size&&this.listeners.delete(r))}emit(r,o){const i=this.listeners.get(r);i&&i.forEach(r=>r(o))}clearAll(){this.listeners.clear()}},nn=(0,i(97557).createContext)({index:-1,value:{}}),rn=(0,Xt.createContext)(null),useRepeaterContext=()=>{const r=(0,Xt.useContext)(rn),o=(0,Xt.useContext)(nn);if(!r)throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");return{...r,...o}},RepeaterContextProvider=({children:r,initial:o,propTypeUtil:i,isItemDisabled:a=()=>!1})=>{const{value:c,setValue:u}=useBoundProp(i),[p,g]=useSyncExternalState({external:c,fallback:()=>[],setExternal:u,persistWhen:()=>!0}),[v,b]=(0,Xt.useState)(()=>p?.map(()=>generateUniqueKey())??[]);(0,Xt.useEffect)(()=>{const r=p?.length??0;b(o=>{const i=o.length;return i===r?o:i>r?o.slice(0,r):[...o,...Array.from({length:r-i},generateUniqueKey)]})},[p?.length]);const k=(0,Xt.useMemo)(()=>v.map((r,o)=>({key:r,item:p[o]})).filter(({item:r})=>void 0!==r),[v,p]),[E,w]=(0,Xt.useState)(-1),[x,C]=(0,Xt.useState)(null),_=-1!==E,T=(0,Qt.usePopupState)({variant:"popover"});return usePopoverDismiss({isOpen:_,onClose:()=>{_&&(w(-1),C(null),T.close())}}),Yt.createElement(rn.Provider,{value:{isOpen:_,openItemIndex:E,setOpenItemIndex:w,items:k??[],setItems:r=>{g(r.map(({item:r})=>r))},popoverState:T,initial:o,updateItem:(r,o)=>{const i=[...p.slice(0,o),r,...p.slice(o+1)];g(i)},addItem:(r,a)=>{const c=a?.item??{...o},u=a?.index??p.length,k=generateUniqueKey(),E=[...p];E.splice(u,0,c),g(E),b([...v.slice(0,u),k,...v.slice(u)]),w(u),T.open(x??r),tn.emit(`${i.key}-item-added`,{itemValue:o.value})},removeItem:r=>{const o=p[r];g(p.filter((o,i)=>i!==r)),b(v.filter((o,i)=>i!==r)),tn.emit(`${i.key}-item-removed`,{itemValue:o?.value})},rowRef:x,setRowRef:C,isItemDisabled:r=>a(k[r].item)}},r)},generateUniqueKey=()=>Date.now()+Math.floor(1e6*Math.random()),an="tiny",TooltipAddItemAction=({disabled:r=!1,enableTooltip:o=!1,tooltipContent:i=null,newItemIndex:a,ariaLabel:c})=>{const{addItem:u}=useRepeaterContext();return qt.createElement(ConditionalToolTip,{content:i,enable:o},qt.createElement(Gt.Box,{component:"span",sx:{cursor:r?"not-allowed":"pointer"}},qt.createElement(Gt.IconButton,{size:an,disabled:r,onClick:r=>u(r,{index:a}),"aria-label":(0,Jt.sprintf)((0,Jt.__)("Add %s item","elementor"),c?.toLowerCase())},qt.createElement(Kt.PlusIcon,{fontSize:an}))))},ConditionalToolTip=({children:r,enable:o,content:i})=>o&&i?qt.createElement(Gt.Infotip,{placement:"right",color:"secondary",content:i},r):r,sn=__toESM(i(97557)),ln=__toESM(i(97557)),cn=i(24413),un=i(79513),pn=i(27723),SortableProvider=r=>ln.createElement(un.List,{sx:{p:0,my:-.5,mx:0}},ln.createElement(un.UnstableSortableProvider,{restrictAxis:!0,disableDragOverlay:!1,variant:"static",...r})),SortableItem=({id:r,children:o,disabled:i})=>ln.createElement(un.UnstableSortableItem,{id:r,disabled:i,render:({itemProps:r,triggerProps:a,itemStyle:c,triggerStyle:u,showDropIndication:p,dropIndicationStyle:g})=>ln.createElement(dn,{...r,style:c,tabIndex:-1},!i&&ln.createElement(SortableTrigger,{...a,style:u}),o,p&&ln.createElement(hn,{style:g}))}),dn=(0,un.styled)(un.ListItem)`
2 +!function(){var e={1523:function(e,t,n){"use strict";var r=n(7557),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l(function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})},[e,n,t]),s(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),a(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},3816:function(e,t,n){"use strict";var r=n(7557),o=n(6886),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.useSyncExternalStore,l=r.useRef,a=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=l(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),void 0!==o&&p.hasValue){var t=p.value;if(o(t,e))return l=t}return l=e}if(t=l,i(s,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(s=e,t):(s=e,l=n)}var s,l,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]);var h=s(e,d[0],d[1]);return a(function(){p.hasValue=!0,p.value=h},[h]),u(h),h}},5544:function(e,t,n){"use strict";e.exports=n(3816)},6886:function(e,t,n){"use strict";e.exports=n(1523)},7557:function(e){"use strict";e.exports=window.React},8061:function(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!==o--;){var s=i[o];if(!("_owner"===s&&t.$$typeof||e(t[s],n[s])))return!1}return!0}return t!=t&&n!=n}},9091:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",o="minute",i="hour",s="day",l="week",a="month",c="quarter",u="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,a),i=n-o<0,s=t.clone().add(r+(i?-1:1),a);return+(-(r+(n-o)/(i?o-s:s-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:a,y:u,w:l,d:s,D:d,h:i,m:o,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",v={};v[b]=m;var w="$isDayjsObject",x=function(e){return e instanceof C||!(!e||!e[w])},E=function e(t,n,r){var o;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();v[i]&&(o=i),n&&(v[i]=n,o=i);var s=t.split("-");if(!o&&s.length>1)return e(s[0])}else{var l=t.name;v[l]=t,o=l}return!r&&o&&(b=o),o||!r&&b},k=function(e,t){if(x(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},S=y;S.l=E,S.i=x,S.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function m(e){this.$L=E(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return!(this.$d.toString()===p)},g.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return k(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<k(e)},g.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,c=!!S.u(t)||t,p=S.p(e),h=function(e,t){var r=S.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?r:r.endOf(s)},f=function(e,t){return S.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,y=this.$D,b="set"+(this.$u?"UTC":"");switch(p){case u:return c?h(1,0):h(31,11);case a:return c?h(1,g):h(0,g+1);case l:var v=this.$locale().weekStart||0,w=(m<v?m+7:m)-v;return h(c?y-w:y+(6-w),g);case s:case d:return f(b+"Hours",0);case i:return f(b+"Minutes",1);case o:return f(b+"Seconds",2);case r:return f(b+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var l,c=S.p(e),p="set"+(this.$u?"UTC":""),h=(l={},l[s]=p+"Date",l[d]=p+"Date",l[a]=p+"Month",l[u]=p+"FullYear",l[i]=p+"Hours",l[o]=p+"Minutes",l[r]=p+"Seconds",l[n]=p+"Milliseconds",l)[c],f=c===s?this.$D+(t-this.$W):t;if(c===a||c===u){var m=this.clone().set(d,1);m.$d[h](f),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else h&&this.$d[h](f);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[S.p(e)]()},g.add=function(n,c){var d,p=this;n=Number(n);var h=S.p(c),f=function(e){var t=k(p);return S.w(t.date(t.date()+Math.round(e*n)),p)};if(h===a)return this.set(a,this.$M+n);if(h===u)return this.set(u,this.$y+n);if(h===s)return f(1);if(h===l)return f(7);var m=(d={},d[o]=e,d[i]=t,d[r]=1e3,d)[h]||1,g=this.$d.getTime()+n*m;return S.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=S.z(this),i=this.$H,s=this.$m,l=this.$M,a=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},h=function(e){return S.s(i%12||12,e,"0")},m=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return S.s(t.$y,4,"0");case"M":return l+1;case"MM":return S.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,c,3);case"MMMM":return d(c,l);case"D":return t.$D;case"DD":return S.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,a,2);case"ddd":return d(n.weekdaysShort,t.$W,a,3);case"dddd":return a[t.$W];case"H":return String(i);case"HH":return S.s(i,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return m(i,s,!0);case"A":return m(i,s,!1);case"m":return String(s);case"mm":return S.s(s,2,"0");case"s":return String(t.$s);case"ss":return S.s(t.$s,2,"0");case"SSS":return S.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,d,p){var h,f=this,m=S.p(d),g=k(n),y=(g.utcOffset()-this.utcOffset())*e,b=this-g,v=function(){return S.m(f,g)};switch(m){case u:h=v()/12;break;case a:h=v();break;case c:h=v()/3;break;case l:h=(b-y)/6048e5;break;case s:h=(b-y)/864e5;break;case i:h=b/t;break;case o:h=b/e;break;case r:h=b/1e3;break;default:h=b}return p?h:S.a(h)},g.daysInMonth=function(){return this.endOf(a).$D},g.$locale=function(){return v[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=E(e,t,!0);return r&&(n.$L=r),n},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),T=C.prototype;return k.prototype=T,[["$ms",n],["$s",r],["$m",o],["$H",i],["$W",s],["$M",a],["$y",u],["$D",d]].forEach(function(e){T[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),k.extend=function(e,t){return e.$i||(e(t,C,k),e.$i=!0),k},k.locale=E,k.isDayjs=x,k.unix=function(e){return k(1e3*e)},k.en=v[b],k.Ls=v,k.p={},k}()},9106:function(e,t,n){"use strict";var r=n(7557),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!a.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:l.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},9370:function(e,t,n){"use strict";e.exports=n(9106)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r),n.d(r,{AspectRatioControl:function(){return or},BackgroundControl:function(){return no},BoxShadowRepeaterControl:function(){return Tt},ClearIconButton:function(){return Lm},ColorControl:function(){return Oe},ControlActionsProvider:function(){return U},ControlAdornments:function(){return St},ControlAdornmentsProvider:function(){return Et},ControlFormLabel:function(){return E},ControlReplacementsProvider:function(){return S},ControlToggleButtonGroup:function(){return an},DateTimeControl:function(){return Li},EqualUnequalSizesControl:function(){return bn},FilterRepeaterControl:function(){return Zt},FloatingActionsBar:function(){return L},FontFamilyControl:function(){return On},GapControl:function(){return Qn},HtmlTagControl:function(){return Zn},ImageControl:function(){return Y},InlineEditingControl:function(){return Bm},InlineEditor:function(){return $m},InlineEditorToolbar:function(){return zm},ItemSelector:function(){return kn},KeyValueControl:function(){return yo},LinkControl:function(){return Gn},LinkedDimensionsControl:function(){return wn},NumberControl:function(){return fn},PopoverContent:function(){return vt},PopoverGridContainer:function(){return wt},PositionControl:function(){return vo},PropKeyProvider:function(){return f},PropProvider:function(){return d},QueryControl:function(){return Fn},RepeatableControl:function(){return lo},Repeater:function(){return Um},SelectControl:function(){return K},SelectControlWrapper:function(){return nn},SizeControl:function(){return xe},StrokeControl:function(){return Pe},SvgMediaControl:function(){return vr},SwitchControl:function(){return jn},TextAreaControl:function(){return ee},TextControl:function(){return Q},ToggleButtonGroupUi:function(){return ln},ToggleControl:function(){return pn},TransformRepeaterControl:function(){return fi},TransformSettingsControl:function(){return di},TransitionRepeaterControl:function(){return Ri},UrlControl:function(){return In},createControl:function(){return M},createControlReplacementsRegistry:function(){return T},enqueueFont:function(){return Tn},injectIntoRepeaterItemActions:function(){return ot},injectIntoRepeaterItemIcon:function(){return et},injectIntoRepeaterItemLabel:function(){return nt},transitionProperties:function(){return wi},transitionsItemsList:function(){return xi},useBoundProp:function(){return b},useControlActions:function(){return W},useFloatingActionsBar:function(){return F},useSyncExternalState:function(){return ye}});var e=n(7557),t=window.elementorV2.editorProps,o=window.elementorV2.ui,i=window.wp.i18n,s=window.elementorV2.utils;const l=(0,s.createError)({code:"missing_prop_provider_prop_type",message:"Prop type is missing"}),a=(0,s.createError)({code:"unsupported_prop_provider_prop_type",message:"Parent prop type is not supported"}),c=(0,s.createError)({code:"hook_outside_provider",message:"Hook used outside of provider"}),u=(0,e.createContext)(null),d=({children:t,value:n,setValue:r,propType:o,placeholder:i,isDisabled:s})=>e.createElement(u.Provider,{value:{value:n,propType:o,setValue:r,placeholder:i,isDisabled:s}},t),p=()=>{const t=(0,e.useContext)(u);if(!t)throw new c({context:{hook:"usePropContext",provider:"PropProvider"}});return t},h=(0,e.createContext)(null),f=({children:t,bind:n})=>{const{propType:r}=p();if(!r)throw new l({context:{bind:n}});if("array"===r.kind)return e.createElement(g,{bind:n},t);if("object"===r.kind)return e.createElement(m,{bind:n},t);throw new a({context:{propType:r}})},m=({children:t,bind:n})=>{const r=p(),{path:o}=(0,e.useContext)(h)??{},i=r.value?.[n],s=r.placeholder?.[n],l=r.propType.shape[n];return e.createElement(h.Provider,{value:{...r,value:i,setValue:(e,t,o)=>{const i={...r.value,[n]:e};return r?.setValue(i,t,{...o,bind:n})},placeholder:s,bind:n,propType:l,path:[...o??[],n]}},t)},g=({children:t,bind:n})=>{const r=p(),{path:o}=(0,e.useContext)(h)??{},i=r.value?.[Number(n)],s=r.propType.item_prop_type;return e.createElement(h.Provider,{value:{...r,value:i,setValue:(e,t)=>{const o=[...r.value??[]];return o[Number(n)]=e,r?.setValue(o,t,{bind:n})},bind:n,propType:s,path:[...o??[],n]}},t)},y=()=>{const t=(0,e.useContext)(h);if(!t)throw new c({context:{hook:"usePropKeyContext",provider:"PropKeyProvider"}});return t};function b(e){const t=y(),{isValid:n,validate:r,restoreValue:o}=v(t.propType),i=t.isDisabled?.(t.propType),s=()=>{t.setValue(t.propType.initial_value??null)};if(!e)return{...t,disabled:i,resetValue:s};const l=w(t.propType,e.key),a=e.extract(t.value??l.default??null),c=e.extract(t.placeholder??null);return{...t,propType:l,setValue:function(n,o,i){if(r(n,i?.validation))return null===n?t?.setValue(null,o,i):t?.setValue(e?.create(n,o),{},i)},value:n?a:null,restoreValue:o,placeholder:c,disabled:i,resetValue:s}}const v=t=>{const[n,r]=(0,e.useState)(!0);return{isValid:n,setIsValid:r,validate:(e,n)=>{let o=!0;return t.settings.required&&null===e&&(o=!1),n&&!n(e)&&(o=!1),r(o),o},restoreValue:()=>r(!0)}},w=(e,t)=>{let n=e;if("union"===e.kind&&(n=e.prop_types[t]),!n)throw new l({context:{key:t}});return n};function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(null,arguments)}const E=t=>e.createElement(o.FormLabel,x({size:"tiny"},t)),k=(0,e.createContext)([]),S=({replacements:t,children:n})=>e.createElement(k.Provider,{value:t},n),C=t=>{const{value:n,placeholder:r}=b(),o=(0,e.useContext)(k);try{const e=o.find(e=>e.condition({value:n,placeholder:r}));return e?.component??t}catch{return t}},T=()=>{const e=[];return{registerControlReplacement:function(t){e.push(t)},getControlReplacements:function(){return e}}};function M(t){return n=>{const r=C(t);return e.createElement(o.ErrorBoundary,{fallback:null},e.createElement(r,n))}}Symbol("control");var O=window.elementorV2.query,I=window.elementorV2.httpClient;const P="elementor/v1/settings",N=e=>e.data.value,D="elementor_unfiltered_files_upload",A={queryKey:[D]},_=()=>(0,O.useQuery)({...A,queryFn:()=>{return(e=D,(0,I.httpService)().get(`${P}/${e}`).then(e=>N(e.data))).then(e=>z(e));var e},staleTime:1/0}),z=e=>Boolean("1"===e);var R=window.elementorV2.icons,$=window.elementorV2.wpMedia;const B=(0,o.styled)("span")`
3 + display: contents;
4 +
5 + .MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
6 + display: none;
7 + }
8 +
9 + .MuiFloatingActionBar-popper {
10 + z-index: 1000;
11 + }
12 +`,V=(0,e.createContext)(null);function L({actions:t,children:n}){const[r,i]=(0,e.useState)(!1);return e.createElement(V.Provider,{value:{open:r,setOpen:i}},e.createElement(B,null,e.createElement(o.UnstableFloatingActionBar,{actions:t,open:r||void 0},n)))}function F(){const t=(0,e.useContext)(V);if(!t)throw new Error("useFloatingActions must be used within a FloatingActionsBar");return t}const j=(0,e.createContext)(null),U=({children:t,items:n})=>e.createElement(j.Provider,{value:{items:n}},t),W=()=>{const t=(0,e.useContext)(j);if(!t)throw new Error("useControlActions must be used within a ControlActionsProvider");return t};function G({children:t}){const{items:n}=W(),{disabled:r}=b();if(0===n.length||r)return t;const o=n.map(({MenuItem:t,id:n})=>e.createElement(t,{key:n}));return e.createElement(L,{actions:o},t)}const H=M(({mediaTypes:n=["image"]})=>{const{value:r,setValue:s,propType:l}=b(t.imageSrcPropTypeUtil),{id:a,url:c}=r??{},{data:u,isFetching:d}=(0,$.useWpMediaAttachment)(a?.value||null),p=u?.url??c?.value??null,{open:h}=(0,$.useWpMediaFrame)({mediaTypes:n,multiple:!1,selected:a?.value||null,onSelect:e=>{s({id:{$$type:"image-attachment-id",value:e.id},url:null})}});return e.createElement(G,null,e.createElement(o.Card,{variant:"outlined"},e.createElement(o.CardMedia,{image:p,sx:{height:l.meta.isDynamic?134:150}},d?e.createElement(o.Stack,{justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},e.createElement(o.CircularProgress,null)):e.createElement(e.Fragment,null)),e.createElement(o.CardOverlay,null,e.createElement(o.Stack,{gap:1},e.createElement(o.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>h({mode:"browse"})},(0,i.__)("Select image","elementor")),e.createElement(o.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:e.createElement(R.UploadIcon,null),onClick:()=>h({mode:"upload"})},(0,i.__)("Upload","elementor"))))))});var q=window.elementorV2.editorUi;function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}const K=M(({options:n,onChange:r,MenuProps:i,ariaLabel:s})=>{const{value:l,setValue:a,disabled:c,placeholder:u}=b(t.stringPropTypeUtil),d=c||0===n.length;return e.createElement(G,null,e.createElement(o.Select,{sx:{overflow:"hidden"},displayEmpty:!0,size:"tiny",MenuProps:i,"aria-label":s||u,renderValue:t=>{const r=e=>n.find(t=>t.value===e);if(!t||""===t){if(u){const t=r(u),n=t?.label||u;return e.createElement(o.Typography,{component:"span",variant:"caption",color:"text.tertiary"},n)}return""}const i=r(t);return i?.label||t},value:l??"",onChange:e=>{const t=e.target.value||null;r?.(t,l),a(t)},disabled:d,fullWidth:!0},n.map(({label:t,...n})=>e.createElement(q.MenuListItem,J({key:n.value},n,{value:n.value??""}),t))))}),Y=M(({sizes:n,showMode:r="all"})=>{const s=b(t.imagePropTypeUtil);let l;switch(r){case"media":l=e.createElement(X,null);break;case"sizes":l=e.createElement(Z,{sizes:n});break;default:l=e.createElement(o.Stack,{gap:1.5},e.createElement(E,null,(0,i.__)("Image","elementor")),e.createElement(X,null),e.createElement(o.Grid,{container:!0,gap:1.5,alignItems:"center",flexWrap:"nowrap"},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,(0,i.__)("Resolution","elementor"))),e.createElement(o.Grid,{item:!0,xs:6,sx:{overflow:"hidden"}},e.createElement(Z,{sizes:n}))))}return e.createElement(d,s,l)}),X=()=>{const{data:t}=_(),n=t?["image","svg"]:["image"];return e.createElement(f,{bind:"src"},e.createElement(H,{mediaTypes:n}))},Z=({sizes:t})=>e.createElement(f,{bind:"size"},e.createElement(K,{options:t})),Q=M(({placeholder:n,error:r,inputValue:i,inputDisabled:s,helperText:l,sx:a,ariaLabel:c})=>{const{value:u,setValue:d,disabled:p}=b(t.stringPropTypeUtil);return e.createElement(G,null,e.createElement(o.TextField,{size:"tiny",fullWidth:!0,disabled:s??p,value:i??u??"",onChange:e=>d(e.target.value),placeholder:n,error:r,helperText:l,sx:a,inputProps:{...c?{"aria-label":c}:{}}}))}),ee=M(({placeholder:n,ariaLabel:r})=>{const{value:i,setValue:s,disabled:l}=b(t.stringPropTypeUtil);return e.createElement(G,null,e.createElement(o.TextField,{size:"tiny",multiline:!0,fullWidth:!0,minRows:5,disabled:l,value:i??"",onChange:e=>{s(e.target.value)},placeholder:n,inputProps:{...r?{"aria-label":r}:{}}}))});var te=window.elementorV2.editorResponsive;const ne=["px","%","em","rem","vw","vh"],re=["auto","custom"],oe=NaN;function ie(e){return re.includes(e)}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(null,arguments)}const le=["e","E","+"],ae=(0,e.forwardRef)((t,n)=>{const[r,i]=(0,e.useState)(0);return e.createElement(o.TextField,se({},t,{ref:n,key:r,onKeyDown:e=>{!function(e,t){const n=[...le];t>=0&&n.push("-"),n.includes(e.key)&&e.preventDefault()}(e,t.inputProps?.min),t.onKeyDown?.(e)},onBlur:e=>{t.onBlur?.(e);const{valid:n}=e.target.validity;n||i(e=>e+1)}}))});function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce.apply(null,arguments)}const ue=(0,e.forwardRef)(({placeholder:n,type:r,value:o,onChange:i,onBlur:s,onKeyDown:l,onKeyUp:a,InputProps:c,inputProps:u,disabled:d,isPopoverOpen:p,id:h},f)=>{const{placeholder:m}=b(t.sizePropTypeUtil);return e.createElement(ae,{ref:f,sx:{input:{cursor:c.readOnly?"default !important":void 0}},size:"tiny",fullWidth:!0,type:r,value:o,onInput:i,onKeyDown:l,onKeyUp:a,disabled:d,onBlur:s,focused:!!p||void 0,placeholder:n??(String(m?.size??"")||void 0),InputProps:c,inputProps:u,id:h})}),de=({options:n,alternativeOptionLabels:r={},onClick:i,value:s,menuItemsAttributes:l={},disabled:a})=>{const c=(0,o.usePopupState)({variant:"popover",popupId:(0,e.useId)()}),{placeholder:u,showPrimaryColor:d}=function(e){const{value:n,placeholder:r}=b(t.sizePropTypeUtil),o=n?.size,i=n?.unit,s="custom"===e&&Boolean(o),l="auto"===e||s||Boolean(o);if(!r)return{placeholder:null,showPrimaryColor:l};return{placeholder:!i&&"px"===e?r.unit:void 0,showPrimaryColor:l}}(s),p={display:"flex",flexDirection:"column",justifyContent:"center"};return e.createElement(o.InputAdornment,{position:"end"},e.createElement(pe,ce({isPrimaryColor:d,size:"small",disabled:a},(0,o.bindTrigger)(c)),u??r[s]??s),e.createElement(o.Menu,ce({MenuListProps:{dense:!0}},(0,o.bindMenu)(c)),n.map((t,o)=>e.createElement(q.MenuListItem,ce({key:t,onClick:()=>(e=>{i(n[e]),c.close()})(o)},l?.[t],{primaryTypographyProps:{variant:"caption",sx:{...p,lineHeight:"1"}},menuItemTextProps:{sx:p}}),r[t]??t.toUpperCase()))))},pe=(0,o.styled)(o.Button,{shouldForwardProp:e=>"isPrimaryColor"!==e})(({isPrimaryColor:e,theme:t})=>({color:e?t.palette.text.primary:t.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),he=["auto"],fe=({units:t,handleUnitChange:n,handleSizeChange:r,placeholder:i,startIcon:s,onBlur:l,onFocus:a,onClick:c,size:u,unit:d,popupState:p,disabled:h,min:f,id:m,ariaLabel:g})=>{const y=(0,e.useRef)(""),b=ie(d)?"text":"number",v=!ie(d)&&Number.isNaN(u)?"":u??"",w={"aria-controls":p.isOpen?p.popupId:void 0,"aria-haspopup":!0},x=t.includes("custom")?{custom:w}:void 0,E={custom:e.createElement(R.MathFunctionIcon,{fontSize:"tiny"})},k={...w,readOnly:ie(d),autoComplete:"off",onClick:c,onFocus:a,startAdornment:s?e.createElement(o.InputAdornment,{position:"start",disabled:h},s):void 0,endAdornment:e.createElement(de,{disabled:h,options:t,onClick:n,value:d,alternativeOptionLabels:E,menuItemsAttributes:x})};return e.createElement(G,null,e.createElement(o.Box,null,e.createElement(ue,{disabled:h,placeholder:i,type:b,value:v,onChange:r,onKeyUp:e=>{const{key:r}=e;if(!/^[a-zA-Z%]$/.test(r))return;e.preventDefault();const o=r.toLowerCase(),i=(y.current+o).slice(-3);y.current=i;const s=t.find(e=>!he.includes(e)&&e.includes(i))||t.find(e=>!he.includes(e)&&e.startsWith(o))||t.find(e=>!he.includes(e)&&e.includes(o));s&&n(s)},onBlur:l,InputProps:k,inputProps:{min:f,step:"any","aria-label":g},isPopoverOpen:p.isOpen,id:m})))};function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},me.apply(null,arguments)}const ge=t=>{const{popupState:n,restoreValue:r,anchorRef:s,value:l,onChange:a}=t,c=(0,e.useRef)(null);(0,e.useEffect)(()=>{n.isOpen&&requestAnimationFrame(()=>{c.current&&c.current.focus()})},[n.isOpen]);const u=()=>{r(),n.close()};return e.createElement(o.Popover,me({disablePortal:!0,slotProps:{paper:{sx:{borderRadius:2,width:s.current?.offsetWidth+"px"}}}},(0,o.bindPopover)(n),{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onClose:u}),e.createElement(q.PopoverHeader,{title:(0,i.__)("CSS function","elementor"),onClose:u,icon:e.createElement(R.MathFunctionIcon,{fontSize:"tiny"})}),e.createElement(o.TextField,{value:l,onChange:a,size:"tiny",type:"text",fullWidth:!0,inputProps:{ref:c},sx:{pt:0,pr:1.5,pb:1.5,pl:1.5}}))},ye=({external:t,setExternal:n,persistWhen:r,fallback:o})=>{function i(e,t){return e||o(t)}const[s,l]=(0,e.useState)(i(t,null));return(0,e.useEffect)(()=>{l(e=>i(t,e))},[t]),[s,(e,t,o)=>{const i=("function"==typeof e?e:()=>e)(s);var a;l(i),n(r(a=i)?a:null,t,o)}]},be={length:"px",angle:"deg",time:"ms"},ve={length:[...ne],angle:["deg","rad","grad","turn"],time:["s","ms"]},we="fx",xe=M(({variant:n="length",defaultUnit:r,units:i,placeholder:s,startIcon:l,anchorRef:a,extendedOptions:c,disableCustom:u,min:d=0,enablePropTypeUnits:p=!1,id:h,ariaLabel:f,isRepeaterControl:m=!1})=>{const{value:g,setValue:y,disabled:v,restoreValue:w,placeholder:x,propType:E}=b(t.sizePropTypeUtil),k=r??x?.unit??be[n],S=(0,te.useActiveBreakpoint)(),C=function(e,t,n,r){const o=[...ve[n]];return t?e.settings?.available_units??o:r??o}(E,p,n,i),T=function(t,n){return(0,e.useMemo)(()=>{const e=[...t];return n||e.includes("custom")?t.includes("custom")&&e.splice(e.indexOf("custom"),1):e.push("custom"),e},[t,n])}(c||[],u??!1),M=(0,o.usePopupState)({variant:"popover"}),O=(0,e.useMemo)(()=>ke(g,k),[g,k]),[I,P]=ye({external:O,setExternal:(e,t,n)=>y(Se(e),t,n),persistWhen:e=>!!Se(e),fallback:e=>({unit:e?.unit??k,numeric:e?.numeric??oe,custom:e?.custom??""})}),{size:N=oe,unit:D=k}=Se(I,!0)||{},A=e=>{const t=e.target.value,n=e.target.validity.valid;"auto"!==D?P(e=>({...e,["custom"===D?"custom":"numeric"]:Ee(t,D),unit:D}),void 0,{validation:()=>n}):P(e=>({...e,unit:D}))};return(0,e.useEffect)(()=>{m||(()=>{const e=ke(g,"custom"===I.unit?I.unit:k,"",I.custom),t=ie(I.unit)?"custom":"numeric",n={...I,unit:e.unit??I.unit,[t]:e[t]};"auto"!==n.unit&&Ce(I,n)||(I.unit!==e.unit?P(e):P(n))})()},[g]),(0,e.useEffect)(()=>{const e=ke(g,k,"",I.custom);S&&!Ce(e,I)&&P(e)},[S]),e.createElement(e.Fragment,null,e.createElement(fe,{disabled:v,size:N,unit:D,units:[...C,...T||[]],placeholder:s,startIcon:l,handleSizeChange:A,handleUnitChange:e=>{"custom"===e&&M.open(a?.current),P(t=>({...t,unit:e}))},onBlur:w,onClick:e=>{e.target.closest("input")&&"custom"===I.unit&&M.open(a?.current)},popupState:M,min:d,id:h,ariaLabel:f}),a?.current&&M.isOpen&&e.createElement(ge,{popupState:M,anchorRef:a,restoreValue:w,value:N,onChange:A}))});function Ee(e,t){return ie(t)?"auto"===t?"":String(e??""):e||0===e?Number(e):NaN}function ke(e,t,n="",r=""){const o=e?.unit??t,i=e?.size??n;return{numeric:ie(o)||isNaN(Number(i))||!i&&0!==i?oe:Number(i),custom:"custom"===o?String(i):r,unit:o}}function Se(e,t=!1){if(!e)return null;if(!e?.unit)return{size:oe,unit:"px"};const{unit:n}=e;if("auto"===n)return{size:"",unit:n};if("custom"===n)return{size:e.custom??"",unit:"custom"};const r=e.numeric;return t||null!=r&&!Number.isNaN(r)?{size:r,unit:n}:null}function Ce(e,t){return e.unit===t.unit&&e.custom===t.custom&&(ie(e.unit)?e.custom===t.custom:e.numeric===t.numeric||isNaN(e.numeric)&&isNaN(t.numeric))}const Te=({gap:t=.5,sx:n,children:r})=>e.createElement(o.Stack,{gap:t,sx:{...n}},r);function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Me.apply(null,arguments)}const Oe=M(({propTypeUtil:n=t.colorPropTypeUtil,anchorEl:r,slotProps:i={},id:s,...l})=>{const{value:a,setValue:c,placeholder:u,disabled:d}=b(n),p=l.placeholder??u;return e.createElement(G,null,e.createElement(o.UnstableColorField,Me({id:s,size:"tiny",fullWidth:!0,value:a??"",placeholder:p??"",onChange:e=>{c(e||null)}},l,{disabled:d,slotProps:{...i,colorPicker:{anchorEl:r,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:-10},slotProps:{colorIndicator:{value:a??p??""},colorBox:{value:a??p??""}}}}})))}),Ie=["px","em","rem"],Pe=M(()=>{const n=b(t.strokePropTypeUtil),r=(0,e.useRef)(null);return e.createElement(d,n,e.createElement(Te,null,e.createElement(Ne,{bind:"width",label:(0,i.__)("Stroke width","elementor"),ref:r},e.createElement(xe,{units:Ie,anchorRef:r})),e.createElement(Ne,{bind:"color",label:(0,i.__)("Stroke color","elementor")},e.createElement(Oe,null))))}),Ne=(0,e.forwardRef)(({bind:t,label:n,children:r},i)=>e.createElement(f,{bind:t},e.createElement(o.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap",ref:i},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,n)),e.createElement(o.Grid,{item:!0,xs:6},r)))),De=new class{listeners=new Map;subscribe(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);const n=this.listeners.get(e);n&&n.add(t)}unsubscribe(e,t){const n=this.listeners.get(e);n&&(n.delete(t),0===n.size&&this.listeners.delete(e))}emit(e,t){const n=this.listeners.get(e);n&&n.forEach(e=>e(t))}clearAll(){this.listeners.clear()}},Ae=(0,e.createContext)({index:-1,value:{}}),_e=(0,e.createContext)(null),ze=()=>{const t=e.useContext(_e),n=e.useContext(Ae);if(!t)throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");return{...t,...n}},Re=({children:t,initial:n,propTypeUtil:r,isItemDisabled:i=()=>!1})=>{const{value:s,setValue:l}=b(r),[a,c]=ye({external:s,fallback:()=>[],setExternal:l,persistWhen:()=>!0}),[u,d]=(0,e.useState)(()=>a?.map((e,t)=>t)??[]),p=(0,e.useMemo)(()=>u.map((e,t)=>({key:e,item:a[t]})).filter(({item:e})=>void 0!==e),[u,a]),[h,f]=(0,e.useState)(-1),[m,g]=(0,e.useState)(null),y=-1!==h,v=(0,o.usePopupState)({variant:"popover"});return e.createElement(_e.Provider,{value:{isOpen:y,openItemIndex:h,setOpenItemIndex:f,items:p??[],setItems:e=>{c(e.map(({item:e})=>e))},popoverState:v,initial:n,updateItem:(e,t)=>{const n=[...a.slice(0,t),e,...a.slice(t+1)];c(n)},addItem:(e,t)=>{const o=t?.item??{...n},i=t?.index??a.length,s=$e(),l=[...a];l.splice(i,0,o),c(l),d([...u.slice(0,i),s,...u.slice(i)]),f(i),v.open(m??e),De.emit(`${r.key}-item-added`,{itemValue:n.value})},removeItem:e=>{const t=a[e];c(a.filter((t,n)=>n!==e)),d(u.filter((t,n)=>n!==e)),De.emit(`${r.key}-item-removed`,{itemValue:t?.value})},rowRef:m,setRowRef:g,isItemDisabled:e=>i(p[e].item)}},t)},$e=()=>Date.now()+Math.floor(1e6*Math.random()),Be="tiny",Ve=({disabled:t=!1,enableTooltip:n=!1,tooltipContent:r=null,newItemIndex:s,ariaLabel:l})=>{const{addItem:a}=ze();return e.createElement(Le,{content:r,enable:n},e.createElement(o.Box,{component:"span",sx:{cursor:t?"not-allowed":"pointer"}},e.createElement(o.IconButton,{size:Be,disabled:t,onClick:e=>a(e,{index:s}),"aria-label":(0,i.sprintf)((0,i.__)("Add %s item","elementor"),l?.toLowerCase())},e.createElement(R.PlusIcon,{fontSize:Be}))))},Le=({children:t,enable:n,content:r})=>n&&r?e.createElement(o.Infotip,{placement:"right",color:"secondary",content:r},t):t;function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fe.apply(null,arguments)}const je=t=>e.createElement(o.List,{sx:{p:0,my:-.5,mx:0}},e.createElement(o.UnstableSortableProvider,Fe({restrictAxis:!0,disableDragOverlay:!1,variant:"static"},t))),Ue=({id:t,children:n,disabled:r})=>e.createElement(o.UnstableSortableItem,{id:t,disabled:r,render:({itemProps:t,triggerProps:o,itemStyle:i,triggerStyle:s,showDropIndication:l,dropIndicationStyle:a})=>e.createElement(We,Fe({},t,{style:i,tabIndex:-1}),!r&&e.createElement(Ge,Fe({},o,{style:s})),n,l&&e.createElement(He,{style:a}))}),We=(0,o.styled)(o.ListItem)`
3 13 position: relative;
4 14 margin-inline: 0px;
5 15 padding-inline: 0px;
6 - padding-block: ${({theme:r})=>r.spacing(.5)};
16 + padding-block: ${({theme:e})=>e.spacing(.5)};
7 17
8 18 & .class-item-sortable-trigger {
9 - color: ${({theme:r})=>r.palette.action.active};
19 + color: ${({theme:e})=>e.palette.action.active};
10 20 height: 100%;
11 21 display: flex;
12 22 align-items: center;
13 23 visibility: hidden;
@@ -12,15 +22,15 @@
12 22 align-items: center;
13 23 visibility: hidden;
14 24 position: absolute;
15 25 top: 50%;
16 - padding-inline-end: ${({theme:r})=>r.spacing(.5)};
26 + padding-inline-end: ${({theme:e})=>e.spacing(.5)};
17 27 transform: translate( -75%, -50% );
18 28 }
19 29
20 30 &[aria-describedby=''] > .MuiTag-root {
21 - background-color: ${({theme:r})=>r.palette.background.paper};
22 - box-shadow: ${({theme:r})=>r.shadows[3]};
31 + background-color: ${({theme:e})=>e.palette.background.paper};
32 + box-shadow: ${({theme:e})=>e.shadows[3]};
23 33 }
24 34
25 35 &:hover,
26 36 &:focus-within {
@@ -27,9 +37,9 @@
27 37 & .class-item-sortable-trigger {
28 38 visibility: visible;
29 39 }
30 40 }
31 -`,SortableTrigger=r=>ln.createElement("div",{...r,role:"button",className:"class-item-sortable-trigger",tabIndex:0,"aria-label":(0,pn.__)("Drag item","elementor")},ln.createElement(cn.GripVerticalIcon,{fontSize:"tiny"})),hn=(0,un.styled)(un.Divider)`
41 +`,Ge=t=>e.createElement("div",Fe({},t,{role:"button",className:"class-item-sortable-trigger",tabIndex:0,"aria-label":(0,i.__)("Drag item","elementor")}),e.createElement(R.GripVerticalIcon,{fontSize:"tiny"})),He=(0,o.styled)(o.Divider)`
32 42 height: 0px;
33 43 border: none;
34 44 overflow: visible;
35 45
@@ -39,13 +49,13 @@
39 49 display: block;
40 50 width: 100%;
41 51 height: var( --height );
42 52 margin-block: calc( -1 * var( --height ) / 2 );
43 - border-radius: ${({theme:r})=>r.spacing(.5)};
44 - background-color: ${({theme:r})=>r.palette.text.primary};
53 + border-radius: ${({theme:e})=>e.spacing(.5)};
54 + background-color: ${({theme:e})=>e.palette.text.primary};
45 55 }
46 -`,ItemsContainer=({isSortable:r=!0,children:o})=>{const{items:i,setItems:a}=useRepeaterContext(),c=i.map(({key:r})=>r);if(!o)return null;return sn.createElement(sn.Fragment,null,sn.createElement(SortableProvider,{value:c,onChange:r=>{a(r.map(r=>{const o=i.findIndex(o=>o.key===r);return i[o]}))}},c.map((a,c)=>{const u=i[c].item;return sn.createElement(SortableItem,{id:a,key:`sortable-${a}`,disabled:!r},sn.createElement(nn.Provider,{value:{index:c,value:u}},o))})))},mn=__toESM(i(97557)),gn=i(97557),vn=i(79513),yn=i(27723),bn=i(97557),kn=(0,bn.createContext)(void 0),useRepeatableControlContext=()=>{const r=(0,bn.useContext)(kn);if(!r)throw new Error("useRepeatableControlContext must be used within RepeatableControl");return r},En=__toESM(i(97557)),Sn=i(97557),wn=i(79513),xn=(0,Sn.forwardRef)((r,o)=>En.createElement(wn.UnstableTag,{ref:o,fullWidth:!0,showActionsOnHover:!0,variant:"outlined",sx:{minHeight:r=>r.spacing(3.5)},...r})),Cn=i(87627),{Slot:_n,inject:Tn}=(0,Cn.createReplaceableLocation)(),{Slot:On,inject:Pn}=(0,Cn.createReplaceableLocation)(),{Slot:An,inject:Mn}=(0,Cn.createLocation)(),Item=({Label:r,Icon:o,actions:i})=>{const{popoverState:a,setRowRef:c,openItemIndex:u,setOpenItemIndex:p,index:g=-1,value:v,isItemDisabled:b}=useRepeaterContext(),k=(0,gn.useContext)(kn),E=!!k?.props?.readOnly,w=(0,vn.bindTrigger)(a);return mn.createElement(xn,{ref:r=>{r&&u===g&&r!==a.anchorEl&&(c(r),a.setAnchorEl(r))},label:mn.createElement(On,{value:v},mn.createElement(r,{value:v})),"aria-label":(0,yn.__)("Open item","elementor"),...w,onClick:r=>{E||b(g)||(w.onClick(r),p(g))},startIcon:mn.createElement(_n,{value:v},mn.createElement(o,{value:v})),sx:{minHeight:r=>r.spacing(3.5),...b(g)&&{'[role="button"]':{cursor:"not-allowed"}}},actions:mn.createElement(mn.Fragment,null,mn.createElement(An,{index:g??-1}),i)})},Nn=__toESM(i(97557)),ControlRepeater=({children:r,initial:o,propTypeUtil:i,isItemDisabled:a})=>Nn.createElement(SectionContent,null,Nn.createElement(RepeaterContextProvider,{initial:o,propTypeUtil:i,isItemDisabled:a},r)),Rn=__toESM(i(97557)),In=i(24413),Dn=i(79513),Ln=i(27723),Fn="tiny",DisableItemAction=()=>{const{items:r,updateItem:o,index:i=-1}=useRepeaterContext();if(-1===i)return null;const a=r[i].item.disabled??!1,c=a?(0,Ln.__)("Show","elementor"):(0,Ln.__)("Hide","elementor");return Rn.createElement(Dn.Tooltip,{title:c,placement:"top"},Rn.createElement(Dn.IconButton,{size:Fn,onClick:()=>{const a=structuredClone(r[i].item);a.disabled=!a.disabled,a.disabled||delete a.disabled,o(a,i)},"aria-label":c},a?Rn.createElement(In.EyeOffIcon,{fontSize:Fn}):Rn.createElement(In.EyeIcon,{fontSize:Fn})))},zn=__toESM(i(97557)),jn=i(24413),Bn=i(79513),Vn=i(27723),$n="tiny",DuplicateItemAction=()=>{const{items:r,addItem:o,index:i=-1,isItemDisabled:a}=useRepeaterContext();if(-1===i)return null;const c=(0,Vn.__)("Duplicate","elementor"),u=r[i]?.item;return zn.createElement(Bn.Tooltip,{title:c,placement:"top"},zn.createElement(Bn.IconButton,{size:$n,onClick:r=>{const a=structuredClone(u);o(r,{item:a,index:i+1})},"aria-label":c,disabled:a(i)},zn.createElement(jn.CopyIcon,{fontSize:$n})))},Un=__toESM(i(97557)),Hn=i(24413),Wn=i(79513),qn=i(27723),Kn="tiny",RemoveItemAction=()=>{const{removeItem:r,index:o=-1}=useRepeaterContext();if(-1===o)return null;const i=(0,qn.__)("Remove","elementor");return Un.createElement(Wn.Tooltip,{title:i,placement:"top"},Un.createElement(Wn.IconButton,{size:Kn,onClick:()=>r(o),"aria-label":i},Un.createElement(Hn.XIcon,{fontSize:Kn})))},Gn=__toESM(i(97557)),Jn=i(79513),Yn=__toESM(i(97557)),Xn=i(79513),RepeaterPopover=({children:r,width:o,...i})=>Yn.createElement(Xn.Popover,{disablePortal:!0,disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{marginBlockStart:.5,width:o,overflow:"visible"}}},...i},r),EditItemPopover=({children:r})=>{const{popoverState:o,openItemIndex:i,isOpen:a,rowRef:c,setOpenItemIndex:u,setRowRef:p}=useRepeaterContext();if(!a||!c)return null;return Gn.createElement(RepeaterPopover,{width:c.offsetWidth,...(0,Jn.bindPopover)(o),onClose:()=>{p(null),o.setAnchorEl(null),u(-1)}},Gn.createElement(PropKeyProvider,{bind:String(i)},Gn.createElement(Jn.Box,null,r)))},Qn=__toESM(i(97557)),Zn=i(79513),PopoverContent=({gap:r=1.5,children:o,...i})=>Qn.createElement(Zn.Stack,{...i,gap:r},o),er=i(97557),nr=__toESM(i(97557)),rr=i(79513),or=(0,er.forwardRef)(({gap:r=1.5,alignItems:o="center",flexWrap:i="nowrap",children:a},c)=>nr.createElement(rr.Grid,{container:!0,gap:r,alignItems:o,flexWrap:i,ref:c},a)),ir=__toESM(i(97557)),ar=i(97557),sr=i(79513),lr=(0,ar.forwardRef)(({label:r,children:o,adornment:i=ControlAdornments},a)=>ir.createElement(sr.Stack,{direction:"row",alignItems:"center",gap:1,sx:{marginInlineEnd:-.75,py:.25},ref:a},ir.createElement(sr.Box,{display:"flex",alignItems:"center",gap:1,sx:{flexGrow:1}},ir.createElement(sr.Typography,{component:"label",variant:"caption",color:"text.secondary",sx:{lineHeight:1}},r),ir.createElement(i,null)),o)),cr=createControl(()=>{const{propType:r,value:o,setValue:i,disabled:a}=useBoundProp(Ut.boxShadowPropTypeUtil);return Vt.createElement(PropProvider,{propType:r,value:o,setValue:i,isDisabled:()=>a},Vt.createElement(ControlRepeater,{initial:pr,propTypeUtil:Ut.boxShadowPropTypeUtil},Vt.createElement(lr,{label:(0,Wt.__)("Box shadow","elementor")},Vt.createElement(TooltipAddItemAction,{newItemIndex:0,disabled:a,ariaLabel:"Box shadow"})),Vt.createElement(ItemsContainer,null,Vt.createElement(Item,{Icon:ItemIcon,Label:ItemLabel,actions:Vt.createElement(Vt.Fragment,null,Vt.createElement(DuplicateItemAction,null),Vt.createElement(DisableItemAction,null),Vt.createElement(RemoveItemAction,null))})),Vt.createElement(EditItemPopover,null,Vt.createElement(Content,null))))}),ur=(0,Ht.styled)(Ht.UnstableColorIndicator)(({theme:r})=>({height:"1rem",width:"1rem",borderRadius:r.shape.borderRadius/2+"px"})),ItemIcon=({value:r})=>Vt.createElement(ur,{size:"inherit",component:"span",value:r.value.color?.value}),Content=()=>{const r=useBoundProp(Ut.shadowPropTypeUtil),o=[(0,$t.useRef)(null),(0,$t.useRef)(null)],{rowRef:i}=useRepeaterContext();return Vt.createElement(PropProvider,{...r},Vt.createElement(PopoverContent,{p:1.5},Vt.createElement(or,null,Vt.createElement(Control2,{bind:"color",label:(0,Wt.__)("Color","elementor")},Vt.createElement(Ft,{anchorEl:i})),Vt.createElement(Control2,{bind:"position",label:(0,Wt.__)("Position","elementor"),sx:{overflow:"hidden"}},Vt.createElement(_e,{options:[{label:(0,Wt.__)("Inset","elementor"),value:"inset"},{label:(0,Wt.__)("Outset","elementor"),value:null}]}))),Vt.createElement(or,{ref:o[0]},Vt.createElement(Control2,{bind:"hOffset",label:(0,Wt.__)("Horizontal","elementor")},Vt.createElement(_t,{anchorRef:o[0],min:-Number.MAX_SAFE_INTEGER})),Vt.createElement(Control2,{bind:"vOffset",label:(0,Wt.__)("Vertical","elementor")},Vt.createElement(_t,{anchorRef:o[0],min:-Number.MAX_SAFE_INTEGER}))),Vt.createElement(or,{ref:o[1]},Vt.createElement(Control2,{bind:"blur",label:(0,Wt.__)("Blur","elementor")},Vt.createElement(_t,{anchorRef:o[1]})),Vt.createElement(Control2,{bind:"spread",label:(0,Wt.__)("Spread","elementor")},Vt.createElement(_t,{anchorRef:o[1],min:-Number.MAX_SAFE_INTEGER})))))},Control2=({label:r,bind:o,children:i,sx:a})=>Vt.createElement(PropKeyProvider,{bind:o},Vt.createElement(Ht.Grid,{item:!0,xs:6,sx:a},Vt.createElement(Ht.Grid,{container:!0,gap:.75,alignItems:"center"},Vt.createElement(Ht.Grid,{item:!0,xs:12},Vt.createElement(Ht.FormLabel,{size:"tiny"},r)),Vt.createElement(Ht.Grid,{item:!0,xs:12},i)))),ItemLabel=({value:r})=>{const{position:o,hOffset:i,vOffset:a,blur:c,spread:u}=r.value,{size:p="",unit:g=""}=c?.value||{},{size:v="",unit:b=""}=u?.value||{},{size:k="unset",unit:E=""}=i?.value||{},{size:w="unset",unit:x=""}=a?.value||{},C=o?.value||"outset",_=[[k,E],[w,x],[p,g],[v,b]].map(([r,o])=>"custom"!==o?r+o:r||Ct).join(" ");return Vt.createElement("span",{style:{textTransform:"capitalize"}},C,": ",_)},pr={$$type:"shadow",value:{hOffset:{$$type:"size",value:{unit:"px",size:0}},vOffset:{$$type:"size",value:{unit:"px",size:0}},blur:{$$type:"size",value:{unit:"px",size:10}},spread:{$$type:"size",value:{unit:"px",size:0}},color:{$$type:"color",value:"rgba(0, 0, 0, 1)"},position:null}},dr=__toESM(i(97557)),fr=i(2020),hr=i(27723),mr=__toESM(i(97557)),gr=i(97557),vr=i(2020),yr=i(27723),br=i(27723),kr={blur:{blur:{name:(0,br.__)("Blur","elementor"),valueName:(0,br.__)("Radius","elementor")}},intensity:{brightness:{name:(0,br.__)("Brightness","elementor")},contrast:{name:(0,br.__)("Contrast","elementor")},saturate:{name:(0,br.__)("Saturate","elementor")}},"hue-rotate":{"hue-rotate":{name:(0,br.__)("Hue Rotate","elementor"),valueName:(0,br.__)("Angle","elementor")}},"color-tone":{grayscale:{name:(0,br.__)("Grayscale","elementor")},invert:{name:(0,br.__)("Invert","elementor")},sepia:{name:(0,br.__)("Sepia","elementor")}},"drop-shadow":{"drop-shadow":{name:(0,br.__)("Drop shadow","elementor"),valueName:(0,br.__)("Drop-shadow","elementor")}}},Er=(0,yr.__)("Amount","elementor"),Sr={"drop-shadow":r=>function buildDropShadowDefault(r){const o=r.shape;return{blur:o?.blur?.default,xAxis:o?.xAxis?.default,yAxis:o?.yAxis?.default,color:o?.color?.default??(o?.color).prop_types.color.default}}(r)};function buildFilterConfig(r){const o=Object.entries(kr).flatMap(([o,i])=>Object.entries(i).map(([i,a])=>function createEntry(o,i,{name:a,valueName:c}){const u=function extractPropType(r,o){return r.shape?.args?.prop_types[o]}(r,o),p=Sr[i]?.(u)??function buildSizeDefault(r){const o=r?.shape?.size;return{size:o?.default}}(u),g=function createDefaultValue({filterFunction:r,filterFunctionGroup:o,value:i}){return{$$type:"css-filter-func",value:{func:{$$type:"string",value:r},args:{$$type:o,value:i}}}}({filterFunction:i,filterFunctionGroup:o,value:p});return[i,{name:a,valueName:c??Er,defaultValue:g,filterFunctionGroup:o}]}(o,i,a)));return Object.fromEntries(o)}var wr=(0,gr.createContext)(null);function FilterConfigProvider({children:r}){const o=useBoundProp(vr.cssFilterFunctionPropUtil),i=(0,gr.useMemo)(()=>{const r=buildFilterConfig(o.propType.item_prop_type),i=Object.entries(r).map(([r,o])=>({value:r,label:o.name}));return{config:r,filterOptions:i,getFilterFunctionConfig:o=>r[o],getInitialValue:()=>r.blur.defaultValue}},[o.propType]);return mr.createElement(wr.Provider,{value:i},r)}function useFilterConfig(){const r=(0,gr.useContext)(wr);if(!r)throw new Error("useFilterConfig must be used within FilterConfigProvider");return r}var xr=__toESM(i(97557)),Cr=i(2020),_r=i(79513),Tr=i(27723),Or=__toESM(i(97557)),Pr=i(97557),Ar=i(2020),Mr=i(79513),Nr=i(27723),Rr=[{bind:"xAxis",label:(0,Nr.__)("X-axis","elementor"),rowIndex:0},{bind:"yAxis",label:(0,Nr.__)("Y-axis","elementor"),rowIndex:0},{bind:"blur",label:(0,Nr.__)("Blur","elementor"),rowIndex:1},{bind:"color",label:(0,Nr.__)("Color","elementor"),rowIndex:1}],DropShadowItemContent=({anchorEl:r})=>{const o=useBoundProp(Ar.dropShadowFilterPropTypeUtil),i=[(0,Pr.useRef)(null),(0,Pr.useRef)(null)];return Or.createElement(PropProvider,{...o},Rr.map(o=>Or.createElement(or,{key:o.bind,ref:i[o.rowIndex]??null},Or.createElement(PropKeyProvider,{bind:o.bind},Or.createElement(Mr.Grid,{item:!0,xs:6},Or.createElement(ControlFormLabel,null,o.label)),Or.createElement(Mr.Grid,{item:!0,xs:6},"color"===o.bind?Or.createElement(Ft,{anchorEl:r}):Or.createElement(_t,{anchorRef:i[o.rowIndex],enablePropTypeUnits:!0,min:"blur"===o.bind?0:-Number.MAX_SAFE_INTEGER,defaultUnit:"px"}))))))},Ir=i(97557),Dr=__toESM(i(97557)),Lr=i(2020),Fr=i(79513),zr={blur:Lr.blurFilterPropTypeUtil,intensity:Lr.intensityFilterPropTypeUtil,"hue-rotate":Lr.hueRotateFilterPropTypeUtil,"color-tone":Lr.colorToneFilterPropTypeUtil},SingleSizeItemContent=({filterFunc:r})=>{const o=(0,Ir.useRef)(null),{getFilterFunctionConfig:i}=useFilterConfig(),{valueName:a,filterFunctionGroup:c}=i(r),u=useBoundProp(zr[c]);return Dr.createElement(PropProvider,{...u},Dr.createElement(PropKeyProvider,{bind:c},Dr.createElement(PropKeyProvider,{bind:"size"},Dr.createElement(or,{ref:o},Dr.createElement(Fr.Grid,{item:!0,xs:6},Dr.createElement(ControlFormLabel,null,a)),Dr.createElement(Fr.Grid,{item:!0,xs:6},Dr.createElement(_t,{anchorRef:o,enablePropTypeUnits:!0}))))))},FilterContent=()=>{const r=useBoundProp(Cr.cssFilterFunctionPropUtil),{filterOptions:o,getFilterFunctionConfig:i}=useFilterConfig();return xr.createElement(PropProvider,{...r,setValue:(o,a,c)=>{let u=structuredClone(o);const p=i(u?.func.value);"func"===c?.bind&&(u=p.defaultValue.value),u.args&&r.setValue(u)}},xr.createElement(PropKeyProvider,{bind:"css-filter-func"},xr.createElement(PopoverContent,{p:1.5},xr.createElement(or,null,xr.createElement(_r.Grid,{item:!0,xs:6},xr.createElement(ControlFormLabel,null,(0,Tr.__)("Filter","elementor"))),xr.createElement(_r.Grid,{item:!0,xs:6},xr.createElement(PropKeyProvider,{bind:"func"},xr.createElement(_e,{options:o})))),xr.createElement(PropKeyProvider,{bind:"args"},xr.createElement(FilterValueContent,null)))))},FilterValueContent=()=>{const{openItemIndex:r,items:o}=useRepeaterContext(),i=o[r].item.value.func.value;return"drop-shadow"===i?xr.createElement(DropShadowItemContent,null):xr.createElement(SingleSizeItemContent,{filterFunc:i})},jr=__toESM(i(97557)),Br=i(79513),FilterIcon=({value:r})=>"drop-shadow"!==r.value.func.value?null:jr.createElement(Vr,{size:"inherit",component:"span",value:r.value.args.value?.color.value}),Vr=(0,Br.styled)(Br.UnstableColorIndicator)(({theme:r})=>({borderRadius:r.shape.borderRadius/2+"px"})),$r=__toESM(i(97557)),Ur=__toESM(i(97557)),Hr=i(79513),Wr=i(27723),DropShadowItemLabel=({value:r})=>{const o=r.value.args.value,i=["xAxis","yAxis","blur"].map(r=>"custom"!==o[r]?.value?.unit?`${o[r]?.value?.size??0}${o[r]?.value?.unit??"px"}`:o[r]?.value?.size||Ct);return Ur.createElement(Hr.Box,{component:"span"},Ur.createElement(Hr.Box,{component:"span",style:{textTransform:"capitalize"}},(0,Wr.__)("Drop shadow:","elementor")),` ${i.join(" ")}`)},qr=__toESM(i(97557)),Kr=i(79513),SingleSizeItemLabel=({value:r})=>{const{func:o,args:i}=r.value,{getFilterFunctionConfig:a}=useFilterConfig(),{defaultValue:c}=a(o.value??""),u=c.value.args.value?.size?.value?.unit??Qe[0],{unit:p,size:g}=i.value.size?.value??{unit:u,size:0},v=qr.createElement(Kr.Box,{component:"span",style:{textTransform:"capitalize"}},o.value??"",":");return qr.createElement(Kr.Box,{component:"span"},v," "+("custom"!==p?`${g??0}${p??u}`:g||Ct))},FilterLabel=({value:r})=>"drop-shadow"===r.value.func.value?$r.createElement(DropShadowItemLabel,{value:r}):$r.createElement(SingleSizeItemLabel,{value:r}),Gr={filter:{propTypeUtil:fr.filterPropTypeUtil,label:(0,hr.__)("Filters","elementor")},"backdrop-filter":{propTypeUtil:fr.backdropFilterPropTypeUtil,label:(0,hr.__)("Backdrop filters","elementor")}},Jr=createControl(({filterPropName:r="filter"})=>{const{propTypeUtil:o,label:i}=function ensureFilterConfig(r){if(r&&r in Gr)return Gr[r];return Gr.filter}(r),{propType:a,value:c,setValue:u}=useBoundProp(o);return dr.createElement(FilterConfigProvider,null,dr.createElement(PropProvider,{propType:a,value:c,setValue:u},dr.createElement(Repeater,{propTypeUtil:o,label:i,filterPropName:r})))}),Repeater=({propTypeUtil:r,label:o,filterPropName:i})=>{const{getInitialValue:a}=useFilterConfig();return dr.createElement(ControlRepeater,{initial:a(),propTypeUtil:r},dr.createElement(lr,{label:o},dr.createElement(TooltipAddItemAction,{newItemIndex:0,ariaLabel:"backdrop-filter"===i?"backdrop filter":"filter"})),dr.createElement(ItemsContainer,null,dr.createElement(Item,{Label:FilterLabel,Icon:FilterIcon,actions:dr.createElement(dr.Fragment,null,dr.createElement(DuplicateItemAction,null),dr.createElement(DisableItemAction,null),dr.createElement(RemoveItemAction,null))})),dr.createElement(EditItemPopover,null,dr.createElement(FilterContent,null)))};var Yr=__toESM(i(97557)),Xr=i(97557),Qr={"off-canvas":()=>{const r=window,o=r.elementor.config.document.id,i=r.elementor.$previewContents[0].querySelectorAll(`[data-elementor-id="${o}"] .elementor-widget-off-canvas.elementor-element-edit-mode`);return Array.from(i).map(r=>({label:r.querySelector(".e-off-canvas")?.getAttribute("aria-label")??"",value:r.dataset.id}))},"form-elements":()=>{const r=window,o=r.elementor.config.document.id,i=[`[data-elementor-id="${o}"] input[id]:not([type="hidden"]):not([type="reset"]):not([type="button"])`,`[data-elementor-id="${o}"] select[id]`,`[data-elementor-id="${o}"] textarea[id]`],a=r.elementor.$previewContents[0].querySelectorAll(i.join(", "));return Array.from(a).map(r=>{const o=r.tagName.toLowerCase();return{label:`${r.id} (${"input"===o?r.getAttribute("type"):o})`,value:r.id}})}},Zr=createControl(({collectionId:r,options:o,...i})=>{const a=((r,o)=>{const[i,a]=(0,Xr.useState)(o??[]);return(0,Xr.useEffect)(()=>{r&&Qr[r]?a(Qr[r]()):a(o??[])},[r,o]),i})(r,o);return Yr.createElement(_e,{options:a,...i})}),eo=__toESM(i(97557)),to=i(2020),no=i(79513),ro=__toESM(i(97557)),oo=i(79513);function ChipsList({getLabel:r,getTagProps:o,values:i}){return ro.createElement(ro.Fragment,null,i.map((i,a)=>{const{key:c,...u}=o({index:a});return ro.createElement(oo.Chip,{key:c,label:r(i),size:"tiny",...u})}))}var io=createControl(({options:r,freeChips:o})=>{const{value:i,setValue:a,disabled:c}=useBoundProp(to.stringArrayPropTypeUtil),u=(i||[]).map(r=>to.stringPropTypeUtil.extract(r)).filter(r=>null!==r).map(o=>((r,o)=>o.find(o=>o.value===r)??{label:r,value:r})(o,r));return eo.createElement(ControlActions,null,eo.createElement(no.Autocomplete,{fullWidth:!0,multiple:!0,freeSolo:o,size:"tiny",disabled:c,value:u,filterSelectedOptions:!0,onChange:(r,o)=>{a(o.map(r=>to.stringPropTypeUtil.create("string"==typeof r?r:r.value)))},options:r,getOptionLabel:r=>"string"==typeof r?r:r.label,isOptionEqualToValue:(r,o)=>r.value===o.value,renderInput:r=>eo.createElement(no.TextField,{...r}),renderTags:(r,o)=>eo.createElement(ChipsList,{getLabel:r=>"string"==typeof r?r:r.label,getTagProps:o,values:r})}))}),ao=__toESM(i(97557)),so=i(2020),lo=__toESM(i(97557)),co=i(97557),uo=i(24413),po=i(79513),fo=__toESM(i(97557)),ho=i(79513),ConditionalTooltip=({showTooltip:r,children:o,label:i})=>r&&i?fo.createElement(ho.Tooltip,{title:i,disableFocusListener:!0,placement:"top"},o):o,mo=(0,po.styled)(po.ToggleButtonGroup)`
47 - ${({justify:r})=>`justify-content: ${r};`}
56 +`,qe=({isSortable:t=!0,children:n})=>{const{items:r,setItems:o}=ze(),i=r.map(({key:e})=>e);return n?e.createElement(e.Fragment,null,e.createElement(je,{value:i,onChange:e=>{o(e.map(e=>{const t=r.findIndex(t=>t.key===e);return r[t]}))}},i.map((o,i)=>{const s=r[i].item;return e.createElement(Ue,{id:o,key:`sortable-${o}`,disabled:!t},e.createElement(Ae.Provider,{value:{index:i,value:s}},n))}))):null},Je=(0,e.createContext)(void 0),Ke=()=>{const t=(0,e.useContext)(Je);if(!t)throw new Error("useRepeatableControlContext must be used within RepeatableControl");return t};function Ye(){return Ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ye.apply(null,arguments)}const Xe=(0,e.forwardRef)((t,n)=>e.createElement(o.UnstableTag,Ye({ref:n,fullWidth:!0,showActionsOnHover:!0,variant:"outlined",sx:{minHeight:e=>e.spacing(3.5)}},t)));var Ze=window.elementorV2.locations;const{Slot:Qe,inject:et}=(0,Ze.createReplaceableLocation)(),{Slot:tt,inject:nt}=(0,Ze.createReplaceableLocation)(),{Slot:rt,inject:ot}=(0,Ze.createLocation)();function it(){return it=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},it.apply(null,arguments)}const st=({Label:t,Icon:n,actions:r})=>{const{popoverState:s,setRowRef:l,openItemIndex:a,setOpenItemIndex:c,index:u=-1,value:d,isItemDisabled:p}=ze(),h=e.useContext(Je),f=!!h?.props?.readOnly,m=(0,o.bindTrigger)(s);return e.createElement(Xe,it({ref:e=>{e&&a===u&&e!==s.anchorEl&&(l(e),s.setAnchorEl(e))},label:e.createElement(tt,{value:d},e.createElement(t,{value:d})),"aria-label":(0,i.__)("Open item","elementor")},m,{onClick:e=>{f||p(u)||(m.onClick(e),c(u))},startIcon:e.createElement(Qe,{value:d},e.createElement(n,{value:d})),sx:{minHeight:e=>e.spacing(3.5),...p(u)&&{'[role="button"]':{cursor:"not-allowed"}}},actions:e.createElement(e.Fragment,null,e.createElement(rt,{index:u??-1}),r)}))},lt=({children:t,initial:n,propTypeUtil:r,isItemDisabled:o})=>e.createElement(Te,null,e.createElement(Re,{initial:n,propTypeUtil:r,isItemDisabled:o},t)),at="tiny",ct=()=>{const{items:t,updateItem:n,index:r=-1}=ze();if(-1===r)return null;const s=t[r].item.disabled??!1,l=s?(0,i.__)("Show","elementor"):(0,i.__)("Hide","elementor");return e.createElement(o.Tooltip,{title:l,placement:"top"},e.createElement(o.IconButton,{size:at,onClick:()=>{const e=structuredClone(t[r].item);e.disabled=!e.disabled,e.disabled||delete e.disabled,n(e,r)},"aria-label":l},s?e.createElement(R.EyeOffIcon,{fontSize:at}):e.createElement(R.EyeIcon,{fontSize:at})))},ut="tiny",dt=()=>{const{items:t,addItem:n,index:r=-1,isItemDisabled:s}=ze();if(-1===r)return null;const l=(0,i.__)("Duplicate","elementor"),a=t[r]?.item;return e.createElement(o.Tooltip,{title:l,placement:"top"},e.createElement(o.IconButton,{size:ut,onClick:e=>{const t=structuredClone(a);n(e,{item:t,index:r+1})},"aria-label":l,disabled:s(r)},e.createElement(R.CopyIcon,{fontSize:ut})))},pt="tiny",ht=()=>{const{removeItem:t,index:n=-1}=ze();if(-1===n)return null;const r=(0,i.__)("Remove","elementor");return e.createElement(o.Tooltip,{title:r,placement:"top"},e.createElement(o.IconButton,{size:pt,onClick:()=>t(n),"aria-label":r},e.createElement(R.XIcon,{fontSize:pt})))};function ft(){return ft=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(null,arguments)}const mt=({children:t,width:n,...r})=>e.createElement(o.Popover,ft({disablePortal:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{marginBlockStart:.5,width:n,overflow:"visible"}}}},r),t);function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gt.apply(null,arguments)}const yt=({children:t})=>{const{popoverState:n,openItemIndex:r,isOpen:i,rowRef:s,setOpenItemIndex:l,setRowRef:a}=ze();return i&&s?e.createElement(mt,gt({width:s.offsetWidth},(0,o.bindPopover)(n),{onClose:()=>{a(null),n.setAnchorEl(null),l(-1)}}),e.createElement(f,{bind:String(r)},e.createElement(o.Box,null,t))):null};function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bt.apply(null,arguments)}const vt=({gap:t=1.5,children:n,...r})=>e.createElement(o.Stack,bt({},r,{gap:t}),n),wt=(0,e.forwardRef)(({gap:t=1.5,alignItems:n="center",flexWrap:r="nowrap",children:i},s)=>e.createElement(o.Grid,{container:!0,gap:t,alignItems:n,flexWrap:r,ref:s},i)),xt=(0,e.createContext)(null),Et=({children:t,items:n})=>e.createElement(xt.Provider,{value:{items:n}},t),kt=()=>{const t=(0,e.useContext)(xt);return t?.items??[]};function St({customContext:t}){const n=kt();return 0===n?.length?null:e.createElement(e.Fragment,null,n.map(({Adornment:n,id:r})=>e.createElement(n,{key:r,customContext:t})))}const Ct=(0,e.forwardRef)(({label:t,children:n,adornment:r=St},i)=>e.createElement(o.Stack,{direction:"row",alignItems:"center",gap:1,sx:{marginInlineEnd:-.75,py:.25},ref:i},e.createElement(o.Box,{display:"flex",alignItems:"center",gap:1,sx:{flexGrow:1}},e.createElement(o.Typography,{component:"label",variant:"caption",color:"text.secondary",sx:{lineHeight:1}},t),e.createElement(r,null)),n)),Tt=M(()=>{const{propType:n,value:r,setValue:o,disabled:s}=b(t.boxShadowPropTypeUtil);return e.createElement(d,{propType:n,value:r,setValue:o,isDisabled:()=>s},e.createElement(lt,{initial:Dt,propTypeUtil:t.boxShadowPropTypeUtil},e.createElement(Ct,{label:(0,i.__)("Box shadow","elementor")},e.createElement(Ve,{newItemIndex:0,disabled:s,ariaLabel:"Box shadow"})),e.createElement(qe,null,e.createElement(st,{Icon:Ot,Label:Nt,actions:e.createElement(e.Fragment,null,e.createElement(dt,null),e.createElement(ct,null),e.createElement(ht,null))})),e.createElement(yt,null,e.createElement(It,null))))}),Mt=(0,o.styled)(o.UnstableColorIndicator)(({theme:e})=>({height:"1rem",width:"1rem",borderRadius:e.shape.borderRadius/2+"px"})),Ot=({value:t})=>e.createElement(Mt,{size:"inherit",component:"span",value:t.value.color?.value}),It=()=>{const n=b(t.shadowPropTypeUtil),r=[(0,e.useRef)(null),(0,e.useRef)(null)],{rowRef:o}=ze();return e.createElement(d,n,e.createElement(vt,{p:1.5},e.createElement(wt,null,e.createElement(Pt,{bind:"color",label:(0,i.__)("Color","elementor")},e.createElement(Oe,{anchorEl:o})),e.createElement(Pt,{bind:"position",label:(0,i.__)("Position","elementor"),sx:{overflow:"hidden"}},e.createElement(K,{options:[{label:(0,i.__)("Inset","elementor"),value:"inset"},{label:(0,i.__)("Outset","elementor"),value:null}]}))),e.createElement(wt,{ref:r[0]},e.createElement(Pt,{bind:"hOffset",label:(0,i.__)("Horizontal","elementor")},e.createElement(xe,{anchorRef:r[0]})),e.createElement(Pt,{bind:"vOffset",label:(0,i.__)("Vertical","elementor")},e.createElement(xe,{anchorRef:r[0]}))),e.createElement(wt,{ref:r[1]},e.createElement(Pt,{bind:"blur",label:(0,i.__)("Blur","elementor")},e.createElement(xe,{anchorRef:r[1]})),e.createElement(Pt,{bind:"spread",label:(0,i.__)("Spread","elementor")},e.createElement(xe,{anchorRef:r[1]})))))},Pt=({label:t,bind:n,children:r,sx:i})=>e.createElement(f,{bind:n},e.createElement(o.Grid,{item:!0,xs:6,sx:i},e.createElement(o.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(o.Grid,{item:!0,xs:12},e.createElement(o.FormLabel,{size:"tiny"},t)),e.createElement(o.Grid,{item:!0,xs:12},r)))),Nt=({value:t})=>{const{position:n,hOffset:r,vOffset:o,blur:i,spread:s}=t.value,{size:l="",unit:a=""}=i?.value||{},{size:c="",unit:u=""}=s?.value||{},{size:d="unset",unit:p=""}=r?.value||{},{size:h="unset",unit:f=""}=o?.value||{},m=n?.value||"outset",g=[[d,p],[h,f],[l,a],[c,u]].map(([e,t])=>"custom"!==t?e+t:e||we).join(" ");return e.createElement("span",{style:{textTransform:"capitalize"}},m,": ",g)},Dt={$$type:"shadow",value:{hOffset:{$$type:"size",value:{unit:"px",size:0}},vOffset:{$$type:"size",value:{unit:"px",size:0}},blur:{$$type:"size",value:{unit:"px",size:10}},spread:{$$type:"size",value:{unit:"px",size:0}},color:{$$type:"color",value:"rgba(0, 0, 0, 1)"},position:null}},At={blur:{blur:{name:(0,i.__)("Blur","elementor"),valueName:(0,i.__)("Radius","elementor")}},intensity:{brightness:{name:(0,i.__)("Brightness","elementor")},contrast:{name:(0,i.__)("Contrast","elementor")},saturate:{name:(0,i.__)("Saturate","elementor")}},"hue-rotate":{"hue-rotate":{name:(0,i.__)("Hue Rotate","elementor"),valueName:(0,i.__)("Angle","elementor")}},"color-tone":{grayscale:{name:(0,i.__)("Grayscale","elementor")},invert:{name:(0,i.__)("Invert","elementor")},sepia:{name:(0,i.__)("Sepia","elementor")}},"drop-shadow":{"drop-shadow":{name:(0,i.__)("Drop shadow","elementor"),valueName:(0,i.__)("Drop-shadow","elementor")}}},_t=(0,i.__)("Amount","elementor"),zt={"drop-shadow":e=>function(e){const t=e.shape;return{blur:t?.blur?.default,xAxis:t?.xAxis?.default,yAxis:t?.yAxis?.default,color:t?.color?.default??(t?.color).prop_types.color.default}}(e)};const Rt=(0,e.createContext)(null);function $t({children:n}){const r=b(t.cssFilterFunctionPropUtil),o=(0,e.useMemo)(()=>{const e=function(e){const t=Object.entries(At).flatMap(([t,n])=>Object.entries(n).map(([n,r])=>function(t,n,{name:r,valueName:o}){const i=function(e,t){return e.shape?.args?.prop_types[t]}(e,t),s=zt[n]?.(i)??function(e){const t=e?.shape?.size;return{size:t?.default}}(i),l=function({filterFunction:e,filterFunctionGroup:t,value:n}){return{$$type:"css-filter-func",value:{func:{$$type:"string",value:e},args:{$$type:t,value:n}}}}({filterFunction:n,filterFunctionGroup:t,value:s});return[n,{name:r,valueName:o??_t,defaultValue:l,filterFunctionGroup:t}]}(t,n,r)));return Object.fromEntries(t)}(r.propType.item_prop_type),t=Object.entries(e).map(([e,t])=>({value:e,label:t.name}));return{config:e,filterOptions:t,getFilterFunctionConfig:t=>e[t],getInitialValue:()=>e.blur.defaultValue}},[r.propType]);return e.createElement(Rt.Provider,{value:o},n)}function Bt(){const t=(0,e.useContext)(Rt);if(!t)throw new Error("useFilterConfig must be used within FilterConfigProvider");return t}const Vt=[{bind:"xAxis",label:(0,i.__)("X-axis","elementor"),rowIndex:0},{bind:"yAxis",label:(0,i.__)("Y-axis","elementor"),rowIndex:0},{bind:"blur",label:(0,i.__)("Blur","elementor"),rowIndex:1},{bind:"color",label:(0,i.__)("Color","elementor"),rowIndex:1}],Lt=({anchorEl:n})=>{const r=b(t.dropShadowFilterPropTypeUtil),i=[(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(d,r,Vt.map(t=>e.createElement(wt,{key:t.bind,ref:i[t.rowIndex]??null},e.createElement(f,{bind:t.bind},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,t.label)),e.createElement(o.Grid,{item:!0,xs:6},"color"===t.bind?e.createElement(Oe,{anchorEl:n}):e.createElement(xe,{anchorRef:i[t.rowIndex],enablePropTypeUnits:!0,defaultUnit:"px",isRepeaterControl:!0}))))))},Ft={blur:t.blurFilterPropTypeUtil,intensity:t.intensityFilterPropTypeUtil,"hue-rotate":t.hueRotateFilterPropTypeUtil,"color-tone":t.colorToneFilterPropTypeUtil},jt=({filterFunc:t})=>{const n=(0,e.useRef)(null),{getFilterFunctionConfig:r}=Bt(),{valueName:i,filterFunctionGroup:s}=r(t),l=b(Ft[s]);return e.createElement(d,l,e.createElement(f,{bind:s},e.createElement(f,{bind:"size"},e.createElement(wt,{ref:n},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,i)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(xe,{anchorRef:n,enablePropTypeUnits:!0,isRepeaterControl:!0}))))))};function Ut(){return Ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ut.apply(null,arguments)}const Wt=()=>{const n=b(t.cssFilterFunctionPropUtil),{filterOptions:r,getFilterFunctionConfig:s}=Bt();return e.createElement(d,Ut({},n,{setValue:(e,t,r)=>{let o=structuredClone(e);const i=s(o?.func.value);"func"===r?.bind&&(o=i.defaultValue.value),o.args&&n.setValue(o)}}),e.createElement(f,{bind:"css-filter-func"},e.createElement(vt,{p:1.5},e.createElement(wt,null,e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,(0,i.__)("Filter","elementor"))),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"func"},e.createElement(K,{options:r})))),e.createElement(f,{bind:"args"},e.createElement(Gt,null)))))},Gt=()=>{const{openItemIndex:t,items:n}=ze(),r=n[t].item.value.func.value;return"drop-shadow"===r?e.createElement(Lt,null):e.createElement(jt,{filterFunc:r})},Ht=({value:t})=>"drop-shadow"!==t.value.func.value?null:e.createElement(qt,{size:"inherit",component:"span",value:t.value.args.value?.color.value}),qt=(0,o.styled)(o.UnstableColorIndicator)(({theme:e})=>({borderRadius:e.shape.borderRadius/2+"px"})),Jt=({value:t})=>{const n=t.value.args.value,r=["xAxis","yAxis","blur"].map(e=>"custom"!==n[e]?.value?.unit?`${n[e]?.value?.size??0}${n[e]?.value?.unit??"px"}`:n[e]?.value?.size||we);return e.createElement(o.Box,{component:"span"},e.createElement(o.Box,{component:"span",style:{textTransform:"capitalize"}},"Drop shadow:"),` ${r.join(" ")}`)},Kt=({value:t})=>{const{func:n,args:r}=t.value,{getFilterFunctionConfig:i}=Bt(),{defaultValue:s}=i(n.value??""),l=s.value.args.value?.size?.value?.unit??ne[0],{unit:a,size:c}=r.value.size?.value??{unit:l,size:0},u=e.createElement(o.Box,{component:"span",style:{textTransform:"capitalize"}},n.value??"",":");return e.createElement(o.Box,{component:"span"},u," "+("custom"!==a?`${c??0}${a??l}`:c||we))},Yt=({value:t})=>"drop-shadow"===t.value.func.value?e.createElement(Jt,{value:t}):e.createElement(Kt,{value:t}),Xt={filter:{propTypeUtil:t.filterPropTypeUtil,label:(0,i.__)("Filters","elementor")},"backdrop-filter":{propTypeUtil:t.backdropFilterPropTypeUtil,label:(0,i.__)("Backdrop filters","elementor")}},Zt=M(({filterPropName:t="filter"})=>{const{propTypeUtil:n,label:r}=(l=t)&&l in Xt?Xt[l]:Xt.filter,{propType:o,value:i,setValue:s}=b(n);var l;return e.createElement($t,null,e.createElement(d,{propType:o,value:i,setValue:s},e.createElement(Qt,{propTypeUtil:n,label:r,filterPropName:t})))}),Qt=({propTypeUtil:t,label:n,filterPropName:r})=>{const{getInitialValue:o}=Bt();return e.createElement(lt,{initial:o(),propTypeUtil:t},e.createElement(Ct,{label:n},e.createElement(Ve,{newItemIndex:0,ariaLabel:"backdrop-filter"===r?"backdrop filter":"filter"})),e.createElement(qe,null,e.createElement(st,{Label:Yt,Icon:Ht,actions:e.createElement(e.Fragment,null,e.createElement(dt,null),e.createElement(ct,null),e.createElement(ht,null))})),e.createElement(yt,null,e.createElement(Wt,null)))};function en(){return en=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},en.apply(null,arguments)}const tn={"off-canvas":()=>{const e=window,t=e.elementor.config.document.id,n=e.elementor.$previewContents[0].querySelectorAll(`[data-elementor-id="${t}"] .elementor-widget-off-canvas.elementor-element-edit-mode`);return Array.from(n).map(e=>({label:e.querySelector(".e-off-canvas")?.getAttribute("aria-label")??"",value:e.dataset.id}))}},nn=M(({collectionId:t,options:n,...r})=>{const o=((t,n)=>{const[r,o]=(0,e.useState)(n??[]);return(0,e.useEffect)(()=>{t&&tn[t]?o(tn[t]()):o(n??[])},[t,n]),r})(t,n);return e.createElement(K,en({options:o},r))}),rn=({showTooltip:t,children:n,label:r})=>t&&r?e.createElement(o.Tooltip,{title:r,disableFocusListener:!0,placement:"top"},n):n,on=(0,o.styled)(o.ToggleButtonGroup)`
57 + ${({justify:e})=>`justify-content: ${e};`}
48 58 button:not( :last-of-type ) {
49 59 border-start-end-radius: 0;
50 60 border-end-end-radius: 0;
51 61 }
@@ -56,19 +66,19 @@
56 66 button:last-of-type {
57 67 border-start-end-radius: 8px;
58 68 border-end-end-radius: 8px;
59 69 }
60 -`,go=(0,po.styled)(po.ToggleButton,{shouldForwardProp:r=>"isPlaceholder"!==r})`
61 - ${({theme:r,isPlaceholder:o})=>o&&`\n\t\tcolor: ${r.palette.text.tertiary};\n\t\tbackground-color: ${"dark"===r.palette.mode?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.02)"};\n\n\t\t&:hover {\n\t\t\tbackground-color: ${"dark"===r.palette.mode?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.04)"};\n\t\t}\n\t`}
62 -`,vo=lo.forwardRef(({justify:r="end",size:o="tiny",value:i,onChange:a,items:c,maxItems:u,exclusive:p=!1,fullWidth:g=!1,disabled:v,placeholder:b},k)=>{const E=p&&void 0!==u&&c.length>u,w=E?c.slice(u-1):[],x=E?c.slice(0,u-1):c,C="rtl"===(0,po.useTheme)().direction,_=(0,co.useMemo)(()=>{const r=w?.length,o=r?x.length+1:x.length,i=r?"auto":"";return g?`repeat(${o}, 1fr) ${i}`:`repeat(${o}, minmax(0, 25%)) ${i}`},[w?.length,x.length,g]),T=p&&(null==i||""===i),P=!p&&Array.isArray(i)?i.map(r=>"string"==typeof r?r:"").join(" ").trim().split(/\s+/).filter(Boolean):[],A=!p&&0===P.length,N=(R=b,Array.isArray(R)?R.flatMap(r=>"string"==typeof r?r.trim().split(/\s+/).filter(Boolean):[]):"string"==typeof R?R.trim().split(/\s+/).filter(Boolean):[]);var R;return lo.createElement(mo,{ref:k,justify:r,value:i,onChange:(r,o)=>{a(o)},exclusive:p,disabled:v,sx:{direction:C?"rtl /* @noflip */":"ltr /* @noflip */",display:"grid",gridTemplateColumns:_,width:"100%"}},x.map(({label:r,value:i,renderContent:a,showTooltip:c,disabled:u=!1})=>{const p=N.length>0&&N.includes(i)&&(T||A);return lo.createElement(ConditionalTooltip,{key:i,label:r,showTooltip:c||!1},lo.createElement(go,{value:i,"aria-label":r,size:o,fullWidth:g,isPlaceholder:p,disabled:u},lo.createElement(a,{size:o})))}),w.length&&p&&lo.createElement(SplitButtonGroup,{size:o,value:i||null,onChange:a,items:w,fullWidth:g}))}),ControlToggleButtonGroup=r=>lo.createElement(ControlActions,null,lo.createElement(vo,{...r})),SplitButtonGroup=({size:r="tiny",onChange:o,items:i,fullWidth:a,value:c})=>{const u=usePreviewButton(i,c),[p,g]=(0,co.useState)(!1),v=(0,co.useRef)(null),onMenuItemClick=r=>{g(!1),onToggleItem(r)},onToggleItem=r=>{o(r===c?null:r)};return lo.createElement(lo.Fragment,null,lo.createElement(po.ToggleButton,{value:u.value,"aria-label":u.label,size:r,fullWidth:a,onClick:r=>{r.preventDefault(),onMenuItemClick(u.value)}},u.renderContent({size:r})),lo.createElement(po.ToggleButton,{size:r,"aria-expanded":p?"true":void 0,"aria-haspopup":"menu","aria-pressed":void 0,onClick:r=>{g(r=>!r),r.preventDefault()},ref:v,value:"__chevron-icon-button__"},lo.createElement(uo.ChevronDownIcon,{fontSize:r})),lo.createElement(po.Menu,{open:p,onClose:()=>g(!1),anchorEl:v.current,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:.5}},i.filter(r=>r.value!==u.value).map(({label:r,value:o})=>lo.createElement(po.MenuItem,{key:o,selected:o===c,onClick:()=>onMenuItemClick(o)},lo.createElement(po.ListItemText,null,lo.createElement(po.Typography,{sx:{fontSize:"14px"}},r))))))},usePreviewButton=(r,o)=>{const[i,a]=(0,co.useState)(r.find(r=>r.value===o)??r[0]);return(0,co.useEffect)(()=>{const i=r.find(r=>r.value===o);i&&a(i)},[r,o]),i},yo=__toESM(i(97557)),bo=__toESM(i(24413)),ko=createControl(({options:r,fullWidth:o=!1,size:i="tiny",exclusive:a=!0,maxItems:c,convertOptions:u=!1})=>{const{value:p,setValue:g,placeholder:v,disabled:b}=useBoundProp(so.stringPropTypeUtil),k=u?(r=>r.map(r=>{const o=r.icon,i=bo[o];return{value:r.value,label:r.label,renderContent:({size:o})=>i?yo.createElement(i,{fontSize:o}):r.label,showTooltip:r.showTooltip,exclusive:r.exclusive}}))(r):r,E=k.filter(r=>r.exclusive).map(r=>r.value),w={items:k,maxItems:c,fullWidth:o,size:i,placeholder:v};return a?ao.createElement(ControlToggleButtonGroup,{...w,value:p??null,onChange:g,disabled:b,exclusive:!0}):ao.createElement(ControlToggleButtonGroup,{...w,value:p?.split(" ")??[],onChange:r=>{const o=r[r.length-1],i=E.includes(o)?[o]:r?.filter(r=>!E.includes(r));g(i?.join(" ")||null)},disabled:b,exclusive:!1})}),Eo=__toESM(i(97557)),So=i(2020),wo=i(79513),isEmptyOrNaN=r=>null==r||""===r||Number.isNaN(Number(r)),renderSuffix=r=>r.meta?.suffix?Eo.createElement(wo.InputAdornment,{position:"end"},Eo.createElement(wo.Typography,{variant:"caption",color:"text.secondary"},r.meta.suffix)):Eo.createElement(Eo.Fragment,null),xo=createControl(({placeholder:r,max:o=Number.MAX_SAFE_INTEGER,min:i=-Number.MAX_SAFE_INTEGER,step:a=1,shouldForceInt:c=!1,startIcon:u,disabled:p})=>{const{value:g,setValue:v,placeholder:b,disabled:k,restoreValue:E,propType:w}=useBoundProp(So.numberPropTypeUtil);return Eo.createElement(ControlActions,null,Eo.createElement(dt,{size:"tiny",type:"number",fullWidth:!0,disabled:p??k,value:isEmptyOrNaN(g)?"":g,onInput:r=>{const{value:a,validity:{valid:u}}=r.target;let p;if(isEmptyOrNaN(a))p=null;else{const r=c?+parseInt(a):Number(a);p=Math.min(Math.max(r,i??Number.MIN_SAFE_INTEGER),o??Number.MAX_SAFE_INTEGER)}v(p,void 0,{validation:()=>u})},onBlur:E,placeholder:r??(isEmptyOrNaN(b)?"":String(b)),inputProps:{step:a,min:i},InputProps:{startAdornment:u?Eo.createElement(wo.InputAdornment,{position:"start",disabled:p??k},u):void 0,endAdornment:renderSuffix(w)}}))}),Co=__toESM(i(97557)),_o=i(97557),To=i(79513),Oo=i(27723);function EqualUnequalSizesControl({label:r,icon:o,tooltipLabel:i,items:a,multiSizePropTypeUtil:c}){const u=(0,_o.useId)(),p=(0,To.usePopupState)({variant:"popover",popupId:u}),g=[(0,_o.useRef)(null),(0,_o.useRef)(null)],{propType:v,disabled:b}=useBoundProp(c),{value:k,setValue:E,placeholder:w}=useBoundProp(),getMultiSizeValues=r=>{if(c.isValid(r))return r.value;const o={};a.forEach(i=>{o[i.bind]=r});const i=c.create(o);return i?.value},x=!p.isOpen,C=getMultiSizeValues(k),_=getMultiSizeValues(w),isEqualValues=r=>{if(!r)return!0;const o=c.create(r),i={};a.forEach(r=>{i[r.bind]=o?.value?.[r.bind]??null});const u=Object.values(i).map(r=>JSON.stringify(r));return u.every(r=>r===u[0])},T=!k&&!isEqualValues(_),P=T||!isEqualValues(C);return Co.createElement(Co.Fragment,null,Co.createElement(To.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap",ref:g[0]},Co.createElement(To.Grid,{item:!0,xs:6},x?Co.createElement(ControlLabel,null,r):Co.createElement(ControlFormLabel,null,r)),Co.createElement(To.Grid,{item:!0,xs:6},Co.createElement(To.Stack,{direction:"row",alignItems:"center",gap:1},Co.createElement(To.Box,{flexGrow:1},Co.createElement(_t,{placeholder:P?(0,Oo.__)("Mixed","elementor"):void 0,enablePropTypeUnits:!P||!T,anchorRef:g[0]})),Co.createElement(To.Tooltip,{title:i,placement:"top"},Co.createElement(go,{size:"tiny",value:"check",sx:{marginLeft:"auto"},...(0,To.bindToggle)(p),selected:p.isOpen,isPlaceholder:T,"aria-label":i},o))))),Co.createElement(To.Popover,{disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},...(0,To.bindPopover)(p),slotProps:{paper:{sx:{mt:.5,width:g[0].current?.getBoundingClientRect().width}}}},Co.createElement(PropProvider,{propType:v,value:C,placeholder:_,setValue:r=>{isEqualValues(r)?E(Object.values(r)?.pop()??null):E(c.create(r))},isDisabled:()=>b},Co.createElement(PopoverContent,{p:1.5},Co.createElement(or,{ref:g[1]},Co.createElement(MultiSizeValueControl,{item:a[0],rowRef:g[1]}),Co.createElement(MultiSizeValueControl,{item:a[1],rowRef:g[1]})),Co.createElement(or,{ref:g[2]},Co.createElement(MultiSizeValueControl,{item:a[2],rowRef:g[2]}),Co.createElement(MultiSizeValueControl,{item:a[3],rowRef:g[2]}))))))}var MultiSizeValueControl=({item:r,rowRef:o})=>{const{bind:i,label:a,icon:c,ariaLabel:u}=r;return Co.createElement(PropKeyProvider,{bind:i},Co.createElement(To.Grid,{item:!0,xs:6},Co.createElement(To.Grid,{container:!0,gap:.75,alignItems:"center"},Co.createElement(To.Grid,{item:!0,xs:12},Co.createElement(ControlLabel,null,a)),Co.createElement(To.Grid,{item:!0,xs:12},Co.createElement(_t,{startIcon:c,ariaLabel:u,anchorRef:o})))))},Po=__toESM(i(97557)),Ao=i(97557),Mo=i(2020),No=i(74518),Ro=i(24413),Io=i(79513),Do=i(27723),Lo=__toESM(i(97557)),Fo=i(97557),zo=i(2020),jo=__toESM(i(97557)),Bo=i(97557),Vo=i(74518),$o=i(79513),Uo=__toESM(i(97557)),Ho=i(24413),Wo=i(79513),getLengthUnits=()=>window.elementor?.config?.size_units?.length??[],getAngleUnits=()=>window.elementor?.config?.size_units?.angle??[],getTimeUnits=()=>window.elementor?.config?.size_units?.time??[],isExtendedUnit=r=>(window.elementor?.config?.size_units?.extended_units??[]).includes(r),qo=/^[a-zA-Z%]$/,isNumericValue=r=>"number"==typeof r?!isNaN(r):"string"==typeof r&&(""!==r.trim()&&!isNaN(Number(r))),Ko=i(97557),Go="",Jo="auto",Yo="custom",resolveSizeOnUnitChange=(r,o)=>isExtendedUnit(o)?Go:r,resolveFallbackUnit=(r,o,i)=>o.includes(r)?r:i&&o.includes(i)?i:o[0]??"",sanitizeSize=r=>"number"==typeof r&&isNaN(r)?Go:r,Xo=i(97557),useSizeValue=({value:r,setValue:o,units:i,defaultUnit:a})=>{const c=(0,Ko.useMemo)(()=>((r,o)=>{if(!r)return r;const{units:i,defaultUnit:a}=o,c=resolveFallbackUnit(r.unit,i,a);return c===Jo?{size:Go,unit:c}:c===Yo?{size:String(r.size??Go),unit:c}:{size:sanitizeSize(r.size)??Go,unit:c}})(r,{units:i,defaultUnit:a}),[r?.size,r?.unit,a]),[u,p]=useSyncExternalState({external:c,setExternal:(r,i,a)=>{null!==r&&o(r,i,a)},persistWhen:r=>hasChanged(r,c),fallback:()=>((r,o)=>{let[i]=r;return void 0!==o&&(i=resolveFallbackUnit(o,r)),{size:Go,unit:i}})(i,a)}),[g,v]=(({sizeValue:r,setUnit:o,persistWhen:i})=>{const[a,c]=(0,Xo.useState)(r.unit);return(0,Xo.useEffect)(()=>{r.unit!==a&&c(r.unit)},[r.unit,r.size]),[a,r=>{c(r),(isExtendedUnit(r)||i())&&o(r)}]})({sizeValue:u,setUnit:r=>{p({unit:r,size:resolveSizeOnUnitChange(u.size,r)})},persistWhen:()=>Boolean(u.size)||""!==u.size||isExtendedUnit(u.unit)});return{size:u.size,setSize:(r,o=!0)=>{if(isExtendedUnit(g))return;const i=r.trim(),a=Number(i),c={unit:g,size:i&&!isNaN(a)?a:""};p(c,void 0,{validation:()=>o})},unit:g,setUnit:v}},hasChanged=(r,o)=>r?.size!==o?.size||r?.unit!==o?.unit,Qo=__toESM(i(97557)),Zo=(0,i(97557).forwardRef)(({id:r,type:o,value:i,onBlur:a,onKeyUp:c,focused:u,disabled:p,onChange:g,onKeyDown:v,InputProps:b,inputProps:k,placeholder:E},w)=>Qo.createElement(dt,{id:r,ref:w,size:"tiny",fullWidth:!0,type:o,value:i,placeholder:E,onKeyUp:c,focused:u,disabled:p,onKeyDown:v,onInput:g,onBlur:a,InputProps:b,inputProps:k,sx:getCursorStyle(b?.readOnly??!1)})),getCursorStyle=r=>({input:{cursor:r?"default !important":void 0}}),ei=__toESM(i(97557)),ti=i(97557),ni=i(70374),ri=i(79513),oi={display:"flex",flexDirection:"column",justifyContent:"center"},UnitSelector=({value:r,isUnitHighlighted:o,onSelect:i,options:a,disabled:c,menuItemsAttributes:u={},optionLabelOverrides:p={}})=>{const g=(0,ri.usePopupState)({variant:"popover",popupId:(0,ti.useId)()});return ei.createElement(ei.Fragment,null,ei.createElement(ii,{isHighlighted:o,disabled:c,size:"small",...(0,ri.bindTrigger)(g)},p[r]??r),ei.createElement(ri.Menu,{MenuListProps:{dense:!0},...(0,ri.bindMenu)(g)},a.map(r=>ei.createElement(ni.MenuListItem,{key:r,onClick:()=>(r=>{i(r),g.close()})(r),...u?.[r],primaryTypographyProps:{variant:"caption",sx:{...oi,lineHeight:"1"}},menuItemTextProps:{sx:oi}},p[r]??r.toUpperCase()))))},ii=(0,ri.styled)(ri.Button,{shouldForwardProp:r=>"isHighlighted"!==r})(({isHighlighted:r,theme:o})=>({color:r?o.palette.text.primary:o.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),ai={custom:Uo.createElement(Ho.MathFunctionIcon,{fontSize:"tiny"})},SizeField=({value:r,focused:o,disabled:i,InputProps:a,defaultUnit:c,placeholder:u,onUnitChange:p,startIcon:g,ariaLabel:v,onKeyDown:b,setValue:k,onBlur:E,units:w,min:x,unitSelectorProps:C})=>{const{size:_,unit:T,setSize:P,setUnit:A}=useSizeValue({value:r,setValue:k,units:w,defaultUnit:c}),handleUnitChange=r=>{A(r),p?.(r)},{onUnitKeyDown:N}=(({unit:r,units:o,onUnitChange:i})=>{const{appendKey:a,startsWith:c}=useTypingBuffer();return{onUnitKeyDown:u=>{if(0===o.length)return;const{key:p,altKey:g,ctrlKey:v,metaKey:b}=u;if(g||v||b)return;if(isExtendedUnit(r)&&isNumericValue(p)){const[r]=o;return void(r&&i(r))}if(!qo.test(p))return;u.preventDefault();const k=a(p.toLowerCase()),E=o.find(r=>c(r,k));E&&i(E)}}})({unit:T,onUnitChange:handleUnitChange,units:w}),R=isExtendedUnit(T)?"text":"number";return Uo.createElement(Zo,{disabled:i,focused:o,type:R,value:_,placeholder:u,onBlur:E,onKeyDown:r=>{N(r),b?.(r)},onChange:r=>{const o=r.target.value,i=r.target.validity.valid;P(o,i)},InputProps:{...a,autoComplete:"off",readOnly:isExtendedUnit(T),startAdornment:g&&Uo.createElement(Wo.InputAdornment,{position:"start",disabled:i},g),endAdornment:Uo.createElement(Wo.InputAdornment,{position:"end"},Uo.createElement(UnitSelector,{options:w,value:T,onSelect:handleUnitChange,isUnitHighlighted:shouldHighlightUnit({size:_,unit:T}),...C,optionLabelOverrides:ai}))},inputProps:{min:x,step:"any","aria-label":v}})},shouldHighlightUnit=r=>!!r&&(r.unit===Jo||(Boolean(r.size)||0===r.size)),si=__toESM(i(97557)),li=i(97557),ci=i(70374),ui=i(24413),pi=i(79513),di=i(27723),TextFieldPopover2=({popupState:r,anchorRef:o,value:i,onChange:a,onClose:c})=>{const u=(0,li.useRef)(null);(0,li.useEffect)(()=>{r.isOpen&&requestAnimationFrame(()=>{u.current&&u.current.focus()})},[r.isOpen]);const handleClose=()=>{c?.(),r.close()};return si.createElement(pi.Popover,{disablePortal:!0,slotProps:{paper:{sx:{borderRadius:2,width:o.current?.offsetWidth+"px"}}},...(0,pi.bindPopover)(r),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onClose:handleClose},si.createElement(ci.PopoverHeader,{title:(0,di.__)("CSS function","elementor"),onClose:handleClose,icon:si.createElement(ui.MathFunctionIcon,{fontSize:"tiny"})}),si.createElement(pi.TextField,{value:i,onChange:a,onKeyDown:r=>{"enter"===r.key.toLowerCase()&&handleClose()},size:"tiny",type:"text",fullWidth:!0,inputProps:{ref:u},sx:{pt:0,pr:1.5,pb:1.5,pl:1.5}}))},SizeComponent=({anchorRef:r,SizeFieldWrapper:o=jo.Fragment,...i})=>{const a=(0,$o.usePopupState)({variant:"popover"}),c=(0,Vo.useActiveBreakpoint)(),u=i?.value?.unit===Yo,p=i.units.includes(Yo);(0,Bo.useEffect)(()=>{a&&a.isOpen&&a.close()},[c]);const g={"aria-controls":a.isOpen?a.popupId:void 0,"aria-haspopup":!0};return jo.createElement(jo.Fragment,null,jo.createElement(o,null,jo.createElement($o.Box,null,jo.createElement(SizeField,{focused:!!a.isOpen||void 0,onUnitChange:o=>{o===Yo&&r?.current&&a.open(r.current)},InputProps:{...g,onClick:o=>{o.target.closest("input")&&u&&a.open(r?.current)}},unitSelectorProps:{menuItemsAttributes:p?{custom:g}:void 0},...i}))),a.isOpen&&r?.current&&jo.createElement(TextFieldPopover2,{popupState:a,anchorRef:r,value:String(i?.value?.size??""),onChange:r=>{i.setValue({size:r.target.value,unit:Yo})},onClose:()=>{}}))},fi=i(2020),toUnitPlaceholder=r=>({...r,size:""}),pickFirstValid=r=>{const o=r.find(({candidate:r})=>validateSizeValue(r));return o?o.resolve(o.candidate):null},validateSizeValue=r=>{if(!r||"object"!=typeof r)return!1;const o=fi.sizePropTypeUtil.create(r);return fi.sizePropTypeUtil.isValid(o)},resolvePlaceholder=r=>{if("string"==typeof r)return r;const o=r?.size;return void 0!==o?"number"==typeof o?o.toString():o:void 0},getSizeUnits=(r,o)=>(r=>getPropTypeSettings(r)?.available_units)(r)??(r=>({length:getLengthUnits,angle:getAngleUnits,time:getTimeUnits}[r]()))(o),hi=[r=>Boolean(r),r=>null==r?.size||""===r?.size,r=>r?.unit!==Jo,r=>r?.unit!==Yo],mi=createControl(({variant:r="length",placeholder:o,anchorRef:i,startIcon:a,ariaLabel:c,min:u})=>{const{value:p,setValue:g,propType:v,placeholder:b,restoreValue:k}=useBoundProp(zo.sizePropTypeUtil),E=(0,Fo.useRef)(null),{sizeValue:w,placeholder:x}=((r,o,i)=>{const a=i??o;return{sizeValue:pickFirstValid([{candidate:r,resolve:r=>r},{candidate:i,resolve:toUnitPlaceholder},{candidate:o,resolve:toUnitPlaceholder}]),placeholder:Boolean(r)?void 0:resolvePlaceholder(a)}})(p??E.current,b,o),C=getSizeUnits(v,r),_=(r=>getPropTypeSettings(r)?.default_unit)(v);return Lo.createElement(SizeComponent,{units:C,value:w,anchorRef:i,placeholder:x,defaultUnit:_,onBlur:()=>{const r=v.settings.required;(r=>hi.every(o=>o(r)))(p)&&!r&&g(null),r&&k()},setValue:(r,o,i)=>{if(isTransitioningFromExtendedUnit(r,p))return E.current=r,void g(null);g(r,o,{...i,validation:()=>v.settings.required?""!==r.size:!i?.validation||i.validation(r)})},SizeFieldWrapper:ControlActions,startIcon:a,ariaLabel:c,min:u})}),isTransitioningFromExtendedUnit=(r,o)=>!isExtendedUnit(r.unit)&&isExtendedUnit(o?.unit)&&""===r.size,LinkedDimensionsControl=({label:r,isSiteRtl:o=!1,min:i})=>{const a=[(0,Ao.useRef)(null),(0,Ao.useRef)(null)],{disabled:c}=useBoundProp(Mo.sizePropTypeUtil),{value:u,setValue:p,propType:g,placeholder:v,disabled:b}=useBoundProp(Mo.dimensionsPropTypeUtil),{value:k,placeholder:E,setValue:w}=useBoundProp(),inferIsLinked=()=>!Mo.dimensionsPropTypeUtil.isValid(k)&&!(!k&&Mo.dimensionsPropTypeUtil.isValid(E)),[x,C]=(0,Ao.useState)(()=>inferIsLinked()),_=(0,No.useActiveBreakpoint)(),T=Mo.dimensionsPropTypeUtil.isValid(k??E);(0,Ao.useLayoutEffect)(()=>{C(inferIsLinked)},[_,T]);const P=r.toLowerCase(),A=x?Ro.LinkIcon:Ro.DetachIcon,N=(0,Do.__)("Link %s","elementor").replace("%s",P),R=(0,Do.__)("Unlink %s","elementor").replace("%s",P),I=c||b,L={propType:g,value:u,placeholder:v??(x?null:{"block-start":E,"block-end":E,"inline-start":E,"inline-end":E}),setValue:r=>{const o=Object.entries(r).filter(([,r])=>Boolean(r));p(0===o.length?null:Object.fromEntries(o))},isDisabled:()=>b},z=!k&&(v||E),getEffectivePlaceholder=r=>{if(x){const r=getFirstDefined(v);return Mo.sizePropTypeUtil.extract(r)}return Mo.sizePropTypeUtil.extract(v?.[r])};return Po.createElement(PropProvider,{...L},Po.createElement(Io.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},Po.createElement(ControlFormLabel,null,r),Po.createElement(Io.Tooltip,{title:x?R:N,placement:"top"},Po.createElement(go,{"aria-label":x?R:N,size:"tiny",value:"check",selected:x,sx:{marginLeft:"auto"},onChange:()=>{if(C(r=>!r),!Mo.dimensionsPropTypeUtil.isValid(k)){const r=k||null;return r?void w(Mo.dimensionsPropTypeUtil.create({"block-start":r,"block-end":r,"inline-start":r,"inline-end":r})):void w(null)}const r=getFirstDefined(u)??null;w(r||null)},disabled:I,isPlaceholder:z},Po.createElement(A,{fontSize:"tiny"})))),function getCssDimensionProps(r,o){return[[{bind:"block-start",label:(0,Do.__)("Top","elementor"),ariaLabel:(0,Do.sprintf)((0,Do.__)("%s top","elementor"),r),icon:Po.createElement(Ro.SideTopIcon,{fontSize:"tiny"})},{bind:"inline-end",label:o?(0,Do.__)("Left","elementor"):(0,Do.__)("Right","elementor"),ariaLabel:o?(0,Do.sprintf)((0,Do.__)("%s left","elementor"),r):(0,Do.sprintf)((0,Do.__)("%s right","elementor"),r),icon:o?Po.createElement(Ro.SideLeftIcon,{fontSize:"tiny"}):Po.createElement(Ro.SideRightIcon,{fontSize:"tiny"})}],[{bind:"block-end",label:(0,Do.__)("Bottom","elementor"),ariaLabel:(0,Do.sprintf)((0,Do.__)("%s bottom","elementor"),r),icon:Po.createElement(Ro.SideBottomIcon,{fontSize:"tiny"})},{bind:"inline-start",label:o?(0,Do.__)("Right","elementor"):(0,Do.__)("Left","elementor"),ariaLabel:o?(0,Do.sprintf)((0,Do.__)("%s right","elementor"),r):(0,Do.sprintf)((0,Do.__)("%s left","elementor"),r),icon:o?Po.createElement(Ro.SideRightIcon,{fontSize:"tiny"}):Po.createElement(Ro.SideLeftIcon,{fontSize:"tiny"})}]]}(r,o).map((r,o)=>Po.createElement(Io.Stack,{direction:"row",gap:2,flexWrap:"nowrap",key:o,ref:a[o]},r.map(({icon:r,...c})=>Po.createElement(Io.Grid,{container:!0,gap:.75,alignItems:"center",key:c.bind},Po.createElement(Io.Grid,{item:!0,xs:12},Po.createElement(Label,{...c})),Po.createElement(Io.Grid,{item:!0,xs:12},Po.createElement(Control3,{bind:c.bind,ariaLabel:c.ariaLabel,startIcon:r,isLinked:x,placeholder:getEffectivePlaceholder(c.bind)??void 0,anchorRef:a[o],min:i})))))))},Control3=({bind:r,ariaLabel:o,startIcon:i,isLinked:a,placeholder:c,anchorRef:u,min:p})=>a?Po.createElement(mi,{ariaLabel:o,startIcon:i,anchorRef:u,placeholder:c,min:p}):Po.createElement(PropKeyProvider,{bind:r},Po.createElement(mi,{ariaLabel:o,startIcon:i,anchorRef:u,min:p,placeholder:c})),Label=({label:r,bind:o})=>Po.createElement(PropKeyProvider,{bind:o},Po.createElement(ControlLabel,null,r)),getFirstDefined=r=>r?.["block-start"]??r?.["inline-end"]??r?.["block-end"]??r?.["inline-start"];var gi=__toESM(i(97557)),vi=i(97557),yi=i(2020),bi=i(24413),ki=i(79513),Ei=i(27723),Si=__toESM(i(97557)),wi=i(97557),xi=i(70374),Ci=i(79513),_i=i(22444),Ti=i(27723),ItemSelector=({itemsList:r,selectedItem:o,onItemChange:i,onClose:a,sectionWidth:c,title:u,itemStyle:p=()=>({}),onDebounce:g=()=>{},icon:v,disabledItems:b,id:k="item-selector",footer:E,categoryItemContentTemplate:w})=>{const[x,C]=(0,wi.useState)(""),_=((r,o,i)=>r.reduce((r,a)=>{const c=a.items.filter(r=>r.toLowerCase().includes(o.toLowerCase()));return c.length&&(r.push({type:"category",value:a.label}),c.forEach(o=>{r.push({type:"item",value:o,disabled:i?.includes(o)??!1})})),r},[]))(r,x,b),T=v,handleClose=()=>{C(""),a()};return Si.createElement(xi.PopoverBody,{width:c,id:k},Si.createElement(xi.PopoverHeader,{title:u,onClose:handleClose,icon:Si.createElement(T,{fontSize:"tiny"})}),Si.createElement(xi.SearchField,{value:x,onSearch:r=>{C(r)},placeholder:(0,Ti.__)("Search","elementor"),id:k+"-search"}),Si.createElement(Ci.Divider,null),Si.createElement(Ci.Box,{sx:{flex:1,overflow:"auto",minHeight:0}},_.length>0?Si.createElement(ItemList,{itemListItems:_,setSelectedItem:i,handleClose:handleClose,selectedItem:o,itemStyle:p,onDebounce:g,categoryItemContentTemplate:w}):Si.createElement(Ci.Stack,{alignItems:"center",justifyContent:"center",height:"100%",p:2.5,gap:1.5,overflow:"hidden"},Si.createElement(T,{fontSize:"large"}),Si.createElement(Ci.Box,{sx:{maxWidth:160,overflow:"hidden"}},Si.createElement(Ci.Typography,{align:"center",variant:"subtitle2",color:"text.secondary"},(0,Ti.__)("Sorry, nothing matched","elementor")),Si.createElement(Ci.Typography,{variant:"subtitle2",color:"text.secondary",sx:{display:"flex",width:"100%",justifyContent:"center"}},Si.createElement("span",null,"“"),Si.createElement(Ci.Box,{component:"span",sx:{maxWidth:"80%",overflow:"hidden",textOverflow:"ellipsis"}},x),Si.createElement("span",null,"”."))),Si.createElement(Ci.Typography,{align:"center",variant:"caption",color:"text.secondary",sx:{display:"flex",flexDirection:"column"}},(0,Ti.__)("Try something else.","elementor"),Si.createElement(Ci.Link,{color:"secondary",variant:"caption",component:"button",onClick:()=>C("")},(0,Ti.__)("Clear & try again","elementor"))))),E)},ItemList=({itemListItems:r,setSelectedItem:o,handleClose:i,selectedItem:a,itemStyle:c=()=>({}),onDebounce:u=()=>{},categoryItemContentTemplate:p})=>{const g=r.find(r=>r.value===a),v=useDebounce(r=>{r.forEach(r=>{r&&"item"===r.type&&u(r.value)})},100),b=(0,wi.useCallback)(r=>c(r),[c]);return Si.createElement(xi.PopoverMenuList,{items:r,selectedValue:g?.value,onChange:v,onSelect:o,onClose:i,itemStyle:b,"data-testid":"item-list",categoryItemContentTemplate:p})},useDebounce=(r,o)=>{const[i]=(0,wi.useState)(()=>(0,_i.debounce)(r,o));return(0,wi.useEffect)(()=>()=>i.cancel(),[i]),i},enqueueFont=(r,o="editor")=>{const i=window;return i.elementor?.helpers?.enqueueFont?.(r,o)??null},Oi=createControl(({fontFamilies:r,sectionWidth:o,ariaLabel:i})=>{const{value:a,setValue:c,disabled:u,placeholder:p}=useBoundProp(yi.fontFamilyPropTypeUtil),g=(0,ki.usePopupState)({variant:"popover"}),v=!a&&p,b=(0,vi.useMemo)(()=>r.map(({label:r,fonts:o})=>({label:r,items:o})),[r]);return gi.createElement(gi.Fragment,null,gi.createElement(ControlActions,null,gi.createElement(ki.UnstableTag,{id:"font-family-control",variant:"outlined",label:a||p,endIcon:gi.createElement(bi.ChevronDownIcon,{fontSize:"tiny"}),...(0,ki.bindTrigger)(g),fullWidth:!0,disabled:u,"aria-label":i,sx:v?{"& .MuiTag-label":{color:r=>r.palette.text.tertiary},textTransform:"capitalize"}:void 0})),gi.createElement(ki.Popover,{disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{my:1.5},...(0,ki.bindPopover)(g)},gi.createElement(ItemSelector,{id:"font-family-selector",itemsList:b,selectedItem:a,onItemChange:c,onClose:g.close,sectionWidth:o,title:(0,Ei.__)("Font family","elementor"),itemStyle:r=>({fontFamily:r.value}),onDebounce:enqueueFont,icon:bi.TextIcon})))}),Pi=__toESM(i(97557)),Ai=i(2020),Mi=i(79513),Ni=createControl(({placeholder:r,ariaLabel:o})=>{const{value:i,setValue:a,disabled:c,placeholder:u}=useBoundProp(Ai.urlPropTypeUtil),p=r??u??void 0;return Pi.createElement(ControlActions,null,Pi.createElement(Mi.TextField,{size:"tiny",fullWidth:!0,value:i??"",disabled:c,onChange:r=>a(r.target.value),placeholder:p,inputProps:{...o?{"aria-label":o}:{}}}))}),Ri=__toESM(i(97557)),Ii=i(97557),Di=i(70975),Li=i(2020),Fi=i(5527),zi=i(24413),ji=i(78187),Bi=i(79513),Vi=i(22444),$i=i(27723),Ui=__toESM(i(97557)),Hi=i(70975),Wi=i(24413),qi=i(79513),Ki=i(27723),Gi={label:(0,Ki.__)("Learn More","elementor"),href:"https://go.elementor.com/element-link-inside-link-infotip"},Ji={descendant:(0,Ki.__)("To add a link or action to this element, first remove the link or action from the elements inside of it.","elementor"),ancestor:(0,Ki.__)("To add a link or action to this container, first remove the link or action from its parent container.","elementor")};var RestrictedLinkInfotip=({linkInLinkRestriction:r,isVisible:o,children:i})=>{const{shouldRestrict:a,reason:c,elementId:u}=r,p=!(!u||!function isTargetInCurrentDocument(r){if(!r)return!1;const o=(0,Hi.getContainer)(r)?.view?.el;if(!o)return!1;const i=o.closest("[data-elementor-id]")?.getAttribute("data-elementor-id"),a=String((0,Hi.getCurrentDocumentId)()??"");return!(!i||!a||i!==a)}(u)),g=Ui.createElement(qi.Alert,{color:"secondary",icon:Ui.createElement(Wi.InfoCircleFilledIcon,null),size:"small",action:p?Ui.createElement(qi.AlertAction,{sx:{width:"fit-content"},variant:"contained",color:"secondary",onClick:()=>{u&&(0,Hi.selectElement)(u)}},(0,Ki.__)("Take me there","elementor")):void 0},Ui.createElement(qi.AlertTitle,null,(0,Ki.__)("Nested links","elementor")),Ui.createElement(qi.Box,{component:"span"},Ji[c??"descendant"]," ",Ui.createElement(qi.Link,{href:Gi.href,target:"_blank",color:"info.main"},Gi.label)));return a&&o?Ui.createElement(qi.Infotip,{placement:"right",content:g,color:"secondary",slotProps:{popper:{sx:{width:300}}}},Ui.createElement(qi.Box,null,i)):Ui.createElement(Ui.Fragment,null,i)},Yi=__toESM(i(97557)),Xi=i(2020),Qi=i(24413),Zi=i(27723),ea=__toESM(i(97557)),na=i(97557),ra=i(24413),oa=i(79513),ia=(0,na.forwardRef)((r,o)=>{const{options:i,onOptionChange:a,onTextChange:c,allowCustomValues:u=!1,placeholder:p="",minInputLength:g=2,value:v="",startAdornment:b,disablePortal:k=!0,inputProps:E,...w}=r,x=function factoryFilter(r,o,i){if(null===r)return o;const a=String(r||"")?.toLowerCase();if(a.length<i)return new Array(0);return o.filter(r=>String(r.id).toLowerCase().includes(a)||r.label.toLowerCase().includes(a))}(v,i,g).map(({id:r})=>r),C=!!v,_=u||!!v?.toString()?.length?void 0:()=>!0,T="number"==typeof v&&!!findMatchingOption(i,v),P=(v?.toString()?.length??0)>=g&&(!u||x.length>0);return ea.createElement(oa.Autocomplete,{...w,ref:o,forcePopupIcon:!1,disablePortal:k,disableClearable:!0,freeSolo:u,openOnFocus:!1,open:P,value:v?.toString()||"",size:"tiny",onChange:(r,o)=>a(Number(o)),readOnly:T,options:x,getOptionKey:r=>findMatchingOption(i,r)?.id||r,getOptionLabel:r=>findMatchingOption(i,r)?.label||r.toString(),groupBy:isCategorizedOptionPool(i)?r=>findMatchingOption(i,r)?.groupLabel||r:void 0,isOptionEqualToValue:_,filterOptions:()=>x,renderOption:(r,o)=>ea.createElement(oa.Box,{component:"li",...r,key:r.id},findMatchingOption(i,o)?.label??o),renderInput:r=>ea.createElement(TextInput,{params:r,handleChange:r=>c?.(r),allowClear:C,placeholder:p,hasSelectedValue:T,startAdornment:b,extraInputProps:E})})}),TextInput=({params:r,allowClear:o,placeholder:i,handleChange:a,hasSelectedValue:c,startAdornment:u,extraInputProps:p})=>ea.createElement(oa.TextField,{...r,placeholder:i,onChange:r=>{a(r.target.value)},inputProps:{...r.inputProps??{},...p??{}},sx:{"& .MuiInputBase-input":{cursor:c?"default":void 0}},InputProps:{...r.InputProps,startAdornment:u||r.InputProps.startAdornment,endAdornment:ea.createElement(ClearButton,{params:r,allowClear:o,handleChange:a})}}),ClearButton=({allowClear:r,handleChange:o,params:i})=>ea.createElement(oa.InputAdornment,{position:"end"},r&&ea.createElement(oa.IconButton,{size:i.size,onClick:()=>o(null),sx:{cursor:"pointer"}},ea.createElement(ra.XIcon,{fontSize:i.size})));function findMatchingOption(r,o=null){const i=(o||"").toString();return r.find(({id:r})=>i===r.toString())}function isCategorizedOptionPool(r){if(r.length<=1)return!1;return new Set(r.map(r=>r.groupLabel)).size>1}var aa=i(97557),sa=i(2020),la=i(18998),ca=i(22444);function useQueryAutocomplete({url:r,params:o={},minInputLength:i=2,initialQueryValue:a=null,excludeIds:c}){const u=(0,aa.useMemo)(()=>new Set((c??[]).map(String)),[c]),[p,g]=(0,aa.useState)(function generateFirstLoadedOption(r){const o=extractFlatOptionFromQueryValue(r);return o?[o]:[]}(a)),v=(0,aa.useMemo)(()=>(0,ca.debounce)(o=>fetchOptions(r,o).then(r=>{g(formatOptions(filterExcludedOptions(r,u)))}),400),[r,u]);(0,aa.useEffect)(()=>{0===i&&r&&fetchOptions(r,{...o,term:""}).then(r=>{g(formatOptions(filterExcludedOptions(r,u)))})},[r,i,u,o]);return{options:p,updateOptions:a=>{const c=a??"";!r||c.length<i||v({...o,term:c})}}}async function fetchOptions(r,o){if(!o||!r)return[];try{const{data:i}=await(0,la.httpService)().get(r,{params:o});return i.data.value}catch{return[]}}function formatOptions(r){const o=isCategorizedOptionPool(r)?"groupLabel":"label";return r.sort((r,i)=>r[o]&&i[o]?r[o].localeCompare(i[o]):0)}function filterExcludedOptions(r,o){return 0===o.size?r:r.filter(r=>!o.has(String(r.id)))}function extractFlatOptionFromQueryValue(r){const o=sa.numberPropTypeUtil.extract(r?.id),i=sa.stringPropTypeUtil.extract(r?.label);return null===o?null:{id:String(o),label:i||String(o)}}var ua=createControl(r=>{const{value:o,setValue:i}=useBoundProp(Xi.queryPropTypeUtil),{value:a,setValue:c,placeholder:u}=useBoundProp(Xi.urlPropTypeUtil),{allowCustomValues:p=!0,queryOptions:{url:g,params:v={}},placeholder:b=(0,Zi.__)("Search","elementor"),minInputLength:k=2,onSetValue:E,ariaLabel:w}=r||{},{options:x,updateOptions:C}=useQueryAutocomplete({url:g,params:v,minInputLength:k,initialQueryValue:o}),_=o?.id?.value??a;return Yi.createElement(ControlActions,null,Yi.createElement(ia,{options:x,allowCustomValues:p,placeholder:u??b,startAdornment:Yi.createElement(Qi.SearchIcon,{fontSize:"tiny"}),value:_,onOptionChange:r=>{if(null===r)return i(null),void E?.(null);const o={id:Xi.numberPropTypeUtil.create(r),label:Xi.stringPropTypeUtil.create(findMatchingOption(x,r)?.label||null)};i(o),E?.(Xi.queryPropTypeUtil.create(o))},onTextChange:r=>{const o=r?.trim()||"";if(!o)return c(null),void E?.(null);c(o),E?.(Xi.urlPropTypeUtil.create(o)),C(r)},minInputLength:k,disablePortal:!1,inputProps:{...w?{"aria-label":w}:{}}}))}),pa=__toESM(i(97557)),da=i(2020),fa=i(79513),ha=createControl(()=>{const{value:r,setValue:o,disabled:i,placeholder:a}=useBoundProp(da.booleanPropTypeUtil);return pa.createElement(fa.Box,{sx:{display:"flex",justifyContent:"flex-end"}},pa.createElement(fa.Switch,{checked:!(!r&&!a),onChange:r=>{o(r.target.checked)},size:"small",disabled:i,inputProps:{...i?{style:{opacity:0}}:{}}}))}),ma="tiny",ga=createControl(r=>{const{value:o,path:i,setValue:a,...c}=useBoundProp(Li.linkPropTypeUtil),u=c.placeholder,[p,g]=(0,ji.useSessionStorage)(i.join("/")),[v,b]=(0,Ii.useState)(!!o||!!u),{allowCustomValues:k=!0,queryOptions:E,placeholder:w,minInputLength:x=2,context:{elementId:C},label:_=(0,$i.__)("Link","elementor"),ariaLabel:T}=r||{},[P,A]=(0,Ii.useState)((0,Di.getLinkInLinkRestriction)(C,o??u)),N=!v&&P.shouldRestrict,R=(0,Vi.useDebouncedCallback)(()=>{const r=(0,Di.getLinkInLinkRestriction)(C,o??u);r.shouldRestrict&&v&&!u&&(b(!1),null!==o&&a(null)),A(o=>function isSameRestriction(r,o){return r.shouldRestrict===o.shouldRestrict&&r.reason===o.reason&&r.elementId===o.elementId}(o,r)?o:r)},300);(0,Fi.__privateUseListenTo)((0,Fi.commandEndEvent)("document/elements/set-settings"),()=>{R()},[R]),(0,Ii.useEffect)(()=>{R();const handleInlineLinkChanged=()=>{R()};return window.addEventListener("elementor:inline-link-changed",handleInlineLinkChanged),()=>{window.removeEventListener("elementor:inline-link-changed",handleInlineLinkChanged)}},[C,R]);return Ri.createElement(PropProvider,{...c,value:o,setValue:a},Ri.createElement(Bi.Stack,{gap:1.5},Ri.createElement(Bi.Stack,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",marginInlineEnd:-.75}},Ri.createElement(ControlLabel,null,_),Ri.createElement(RestrictedLinkInfotip,{isVisible:!v,linkInLinkRestriction:P},Ri.createElement(Bi.IconButton,{size:ma,onClick:()=>{if(A((0,Di.getLinkInLinkRestriction)(C,o??u)),P.shouldRestrict&&!v)return;const r=!v;b(r),r||null===o||a(null),r&&p?.value&&a(p.value),g({value:p?.value,meta:{isEnabled:r}})},"aria-label":(0,$i.__)("Toggle link","elementor"),disabled:N},v?Ri.createElement(zi.MinusIcon,{fontSize:ma}):Ri.createElement(zi.PlusIcon,{fontSize:ma})))),Ri.createElement(Bi.Collapse,{in:v,timeout:"auto",unmountOnExit:!0},Ri.createElement(Bi.Stack,{gap:1.5},Ri.createElement(PropKeyProvider,{bind:"destination"},Ri.createElement(ua,{queryOptions:E,allowCustomValues:k,minInputLength:x,placeholder:w,onSetValue:r=>{const i=r?{...o,destination:r}:null;g({...p,value:i})},ariaLabel:T||_})),Ri.createElement(PropKeyProvider,{bind:"isTargetBlank"},Ri.createElement(Bi.Grid,{container:!0,alignItems:"center",flexWrap:"nowrap",justifyContent:"space-between"},Ri.createElement(Bi.Grid,{item:!0},Ri.createElement(ControlFormLabel,null,(0,$i.__)("Open in a new tab","elementor"))),Ri.createElement(Bi.Grid,{item:!0,sx:{marginInlineEnd:-1}},Ri.createElement(ha,null))))))))});var va=__toESM(i(97557)),ya=i(70975),ba=i(2020),ka=i(70374),Ea=i(79513),Sa=i(27723),wa=__toESM(i(97557)),xa=i(70374),Ca=i(79513),_a=i(79513),Ta="secondary",Oa=wa.forwardRef(({children:r,title:o,description:i,alertProps:a,infotipProps:c,...u},p)=>{const g="rtl"===(0,Ca.useTheme)().direction,v=u.isEnabled&&(o||i);return wa.createElement(Ca.Box,{ref:p},v?wa.createElement(_a.DirectionProvider,{rtl:g},wa.createElement(Ca.Infotip,{placement:"right",color:Ta,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,10]}}]}},...c,content:wa.createElement(xa.InfoAlert,{color:Ta,sx:{width:300,px:1.5,py:2},...a},wa.createElement(Ca.Box,{sx:{flexDirection:"column",display:"flex",gap:.5}},wa.createElement(Ca.AlertTitle,null,o),wa.createElement(Ca.Box,null,i)))},r)):r)}),Pa=(0,Ea.styled)(Ea.Select)(()=>({".MuiSelect-select.Mui-disabled":{cursor:"not-allowed"}})),Aa=createControl(r=>{const{options:o,onChange:i,fallbackLabels:a={},context:{elementId:c}}=r,{value:u,setValue:p,disabled:g,placeholder:v}=useBoundProp(ba.stringPropTypeUtil),b=(0,ya.getElementLabel)(c)??"element",k={title:(0,Sa.__)("HTML Tag","elementor"),description:(0,Sa.__)("The tag is locked to 'a' tag because this %s has a link. To pick a different tag, remove the link first.","elementor").replace("%s",b),isEnabled:!!g},findOptionByValue=r=>o.find(o=>o.value===r);return va.createElement(ControlActions,null,va.createElement(Oa,{...k},va.createElement(Pa,{sx:{overflow:"hidden",cursor:g?"not-allowed":void 0},displayEmpty:!0,size:"tiny",renderValue:r=>{if(r)return findOptionByValue(r)?.label||a[r]||r;if(!v)return"";const o=findOptionByValue(v),i=o?.label||v;return va.createElement(Ea.Typography,{component:"span",variant:"caption",color:"text.tertiary"},i)},value:u??"",onChange:r=>{const o=r.target.value||null;i?.(o,u),p(o)},disabled:g,fullWidth:!0},o.map(({label:r,...o})=>va.createElement(ka.MenuListItem,{key:o.value,...o,value:o.value??""},r)))))}),Ma=__toESM(i(97557)),Na=i(97557),Ra=i(2020),Ia=i(79513),Da=i(27723),La=(0,Ra.createArrayPropUtils)(Ra.queryPropTypeUtil.key,Ra.queryPropTypeUtil.schema),Fa=createControl(r=>{const{queryOptions:o,placeholder:i,minInputLength:a=2}=r,{value:c,setValue:u,disabled:p}=useBoundProp(La),g=(0,Na.useMemo)(()=>function extractChips(r){if(!r)return[];return r.map(r=>extractFlatOptionFromQueryValue(r?.value)).filter(r=>null!==r)}(c),[c]),v=(0,Na.useMemo)(()=>g.map(r=>Number(r.id)).filter(r=>Number.isFinite(r)),[g]),{options:b,updateOptions:k}=useQueryAutocomplete({url:o.url,params:o.params,minInputLength:a,excludeIds:v});return Ma.createElement(ControlActions,null,Ma.createElement(Ia.Autocomplete,{multiple:!0,fullWidth:!0,disableClearable:!0,forcePopupIcon:!1,disabled:p,size:"tiny",value:g,options:b,onChange:(r,o)=>{u(o.map(r=>Ra.queryPropTypeUtil.create({id:Ra.numberPropTypeUtil.create(Number(r.id)),label:Ra.stringPropTypeUtil.create(r.label)})))},onInputChange:(r,o)=>{k(o||null)},getOptionLabel:r=>r.label,isOptionEqualToValue:(r,o)=>r.id===o.id,filterOptions:r=>r,renderTags:(r,o)=>Ma.createElement(ChipsList,{getLabel:r=>r.label,getTagProps:o,values:r}),renderInput:r=>Ma.createElement(Ia.TextField,{...r,placeholder:i??(0,Da.__)("Search","elementor")})}))});var za=__toESM(i(97557)),ja=i(97557),Ba=i(70975),Va=i(2020),$a=i(24413),Ua=i(79513),Ha=i(27723),Wa=createControl(({allowedKeys:r,keyConfig:o,label:i=(0,Ha.__)("Filter","elementor"),chipsPlaceholder:a})=>{const{propType:c,value:u,setValue:p}=useBoundProp(Va.queryFilterArrayPropTypeUtil),{settings:g}=(0,Ba.useSelectedElementSettings)(),v=(0,ja.useMemo)(()=>r.filter(r=>function isKeyVisible(r,o){if(!r)return!0;if(!o)return!1;const i=Va.stringPropTypeUtil.extract((0,Va.extractValue)(r.path,o));return null!==i&&r.in.includes(i)}(o[r]?.visibleWhen,g)),[r,o,g]),b=(0,ja.useMemo)(()=>function getUsedKeys(r){const o=r.map(r=>Va.stringPropTypeUtil.extract(r?.value?.key)).filter(r=>!!r);return new Set(o)}(u??[]),[u]),k=(0,ja.useMemo)(()=>v.find(r=>!b.has(r))??null,[v,b]),E=(0,ja.useMemo)(()=>r=>v.map(i=>({value:i,label:o[i]?.label??i,disabled:i!==r&&b.has(i)})),[v,o,b]),w=(0,ja.useMemo)(()=>createItemForKey(v[0]??""),[v]);return za.createElement(PropProvider,{propType:c,value:u,setValue:p},za.createElement(ControlRepeater,{initial:w,propTypeUtil:Va.queryFilterArrayPropTypeUtil},za.createElement(lr,{label:i},za.createElement(AddFilterItemAction,{nextAvailableKey:k,ariaLabel:i})),za.createElement(ItemsContainer,{isSortable:!1},za.createElement(Item,{Icon:EmptyIcon,actions:za.createElement(RemoveItemAction,null),Label:({value:r})=>za.createElement(ItemLabel2,{value:r,keyConfig:o})})),za.createElement(EditItemPopover,null,za.createElement(ItemContent,{keyConfig:o,getKeySelectOptions:E,chipsPlaceholder:a}))))}),AddFilterItemAction=({nextAvailableKey:r,ariaLabel:o})=>{const{addItem:i}=useRepeaterContext(),a=null===r;return za.createElement(Ua.Box,{component:"span",sx:{cursor:a?"not-allowed":"pointer"}},za.createElement(Ua.IconButton,{size:"tiny",disabled:a,onClick:o=>{r&&i(o,{item:createItemForKey(r),index:0})},"aria-label":(0,Ha.sprintf)((0,Ha.__)("Add %s item","elementor"),o.toLowerCase())},za.createElement($a.PlusIcon,{fontSize:"tiny"})))},EmptyIcon=()=>null,ItemLabel2=({value:r,keyConfig:o})=>{const i=Va.stringPropTypeUtil.extract(r?.value?.key),a=i&&o[i]?.label||(0,Ha.__)("Item","elementor"),c=function extractChipLabels(r){return(r?.value??[]).map(r=>Va.stringPropTypeUtil.extract(r?.value?.label)).filter(r=>!!r)}(r?.value?.values),u=[...c,...function extractTaxonomyLabels(r,o){const i=(Va.stringArrayPropTypeUtil.extract(r)??[]).map(r=>Va.stringPropTypeUtil.extract(r)).filter(r=>!!r);if(!i.length)return[];const a=o?.staticOptions??[];return i.map(r=>a.find(o=>o.value===r)?.label??r)}(r?.value?.taxonomies,i?o[i]:void 0)],p=u.length>0?`: ${u.join(", ")}`:"";return za.createElement(Ua.Box,{component:"span"},a,p)};var ItemContent=({keyConfig:r,getKeySelectOptions:o,chipsPlaceholder:i})=>{const a=useBoundProp(Va.queryFilterPropTypeUtil),c=(0,ja.useRef)({}),u=Va.stringPropTypeUtil.extract(a.value?.key),p=u?r[u]:void 0,g=p?.valueType??"chips",v=(0,ja.useMemo)(()=>o(u),[o,u]);return za.createElement(PopoverContent,{p:1.5},za.createElement(PropProvider,{...a,setValue:(r,o,i)=>{if("key"!==i?.bind)return void a.setValue(r,o,i);const u=Va.stringPropTypeUtil.extract(a.value?.key),p=Va.stringPropTypeUtil.extract(r?.key);u&&(c.current[u]={values:a.value?.values??null,taxonomies:a.value?.taxonomies??null});const g=p?c.current[p]:void 0;a.setValue({...r,values:g?.values??null,taxonomies:g?.taxonomies??null},o,i)}},za.createElement(or,{flexWrap:"wrap"},za.createElement(Ua.Grid,{item:!0,xs:12},za.createElement(ControlFormLabel,null,(0,Ha.__)("Type","elementor"))),za.createElement(Ua.Grid,{item:!0,xs:12},za.createElement(PropKeyProvider,{bind:"key"},za.createElement(_e,{options:v})))),"taxonomies"===g&&p?.staticOptions&&za.createElement(or,{flexWrap:"wrap"},za.createElement(Ua.Grid,{item:!0,xs:12},za.createElement(ControlFormLabel,null,p.label)),za.createElement(Ua.Grid,{item:!0,xs:12},za.createElement(PropKeyProvider,{bind:"taxonomies"},za.createElement(io,{options:p.staticOptions})))),"taxonomies"!==g&&p?.queryEndpoint&&za.createElement(or,{flexWrap:"wrap"},za.createElement(Ua.Grid,{item:!0,xs:12},za.createElement(ControlFormLabel,null,p.label)),za.createElement(Ua.Grid,{item:!0,xs:12},za.createElement(PropKeyProvider,{bind:"values"},za.createElement(Fa,{queryOptions:{url:p.queryEndpoint.url,params:p.queryEndpoint.params??{}},placeholder:p.chipsPlaceholder??i}))))))};function createItemForKey(r){return Va.queryFilterPropTypeUtil.create({key:Va.stringPropTypeUtil.create(r),values:null,taxonomies:null})}var qa=__toESM(i(97557)),Ka=i(97557),Ga=i(2020),Ja=i(74518),Ya=i(24413),Xa=i(79513),Qa=i(27723),GapControl=({label:r})=>{const o=(0,Ka.useRef)(null),{disabled:i}=useBoundProp(Ga.sizePropTypeUtil),{value:a,setValue:c,propType:u,placeholder:p,disabled:g}=useBoundProp(Ga.layoutDirectionPropTypeUtil),{value:v,setValue:b,placeholder:k}=useBoundProp(),inferIsLinked=()=>!Ga.layoutDirectionPropTypeUtil.isValid(v)&&!(!v&&Ga.layoutDirectionPropTypeUtil.isValid(k)),[E,w]=(0,Ka.useState)(()=>inferIsLinked()),x=Ga.layoutDirectionPropTypeUtil.isValid(v??k),C=(0,Ja.useActiveBreakpoint)();(0,Ka.useLayoutEffect)(()=>{w(inferIsLinked())},[C,x]);const _=r.toLowerCase(),T=E?Ya.LinkIcon:Ya.DetachIcon,P=(0,Qa.__)("Link %s","elementor").replace("%s",_),A=(0,Qa.__)("Unlink %s","elementor").replace("%s",_),N=i||g,R={propType:u,value:a??(E?null:{row:p?.row,column:p?.column}),setValue:r=>{const o=Object.entries(r).filter(([,r])=>Boolean(r));c(0===o.length?null:Object.fromEntries(o))},placeholder:p},I=!v&&(p||k),getEffectivePlaceholder=r=>{if(E){const r=p?.column??p?.row;return Ga.sizePropTypeUtil.extract(r)}return Ga.sizePropTypeUtil.extract(p?.[r])};return qa.createElement(PropProvider,{...R},qa.createElement(Xa.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},qa.createElement(ControlLabel,null,r),qa.createElement(Xa.Tooltip,{title:E?A:P,placement:"top"},qa.createElement(go,{"aria-label":E?A:P,size:"tiny",value:"check",selected:E,sx:{marginLeft:"auto"},onChange:()=>{if(w(r=>!r),!Ga.layoutDirectionPropTypeUtil.isValid(v)){const r=v||null;return r?void b(Ga.layoutDirectionPropTypeUtil.create({row:r,column:r})):void b(null)}b(a?.column??a?.row??null)},disabled:N,isPlaceholder:I},qa.createElement(T,{fontSize:"tiny"})))),qa.createElement(Xa.Stack,{direction:"row",gap:2,flexWrap:"nowrap",ref:o},qa.createElement(Xa.Grid,{container:!0,gap:.75,alignItems:"center"},qa.createElement(Xa.Grid,{item:!0,xs:12},qa.createElement(ControlFormLabel,null,(0,Qa.__)("Column","elementor"))),qa.createElement(Xa.Grid,{item:!0,xs:12},qa.createElement(Control4,{bind:"column",ariaLabel:(0,Qa.__)("Column gap","elementor"),isLinked:E,anchorRef:o,placeholder:getEffectivePlaceholder("column")??void 0}))),qa.createElement(Xa.Grid,{container:!0,gap:.75,alignItems:"center"},qa.createElement(Xa.Grid,{item:!0,xs:12},qa.createElement(ControlFormLabel,null,(0,Qa.__)("Row","elementor"))),qa.createElement(Xa.Grid,{item:!0,xs:12},qa.createElement(Control4,{bind:"row",ariaLabel:(0,Qa.__)("Row gap","elementor"),isLinked:E,anchorRef:o,placeholder:getEffectivePlaceholder("row")??void 0})))))},Control4=({bind:r,ariaLabel:o,isLinked:i,anchorRef:a,placeholder:c})=>i?qa.createElement(mi,{anchorRef:a,placeholder:c,ariaLabel:o}):qa.createElement(PropKeyProvider,{bind:r},qa.createElement(mi,{anchorRef:a,placeholder:c,ariaLabel:o})),Za=__toESM(i(97557)),es=i(97557),ns=i(2020),rs=i(70374),os=i(24413),as=i(79513),ss=i(27723),ls=[{label:(0,ss.__)("Auto","elementor"),value:"auto"},{label:"1/1",value:"1/1"},{label:"4/3",value:"4/3"},{label:"3/4",value:"3/4"},{label:"16/9",value:"16/9"},{label:"9/16",value:"9/16"},{label:"3/2",value:"3/2"},{label:"2/3",value:"2/3"}],cs="custom",us=createControl(({label:r})=>{const{value:o,setValue:i,disabled:a,placeholder:c}=useBoundProp(ns.stringPropTypeUtil),u=o??c,p=u&&!ls.some(r=>r.value===u),[g,v]=p?u.split("/"):["",""],[b,k]=(0,es.useState)(p),[E,w]=(0,es.useState)(g),[x,C]=(0,es.useState)(v),[_,T]=(0,es.useState)(p?cs:u||"");(0,es.useEffect)(()=>{if(u&&!ls.some(r=>r.value===u)){const[r,o]=u.split("/");w(r||""),C(o||""),T(cs),k(!0)}else T(u||""),k(!1),w(""),C("")},[u]);const P=o??c,A=ls.find(r=>r.value===P);return Za.createElement(ControlActions,null,Za.createElement(as.Stack,{direction:"column",gap:2},Za.createElement(as.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},Za.createElement(as.Grid,{item:!0,xs:6},Za.createElement(ControlLabel,null,r)),Za.createElement(as.Grid,{item:!0,xs:6},Za.createElement(as.Select,{size:"tiny",displayEmpty:!0,sx:{overflow:"hidden"},disabled:a,value:_,onChange:r=>{const o=r.target.value,a=o===cs;k(a),T(o),a||i(o)},renderValue:p?void 0:()=>A?.label,fullWidth:!0},[...ls,{label:(0,ss.__)("Custom","elementor"),value:cs}].map(({label:r,...o})=>Za.createElement(rs.MenuListItem,{key:o.value,...o,value:o.value??""},r))))),b&&Za.createElement(as.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},Za.createElement(as.Grid,{item:!0,xs:6},Za.createElement(as.TextField,{size:"tiny",type:"number",fullWidth:!0,disabled:a,value:E,onChange:r=>{const o=r.target.value;w(o),o&&x&&i(`${o}/${x}`)},InputProps:{startAdornment:Za.createElement(os.ArrowsMoveHorizontalIcon,{fontSize:"tiny"})}})),Za.createElement(as.Grid,{item:!0,xs:6},Za.createElement(as.TextField,{size:"tiny",type:"number",fullWidth:!0,disabled:a,value:x,onChange:r=>{const o=r.target.value;C(o),E&&o&&i(`${E}/${o}`)},InputProps:{startAdornment:Za.createElement(os.ArrowsMoveVerticalIcon,{fontSize:"tiny"})}})))))}),ps=__toESM(i(97557)),ds=i(97557),fs=i(46400),hs=i(2020),ms=i(24413),gs=i(79513),vs=i(84792),ys=i(27723),bs=__toESM(i(97557)),ks=i(97557),Es=i(79513),Ss=i(27723),ws=(0,Ss.__)("Enable Unfiltered Uploads","elementor"),xs=(0,Ss.__)("Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.","elementor"),Cs=(0,Ss.__)("Failed to enable unfiltered files upload.","elementor"),_s=(0,Ss.__)("You can try again, if the problem persists, please contact support.","elementor"),EnableUnfilteredModal=r=>{const{mutateAsync:o,isPending:i}=function useUpdateUnfilteredFilesUpload(){const r=(0,oe.useQueryClient)();return(0,oe.useMutation)({mutationFn:({allowUnfilteredFilesUpload:r})=>apiClient_updateElementorSetting(se,r?"1":"0"),onSuccess:()=>r.invalidateQueries(le)})}(),[a,c]=(0,ks.useState)(!1),u={...r,isPending:i,handleEnable:async()=>{try{const i=await o({allowUnfilteredFilesUpload:!0});!1===i?.data?.success?c(!0):r.onClose(!0)}catch{c(!0)}},isError:a,onClose:o=>{r.onClose(o),setTimeout(()=>c(!1),300)}};return bs.createElement(AdminDialog,{...u})},AdminDialog=({open:r,onClose:o,handleEnable:i,isPending:a,isError:c})=>bs.createElement(Es.Dialog,{open:r,maxWidth:"sm",onClose:()=>o(!1)},bs.createElement(Es.DialogHeader,{logo:!1},bs.createElement(Es.DialogTitle,null,ws)),bs.createElement(Es.Divider,null),bs.createElement(Es.DialogContent,null,bs.createElement(Es.DialogContentText,null,c?bs.createElement(bs.Fragment,null,Cs," ",bs.createElement("br",null)," ",_s):xs)),bs.createElement(Es.DialogActions,null,bs.createElement(Es.Button,{size:"medium",color:"secondary",onClick:()=>o(!1)},(0,Ss.__)("Cancel","elementor")),bs.createElement(Es.Button,{size:"medium",onClick:()=>i(),variant:"contained",color:"primary",disabled:a},a?bs.createElement(Es.CircularProgress,{size:24}):(0,Ss.__)("Enable","elementor")))),Ts="transparent",Os="#c1c1c1",Ps=`linear-gradient(45deg, ${Os} 25%, ${Ts} 0, ${Ts} 75%, ${Os} 0, ${Os})`,As=(0,gs.styled)(gs.Card)`
70 +`,sn=(0,o.styled)(o.ToggleButton,{shouldForwardProp:e=>"isPlaceholder"!==e})`
71 + ${({theme:e,isPlaceholder:t})=>t&&`\n\t\tcolor: ${e.palette.text.tertiary};\n\t\tbackground-color: ${"dark"===e.palette.mode?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.02)"};\n\n\t\t&:hover {\n\t\t\tbackground-color: ${"dark"===e.palette.mode?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.04)"};\n\t\t}\n\t`}
72 +`,ln=e.forwardRef(({justify:t="end",size:n="tiny",value:r,onChange:i,items:s,maxItems:l,exclusive:a=!1,fullWidth:c=!1,disabled:u,placeholder:d},p)=>{const h=a&&void 0!==l&&s.length>l,f=h?s.slice(l-1):[],m=h?s.slice(0,l-1):s,g="rtl"===(0,o.useTheme)().direction,y=(0,e.useMemo)(()=>{const e=f?.length;return`repeat(${e?m.length+1:m.length}, minmax(0, 25%)) ${e?"auto":""}`},[f?.length,m.length]),b=a&&(null==r||""===r),v=!a&&Array.isArray(r)?r.map(e=>"string"==typeof e?e:"").join(" ").trim().split(/\s+/).filter(Boolean):[],w=!a&&0===v.length,x=(E=d,Array.isArray(E)?E.flatMap(e=>"string"==typeof e?e.trim().split(/\s+/).filter(Boolean):[]):"string"==typeof E?E.trim().split(/\s+/).filter(Boolean):[]);var E;return e.createElement(on,{ref:p,justify:t,value:r,onChange:(e,t)=>{i(t)},exclusive:a,disabled:u,sx:{direction:g?"rtl /* @noflip */":"ltr /* @noflip */",display:"grid",gridTemplateColumns:y,width:"100%"}},m.map(({label:t,value:r,renderContent:o,showTooltip:i})=>{const s=x.length>0&&x.includes(r)&&(b||w);return e.createElement(rn,{key:r,label:t,showTooltip:i||!1},e.createElement(sn,{value:r,"aria-label":t,size:n,fullWidth:c,isPlaceholder:s},e.createElement(o,{size:n})))}),f.length&&a&&e.createElement(cn,{size:n,value:r||null,onChange:i,items:f,fullWidth:c}))}),an=t=>e.createElement(G,null,e.createElement(ln,t)),cn=({size:t="tiny",onChange:n,items:r,fullWidth:i,value:s})=>{const l=un(r,s),[a,c]=(0,e.useState)(!1),u=(0,e.useRef)(null),d=e=>{c(!1),p(e)},p=e=>{n(e===s?null:e)};return e.createElement(e.Fragment,null,e.createElement(o.ToggleButton,{value:l.value,"aria-label":l.label,size:t,fullWidth:i,onClick:e=>{e.preventDefault(),d(l.value)}},l.renderContent({size:t})),e.createElement(o.ToggleButton,{size:t,"aria-expanded":a?"true":void 0,"aria-haspopup":"menu","aria-pressed":void 0,onClick:e=>{c(e=>!e),e.preventDefault()},ref:u,value:"__chevron-icon-button__"},e.createElement(R.ChevronDownIcon,{fontSize:t})),e.createElement(o.Menu,{open:a,onClose:()=>c(!1),anchorEl:u.current,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:.5}},r.map(({label:t,value:n})=>e.createElement(o.MenuItem,{key:n,selected:n===s,onClick:()=>d(n)},e.createElement(o.ListItemText,null,e.createElement(o.Typography,{sx:{fontSize:"14px"}},t))))))},un=(t,n)=>{const[r,o]=(0,e.useState)(t.find(e=>e.value===n)??t[0]);return(0,e.useEffect)(()=>{const e=t.find(e=>e.value===n);e&&o(e)},[t,n]),r};function dn(){return dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dn.apply(null,arguments)}const pn=M(({options:n,fullWidth:r=!1,size:o="tiny",exclusive:i=!0,maxItems:s,convertOptions:l=!1})=>{const{value:a,setValue:c,placeholder:u,disabled:d}=b(t.stringPropTypeUtil),p=l?(t=>t.map(t=>{const n=t.icon,r=R[n];return{value:t.value,label:t.label,renderContent:({size:n})=>r?e.createElement(r,{fontSize:n}):t.label,showTooltip:t.showTooltip,exclusive:t.exclusive}}))(n):n,h=p.filter(e=>e.exclusive).map(e=>e.value),f={items:p,maxItems:s,fullWidth:r,size:o,placeholder:u};return i?e.createElement(an,dn({},f,{value:a??null,onChange:c,disabled:d,exclusive:!0})):e.createElement(an,dn({},f,{value:a?.split(" ")??[],onChange:e=>{const t=e[e.length-1],n=h.includes(t)?[t]:e?.filter(e=>!h.includes(e));c(n?.join(" ")||null)},disabled:d,exclusive:!1}))}),hn=e=>null==e||""===e||Number.isNaN(Number(e)),fn=M(({placeholder:n,max:r=Number.MAX_SAFE_INTEGER,min:i=-Number.MAX_SAFE_INTEGER,step:s=1,shouldForceInt:l=!1,startIcon:a})=>{const{value:c,setValue:u,placeholder:d,disabled:p,restoreValue:h}=b(t.numberPropTypeUtil);return e.createElement(G,null,e.createElement(ae,{size:"tiny",type:"number",fullWidth:!0,disabled:p,value:hn(c)?"":c,onInput:e=>{const{value:t,validity:{valid:n}}=e.target;let o;if(hn(t))o=null;else{const e=l?+parseInt(t):Number(t);o=Math.min(Math.max(e,i??Number.MIN_SAFE_INTEGER),r??Number.MAX_SAFE_INTEGER)}u(o,void 0,{validation:()=>n})},onBlur:h,placeholder:n??(hn(d)?"":String(d)),inputProps:{step:s,min:i},InputProps:{startAdornment:a?e.createElement(o.InputAdornment,{position:"start",disabled:p},a):void 0}}))}),mn=({children:t,...n})=>e.createElement(o.Stack,{direction:"row",alignItems:"center",justifyItems:"start",gap:.25},e.createElement(E,n,t),e.createElement(St,null));function gn(){return gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gn.apply(null,arguments)}const yn=(e,t)=>{const n=Object.values(e);if(n.length!==t.length)return!1;const[r,...o]=n;return o.every(e=>e?.value?.size===r?.value?.size&&e?.value?.unit===r?.value?.unit)};function bn({label:n,icon:r,tooltipLabel:s,items:l,multiSizePropTypeUtil:a}){const c=(0,e.useId)(),u=(0,o.usePopupState)({variant:"popover",popupId:c}),{propType:p,value:h,setValue:f,disabled:m}=b(a),{value:g,setValue:y}=b(t.sizePropTypeUtil),v=[(0,e.useRef)(null),(0,e.useRef)(null)],w=()=>g?l.reduce((e,{bind:n})=>({...e,[n]:t.sizePropTypeUtil.create(g)}),{}):null,x=!u.isOpen,k=!!h;return e.createElement(e.Fragment,null,e.createElement(o.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap",ref:v[0]},e.createElement(o.Grid,{item:!0,xs:6},x?e.createElement(mn,null,n):e.createElement(E,null,n)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(o.Stack,{direction:"row",alignItems:"center",gap:1},e.createElement(xe,{placeholder:k?(0,i.__)("Mixed","elementor"):void 0,anchorRef:v[0]}),e.createElement(o.Tooltip,{title:s,placement:"top"},e.createElement(o.ToggleButton,gn({size:"tiny",value:"check",sx:{marginLeft:"auto"}},(0,o.bindToggle)(u),{selected:u.isOpen,"aria-label":s}),r))))),e.createElement(o.Popover,gn({disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},(0,o.bindPopover)(u),{slotProps:{paper:{sx:{mt:.5,width:v[0].current?.getBoundingClientRect().width}}}}),e.createElement(d,{propType:p,value:h||(w()??null),setValue:e=>{const t={...h??w(),...e};if(yn(t,l))return y(Object.values(t)[0]?.value);f(t)},isDisabled:()=>m},e.createElement(vt,{p:1.5},e.createElement(wt,{ref:v[1]},e.createElement(vn,{item:l[0],rowRef:v[1]}),e.createElement(vn,{item:l[1],rowRef:v[1]})),e.createElement(wt,{ref:v[2]},e.createElement(vn,{item:l[2],rowRef:v[2]}),e.createElement(vn,{item:l[3],rowRef:v[2]}))))))}const vn=({item:t,rowRef:n})=>e.createElement(f,{bind:t.bind},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(o.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(o.Grid,{item:!0,xs:12},e.createElement(mn,null,t.label)),e.createElement(o.Grid,{item:!0,xs:12},e.createElement(xe,{startIcon:t.icon,anchorRef:n}))))),wn=({label:n,isSiteRtl:r=!1,extendedOptions:s,min:l})=>{const{value:a,setValue:c,disabled:u,placeholder:p}=b(t.sizePropTypeUtil),h=[(0,e.useRef)(null),(0,e.useRef)(null)],{value:f,setValue:m,propType:g,placeholder:y,disabled:v}=b(t.dimensionsPropTypeUtil),w=!(!p&&!y),x=!((f||a||w)&&(w?!p:!a)),k=n.toLowerCase(),S=x?R.LinkIcon:R.DetachIcon,C=(0,i.__)("Link %s","elementor").replace("%s",k),T=(0,i.__)("Unlink %s","elementor").replace("%s",k),M=u||v;return e.createElement(d,{propType:g,value:f,setValue:m,placeholder:y,isDisabled:()=>M},e.createElement(o.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},e.createElement(E,null,n),e.createElement(o.Tooltip,{title:x?T:C,placement:"top"},e.createElement(sn,{"aria-label":x?T:C,size:"tiny",value:"check",selected:x,sx:{marginLeft:"auto"},onChange:()=>{if(!x)return void c(f["block-start"]?.value??null);const e=a?t.sizePropTypeUtil.create(a):null;m({"block-start":e,"block-end":e,"inline-start":e,"inline-end":e})},disabled:M,isPlaceholder:w},e.createElement(S,{fontSize:"tiny"})))),function(t){return[[{bind:"block-start",label:(0,i.__)("Top","elementor"),icon:e.createElement(R.SideTopIcon,{fontSize:"tiny"})},{bind:"inline-end",label:t?(0,i.__)("Left","elementor"):(0,i.__)("Right","elementor"),icon:t?e.createElement(R.SideLeftIcon,{fontSize:"tiny"}):e.createElement(R.SideRightIcon,{fontSize:"tiny"})}],[{bind:"block-end",label:(0,i.__)("Bottom","elementor"),icon:e.createElement(R.SideBottomIcon,{fontSize:"tiny"})},{bind:"inline-start",label:t?(0,i.__)("Right","elementor"):(0,i.__)("Left","elementor"),icon:t?e.createElement(R.SideRightIcon,{fontSize:"tiny"}):e.createElement(R.SideLeftIcon,{fontSize:"tiny"})}]]}(r).map((t,n)=>e.createElement(o.Stack,{direction:"row",gap:2,flexWrap:"nowrap",key:n,ref:h[n]},t.map(({icon:t,...r})=>e.createElement(o.Grid,{container:!0,gap:.75,alignItems:"center",key:r.bind},e.createElement(o.Grid,{item:!0,xs:12},e.createElement(En,r)),e.createElement(o.Grid,{item:!0,xs:12},e.createElement(xn,{bind:r.bind,startIcon:t,isLinked:x,extendedOptions:s,anchorRef:h[n],min:l})))))))},xn=({bind:t,startIcon:n,isLinked:r,extendedOptions:o,anchorRef:i,min:s})=>r?e.createElement(xe,{startIcon:n,extendedOptions:o,anchorRef:i,min:s}):e.createElement(f,{bind:t},e.createElement(xe,{startIcon:n,extendedOptions:o,anchorRef:i,min:s})),En=({label:t,bind:n})=>e.createElement(f,{bind:n},e.createElement(mn,null,t)),kn=({itemsList:t,selectedItem:n,onItemChange:r,onClose:s,sectionWidth:l,title:a,itemStyle:c=()=>({}),onDebounce:u=()=>{},icon:d,disabledItems:p,id:h="item-selector"})=>{const[f,m]=(0,e.useState)(""),g=((e,t,n)=>e.reduce((e,r)=>{const o=r.items.filter(e=>e.toLowerCase().includes(t.toLowerCase()));return o.length&&(e.push({type:"category",value:r.label}),o.forEach(t=>{e.push({type:"item",value:t,disabled:n?.includes(t)??!1})})),e},[]))(t,f,p),y=d,b=()=>{m(""),s()};return e.createElement(q.PopoverBody,{width:l,id:h},e.createElement(q.PopoverHeader,{title:a,onClose:b,icon:e.createElement(y,{fontSize:"tiny"})}),e.createElement(q.SearchField,{value:f,onSearch:e=>{m(e)},placeholder:(0,i.__)("Search","elementor"),id:h+"-search"}),e.createElement(o.Divider,null),g.length>0?e.createElement(Sn,{itemListItems:g,setSelectedItem:r,handleClose:b,selectedItem:n,itemStyle:c,onDebounce:u}):e.createElement(o.Stack,{alignItems:"center",justifyContent:"center",height:"100%",p:2.5,gap:1.5,overflow:"hidden"},e.createElement(y,{fontSize:"large"}),e.createElement(o.Box,{sx:{maxWidth:160,overflow:"hidden"}},e.createElement(o.Typography,{align:"center",variant:"subtitle2",color:"text.secondary"},(0,i.__)("Sorry, nothing matched","elementor")),e.createElement(o.Typography,{variant:"subtitle2",color:"text.secondary",sx:{display:"flex",width:"100%",justifyContent:"center"}},e.createElement("span",null,"“"),e.createElement(o.Box,{component:"span",sx:{maxWidth:"80%",overflow:"hidden",textOverflow:"ellipsis"}},f),e.createElement("span",null,"”."))),e.createElement(o.Typography,{align:"center",variant:"caption",color:"text.secondary",sx:{display:"flex",flexDirection:"column"}},(0,i.__)("Try something else.","elementor"),e.createElement(o.Link,{color:"secondary",variant:"caption",component:"button",onClick:()=>m("")},(0,i.__)("Clear & try again","elementor")))))},Sn=({itemListItems:t,setSelectedItem:n,handleClose:r,selectedItem:o,itemStyle:i=()=>({}),onDebounce:s=()=>{}})=>{const l=t.find(e=>e.value===o),a=Cn(({getVirtualIndexes:e})=>{e().forEach(e=>{const n=t[e];n&&"item"===n.type&&s(n.value)})},100),c=(0,e.useCallback)(e=>i(e),[i]);return e.createElement(q.PopoverMenuList,{items:t,selectedValue:l?.value,onChange:a,onSelect:n,onClose:r,itemStyle:c,"data-testid":"item-list"})},Cn=(t,n)=>{const[r]=(0,e.useState)(()=>(0,s.debounce)(t,n));return(0,e.useEffect)(()=>()=>r.cancel(),[r]),r},Tn=(e,t="editor")=>{const n=window;return n.elementor?.helpers?.enqueueFont?.(e,t)??null};function Mn(){return Mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mn.apply(null,arguments)}const On=M(({fontFamilies:n,sectionWidth:r,ariaLabel:s})=>{const{value:l,setValue:a,disabled:c,placeholder:u}=b(t.stringPropTypeUtil),d=(0,o.usePopupState)({variant:"popover"}),p=!l&&u,h=e.useMemo(()=>n.map(({label:e,fonts:t})=>({label:e,items:t})),[n]);return e.createElement(e.Fragment,null,e.createElement(G,null,e.createElement(o.UnstableTag,Mn({id:"font-family-control",variant:"outlined",label:l||u,endIcon:e.createElement(R.ChevronDownIcon,{fontSize:"tiny"})},(0,o.bindTrigger)(d),{fullWidth:!0,disabled:c,"aria-label":s,sx:p?{"& .MuiTag-label":{color:e=>e.palette.text.tertiary},textTransform:"capitalize"}:void 0}))),e.createElement(o.Popover,Mn({disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{my:1.5}},(0,o.bindPopover)(d)),e.createElement(kn,{id:"font-family-selector",itemsList:h,selectedItem:l,onItemChange:a,onClose:d.close,sectionWidth:r,title:(0,i.__)("Font family","elementor"),itemStyle:e=>({fontFamily:e.value}),onDebounce:Tn,icon:R.TextIcon})))}),In=M(({placeholder:n,ariaLabel:r})=>{const{value:i,setValue:s,disabled:l}=b(t.urlPropTypeUtil);return e.createElement(G,null,e.createElement(o.TextField,{size:"tiny",fullWidth:!0,value:i??"",disabled:l,onChange:e=>s(e.target.value),placeholder:n,inputProps:{...r?{"aria-label":r}:{}}}))});var Pn=window.elementorV2.editorElements,Nn=window.elementorV2.session;const Dn={label:(0,i.__)("Learn More","elementor"),href:"https://go.elementor.com/element-link-inside-link-infotip"},An={descendant:(0,i.__)("To add a link to this element, first remove the link from the elements inside of it.","elementor"),ancestor:(0,i.__)("To add a link to this element, first remove the link from its parent container.","elementor")},_n=({linkInLinkRestriction:t,isVisible:n,children:r})=>{const{shouldRestrict:s,reason:l,elementId:a}=t,c=e.createElement(o.Alert,{color:"secondary",icon:e.createElement(R.InfoCircleFilledIcon,null),action:e.createElement(o.AlertAction,{sx:{width:"fit-content"},variant:"contained",color:"secondary",onClick:()=>{a&&(0,Pn.selectElement)(a)}},(0,i.__)("Take me there","elementor"))},e.createElement(o.AlertTitle,null,(0,i.__)("Nested links","elementor")),e.createElement(o.Box,{component:"span"},An[l??"descendant"]," ",e.createElement(o.Link,{href:Dn.href,target:"_blank",color:"info.main"},Dn.label)));return s&&n?e.createElement(o.Infotip,{placement:"right",content:c,color:"secondary",slotProps:{popper:{sx:{width:300}}}},e.createElement(o.Box,null,r)):e.createElement(e.Fragment,null,r)};function zn(){return zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zn.apply(null,arguments)}const Rn=(0,e.forwardRef)((t,n)=>{const{options:r,onOptionChange:i,onTextChange:s,allowCustomValues:l=!1,placeholder:a="",minInputLength:c=2,value:u="",startAdornment:d,disablePortal:p=!0,...h}=t,f=function(e,t,n){if(null===e)return t;const r=String(e||"")?.toLowerCase();return r.length<n?new Array(0):t.filter(e=>String(e.id).toLowerCase().includes(r)||e.label.toLowerCase().includes(r))}(u,r,c).map(({id:e})=>e),m=!!u,g=l||u?.toString()?.length?void 0:()=>!0,y="number"==typeof u&&!!Vn(r,u),b=(u?.toString()?.length??0)>=c&&(!l||f.length>0);return e.createElement(o.Autocomplete,zn({},h,{ref:n,forcePopupIcon:!1,disablePortal:p,disableClearable:!0,freeSolo:l,openOnFocus:!1,open:b,value:u?.toString()||"",size:"tiny",onChange:(e,t)=>i(Number(t)),readOnly:y,options:f,getOptionKey:e=>Vn(r,e)?.id||e,getOptionLabel:e=>Vn(r,e)?.label||e.toString(),groupBy:Ln(r)?e=>Vn(r,e)?.groupLabel||e:void 0,isOptionEqualToValue:g,filterOptions:()=>f,renderOption:(t,n)=>e.createElement(o.Box,zn({component:"li"},t,{key:t.id}),Vn(r,n)?.label??n),renderInput:t=>e.createElement($n,{params:t,handleChange:e=>s?.(e),allowClear:m,placeholder:a,hasSelectedValue:y,startAdornment:d,extraInputProps:h.inputProps})}))}),$n=({params:t,allowClear:n,placeholder:r,handleChange:i,hasSelectedValue:s,startAdornment:l,extraInputProps:a})=>e.createElement(o.TextField,zn({},t,{placeholder:r,onChange:e=>{i(e.target.value)},inputProps:{...t.inputProps??{},...a??{}},sx:{"& .MuiInputBase-input":{cursor:s?"default":void 0}},InputProps:{...t.InputProps,startAdornment:l?e.createElement(o.InputAdornment,{position:"start"},l):t.InputProps.startAdornment,endAdornment:e.createElement(Bn,{params:t,allowClear:n,handleChange:i})}})),Bn=({allowClear:t,handleChange:n,params:r})=>e.createElement(o.InputAdornment,{position:"end"},t&&e.createElement(o.IconButton,{size:r.size,onClick:()=>n(null),sx:{cursor:"pointer"}},e.createElement(R.XIcon,{fontSize:r.size})));function Vn(e,t=null){const n=(t||"").toString();return e.find(({id:e})=>n===e.toString())}function Ln(e){return!(e.length<=1)&&new Set(e.map(e=>e.groupLabel)).size>1}const Fn=M(n=>{const{value:r,setValue:o}=b(),{allowCustomValues:l=!0,queryOptions:{url:a,params:c={}},placeholder:u,minInputLength:d=2,onSetValue:p,ariaLabel:h}=n||{},f=u||(0,i.__)("Search","elementor"),[m,g]=(0,e.useState)(function(e){const t=e?.id?.value,n=e?.label?.value;return t&&n&&"number"===(e?.id?.$$type||"url")?[{id:t.toString(),label:n}]:[]}(r?.value)),y=(0,e.useMemo)(()=>(0,s.debounce)(e=>async function(e,t){if(!t||!e)return[];try{const{data:n}=await(0,I.httpService)().get(e,{params:t});return n.data.value}catch{return[]}}(a,e).then(e=>{g(function(e){const t=Ln(e)?"groupLabel":"label";return e.sort((e,n)=>e[t]&&n[t]?e[t].localeCompare(n[t]):0)}(e))}),400),[a]);return e.createElement(G,null,e.createElement(Rn,{options:m,allowCustomValues:l,placeholder:f,startAdornment:e.createElement(R.SearchIcon,{fontSize:"tiny"}),value:r?.value?.id?.value||r?.value,onOptionChange:e=>{if(null===e)return o(null),void p?.(null);const n={$$type:"query",value:{id:t.numberPropTypeUtil.create(e),label:t.stringPropTypeUtil.create(Vn(m,e)?.label||null)}};o(n),p?.(n)},onTextChange:e=>{if(!e)return o(null),void p?.(null);const n=e?.trim()||"",r=n?t.urlPropTypeUtil.create(n):null;o(r),p?.(r),(e=>{g([]),!e||!a||e.length<d||y({...c,term:e})})(e)},minInputLength:d,disablePortal:!1,inputProps:{...h?{"aria-label":h}:{}}}))}),jn=M(()=>{const{value:n,setValue:r,disabled:i}=b(t.booleanPropTypeUtil);return e.createElement(o.Box,{sx:{display:"flex",justifyContent:"flex-end"}},e.createElement(o.Switch,{checked:!!n,onChange:e=>{r(e.target.checked)},size:"small",disabled:i,inputProps:{...i?{style:{opacity:0}}:{}}}))});function Un(){return Un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Un.apply(null,arguments)}const Wn="tiny",Gn=M(n=>{const{value:r,path:s,setValue:l,...a}=b(t.linkPropTypeUtil),[c,u]=(0,Nn.useSessionStorage)(s.join("/")),[p,h]=(0,e.useState)(!!r),{allowCustomValues:m=!0,queryOptions:g,placeholder:y,minInputLength:v=2,context:{elementId:w},label:x=(0,i.__)("Link","elementor"),ariaLabel:k}=n||{},[S,C]=(0,e.useState)((0,Pn.getLinkInLinkRestriction)(w)),T=!p&&S.shouldRestrict;return e.createElement(d,Un({},a,{value:r,setValue:l}),e.createElement(o.Stack,{gap:1.5},e.createElement(o.Stack,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",marginInlineEnd:-.75}},e.createElement(mn,null,x),e.createElement(_n,{isVisible:!p,linkInLinkRestriction:S},e.createElement(Hn,{disabled:T,active:p,onIconClick:()=>{if(C((0,Pn.getLinkInLinkRestriction)(w)),S.shouldRestrict&&!p)return;const e=!p;h(e),e||null===r||l(null),e&&c?.value&&l(c.value),u({value:c?.value,meta:{isEnabled:e}})},label:(0,i.__)("Toggle link","elementor")}))),e.createElement(o.Collapse,{in:p,timeout:"auto",unmountOnExit:!0},e.createElement(o.Stack,{gap:1.5},e.createElement(f,{bind:"destination"},e.createElement(Fn,{queryOptions:g,allowCustomValues:m,minInputLength:v,placeholder:y,onSetValue:e=>{const t=e?{...r,destination:e}:null;u({...c,value:t})},ariaLabel:k||x})),e.createElement(f,{bind:"isTargetBlank"},e.createElement(o.Grid,{container:!0,alignItems:"center",flexWrap:"nowrap",justifyContent:"space-between"},e.createElement(o.Grid,{item:!0},e.createElement(E,null,(0,i.__)("Open in a new tab","elementor"))),e.createElement(o.Grid,{item:!0,sx:{marginInlineEnd:-1}},e.createElement(jn,null))))))))}),Hn=({disabled:t,active:n,onIconClick:r,label:i})=>e.createElement(o.IconButton,{size:Wn,onClick:r,"aria-label":i,disabled:t},n?e.createElement(R.MinusIcon,{fontSize:Wn}):e.createElement(R.PlusIcon,{fontSize:Wn}));function qn(){return qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qn.apply(null,arguments)}const Jn="secondary",Kn=e.forwardRef(({children:t,title:n,description:r,alertProps:i,infotipProps:s,...l},a)=>{const c="rtl"===(0,o.useTheme)().direction,u=l.isEnabled&&(n||r);return e.createElement(o.Box,{ref:a},u?e.createElement(o.DirectionProvider,{rtl:c},e.createElement(o.Infotip,qn({placement:"right",color:Jn,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,10]}}]}}},s,{content:e.createElement(q.InfoAlert,qn({color:Jn,sx:{width:300,px:1.5,py:2}},i),e.createElement(o.Box,{sx:{flexDirection:"column",display:"flex",gap:.5}},e.createElement(o.AlertTitle,null,n),e.createElement(o.Box,null,r)))}),t)):t)});function Yn(){return Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yn.apply(null,arguments)}const Xn=(0,o.styled)(o.Select)(()=>({".MuiSelect-select.Mui-disabled":{cursor:"not-allowed"}})),Zn=M(({options:n,onChange:r,fallbackLabels:s={}})=>{const{value:l,setValue:a,disabled:c,placeholder:u}=b(t.stringPropTypeUtil),d=(0,Pn.getElementLabel)()??"element",p={title:(0,i.__)("HTML Tag","elementor"),description:(0,i.__)("The tag is locked to 'a' tag because this %s has a link. To pick a different tag, remove the link first.","elementor").replace("%s",d),isEnabled:!!c},h=e=>n.find(t=>t.value===e);return e.createElement(G,null,e.createElement(Kn,p,e.createElement(Xn,{sx:{overflow:"hidden",cursor:c?"not-allowed":void 0},displayEmpty:!0,size:"tiny",renderValue:t=>{if(t)return h(t)?.label||s[t]||t;if(!u)return"";const n=h(u),r=n?.label||u;return e.createElement(o.Typography,{component:"span",variant:"caption",color:"text.tertiary"},r)},value:l??"",onChange:e=>{const t=e.target.value||null;r?.(t,l),a(t)},disabled:c,fullWidth:!0},n.map(({label:t,...n})=>e.createElement(q.MenuListItem,Yn({key:n.value},n,{value:n.value??""}),t)))))}),Qn=({label:n})=>{const{value:r,setValue:s,propType:l,disabled:a}=b(t.layoutDirectionPropTypeUtil),c=(0,e.useRef)(null),{value:u,setValue:p,disabled:h}=b(t.sizePropTypeUtil),f=!r&&!u||!!u,m=n.toLowerCase(),g=f?R.LinkIcon:R.DetachIcon,y=(0,i.__)("Link %s","elementor").replace("%s",m),v=(0,i.__)("Unlink %s","elementor").replace("%s",m),w=h||a;return e.createElement(d,{propType:l,value:r,setValue:s},e.createElement(o.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},e.createElement(mn,null,n),e.createElement(o.Tooltip,{title:f?v:y,placement:"top"},e.createElement(o.ToggleButton,{"aria-label":f?v:y,size:"tiny",value:"check",selected:f,sx:{marginLeft:"auto"},onChange:()=>{if(!f)return void p(r?.column?.value??null);const e=u?t.sizePropTypeUtil.create(u):null;s({row:e,column:e})},disabled:w},e.createElement(g,{fontSize:"tiny"})))),e.createElement(o.Stack,{direction:"row",gap:2,flexWrap:"nowrap",ref:c},e.createElement(o.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(o.Grid,{item:!0,xs:12},e.createElement(E,null,(0,i.__)("Column","elementor"))),e.createElement(o.Grid,{item:!0,xs:12},e.createElement(er,{bind:"column",isLinked:f,anchorRef:c}))),e.createElement(o.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(o.Grid,{item:!0,xs:12},e.createElement(E,null,(0,i.__)("Row","elementor"))),e.createElement(o.Grid,{item:!0,xs:12},e.createElement(er,{bind:"row",isLinked:f,anchorRef:c})))))},er=({bind:t,isLinked:n,anchorRef:r})=>n?e.createElement(xe,{anchorRef:r}):e.createElement(f,{bind:t},e.createElement(xe,{anchorRef:r}));function tr(){return tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tr.apply(null,arguments)}const nr=[{label:(0,i.__)("Auto","elementor"),value:"auto"},{label:"1/1",value:"1/1"},{label:"4/3",value:"4/3"},{label:"3/4",value:"3/4"},{label:"16/9",value:"16/9"},{label:"9/16",value:"9/16"},{label:"3/2",value:"3/2"},{label:"2/3",value:"2/3"}],rr="custom",or=M(({label:n})=>{const{value:r,setValue:s,disabled:l}=b(t.stringPropTypeUtil),a=r&&!nr.some(e=>e.value===r),[c,u]=a?r.split("/"):["",""],[d,p]=(0,e.useState)(a),[h,f]=(0,e.useState)(c),[m,g]=(0,e.useState)(u),[y,v]=(0,e.useState)(a?rr:r||"");return(0,e.useEffect)(()=>{if(r&&!nr.some(e=>e.value===r)){const[e,t]=r.split("/");f(e||""),g(t||""),v(rr),p(!0)}else v(r||""),p(!1),f(""),g("")},[r]),e.createElement(G,null,e.createElement(o.Stack,{direction:"column",gap:2},e.createElement(o.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(mn,null,n)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(o.Select,{size:"tiny",displayEmpty:!0,sx:{overflow:"hidden"},disabled:l,value:y,onChange:e=>{const t=e.target.value,n=t===rr;p(n),v(t),n||s(t)},fullWidth:!0},[...nr,{label:(0,i.__)("Custom","elementor"),value:rr}].map(({label:t,...n})=>e.createElement(q.MenuListItem,tr({key:n.value},n,{value:n.value??""}),t))))),d&&e.createElement(o.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(o.TextField,{size:"tiny",type:"number",fullWidth:!0,disabled:l,value:h,onChange:e=>{const t=e.target.value;f(t),t&&m&&s(`${t}/${m}`)},InputProps:{startAdornment:e.createElement(R.ArrowsMoveHorizontalIcon,{fontSize:"tiny"})}})),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(o.TextField,{size:"tiny",type:"number",fullWidth:!0,disabled:l,value:m,onChange:e=>{const t=e.target.value;g(t),h&&t&&s(`${h}/${t}`)},InputProps:{startAdornment:e.createElement(R.ArrowsMoveVerticalIcon,{fontSize:"tiny"})}})))))});var ir=window.elementorV2.editorCurrentUser;const sr=(0,i.__)("Enable Unfiltered Uploads","elementor"),lr=(0,i.__)("Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.","elementor"),ar=(0,i.__)("Failed to enable unfiltered files upload.","elementor"),cr=(0,i.__)("You can try again, if the problem persists, please contact support.","elementor"),ur=t=>{const{mutateAsync:n,isPending:r}=function(){const e=(0,O.useQueryClient)();return(0,O.useMutation)({mutationFn:({allowUnfilteredFilesUpload:e})=>{return t=D,n=e?"1":"0",(0,I.httpService)().put(`${P}/${t}`,{value:n});var t,n},onSuccess:()=>e.invalidateQueries(A)})}(),[o,i]=(0,e.useState)(!1),s={...t,isPending:r,handleEnable:async()=>{try{const e=await n({allowUnfilteredFilesUpload:!0});!1===e?.data?.success?i(!0):t.onClose(!0)}catch{i(!0)}},isError:o,onClose:e=>{t.onClose(e),setTimeout(()=>i(!1),300)}};return e.createElement(dr,s)},dr=({open:t,onClose:n,handleEnable:r,isPending:s,isError:l})=>e.createElement(o.Dialog,{open:t,maxWidth:"sm",onClose:()=>n(!1)},e.createElement(o.DialogHeader,{logo:!1},e.createElement(o.DialogTitle,null,sr)),e.createElement(o.Divider,null),e.createElement(o.DialogContent,null,e.createElement(o.DialogContentText,null,l?e.createElement(e.Fragment,null,ar," ",e.createElement("br",null)," ",cr):lr)),e.createElement(o.DialogActions,null,e.createElement(o.Button,{size:"medium",color:"secondary",onClick:()=>n(!1)},(0,i.__)("Cancel","elementor")),e.createElement(o.Button,{size:"medium",onClick:()=>r(),variant:"contained",color:"primary",disabled:s},s?e.createElement(o.CircularProgress,{size:24}):(0,i.__)("Enable","elementor")))),pr="transparent",hr="#c1c1c1",fr=`linear-gradient(45deg, ${hr} 25%, ${pr} 0, ${pr} 75%, ${hr} 0, ${hr})`,mr=(0,o.styled)(o.Card)`
63 73 background-color: white;
64 - background-image: ${Ps}, ${Ps};
74 + background-image: ${fr}, ${fr};
65 75 background-size: ${8}px ${8}px;
66 76 background-position:
67 77 0 0,
68 78 ${4}px ${4}px;
69 79 border: none;
70 -`,Ms=(0,gs.styled)(gs.Stack)`
80 +`,gr=(0,o.styled)(o.Stack)`
71 81 position: relative;
72 82 height: 140px;
73 83 object-fit: contain;
74 84 padding: 5px;
@@ -74,5 +84,5 @@
74 84 padding: 5px;
75 85 justify-content: center;
76 86 align-items: center;
77 87 background-color: rgba( 255, 255, 255, 0.37 );
78 -`,Ns={mode:"browse"},Rs={mode:"upload"},Is=createControl(()=>{const{value:r,setValue:o}=useBoundProp(hs.svgSrcPropTypeUtil),i=r?.id,a=r?.url,{data:c,isFetching:u}=(0,vs.useWpMediaAttachment)(i?.value||null),p=c?.url??a?.value??null,{data:g}=useUnfilteredFilesUpload(),[v,b]=(0,ds.useState)(!1),{isAdmin:k}=(0,fs.useCurrentUserCapabilities)(),{open:E}=(0,vs.useWpMediaFrame)({mediaTypes:["svg"],multiple:!1,selected:i?.value||null,onSelect:r=>{o({id:{$$type:"image-attachment-id",value:r.id},url:hs.urlPropTypeUtil.create(r.url)})}}),handleClick=r=>{g||r!==Rs?E(r):b(!0)},w={title:(0,ys.__)("Sorry, you can't upload that file yet.","elementor"),description:ps.createElement(ps.Fragment,null,(0,ys.__)("To upload them anyway, ask the site administrator to enable unfiltered","elementor"),ps.createElement("br",null),(0,ys.__)("file uploads.","elementor")),isEnabled:!k};return ps.createElement(gs.Stack,{gap:1,"aria-label":"SVG Control"},ps.createElement(EnableUnfilteredModal,{open:v,onClose:r=>{b(!1),r&&E(Rs)}}),ps.createElement(ControlActions,null,ps.createElement(As,{variant:"outlined"},ps.createElement(Ms,null,u?ps.createElement(gs.CircularProgress,{role:"progressbar"}):ps.createElement(gs.CardMedia,{component:"img",image:p,alt:(0,ys.__)("Preview SVG","elementor"),sx:{maxHeight:"140px",width:"50px"}})),ps.createElement(gs.CardOverlay,{sx:{"&:hover":{backgroundColor:"rgba( 0, 0, 0, 0.75 )"}}},ps.createElement(gs.Stack,{gap:1},ps.createElement(gs.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>handleClick(Ns),"aria-label":"Select SVG"},(0,ys.__)("Select SVG","elementor")),ps.createElement(Oa,{...w},ps.createElement("span",null,ps.createElement(gs.ThemeProvider,{colorScheme:k?"light":"dark"},ps.createElement(gs.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:ps.createElement(ms.UploadIcon,null),disabled:!k,onClick:()=>k&&handleClick(Rs),"aria-label":"Upload SVG"},(0,ys.__)("Upload","elementor"))))))))))}),Ds=__toESM(i(97557)),Ls=i(2020),Fs=i(24413),zs=i(79513),js=i(84792),Bs=i(27723),Vs=window.elementorCommon?.config?.urls?.assets+"/shapes/play-triangle.svg",$s=createControl(()=>{const{value:r,setValue:o}=useBoundProp(Ls.videoSrcPropTypeUtil),{id:i,url:a}=r??{},{data:c,isFetching:u}=(0,js.useWpMediaAttachment)(i?.value||null),p=c?.url??a?.value??null,{open:g}=(0,js.useWpMediaFrame)({mediaTypes:["video"],multiple:!1,selected:i?.value||null,onSelect:r=>{o({id:{$$type:"video-attachment-id",value:r.id},url:null})}});return Ds.createElement(ControlActions,null,Ds.createElement(zs.Card,{variant:"outlined"},Ds.createElement(zs.CardMedia,{sx:{height:140,backgroundColor:"white",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundRepeat:"repeat",backgroundImage:`${Ps}, ${Ps}`,display:"flex",justifyContent:"center",alignItems:"center"}},Ds.createElement(VideoPreview,{isFetching:u,videoUrl:p})),Ds.createElement(zs.CardOverlay,null,Ds.createElement(zs.Stack,{gap:1},Ds.createElement(zs.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>g({mode:"browse"})},(0,Bs.__)("Select video","elementor")),Ds.createElement(zs.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:Ds.createElement(Fs.UploadIcon,null),onClick:()=>g({mode:"upload"})},(0,Bs.__)("Upload","elementor"))))))}),VideoPreview=({isFetching:r=!1,videoUrl:o})=>r?Ds.createElement(zs.CircularProgress,null):o?Ds.createElement("video",{src:o,muted:!0,preload:"metadata",style:{width:"100%",height:"100%",objectFit:"cover",pointerEvents:"none"}}):Ds.createElement("img",{src:Vs,alt:"No video selected"}),Us=__toESM(i(97557)),Hs=i(2020),Ws=i(79513),qs=i(27723),Ks=__toESM(i(97557)),Gs=i(2020),Js=i(79513),Ys=i(84792),Xs=i(27723),Qs=i(78806),{env:Zs}=(0,Qs.parseEnv)("@elementor/editor-controls"),el=__toESM(i(97557)),tl=i(2020),nl=i(79513),rl=createControl(()=>{const{value:r,setValue:o}=useBoundProp(tl.backgroundGradientOverlayPropTypeUtil),createTransformableValue=r=>({...r,type:tl.stringPropTypeUtil.create(r.type),angle:tl.numberPropTypeUtil.create(r.angle),stops:tl.gradientColorStopPropTypeUtil.create(r.stops.map(({color:r,offset:o})=>tl.colorStopPropTypeUtil.create({color:tl.colorPropTypeUtil.create(r),offset:tl.numberPropTypeUtil.create(o)})))});return el.createElement(nl.UnstableGradientBox,{sx:{width:"auto",padding:1.5},value:(()=>{if(!r)return;const{type:o,angle:i,stops:a,positions:c}=r;return{type:o.value,angle:i?.value||0,stops:a.value.map(({value:{color:r,offset:o}})=>({color:r.value,offset:o.value})),positions:c?.value.split(" ")}})(),onChange:r=>{const i=createTransformableValue(r);i.positions&&(i.positions=tl.stringPropTypeUtil.create(r.positions.join(" "))),o(i)}})}),ol=tl.backgroundGradientOverlayPropTypeUtil.create({type:tl.stringPropTypeUtil.create("linear"),angle:tl.numberPropTypeUtil.create(180),stops:tl.gradientColorStopPropTypeUtil.create([tl.colorStopPropTypeUtil.create({color:tl.colorPropTypeUtil.create("rgb(0,0,0)"),offset:tl.numberPropTypeUtil.create(0)}),tl.colorStopPropTypeUtil.create({color:tl.colorPropTypeUtil.create("rgb(255,255,255)"),offset:tl.numberPropTypeUtil.create(100)})])}),il=__toESM(i(97557)),al=i(24413),sl=i(79513),ll=i(27723),cl=[{value:"fixed",label:(0,ll.__)("Fixed","elementor"),renderContent:({size:r})=>il.createElement(al.PinIcon,{fontSize:r}),showTooltip:!0},{value:"scroll",label:(0,ll.__)("Scroll","elementor"),renderContent:({size:r})=>il.createElement(al.PinnedOffIcon,{fontSize:r}),showTooltip:!0}],BackgroundImageOverlayAttachment=()=>il.createElement(or,null,il.createElement(sl.Grid,{item:!0,xs:6},il.createElement(ControlFormLabel,null,(0,ll.__)("Attachment","elementor"))),il.createElement(sl.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end",overflow:"hidden"}},il.createElement(ko,{options:cl}))),ul=__toESM(i(97557)),pl=i(97557),dl=i(2020),fl=i(70374),hl=i(24413),ml=i(79513),gl=i(27723),vl=[{label:(0,gl.__)("Center center","elementor"),value:"center center"},{label:(0,gl.__)("Center left","elementor"),value:"center left"},{label:(0,gl.__)("Center right","elementor"),value:"center right"},{label:(0,gl.__)("Top center","elementor"),value:"top center"},{label:(0,gl.__)("Top left","elementor"),value:"top left"},{label:(0,gl.__)("Top right","elementor"),value:"top right"},{label:(0,gl.__)("Bottom center","elementor"),value:"bottom center"},{label:(0,gl.__)("Bottom left","elementor"),value:"bottom left"},{label:(0,gl.__)("Bottom right","elementor"),value:"bottom right"},{label:(0,gl.__)("Custom","elementor"),value:"custom"}],BackgroundImageOverlayPosition=()=>{const r=useBoundProp(dl.backgroundImagePositionOffsetPropTypeUtil),o=useBoundProp(dl.stringPropTypeUtil),i=!!r.value,a=(0,pl.useRef)(null);return ul.createElement(ml.Grid,{container:!0,spacing:1.5},ul.createElement(ml.Grid,{item:!0,xs:12},ul.createElement(or,null,ul.createElement(ml.Grid,{item:!0,xs:6},ul.createElement(ControlFormLabel,null,(0,gl.__)("Position","elementor"))),ul.createElement(ml.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end",overflow:"hidden"}},ul.createElement(ControlActions,null,ul.createElement(ml.Select,{fullWidth:!0,size:"tiny",onChange:i=>{const a=i.target.value||null;"custom"===a?r.setValue({x:null,y:null}):o.setValue(a)},disabled:o.disabled,value:(r.value?"custom":o.value)??""},vl.map(({label:r,value:o})=>ul.createElement(fl.MenuListItem,{key:o,value:o??""},r))))))),i?ul.createElement(PropProvider,{...r},ul.createElement(ml.Grid,{item:!0,xs:12},ul.createElement(ml.Grid,{container:!0,spacing:1.5,ref:a},ul.createElement(ml.Grid,{item:!0,xs:6},ul.createElement(PropKeyProvider,{bind:"x"},ul.createElement(_t,{startIcon:ul.createElement(hl.LetterXIcon,{fontSize:"tiny"}),anchorRef:a,min:-Number.MAX_SAFE_INTEGER}))),ul.createElement(ml.Grid,{item:!0,xs:6},ul.createElement(PropKeyProvider,{bind:"y"},ul.createElement(_t,{startIcon:ul.createElement(hl.LetterYIcon,{fontSize:"tiny"}),anchorRef:a,min:-Number.MAX_SAFE_INTEGER})))))):null)},yl=__toESM(i(97557)),bl=i(24413),kl=i(79513),El=i(27723),Sl=[{value:"repeat",label:(0,El.__)("Repeat","elementor"),renderContent:({size:r})=>yl.createElement(bl.GridDotsIcon,{fontSize:r}),showTooltip:!0},{value:"repeat-x",label:(0,El.__)("Repeat-x","elementor"),renderContent:({size:r})=>yl.createElement(bl.DotsHorizontalIcon,{fontSize:r}),showTooltip:!0},{value:"repeat-y",label:(0,El.__)("Repeat-y","elementor"),renderContent:({size:r})=>yl.createElement(bl.DotsVerticalIcon,{fontSize:r}),showTooltip:!0},{value:"no-repeat",label:(0,El.__)("No-repeat","elementor"),renderContent:({size:r})=>yl.createElement(bl.XIcon,{fontSize:r}),showTooltip:!0}],BackgroundImageOverlayRepeat=()=>yl.createElement(or,null,yl.createElement(kl.Grid,{item:!0,xs:6},yl.createElement(ControlFormLabel,null,(0,El.__)("Repeat","elementor"))),yl.createElement(kl.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end"}},yl.createElement(ko,{options:Sl}))),wl=__toESM(i(97557)),xl=i(97557),Cl=i(2020),_l=i(24413),Tl=i(79513),Ol=i(27723),Pl=[{value:"auto",label:(0,Ol.__)("Auto","elementor"),renderContent:({size:r})=>wl.createElement(_l.LetterAIcon,{fontSize:r}),showTooltip:!0},{value:"cover",label:(0,Ol.__)("Cover","elementor"),renderContent:({size:r})=>wl.createElement(_l.ArrowsMaximizeIcon,{fontSize:r}),showTooltip:!0},{value:"contain",label:(0,Ol.__)("Contain","elementor"),renderContent:({size:r})=>wl.createElement(_l.ArrowBarBothIcon,{fontSize:r}),showTooltip:!0},{value:"custom",label:(0,Ol.__)("Custom","elementor"),renderContent:({size:r})=>wl.createElement(_l.PencilIcon,{fontSize:r}),showTooltip:!0}],BackgroundImageOverlaySize=()=>{const r=useBoundProp(Cl.backgroundImageSizeScalePropTypeUtil),o=useBoundProp(Cl.stringPropTypeUtil),i=!!r.value,a=(0,xl.useRef)(null);return wl.createElement(Tl.Grid,{container:!0,spacing:1.5},wl.createElement(Tl.Grid,{item:!0,xs:12},wl.createElement(or,null,wl.createElement(Tl.Grid,{item:!0,xs:6},wl.createElement(ControlFormLabel,null,(0,Ol.__)("Size","elementor"))),wl.createElement(Tl.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end"}},wl.createElement(ControlToggleButtonGroup,{exclusive:!0,items:Pl,onChange:i=>{"custom"===i?r.setValue({width:null,height:null}):o.setValue(i)},disabled:o.disabled,value:r.value?"custom":o.value})))),i?wl.createElement(PropProvider,{...r},wl.createElement(Tl.Grid,{item:!0,xs:12,ref:a},wl.createElement(or,null,wl.createElement(Tl.Grid,{item:!0,xs:6},wl.createElement(PropKeyProvider,{bind:"width"},wl.createElement(_t,{startIcon:wl.createElement(_l.ArrowsMoveHorizontalIcon,{fontSize:"tiny"}),extendedOptions:["auto"],anchorRef:a}))),wl.createElement(Tl.Grid,{item:!0,xs:6},wl.createElement(PropKeyProvider,{bind:"height"},wl.createElement(_t,{startIcon:wl.createElement(_l.ArrowsMoveVerticalIcon,{fontSize:"tiny"}),extendedOptions:["auto"],anchorRef:a})))))):null)},Al=i(97557),Ml=i(2020),Nl=i(79513),Rl=Gs.backgroundColorOverlayPropTypeUtil.create({color:Gs.colorPropTypeUtil.create("#00000033")}),getInitialBackgroundOverlay=()=>({$$type:"background-image-overlay",value:{image:{$$type:"image",value:{src:{$$type:"image-src",value:{url:{$$type:"url",value:Zs.background_placeholder_image},id:null}},size:{$$type:"string",value:"large"}}}}}),Il=[{label:(0,Xs.__)("Thumbnail - 150 x 150","elementor"),value:"thumbnail"},{label:(0,Xs.__)("Medium - 300 x 300","elementor"),value:"medium"},{label:(0,Xs.__)("Large 1024 x 1024","elementor"),value:"large"},{label:(0,Xs.__)("Full","elementor"),value:"full"}],Dl=createControl(()=>{const{propType:r,value:o,setValue:i}=useBoundProp(Gs.backgroundOverlayPropTypeUtil);return Ks.createElement(PropProvider,{propType:r,value:o,setValue:i},Ks.createElement(ControlRepeater,{initial:getInitialBackgroundOverlay(),propTypeUtil:Gs.backgroundOverlayPropTypeUtil},Ks.createElement(lr,{label:(0,Xs.__)("Overlay","elementor")},Ks.createElement(TooltipAddItemAction,{newItemIndex:0})),Ks.createElement(ItemsContainer,null,Ks.createElement(Item,{Icon:ItemIcon2,Label:ItemLabel3,actions:Ks.createElement(Ks.Fragment,null,Ks.createElement(DuplicateItemAction,null),Ks.createElement(DisableItemAction,null),Ks.createElement(RemoveItemAction,null))})),Ks.createElement(EditItemPopover,null,Ks.createElement(ItemContent2,null))))}),ItemContent2=()=>{const{getTabsProps:r,getTabProps:o,getTabPanelProps:i}=(({color:r,image:o,gradient:i})=>{const{value:a,setValue:c}=useBoundProp(Ml.backgroundImageOverlayPropTypeUtil),{value:u,setValue:p}=useBoundProp(Ml.backgroundColorOverlayPropTypeUtil),{value:g,setValue:v}=useBoundProp(Ml.backgroundGradientOverlayPropTypeUtil),{getTabsProps:b,getTabProps:k,getTabPanelProps:E}=(0,Nl.useTabs)(u?"color":g?"gradient":"image"),w=(0,Al.useRef)({image:o,color:r,gradient:i}),saveToHistory=(r,o)=>{o&&(w.current[r]=o)},onTabChange=(r,o)=>{switch(o){case"image":c(w.current.image),saveToHistory("color",u),saveToHistory("gradient",g);break;case"gradient":v(w.current.gradient),saveToHistory("color",u),saveToHistory("image",a);break;case"color":p(w.current.color),saveToHistory("image",a),saveToHistory("gradient",g)}return b().onChange(r,o)};return{getTabProps:k,getTabPanelProps:E,getTabsProps:()=>({...b(),onChange:onTabChange})}})({image:getInitialBackgroundOverlay().value,color:Rl.value,gradient:ol.value}),{rowRef:a}=useRepeaterContext();return Ks.createElement(Js.Box,{sx:{width:"100%"}},Ks.createElement(Js.Box,{sx:{borderBottom:1,borderColor:"divider"}},Ks.createElement(Js.Tabs,{size:"small",variant:"fullWidth",...r(),"aria-label":(0,Xs.__)("Background Overlay","elementor")},Ks.createElement(Js.Tab,{label:(0,Xs.__)("Image","elementor"),...o("image")}),Ks.createElement(Js.Tab,{label:(0,Xs.__)("Gradient","elementor"),...o("gradient")}),Ks.createElement(Js.Tab,{label:(0,Xs.__)("Color","elementor"),...o("color")}))),Ks.createElement(Js.TabPanel,{sx:{p:1.5},...i("image")},Ks.createElement(PopoverContent,null,Ks.createElement(ImageOverlayContent,null))),Ks.createElement(Js.TabPanel,{sx:{p:1.5},...i("gradient")},Ks.createElement(rl,null)),Ks.createElement(Js.TabPanel,{sx:{p:1.5},...i("color")},Ks.createElement(PopoverContent,null,Ks.createElement(ColorOverlayContent,{anchorEl:a}))))},ItemIcon2=({value:r})=>{switch(r.$$type){case"background-image-overlay":return Ks.createElement(ItemIconImage,{value:r});case"background-color-overlay":return Ks.createElement(ItemIconColor,{value:r});case"background-gradient-overlay":return Ks.createElement(ItemIconGradient,{value:r});default:return null}},extractColorFrom=r=>r?.value?.color?.value?r.value.color.value:"",ItemIconColor=({value:r})=>{const o=extractColorFrom(r);return Ks.createElement(Ll,{size:"inherit",component:"span",value:o})},ItemIconImage=({value:r})=>{const{imageUrl:o}=useImage(r);return Ks.createElement(Js.CardMedia,{image:o,sx:r=>({height:"1rem",width:"1rem",borderRadius:r.shape.borderRadius/2+"px",outline:`1px solid ${r.palette.action.disabled}`})})},ItemIconGradient=({value:r})=>{const o=getGradientValue(r);return Ks.createElement(Ll,{size:"inherit",component:"span",value:o})},ItemLabel3=({value:r})=>{switch(r.$$type){case"background-image-overlay":return Ks.createElement(ItemLabelImage,{value:r});case"background-color-overlay":return Ks.createElement(ItemLabelColor,{value:r});case"background-gradient-overlay":return Ks.createElement(ItemLabelGradient,{value:r});default:return null}},ItemLabelColor=({value:r})=>{const o=extractColorFrom(r);return Ks.createElement("span",null,o)},ItemLabelImage=({value:r})=>{const{imageTitle:o}=useImage(r);return Ks.createElement("span",null,o)},ItemLabelGradient=({value:r})=>"linear"===r.value.type.value?Ks.createElement("span",null,(0,Xs.__)("Linear Gradient","elementor")):Ks.createElement("span",null,(0,Xs.__)("Radial Gradient","elementor")),ColorOverlayContent=({anchorEl:r})=>{const o=useBoundProp(Gs.backgroundColorOverlayPropTypeUtil);return Ks.createElement(PropProvider,{...o},Ks.createElement(PropKeyProvider,{bind:"color"},Ks.createElement(Ft,{anchorEl:r})))},ImageOverlayContent=()=>{const r=useBoundProp(Gs.backgroundImageOverlayPropTypeUtil);return Ks.createElement(PropProvider,{...r},Ks.createElement(PropKeyProvider,{bind:"image"},Ks.createElement(Oe,{sizes:Il})),Ks.createElement(PropKeyProvider,{bind:"position"},Ks.createElement(BackgroundImageOverlayPosition,null)),Ks.createElement(PropKeyProvider,{bind:"repeat"},Ks.createElement(BackgroundImageOverlayRepeat,null)),Ks.createElement(PropKeyProvider,{bind:"size"},Ks.createElement(BackgroundImageOverlaySize,null)),Ks.createElement(PropKeyProvider,{bind:"attachment"},Ks.createElement(BackgroundImageOverlayAttachment,null)))},Ll=(0,Js.styled)(Js.UnstableColorIndicator)(({theme:r})=>({height:"1rem",width:"1rem",borderRadius:r.shape.borderRadius/2+"px"})),useImage=r=>{let o,i=null;const a=r?.value.image.value?.src.value,{data:c}=(0,Ys.useWpMediaAttachment)(a.id?.value||null);if(a.id){const r=getFileExtensionFromFilename(c?.filename);o=`${c?.title}${r}`||null,i=c?.url||null}else a.url&&(i=a.url.value,o=i?.substring(i.lastIndexOf("/")+1)||null);return{imageTitle:o,imageUrl:i}},getFileExtensionFromFilename=r=>{if(!r)return"";return`.${r.substring(r.lastIndexOf(".")+1)}`},getGradientValue=r=>{const o=r.value,i=o.stops.value?.map(({value:{color:r,offset:o}})=>`${r.value} ${o.value??0}%`)?.join(",");return"linear"===o.type.value?`linear-gradient(${o.angle.value}deg, ${i})`:`radial-gradient(circle at ${o.positions.value}, ${i})`},Fl=[{label:(0,qs.__)("Full element","elementor"),value:"border-box"},{label:(0,qs.__)("Padding edges","elementor"),value:"padding-box"},{label:(0,qs.__)("Content edges","elementor"),value:"content-box"},{label:(0,qs.__)("Text","elementor"),value:"text"}],zl=(0,qs.__)("Color","elementor"),jl=(0,qs.__)("Clipping","elementor"),Bl=createControl(()=>{const r=useBoundProp(Hs.backgroundPropTypeUtil);return Us.createElement(PropProvider,{...r},Us.createElement(PropKeyProvider,{bind:"background-overlay"},Us.createElement(Dl,null)),Us.createElement(BackgroundColorField,null),Us.createElement(BackgroundClipField,null))}),BackgroundColorField=()=>Us.createElement(PropKeyProvider,{bind:"color"},Us.createElement(Ws.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},Us.createElement(Ws.Grid,{item:!0,xs:6},Us.createElement(ControlLabel,null,zl)),Us.createElement(Ws.Grid,{item:!0,xs:6},Us.createElement(Ft,null)))),BackgroundClipField=()=>Us.createElement(PropKeyProvider,{bind:"clip"},Us.createElement(Ws.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},Us.createElement(Ws.Grid,{item:!0,xs:6},Us.createElement(ControlLabel,null,jl)),Us.createElement(Ws.Grid,{item:!0,xs:6},Us.createElement(_e,{options:Fl})))),Vl=__toESM(i(97557)),$l=i(97557),Ul=i(2020),Hl=i(79513),Wl=/\$\{([^}]+)\}/g,ql=createControl(({repeaterLabel:r,childControlConfig:o,showDuplicate:i,showToggle:a,initialValues:c,patternLabel:u,placeholder:p,propKey:g,isSortable:v,addItemTooltipProps:b})=>{const{propTypeUtil:k,isItemDisabled:E}=o;if(!k)return null;const w=(0,$l.useMemo)(()=>(0,Ul.createArrayPropUtils)(k.key,k.schema,g),[k.key,k.schema,g]),x=(0,$l.useMemo)(()=>({...o,placeholder:p||"",patternLabel:u||""}),[o,p,u]),{propType:C,value:_,setValue:T}=useBoundProp(w),P=null===b?.newItemIndex?void 0:0;return Vl.createElement(PropProvider,{propType:C,value:_,setValue:T},Vl.createElement(kn.Provider,{value:x},Vl.createElement(ControlRepeater,{initial:k.create(c||null),propTypeUtil:w,isItemDisabled:E},Vl.createElement(lr,{label:r},Vl.createElement(TooltipAddItemAction,{...b,newItemIndex:P,ariaLabel:r})),Vl.createElement(ItemsContainer,{isSortable:v},Vl.createElement(Item,{Icon:ItemIcon3,Label:ItemLabel4,actions:Vl.createElement(Vl.Fragment,null,i&&Vl.createElement(DuplicateItemAction,null),a&&Vl.createElement(DisableItemAction,null),Vl.createElement(RemoveItemAction,null))})),Vl.createElement(EditItemPopover,null,Vl.createElement(Content2,null)))))}),ItemIcon3=()=>Vl.createElement(Vl.Fragment,null),Content2=()=>{const{component:r,props:o={}}=useRepeatableControlContext();return Vl.createElement(PopoverContent,{p:1.5},Vl.createElement(or,null,Vl.createElement(r,{...o})))},getNestedValue=(r,o)=>{let i={};const a=o.split("."),c=a.slice(-1)[0];let u=a.reduce((r,o,c)=>(c===a.length-2&&(i=r),r&&"object"==typeof r?r[o]:{}),r);u=u||"";const p=i?.$$type,g=i?.value;return"unit"===c&&"size"===p&&"custom"===g?.unit?g?.size?"":Ct:u},isEmptyValue=r=>"string"==typeof r?""===r.trim():!!Number.isNaN(r)||(Array.isArray(r)?0===r.length:"object"==typeof r&&null!==r&&0===Object.keys(r).length),ItemLabel4=({value:r})=>{const{placeholder:o,patternLabel:i,props:a}=useRepeatableControlContext(),c=((r,o)=>{const i=getAllProperties(r).map(r=>getNestedValue(o,r));return!(0===i.length||!i.some(r=>null==r)&&!i.every(isEmptyValue))})(i,r),u=c?o:(p=i,(g=r)?p.replace(Wl,(r,o)=>{const i=getNestedValue(g,o);return"object"!=typeof i||null===i||Array.isArray(i)?Array.isArray(i)?i.join(", "):String(i??""):"name"in i&&i.name?i.name:JSON.stringify(i)}):p);var p,g;const v=((r,o)=>r?"text.disabled":o?"text.tertiary":"text.primary")(!!a?.readOnly,c);return Vl.createElement(Hl.Box,{component:"span",color:v},u)},getAllProperties=r=>r.match(Wl)?.map(r=>r.slice(2,-1))||[],Kl=__toESM(i(97557)),Gl=i(97557),Jl=i(2020),Yl=i(79513),Xl=i(27723),escapeHtmlAttr=r=>{const o={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"};return r.replace(/[&<>'"]/g,r=>o[r]||r)},getInitialFieldValue=r=>{const o=r;return r&&"object"==typeof r&&"dynamic"!==o.$$type&&o.value||""},Ql=createControl((r={})=>{const{value:o,setValue:i,...a}=useBoundProp(Jl.keyValuePropTypeUtil),[c,u]=(0,Gl.useState)(""),[p,g]=(0,Gl.useState)(""),[v,b]=(0,Gl.useState)({key:getInitialFieldValue(o?.key),value:getInitialFieldValue(o?.value)}),k=r.keyName||(0,Xl.__)("Key","elementor"),E=r.valueName||(0,Xl.__)("Value","elementor"),{keyHelper:w,valueHelper:x}=r.getHelperText?.(v.key,v.value)||{keyHelper:void 0,valueHelper:void 0},[C,_,T]=(0,Gl.useMemo)(()=>[r.regexKey?new RegExp(r.regexKey):void 0,r.regexValue?new RegExp(r.regexValue):void 0,r.validationErrorMessage||(0,Xl.__)("Invalid Format","elementor")],[r.regexKey,r.regexValue,r.validationErrorMessage]);return Kl.createElement(PropProvider,{...a,value:o,setValue:(r,a,c)=>{const p=c?.bind;if(!p)return;const v=r[p];if((0,Jl.isTransformable)(v)&&"dynamic"===v.$$type)return void i({...o,[p]:v});const k=Jl.stringPropTypeUtil.extract(v);b(r=>({...r,[p]:k})),k&&((r,o)=>{if("key"===o&&C){const o=C.test(r);return u(o?"":T),o}if("value"===o&&_){const o=_.test(r);return g(o?"":T),o}return!0})(k,p)?i({...o,[p]:v}):i({...o,[p]:{value:"",$$type:"string"}})}},Kl.createElement(Yl.Grid,{container:!0,gap:1.5},Kl.createElement(Yl.Grid,{item:!0,xs:12,display:"flex",flexDirection:"column"},Kl.createElement(Yl.FormLabel,{size:"tiny",sx:{pb:1}},k),Kl.createElement(PropKeyProvider,{bind:"key"},Kl.createElement(Ne,{inputValue:r.escapeHtml?escapeHtmlAttr(v.key):v.key,error:!!c,helperText:w})),!!c&&Kl.createElement(Yl.FormHelperText,{error:!0},c)),Kl.createElement(Yl.Grid,{item:!0,xs:12,display:"flex",flexDirection:"column"},Kl.createElement(Yl.FormLabel,{size:"tiny",sx:{pb:1}},E),Kl.createElement(PropKeyProvider,{bind:"value"},Kl.createElement(Ne,{inputValue:r.escapeHtml?escapeHtmlAttr(v.value):v.value,error:!!p,inputDisabled:!!c,helperText:x})),!!p&&Kl.createElement(Yl.FormHelperText,{error:!0},p))))}),Zl=__toESM(i(97557)),ec=i(2020),tc=i(70374),nc=i(24413),rc=i(79513),oc=i(27723),ic=[{label:(0,oc.__)("Center center","elementor"),value:"center center"},{label:(0,oc.__)("Center left","elementor"),value:"center left"},{label:(0,oc.__)("Center right","elementor"),value:"center right"},{label:(0,oc.__)("Top center","elementor"),value:"top center"},{label:(0,oc.__)("Top left","elementor"),value:"top left"},{label:(0,oc.__)("Top right","elementor"),value:"top right"},{label:(0,oc.__)("Bottom center","elementor"),value:"bottom center"},{label:(0,oc.__)("Bottom left","elementor"),value:"bottom left"},{label:(0,oc.__)("Bottom right","elementor"),value:"bottom right"},{label:(0,oc.__)("Custom","elementor"),value:"custom"}],PositionControl=()=>{const r=useBoundProp(ec.positionPropTypeUtil),o=useBoundProp(ec.stringPropTypeUtil),i=!!r.value,a=r.placeholder?"custom":o.placeholder??null;return Zl.createElement(rc.Grid,{container:!0,spacing:1.5},Zl.createElement(rc.Grid,{item:!0,xs:12},Zl.createElement(rc.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},Zl.createElement(rc.Grid,{item:!0,xs:6},Zl.createElement(ControlFormLabel,null,(0,oc.__)("Object position","elementor"))),Zl.createElement(rc.Grid,{item:!0,xs:6,sx:{overflow:"hidden"}},Zl.createElement(rc.Select,{size:"tiny",displayEmpty:!0,disabled:o.disabled,value:(r.value?"custom":o.value)??"",onChange:i=>{const a=i.target.value||null;"custom"===a?r.setValue({x:null,y:null}):o.setValue(a)},renderValue:r=>getSelectRenderValue(ic,a,r),fullWidth:!0},ic.map(({label:r,value:o})=>Zl.createElement(tc.MenuListItem,{key:o,value:o??""},r)))))),i&&Zl.createElement(PropProvider,{...r},Zl.createElement(rc.Grid,{item:!0,xs:12},Zl.createElement(rc.Grid,{container:!0,spacing:1.5},Zl.createElement(rc.Grid,{item:!0,xs:6},Zl.createElement(PropKeyProvider,{bind:"x"},Zl.createElement(_t,{startIcon:Zl.createElement(nc.LetterXIcon,{fontSize:"tiny"}),min:-Number.MAX_SAFE_INTEGER}))),Zl.createElement(rc.Grid,{item:!0,xs:6},Zl.createElement(PropKeyProvider,{bind:"y"},Zl.createElement(_t,{startIcon:Zl.createElement(nc.LetterYIcon,{fontSize:"tiny"}),min:-Number.MAX_SAFE_INTEGER})))))))},ac=__toESM(i(97557)),sc=i(97557),lc=i(2020),cc=i(24413),uc=i(79513),pc=i(27723),dc=i(2020),fc="transform-move",hc="transform-scale",mc="transform-rotate",gc="transform-skew",vc={move:{size:0,unit:"px"},scale:1,rotate:{size:0,unit:"deg"},skew:{size:0,unit:"deg"}},yc={$$type:fc,value:{x:{$$type:"size",value:{size:vc.move.size,unit:vc.move.unit}},y:{$$type:"size",value:{size:vc.move.size,unit:vc.move.unit}},z:{$$type:"size",value:{size:vc.move.size,unit:vc.move.unit}}}},bc=dc.scaleTransformPropTypeUtil.create({x:dc.numberPropTypeUtil.create(vc.scale),y:dc.numberPropTypeUtil.create(vc.scale),z:dc.numberPropTypeUtil.create(vc.scale)}),kc=dc.rotateTransformPropTypeUtil.create({x:{$$type:"size",value:{size:vc.rotate.size,unit:vc.rotate.unit}},y:{$$type:"size",value:{size:vc.rotate.size,unit:vc.rotate.unit}},z:{$$type:"size",value:{size:vc.rotate.size,unit:vc.rotate.unit}}}),Ec=dc.skewTransformPropTypeUtil.create({x:{$$type:"size",value:{size:vc.skew.size,unit:vc.skew.unit}},y:{$$type:"size",value:{size:vc.skew.size,unit:vc.skew.unit}}}),Sc=__toESM(i(97557)),wc=i(79513),xc=i(27723),Cc=__toESM(i(97557)),_c=i(97557),Tc=i(2020),Oc=i(24413),Pc=i(79513),Ac=i(27723),Mc=__toESM(i(97557)),Nc=i(79513),AxisRow=({label:r,bind:o,startIcon:i,anchorRef:a,units:c,variant:u="angle"})=>{const p=r.replace(/\s+/g,"-").toLowerCase();return Mc.createElement(Nc.Grid,{item:!0,xs:12},Mc.createElement(or,{ref:a},Mc.createElement(Nc.Grid,{item:!0,xs:6},Mc.createElement(ControlLabel,{htmlFor:p},r)),Mc.createElement(Nc.Grid,{item:!0,xs:6},Mc.createElement(PropKeyProvider,{bind:o},Mc.createElement(_t,{anchorRef:a,startIcon:i,units:c,variant:u,min:-Number.MAX_SAFE_INTEGER,id:p})))))},Rc=[{label:(0,Ac.__)("Move X","elementor"),bind:"x",startIcon:Cc.createElement(Oc.ArrowRightIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vw"]},{label:(0,Ac.__)("Move Y","elementor"),bind:"y",startIcon:Cc.createElement(Oc.ArrowDownSmallIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vh"]},{label:(0,Ac.__)("Move Z","elementor"),bind:"z",startIcon:Cc.createElement(Oc.ArrowDownLeftIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vw","vh"]}],Move=()=>{const r=useBoundProp(Tc.moveTransformPropTypeUtil),o=[(0,_c.useRef)(null),(0,_c.useRef)(null),(0,_c.useRef)(null)];return Cc.createElement(Pc.Grid,{container:!0,spacing:1.5},Cc.createElement(PropProvider,{...r},Cc.createElement(PropKeyProvider,{bind:fc},Rc.map((r,i)=>Cc.createElement(AxisRow,{key:r.bind,...r,anchorRef:o[i],units:r.units,variant:"length"})))))},Ic=__toESM(i(97557)),Dc=i(97557),Lc=i(2020),Fc=i(24413),zc=i(79513),jc=i(27723),Bc=[{label:(0,jc.__)("Rotate X","elementor"),bind:"x",startIcon:Ic.createElement(Fc.Arrow360Icon,{fontSize:"tiny"})},{label:(0,jc.__)("Rotate Y","elementor"),bind:"y",startIcon:Ic.createElement(Fc.Arrow360Icon,{fontSize:"tiny",style:{transform:"scaleX(-1) rotate(-90deg)"}})},{label:(0,jc.__)("Rotate Z","elementor"),bind:"z",startIcon:Ic.createElement(Fc.RotateClockwiseIcon,{fontSize:"tiny"})}],Vc=["deg","rad","grad","turn"],Rotate=()=>{const r=useBoundProp(Lc.rotateTransformPropTypeUtil),o=[(0,Dc.useRef)(null),(0,Dc.useRef)(null),(0,Dc.useRef)(null)];return Ic.createElement(zc.Grid,{container:!0,spacing:1.5},Ic.createElement(PropProvider,{...r},Ic.createElement(PropKeyProvider,{bind:mc},Bc.map((r,i)=>Ic.createElement(AxisRow,{key:r.bind,...r,anchorRef:o[i],units:Vc})))))},$c=__toESM(i(97557)),Uc=i(97557),Hc=i(2020),Wc=i(24413),qc=i(79513),Kc=i(27723),Gc=__toESM(i(97557)),Jc=i(79513),ScaleAxisRow=({label:r,bind:o,startIcon:i,anchorRef:a})=>Gc.createElement(Jc.Grid,{item:!0,xs:12},Gc.createElement(or,{ref:a},Gc.createElement(Jc.Grid,{item:!0,xs:6},Gc.createElement(ControlLabel,null,r)),Gc.createElement(Jc.Grid,{item:!0,xs:6},Gc.createElement(PropKeyProvider,{bind:o},Gc.createElement(xo,{step:.1,placeholder:"1",startIcon:i}))))),Yc=[{label:(0,Kc.__)("Scale X","elementor"),bind:"x",startIcon:$c.createElement(Wc.ArrowRightIcon,{fontSize:"tiny"})},{label:(0,Kc.__)("Scale Y","elementor"),bind:"y",startIcon:$c.createElement(Wc.ArrowDownSmallIcon,{fontSize:"tiny"})},{label:(0,Kc.__)("Scale Z","elementor"),bind:"z",startIcon:$c.createElement(Wc.ArrowDownLeftIcon,{fontSize:"tiny"})}],Scale=()=>{const r=useBoundProp(Hc.scaleTransformPropTypeUtil),o=[(0,Uc.useRef)(null),(0,Uc.useRef)(null),(0,Uc.useRef)(null)];return $c.createElement(qc.Grid,{container:!0,spacing:1.5},$c.createElement(PropProvider,{...r},$c.createElement(PropKeyProvider,{bind:hc},Yc.map((r,i)=>$c.createElement(ScaleAxisRow,{key:r.bind,...r,anchorRef:o[i]})))))},Xc=__toESM(i(97557)),Qc=i(97557),Zc=i(2020),eu=i(24413),tu=i(79513),nu=i(27723),ru=[{label:(0,nu.__)("Skew X","elementor"),bind:"x",startIcon:Xc.createElement(eu.ArrowRightIcon,{fontSize:"tiny"})},{label:(0,nu.__)("Skew Y","elementor"),bind:"y",startIcon:Xc.createElement(eu.ArrowLeftIcon,{fontSize:"tiny",style:{transform:"scaleX(-1) rotate(-90deg)"}})}],ou=["deg","rad","grad","turn"],Skew=()=>{const r=useBoundProp(Zc.skewTransformPropTypeUtil),o=[(0,Qc.useRef)(null),(0,Qc.useRef)(null),(0,Qc.useRef)(null)];return Xc.createElement(tu.Grid,{container:!0,spacing:1.5},Xc.createElement(PropProvider,{...r},Xc.createElement(PropKeyProvider,{bind:gc},ru.map((r,i)=>Xc.createElement(AxisRow,{key:r.bind,...r,anchorRef:o[i],units:ou})))))},iu=i(97557),au=i(2020),su=i(79513),TransformContent=()=>{const{getTabsProps:r,getTabProps:o,getTabPanelProps:i}=(({move:r,scale:o,rotate:i,skew:a})=>{const{value:c,setValue:u}=useBoundProp(au.moveTransformPropTypeUtil),{value:p,setValue:g}=useBoundProp(au.scaleTransformPropTypeUtil),{value:v,setValue:b}=useBoundProp(au.rotateTransformPropTypeUtil),{value:k,setValue:E}=useBoundProp(au.skewTransformPropTypeUtil),{openItemIndex:w,items:x}=useRepeaterContext(),{getTabsProps:C,getTabProps:_,getTabPanelProps:T}=(0,su.useTabs)((()=>{switch(!0){case!!p:return hc;case!!v:return mc;case!!k:return gc;default:return fc}})()),P=(0,iu.useRef)({move:r,scale:o,rotate:i,skew:a}),saveToHistory=(r,o)=>{o&&(P.current[r]=o)},onTabChange=(r,o)=>{switch(o){case fc:u(P.current.move),saveToHistory("scale",p),saveToHistory("rotate",v),saveToHistory("skew",k);break;case hc:g(P.current.scale),saveToHistory("move",c),saveToHistory("rotate",v),saveToHistory("skew",k);break;case mc:b(P.current.rotate),saveToHistory("move",c),saveToHistory("scale",p),saveToHistory("skew",k);break;case gc:E(P.current.skew),saveToHistory("move",c),saveToHistory("scale",p),saveToHistory("rotate",v)}return C().onChange(r,o)};return{getTabProps:r=>{return{..._(r),disabled:(o=r,!!x.find(({item:{$$type:r}},i)=>o===r&&i!==w))};var o},getTabPanelProps:T,getTabsProps:()=>({...C(),onChange:onTabChange})}})({move:yc.value,scale:bc.value,rotate:kc.value,skew:Ec.value});return Sc.createElement(PopoverContent,null,Sc.createElement(wc.Box,{sx:{width:"100%"}},Sc.createElement(wc.Box,{sx:{borderBottom:1,borderColor:"divider"}},Sc.createElement(wc.Tabs,{size:"small",variant:"fullWidth",sx:{"& .MuiTab-root":{minWidth:"62px"}},...r(),"aria-label":(0,xc.__)("Transform","elementor")},Sc.createElement(wc.Tab,{label:(0,xc.__)("Move","elementor"),...o(fc)}),Sc.createElement(wc.Tab,{label:(0,xc.__)("Scale","elementor"),...o(hc)}),Sc.createElement(wc.Tab,{label:(0,xc.__)("Rotate","elementor"),...o(mc)}),Sc.createElement(wc.Tab,{label:(0,xc.__)("Skew","elementor"),...o(gc)}))),Sc.createElement(wc.TabPanel,{sx:{p:1.5},...i(fc)},Sc.createElement(Move,null)),Sc.createElement(wc.TabPanel,{sx:{p:1.5},...i(hc)},Sc.createElement(Scale,null)),Sc.createElement(wc.TabPanel,{sx:{p:1.5},...i(mc)},Sc.createElement(Rotate,null)),Sc.createElement(wc.TabPanel,{sx:{p:1.5},...i(gc)},Sc.createElement(Skew,null))))},lu=__toESM(i(97557)),cu=i(24413),TransformIcon=({value:r})=>{switch(r.$$type){case fc:return lu.createElement(cu.ArrowsMaximizeIcon,{fontSize:"tiny"});case hc:return lu.createElement(cu.ArrowAutofitHeightIcon,{fontSize:"tiny"});case mc:return lu.createElement(cu.RotateClockwise2Icon,{fontSize:"tiny"});case gc:return lu.createElement(cu.SkewXIcon,{fontSize:"tiny"});default:return null}},uu=__toESM(i(97557)),pu=i(79513),du=i(27723),fu=["x","y","z"],formatLabel=(r,o)=>fu.map(i=>{const a=r[i];if("scale"===o)return a?.value||vc[o];const c=vc[o],u=a?.value?.size??c.size,p=a?.value?.unit??c.unit;return"custom"===p?u||Ct:`${u}${p}`}).join(", "),TransformLabel=r=>{const{$$type:o,value:i}=r.value;switch(o){case fc:return uu.createElement(Label2,{label:(0,du.__)("Move","elementor"),value:formatLabel(i,"move")});case hc:return uu.createElement(Label2,{label:(0,du.__)("Scale","elementor"),value:formatLabel(i,"scale")});case mc:return uu.createElement(Label2,{label:(0,du.__)("Rotate","elementor"),value:formatLabel(i,"rotate")});case gc:return uu.createElement(Label2,{label:(0,du.__)("Skew","elementor"),value:formatLabel(i,"skew")});default:return""}},Label2=({label:r,value:o})=>uu.createElement(pu.Box,{component:"span"},r,": ",o),hu=__toESM(i(97557)),mu=i(70374),gu=i(24413),vu=i(79513),yu=i(27723),bu=__toESM(i(97557)),ku=i(97557),Eu=i(2020),Su=i(79513),wu=i(27723),xu=["px","%","em","rem"],Cu={label:(0,wu.__)("Perspective","elementor"),bind:"perspective",units:["px","em","rem","vw","vh"]},_u=[{label:(0,wu.__)("Origin X","elementor"),bind:"x",units:xu},{label:(0,wu.__)("Origin Y","elementor"),bind:"y",units:xu}],ChildrenPerspectiveControl=()=>bu.createElement(Su.Stack,{direction:"column",spacing:1.5},bu.createElement(ControlFormLabel,null,(0,wu.__)("Children perspective","elementor")),bu.createElement(PerspectiveControl,null),bu.createElement(PerspectiveOriginControl,null)),PerspectiveControl=()=>bu.createElement(PropKeyProvider,{bind:"perspective"},bu.createElement(ControlFields,{control:Cu,key:Cu.bind})),PerspectiveOriginControl=()=>bu.createElement(PropKeyProvider,{bind:"perspective-origin"},bu.createElement(PerspectiveOriginControlProvider,null)),PerspectiveOriginControlProvider=()=>{const r=useBoundProp(Eu.perspectiveOriginPropTypeUtil);return bu.createElement(PropProvider,{...r},_u.map(r=>bu.createElement(PropKeyProvider,{bind:r.bind,key:r.bind},bu.createElement(ControlFields,{control:r}))))},ControlFields=({control:r})=>{const o=(0,ku.useRef)(null);return bu.createElement(or,{ref:o},bu.createElement(Su.Grid,{item:!0,xs:6},bu.createElement(ControlFormLabel,null,r.label)),bu.createElement(Su.Grid,{item:!0,xs:6},bu.createElement(_t,{variant:"length",units:r.units,anchorRef:o,disableCustom:!0})))},Tu=__toESM(i(97557)),Ou=i(97557),Pu=i(2020),Au=i(79513),Mu=i(27723),Nu=["px","%","em","rem"],Ru=Nu.filter(r=>"%"!==r),Iu=[{label:(0,Mu.__)("Origin X","elementor"),bind:"x",units:Nu},{label:(0,Mu.__)("Origin Y","elementor"),bind:"y",units:Nu},{label:(0,Mu.__)("Origin Z","elementor"),bind:"z",units:Ru}],TransformOriginControl=()=>Tu.createElement(Au.Stack,{direction:"column",spacing:1.5},Tu.createElement(ControlFormLabel,null,(0,Mu.__)("Transform","elementor")),Iu.map(r=>Tu.createElement(ControlFields2,{control:r,key:r.bind}))),ControlFields2=({control:r})=>{const o=useBoundProp(Pu.transformOriginPropTypeUtil),i=(0,Ou.useRef)(null);return Tu.createElement(PropProvider,{...o},Tu.createElement(PropKeyProvider,{bind:r.bind},Tu.createElement(or,{ref:i},Tu.createElement(Au.Grid,{item:!0,xs:6},Tu.createElement(ControlFormLabel,null,r.label)),Tu.createElement(Au.Grid,{item:!0,xs:6},Tu.createElement(_t,{variant:"length",units:r.units,anchorRef:i})))))},TransformSettingsControl=({popupState:r,anchorRef:o,showChildrenPerspective:i})=>{const a=(0,vu.bindPopover)({...r,anchorEl:o.current??void 0});return hu.createElement(vu.Popover,{disablePortal:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{width:(o.current?.offsetWidth||0)-6+"px",mt:.5}}},...a},hu.createElement(mu.PopoverHeader,{title:(0,yu.__)("Transform settings","elementor"),onClose:r.close,icon:hu.createElement(gu.AdjustmentsIcon,{fontSize:"tiny"})}),hu.createElement(vu.Divider,null),hu.createElement(PopoverContent,{sx:{px:2,py:1.5}},hu.createElement(PropKeyProvider,{bind:"transform-origin"},hu.createElement(TransformOriginControl,null)),i&&hu.createElement(hu.Fragment,null,hu.createElement(vu.Box,{sx:{my:.5}},hu.createElement(vu.Divider,null)),hu.createElement(ChildrenPerspectiveControl,null))))},Du="tiny",Lu=createControl(({showChildrenPerspective:r})=>{const o=useBoundProp(lc.transformPropTypeUtil),i=(0,sc.useRef)(null),a=(0,uc.usePopupState)({variant:"popover"});return ac.createElement(PropProvider,{...o},ac.createElement(TransformSettingsControl,{popupState:a,anchorRef:i,showChildrenPerspective:r}),ac.createElement(PropKeyProvider,{bind:"transform-functions"},ac.createElement(Repeater2,{headerRef:i,propType:o.propType,popupState:a})))}),Fu=ac.createElement(uc.Box,{component:"span","aria-label":void 0,sx:{display:"flex",gap:.5,p:2,width:320,borderRadius:1}},ac.createElement(cc.InfoCircleFilledIcon,{sx:{color:"secondary.main"}}),ac.createElement(uc.Typography,{variant:"body2",color:"text.secondary",fontSize:"14px"},(0,pc.__)("You can use each kind of transform only once per element.","elementor"))),Repeater2=({headerRef:r,propType:o,popupState:i})=>{const a=useBoundProp(lc.transformFunctionsPropTypeUtil),c=[yc,bc,kc,Ec],{value:u,bind:p}=a,getInitialValue2=()=>c.find(r=>!u?.some(o=>o.$$type===r.$$type)),g=!getInitialValue2();return ac.createElement(PropProvider,{...a},ac.createElement(ControlRepeater,{initial:getInitialValue2()??yc,propTypeUtil:lc.transformFunctionsPropTypeUtil},ac.createElement(lr,{label:(0,pc.__)("Transform","elementor"),adornment:()=>ac.createElement(ControlAdornments,{customContext:{path:["transform"],propType:o}}),ref:r},ac.createElement(TransformBasePopoverTrigger,{popupState:i,repeaterBindKey:p}),ac.createElement(TooltipAddItemAction,{disabled:g,tooltipContent:Fu,enableTooltip:g,ariaLabel:"transform"})),ac.createElement(ItemsContainer,null,ac.createElement(Item,{Icon:TransformIcon,Label:TransformLabel,actions:ac.createElement(ac.Fragment,null,ac.createElement(DisableItemAction,null),ac.createElement(RemoveItemAction,null))})),ac.createElement(EditItemPopover,null,ac.createElement(TransformContent,null))))},TransformBasePopoverTrigger=({popupState:r,repeaterBindKey:o})=>{const{bind:i}=useBoundProp(),a=(0,pc.__)("Transform settings","elementor");return i!==o?null:ac.createElement(uc.Tooltip,{title:a,placement:"top"},ac.createElement(uc.IconButton,{size:Du,"aria-label":a,...(0,uc.bindTrigger)(r)},ac.createElement(cc.AdjustmentsIcon,{fontSize:Du})))},zu=__toESM(i(97557)),ju=i(97557),Bu=i(2020),Vu=i(24413),$u=i(79513),Uu=i(22444),Hu=i(27723),Wu=__toESM(i(97557)),qu=i(97557),Ku=i(2020),Gu=i(79513),Ju=createControl(({selectionLabel:r,sizeLabel:o,selectionConfig:i,sizeConfigMap:a})=>{const{value:c,setValue:u,propType:p}=useBoundProp(Ku.selectionSizePropTypeUtil),g=(0,qu.useRef)(null),v=o.replace(/\s+/g,"-").toLowerCase(),b=(0,qu.useMemo)(()=>{switch(c.selection.$$type){case"key-value":return a[c?.selection?.value.value.value||""];case"string":return a[c?.selection?.value||""];default:return null}},[c,a]),k=i.component;return Wu.createElement(PropProvider,{value:c,setValue:u,propType:p},Wu.createElement(Gu.Grid,{container:!0,spacing:1.5,ref:g},Wu.createElement(Gu.Grid,{item:!0,xs:6,sx:{display:"flex",alignItems:"center"}},Wu.createElement(ControlFormLabel,null,r)),Wu.createElement(Gu.Grid,{item:!0,xs:6},Wu.createElement(PropKeyProvider,{bind:"selection"},Wu.createElement(k,{...i.props}))),b&&Wu.createElement(Wu.Fragment,null,Wu.createElement(Gu.Grid,{item:!0,xs:6,sx:{display:"flex",alignItems:"center"}},Wu.createElement(ControlFormLabel,{htmlFor:v},o)),Wu.createElement(Gu.Grid,{item:!0,xs:6},Wu.createElement(PropKeyProvider,{bind:"size"},Wu.createElement(_t,{anchorRef:g,variant:b.variant,units:b.units,defaultUnit:b.defaultUnit,id:v}))))))}),Yu=i(22444),Xu=i(27723),Qu={selection:{$$type:"key-value",value:{key:{value:(0,Xu.__)("All properties","elementor"),$$type:"string"},value:{value:"all",$$type:"string"}}},size:{$$type:"size",value:{size:200,unit:"ms"}}},Zu=(()=>{const r=!!window.elementorFrontend?.config?.is_rtl,o=[{label:(0,Xu.__)("Default","elementor"),type:"category",properties:[{label:(0,Xu.__)("All properties","elementor"),value:"all"}]},{label:(0,Xu.__)("Margin","elementor"),type:"category",properties:[{label:(0,Xu.__)("Margin (all)","elementor"),value:"margin",isDisabled:!0},{label:(0,Xu.__)("Margin bottom","elementor"),value:"margin-block-end",isDisabled:!0},{label:r?(0,Xu.__)("Margin right","elementor"):(0,Xu.__)("Margin left","elementor"),value:"margin-inline-start",isDisabled:!0},{label:r?(0,Xu.__)("Margin left","elementor"):(0,Xu.__)("Margin right","elementor"),value:"margin-inline-end",isDisabled:!0},{label:(0,Xu.__)("Margin top","elementor"),value:"margin-block-start",isDisabled:!0}]},{label:(0,Xu.__)("Padding","elementor"),type:"category",properties:[{label:(0,Xu.__)("Padding (all)","elementor"),value:"padding",isDisabled:!0},{label:(0,Xu.__)("Padding bottom","elementor"),value:"padding-block-end",isDisabled:!0},{label:r?(0,Xu.__)("Padding right","elementor"):(0,Xu.__)("Padding left","elementor"),value:"padding-inline-start",isDisabled:!0},{label:r?(0,Xu.__)("Padding left","elementor"):(0,Xu.__)("Padding right","elementor"),value:"padding-inline-end",isDisabled:!0},{label:(0,Xu.__)("Padding top","elementor"),value:"padding-block-start",isDisabled:!0}]},{label:(0,Xu.__)("Flex","elementor"),type:"category",properties:[{label:(0,Xu.__)("Flex (all)","elementor"),value:"flex",isDisabled:!0},{label:(0,Xu.__)("Flex grow","elementor"),value:"flex-grow",isDisabled:!0},{label:(0,Xu.__)("Flex shrink","elementor"),value:"flex-shrink",isDisabled:!0},{label:(0,Xu.__)("Flex basis","elementor"),value:"flex-basis",isDisabled:!0}]},{label:(0,Xu.__)("Size","elementor"),type:"category",properties:[{label:(0,Xu.__)("Width","elementor"),value:"width",isDisabled:!0},{label:(0,Xu.__)("Height","elementor"),value:"height",isDisabled:!0},{label:(0,Xu.__)("Max height","elementor"),value:"max-height",isDisabled:!0},{label:(0,Xu.__)("Max width","elementor"),value:"max-width",isDisabled:!0},{label:(0,Xu.__)("Min height","elementor"),value:"min-height",isDisabled:!0},{label:(0,Xu.__)("Min width","elementor"),value:"min-width",isDisabled:!0}]},{label:(0,Xu.__)("Position","elementor"),type:"category",properties:[{label:(0,Xu.__)("Top","elementor"),value:"inset-block-start",isDisabled:!0},{label:r?(0,Xu.__)("Right","elementor"):(0,Xu.__)("Left","elementor"),value:"inset-inline-start",isDisabled:!0},{label:r?(0,Xu.__)("Left","elementor"):(0,Xu.__)("Right","elementor"),value:"inset-inline-end",isDisabled:!0},{label:(0,Xu.__)("Bottom","elementor"),value:"inset-block-end",isDisabled:!0},{label:(0,Xu.__)("Z-index","elementor"),value:"z-index",isDisabled:!0}]},{label:(0,Xu.__)("Typography","elementor"),type:"category",properties:[{label:(0,Xu.__)("Font color","elementor"),value:"color",isDisabled:!0},{label:(0,Xu.__)("Font size","elementor"),value:"font-size",isDisabled:!0},{label:(0,Xu.__)("Line height","elementor"),value:"line-height",isDisabled:!0},{label:(0,Xu.__)("Letter spacing","elementor"),value:"letter-spacing",isDisabled:!0},{label:(0,Xu.__)("Word spacing","elementor"),value:"word-spacing",isDisabled:!0},{label:(0,Xu.__)("Font variations","elementor"),value:"font-variation-settings",isDisabled:!0},{label:(0,Xu.__)("Text stroke color","elementor"),value:"-webkit-text-stroke-color",isDisabled:!0}]},{label:(0,Xu.__)("Background","elementor"),type:"category",properties:[{label:(0,Xu.__)("Background color","elementor"),value:"background-color",isDisabled:!0},{label:(0,Xu.__)("Background position","elementor"),value:"background-position",isDisabled:!0},{label:(0,Xu.__)("Box shadow","elementor"),value:"box-shadow",isDisabled:!0}]},{label:(0,Xu.__)("Border","elementor"),type:"category",properties:[{label:(0,Xu.__)("Border (all)","elementor"),value:"border",isDisabled:!0},{label:(0,Xu.__)("Border radius","elementor"),value:"border-radius",isDisabled:!0},{label:(0,Xu.__)("Border color","elementor"),value:"border-color",isDisabled:!0},{label:(0,Xu.__)("Border width","elementor"),value:"border-width",isDisabled:!0}]},{label:(0,Xu.__)("Effects","elementor"),type:"category",properties:[{label:(0,Xu.__)("Opacity","elementor"),value:"opacity",isDisabled:!0},{label:(0,Xu.__)("Transform (all)","elementor"),value:"transform",isDisabled:!0},{label:(0,Xu.__)("Filter (all)","elementor"),value:"filter",isDisabled:!0}]}];return(()=>{if(!(0,Yu.hasProInstalled)())return!0;const r=window.elementorPro?.config?.version;return!!r&&(0,Yu.isVersionGreaterOrEqual)(r,"3.35")})()?o:[o[0]]})(),ep=Zu.map(r=>({label:r.label,items:r.properties.map(r=>r.label)})),tp=i(70975),np=i(33176),rp={eventName:"click_added_transition",location:"V4 Style Tab",secondaryLocation:"Transition control",trigger:"click"};var op=__toESM(i(97557)),ip=i(97557),ap=i(2020),sp=i(70374),lp=i(24413),cp=i(79513),pp=i(27723),dp=i(70975),fp=i(33176),getBaseEventProperties=(r,o)=>({app_type:o?.appTypes?.editor??"editor",window_name:o?.appTypes?.editor??"editor",interaction_type:o?.triggers?.click??"Click",target_name:r.target_name,target_location:r.target_location??"widget_panel",location_l1:r.location_l1??(0,dp.getSelectedElements)()[0]?.type??"",...r.location_l2&&{location_l2:r.location_l2}}),dispatchPromotionEvent=(r,o)=>{const{dispatchEvent:i,config:a}=(0,fp.getMixpanel)(),{eventName:c,interactionResult:u,interactionDescription:p}=o(a);c&&i?.(c,{...getBaseEventProperties(r,a),interaction_result:u,interaction_description:p})},trackViewPromotion=r=>{dispatchPromotionEvent(r,r=>({eventName:r?.names?.promotions?.viewPromotion,interactionResult:r?.interactionResults?.promotionViewed??"promotion_viewed",interactionDescription:"user_viewed_promotion"}))},trackUpgradePromotionClick=r=>{dispatchPromotionEvent(r,r=>({eventName:r?.names?.promotions?.upgradePromotionClick,interactionResult:r?.interactionResults?.upgradeNow??"upgrade_now",interactionDescription:"user_clicked_upgrade_now"}))};function getTransitionPropertyByValue(r){if(!r?.value)return null;for(const o of Zu)for(const i of o.properties)if(i.value===r.value)return i;return null}var includeCurrentValueInOptions=(r,o)=>o.filter(o=>o!==r.key.value),TransitionSelector=({recentlyUsedList:r=[],disabledItems:o=[],showPromotion:i=!1})=>{const{value:a,setValue:c}=useBoundProp(ap.keyValuePropTypeUtil),{key:{value:u}}=a,p=(0,ip.useRef)(null),g=(0,cp.usePopupState)({variant:"popover"}),v=(0,ip.useMemo)(()=>new Set(Zu.filter(r=>r.properties.some(r=>r.isDisabled)).map(r=>r.label)),[]);return op.createElement(cp.Box,{ref:p},op.createElement(ControlActions,null,op.createElement(cp.UnstableTag,{variant:"outlined",label:u,endIcon:op.createElement(lp.ChevronDownIcon,{fontSize:"tiny"}),...(0,cp.bindTrigger)(g),fullWidth:!0})),op.createElement(cp.Popover,{disablePortal:!0,disableScrollLock:!0,...(0,cp.bindPopover)(g),anchorReference:"anchorPosition",anchorPosition:(()=>{if(!p.current)return;const r=p.current.getBoundingClientRect();return{top:r.top,left:r.right+36}})(),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}},op.createElement(ItemSelector,{itemsList:(()=>{const o=r.map(r=>getTransitionPropertyByValue({value:r,$$type:"string"})?.label).filter(r=>!!r),i=ep.map(r=>({...r,items:r.items.filter(r=>!o.includes(r))}));if(0===o.length)return i;const[a,...c]=i;return[a,{label:(0,pp.__)("Recently Used","elementor"),items:o},...c]})(),selectedItem:u,onItemChange:r=>{const o=(r=>{for(const o of Zu){const i=o.properties.find(o=>o.label===r);if(i)return{key:{value:i.label,$$type:"string"},value:{value:i.value,$$type:"string"}}}return null})(r);o&&(c(o),g.close())},onClose:g.close,sectionWidth:268,title:(0,pp.__)("Transition Property","elementor"),icon:lp.VariationsIcon,disabledItems:includeCurrentValueInOptions(a,o),categoryItemContentTemplate:r=>op.createElement(cp.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},op.createElement("span",null,r.value),i&&v.has(r.value)&&op.createElement(sp.PromotionChip,null)),footer:i?op.createElement(sp.PromotionAlert,{message:(0,pp.__)("Upgrade to customize transition properties and control effects.","elementor"),upgradeUrl:"https://go.elementor.com/go-pro-transitions-modal/",onCtaClick:()=>trackUpgradePromotionClick({target_name:"transition_property",location_l2:"style"})}):null})))},hp={variant:"time",units:["s","ms"],defaultUnit:"ms"},mp=(0,Bu.createArrayPropUtils)(Bu.selectionSizePropTypeUtil.key,Bu.selectionSizePropTypeUtil.schema,"transition");!function subscribeToTransitionEvent(){tn.subscribe("transition-item-added",r=>{const o=r,i=o?.itemValue?.selection?.value?.value?.value,a=(0,tp.getSelectedElements)(),c=a[0]?.type??null;(0,np.trackEvent)({transition_type:i??"unknown",...rp,widget_type:c})})}();var getSelectionSizeProps=(r,o,i)=>({selectionLabel:(0,Hu.__)("Type","elementor"),sizeLabel:(0,Hu.__)("Duration","elementor"),selectionConfig:{component:TransitionSelector,props:{recentlyUsedList:r,disabledItems:o,showPromotion:i}},sizeConfigMap:{...Zu.reduce((r,o)=>(o.properties.forEach(o=>{r[o.value]=hp}),r),{})}}),isItemDisabled=r=>{const o=getTransitionPropertyByValue(r.value.selection.value?.value);return!!o&&!!o.isDisabled},getChildControlConfig=(r,o,i)=>({propTypeUtil:Bu.selectionSizePropTypeUtil,component:Ju,props:getSelectionSizeProps(r,o,i),isItemDisabled:isItemDisabled}),isPropertyUsed=(r,o)=>(r??[]).some(r=>r?.value?.selection?.value?.value?.value===o.value),getInitialValue=(r=[])=>{if(!r?.length)return Qu;for(const o of Zu)for(const i of o.properties)if(!isPropertyUsed(r,i))return{...Qu,selection:{$$type:"key-value",value:{key:{value:i.label,$$type:"string"},value:{value:i.value,$$type:"string"}}}};return Qu},gp=zu.createElement($u.Alert,{sx:{width:280,gap:.5},color:"secondary",icon:zu.createElement(Vu.InfoCircleFilledIcon,null)},zu.createElement($u.AlertTitle,null,(0,Hu.__)("Transitions","elementor")),zu.createElement($u.Box,{component:"span"},zu.createElement($u.Typography,{variant:"body2"},(0,Hu.__)("Switch to 'Normal' state to add a transition.","elementor")))),vp=createControl(({recentlyUsedListGetter:r,currentStyleState:o})=>{const i=null===o,[a,c]=(0,ju.useState)([]),u=(0,Uu.hasProInstalled)(),{value:p,setValue:g}=useBoundProp(mp),{allDisabled:v,proDisabled:b}=(0,ju.useMemo)(()=>((r=[])=>{const o=(r||[]).map(r=>r.value?.selection?.value?.key?.value),i=[];return Zu.forEach(r=>{const a=r.properties.filter(r=>r.isDisabled&&!o.includes(r.label)).map(r=>r.label);i.push(...a)}),{allDisabled:[...o,...i],proDisabled:i}})(p),[p]),k=(0,ju.useMemo)(()=>{const r=new Set;return Zu.forEach(o=>{o.properties.forEach(o=>{o.isDisabled&&!u||r.add(o.value)})}),r},[u]);(0,ju.useEffect)(()=>{if(!p||0===p.length)return;const r=p.filter(r=>{const o=r?.value?.selection?.value?.value?.value??"";return k.has(o)});r.length!==p.length&&g(r)},[k]),(0,ju.useEffect)(()=>{r().then(c)},[r]);const E=(0,ju.useMemo)(()=>((r=[])=>!!r?.length&&Zu.every(o=>o.properties.every(o=>o.isDisabled||!!r?.find(r=>r.value?.selection?.value?.value?.value===o.value))))(p),[p]),w=!i||E;return zu.createElement(ql,{label:(0,Hu.__)("Transitions","elementor"),repeaterLabel:(0,Hu.__)("Transitions","elementor"),patternLabel:"${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",placeholder:(0,Hu.__)("Empty Transition","elementor"),showDuplicate:!1,showToggle:!0,initialValues:getInitialValue(p),childControlConfig:getChildControlConfig(a,v,b.length>0),propKey:"transition",addItemTooltipProps:{disabled:w,enableTooltip:!i,tooltipContent:gp}})}),yp=__toESM(i(97557)),bp=__toESM(i(74353)),kp=i(2020),Ep=i(2020),Sp=i(79513),wp=createControl(({inputDisabled:r})=>{const{value:o,setValue:i,...a}=useBoundProp(Ep.DateTimePropTypeUtil),handleChange=(r,a)=>{const c=a.bind,u=r[c];if((0,kp.isTransformable)(u))return i({...o,[c]:u});let p="";if(u){const r=u;p="date"===c?r.format("YYYY-MM-DD"):r.format("HH:mm")}i({...o,[c]:{$$type:"string",value:p}})};return yp.createElement(PropProvider,{...a,value:o,setValue:i},yp.createElement(ControlActions,null,yp.createElement(Sp.LocalizationProvider,null,yp.createElement(Sp.Box,{display:"flex",gap:1,alignItems:"center"},yp.createElement(PropKeyProvider,{bind:"date"},yp.createElement(Sp.DatePicker,{value:(r=>{if(!r)return null;const o=bp.default(r);return o&&"function"==typeof o.isValid&&o.isValid()?o:null})(kp.stringPropTypeUtil.extract(o?.date)),onChange:r=>handleChange({date:r},{bind:"date"}),disabled:r,slotProps:{textField:{size:"tiny"},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}}})),yp.createElement(PropKeyProvider,{bind:"time"},yp.createElement(Sp.TimePicker,{value:(r=>{if(!r)return null;const[o,i]=r.split(":"),a=Number.parseInt(o??"",10),c=Number.parseInt(i??"",10);if(Number.isNaN(a)||Number.isNaN(c))return null;return bp.default().hour(a).minute(c).second(0).millisecond(0)})(kp.stringPropTypeUtil.extract(o?.time)),onChange:r=>handleChange({time:r},{bind:"time"}),disabled:r,slotProps:{textField:{size:"tiny"},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}}}))))))}),xp=__toESM(i(97557)),Cp=i(2020),_p=i(79513),Tp=i(27723),Op=__toESM(i(97557)),Pp=i(2020),Ap=i(79513),Mp=__toESM(i(74353));function isValidDayjs(r){return!!r&&"function"==typeof r.isValid&&r.isValid()}function parseDateString(r){if(!r)return null;const o=Mp.default(r);return isValidDayjs(o)?o:null}function parseTimeString(r){if(!r)return null;const[o,i,a]=r.split(":"),c=Number.parseInt(o??"",10),u=Number.parseInt(i??"",10),p=Number.parseInt(a??"0",10);if(Number.isNaN(c)||Number.isNaN(u))return null;return Mp.default().hour(c).minute(u).second(Number.isNaN(p)?0:p).millisecond(0)}var Np=createControl(({inputDisabled:r,ariaLabel:o,error:i,coerceInvalidToNull:a=!1})=>{const{value:c,setValue:u,disabled:p}=useBoundProp(Pp.dateStringPropTypeUtil),g=r??p,v={textField:{size:"tiny",fullWidth:!0,error:i,inputProps:o?{"aria-label":o}:void 0},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}};return Op.createElement(Ap.LocalizationProvider,null,Op.createElement(ControlActions,null,Op.createElement(Ap.DatePicker,{value:parseDateString(c??""),onChange:r=>((r,o)=>{!r||a&&!isValidDayjs(r)?u(null):u(r.format(o))})(r,"YYYY-MM-DD"),disabled:g,slotProps:v})))}),Rp={min:(0,Tp.__)("Min date","elementor"),max:(0,Tp.__)("Max date","elementor")},Ip=(0,Tp.__)("Max date must be on or after Min date","elementor"),Dp=createControl(()=>{const{value:r,setValue:o,...i}=useBoundProp(Cp.dateRangePropTypeUtil),a=Cp.dateStringPropTypeUtil.extract(r?.min),c=Cp.dateStringPropTypeUtil.extract(r?.max),u=(g=c,!(!(p=a)||!g)&&g<p);var p,g;return xp.createElement(PropProvider,{...i,value:r,setValue:o},xp.createElement(_p.Stack,{gap:.75},xp.createElement(_p.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},xp.createElement(_p.Grid,{container:!0,gap:.75,alignItems:"center"},xp.createElement(_p.Grid,{item:!0,xs:12},xp.createElement(ControlFormLabel,null,Rp.min)),xp.createElement(_p.Grid,{item:!0,xs:12},xp.createElement(BoundDateStringControl,{bind:"min",ariaLabel:Rp.min,error:u}))),xp.createElement(_p.Grid,{container:!0,gap:.75,alignItems:"center"},xp.createElement(_p.Grid,{item:!0,xs:12},xp.createElement(ControlFormLabel,null,Rp.max)),xp.createElement(_p.Grid,{item:!0,xs:12},xp.createElement(BoundDateStringControl,{bind:"max",ariaLabel:Rp.max,error:u})))),u&&xp.createElement(_p.FormHelperText,{error:!0},Ip)))}),BoundDateStringControl=({bind:r,ariaLabel:o,error:i})=>xp.createElement(PropKeyProvider,{bind:r},xp.createElement(Np,{ariaLabel:o,error:i,coerceInvalidToNull:!0})),Lp=__toESM(i(97557)),Fp=i(2020),zp=i(79513),jp=createControl(({inputDisabled:r,ariaLabel:o,error:i,coerceInvalidToNull:a=!1})=>{const{value:c,setValue:u,disabled:p}=useBoundProp(Fp.timeStringPropTypeUtil),g=r??p,v={textField:{size:"tiny",fullWidth:!0,error:i,inputProps:o?{"aria-label":o}:void 0},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}};return Lp.createElement(zp.LocalizationProvider,null,Lp.createElement(ControlActions,null,Lp.createElement(zp.TimePicker,{value:parseTimeString(c??""),onChange:r=>((r,o)=>{!r||a&&!isValidDayjs(r)?u(null):u(r.format(o))})(r,"HH:mm"),disabled:g,slotProps:v})))}),Bp=__toESM(i(97557)),Vp=i(2020),$p=i(79513),Up=i(27723),Hp={min:(0,Up.__)("Start time","elementor"),max:(0,Up.__)("End time","elementor")},Wp=createControl(()=>{const{value:r,setValue:o,...i}=useBoundProp(Vp.timeRangePropTypeUtil);return Bp.createElement(PropProvider,{...i,value:r,setValue:o},Bp.createElement($p.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},Bp.createElement($p.Grid,{container:!0,gap:.75,alignItems:"center"},Bp.createElement($p.Grid,{item:!0,xs:12},Bp.createElement(ControlFormLabel,null,Hp.min)),Bp.createElement($p.Grid,{item:!0,xs:12},Bp.createElement(BoundTimeStringControl,{bind:"min",ariaLabel:Hp.min}))),Bp.createElement($p.Grid,{container:!0,gap:.75,alignItems:"center"},Bp.createElement($p.Grid,{item:!0,xs:12},Bp.createElement(ControlFormLabel,null,Hp.max)),Bp.createElement($p.Grid,{item:!0,xs:12},Bp.createElement(BoundTimeStringControl,{bind:"max",ariaLabel:Hp.max})))))}),BoundTimeStringControl=({bind:r,ariaLabel:o})=>Bp.createElement(PropKeyProvider,{bind:r},Bp.createElement(jp,{ariaLabel:o,coerceInvalidToNull:!0})),qp=__toESM(i(97557)),Kp=i(97557),Gp=i(2020),Jp=i(79513),Yp=i(22444),Xp=__toESM(i(97557)),Qp=i(97557),Zp=i(79513),ed=__toESM(i(27096)),td=__toESM(i(62430)),nd=__toESM(i(29656)),rd=__toESM(i(74951)),od=__toESM(i(39007)),id=__toESM(i(81531)),ad=__toESM(i(5067)),sd=__toESM(i(38393)),ld=__toESM(i(5820)),cd=__toESM(i(14841)),ud=__toESM(i(50976)),pd=__toESM(i(19721)),dd=i(83574);function htmlToPlainText(r){if(!r)return"";const o=r.replace(/<br\s*\/?>/gi,"\n").replace(/<\/p>\s*<p[^>]*>/gi,"\n");return(new DOMParser).parseFromString(o,"text/html").body.textContent??""}var fd="i",hd="b",md="u",gd=Xp.forwardRef((r,o)=>{const{value:i,setValue:a,placeholder:c=null,editorProps:u={},elementClasses:p="",autofocus:g=!1,sx:v={},onBlur:b,expectedTag:k=null,onEditorCreate:E,wrapperClassName:w,onSelectionEnd:x,mountElement:C=null}=r,_=(0,Qp.useRef)(null),T=(0,Qp.useRef)(b);T.current=b;const P=k?"block+":"inline*",editedElementAttributes=r=>({...r,class:p}),A=(0,dd.useEditor)({...C?{element:C}:{},extensions:[td.default.extend({content:P}),ad.default.extend({renderHTML({HTMLAttributes:r}){return[k??"p",editedElementAttributes(r),0]}}),rd.default.extend({renderHTML({node:r,HTMLAttributes:o}){if(k)return[k,editedElementAttributes(o),0];return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,editedElementAttributes(o),0]}}).configure({levels:[1,2,3,4,5,6]}),id.default.configure({openOnClick:!1}),ud.default,ed.default,od.default,sd.default,cd.default,ld.default,pd.default,nd.default.extend({addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.setHardBreak()}}})],content:i,onUpdate:({editor:r})=>{const o=r.getHTML();a(function isEmpty(r=""){if(!r)return!0;const o=document.createElement("div");return o.innerHTML=r,!o.textContent?.length}(o)?null:o)},autofocus:g,editorProps:{...u,handleDOMEvents:{keydown:(r,o)=>{"Escape"===o.key&&T.current?.(),!o.metaKey&&!o.ctrlKey||o.altKey||[fd,hd,md].includes(o.key)&&o.stopPropagation()}},attributes:{...u.attributes??{},role:"textbox",...c?{"data-placeholder":htmlToPlainText(c)}:{},...null===i||""===i?{class:"is-empty"}:{}}},onCreate:E?({editor:r})=>E(r):void 0,onBlur:C?void 0:()=>T.current?.(),onSelectionUpdate:x?({editor:r})=>x(r.view):void 0});return useOnUpdate(()=>{if(!A)return;A.getHTML()!==i&&A.commands.setContent(i,{emitUpdate:!1})},[A,i]),C?null:Xp.createElement(Zp.Box,{ref:_,sx:v,className:w},Xp.createElement(dd.EditorContent,{ref:o,editor:A}))}),useOnUpdate=(r,o)=>{const i=(0,Qp.useRef)(!1);(0,Qp.useEffect)(()=>{i.current?r():i.current=!0},o)},vd=createControl(({sx:r,attributes:o,props:i})=>{const{value:a,setValue:c,placeholder:u}=useBoundProp(Gp.htmlV3PropTypeUtil),p=Gp.stringPropTypeUtil.extract(a?.content??null)??"",g=(0,Kp.useMemo)(()=>(0,Yp.debounce)(r=>{const o=(0,Gp.parseHtmlChildren)(r);c({content:o.content?Gp.stringPropTypeUtil.create(o.content):null,children:o.children})},300),[c]),v=(0,Kp.useCallback)(r=>{const o=r??"";c({content:o?Gp.stringPropTypeUtil.create(o):null,children:a?.children??[]}),g(o)},[c,a?.children,g]);return(0,Kp.useEffect)(()=>()=>g.cancel(),[g]),qp.createElement(ControlActions,null,qp.createElement(Jp.Box,{sx:{p:.8,border:"1px solid",borderColor:"grey.200",borderRadius:"8px",transition:"border-color .2s ease, box-shadow .2s ease","&:hover":{borderColor:"black"},"&:focus-within":{borderColor:"black",boxShadow:"0 0 0 1px black"},"& .ProseMirror:focus":{outline:"none"},"& .ProseMirror":{minHeight:"70px",fontSize:"12px","& a":{color:"inherit"},"& .elementor-inline-editor-reset":{margin:0,padding:0},"&.is-empty::before":{content:"attr(data-placeholder)",color:"text.tertiary",pointerEvents:"none",position:"absolute",opacity:.6}},".strip-styles *":{all:"unset"},...r},...o,...i},qp.createElement(gd,{value:p,setValue:v,placeholder:u?.content?.value??null})))}),yd=__toESM(i(97557)),bd=i(2020),kd=i(70374),Ed=i(79513),Sd=i(27723),wd=__toESM(i(97557)),xd=i(70374),Cd=i(79513),_d=i(27723),Td=i(70975),Od=i(2020),Pd=i(5527),Ad=["e-form-input","e-form-textarea","e-form-checkbox","e-form-radio-button","e-form-select","e-form-date-picker","e-form-time-picker"];function extractStringPropValue(r){return Od.stringPropTypeUtil.extract(r)}function getSettingWithDefault(r,o,i){const a=r.settings.get(i);if(null!=a)return a;const c=(0,Td.getWidgetsCache)()?.[o]?.atomic_props_schema;return c?.[i]?.default??null}function useFormFieldSuggestions(r){return(0,Pd.__privateUseListenTo)([(0,Pd.v1ReadyEvent)(),(0,Pd.commandEndEvent)("document/elements/create"),(0,Pd.commandEndEvent)("document/elements/delete"),(0,Pd.commandEndEvent)("document/elements/set-settings")],()=>{const o=(0,Td.getSelectedElements)()[0];if(!o)return[];const i=function getFormContainer(r){let o=(0,Td.getContainer)(r);for(;o;){if("e-form"===o.model.get("elType"))return o;o=o.parent??null}return null}(o.id);if(!i?.children)return[];const a=[],c=new Set;return i.children.forEachRecursive?.(o=>{const i=o.model.get("widgetType");if(!i||!function isFormFieldWidgetType(r){return Ad.includes(r)}(i))return;if(r?.inputType){if(extractStringPropValue(getSettingWithDefault(o,i,"type"))!==r.inputType)return}const u=function getFieldCssId(r,o){return extractStringPropValue(getSettingWithDefault(r,o,"_cssid"))}(o,i);u&&!c.has(u)&&(c.add(u),a.push({label:u,value:u}))}),a},[])}var Md=__toESM(i(97557)),Nd=i(97557),Rd=i(2020),Id=i(79513),Dd=i(59618),Ld=i(22444),Fd=new Set([" ",","]);var zd=/^\[[^[\]]+]$/;var shouldShowMentionsInfo=()=>{if(!(0,Ld.hasProInstalled)())return!0;const r=window.elementorPro?.config?.version;return!!r&&(0,Ld.isVersionGreaterOrEqual)(r,"4.1.0")},isValidRecipient=r=>function isValidEmail(r){return Dd.z.string().email().safeParse(r).success}(r)||function isFormFieldShortcode(r){return zd.test(r)}(r);function resolveMention(r,o){if(!r.startsWith("@"))return r;const i=o.find(o=>createMentionPattern(o.value,"start").test(r));return i?`[${i.value}]`:r}var jd=createControl(({placeholder:r,suggestions:o=[]})=>{const{value:i,setValue:a,disabled:c}=useBoundProp(Rd.stringArrayPropTypeUtil),[u,p]=(0,Nd.useState)(""),g=i||[],v=g.map(r=>Rd.stringPropTypeUtil.extract(r)).filter(r=>null!==r),b=(0,Nd.useMemo)(()=>o.map(r=>`[${r.value}]`),[o]),tryAddChip=r=>{const i=resolveMention(r.trim(),o);i&&!v.includes(i)&&isValidRecipient(i)&&(a([...g,Rd.stringPropTypeUtil.create(i)]),p(""))},handleKeyDown=r=>{Fd.has(r.key)&&u.trim()&&(r.preventDefault(),tryAddChip(u))};return Md.createElement(ControlActions,null,Md.createElement(Id.Autocomplete,{fullWidth:!0,multiple:!0,freeSolo:!0,size:"tiny",disabled:c,inputValue:u,onInputChange:(r,o,i)=>{"reset"!==i&&p(o)},value:v,onChange:(r,i)=>{const c=[];for(const r of i){const i=resolveMention(r.trim(),o);i&&isValidRecipient(i)&&c.push(Rd.stringPropTypeUtil.create(i))}a(c),p("")},options:b,filterOptions:(r,o)=>{const i=o.inputValue.trim().replace(/^@/,"").toLowerCase();return i?r.filter(r=>r.toLowerCase().includes(i)):r},filterSelectedOptions:!0,onBlur:r=>{const o=r.target;tryAddChip(o.value),p("")},getOptionLabel:r=>r,isOptionEqualToValue:(r,o)=>r===o,renderInput:o=>Md.createElement(Id.TextField,{...o,placeholder:r,onKeyDown:handleKeyDown}),renderTags:(r,o)=>Md.createElement(ChipsList,{getLabel:r=>r,getTagProps:o,values:r})}))}),EmailChipsField=({fieldLabel:r,placeholder:o,suggestions:i})=>Md.createElement(Id.Grid,{container:!0,direction:"column",gap:.5},Md.createElement(Id.Grid,{item:!0},Md.createElement(ControlFormLabel,null,r)),Md.createElement(Id.Grid,{item:!0},Md.createElement(jd,{placeholder:o,suggestions:i}))),Bd=__toESM(i(97557)),Vd=i(79513),EmailField=({bind:r,label:o,placeholder:i})=>Bd.createElement(PropKeyProvider,{bind:r},Bd.createElement(Vd.Grid,{container:!0,direction:"column",gap:.5},Bd.createElement(Vd.Grid,{item:!0},Bd.createElement(ControlFormLabel,null,o)),Bd.createElement(Vd.Grid,{item:!0},Bd.createElement(Ne,{placeholder:i})))),SendToField=({placeholder:r})=>{const o=useFormFieldSuggestions({inputType:"email"});return wd.createElement(PropKeyProvider,{bind:"to"},wd.createElement(Cd.Stack,{gap:.5},wd.createElement(EmailChipsField,{fieldLabel:(0,_d.__)("Send to","elementor"),placeholder:r,suggestions:o}),shouldShowMentionsInfo()&&wd.createElement(xd.InfoAlert,null,(0,_d.__)("Type @ or an email field name to insert its submitted value.","elementor"))))},SubjectField=()=>wd.createElement(EmailField,{bind:"subject",label:(0,_d.__)("Email subject","elementor"),placeholder:(0,_d.__)("New form submission","elementor")}),MessageField=()=>{const r=useFormFieldSuggestions();return wd.createElement(PropKeyProvider,{bind:"message"},wd.createElement(Cd.Grid,{container:!0,direction:"column",gap:.5},wd.createElement(Cd.Grid,{item:!0},wd.createElement(ControlFormLabel,null,(0,_d.__)("Message","elementor"))),wd.createElement(Cd.Grid,{item:!0},wd.createElement($e,{suggestions:r})),wd.createElement(Cd.Grid,{item:!0},wd.createElement(xd.InfoAlert,null,shouldShowMentionsInfo()?(0,_d.__)("[all-fields] shortcode sends all fields. Type @ to insert specific fields and customize your message.","elementor"):(0,_d.__)("[all-fields] shortcode sends all fields.","elementor")))))},FromEmailField=()=>wd.createElement(EmailField,{bind:"from",label:(0,_d.__)("From email","elementor"),placeholder:(0,_d.__)("What email should appear as the sender?","elementor")}),FromNameField=()=>wd.createElement(EmailField,{bind:"from-name",label:(0,_d.__)("From name","elementor"),placeholder:(0,_d.__)("What name should appear as the sender?","elementor")}),ReplyToField=()=>{const r=useFormFieldSuggestions({inputType:"email"});return wd.createElement(PropKeyProvider,{bind:"reply-to"},wd.createElement(Cd.Grid,{container:!0,direction:"column",gap:.5},wd.createElement(Cd.Grid,{item:!0},wd.createElement(ControlFormLabel,null,(0,_d.__)("Reply-to","elementor"))),wd.createElement(Cd.Grid,{item:!0},wd.createElement($e,{suggestions:r,rows:1,triggerPosition:"start",placeholder:(0,_d.__)("You can type @ to insert an email field","elementor")}))))},CcField=()=>{const r=useFormFieldSuggestions({inputType:"email"});return wd.createElement(PropKeyProvider,{bind:"cc"},wd.createElement(EmailChipsField,{fieldLabel:(0,_d.__)("Cc","elementor"),suggestions:r}))},BccField=()=>{const r=useFormFieldSuggestions({inputType:"email"});return wd.createElement(PropKeyProvider,{bind:"bcc"},wd.createElement(EmailChipsField,{fieldLabel:(0,_d.__)("Bcc","elementor"),suggestions:r}))},MetaDataField=()=>wd.createElement(PropKeyProvider,{bind:"meta-data"},wd.createElement(Cd.Stack,{gap:.5},wd.createElement(ControlFormLabel,null,(0,_d.__)("Metadata","elementor")),wd.createElement(io,{options:[{label:(0,_d.__)("Date","elementor"),value:"date"},{label:(0,_d.__)("Time","elementor"),value:"time"},{label:(0,_d.__)("Page URL","elementor"),value:"page-url"},{label:(0,_d.__)("User agent","elementor"),value:"user-agent"},{label:(0,_d.__)("Credit","elementor"),value:"credit"}]}))),SendAsField=()=>wd.createElement(PropKeyProvider,{bind:"send-as"},wd.createElement(Cd.Grid,{container:!0,direction:"column",gap:.5},wd.createElement(Cd.Grid,{item:!0},wd.createElement(ControlFormLabel,null,(0,_d.__)("Send as","elementor"))),wd.createElement(Cd.Grid,{item:!0},wd.createElement(_e,{options:[{label:(0,_d.__)("HTML","elementor"),value:"html"},{label:(0,_d.__)("Plain Text","elementor"),value:"plain"}]})))),$d=createControl(({toPlaceholder:r,label:o})=>{const{value:i,setValue:a,...c}=useBoundProp(bd.emailsPropTypeUtil);return yd.createElement(PropProvider,{...c,value:i,setValue:a},yd.createElement(Ed.Stack,{gap:2},yd.createElement(ControlLabel,null,o?o+" "+(0,Sd.__)("settings","elementor"):(0,Sd.__)("Email settings","elementor")),yd.createElement(SendToField,{placeholder:r}),yd.createElement(SubjectField,null),yd.createElement(MessageField,null),yd.createElement(FromEmailField,null),yd.createElement(AdvancedSettings,null)))}),AdvancedSettings=()=>yd.createElement(kd.CollapsibleContent,{defaultOpen:!1},yd.createElement(Ed.Box,{sx:{pt:2}},yd.createElement(Ed.Stack,{gap:2},yd.createElement(FromNameField,null),yd.createElement(ReplyToField,null),yd.createElement(CcField,null),yd.createElement(BccField,null),yd.createElement(Ed.Divider,null),yd.createElement(MetaDataField,null),yd.createElement(SendAsField,null)))),Ud=__toESM(i(97557)),Hd=i(70374),Wd=i(79513),qd=i(27723),Kd=createControl(({label:r,options:o})=>Ud.createElement(Wd.Grid,{container:!0,direction:"column",gap:1},r&&Ud.createElement(Wd.Grid,{item:!0},Ud.createElement(ControlFormLabel,null,r)),Ud.createElement(Wd.Grid,{item:!0},Ud.createElement(_e,{options:o})),Ud.createElement(Wd.Grid,{item:!0},Ud.createElement(Hd.InfoAlert,null,(0,qd.__)("Linked uploads are saved to the server. Direct attachments will not appear under Submissions.","elementor"))))),Gd=__toESM(i(97557)),Jd=i(2020),Yd=i(79513),Xd=createControl(({placeholder:r,error:o,inputValue:i,inputDisabled:a,helperText:c,sx:u,ariaLabel:p})=>{const{value:g,setValue:v,disabled:b,placeholder:k}=useBoundProp(Jd.spanPropTypeUtil),E=r??k??"e.g: 'span 2' or '1 / 3'";return Gd.createElement(ControlActions,null,Gd.createElement(Yd.TextField,{size:"tiny",fullWidth:!0,disabled:a??b,value:i??g??"",onChange:r=>{const o=r.target.value;v(""===o?null:o)},placeholder:E,error:o,helperText:c,sx:u,inputProps:{...p?{"aria-label":p}:{}}}))}),Qd=__toESM(i(97557)),Zd=i(97557),ef=i(24413),tf=i(79513),nf=i(27723),rf=__toESM(i(97557)),of=i(97557),af=i(70374),sf=i(79513);var lf=(0,of.forwardRef)(({promotionKey:r,children:o,trackingData:i},a)=>{const[c,u]=(0,of.useState)(!1),p=function getV4Promotion(r){return window.elementor?.config?.v4Promotions?.[r]}(r),g=(0,of.useCallback)(()=>{u(r=>(r||trackViewPromotion(i),!r))},[i]);return(0,of.useImperativeHandle)(a,()=>({toggle:g}),[g]),rf.createElement(rf.Fragment,null,p&&rf.createElement(af.PromotionInfotip,{title:p.title,content:p.content,assetUrl:p.image,ctaUrl:p.ctaUrl,open:c,onClose:r=>{r.stopPropagation(),u(!1)},onCtaClick:()=>trackUpgradePromotionClick(i)},rf.createElement(sf.Box,{onClick:r=>{r.stopPropagation(),g()},sx:{cursor:"pointer",display:"inline-flex"}},o??rf.createElement(af.PromotionChip,null))))}),cf=(0,nf.__)("Display Conditions","elementor"),uf={target_name:"display_conditions",location_l2:"general"},pf=createControl(()=>{const r=(0,Zd.useRef)(null);return Qd.createElement(tf.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",alignItems:"center"}},Qd.createElement(lf,{ref:r,promotionKey:"displayConditions",trackingData:uf}),Qd.createElement(tf.Tooltip,{title:cf,placement:"top"},Qd.createElement(tf.IconButton,{size:"tiny","aria-label":cf,"data-behavior":"display-conditions",onClick:()=>r.current?.toggle(),sx:{border:"1px solid",borderColor:"divider",borderRadius:1}},Qd.createElement(ef.SitemapIcon,{fontSize:"tiny",color:"disabled"}))))}),df=__toESM(i(97557)),ff=i(97557),hf=i(24413),mf=i(79513),gf=(0,i(27723).__)("Attributes","elementor"),vf={target_name:"attributes",location_l2:"general"},yf=createControl(()=>{const r=(0,ff.useRef)(null);return df.createElement(mf.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",alignItems:"center"}},df.createElement(lf,{ref:r,promotionKey:"attributes",trackingData:vf}),df.createElement(mf.Tooltip,{title:gf,placement:"top"},df.createElement(hf.PlusIcon,{"aria-label":gf,fontSize:"tiny",color:"disabled",onClick:()=>r.current?.toggle(),sx:{cursor:"pointer"}})))}),bf=__toESM(i(97557)),kf=i(24413),Ef=i(79513),Sf=(0,Ef.styled)(Ef.IconButton)(({theme:r})=>({width:r.spacing(2.5),height:r.spacing(2.5)})),ClearIconButton=({tooltipText:r,onClick:o,disabled:i,size:a="tiny"})=>bf.createElement(Ef.Tooltip,{title:r,placement:"top",disableInteractive:!0},bf.createElement(Sf,{"aria-label":r,size:a,onClick:o,disabled:i},bf.createElement(kf.BrushBigIcon,{fontSize:a}))),wf=__toESM(i(97557)),xf=i(97557),Cf=i(24413),_f=i(79513),Tf=i(27723),Of="tiny",Repeater3=({label:r,itemSettings:o,disabled:i=!1,openOnAdd:a=!1,values:c=[],setValues:u,showDuplicate:p=!0,showToggle:g=!0,showRemove:v=!0,disableAddItemButton:b=!1,addButtonInfotipContent:k,openItem:E=-1,isSortable:w=!0})=>{const[x,C]=(0,xf.useState)(E),_=c.map((r,i)=>w&&"getId"in o?o.getId({item:r,index:i}):String(i)),T=i||b,P=T&&k,A=wf.createElement(_f.IconButton,{size:Of,sx:{ml:"auto"},disabled:T,onClick:()=>{const r=structuredClone(o.initialValues),i=c.length;u([...c,r],{},{action:{type:"add",payload:[{index:i,item:r}]}}),a&&C(i)},"aria-label":(0,Tf.__)("Add item","elementor")},wf.createElement(Cf.PlusIcon,{fontSize:Of}));return wf.createElement(SectionContent,{gap:2},wf.createElement(lr,{label:r,adornment:ControlAdornments},P?wf.createElement(_f.Infotip,{placement:"right",content:k,color:"secondary",slotProps:{popper:{sx:{width:300}}}},wf.createElement(_f.Box,{sx:{...T?{cursor:"not-allowed"}:{}}},A)):A),0<_.length&&wf.createElement(SortableProvider,{value:_,onChange:(r,o)=>{u(r.map(r=>c[_.indexOf(r)]),{},{action:{type:"reorder",payload:{...o}}})}},_.map(r=>{const b=_.indexOf(r),k=c[b];return k?wf.createElement(SortableItem,{id:r,key:`sortable-${r}`,disabled:!w},wf.createElement(RepeaterItem,{disabled:i,propDisabled:k?.disabled,label:wf.createElement(On,{value:k},wf.createElement(o.Label,{value:k,index:b})),startIcon:wf.createElement(_n,{value:k},wf.createElement(o.Icon,{value:k})),removeItem:()=>(r=>{const o=c[r];u(c.filter((o,i)=>i!==r),{},{action:{type:"remove",payload:[{index:r,item:o}]}})})(b),duplicateItem:()=>(r=>{const o=structuredClone(c[r]),i=1+r;u([...c.slice(0,i),o,...c.slice(i)],{},{action:{type:"duplicate",payload:[{index:r,item:o}]}})})(b),toggleDisableItem:()=>(r=>{u(c.map((o,i)=>{if(i===r){const{disabled:r,...i}=o;return{...i,...r?{}:{disabled:!0}}}return o}),{},{action:{type:"toggle-disable"}})})(b),openOnMount:a&&x===b,onOpen:()=>C(-1),onPopoverOpen:o.onPopoverOpen,onPopoverClose:o.onPopoverClose,showDuplicate:p,showToggle:g,showRemove:v,actions:o.actions,value:k},r=>wf.createElement(o.Content,{...r,value:k,bind:String(b),index:b}))):null})))},RepeaterItem=({label:r,propDisabled:o,startIcon:i,children:a,removeItem:c,duplicateItem:u,toggleDisableItem:p,openOnMount:g,onOpen:v,onPopoverOpen:b,onPopoverClose:k,showDuplicate:E,showToggle:w,showRemove:x,disabled:C,actions:_,value:T})=>{const P=k?()=>k(T):void 0,{popoverState:A,popoverProps:N,ref:R,setRef:I}=usePopover(g,()=>{v(),b?.(T)},P),L=(0,_f.bindTrigger)(A);usePopoverDismiss({isOpen:A.isOpen,onClose:N.onClose});const z=(0,Tf.__)("Duplicate","elementor"),j=o?(0,Tf.__)("Show","elementor"):(0,Tf.__)("Hide","elementor"),B=(0,Tf.__)("Remove","elementor");return wf.createElement(_f.Box,{sx:{display:"contents"}},wf.createElement(xn,{disabled:C,label:r,ref:I,"aria-label":(0,Tf.__)("Open item","elementor"),...L,onClick:r=>{L.onClick(r),A.isOpen||b?.(T)},startIcon:i,actions:wf.createElement(wf.Fragment,null,E&&wf.createElement(_f.Tooltip,{title:z,placement:"top"},wf.createElement(_f.IconButton,{size:Of,onClick:u,"aria-label":z},wf.createElement(Cf.CopyIcon,{fontSize:Of}))),w&&wf.createElement(_f.Tooltip,{title:j,placement:"top"},wf.createElement(_f.IconButton,{size:Of,onClick:p,"aria-label":j},o?wf.createElement(Cf.EyeOffIcon,{fontSize:Of}):wf.createElement(Cf.EyeIcon,{fontSize:Of}))),_?.(T),x&&wf.createElement(_f.Tooltip,{title:B,placement:"top"},wf.createElement(_f.IconButton,{size:Of,onClick:c,"aria-label":B},wf.createElement(Cf.XIcon,{fontSize:Of}))))}),wf.createElement(RepeaterPopover,{width:R?.getBoundingClientRect().width,...N,anchorEl:R},wf.createElement(_f.Box,null,a({anchorEl:R}))))},usePopover=(r,o,i)=>{const[a,c]=(0,xf.useState)(null),u=(0,_f.usePopupState)({variant:"popover"}),p=(0,_f.bindPopover)(u);(0,xf.useEffect)(()=>{r&&a&&(u.open(a),o?.())},[a]);return{popoverState:u,ref:a,setRef:c,popoverProps:{...p,onClose:()=>{p.onClose?.(),i?.()}}}},Pf=__toESM(i(97557)),Af=i(97557),Mf=i(70975),Nf=i(24413),Rf=i(79513),If=i(83574),Df=i(27723),Lf=__toESM(i(97557)),Ff=i(97557),zf=i(24413),jf=i(79513),Bf=i(27723),UrlPopover=({popupState:r,restoreValue:o,anchorRef:i,value:a,onChange:c,openInNewTab:u,onToggleNewTab:p})=>{const g=(0,Ff.useRef)(null);(0,Ff.useEffect)(()=>{r.isOpen&&requestAnimationFrame(()=>g.current?.focus())},[r.isOpen]);const handleClose=()=>{o(),r.close()};return Lf.createElement(jf.Popover,{slotProps:{paper:{sx:{borderRadius:"16px",width:i.current?.offsetWidth+"px",marginTop:-1}}},...(0,jf.bindPopover)(r),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:handleClose},Lf.createElement(jf.Stack,{direction:"row",alignItems:"center",gap:1,sx:{p:1.5}},Lf.createElement(jf.TextField,{value:a,onChange:c,size:"tiny",fullWidth:!0,placeholder:(0,Bf.__)("Type a URL","elementor"),inputProps:{ref:g},color:"secondary",InputProps:{sx:{borderRadius:"8px"}},onKeyUp:r=>"Enter"===r.key&&handleClose()}),Lf.createElement(jf.Tooltip,{title:(0,Bf.__)("Open in a new tab","elementor")},Lf.createElement(jf.ToggleButton,{size:"tiny",value:"newTab",selected:u,onClick:p,"aria-label":(0,Bf.__)("Open in a new tab","elementor"),sx:{borderRadius:"8px"}},Lf.createElement(zf.ExternalLinkIcon,{fontSize:"tiny"})))))},InlineEditorToolbar=({editor:r,elementId:o,sx:i={}})=>{const[a,c]=(0,Af.useState)(""),[u,p]=(0,Af.useState)(!1),g=(0,Af.useRef)(null),v=(0,Rf.usePopupState)({variant:"popover"}),b=!!o&&checkIfElementIsClickable(o),k=(0,If.useEditorState)({editor:r,selector:r=>Hf.filter(o=>r.editor.isActive(o))}),E=(0,Af.useMemo)(()=>{const r=Object.values(Uf);return b?r.filter(r=>"link"!==r.action):r},[b]);return(0,Af.useEffect)(()=>{r?.commands?.focus()},[r]),Pf.createElement(Rf.Box,{ref:g,sx:{display:"inline-flex",gap:.5,padding:.5,borderRadius:"8px",backgroundColor:"background.paper",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)",alignItems:"center",visibility:v.isOpen?"hidden":"visible",pointerEvents:v.isOpen?"none":"all",...i}},Pf.createElement(Rf.Tooltip,{title:$f.label,placement:"top",sx:{borderRadius:"8px"}},Pf.createElement(Rf.IconButton,{"aria-label":$f.label,onClick:()=>$f.method(r),size:"tiny"},$f.icon)),Pf.createElement(Rf.ToggleButtonGroup,{value:k,size:"tiny",sx:{display:"flex",gap:.5,border:"none",[`& .${Rf.toggleButtonGroupClasses.firstButton}, & .${Rf.toggleButtonGroupClasses.middleButton}, & .${Rf.toggleButtonGroupClasses.lastButton}`]:{borderRadius:"8px",border:"none",marginLeft:0,"&.Mui-selected":{marginLeft:0},"& + &.Mui-selected":{marginLeft:0}}}},E.map(o=>Pf.createElement(Rf.Tooltip,{title:o.label,key:o.action,placement:"top"},Pf.createElement(Rf.ToggleButton,{value:o.action,"aria-label":o.label,size:"tiny",onClick:()=>{"link"===o.action?(()=>{const o=r.getAttributes("link");c(o.href||""),p("_blank"===o.target),v.open(g.current)})():o.method?.(r),r?.commands?.focus()}},o.icon)))),Pf.createElement(UrlPopover,{popupState:v,anchorRef:g,restoreValue:()=>{a?r.chain().focus().setLink({href:a,target:u?"_blank":"_self"}).run():r.chain().focus().unsetLink().run(),o&&window.dispatchEvent(new CustomEvent("elementor:inline-link-changed",{detail:{elementId:o}})),v.close()},value:a,onChange:r=>{c(r.target.value)},openInNewTab:u,onToggleNewTab:()=>{p(!u)}}))},checkIfElementIsClickable=r=>{const o=(0,Mf.getContainer)(r),i=o?.model.get("widgetType"),a="e-button"===i,c=!!(0,Mf.getElementSetting)(r,"link")?.value?.destination;return a||c},Vf={clear:{label:(0,Df.__)("Clear","elementor"),icon:Pf.createElement(Nf.MinusIcon,{fontSize:"tiny"}),action:"clear",method:r=>{r.chain().focus().clearNodes().unsetAllMarks().run()}},bold:{label:(0,Df.__)("Bold","elementor"),icon:Pf.createElement(Nf.BoldIcon,{fontSize:"tiny"}),action:"bold",method:r=>{r.chain().focus().toggleBold().run()}},italic:{label:(0,Df.__)("Italic","elementor"),icon:Pf.createElement(Nf.ItalicIcon,{fontSize:"tiny"}),action:"italic",method:r=>{r.chain().focus().toggleItalic().run()}},underline:{label:(0,Df.__)("Underline","elementor"),icon:Pf.createElement(Nf.UnderlineIcon,{fontSize:"tiny"}),action:"underline",method:r=>{r.chain().focus().toggleUnderline().run()}},strike:{label:(0,Df.__)("Strikethrough","elementor"),icon:Pf.createElement(Nf.StrikethroughIcon,{fontSize:"tiny"}),action:"strike",method:r=>{r.chain().focus().toggleStrike().run()}},superscript:{label:(0,Df.__)("Superscript","elementor"),icon:Pf.createElement(Nf.SuperscriptIcon,{fontSize:"tiny"}),action:"superscript",method:r=>{r.chain().focus().toggleSuperscript().run()}},subscript:{label:(0,Df.__)("Subscript","elementor"),icon:Pf.createElement(Nf.SubscriptIcon,{fontSize:"tiny"}),action:"subscript",method:r=>{r.chain().focus().toggleSubscript().run()}},link:{label:(0,Df.__)("Link","elementor"),icon:Pf.createElement(Nf.LinkIcon,{fontSize:"tiny"}),action:"link",method:null}},{clear:$f,...Uf}=Vf,Hf=Object.keys(Uf),Wf=__toESM(i(97557)),qf=i(79513),differsFromExternal=(r,o)=>r?.size!==o?.size||r?.unit!==o?.unit,Kf=__toESM(i(97557)),Gf=i(97557),Jf=i(70374),Yf=i(79513),Xf={display:"flex",flexDirection:"column",justifyContent:"center"},UnitSelect=({value:r,showPrimaryColor:o,onClick:i,options:a})=>{const c=(0,Yf.usePopupState)({variant:"popover",popupId:(0,Gf.useId)()});return Kf.createElement(Kf.Fragment,null,Kf.createElement(Qf,{isPrimaryColor:o,size:"small",...(0,Yf.bindTrigger)(c)},r),Kf.createElement(Yf.Menu,{MenuListProps:{dense:!0},...(0,Yf.bindMenu)(c)},a.map((r,o)=>Kf.createElement(Jf.MenuListItem,{key:r,onClick:()=>(r=>{i(a[r]),c.close()})(o),primaryTypographyProps:{variant:"caption",sx:{...Xf,lineHeight:"1"}},menuItemTextProps:{sx:Xf}},r.toUpperCase()))))},Qf=(0,Yf.styled)(Yf.Button,{shouldForwardProp:r=>"isPrimaryColor"!==r})(({isPrimaryColor:r,theme:o})=>({color:r?o.palette.text.primary:o.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),Zf=__toESM(i(97557)),eh=(0,i(97557).forwardRef)(({type:r,value:o,onChange:i,onKeyDown:a,onKeyUp:c,InputProps:u,onBlur:p,focused:g,disabled:v},b)=>Zf.createElement(dt,{ref:b,size:"tiny",fullWidth:!0,type:r,value:o,onKeyUp:c,focused:g,disabled:v,onKeyDown:a,onInput:i,onBlur:p,InputProps:u,sx:getCursorStyle2(u?.readOnly??!1)})),getCursorStyle2=r=>({input:{cursor:r?"default !important":void 0}}),UnstableSizeField=({value:r,InputProps:o,onChange:i,onBlur:a,units:c,defaultUnit:u,startIcon:p})=>{const{size:g,unit:v,setSize:b,setUnit:k}=((r,o,i)=>{const[a,c]=useSyncExternalState({external:r,setExternal:r=>{null!==r&&o(r)},persistWhen:o=>differsFromExternal(o,r),fallback:()=>({size:"",unit:i??"px"})});return{size:a.size,unit:a.unit,setSize:r=>{const o={...a,size:""===r.trim()?null:Number(r)};c(o)},setUnit:r=>{const o={...a,unit:r};c(o)}}})(r,i,u);return Wf.createElement(eh,{type:"number",value:g??"",onBlur:a,onChange:r=>b(r.target.value),InputProps:{...o,startAdornment:p&&Wf.createElement(qf.InputAdornment,{position:"start"},p),endAdornment:Wf.createElement(qf.InputAdornment,{position:"end"},Wf.createElement(UnitSelect,{options:c,value:v,onClick:k,showPrimaryColor:hasValue(g)}))}})},hasValue=r=>null!==r&&""!==r,th=i(97557),nh=i(5527),useFontFamilies=()=>{const{groups:r,options:o}=(()=>{const{controls:r}=(0,nh.getElementorConfig)();return r?.font??{}})();return(0,th.useMemo)(()=>{if(!r||!o)return[];const i=Object.keys(r),a=new Map(i.map((r,o)=>[r,o]));return Object.entries(o).reduce((o,[i,c])=>{const u=a.get(c);return void 0===u||(o[u]||(o[u]={label:r[c],fonts:[]}),o[u].fonts.push(i)),o},[]).filter(Boolean)},[r,o])}},40331:function(r,o){"use strict";const{getOwnPropertyNames:i,getOwnPropertySymbols:a}=Object,{hasOwnProperty:c}=Object.prototype;function combineComparators(r,o){return function isEqual(i,a,c){return r(i,a,c)&&o(i,a,c)}}function createIsCircular(r){return function isCircular(o,i,a){if(!o||!i||"object"!=typeof o||"object"!=typeof i)return r(o,i,a);const{cache:c}=a,u=c.get(o),p=c.get(i);if(u&&p)return u===i&&p===o;c.set(o,i),c.set(i,o);const g=r(o,i,a);return c.delete(o),c.delete(i),g}}function getStrictProperties(r){return i(r).concat(a(r))}const u=Object.hasOwn||((r,o)=>c.call(r,o));function sameValueZeroEqual(r,o){return r===o||!r&&!o&&r!=r&&o!=o}const{getOwnPropertyDescriptor:p,keys:g}=Object;function areArrayBuffersEqual(r,o){return r.byteLength===o.byteLength&&areTypedArraysEqual(new Uint8Array(r),new Uint8Array(o))}function areArraysEqual(r,o,i){let a=r.length;if(o.length!==a)return!1;for(;a-- >0;)if(!i.equals(r[a],o[a],a,a,r,o,i))return!1;return!0}function areDataViewsEqual(r,o){return r.byteLength===o.byteLength&&areTypedArraysEqual(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),new Uint8Array(o.buffer,o.byteOffset,o.byteLength))}function areDatesEqual(r,o){return sameValueZeroEqual(r.getTime(),o.getTime())}function areErrorsEqual(r,o){return r.name===o.name&&r.message===o.message&&r.cause===o.cause&&r.stack===o.stack}function areFunctionsEqual(r,o){return r===o}function areMapsEqual(r,o,i){const a=r.size;if(a!==o.size)return!1;if(!a)return!0;const c=new Array(a),u=r.entries();let p,g,v=0;for(;(p=u.next())&&!p.done;){const a=o.entries();let u=!1,b=0;for(;(g=a.next())&&!g.done;){if(c[b]){b++;continue}const a=p.value,k=g.value;if(i.equals(a[0],k[0],v,b,r,o,i)&&i.equals(a[1],k[1],a[0],k[0],r,o,i)){u=c[b]=!0;break}b++}if(!u)return!1;v++}return!0}const v=sameValueZeroEqual;function areObjectsEqual(r,o,i){const a=g(r);let c=a.length;if(g(o).length!==c)return!1;for(;c-- >0;)if(!isPropertyEqual(r,o,i,a[c]))return!1;return!0}function areObjectsEqualStrict(r,o,i){const a=getStrictProperties(r);let c,u,g,v=a.length;if(getStrictProperties(o).length!==v)return!1;for(;v-- >0;){if(c=a[v],!isPropertyEqual(r,o,i,c))return!1;if(u=p(r,c),g=p(o,c),(u||g)&&(!u||!g||u.configurable!==g.configurable||u.enumerable!==g.enumerable||u.writable!==g.writable))return!1}return!0}function arePrimitiveWrappersEqual(r,o){return sameValueZeroEqual(r.valueOf(),o.valueOf())}function areRegExpsEqual(r,o){return r.source===o.source&&r.flags===o.flags}function areSetsEqual(r,o,i){const a=r.size;if(a!==o.size)return!1;if(!a)return!0;const c=new Array(a),u=r.values();let p,g;for(;(p=u.next())&&!p.done;){const a=o.values();let u=!1,v=0;for(;(g=a.next())&&!g.done;){if(!c[v]&&i.equals(p.value,g.value,p.value,g.value,r,o,i)){u=c[v]=!0;break}v++}if(!u)return!1}return!0}function areTypedArraysEqual(r,o){let i=r.byteLength;if(o.byteLength!==i||r.byteOffset!==o.byteOffset)return!1;for(;i-- >0;)if(r[i]!==o[i])return!1;return!0}function areUrlsEqual(r,o){return r.hostname===o.hostname&&r.pathname===o.pathname&&r.protocol===o.protocol&&r.port===o.port&&r.hash===o.hash&&r.username===o.username&&r.password===o.password}function isPropertyEqual(r,o,i,a){return!("_owner"!==a&&"__o"!==a&&"__v"!==a||!r.$$typeof&&!o.$$typeof)||u(o,a)&&i.equals(r[a],o[a],a,a,r,o,i)}const b={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},k=Object.prototype.toString;function createEqualityComparator({areArrayBuffersEqual:r,areArraysEqual:o,areDataViewsEqual:i,areDatesEqual:a,areErrorsEqual:c,areFunctionsEqual:u,areMapsEqual:p,areNumbersEqual:g,areObjectsEqual:v,arePrimitiveWrappersEqual:E,areRegExpsEqual:w,areSetsEqual:x,areTypedArraysEqual:C,areUrlsEqual:_,unknownTagComparators:T}){return function comparator(P,A,N){if(P===A)return!0;if(null==P||null==A)return!1;const R=typeof P;if(R!==typeof A)return!1;if("object"!==R)return"number"===R?g(P,A,N):"function"===R&&u(P,A,N);const I=P.constructor;if(I!==A.constructor)return!1;if(I===Object)return v(P,A,N);if(Array.isArray(P))return o(P,A,N);if(I===Date)return a(P,A,N);if(I===RegExp)return w(P,A,N);if(I===Map)return p(P,A,N);if(I===Set)return x(P,A,N);const L=k.call(P);if("[object Date]"===L)return a(P,A,N);if("[object RegExp]"===L)return w(P,A,N);if("[object Map]"===L)return p(P,A,N);if("[object Set]"===L)return x(P,A,N);if("[object Object]"===L)return"function"!=typeof P.then&&"function"!=typeof A.then&&v(P,A,N);if("[object URL]"===L)return _(P,A,N);if("[object Error]"===L)return c(P,A,N);if("[object Arguments]"===L)return v(P,A,N);if(b[L])return C(P,A,N);if("[object ArrayBuffer]"===L)return r(P,A,N);if("[object DataView]"===L)return i(P,A,N);if("[object Boolean]"===L||"[object Number]"===L||"[object String]"===L)return E(P,A,N);if(T){let r=T[L];if(!r){const o=function getShortTag(r){return null!=r?r[Symbol.toStringTag]:void 0}(P);o&&(r=T[o])}if(r)return r(P,A,N)}return!1}}const E=createCustomEqual(),w=createCustomEqual({strict:!0}),x=createCustomEqual({circular:!0}),C=createCustomEqual({circular:!0,strict:!0}),_=createCustomEqual({createInternalComparator:()=>sameValueZeroEqual}),T=createCustomEqual({strict:!0,createInternalComparator:()=>sameValueZeroEqual}),P=createCustomEqual({circular:!0,createInternalComparator:()=>sameValueZeroEqual}),A=createCustomEqual({circular:!0,createInternalComparator:()=>sameValueZeroEqual,strict:!0});function createCustomEqual(r={}){const{circular:o=!1,createInternalComparator:i,createState:a,strict:c=!1}=r,u=function createEqualityComparatorConfig({circular:r,createCustomConfig:o,strict:i}){let a={areArrayBuffersEqual:areArrayBuffersEqual,areArraysEqual:i?areObjectsEqualStrict:areArraysEqual,areDataViewsEqual:areDataViewsEqual,areDatesEqual:areDatesEqual,areErrorsEqual:areErrorsEqual,areFunctionsEqual:areFunctionsEqual,areMapsEqual:i?combineComparators(areMapsEqual,areObjectsEqualStrict):areMapsEqual,areNumbersEqual:v,areObjectsEqual:i?areObjectsEqualStrict:areObjectsEqual,arePrimitiveWrappersEqual:arePrimitiveWrappersEqual,areRegExpsEqual:areRegExpsEqual,areSetsEqual:i?combineComparators(areSetsEqual,areObjectsEqualStrict):areSetsEqual,areTypedArraysEqual:i?combineComparators(areTypedArraysEqual,areObjectsEqualStrict):areTypedArraysEqual,areUrlsEqual:areUrlsEqual,unknownTagComparators:void 0};if(o&&(a=Object.assign({},a,o(a))),r){const r=createIsCircular(a.areArraysEqual),o=createIsCircular(a.areMapsEqual),i=createIsCircular(a.areObjectsEqual),c=createIsCircular(a.areSetsEqual);a=Object.assign({},a,{areArraysEqual:r,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:c})}return a}(r),p=createEqualityComparator(u);return function createIsEqual({circular:r,comparator:o,createState:i,equals:a,strict:c}){if(i)return function isEqual(u,p){const{cache:g=(r?new WeakMap:void 0),meta:v}=i();return o(u,p,{cache:g,equals:a,meta:v,strict:c})};if(r)return function isEqual(r,i){return o(r,i,{cache:new WeakMap,equals:a,meta:void 0,strict:c})};const u={cache:void 0,equals:a,meta:void 0,strict:c};return function isEqual(r,i){return o(r,i,u)}}({circular:o,comparator:p,createState:a,equals:i?i(p):function createInternalEqualityComparator(r){return function(o,i,a,c,u,p,g){return r(o,i,g)}}(p),strict:c})}o.circularDeepEqual=x,o.circularShallowEqual=P,o.createCustomEqual=createCustomEqual,o.deepEqual=E,o.sameValueZeroEqual=sameValueZeroEqual,o.shallowEqual=_,o.strictCircularDeepEqual=C,o.strictCircularShallowEqual=A,o.strictDeepEqual=w,o.strictShallowEqual=T},43617:function(r){"use strict";r.exports=window.ReactDOM},45643:function(r){"use strict";r.exports=window.elementorV2.query},46400:function(r){"use strict";r.exports=window.elementorV2.editorCurrentUser},49162:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(37820))},49454:function(r,o,i){"use strict";function _slicedToArray(r,o){return function _arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function _iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||_unsupportedIterableToArray(r,o)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(r,o){var i="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=_unsupportedIterableToArray(r))||o&&r&&"number"==typeof r.length){i&&(r=i);var a=0,c=function F(){};return{s:c,n:function n(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function e(r){throw r},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,p=!0,g=!1;return{s:function s(){i=i.call(r)},n:function n(){var r=i.next();return p=r.done,r},e:function e(r){g=!0,u=r},f:function f(){try{p||null==i.return||i.return()}finally{if(g)throw u}}}}function _unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return _arrayLikeToArray(r,o);var i=Object.prototype.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(r,o):void 0}}function _arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=new Array(o);i<o;i++)a[i]=r[i];return a}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(r,o,i){var a=function _superPropBase(r,o){for(;!Object.prototype.hasOwnProperty.call(r,o)&&null!==(r=_getPrototypeOf(r)););return r}(r,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(arguments.length<3?r:i):c.value}},_get.apply(this,arguments)}function _inherits(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),o&&_setPrototypeOf(r,o)}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _createSuper(r){var o=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}();return function _createSuperInternal(){var i,a=_getPrototypeOf(r);if(o){var c=_getPrototypeOf(this).constructor;i=Reflect.construct(a,arguments,c)}else i=a.apply(this,arguments);return function _possibleConstructorReturn(r,o){if(o&&("object"===_typeof(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(r)}(this,i)}}function _assertThisInitialized(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,_toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _toPropertyKey(r){var o=function _toPrimitive(r,o){if("object"!==_typeof(r)||null===r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"===_typeof(o)?o:String(o)}var a=i(37820),c=i(77712),u=i(36553),p=function domIndex(r){for(var o=0;;o++)if(!(r=r.previousSibling))return o},g=function parentNode(r){var o=r.assignedSlot||r.parentNode;return o&&11==o.nodeType?o.host:o},v=null,b=function textRange(r,o,i){var a=v||(v=document.createRange());return a.setEnd(r,null==i?r.nodeValue.length:i),a.setStart(r,o||0),a},k=function isEquivalentPosition(r,o,i,a){return i&&(scanFor(r,o,i,a,-1)||scanFor(r,o,i,a,1))},E=/^(img|br|input|textarea|hr)$/i;function scanFor(r,o,i,a,c){for(var u;;){if(r==i&&o==a)return!0;if(o==(c<0?0:nodeSize(r))){var g=r.parentNode;if(!g||1!=g.nodeType||hasBlockDesc(r)||E.test(r.nodeName)||"false"==r.contentEditable)return!1;o=p(r)+(c<0?0:1),r=g}else{if(1!=r.nodeType)return!1;var v=r.childNodes[o+(c<0?-1:0)];if(1==v.nodeType&&"false"==v.contentEditable){if(!(null===(u=v.pmViewDesc)||void 0===u?void 0:u.ignoreForSelection))return!1;o+=c}else r=v,o=c<0?nodeSize(r):0}}}function nodeSize(r){return 3==r.nodeType?r.nodeValue.length:r.childNodes.length}function hasBlockDesc(r){for(var o,i=r;i&&!(o=i.pmViewDesc);i=i.parentNode);return o&&o.node&&o.node.isBlock&&(o.dom==r||o.contentDOM==r)}var w=function selectionCollapsed(r){return r.focusNode&&k(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function keyEvent(r,o){var i=document.createEvent("Event");return i.initEvent("keydown",!0,!0),i.keyCode=r,i.key=i.code=o,i}var x="undefined"!=typeof navigator?navigator:null,C="undefined"!=typeof document?document:null,_=x&&x.userAgent||"",T=/Edge\/(\d+)/.exec(_),P=/MSIE \d/.exec(_),A=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(_),N=!!(P||A||T),R=P?document.documentMode:A?+A[1]:T?+T[1]:0,I=!N&&/gecko\/(\d+)/i.test(_);I&&(/Firefox\/(\d+)/.exec(_)||[0,0])[1];var L=!N&&/Chrome\/(\d+)/.exec(_),z=!!L,j=L?+L[1]:0,B=!N&&!!x&&/Apple Computer/.test(x.vendor),V=B&&(/Mobile\/\w+/.test(_)||!!x&&x.maxTouchPoints>2),U=V||!!x&&/Mac/.test(x.platform),H=!!x&&/Win/.test(x.platform),W=/Android \d/.test(_),K=!!C&&"webkitFontSmoothing"in C.documentElement.style,G=K?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function windowRect(r){var o=r.defaultView&&r.defaultView.visualViewport;return o?{left:0,right:o.width,top:0,bottom:o.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function getSide(r,o){return"number"==typeof r?r:r[o]}function clientRect(r){var o=r.getBoundingClientRect(),i=o.width/r.offsetWidth||1,a=o.height/r.offsetHeight||1;return{left:o.left,right:o.left+r.clientWidth*i,top:o.top,bottom:o.top+r.clientHeight*a}}function scrollRectIntoView(r,o,i){for(var a=r.someProp("scrollThreshold")||0,c=r.someProp("scrollMargin")||5,u=r.dom.ownerDocument,p=i||r.dom;p;)if(1==p.nodeType){var v=p,b=v==u.body,k=b?windowRect(u):clientRect(v),E=0,w=0;if(o.top<k.top+getSide(a,"top")?w=-(k.top-o.top+getSide(c,"top")):o.bottom>k.bottom-getSide(a,"bottom")&&(w=o.bottom-o.top>k.bottom-k.top?o.top+getSide(c,"top")-k.top:o.bottom-k.bottom+getSide(c,"bottom")),o.left<k.left+getSide(a,"left")?E=-(k.left-o.left+getSide(c,"left")):o.right>k.right-getSide(a,"right")&&(E=o.right-k.right+getSide(c,"right")),E||w)if(b)u.defaultView.scrollBy(E,w);else{var x=v.scrollLeft,C=v.scrollTop;w&&(v.scrollTop+=w),E&&(v.scrollLeft+=E);var _=v.scrollLeft-x,T=v.scrollTop-C;o={left:o.left-_,top:o.top-T,right:o.right-_,bottom:o.bottom-T}}var P=b?"fixed":getComputedStyle(p).position;if(/^(fixed|sticky)$/.test(P))break;p="absolute"==P?p.offsetParent:g(p)}else p=g(p)}function scrollStack(r){for(var o=[],i=r.ownerDocument,a=r;a&&(o.push({dom:a,top:a.scrollTop,left:a.scrollLeft}),r!=i);a=g(a));return o}function restoreScrollStack(r,o){for(var i=0;i<r.length;i++){var a=r[i],c=a.dom,u=a.top,p=a.left;c.scrollTop!=u+o&&(c.scrollTop=u+o),c.scrollLeft!=p&&(c.scrollLeft=p)}}var J=null;function findOffsetInNode(r,o){for(var i,a,c,u,p=2e8,g=0,v=o.top,k=o.top,E=r.firstChild,w=0;E;E=E.nextSibling,w++){var x=void 0;if(1==E.nodeType)x=E.getClientRects();else{if(3!=E.nodeType)continue;x=b(E).getClientRects()}for(var C=0;C<x.length;C++){var _=x[C];if(_.top<=v&&_.bottom>=k){v=Math.max(_.bottom,v),k=Math.min(_.top,k);var T=_.left>o.left?_.left-o.left:_.right<o.left?o.left-_.right:0;if(T<p){i=E,p=T,a=T&&3==i.nodeType?{left:_.right<o.left?_.right:_.left,top:o.top}:o,1==E.nodeType&&T&&(g=w+(o.left>=(_.left+_.right)/2?1:0));continue}}else _.top>o.top&&!c&&_.left<=o.left&&_.right>=o.left&&(c=E,u={left:Math.max(_.left,Math.min(_.right,o.left)),top:_.top});!i&&(o.left>=_.right&&o.top>=_.top||o.left>=_.left&&o.top>=_.bottom)&&(g=w+1)}}return!i&&c&&(i=c,a=u,p=0),i&&3==i.nodeType?function findOffsetInText(r,o){for(var i,a=r.nodeValue.length,c=document.createRange(),u=0;u<a;u++){c.setEnd(r,u+1),c.setStart(r,u);var p=singleRect(c,1);if(p.top!=p.bottom&&inRect(o,p)){i={node:r,offset:u+(o.left>=(p.left+p.right)/2?1:0)};break}}return c.detach(),i||{node:r,offset:0}}(i,a):!i||p&&1==i.nodeType?{node:r,offset:g}:findOffsetInNode(i,a)}function inRect(r,o){return r.left>=o.left-1&&r.left<=o.right+1&&r.top>=o.top-1&&r.top<=o.bottom+1}function elementFromPoint(r,o,i){var a=r.childNodes.length;if(a&&i.top<i.bottom)for(var c=Math.max(0,Math.min(a-1,Math.floor(a*(o.top-i.top)/(i.bottom-i.top))-2)),u=c;;){var p=r.childNodes[u];if(1==p.nodeType)for(var g=p.getClientRects(),v=0;v<g.length;v++){var b=g[v];if(inRect(o,b))return elementFromPoint(p,o,b)}if((u=(u+1)%a)==c)break}return r}function _posAtCoords(r,o){var i,a=r.dom.ownerDocument,c=0,u=function caretFromPoint(r,o,i){if(r.caretPositionFromPoint)try{var a=r.caretPositionFromPoint(o,i);if(a)return{node:a.offsetNode,offset:Math.min(nodeSize(a.offsetNode),a.offset)}}catch(r){}if(r.caretRangeFromPoint){var c=r.caretRangeFromPoint(o,i);if(c)return{node:c.startContainer,offset:Math.min(nodeSize(c.startContainer),c.startOffset)}}}(a,o.left,o.top);u&&(i=u.node,c=u.offset);var p,v=(r.root.elementFromPoint?r.root:a).elementFromPoint(o.left,o.top);if(!v||!r.dom.contains(1!=v.nodeType?v.parentNode:v)){var b=r.dom.getBoundingClientRect();if(!inRect(o,b))return null;if(!(v=elementFromPoint(r.dom,o,b)))return null}if(B)for(var k=v;i&&k;k=g(k))k.draggable&&(i=void 0);if(v=function targetKludge(r,o){var i=r.parentNode;return i&&/^li$/i.test(i.nodeName)&&o.left<r.getBoundingClientRect().left?i:r}(v,o),i){if(I&&1==i.nodeType&&(c=Math.min(c,i.childNodes.length))<i.childNodes.length){var E,w=i.childNodes[c];"IMG"==w.nodeName&&(E=w.getBoundingClientRect()).right<=o.left&&E.bottom>o.top&&c++}var x;K&&c&&1==i.nodeType&&1==(x=i.childNodes[c-1]).nodeType&&"false"==x.contentEditable&&x.getBoundingClientRect().top>=o.top&&c--,i==r.dom&&c==i.childNodes.length-1&&1==i.lastChild.nodeType&&o.top>i.lastChild.getBoundingClientRect().bottom?p=r.state.doc.content.size:0!=c&&1==i.nodeType&&"BR"==i.childNodes[c-1].nodeName||(p=function posFromCaret(r,o,i,a){for(var c=-1,u=o,p=!1;u!=r.dom;){var g=r.docView.nearestDesc(u,!0),v=void 0;if(!g)return null;if(1==g.dom.nodeType&&(g.node.isBlock&&g.parent||!g.contentDOM)&&((v=g.dom.getBoundingClientRect()).width||v.height)&&(g.node.isBlock&&g.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(g.dom.nodeName)&&(!p&&v.left>a.left||v.top>a.top?c=g.posBefore:(!p&&v.right<a.left||v.bottom<a.top)&&(c=g.posAfter),p=!0),!g.contentDOM&&c<0&&!g.node.isText))return(g.node.isBlock?a.top<(v.top+v.bottom)/2:a.left<(v.left+v.right)/2)?g.posBefore:g.posAfter;u=g.dom.parentNode}return c>-1?c:r.docView.posFromDOM(o,i,-1)}(r,i,c,o))}null==p&&(p=function posFromElement(r,o,i){var a=findOffsetInNode(o,i),c=a.node,u=a.offset,p=-1;if(1==c.nodeType&&!c.firstChild){var g=c.getBoundingClientRect();p=g.left!=g.right&&i.left>(g.left+g.right)/2?1:-1}return r.docView.posFromDOM(c,u,p)}(r,v,o));var C=r.docView.nearestDesc(v,!0);return{pos:p,inside:C?C.posAtStart-C.border:-1}}function nonZero(r){return r.top<r.bottom||r.left<r.right}function singleRect(r,o){var i=r.getClientRects();if(i.length){var a=i[o<0?0:i.length-1];if(nonZero(a))return a}return Array.prototype.find.call(i,nonZero)||r.getBoundingClientRect()}var Y=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _coordsAtPos(r,o,i){var a=r.docView.domFromPos(o,i<0?-1:1),c=a.node,u=a.offset,p=a.atom,g=K||I;if(3==c.nodeType){if(!g||!Y.test(c.nodeValue)&&(i<0?u:u!=c.nodeValue.length)){var v=u,k=u,E=i<0?1:-1;return i<0&&!u?(k++,E=-1):i>=0&&u==c.nodeValue.length?(v--,E=1):i<0?v--:k++,flattenV(singleRect(b(c,v,k),E),E<0)}var w=singleRect(b(c,u,u),i);if(I&&u&&/\s/.test(c.nodeValue[u-1])&&u<c.nodeValue.length){var x=singleRect(b(c,u-1,u-1),-1);if(x.top==w.top){var C=singleRect(b(c,u,u+1),-1);if(C.top!=w.top)return flattenV(C,C.left<x.left)}}return w}if(!r.state.doc.resolve(o-(p||0)).parent.inlineContent){if(null==p&&u&&(i<0||u==nodeSize(c))){var _=c.childNodes[u-1];if(1==_.nodeType)return flattenH(_.getBoundingClientRect(),!1)}if(null==p&&u<nodeSize(c)){var T=c.childNodes[u];if(1==T.nodeType)return flattenH(T.getBoundingClientRect(),!0)}return flattenH(c.getBoundingClientRect(),i>=0)}if(null==p&&u&&(i<0||u==nodeSize(c))){var P=c.childNodes[u-1],A=3==P.nodeType?b(P,nodeSize(P)-(g?0:1)):1!=P.nodeType||"BR"==P.nodeName&&P.nextSibling?null:P;if(A)return flattenV(singleRect(A,1),!1)}if(null==p&&u<nodeSize(c)){for(var N=c.childNodes[u];N.pmViewDesc&&N.pmViewDesc.ignoreForCoords;)N=N.nextSibling;var R=N?3==N.nodeType?b(N,0,g?0:1):1==N.nodeType?N:null:null;if(R)return flattenV(singleRect(R,-1),!0)}return flattenV(singleRect(3==c.nodeType?b(c):c,-i),i>=0)}function flattenV(r,o){if(0==r.width)return r;var i=o?r.left:r.right;return{top:r.top,bottom:r.bottom,left:i,right:i}}function flattenH(r,o){if(0==r.height)return r;var i=o?r.top:r.bottom;return{top:i,bottom:i,left:r.left,right:r.right}}function withFlushedState(r,o,i){var a=r.state,c=r.root.activeElement;a!=o&&r.updateState(o),c!=r.dom&&r.focus();try{return i()}finally{a!=o&&r.updateState(a),c!=r.dom&&c&&c.focus()}}var X=/[\u0590-\u08ac]/;var Q=null,Z=null,ee=!1;function _endOfTextblock(r,o,i){return Q==o&&Z==i?ee:(Q=o,Z=i,ee="up"==i||"down"==i?function endOfTextblockVertical(r,o,i){var a=o.selection,c="up"==i?a.$from:a.$to;return withFlushedState(r,o,function(){for(var o=r.docView.domFromPos(c.pos,"up"==i?-1:1).node;;){var a=r.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}for(var u=_coordsAtPos(r,c.pos,1),p=o.firstChild;p;p=p.nextSibling){var g=void 0;if(1==p.nodeType)g=p.getClientRects();else{if(3!=p.nodeType)continue;g=b(p,0,p.nodeValue.length).getClientRects()}for(var v=0;v<g.length;v++){var k=g[v];if(k.bottom>k.top+1&&("up"==i?u.top-k.top>2*(k.bottom-u.top):k.bottom-u.bottom>2*(u.bottom-k.top)))return!1}}return!0})}(r,o,i):function endOfTextblockHorizontal(r,o,i){var a=o.selection.$head;if(!a.parent.isTextblock)return!1;var c=a.parentOffset,u=!c,p=c==a.parent.content.size,g=r.domSelection();return g?X.test(a.parent.textContent)&&g.modify?withFlushedState(r,o,function(){var o=r.domSelectionRange(),c=o.focusNode,u=o.focusOffset,p=o.anchorNode,v=o.anchorOffset,b=g.caretBidiLevel;g.modify("move",i,"character");var k=a.depth?r.docView.domAfterPos(a.before()):r.dom,E=r.domSelectionRange(),w=E.focusNode,x=E.focusOffset,C=w&&!k.contains(1==w.nodeType?w:w.parentNode)||c==w&&u==x;try{g.collapse(p,v),c&&(c!=p||u!=v)&&g.extend&&g.extend(c,u)}catch(r){}return null!=b&&(g.caretBidiLevel=b),C}):"left"==i||"backward"==i?u:p:a.pos==a.start()||a.pos==a.end()}(r,o,i))}var te=function(){function ViewDesc(r,o,i,a){_classCallCheck(this,ViewDesc),this.parent=r,this.children=o,this.dom=i,this.contentDOM=a,this.dirty=0,i.pmViewDesc=this}return _createClass(ViewDesc,[{key:"matchesWidget",value:function matchesWidget(r){return!1}},{key:"matchesMark",value:function matchesMark(r){return!1}},{key:"matchesNode",value:function matchesNode(r,o,i){return!1}},{key:"matchesHack",value:function matchesHack(r){return!1}},{key:"parseRule",value:function parseRule(){return null}},{key:"stopEvent",value:function stopEvent(r){return!1}},{key:"size",get:function get(){for(var r=0,o=0;o<this.children.length;o++)r+=this.children[o].size;return r}},{key:"border",get:function get(){return 0}},{key:"destroy",value:function destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var r=0;r<this.children.length;r++)this.children[r].destroy()}},{key:"posBeforeChild",value:function posBeforeChild(r){for(var o=0,i=this.posAtStart;;o++){var a=this.children[o];if(a==r)return i;i+=a.size}}},{key:"posBefore",get:function get(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function get(){return this.posBefore+this.size}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function localPosFromDOM(r,o,i){if(this.contentDOM&&this.contentDOM.contains(1==r.nodeType?r:r.parentNode)){if(i<0){var a,c;if(r==this.contentDOM)a=r.childNodes[o-1];else{for(;r.parentNode!=this.contentDOM;)r=r.parentNode;a=r.previousSibling}for(;a&&(!(c=a.pmViewDesc)||c.parent!=this);)a=a.previousSibling;return a?this.posBeforeChild(c)+c.size:this.posAtStart}var u,g;if(r==this.contentDOM)u=r.childNodes[o];else{for(;r.parentNode!=this.contentDOM;)r=r.parentNode;u=r.nextSibling}for(;u&&(!(g=u.pmViewDesc)||g.parent!=this);)u=u.nextSibling;return u?this.posBeforeChild(g):this.posAtEnd}var v;if(r==this.dom&&this.contentDOM)v=o>p(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))v=2&r.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==o)for(var b=r;;b=b.parentNode){if(b==this.dom){v=!1;break}if(b.previousSibling)break}if(null==v&&o==r.childNodes.length)for(var k=r;;k=k.parentNode){if(k==this.dom){v=!0;break}if(k.nextSibling)break}}return(null==v?i>0:v)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function nearestDesc(r){for(var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!0,a=r;a;a=a.parentNode){var c=this.getDesc(a),u=void 0;if(c&&(!o||c.node)){if(!i||!(u=c.nodeDOM)||(1==u.nodeType?u.contains(1==r.nodeType?r:r.parentNode):u==r))return c;i=!1}}}},{key:"getDesc",value:function getDesc(r){for(var o=r.pmViewDesc,i=o;i;i=i.parent)if(i==this)return o}},{key:"posFromDOM",value:function posFromDOM(r,o,i){for(var a=r;a;a=a.parentNode){var c=this.getDesc(a);if(c)return c.localPosFromDOM(r,o,i)}return-1}},{key:"descAt",value:function descAt(r){for(var o=0,i=0;o<this.children.length;o++){var a=this.children[o],c=i+a.size;if(i==r&&c!=i){for(;!a.border&&a.children.length;)for(var u=0;u<a.children.length;u++){var p=a.children[u];if(p.size){a=p;break}}return a}if(r<c)return a.descAt(r-i-a.border);i=c}}},{key:"domFromPos",value:function domFromPos(r,o){if(!this.contentDOM)return{node:this.dom,offset:0,atom:r+1};for(var i,a=0,c=0,u=0;a<this.children.length;a++){var g=this.children[a],v=u+g.size;if(v>r||g instanceof se){c=r-u;break}u=v}if(c)return this.children[a].domFromPos(c-this.children[a].border,o);for(;a&&!(i=this.children[a-1]).size&&i instanceof ne&&i.side>=0;a--);if(o<=0){for(var b,k=!0;(b=a?this.children[a-1]:null)&&b.dom.parentNode!=this.contentDOM;a--,k=!1);return b&&o&&k&&!b.border&&!b.domAtom?b.domFromPos(b.size,o):{node:this.contentDOM,offset:b?p(b.dom)+1:0}}for(var E,w=!0;(E=a<this.children.length?this.children[a]:null)&&E.dom.parentNode!=this.contentDOM;a++,w=!1);return E&&w&&!E.border&&!E.domAtom?E.domFromPos(0,o):{node:this.contentDOM,offset:E?p(E.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function parseRange(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:r,to:o,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var a=-1,c=-1,u=i,g=0;;g++){var v=this.children[g],b=u+v.size;if(-1==a&&r<=b){var k=u+v.border;if(r>=k&&o<=b-v.border&&v.node&&v.contentDOM&&this.contentDOM.contains(v.contentDOM))return v.parseRange(r,o,k);r=u;for(var E=g;E>0;E--){var w=this.children[E-1];if(w.size&&w.dom.parentNode==this.contentDOM&&!w.emptyChildAt(1)){a=p(w.dom)+1;break}r-=w.size}-1==a&&(a=0)}if(a>-1&&(b>o||g==this.children.length-1)){o=b;for(var x=g+1;x<this.children.length;x++){var C=this.children[x];if(C.size&&C.dom.parentNode==this.contentDOM&&!C.emptyChildAt(-1)){c=p(C.dom);break}o+=C.size}-1==c&&(c=this.contentDOM.childNodes.length);break}u=b}return{node:this.contentDOM,from:r,to:o,fromOffset:a,toOffset:c}}},{key:"emptyChildAt",value:function emptyChildAt(r){if(this.border||!this.contentDOM||!this.children.length)return!1;var o=this.children[r<0?0:this.children.length-1];return 0==o.size||o.emptyChildAt(r)}},{key:"domAfterPos",value:function domAfterPos(r){var o=this.domFromPos(r,0),i=o.node,a=o.offset;if(1!=i.nodeType||a==i.childNodes.length)throw new RangeError("No node after pos "+r);return i.childNodes[a]}},{key:"setSelection",value:function setSelection(r,o,i){for(var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=Math.min(r,o),u=Math.max(r,o),g=0,v=0;g<this.children.length;g++){var b=this.children[g],E=v+b.size;if(c>v&&u<E)return b.setSelection(r-v-b.border,o-v-b.border,i,a);v=E}var w=this.domFromPos(r,r?-1:1),x=o==r?w:this.domFromPos(o,o?-1:1),C=i.root.getSelection(),_=i.domSelectionRange(),T=!1;if((I||B)&&r==o){var P=w,A=P.node,N=P.offset;if(3==A.nodeType){if((T=!(!N||"\n"!=A.nodeValue[N-1]))&&N==A.nodeValue.length)for(var R,L=A;L;L=L.parentNode){if(R=L.nextSibling){"BR"==R.nodeName&&(w=x={node:R.parentNode,offset:p(R)+1});break}var z=L.pmViewDesc;if(z&&z.node&&z.node.isBlock)break}}else{var j=A.childNodes[N-1];T=j&&("BR"==j.nodeName||"false"==j.contentEditable)}}if(I&&_.focusNode&&_.focusNode!=x.node&&1==_.focusNode.nodeType){var V=_.focusNode.childNodes[_.focusOffset];V&&"false"==V.contentEditable&&(a=!0)}if(a||T&&B||!k(w.node,w.offset,_.anchorNode,_.anchorOffset)||!k(x.node,x.offset,_.focusNode,_.focusOffset)){var U=!1;if((C.extend||r==o)&&(!T||!I)){C.collapse(w.node,w.offset);try{r!=o&&C.extend(x.node,x.offset),U=!0}catch(r){}}if(!U){if(r>o){var H=w;w=x,x=H}var W=document.createRange();W.setEnd(x.node,x.offset),W.setStart(w.node,w.offset),C.removeAllRanges(),C.addRange(W)}}}},{key:"ignoreMutation",value:function ignoreMutation(r){return!this.contentDOM&&"selection"!=r.type}},{key:"contentLost",get:function get(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function markDirty(r,o){for(var i=0,a=0;a<this.children.length;a++){var c=this.children[a],u=i+c.size;if(i==u?r<=u&&o>=i:r<u&&o>i){var p=i+c.border,g=u-c.border;if(r>=p&&o<=g)return this.dirty=r==i||o==u?2:1,void(r!=p||o!=g||!c.contentLost&&c.dom.parentNode==this.contentDOM?c.markDirty(r-p,o-p):c.dirty=3);c.dirty=c.dom!=c.contentDOM||c.dom.parentNode!=this.contentDOM||c.children.length?3:2}i=u}this.dirty=2}},{key:"markParentsDirty",value:function markParentsDirty(){for(var r=1,o=this.parent;o;o=o.parent,r++){var i=1==r?2:1;o.dirty<i&&(o.dirty=i)}}},{key:"domAtom",get:function get(){return!1}},{key:"ignoreForCoords",get:function get(){return!1}},{key:"ignoreForSelection",get:function get(){return!1}},{key:"isText",value:function isText(r){return!1}}]),ViewDesc}(),ne=function(r){_inherits(WidgetViewDesc,r);var o=_createSuper(WidgetViewDesc);function WidgetViewDesc(r,i,a,c){var u;_classCallCheck(this,WidgetViewDesc);var p,g=i.type.toDOM;if("function"==typeof g&&(g=g(a,function(){return p?p.parent?p.parent.posBeforeChild(p):void 0:c})),!i.type.spec.raw){if(1!=g.nodeType){var v=document.createElement("span");v.appendChild(g),g=v}g.contentEditable="false",g.classList.add("ProseMirror-widget")}return(u=o.call(this,r,[],g,null)).widget=i,u.widget=i,p=_assertThisInitialized(u),u}return _createClass(WidgetViewDesc,[{key:"matchesWidget",value:function matchesWidget(r){return 0==this.dirty&&r.type.eq(this.widget.type)}},{key:"parseRule",value:function parseRule(){return{ignore:!0}}},{key:"stopEvent",value:function stopEvent(r){var o=this.widget.spec.stopEvent;return!!o&&o(r)}},{key:"ignoreMutation",value:function ignoreMutation(r){return"selection"!=r.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function destroy(){this.widget.type.destroy(this.dom),_get(_getPrototypeOf(WidgetViewDesc.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function get(){return!0}},{key:"ignoreForSelection",get:function get(){return!!this.widget.type.spec.relaxedSide}},{key:"side",get:function get(){return this.widget.type.side}}]),WidgetViewDesc}(te),re=function(r){_inherits(CompositionViewDesc,r);var o=_createSuper(CompositionViewDesc);function CompositionViewDesc(r,i,a,c){var u;return _classCallCheck(this,CompositionViewDesc),(u=o.call(this,r,[],i,null)).textDOM=a,u.text=c,u}return _createClass(CompositionViewDesc,[{key:"size",get:function get(){return this.text.length}},{key:"localPosFromDOM",value:function localPosFromDOM(r,o){return r!=this.textDOM?this.posAtStart+(o?this.size:0):this.posAtStart+o}},{key:"domFromPos",value:function domFromPos(r){return{node:this.textDOM,offset:r}}},{key:"ignoreMutation",value:function ignoreMutation(r){return"characterData"===r.type&&r.target.nodeValue==r.oldValue}}]),CompositionViewDesc}(te),oe=function(r){_inherits(MarkViewDesc,r);var o=_createSuper(MarkViewDesc);function MarkViewDesc(r,i,a,c,u){var p;return _classCallCheck(this,MarkViewDesc),(p=o.call(this,r,[],a,c)).mark=i,p.spec=u,p}return _createClass(MarkViewDesc,[{key:"parseRule",value:function parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}},{key:"matchesMark",value:function matchesMark(r){return 3!=this.dirty&&this.mark.eq(r)}},{key:"markDirty",value:function markDirty(r,o){if(_get(_getPrototypeOf(MarkViewDesc.prototype),"markDirty",this).call(this,r,o),0!=this.dirty){for(var i=this.parent;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function slice(r,o,i){var a=MarkViewDesc.create(this.parent,this.mark,!0,i),c=this.children,u=this.size;o<u&&(c=replaceNodes(c,o,u,i)),r>0&&(c=replaceNodes(c,0,r,i));for(var p=0;p<c.length;p++)c[p].parent=a;return a.children=c,a}},{key:"ignoreMutation",value:function ignoreMutation(r){return this.spec.ignoreMutation?this.spec.ignoreMutation(r):_get(_getPrototypeOf(MarkViewDesc.prototype),"ignoreMutation",this).call(this,r)}},{key:"destroy",value:function destroy(){this.spec.destroy&&this.spec.destroy(),_get(_getPrototypeOf(MarkViewDesc.prototype),"destroy",this).call(this)}}],[{key:"create",value:function create(r,o,i,a){var u=a.nodeViews[o.type.name],p=u&&u(o,a,i);return p&&p.dom||(p=c.DOMSerializer.renderSpec(document,o.type.spec.toDOM(o,i),null,o.attrs)),new MarkViewDesc(r,o,p.dom,p.contentDOM||p.dom,p)}}]),MarkViewDesc}(te),ie=function(r){_inherits(NodeViewDesc,r);var o=_createSuper(NodeViewDesc);function NodeViewDesc(r,i,a,c,u,p,g,v,b){var k;return _classCallCheck(this,NodeViewDesc),(k=o.call(this,r,[],u,p)).node=i,k.outerDeco=a,k.innerDeco=c,k.nodeDOM=g,k}return _createClass(NodeViewDesc,[{key:"parseRule",value:function parseRule(){var r=this;if(this.node.type.spec.reparseInView)return null;var o={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(o.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var i=this.children.length-1;i>=0;i--){var a=this.children[i];if(this.dom.contains(a.dom.parentNode)){o.contentElement=a.dom.parentNode;break}}o.contentElement||(o.getContent=function(){return c.Fragment.empty})}else o.contentElement=this.contentDOM;else o.getContent=function(){return r.node.content};return o}},{key:"matchesNode",value:function matchesNode(r,o,i){return 0==this.dirty&&r.eq(this.node)&&sameOuterDeco(o,this.outerDeco)&&i.eq(this.innerDeco)}},{key:"size",get:function get(){return this.node.nodeSize}},{key:"border",get:function get(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function updateChildren(r,o){var i=this,a=this.node.inlineContent,u=o,p=r.composing?this.localCompositionInfo(r,o):null,g=p&&p.pos>-1?p:null,v=p&&p.pos<0,b=new pe(this,g&&g.node,r);!function iterDeco(r,o,i,a){var c=o.locals(r),u=0;if(0==c.length){for(var p=0;p<r.childCount;p++){var g=r.child(p);a(g,c,o.forChild(u,g),p),u+=g.nodeSize}return}for(var v=0,b=[],k=null,E=0;;){for(var w=void 0,x=void 0;v<c.length&&c[v].to==u;){var C=c[v++];C.widget&&(w?(x||(x=[w])).push(C):w=C)}if(w)if(x){x.sort(compareSide);for(var _=0;_<x.length;_++)i(x[_],E,!!k)}else i(w,E,!!k);var T=void 0,P=void 0;if(k)P=-1,T=k,k=null;else{if(!(E<r.childCount))break;P=E,T=r.child(E++)}for(var A=0;A<b.length;A++)b[A].to<=u&&b.splice(A--,1);for(;v<c.length&&c[v].from<=u&&c[v].to>u;)b.push(c[v++]);var N=u+T.nodeSize;if(T.isText){var R=N;v<c.length&&c[v].from<R&&(R=c[v].from);for(var I=0;I<b.length;I++)b[I].to<R&&(R=b[I].to);R<N&&(k=T.cut(R-u),T=T.cut(0,R-u),N=R,P=-1)}else for(;v<c.length&&c[v].to<N;)v++;a(T,T.isInline&&!T.isLeaf?b.filter(function(r){return!r.inline}):b.slice(),o.forChild(u,T),P),u=N}}(this.node,this.innerDeco,function(o,p,g){o.spec.marks?b.syncToMarks(o.spec.marks,a,r,p):o.type.side>=0&&!g&&b.syncToMarks(p==i.node.childCount?c.Mark.none:i.node.child(p).marks,a,r,p),b.placeWidget(o,r,u)},function(o,i,c,g){var k;b.syncToMarks(o.marks,a,r,g),b.findNodeMatch(o,i,c,g)||v&&r.state.selection.from>u&&r.state.selection.to<u+o.nodeSize&&(k=b.findIndexWithChild(p.node))>-1&&b.updateNodeAt(o,i,c,k,r)||b.updateNextNode(o,i,c,r,g,u)||b.addNode(o,i,c,r,u),u+=o.nodeSize}),b.syncToMarks([],a,r,0),this.node.isTextblock&&b.addTextblockHacks(),b.destroyRest(),(b.changed||2==this.dirty)&&(g&&this.protectLocalComposition(r,g),renderDescs(this.contentDOM,this.children,r),V&&function iosHacks(r){if("UL"==r.nodeName||"OL"==r.nodeName){var o=r.style.cssText;r.style.cssText=o+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=o}}(this.dom))}},{key:"localCompositionInfo",value:function localCompositionInfo(r,o){var i=r.state.selection,c=i.from,u=i.to;if(!(r.state.selection instanceof a.TextSelection)||c<o||u>o+this.node.content.size)return null;var p=r.input.compositionNode;if(!p||!this.dom.contains(p.parentNode))return null;if(this.node.inlineContent){var g=p.nodeValue,v=function findTextInFragment(r,o,i,a){for(var c=0,u=0;c<r.childCount&&u<=a;){var p=r.child(c++),g=u;if(u+=p.nodeSize,p.isText){for(var v=p.text;c<r.childCount;){var b=r.child(c++);if(u+=b.nodeSize,!b.isText)break;v+=b.text}if(u>=i){if(u>=a&&v.slice(a-o.length-g,a-g)==o)return a-o.length;var k=g<a?v.lastIndexOf(o,a-g-1):-1;if(k>=0&&k+o.length+g>=i)return g+k;if(i==a&&v.length>=a+o.length-g&&v.slice(a-g,a-g+o.length)==o)return a}}}return-1}(this.node.content,g,c-o,u-o);return v<0?null:{node:p,pos:v,text:g}}return{node:p,pos:-1,text:""}}},{key:"protectLocalComposition",value:function protectLocalComposition(r,o){var i=o.node,a=o.pos,c=o.text;if(!this.getDesc(i)){for(var u=i;u.parentNode!=this.contentDOM;u=u.parentNode){for(;u.previousSibling;)u.parentNode.removeChild(u.previousSibling);for(;u.nextSibling;)u.parentNode.removeChild(u.nextSibling);u.pmViewDesc&&(u.pmViewDesc=void 0)}var p=new re(this,u,i,c);r.input.compositionNodes.push(p),this.children=replaceNodes(this.children,a,a+c.length,r,p)}}},{key:"update",value:function update(r,o,i,a){return!(3==this.dirty||!r.sameMarkup(this.node))&&(this.updateInner(r,o,i,a),!0)}},{key:"updateInner",value:function updateInner(r,o,i,a){this.updateOuterDeco(o),this.node=r,this.innerDeco=i,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function updateOuterDeco(r){if(!sameOuterDeco(r,this.outerDeco)){var o=1!=this.nodeDOM.nodeType,i=this.dom;this.dom=patchOuterDeco(this.dom,this.nodeDOM,computeOuterDeco(this.outerDeco,this.node,o),computeOuterDeco(r,this.node,o)),this.dom!=i&&(i.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=r}}},{key:"selectNode",value:function selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}},{key:"deselectNode",value:function deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}},{key:"domAtom",get:function get(){return this.node.isAtom}}],[{key:"create",value:function create(r,o,i,a,u,p){var g,v=u.nodeViews[o.type.name],b=v&&v(o,u,function(){return g?g.parent?g.parent.posBeforeChild(g):void 0:p},i,a),k=b&&b.dom,E=b&&b.contentDOM;if(o.isText)if(k){if(3!=k.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else k=document.createTextNode(o.text);else if(!k){var w=c.DOMSerializer.renderSpec(document,o.type.spec.toDOM(o),null,o.attrs);k=w.dom,E=w.contentDOM}E||o.isText||"BR"==k.nodeName||(k.hasAttribute("contenteditable")||(k.contentEditable="false"),o.type.spec.draggable&&(k.draggable=!0));var x=k;return k=applyOuterDeco(k,i,o),b?g=new le(r,o,i,a,k,E||null,x,b,u,p+1):o.isText?new ae(r,o,i,a,k,x,u):new NodeViewDesc(r,o,i,a,k,E||null,x,u,p+1)}}]),NodeViewDesc}(te);function docViewDesc(r,o,i,a,c){applyOuterDeco(a,o,r);var u=new ie(void 0,r,o,i,a,a,a,c,0);return u.contentDOM&&u.updateChildren(c,0),u}var ae=function(r){_inherits(TextViewDesc,r);var o=_createSuper(TextViewDesc);function TextViewDesc(r,i,a,c,u,p,g){return _classCallCheck(this,TextViewDesc),o.call(this,r,i,a,c,u,null,p,g,0)}return _createClass(TextViewDesc,[{key:"parseRule",value:function parseRule(){for(var r=this.nodeDOM.parentNode;r&&r!=this.dom&&!r.pmIsDeco;)r=r.parentNode;return{skip:r||!0}}},{key:"update",value:function update(r,o,i,a){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!r.sameMarkup(this.node))&&(this.updateOuterDeco(o),0==this.dirty&&r.text==this.node.text||r.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=r.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=r,this.dirty=0,!0)}},{key:"inParent",value:function inParent(){for(var r=this.parent.contentDOM,o=this.nodeDOM;o;o=o.parentNode)if(o==r)return!0;return!1}},{key:"domFromPos",value:function domFromPos(r){return{node:this.nodeDOM,offset:r}}},{key:"localPosFromDOM",value:function localPosFromDOM(r,o,i){return r==this.nodeDOM?this.posAtStart+Math.min(o,this.node.text.length):_get(_getPrototypeOf(TextViewDesc.prototype),"localPosFromDOM",this).call(this,r,o,i)}},{key:"ignoreMutation",value:function ignoreMutation(r){return"characterData"!=r.type&&"selection"!=r.type}},{key:"slice",value:function slice(r,o,i){var a=this.node.cut(r,o),c=document.createTextNode(a.text);return new TextViewDesc(this.parent,a,this.outerDeco,this.innerDeco,c,c,i)}},{key:"markDirty",value:function markDirty(r,o){_get(_getPrototypeOf(TextViewDesc.prototype),"markDirty",this).call(this,r,o),this.dom==this.nodeDOM||0!=r&&o!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function get(){return!1}},{key:"isText",value:function isText(r){return this.node.text==r}}]),TextViewDesc}(ie),se=function(r){_inherits(TrailingHackViewDesc,r);var o=_createSuper(TrailingHackViewDesc);function TrailingHackViewDesc(){return _classCallCheck(this,TrailingHackViewDesc),o.apply(this,arguments)}return _createClass(TrailingHackViewDesc,[{key:"parseRule",value:function parseRule(){return{ignore:!0}}},{key:"matchesHack",value:function matchesHack(r){return 0==this.dirty&&this.dom.nodeName==r}},{key:"domAtom",get:function get(){return!0}},{key:"ignoreForCoords",get:function get(){return"IMG"==this.dom.nodeName}}]),TrailingHackViewDesc}(te),le=function(r){_inherits(CustomNodeViewDesc,r);var o=_createSuper(CustomNodeViewDesc);function CustomNodeViewDesc(r,i,a,c,u,p,g,v,b,k){var E;return _classCallCheck(this,CustomNodeViewDesc),(E=o.call(this,r,i,a,c,u,p,g,b,k)).spec=v,E}return _createClass(CustomNodeViewDesc,[{key:"update",value:function update(r,o,i,a){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==r.type||this.spec.multiType)){var c=this.spec.update(r,o,i);return c&&this.updateInner(r,o,i,a),c}return!(!this.contentDOM&&!r.isLeaf)&&_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"update",this).call(this,r,o,i,a)}},{key:"selectNode",value:function selectNode(){this.spec.selectNode?this.spec.selectNode():_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function deselectNode(){this.spec.deselectNode?this.spec.deselectNode():_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function setSelection(r,o,i,a){this.spec.setSelection?this.spec.setSelection(r,o,i.root):_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"setSelection",this).call(this,r,o,i,a)}},{key:"destroy",value:function destroy(){this.spec.destroy&&this.spec.destroy(),_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function stopEvent(r){return!!this.spec.stopEvent&&this.spec.stopEvent(r)}},{key:"ignoreMutation",value:function ignoreMutation(r){return this.spec.ignoreMutation?this.spec.ignoreMutation(r):_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"ignoreMutation",this).call(this,r)}}]),CustomNodeViewDesc}(ie);function renderDescs(r,o,i){for(var a=r.firstChild,c=!1,u=0;u<o.length;u++){var p=o[u],g=p.dom;if(g.parentNode==r){for(;g!=a;)a=rm(a),c=!0;a=a.nextSibling}else c=!0,r.insertBefore(g,a);if(p instanceof oe){var v=a?a.previousSibling:r.lastChild;renderDescs(p.contentDOM,p.children,i),a=v?v.nextSibling:r.firstChild}}for(;a;)a=rm(a),c=!0;c&&i.trackWrites==r&&(i.trackWrites=null)}var ce=function OuterDecoLevel(r){r&&(this.nodeName=r)};ce.prototype=Object.create(null);var ue=[new ce];function computeOuterDeco(r,o,i){if(0==r.length)return ue;for(var a=i?ue[0]:new ce,c=[a],u=0;u<r.length;u++){var p=r[u].type.attrs;if(p)for(var g in p.nodeName&&c.push(a=new ce(p.nodeName)),p){var v=p[g];null!=v&&(i&&1==c.length&&c.push(a=new ce(o.isInline?"span":"div")),"class"==g?a.class=(a.class?a.class+" ":"")+v:"style"==g?a.style=(a.style?a.style+";":"")+v:"nodeName"!=g&&(a[g]=v))}}return c}function patchOuterDeco(r,o,i,a){if(i==ue&&a==ue)return o;for(var c=o,u=0;u<a.length;u++){var p=a[u],g=i[u];if(u){var v=void 0;g&&g.nodeName==p.nodeName&&c!=r&&(v=c.parentNode)&&v.nodeName.toLowerCase()==p.nodeName||((v=document.createElement(p.nodeName)).pmIsDeco=!0,v.appendChild(c),g=ue[0]),c=v}patchAttributes(c,g||ue[0],p)}return c}function patchAttributes(r,o,i){for(var a in o)"class"==a||"style"==a||"nodeName"==a||a in i||r.removeAttribute(a);for(var c in i)"class"!=c&&"style"!=c&&"nodeName"!=c&&i[c]!=o[c]&&r.setAttribute(c,i[c]);if(o.class!=i.class){for(var u=o.class?o.class.split(" ").filter(Boolean):[],p=i.class?i.class.split(" ").filter(Boolean):[],g=0;g<u.length;g++)-1==p.indexOf(u[g])&&r.classList.remove(u[g]);for(var v=0;v<p.length;v++)-1==u.indexOf(p[v])&&r.classList.add(p[v]);0==r.classList.length&&r.removeAttribute("class")}if(o.style!=i.style){if(o.style)for(var b,k=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;b=k.exec(o.style);)r.style.removeProperty(b[1]);i.style&&(r.style.cssText+=i.style)}}function applyOuterDeco(r,o,i){return patchOuterDeco(r,r,ue,computeOuterDeco(o,i,1!=r.nodeType))}function sameOuterDeco(r,o){if(r.length!=o.length)return!1;for(var i=0;i<r.length;i++)if(!r[i].type.eq(o[i].type))return!1;return!0}function rm(r){var o=r.nextSibling;return r.parentNode.removeChild(r),o}var pe=function(){function ViewTreeUpdater(r,o,i){_classCallCheck(this,ViewTreeUpdater),this.lock=o,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=r,this.preMatch=function preMatch(r,o){var i=o,a=i.children.length,c=r.childCount,u=new Map,p=[];e:for(;c>0;){for(var g=void 0;;)if(a){var v=i.children[a-1];if(!(v instanceof oe)){g=v,a--;break}i=v,a=v.children.length}else{if(i==o)break e;a=i.parent.children.indexOf(i),i=i.parent}var b=g.node;if(b){if(b!=r.child(c-1))break;--c,u.set(g,c),p.push(g)}}return{index:c,matched:u,matches:p.reverse()}}(r.node.content,r)}return _createClass(ViewTreeUpdater,[{key:"destroyBetween",value:function destroyBetween(r,o){if(r!=o){for(var i=r;i<o;i++)this.top.children[i].destroy();this.top.children.splice(r,o-r),this.changed=!0}}},{key:"destroyRest",value:function destroyRest(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function syncToMarks(r,o,i,a){for(var c=0,u=this.stack.length>>1,p=Math.min(u,r.length);c<p&&(c==u-1?this.top:this.stack[c+1<<1]).matchesMark(r[c])&&!1!==r[c].type.spec.spanning;)c++;for(;c<u;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),u--;for(;u<r.length;){this.stack.push(this.top,this.index+1);var g=-1,v=this.top.children.length;a<this.preMatch.index&&(v=Math.min(this.index+3,v));for(var b=this.index;b<v;b++){var k=this.top.children[b];if(k.matchesMark(r[u])&&!this.isLocked(k.dom)){g=b;break}}if(g>-1)g>this.index&&(this.changed=!0,this.destroyBetween(this.index,g)),this.top=this.top.children[this.index];else{var E=oe.create(this.top,r[u],o,i);this.top.children.splice(this.index,0,E),this.top=E,this.changed=!0}this.index=0,u++}}},{key:"findNodeMatch",value:function findNodeMatch(r,o,i,a){var c,u=-1;if(a>=this.preMatch.index&&(c=this.preMatch.matches[a-this.preMatch.index]).parent==this.top&&c.matchesNode(r,o,i))u=this.top.children.indexOf(c,this.index);else for(var p=this.index,g=Math.min(this.top.children.length,p+5);p<g;p++){var v=this.top.children[p];if(v.matchesNode(r,o,i)&&!this.preMatch.matched.has(v)){u=p;break}}return!(u<0)&&(this.destroyBetween(this.index,u),this.index++,!0)}},{key:"updateNodeAt",value:function updateNodeAt(r,o,i,a,c){var u=this.top.children[a];return 3==u.dirty&&u.dom==u.contentDOM&&(u.dirty=2),!!u.update(r,o,i,c)&&(this.destroyBetween(this.index,a),this.index++,!0)}},{key:"findIndexWithChild",value:function findIndexWithChild(r){for(;;){var o=r.parentNode;if(!o)return-1;if(o==this.top.contentDOM){var i=r.pmViewDesc;if(i)for(var a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==i)return a;return-1}r=o}}},{key:"updateNextNode",value:function updateNextNode(r,o,i,a,c,u){for(var p=this.index;p<this.top.children.length;p++){var g=this.top.children[p];if(g instanceof ie){var v=this.preMatch.matched.get(g);if(null!=v&&v!=c)return!1;var b=g.dom,k=void 0,E=this.isLocked(b)&&!(r.isText&&g.node&&g.node.isText&&g.nodeDOM.nodeValue==r.text&&3!=g.dirty&&sameOuterDeco(o,g.outerDeco));if(!E&&g.update(r,o,i,a))return this.destroyBetween(this.index,p),g.dom!=b&&(this.changed=!0),this.index++,!0;if(!E&&(k=this.recreateWrapper(g,r,o,i,a,u)))return this.destroyBetween(this.index,p),this.top.children[this.index]=k,k.contentDOM&&(k.dirty=2,k.updateChildren(a,u+1),k.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}},{key:"recreateWrapper",value:function recreateWrapper(r,o,i,a,c,u){if(r.dirty||o.isAtom||!r.children.length||!r.node.content.eq(o.content)||!sameOuterDeco(i,r.outerDeco)||!a.eq(r.innerDeco))return null;var p=ie.create(this.top,o,i,a,c,u);if(p.contentDOM){p.children=r.children,r.children=[];var g,v=_createForOfIteratorHelper(p.children);try{for(v.s();!(g=v.n()).done;){g.value.parent=p}}catch(r){v.e(r)}finally{v.f()}}return r.destroy(),p}},{key:"addNode",value:function addNode(r,o,i,a,c){var u=ie.create(this.top,r,o,i,a,c);u.contentDOM&&u.updateChildren(a,c+1),this.top.children.splice(this.index++,0,u),this.changed=!0}},{key:"placeWidget",value:function placeWidget(r,o,i){var a=this.index<this.top.children.length?this.top.children[this.index]:null;if(!a||!a.matchesWidget(r)||r!=a.widget&&a.widget.type.toDOM.parentNode){var c=new ne(this.top,r,o,i);this.top.children.splice(this.index++,0,c),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function addTextblockHacks(){for(var r=this.top.children[this.index-1],o=this.top;r instanceof oe;)r=(o=r).children[o.children.length-1];(!r||!(r instanceof ae)||/\n$/.test(r.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(r.node.text))&&((B||z)&&r&&"false"==r.dom.contentEditable&&this.addHackNode("IMG",o),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function addHackNode(r,o){if(o==this.top&&this.index<o.children.length&&o.children[this.index].matchesHack(r))this.index++;else{var i=document.createElement(r);"IMG"==r&&(i.className="ProseMirror-separator",i.alt=""),"BR"==r&&(i.className="ProseMirror-trailingBreak");var a=new se(this.top,[],i,null);o!=this.top?o.children.push(a):o.children.splice(this.index++,0,a),this.changed=!0}}},{key:"isLocked",value:function isLocked(r){return this.lock&&(r==this.lock||1==r.nodeType&&r.contains(this.lock.parentNode))}}]),ViewTreeUpdater}();function compareSide(r,o){return r.type.side-o.type.side}function replaceNodes(r,o,i,a,c){for(var u=[],p=0,g=0;p<r.length;p++){var v=r[p],b=g,k=g+=v.size;b>=i||k<=o?u.push(v):(b<o&&u.push(v.slice(0,o-b,a)),c&&(u.push(c),c=void 0),k>i&&u.push(v.slice(i-b,v.size,a)))}return u}function selectionFromDOM(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=r.domSelectionRange(),c=r.state.doc;if(!i.focusNode)return null;var u=r.docView.nearestDesc(i.focusNode),g=u&&0==u.size,v=r.docView.posFromDOM(i.focusNode,i.focusOffset,1);if(v<0)return null;var b,k,E=c.resolve(v);if(w(i)){for(b=v;u&&!u.node;)u=u.parent;var x=u.node;if(u&&x.isAtom&&a.NodeSelection.isSelectable(x)&&u.parent&&(!x.isInline||!function isOnEdge(r,o,i){for(var a=0==o,c=o==nodeSize(r);a||c;){if(r==i)return!0;var u=p(r);if(!(r=r.parentNode))return!1;a=a&&0==u,c=c&&u==nodeSize(r)}}(i.focusNode,i.focusOffset,u.dom))){var C=u.posBefore;k=new a.NodeSelection(v==C?E:c.resolve(C))}}else{if(i instanceof r.dom.ownerDocument.defaultView.Selection&&i.rangeCount>1){for(var _=v,T=v,P=0;P<i.rangeCount;P++){var A=i.getRangeAt(P);_=Math.min(_,r.docView.posFromDOM(A.startContainer,A.startOffset,1)),T=Math.max(T,r.docView.posFromDOM(A.endContainer,A.endOffset,-1))}if(_<0)return null;var N=_slicedToArray(T==r.state.selection.anchor?[T,_]:[_,T],2);b=N[0],v=N[1],E=c.resolve(v)}else b=r.docView.posFromDOM(i.anchorNode,i.anchorOffset,1);if(b<0)return null}var R=c.resolve(b);k||(k=selectionBetween(r,R,E,"pointer"==o||r.state.selection.head<E.pos&&!g?1:-1));return k}function editorOwnsSelection(r){return r.editable?r.hasFocus():hasSelection(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function selectionToDOM(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=r.state.selection;if(syncNodeSelection(r,i),editorOwnsSelection(r)){if(!o&&r.input.mouseDown&&r.input.mouseDown.allowDefault&&z){var c=r.domSelectionRange(),u=r.domObserver.currentSelection;if(c.anchorNode&&u.anchorNode&&k(c.anchorNode,c.anchorOffset,u.anchorNode,u.anchorOffset))return r.input.mouseDown.delayedSelectionSync=!0,void r.domObserver.setCurSelection()}if(r.domObserver.disconnectSelection(),r.cursorWrapper)!function selectCursorWrapper(r){var o=r.domSelection();if(!o)return;var i=r.cursorWrapper.dom,a="IMG"==i.nodeName;a?o.collapse(i.parentNode,p(i)+1):o.collapse(i,0);!a&&!r.state.selection.visible&&N&&R<=11&&(i.disabled=!0,i.disabled=!1)}(r);else{var g,v,b=i.anchor,E=i.head;!de||i instanceof a.TextSelection||(i.$from.parent.inlineContent||(g=temporarilyEditableNear(r,i.from)),i.empty||i.$from.parent.inlineContent||(v=temporarilyEditableNear(r,i.to))),r.docView.setSelection(b,E,r,o),de&&(g&&resetEditable(g),v&&resetEditable(v)),i.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function removeClassOnSelectionChange(r){var o=r.dom.ownerDocument;o.removeEventListener("selectionchange",r.input.hideSelectionGuard);var i=r.domSelectionRange(),a=i.anchorNode,c=i.anchorOffset;o.addEventListener("selectionchange",r.input.hideSelectionGuard=function(){i.anchorNode==a&&i.anchorOffset==c||(o.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(function(){editorOwnsSelection(r)&&!r.state.selection.visible||r.dom.classList.remove("ProseMirror-hideselection")},20))})}(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}}var de=B||z&&j<63;function temporarilyEditableNear(r,o){var i=r.docView.domFromPos(o,0),a=i.node,c=i.offset,u=c<a.childNodes.length?a.childNodes[c]:null,p=c?a.childNodes[c-1]:null;if(B&&u&&"false"==u.contentEditable)return setEditable(u);if(!(u&&"false"!=u.contentEditable||p&&"false"!=p.contentEditable)){if(u)return setEditable(u);if(p)return setEditable(p)}}function setEditable(r){return r.contentEditable="true",B&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function resetEditable(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function syncNodeSelection(r,o){if(o instanceof a.NodeSelection){var i=r.docView.descAt(o.from);i!=r.lastSelectedViewDesc&&(clearNodeSelection(r),i&&i.selectNode(),r.lastSelectedViewDesc=i)}else clearNodeSelection(r)}function clearNodeSelection(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function selectionBetween(r,o,i,c){return r.someProp("createSelectionBetween",function(a){return a(r,o,i)})||a.TextSelection.between(o,i,c)}function hasFocusAndSelection(r){return!(r.editable&&!r.hasFocus())&&hasSelection(r)}function hasSelection(r){var o=r.domSelectionRange();if(!o.anchorNode)return!1;try{return r.dom.contains(3==o.anchorNode.nodeType?o.anchorNode.parentNode:o.anchorNode)&&(r.editable||r.dom.contains(3==o.focusNode.nodeType?o.focusNode.parentNode:o.focusNode))}catch(r){return!1}}function moveSelectionBlock(r,o){var i=r.selection,c=i.$anchor,u=i.$head,p=o>0?c.max(u):c.min(u),g=p.parent.inlineContent?p.depth?r.doc.resolve(o>0?p.after():p.before()):null:p;return g&&a.Selection.findFrom(g,o)}function apply(r,o){return r.dispatch(r.state.tr.setSelection(o).scrollIntoView()),!0}function selectHorizontally(r,o,i){var c=r.state.selection;if(!(c instanceof a.TextSelection)){if(c instanceof a.NodeSelection&&c.node.isInline)return apply(r,new a.TextSelection(o>0?c.$to:c.$from));var u=moveSelectionBlock(r.state,o);return!!u&&apply(r,u)}if(i.indexOf("s")>-1){var p=c.$head,g=p.textOffset?null:o<0?p.nodeBefore:p.nodeAfter;if(!g||g.isText||!g.isLeaf)return!1;var v=r.state.doc.resolve(p.pos+g.nodeSize*(o<0?-1:1));return apply(r,new a.TextSelection(c.$anchor,v))}if(!c.empty)return!1;if(r.endOfTextblock(o>0?"forward":"backward")){var b=moveSelectionBlock(r.state,o);return!!(b&&b instanceof a.NodeSelection)&&apply(r,b)}if(!(U&&i.indexOf("m")>-1)){var k,E=c.$head,w=E.textOffset?null:o<0?E.nodeBefore:E.nodeAfter;if(!w||w.isText)return!1;var x=o<0?E.pos-w.nodeSize:E.pos;return!!(w.isAtom||(k=r.docView.descAt(x))&&!k.contentDOM)&&(a.NodeSelection.isSelectable(w)?apply(r,new a.NodeSelection(o<0?r.state.doc.resolve(E.pos-w.nodeSize):E)):!!K&&apply(r,new a.TextSelection(r.state.doc.resolve(o<0?x:x+w.nodeSize))))}}function nodeLen(r){return 3==r.nodeType?r.nodeValue.length:r.childNodes.length}function isIgnorable(r,o){var i=r.pmViewDesc;return i&&0==i.size&&(o<0||r.nextSibling||"BR"!=r.nodeName)}function skipIgnoredNodes(r,o){return o<0?function skipIgnoredNodesBefore(r){var o=r.domSelectionRange(),i=o.focusNode,a=o.focusOffset;if(!i)return;var c,u,g=!1;I&&1==i.nodeType&&a<nodeLen(i)&&isIgnorable(i.childNodes[a],-1)&&(g=!0);for(;;)if(a>0){if(1!=i.nodeType)break;var v=i.childNodes[a-1];if(isIgnorable(v,-1))c=i,u=--a;else{if(3!=v.nodeType)break;a=(i=v).nodeValue.length}}else{if(isBlockNode(i))break;for(var b=i.previousSibling;b&&isIgnorable(b,-1);)c=i.parentNode,u=p(b),b=b.previousSibling;if(b)a=nodeLen(i=b);else{if((i=i.parentNode)==r.dom)break;a=0}}g?setSelFocus(r,i,a):c&&setSelFocus(r,c,u)}(r):function skipIgnoredNodesAfter(r){var o=r.domSelectionRange(),i=o.focusNode,a=o.focusOffset;if(!i)return;for(var c,u,g=nodeLen(i);;)if(a<g){if(1!=i.nodeType)break;if(!isIgnorable(i.childNodes[a],1))break;c=i,u=++a}else{if(isBlockNode(i))break;for(var v=i.nextSibling;v&&isIgnorable(v,1);)c=v.parentNode,u=p(v)+1,v=v.nextSibling;if(v)a=0,g=nodeLen(i=v);else{if((i=i.parentNode)==r.dom)break;a=g=0}}c&&setSelFocus(r,c,u)}(r)}function isBlockNode(r){var o=r.pmViewDesc;return o&&o.node&&o.node.isBlock}function setSelFocus(r,o,i){var a,c;3!=o.nodeType&&((c=function textNodeAfter(r,o){for(;r&&o==r.childNodes.length&&!hasBlockDesc(r);)o=p(r)+1,r=r.parentNode;for(;r&&o<r.childNodes.length;){var i=r.childNodes[o];if(3==i.nodeType)return i;if(1==i.nodeType&&"false"==i.contentEditable)break;r=i,o=0}}(o,i))?(o=c,i=0):(a=function textNodeBefore(r,o){for(;r&&!o&&!hasBlockDesc(r);)o=p(r),r=r.parentNode;for(;r&&o;){var i=r.childNodes[o-1];if(3==i.nodeType)return i;if(1==i.nodeType&&"false"==i.contentEditable)break;o=(r=i).childNodes.length}}(o,i))&&(o=a,i=a.nodeValue.length));var u=r.domSelection();if(u){if(w(u)){var g=document.createRange();g.setEnd(o,i),g.setStart(o,i),u.removeAllRanges(),u.addRange(g)}else u.extend&&u.extend(o,i);r.domObserver.setCurSelection();var v=r.state;setTimeout(function(){r.state==v&&selectionToDOM(r)},50)}}function findDirection(r,o){var i=r.state.doc.resolve(o);if(!z&&!H&&i.parent.inlineContent){var a=r.coordsAtPos(o);if(o>i.start()){var c=r.coordsAtPos(o-1),u=(c.top+c.bottom)/2;if(u>a.top&&u<a.bottom&&Math.abs(c.left-a.left)>1)return c.left<a.left?"ltr":"rtl"}if(o<i.end()){var p=r.coordsAtPos(o+1),g=(p.top+p.bottom)/2;if(g>a.top&&g<a.bottom&&Math.abs(p.left-a.left)>1)return p.left>a.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(r.dom).direction?"rtl":"ltr"}function selectVertically(r,o,i){var c=r.state.selection;if(c instanceof a.TextSelection&&!c.empty||i.indexOf("s")>-1)return!1;if(U&&i.indexOf("m")>-1)return!1;var u=c.$from,p=c.$to;if(!u.parent.inlineContent||r.endOfTextblock(o<0?"up":"down")){var g=moveSelectionBlock(r.state,o);if(g&&g instanceof a.NodeSelection)return apply(r,g)}if(!u.parent.inlineContent){var v=o<0?u:p,b=c instanceof a.AllSelection?a.Selection.near(v,o):a.Selection.findFrom(v,o);return!!b&&apply(r,b)}return!1}function stopNativeHorizontalDelete(r,o){if(!(r.state.selection instanceof a.TextSelection))return!0;var i=r.state.selection,c=i.$head,u=i.$anchor,p=i.empty;if(!c.sameParent(u))return!0;if(!p)return!1;if(r.endOfTextblock(o>0?"forward":"backward"))return!0;var g=!c.textOffset&&(o<0?c.nodeBefore:c.nodeAfter);if(g&&!g.isText){var v=r.state.tr;return o<0?v.delete(c.pos-g.nodeSize,c.pos):v.delete(c.pos,c.pos+g.nodeSize),r.dispatch(v),!0}return!1}function switchEditable(r,o,i){r.domObserver.stop(),o.contentEditable=i,r.domObserver.start()}function captureKeyDown(r,o){var i=o.keyCode,a=function getMods(r){var o="";return r.ctrlKey&&(o+="c"),r.metaKey&&(o+="m"),r.altKey&&(o+="a"),r.shiftKey&&(o+="s"),o}(o);if(8==i||U&&72==i&&"c"==a)return stopNativeHorizontalDelete(r,-1)||skipIgnoredNodes(r,-1);if(46==i&&!o.shiftKey||U&&68==i&&"c"==a)return stopNativeHorizontalDelete(r,1)||skipIgnoredNodes(r,1);if(13==i||27==i)return!0;if(37==i||U&&66==i&&"c"==a){var c=37==i?"ltr"==findDirection(r,r.state.selection.from)?-1:1:-1;return selectHorizontally(r,c,a)||skipIgnoredNodes(r,c)}if(39==i||U&&70==i&&"c"==a){var u=39==i?"ltr"==findDirection(r,r.state.selection.from)?1:-1:1;return selectHorizontally(r,u,a)||skipIgnoredNodes(r,u)}return 38==i||U&&80==i&&"c"==a?selectVertically(r,-1,a)||skipIgnoredNodes(r,-1):40==i||U&&78==i&&"c"==a?function safariDownArrowBug(r){if(!B||r.state.selection.$head.parentOffset>0)return!1;var o=r.domSelectionRange(),i=o.focusNode,a=o.focusOffset;if(i&&1==i.nodeType&&0==a&&i.firstChild&&"false"==i.firstChild.contentEditable){var c=i.firstChild;switchEditable(r,c,"true"),setTimeout(function(){return switchEditable(r,c,"false")},20)}return!1}(r)||selectVertically(r,1,a)||skipIgnoredNodes(r,1):a==(U?"m":"c")&&(66==i||73==i||89==i||90==i)}function _serializeForClipboard(r,o){r.someProp("transformCopied",function(i){o=i(o,r)});for(var i=[],a=o,u=a.content,p=a.openStart,g=a.openEnd;p>1&&g>1&&1==u.childCount&&1==u.firstChild.childCount;){p--,g--;var v=u.firstChild;i.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),u=v.content}var b=r.someProp("clipboardSerializer")||c.DOMSerializer.fromSchema(r.state.schema),k=detachedDoc(),E=k.createElement("div");E.appendChild(b.serializeFragment(u,{document:k}));for(var w,x=E.firstChild,C=0;x&&1==x.nodeType&&(w=he[x.nodeName.toLowerCase()]);){for(var _=w.length-1;_>=0;_--){for(var T=k.createElement(w[_]);E.firstChild;)T.appendChild(E.firstChild);E.appendChild(T),C++}x=E.firstChild}return x&&1==x.nodeType&&x.setAttribute("data-pm-slice","".concat(p," ").concat(g).concat(C?" -".concat(C):""," ").concat(JSON.stringify(i))),{dom:E,text:r.someProp("clipboardTextSerializer",function(i){return i(o,r)})||o.content.textBetween(0,o.content.size,"\n\n"),slice:o}}function parseFromClipboard(r,o,i,a,u){var p,g,v=u.parent.type.spec.code;if(!i&&!o)return null;var b=!!o&&(a||v||!i);if(b){if(r.someProp("transformPastedText",function(i){o=i(o,v||a,r)}),v)return g=new c.Slice(c.Fragment.from(r.state.schema.text(o.replace(/\r\n?/g,"\n"))),0,0),r.someProp("transformPasted",function(o){g=o(g,r,!0)}),g;var k=r.someProp("clipboardTextParser",function(i){return i(o,u,a,r)});if(k)g=k;else{var E=u.marks(),w=r.state.schema,x=c.DOMSerializer.fromSchema(w);p=document.createElement("div"),o.split(/(?:\r\n?|\n)+/).forEach(function(r){var o=p.appendChild(document.createElement("p"));r&&o.appendChild(x.serializeNode(w.text(r,E)))})}}else r.someProp("transformPastedHTML",function(o){i=o(i,r)}),p=function readHTML(r){var o=/^(\s*<meta [^>]*>)*/.exec(r);o&&(r=r.slice(o[0].length));var i,a=detachedDoc().createElement("div"),c=/<([a-z][^>\s]+)/i.exec(r);(i=c&&he[c[1].toLowerCase()])&&(r=i.map(function(r){return"<"+r+">"}).join("")+r+i.map(function(r){return"</"+r+">"}).reverse().join(""));if(a.innerHTML=function maybeWrapTrusted(r){var o=window.trustedTypes;if(!o)return r;ge||(ge=o.defaultPolicy||o.createPolicy("ProseMirrorClipboard",{createHTML:function createHTML(r){return r}}));return ge.createHTML(r)}(r),i)for(var u=0;u<i.length;u++)a=a.querySelector(i[u])||a;return a}(i),K&&function restoreReplacedSpaces(r){for(var o=r.querySelectorAll(z?"span:not([class]):not([style])":"span.Apple-converted-space"),i=0;i<o.length;i++){var a=o[i];1==a.childNodes.length&&" "==a.textContent&&a.parentNode&&a.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),a)}}(p);var C=p&&p.querySelector("[data-pm-slice]"),_=C&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(C.getAttribute("data-pm-slice")||"");if(_&&_[3])for(var T=+_[3];T>0;T--){for(var P=p.firstChild;P&&1!=P.nodeType;)P=P.nextSibling;if(!P)break;p=P}if(!g){var A=r.someProp("clipboardParser")||r.someProp("domParser")||c.DOMParser.fromSchema(r.state.schema);g=A.parseSlice(p,{preserveWhitespace:!(!b&&!_),context:u,ruleFromNode:function ruleFromNode(r){return"BR"!=r.nodeName||r.nextSibling||!r.parentNode||fe.test(r.parentNode.nodeName)?null:{ignore:!0}}})}if(_)g=function addContext(r,o){if(!r.size)return r;var i,a=r.content.firstChild.type.schema;try{i=JSON.parse(o)}catch(o){return r}for(var u=r.content,p=r.openStart,g=r.openEnd,v=i.length-2;v>=0;v-=2){var b=a.nodes[i[v]];if(!b||b.hasRequiredAttrs())break;u=c.Fragment.from(b.create(i[v+1],u)),p++,g++}return new c.Slice(u,p,g)}(closeSlice(g,+_[1],+_[2]),_[4]);else if(g=c.Slice.maxOpen(function normalizeSiblings(r,o){if(r.childCount<2)return r;for(var i,a=function _loop(){var i,a=o.node(u).contentMatchAt(o.index(u)),p=[];if(r.forEach(function(r){if(p){var o,c=a.findWrapping(r.type);if(!c)return p=null;if(o=p.length&&i.length&&addToSibling(c,i,r,p[p.length-1],0))p[p.length-1]=o;else{p.length&&(p[p.length-1]=closeRight(p[p.length-1],i.length));var u=withWrappers(r,c);p.push(u),a=a.matchType(u.type),i=c}}}),p)return{v:c.Fragment.from(p)}},u=o.depth;u>=0;u--)if(i=a())return i.v;return r}(g.content,u),!0),g.openStart||g.openEnd){for(var N=0,R=0,I=g.content.firstChild;N<g.openStart&&!I.type.spec.isolating;N++,I=I.firstChild);for(var L=g.content.lastChild;R<g.openEnd&&!L.type.spec.isolating;R++,L=L.lastChild);g=closeSlice(g,N,R)}return r.someProp("transformPasted",function(o){g=o(g,r,b)}),g}var fe=/^(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 withWrappers(r,o){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=o.length-1;a>=i;a--)r=o[a].create(null,c.Fragment.from(r));return r}function addToSibling(r,o,i,a,u){if(u<r.length&&u<o.length&&r[u]==o[u]){var p=addToSibling(r,o,i,a.lastChild,u+1);if(p)return a.copy(a.content.replaceChild(a.childCount-1,p));if(a.contentMatchAt(a.childCount).matchType(u==r.length-1?i.type:r[u+1]))return a.copy(a.content.append(c.Fragment.from(withWrappers(i,r,u+1))))}}function closeRight(r,o){if(0==o)return r;var i=r.content.replaceChild(r.childCount-1,closeRight(r.lastChild,o-1)),a=r.contentMatchAt(r.childCount).fillBefore(c.Fragment.empty,!0);return r.copy(i.append(a))}function closeRange(r,o,i,a,u,p){var g=o<0?r.firstChild:r.lastChild,v=g.content;return r.childCount>1&&(p=0),u<a-1&&(v=closeRange(v,o,i,a,u+1,p)),u>=i&&(v=o<0?g.contentMatchAt(0).fillBefore(v,p<=u).append(v):v.append(g.contentMatchAt(g.childCount).fillBefore(c.Fragment.empty,!0))),r.replaceChild(o<0?0:r.childCount-1,g.copy(v))}function closeSlice(r,o,i){return o<r.openStart&&(r=new c.Slice(closeRange(r.content,-1,o,r.openStart,0,r.openEnd),o,r.openEnd)),i<r.openEnd&&(r=new c.Slice(closeRange(r.content,1,i,r.openEnd,0,0),r.openStart,i)),r}var he={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},me=null;function detachedDoc(){return me||(me=document.implementation.createHTMLDocument("title"))}var ge=null;var ve={},ye={},be={touchstart:!0,touchmove:!0},ke=_createClass(function InputState(){_classCallCheck(this,InputState),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null});function setSelectionOrigin(r,o){r.input.lastSelectionOrigin=o,r.input.lastSelectionTime=Date.now()}function ensureListeners(r){r.someProp("handleDOMEvents",function(o){for(var i in o)r.input.eventHandlers[i]||r.dom.addEventListener(i,r.input.eventHandlers[i]=function(o){return runCustomHandler(r,o)})})}function runCustomHandler(r,o){return r.someProp("handleDOMEvents",function(i){var a=i[o.type];return!!a&&(a(r,o)||o.defaultPrevented)})}function eventCoords(r){return{left:r.clientX,top:r.clientY}}function runHandlerOnContext(r,o,i,a,c){if(-1==a)return!1;for(var u,p=r.state.doc.resolve(a),g=function _loop3(a){if(r.someProp(o,function(o){return a>p.depth?o(r,i,p.nodeAfter,p.before(a),c,!0):o(r,i,p.node(a),p.before(a),c,!1)}))return{v:!0}},v=p.depth+1;v>0;v--)if(u=g(v))return u.v;return!1}function updateSelection(r,o,i){if(r.focused||r.focus(),!r.state.selection.eq(o)){var a=r.state.tr.setSelection(o);"pointer"==i&&a.setMeta("pointer",!0),r.dispatch(a)}}function handleSingleClick(r,o,i,c,u){return runHandlerOnContext(r,"handleClickOn",o,i,c)||r.someProp("handleClick",function(i){return i(r,o,c)})||(u?function selectClickedNode(r,o){if(-1==o)return!1;var i,c,u=r.state.selection;u instanceof a.NodeSelection&&(i=u.node);for(var p=r.state.doc.resolve(o),g=p.depth+1;g>0;g--){var v=g>p.depth?p.nodeAfter:p.node(g);if(a.NodeSelection.isSelectable(v)){c=i&&u.$from.depth>0&&g>=u.$from.depth&&p.before(u.$from.depth+1)==u.$from.pos?p.before(u.$from.depth):p.before(g);break}}return null!=c&&(updateSelection(r,a.NodeSelection.create(r.state.doc,c),"pointer"),!0)}(r,i):function selectClickedLeaf(r,o){if(-1==o)return!1;var i=r.state.doc.resolve(o),c=i.nodeAfter;return!!(c&&c.isAtom&&a.NodeSelection.isSelectable(c))&&(updateSelection(r,new a.NodeSelection(i),"pointer"),!0)}(r,i))}function handleDoubleClick(r,o,i,a){return runHandlerOnContext(r,"handleDoubleClickOn",o,i,a)||r.someProp("handleDoubleClick",function(i){return i(r,o,a)})}function handleTripleClick(r,o,i,c){return runHandlerOnContext(r,"handleTripleClickOn",o,i,c)||r.someProp("handleTripleClick",function(i){return i(r,o,c)})||function defaultTripleClick(r,o,i){if(0!=i.button)return!1;var c=r.state.doc;if(-1==o)return!!c.inlineContent&&(updateSelection(r,a.TextSelection.create(c,0,c.content.size),"pointer"),!0);for(var u=c.resolve(o),p=u.depth+1;p>0;p--){var g=p>u.depth?u.nodeAfter:u.node(p),v=u.before(p);if(g.inlineContent)updateSelection(r,a.TextSelection.create(c,v+1,v+1+g.content.size),"pointer");else{if(!a.NodeSelection.isSelectable(g))continue;updateSelection(r,a.NodeSelection.create(c,v),"pointer")}return!0}}(r,i,c)}function forceDOMFlush(r){return endComposition(r)}ye.keydown=function(r,o){var i=o;if(r.input.shiftKey=16==i.keyCode||i.shiftKey,!inOrNearComposition(r,i)&&(r.input.lastKeyCode=i.keyCode,r.input.lastKeyCodeTime=Date.now(),!W||!z||13!=i.keyCode))if(229!=i.keyCode&&r.domObserver.forceFlush(),!V||13!=i.keyCode||i.ctrlKey||i.altKey||i.metaKey)r.someProp("handleKeyDown",function(o){return o(r,i)})||captureKeyDown(r,i)?i.preventDefault():setSelectionOrigin(r,"key");else{var a=Date.now();r.input.lastIOSEnter=a,r.input.lastIOSEnterFallbackTimeout=setTimeout(function(){r.input.lastIOSEnter==a&&(r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))}),r.input.lastIOSEnter=0)},200)}},ye.keyup=function(r,o){16==o.keyCode&&(r.input.shiftKey=!1)},ye.keypress=function(r,o){var i=o;if(!(inOrNearComposition(r,i)||!i.charCode||i.ctrlKey&&!i.altKey||U&&i.metaKey))if(r.someProp("handleKeyPress",function(o){return o(r,i)}))i.preventDefault();else{var c=r.state.selection;if(!(c instanceof a.TextSelection&&c.$from.sameParent(c.$to))){var u=String.fromCharCode(i.charCode),p=function deflt(){return r.state.tr.insertText(u).scrollIntoView()};/[\r\n]/.test(u)||r.someProp("handleTextInput",function(o){return o(r,c.$from.pos,c.$to.pos,u,p)})||r.dispatch(p()),i.preventDefault()}}};var Ee=U?"metaKey":"ctrlKey";ve.mousedown=function(r,o){var i=o;r.input.shiftKey=i.shiftKey;var a=forceDOMFlush(r),c=Date.now(),u="singleClick";c-r.input.lastClick.time<500&&function isNear(r,o){var i=o.x-r.clientX,a=o.y-r.clientY;return i*i+a*a<100}(i,r.input.lastClick)&&!i[Ee]&&r.input.lastClick.button==i.button&&("singleClick"==r.input.lastClick.type?u="doubleClick":"doubleClick"==r.input.lastClick.type&&(u="tripleClick")),r.input.lastClick={time:c,x:i.clientX,y:i.clientY,type:u,button:i.button};var p=r.posAtCoords(eventCoords(i));p&&("singleClick"==u?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new Se(r,p,i,!!a)):("doubleClick"==u?handleDoubleClick:handleTripleClick)(r,p.pos,p.inside,i)?i.preventDefault():setSelectionOrigin(r,"pointer"))};var Se=function(){function MouseDown(r,o,i,c){var u,p,g=this;if(_classCallCheck(this,MouseDown),this.view=r,this.pos=o,this.event=i,this.flushed=c,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=r.state.doc,this.selectNode=!!i[Ee],this.allowDefault=i.shiftKey,o.inside>-1)u=r.state.doc.nodeAt(o.inside),p=o.inside;else{var v=r.state.doc.resolve(o.pos);u=v.parent,p=v.depth?v.before():0}var b=c?null:i.target,k=b?r.docView.nearestDesc(b,!0):null;this.target=k&&1==k.nodeDOM.nodeType?k.nodeDOM:null;var E=r.state.selection;(0==i.button&&u.type.spec.draggable&&!1!==u.type.spec.selectable||E instanceof a.NodeSelection&&E.from<=p&&E.to>p)&&(this.mightDrag={node:u,pos:p,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!I||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(function(){g.view.input.mouseDown==g&&g.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),r.root.addEventListener("mouseup",this.up=this.up.bind(this)),r.root.addEventListener("mousemove",this.move=this.move.bind(this)),setSelectionOrigin(r,"pointer")}return _createClass(MouseDown,[{key:"done",value:function done(){var r=this;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(function(){return selectionToDOM(r.view)}),this.view.input.mouseDown=null}},{key:"up",value:function up(r){if(this.done(),this.view.dom.contains(r.target)){var o=this.pos;this.view.state.doc!=this.startDoc&&(o=this.view.posAtCoords(eventCoords(r))),this.updateAllowDefault(r),this.allowDefault||!o?setSelectionOrigin(this.view,"pointer"):handleSingleClick(this.view,o.pos,o.inside,r,this.selectNode)?r.preventDefault():0==r.button&&(this.flushed||B&&this.mightDrag&&!this.mightDrag.node.isAtom||z&&!this.view.state.selection.visible&&Math.min(Math.abs(o.pos-this.view.state.selection.from),Math.abs(o.pos-this.view.state.selection.to))<=2)?(updateSelection(this.view,a.Selection.near(this.view.state.doc.resolve(o.pos)),"pointer"),r.preventDefault()):setSelectionOrigin(this.view,"pointer")}}},{key:"move",value:function move(r){this.updateAllowDefault(r),setSelectionOrigin(this.view,"pointer"),0==r.buttons&&this.done()}},{key:"updateAllowDefault",value:function updateAllowDefault(r){!this.allowDefault&&(Math.abs(this.event.x-r.clientX)>4||Math.abs(this.event.y-r.clientY)>4)&&(this.allowDefault=!0)}}]),MouseDown}();function inOrNearComposition(r,o){return!!r.composing||!!(B&&Math.abs(o.timeStamp-r.input.compositionEndedAt)<500)&&(r.input.compositionEndedAt=-2e8,!0)}ve.touchstart=function(r){r.input.lastTouch=Date.now(),forceDOMFlush(r),setSelectionOrigin(r,"pointer")},ve.touchmove=function(r){r.input.lastTouch=Date.now(),setSelectionOrigin(r,"pointer")},ve.contextmenu=function(r){return forceDOMFlush(r)};var we=W?5e3:-1;function scheduleComposeEnd(r,o){clearTimeout(r.input.composingTimeout),o>-1&&(r.input.composingTimeout=setTimeout(function(){return endComposition(r)},o))}function clearComposition(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=function timestampFromCustomEvent(){var r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function findCompositionNode(r){var o=r.domSelectionRange();if(!o.focusNode)return null;var i=function textNodeBefore$1(r,o){for(;;){if(3==r.nodeType&&o)return r;if(1==r.nodeType&&o>0){if("false"==r.contentEditable)return null;o=nodeSize(r=r.childNodes[o-1])}else{if(!r.parentNode||hasBlockDesc(r))return null;o=p(r),r=r.parentNode}}}(o.focusNode,o.focusOffset),a=function textNodeAfter$1(r,o){for(;;){if(3==r.nodeType&&o<r.nodeValue.length)return r;if(1==r.nodeType&&o<r.childNodes.length){if("false"==r.contentEditable)return null;r=r.childNodes[o],o=0}else{if(!r.parentNode||hasBlockDesc(r))return null;o=p(r)+1,r=r.parentNode}}}(o.focusNode,o.focusOffset);if(i&&a&&i!=a){var c=a.pmViewDesc,u=r.domObserver.lastChangedTextNode;if(i==u||a==u)return u;if(!c||!c.isText(a.nodeValue))return a;if(r.input.compositionNode==a){var g=i.pmViewDesc;if(g&&g.isText(i.nodeValue))return a}}return i||a}function endComposition(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(W&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),clearComposition(r),o||r.docView&&r.docView.dirty){var i=selectionFromDOM(r),a=r.state.selection;return i&&!i.eq(a)?r.dispatch(r.state.tr.setSelection(i)):!r.markCursor&&!o||a.$from.node(a.$from.sharedDepth(a.to)).inlineContent?r.updateState(r.state):r.dispatch(r.state.tr.deleteSelection()),!0}return!1}}ye.compositionstart=ye.compositionupdate=function(r){if(!r.composing){r.domObserver.flush();var o=r.state,i=o.selection.$to;if(o.selection instanceof a.TextSelection&&(o.storedMarks||!i.textOffset&&i.parentOffset&&i.nodeBefore.marks.some(function(r){return!1===r.type.spec.inclusive})||z&&H&&function selectionBeforeUneditable(r){var o=r.domSelectionRange(),i=o.focusNode,a=o.focusOffset;if(!i||1!=i.nodeType||a>=i.childNodes.length)return!1;var c=i.childNodes[a];return 1==c.nodeType&&"false"==c.contentEditable}(r)))r.markCursor=r.state.storedMarks||i.marks(),endComposition(r,!0),r.markCursor=null;else if(endComposition(r,!o.selection.empty),I&&o.selection.empty&&i.parentOffset&&!i.textOffset&&i.nodeBefore.marks.length)for(var c=r.domSelectionRange(),u=c.focusNode,p=c.focusOffset;u&&1==u.nodeType&&0!=p;){var g=p<0?u.lastChild:u.childNodes[p-1];if(!g)break;if(3==g.nodeType){var v=r.domSelection();v&&v.collapse(g,g.nodeValue.length);break}u=g,p=-1}r.input.composing=!0}scheduleComposeEnd(r,we)},ye.compositionend=function(r,o){r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=o.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.badSafariComposition?r.domObserver.forceFlush():r.input.compositionPendingChanges&&Promise.resolve().then(function(){return r.domObserver.flush()}),r.input.compositionID++,scheduleComposeEnd(r,20))};var xe=N&&R<15||V&&G<604;function doPaste(r,o,i,a,u){var p=parseFromClipboard(r,o,i,a,r.state.selection.$from);if(r.someProp("handlePaste",function(o){return o(r,u,p||c.Slice.empty)}))return!0;if(!p)return!1;var g=function sliceSingleNode(r){return 0==r.openStart&&0==r.openEnd&&1==r.content.childCount?r.content.firstChild:null}(p),v=g?r.state.tr.replaceSelectionWith(g,a):r.state.tr.replaceSelection(p);return r.dispatch(v.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function getText(r){var o=r.getData("text/plain")||r.getData("Text");if(o)return o;var i=r.getData("text/uri-list");return i?i.replace(/\r?\n/g," "):""}ve.copy=ye.cut=function(r,o){var i=o,a=r.state.selection,c="cut"==i.type;if(!a.empty){var u=xe?null:i.clipboardData,p=_serializeForClipboard(r,a.content()),g=p.dom,v=p.text;u?(i.preventDefault(),u.clearData(),u.setData("text/html",g.innerHTML),u.setData("text/plain",v)):function captureCopy(r,o){if(r.dom.parentNode){var i=r.dom.parentNode.appendChild(document.createElement("div"));i.appendChild(o),i.style.cssText="position: fixed; left: -10000px; top: 10px";var a=getSelection(),c=document.createRange();c.selectNodeContents(o),r.dom.blur(),a.removeAllRanges(),a.addRange(c),setTimeout(function(){i.parentNode&&i.parentNode.removeChild(i),r.focus()},50)}}(r,g),c&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},ye.paste=function(r,o){var i=o;if(!r.composing||W){var a=xe?null:i.clipboardData,c=r.input.shiftKey&&45!=r.input.lastKeyCode;a&&doPaste(r,getText(a),a.getData("text/html"),c,i)?i.preventDefault():function capturePaste(r,o){if(r.dom.parentNode){var i=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,a=r.dom.parentNode.appendChild(document.createElement(i?"textarea":"div"));i||(a.contentEditable="true"),a.style.cssText="position: fixed; left: -10000px; top: 10px",a.focus();var c=r.input.shiftKey&&45!=r.input.lastKeyCode;setTimeout(function(){r.focus(),a.parentNode&&a.parentNode.removeChild(a),i?doPaste(r,a.value,null,c,o):doPaste(r,a.textContent,a.innerHTML,c,o)},50)}}(r,i)}};var Ce=_createClass(function Dragging(r,o,i){_classCallCheck(this,Dragging),this.slice=r,this.move=o,this.node=i}),_e=U?"altKey":"ctrlKey";function dragMoves(r,o){var i=r.someProp("dragCopies",function(r){return!r(o)});return null!=i?i:!o[_e]}for(var Te in ve.dragstart=function(r,o){var i=o,c=r.input.mouseDown;if(c&&c.done(),i.dataTransfer){var u,p=r.state.selection,g=p.empty?null:r.posAtCoords(eventCoords(i));if(g&&g.pos>=p.from&&g.pos<=(p instanceof a.NodeSelection?p.to-1:p.to));else if(c&&c.mightDrag)u=a.NodeSelection.create(r.state.doc,c.mightDrag.pos);else if(i.target&&1==i.target.nodeType){var v=r.docView.nearestDesc(i.target,!0);v&&v.node.type.spec.draggable&&v!=r.docView&&(u=a.NodeSelection.create(r.state.doc,v.posBefore))}var b=_serializeForClipboard(r,(u||r.state.selection).content()),k=b.dom,E=b.text,w=b.slice;(!i.dataTransfer.files.length||!z||j>120)&&i.dataTransfer.clearData(),i.dataTransfer.setData(xe?"Text":"text/html",k.innerHTML),i.dataTransfer.effectAllowed="copyMove",xe||i.dataTransfer.setData("text/plain",E),r.dragging=new Ce(w,dragMoves(r,i),u)}},ve.dragend=function(r){var o=r.dragging;window.setTimeout(function(){r.dragging==o&&(r.dragging=null)},50)},ye.dragover=ye.dragenter=function(r,o){return o.preventDefault()},ye.drop=function(r,o){try{!function handleDrop(r,o,i){if(!o.dataTransfer)return;var p=r.posAtCoords(eventCoords(o));if(!p)return;var g=r.state.doc.resolve(p.pos),v=i&&i.slice;v?r.someProp("transformPasted",function(o){v=o(v,r,!1)}):v=parseFromClipboard(r,getText(o.dataTransfer),xe?null:o.dataTransfer.getData("text/html"),!1,g);var b=!(!i||!dragMoves(r,o));if(r.someProp("handleDrop",function(i){return i(r,o,v||c.Slice.empty,b)}))return void o.preventDefault();if(!v)return;o.preventDefault();var k=v?u.dropPoint(r.state.doc,g.pos,v):g.pos;null==k&&(k=g.pos);var E=r.state.tr;if(b){var w=i.node;w?w.replace(E):E.deleteSelection()}var x=E.mapping.map(k),C=0==v.openStart&&0==v.openEnd&&1==v.content.childCount,_=E.doc;C?E.replaceRangeWith(x,x,v.content.firstChild):E.replaceRange(x,x,v);if(E.doc.eq(_))return;var T=E.doc.resolve(x);if(C&&a.NodeSelection.isSelectable(v.content.firstChild)&&T.nodeAfter&&T.nodeAfter.sameMarkup(v.content.firstChild))E.setSelection(new a.NodeSelection(T));else{var P=E.mapping.map(k);E.mapping.maps[E.mapping.maps.length-1].forEach(function(r,o,i,a){return P=a}),E.setSelection(selectionBetween(r,T,E.doc.resolve(P)))}r.focus(),r.dispatch(E.setMeta("uiEvent","drop"))}(r,o,r.dragging)}finally{r.dragging=null}},ve.focus=function(r){r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(function(){r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&selectionToDOM(r)},20))},ve.blur=function(r,o){var i=o;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),i.relatedTarget&&r.dom.contains(i.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)},ve.beforeinput=function(r,o){if(z&&W&&"deleteContentBackward"==o.inputType){r.domObserver.flushSoon();var i=r.input.domChangeCount;setTimeout(function(){if(r.input.domChangeCount==i&&(r.dom.blur(),r.focus(),!r.someProp("handleKeyDown",function(o){return o(r,keyEvent(8,"Backspace"))}))){var o=r.state.selection.$cursor;o&&o.pos>0&&r.dispatch(r.state.tr.delete(o.pos-1,o.pos).scrollIntoView())}},50)}},ye)ve[Te]=ye[Te];function compareObjs(r,o){if(r==o)return!0;for(var i in r)if(r[i]!==o[i])return!1;for(var a in o)if(!(a in r))return!1;return!0}var Oe=function(){function WidgetType(r,o){_classCallCheck(this,WidgetType),this.toDOM=r,this.spec=o||Re,this.side=this.spec.side||0}return _createClass(WidgetType,[{key:"map",value:function map(r,o,i,a){var c=r.mapResult(o.from+a,this.side<0?-1:1),u=c.pos;return c.deleted?null:new Me(u-i,u-i,this)}},{key:"valid",value:function valid(){return!0}},{key:"eq",value:function eq(r){return this==r||r instanceof WidgetType&&(this.spec.key&&this.spec.key==r.spec.key||this.toDOM==r.toDOM&&compareObjs(this.spec,r.spec))}},{key:"destroy",value:function destroy(r){this.spec.destroy&&this.spec.destroy(r)}}]),WidgetType}(),Pe=function(){function InlineType(r,o){_classCallCheck(this,InlineType),this.attrs=r,this.spec=o||Re}return _createClass(InlineType,[{key:"map",value:function map(r,o,i,a){var c=r.map(o.from+a,this.spec.inclusiveStart?-1:1)-i,u=r.map(o.to+a,this.spec.inclusiveEnd?1:-1)-i;return c>=u?null:new Me(c,u,this)}},{key:"valid",value:function valid(r,o){return o.from<o.to}},{key:"eq",value:function eq(r){return this==r||r instanceof InlineType&&compareObjs(this.attrs,r.attrs)&&compareObjs(this.spec,r.spec)}},{key:"destroy",value:function destroy(){}}],[{key:"is",value:function is(r){return r.type instanceof InlineType}}]),InlineType}(),Ae=function(){function NodeType(r,o){_classCallCheck(this,NodeType),this.attrs=r,this.spec=o||Re}return _createClass(NodeType,[{key:"map",value:function map(r,o,i,a){var c=r.mapResult(o.from+a,1);if(c.deleted)return null;var u=r.mapResult(o.to+a,-1);return u.deleted||u.pos<=c.pos?null:new Me(c.pos-i,u.pos-i,this)}},{key:"valid",value:function valid(r,o){var i,a=r.content.findIndex(o.from),c=a.index,u=a.offset;return u==o.from&&!(i=r.child(c)).isText&&u+i.nodeSize==o.to}},{key:"eq",value:function eq(r){return this==r||r instanceof NodeType&&compareObjs(this.attrs,r.attrs)&&compareObjs(this.spec,r.spec)}},{key:"destroy",value:function destroy(){}}]),NodeType}(),Me=function(){function Decoration(r,o,i){_classCallCheck(this,Decoration),this.from=r,this.to=o,this.type=i}return _createClass(Decoration,[{key:"copy",value:function copy(r,o){return new Decoration(r,o,this.type)}},{key:"eq",value:function eq(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(r.type)&&this.from+o==r.from&&this.to+o==r.to}},{key:"map",value:function map(r,o,i){return this.type.map(r,this,o,i)}},{key:"spec",get:function get(){return this.type.spec}},{key:"inline",get:function get(){return this.type instanceof Pe}},{key:"widget",get:function get(){return this.type instanceof Oe}}],[{key:"widget",value:function widget(r,o,i){return new Decoration(r,r,new Oe(o,i))}},{key:"inline",value:function inline(r,o,i,a){return new Decoration(r,o,new Pe(i,a))}},{key:"node",value:function node(r,o,i,a){return new Decoration(r,o,new Ae(i,a))}}]),Decoration}(),Ne=[],Re={},Ie=function(){function DecorationSet(r,o){_classCallCheck(this,DecorationSet),this.local=r.length?r:Ne,this.children=o.length?o:Ne}return _createClass(DecorationSet,[{key:"find",value:function find(r,o,i){var a=[];return this.findInner(null==r?0:r,null==o?1e9:o,a,0,i),a}},{key:"findInner",value:function findInner(r,o,i,a,c){for(var u=0;u<this.local.length;u++){var p=this.local[u];p.from<=o&&p.to>=r&&(!c||c(p.spec))&&i.push(p.copy(p.from+a,p.to+a))}for(var g=0;g<this.children.length;g+=3)if(this.children[g]<o&&this.children[g+1]>r){var v=this.children[g]+1;this.children[g+2].findInner(r-v,o-v,i,a+v,c)}}},{key:"map",value:function map(r,o,i){return this==De||0==r.maps.length?this:this.mapInner(r,o,0,0,i||Re)}},{key:"mapInner",value:function mapInner(r,o,i,a,c){for(var u,p=0;p<this.local.length;p++){var g=this.local[p].map(r,i,a);g&&g.type.valid(o,g)?(u||(u=[])).push(g):c.onRemove&&c.onRemove(this.local[p].spec)}return this.children.length?mapChildren(this.children,u||[],r,o,i,a,c):u?new DecorationSet(u.sort(byPos),Ne):De}},{key:"add",value:function add(r,o){return o.length?this==De?DecorationSet.create(r,o):this.addInner(r,o,0):this}},{key:"addInner",value:function addInner(r,o,i){var a,c=this,u=0;r.forEach(function(r,p){var g,v=p+i;if(g=takeSpansForNode(o,r,v)){for(a||(a=c.children.slice());u<a.length&&a[u]<p;)u+=3;a[u]==p?a[u+2]=a[u+2].addInner(r,g,v+1):a.splice(u,0,p,p+r.nodeSize,buildTree(g,r,v+1,Re)),u+=3}});for(var p=moveSpans(u?withoutNulls(o):o,-i),g=0;g<p.length;g++)p[g].type.valid(r,p[g])||p.splice(g--,1);return new DecorationSet(p.length?this.local.concat(p).sort(byPos):this.local,a||this.children)}},{key:"remove",value:function remove(r){return 0==r.length||this==De?this:this.removeInner(r,0)}},{key:"removeInner",value:function removeInner(r,o){for(var i=this.children,a=this.local,c=0;c<i.length;c+=3){for(var u,p=void 0,g=i[c]+o,v=i[c+1]+o,b=0;b<r.length;b++)(u=r[b])&&u.from>g&&u.to<v&&(r[b]=null,(p||(p=[])).push(u));if(p){i==this.children&&(i=this.children.slice());var k=i[c+2].removeInner(p,g+1);k!=De?i[c+2]=k:(i.splice(c,3),c-=3)}}if(a.length)for(var E,w=0;w<r.length;w++)if(E=r[w])for(var x=0;x<a.length;x++)a[x].eq(E,o)&&(a==this.local&&(a=this.local.slice()),a.splice(x--,1));return i==this.children&&a==this.local?this:a.length||i.length?new DecorationSet(a,i):De}},{key:"forChild",value:function forChild(r,o){if(this==De)return this;if(o.isLeaf)return DecorationSet.empty;for(var i,a,c=0;c<this.children.length;c+=3)if(this.children[c]>=r){this.children[c]==r&&(i=this.children[c+2]);break}for(var u=r+1,p=u+o.content.size,g=0;g<this.local.length;g++){var v=this.local[g];if(v.from<p&&v.to>u&&v.type instanceof Pe){var b=Math.max(u,v.from)-u,k=Math.min(p,v.to)-u;b<k&&(a||(a=[])).push(v.copy(b,k))}}if(a){var E=new DecorationSet(a.sort(byPos),Ne);return i?new Le([E,i]):E}return i||De}},{key:"eq",value:function eq(r){if(this==r)return!0;if(!(r instanceof DecorationSet)||this.local.length!=r.local.length||this.children.length!=r.children.length)return!1;for(var o=0;o<this.local.length;o++)if(!this.local[o].eq(r.local[o]))return!1;for(var i=0;i<this.children.length;i+=3)if(this.children[i]!=r.children[i]||this.children[i+1]!=r.children[i+1]||!this.children[i+2].eq(r.children[i+2]))return!1;return!0}},{key:"locals",value:function locals(r){return removeOverlap(this.localsInner(r))}},{key:"localsInner",value:function localsInner(r){if(this==De)return Ne;if(r.inlineContent||!this.local.some(Pe.is))return this.local;for(var o=[],i=0;i<this.local.length;i++)this.local[i].type instanceof Pe||o.push(this.local[i]);return o}},{key:"forEachSet",value:function forEachSet(r){r(this)}}],[{key:"create",value:function create(r,o){return o.length?buildTree(o,r,0,Re):De}}]),DecorationSet}();Ie.empty=new Ie([],[]),Ie.removeOverlap=removeOverlap;var De=Ie.empty,Le=function(){function DecorationGroup(r){_classCallCheck(this,DecorationGroup),this.members=r}return _createClass(DecorationGroup,[{key:"map",value:function map(r,o){var i=this.members.map(function(i){return i.map(r,o,Re)});return DecorationGroup.from(i)}},{key:"forChild",value:function forChild(r,o){if(o.isLeaf)return Ie.empty;for(var i=[],a=0;a<this.members.length;a++){var c=this.members[a].forChild(r,o);c!=De&&(c instanceof DecorationGroup?i=i.concat(c.members):i.push(c))}return DecorationGroup.from(i)}},{key:"eq",value:function eq(r){if(!(r instanceof DecorationGroup)||r.members.length!=this.members.length)return!1;for(var o=0;o<this.members.length;o++)if(!this.members[o].eq(r.members[o]))return!1;return!0}},{key:"locals",value:function locals(r){for(var o,i=!0,a=0;a<this.members.length;a++){var locals=this.members[a].localsInner(r);if(locals.length)if(o){i&&(o=o.slice(),i=!1);for(var c=0;c<locals.length;c++)o.push(locals[c])}else o=locals}return o?removeOverlap(i?o:o.sort(byPos)):Ne}},{key:"forEachSet",value:function forEachSet(r){for(var o=0;o<this.members.length;o++)this.members[o].forEachSet(r)}}],[{key:"from",value:function from(r){switch(r.length){case 0:return De;case 1:return r[0];default:return new DecorationGroup(r.every(function(r){return r instanceof Ie})?r:r.reduce(function(r,o){return r.concat(o instanceof Ie?o:o.members)},[]))}}}]),DecorationGroup}();function mapChildren(r,o,i,a,c,u,p){for(var g=r.slice(),v=function _loop4(r){var o=0;i.maps[b].forEach(function(i,a,c,u){for(var p=u-c-(a-i),v=0;v<g.length;v+=3){var b=g[v+1];if(!(b<0||i>b+r-o)){var k=g[v]+r-o;a>=k?g[v+1]=i<=k?-2:-1:i>=r&&p&&(g[v]+=p,g[v+1]+=p)}}o+=p}),r=i.maps[b].map(r,-1),k=r},b=0,k=u;b<i.maps.length;b++)v(k);for(var E=!1,w=0;w<g.length;w+=3)if(g[w+1]<0){if(-2==g[w+1]){E=!0,g[w+1]=-1;continue}var x=i.map(r[w]+u),C=x-c;if(C<0||C>=a.content.size){E=!0;continue}var _=i.map(r[w+1]+u,-1)-c,T=a.content.findIndex(C),P=T.index,A=T.offset,N=a.maybeChild(P);if(N&&A==C&&A+N.nodeSize==_){var R=g[w+2].mapInner(i,N,x+1,r[w]+u+1,p);R!=De?(g[w]=C,g[w+1]=_,g[w+2]=R):(g[w+1]=-2,E=!0)}else E=!0}if(E){var I=function mapAndGatherRemainingDecorations(r,o,i,a,c,u,p){function gather(r,o){for(var u=0;u<r.local.length;u++){var g=r.local[u].map(a,c,o);g?i.push(g):p.onRemove&&p.onRemove(r.local[u].spec)}for(var v=0;v<r.children.length;v+=3)gather(r.children[v+2],r.children[v]+o+1)}for(var g=0;g<r.length;g+=3)-1==r[g+1]&&gather(r[g+2],o[g]+u+1);return i}(g,r,o,i,c,u,p),L=buildTree(I,a,0,p);o=L.local;for(var z=0;z<g.length;z+=3)g[z+1]<0&&(g.splice(z,3),z-=3);for(var j=0,B=0;j<L.children.length;j+=3){for(var V=L.children[j];B<g.length&&g[B]<V;)B+=3;g.splice(B,0,L.children[j],L.children[j+1],L.children[j+2])}}return new Ie(o.sort(byPos),g)}function moveSpans(r,o){if(!o||!r.length)return r;for(var i=[],a=0;a<r.length;a++){var c=r[a];i.push(new Me(c.from+o,c.to+o,c.type))}return i}function takeSpansForNode(r,o,i){if(o.isLeaf)return null;for(var a,c=i+o.nodeSize,u=null,p=0;p<r.length;p++)(a=r[p])&&a.from>i&&a.to<c&&((u||(u=[])).push(a),r[p]=null);return u}function withoutNulls(r){for(var o=[],i=0;i<r.length;i++)null!=r[i]&&o.push(r[i]);return o}function buildTree(r,o,i,a){var c=[],u=!1;o.forEach(function(o,p){var g=takeSpansForNode(r,o,p+i);if(g){u=!0;var v=buildTree(g,o,i+p+1,a);v!=De&&c.push(p,p+o.nodeSize,v)}});for(var p=moveSpans(u?withoutNulls(r):r,-i).sort(byPos),g=0;g<p.length;g++)p[g].type.valid(o,p[g])||(a.onRemove&&a.onRemove(p[g].spec),p.splice(g--,1));return p.length||c.length?new Ie(p,c):De}function byPos(r,o){return r.from-o.from||r.to-o.to}function removeOverlap(r){for(var o=r,i=0;i<o.length-1;i++){var a=o[i];if(a.from!=a.to)for(var c=i+1;c<o.length;c++){var u=o[c];if(u.from!=a.from){u.from<a.to&&(o==r&&(o=r.slice()),o[i]=a.copy(a.from,u.from),insertAhead(o,c,a.copy(u.from,a.to)));break}u.to!=a.to&&(o==r&&(o=r.slice()),o[c]=u.copy(u.from,a.to),insertAhead(o,c+1,u.copy(a.to,u.to)))}}return o}function insertAhead(r,o,i){for(;o<r.length&&byPos(i,r[o])>0;)o++;r.splice(o,0,i)}function viewDecorations(r){var o=[];return r.someProp("decorations",function(i){var a=i(r.state);a&&a!=De&&o.push(a)}),r.cursorWrapper&&o.push(Ie.create(r.state.doc,[r.cursorWrapper.deco])),Le.from(o)}var Fe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ze=N&&R<=11,je=function(){function SelectionState(){_classCallCheck(this,SelectionState),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return _createClass(SelectionState,[{key:"set",value:function set(r){this.anchorNode=r.anchorNode,this.anchorOffset=r.anchorOffset,this.focusNode=r.focusNode,this.focusOffset=r.focusOffset}},{key:"clear",value:function clear(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function eq(r){return r.anchorNode==this.anchorNode&&r.anchorOffset==this.anchorOffset&&r.focusNode==this.focusNode&&r.focusOffset==this.focusOffset}}]),SelectionState}(),Be=function(){function DOMObserver(r,o){var i=this;_classCallCheck(this,DOMObserver),this.view=r,this.handleDOMChange=o,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new je,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(function(o){for(var a=0;a<o.length;a++)i.queue.push(o[a]);N&&R<=11&&o.some(function(r){return"childList"==r.type&&r.removedNodes.length||"characterData"==r.type&&r.oldValue.length>r.target.nodeValue.length})?i.flushSoon():B&&r.composing&&o.some(function(r){return"childList"==r.type&&"TR"==r.target.nodeName})?(r.input.badSafariComposition=!0,i.flushSoon()):i.flush()}),ze&&(this.onCharData=function(r){i.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),i.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return _createClass(DOMObserver,[{key:"flushSoon",value:function flushSoon(){var r=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){r.flushingSoon=-1,r.flush()},20))}},{key:"forceFlush",value:function forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Fe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function stop(){var r=this;if(this.observer){var o=this.observer.takeRecords();if(o.length){for(var i=0;i<o.length;i++)this.queue.push(o[i]);window.setTimeout(function(){return r.flush()},20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function suppressSelectionUpdates(){var r=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return r.suppressingSelectionUpdates=!1},50)}},{key:"onSelectionChange",value:function onSelectionChange(){if(hasFocusAndSelection(this.view)){if(this.suppressingSelectionUpdates)return selectionToDOM(this.view);if(N&&R<=11&&!this.view.state.selection.empty){var r=this.view.domSelectionRange();if(r.focusNode&&k(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}},{key:"ignoreSelectionChange",value:function ignoreSelectionChange(r){if(!r.focusNode)return!0;for(var o,i=new Set,a=r.focusNode;a;a=g(a))i.add(a);for(var c=r.anchorNode;c;c=g(c))if(i.has(c)){o=c;break}var u=o&&this.view.docView.nearestDesc(o);return u&&u.ignoreMutation({type:"selection",target:3==o.nodeType?o.parentNode:o})?(this.setCurSelection(),!0):void 0}},{key:"pendingRecords",value:function pendingRecords(){if(this.observer){var r,o=_createForOfIteratorHelper(this.observer.takeRecords());try{for(o.s();!(r=o.n()).done;){var i=r.value;this.queue.push(i)}}catch(r){o.e(r)}finally{o.f()}}return this.queue}},{key:"flush",value:function flush(){var r=this.view;if(r.docView&&!(this.flushingSoon>-1)){var o=this.pendingRecords();o.length&&(this.queue=[]);var i=r.domSelectionRange(),c=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&hasFocusAndSelection(r)&&!this.ignoreSelectionChange(i),u=-1,p=-1,g=!1,v=[];if(r.editable)for(var b=0;b<o.length;b++){var k=this.registerMutation(o[b],v);k&&(u=u<0?k.from:Math.min(k.from,u),p=p<0?k.to:Math.max(k.to,p),k.typeOver&&(g=!0))}if(!v.some(function(r){return"BR"==r.nodeName})||8!=r.input.lastKeyCode&&46!=r.input.lastKeyCode){if(I&&v.length){var E=v.filter(function(r){return"BR"==r.nodeName});if(2==E.length){var x=_slicedToArray(E,2),C=x[0],_=x[1];C.parentNode&&C.parentNode.parentNode==_.parentNode?_.remove():C.remove()}else{var T,P=this.currentSelection.focusNode,A=_createForOfIteratorHelper(E);try{for(A.s();!(T=A.n()).done;){var N=T.value,R=N.parentNode;!R||"LI"!=R.nodeName||P&&blockParent(r,P)==R||N.remove()}}catch(r){A.e(r)}finally{A.f()}}}}else{var L,z=_createForOfIteratorHelper(v);try{for(z.s();!(L=z.n()).done;){var j=L.value;if("BR"==j.nodeName&&j.parentNode){var B=j.nextSibling;B&&1==B.nodeType&&"false"==B.contentEditable&&j.parentNode.removeChild(j)}}}catch(r){z.e(r)}finally{z.f()}}var V=null;u<0&&c&&r.input.lastFocus>Date.now()-200&&Math.max(r.input.lastTouch,r.input.lastClick.time)<Date.now()-300&&w(i)&&(V=selectionFromDOM(r))&&V.eq(a.Selection.near(r.state.doc.resolve(0),1))?(r.input.lastFocus=0,selectionToDOM(r),this.currentSelection.set(i),r.scrollToSelection()):(u>-1||c)&&(u>-1&&(r.docView.markDirty(u,p),function checkCSS(r){if(Ve.has(r))return;if(Ve.set(r,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace)){if(r.requiresGeckoHackNode=I,$e)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),$e=!0}}(r)),r.input.badSafariComposition&&(r.input.badSafariComposition=!1,function fixUpBadSafariComposition(r,o){var i,a,c=r.domSelectionRange(),u=c.focusNode,p=c.focusOffset,g=_createForOfIteratorHelper(o);try{for(g.s();!(a=g.n()).done;){var v=a.value;if("TR"==(null===(i=v.parentNode)||void 0===i?void 0:i.nodeName)){for(var b=v.nextSibling;b&&"TD"!=b.nodeName&&"TH"!=b.nodeName;)b=b.nextSibling;if(b){for(var k=b;;){var E=k.firstChild;if(!E||1!=E.nodeType||"false"==E.contentEditable||/^(BR|IMG)$/.test(E.nodeName))break;k=E}k.insertBefore(v,k.firstChild),u==v&&r.domSelection().collapse(v,p)}else v.parentNode.removeChild(v)}}}catch(r){g.e(r)}finally{g.f()}}(r,v)),this.handleDOMChange(u,p,g,v),r.docView&&r.docView.dirty?r.updateState(r.state):this.currentSelection.eq(i)||selectionToDOM(r),this.currentSelection.set(i))}}},{key:"registerMutation",value:function registerMutation(r,o){if(o.indexOf(r.target)>-1)return null;var i=this.view.docView.nearestDesc(r.target);if("attributes"==r.type&&(i==this.view.docView||"contenteditable"==r.attributeName||"style"==r.attributeName&&!r.oldValue&&!r.target.getAttribute("style")))return null;if(!i||i.ignoreMutation(r))return null;if("childList"==r.type){for(var a=0;a<r.addedNodes.length;a++){var c=r.addedNodes[a];o.push(c),3==c.nodeType&&(this.lastChangedTextNode=c)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(r.target))return{from:i.posBefore,to:i.posAfter};var u=r.previousSibling,g=r.nextSibling;if(N&&R<=11&&r.addedNodes.length)for(var v=0;v<r.addedNodes.length;v++){var b=r.addedNodes[v],k=b.previousSibling,E=b.nextSibling;(!k||Array.prototype.indexOf.call(r.addedNodes,k)<0)&&(u=k),(!E||Array.prototype.indexOf.call(r.addedNodes,E)<0)&&(g=E)}var w=u&&u.parentNode==r.target?p(u)+1:0,x=i.localPosFromDOM(r.target,w,-1),C=g&&g.parentNode==r.target?p(g):r.target.childNodes.length;return{from:x,to:i.localPosFromDOM(r.target,C,1)}}return"attributes"==r.type?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=r.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:r.target.nodeValue==r.oldValue})}}]),DOMObserver}(),Ve=new WeakMap,$e=!1;function rangeToSelectionRange(r,o){var i=o.startContainer,a=o.startOffset,c=o.endContainer,u=o.endOffset,p=r.domAtPos(r.state.selection.anchor);if(k(p.node,p.offset,c,u)){var g=[c,u,i,a];i=g[0],a=g[1],c=g[2],u=g[3]}return{anchorNode:i,anchorOffset:a,focusNode:c,focusOffset:u}}function blockParent(r,o){for(var i=o.parentNode;i&&i!=r.dom;i=i.parentNode){var a=r.docView.nearestDesc(i,!0);if(a&&a.node.isBlock)return i}return null}function ruleFromNode(r){var o=r.pmViewDesc;if(o)return o.parseRule();if("BR"==r.nodeName&&r.parentNode){if(B&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){var i=document.createElement("div");return i.appendChild(document.createElement("li")),{skip:i}}if(r.parentNode.lastChild==r||B&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if("IMG"==r.nodeName&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}var Ue=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function readDOMChange(r,o,i,u,p){var g=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,o<0){var v=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,b=selectionFromDOM(r,v);if(b&&!r.state.selection.eq(b)){if(z&&W&&13===r.input.lastKeyCode&&Date.now()-100<r.input.lastKeyCodeTime&&r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))}))return;var k=r.state.tr.setSelection(b);"pointer"==v?k.setMeta("pointer",!0):"key"==v&&k.scrollIntoView(),g&&k.setMeta("composition",g),r.dispatch(k)}}else{var E=r.state.doc.resolve(o),x=E.sharedDepth(i);o=E.before(x+1),i=r.state.doc.resolve(i).after(x+1);var C,_,T=r.state.selection,P=function parseBetween(r,o,i){var a,u=r.docView.parseRange(o,i),p=u.node,g=u.fromOffset,v=u.toOffset,b=u.from,k=u.to,E=r.domSelectionRange(),x=E.anchorNode;if(x&&r.dom.contains(1==x.nodeType?x:x.parentNode)&&(a=[{node:x,offset:E.anchorOffset}],w(E)||a.push({node:E.focusNode,offset:E.focusOffset})),z&&8===r.input.lastKeyCode)for(var C=v;C>g;C--){var _=p.childNodes[C-1],T=_.pmViewDesc;if("BR"==_.nodeName&&!T){v=C;break}if(!T||T.size)break}var P=r.state.doc,A=r.someProp("domParser")||c.DOMParser.fromSchema(r.state.schema),N=P.resolve(b),R=null,I=A.parse(p,{topNode:N.parent,topMatch:N.parent.contentMatchAt(N.index()),topOpen:!0,from:g,to:v,preserveWhitespace:"pre"!=N.parent.type.whitespace||"full",findPositions:a,ruleFromNode:ruleFromNode,context:N});if(a&&null!=a[0].pos){var L=a[0].pos,j=a[1]&&a[1].pos;null==j&&(j=L),R={anchor:L+b,head:j+b}}return{doc:I,sel:R,from:b,to:k}}(r,o,i),A=r.state.doc,I=A.slice(P.from,P.to);8===r.input.lastKeyCode&&Date.now()-100<r.input.lastKeyCodeTime?(C=r.state.selection.to,_="end"):(C=r.state.selection.from,_="start"),r.input.lastKeyCode=null;var L=function findDiff(r,o,i,a,c){var u=r.findDiffStart(o,i);if(null==u)return null;var p=r.findDiffEnd(o,i+r.size,i+o.size),g=p.a,v=p.b;if("end"==c){a-=g+Math.max(0,u-Math.min(g,v))-u}if(g<u&&r.size<o.size){var b=a<=u&&a>=g?u-a:0;(u-=b)&&u<o.size&&isSurrogatePair(o.textBetween(u-1,u+1))&&(u+=b?1:-1),v=u+(v-g),g=u}else if(v<u){var k=a<=u&&a>=v?u-a:0;(u-=k)&&u<r.size&&isSurrogatePair(r.textBetween(u-1,u+1))&&(u+=k?1:-1),g=u+(g-v),v=u}return{start:u,endA:g,endB:v}}(I.content,P.doc.content,P.from,C,_);if(L&&r.input.domChangeCount++,(V&&r.input.lastIOSEnter>Date.now()-225||W)&&p.some(function(r){return 1==r.nodeType&&!Ue.test(r.nodeName)})&&(!L||L.endA>=L.endB)&&r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))}))r.input.lastIOSEnter=0;else{if(!L){if(!(u&&T instanceof a.TextSelection&&!T.empty&&T.$head.sameParent(T.$anchor))||r.composing||P.sel&&P.sel.anchor!=P.sel.head){if(P.sel){var j=resolveSelection(r,r.state.doc,P.sel);if(j&&!j.eq(r.state.selection)){var B=r.state.tr.setSelection(j);g&&B.setMeta("composition",g),r.dispatch(B)}}return}L={start:T.from,endA:T.to,endB:T.to}}r.state.selection.from<r.state.selection.to&&L.start==L.endB&&r.state.selection instanceof a.TextSelection&&(L.start>r.state.selection.from&&L.start<=r.state.selection.from+2&&r.state.selection.from>=P.from?L.start=r.state.selection.from:L.endA<r.state.selection.to&&L.endA>=r.state.selection.to-2&&r.state.selection.to<=P.to&&(L.endB+=r.state.selection.to-L.endA,L.endA=r.state.selection.to)),N&&R<=11&&L.endB==L.start+1&&L.endA==L.start&&L.start>P.from&&"  "==P.doc.textBetween(L.start-P.from-1,L.start-P.from+1)&&(L.start--,L.endA--,L.endB--);var U=P.doc.resolveNoCache(L.start-P.from),H=P.doc.resolveNoCache(L.endB-P.from),K=A.resolve(L.start),G=U.sameParent(H)&&U.parent.inlineContent&&K.end()>=L.endA;if((V&&r.input.lastIOSEnter>Date.now()-225&&(!G||p.some(function(r){return"DIV"==r.nodeName||"P"==r.nodeName}))||!G&&U.pos<P.doc.content.size&&(!U.sameParent(H)||!U.parent.inlineContent)&&U.pos<H.pos&&!/\S/.test(P.doc.textBetween(U.pos,H.pos,"","")))&&r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))}))r.input.lastIOSEnter=0;else if(r.state.selection.anchor>L.start&&function looksLikeBackspace(r,o,i,a,c){if(i-o<=c.pos-a.pos||skipClosingAndOpening(a,!0,!1)<c.pos)return!1;var u=r.resolve(o);if(!a.parent.isTextblock){var p=u.nodeAfter;return null!=p&&i==o+p.nodeSize}if(u.parentOffset<u.parent.content.size||!u.parent.isTextblock)return!1;var g=r.resolve(skipClosingAndOpening(u,!0,!0));return!(!g.parent.isTextblock||g.pos>i||skipClosingAndOpening(g,!0,!1)<i)&&a.parent.content.cut(a.parentOffset).eq(g.parent.content)}(A,L.start,L.endA,U,H)&&r.someProp("handleKeyDown",function(o){return o(r,keyEvent(8,"Backspace"))}))W&&z&&r.domObserver.suppressSelectionUpdates();else{z&&L.endB==L.start&&(r.input.lastChromeDelete=Date.now()),W&&!G&&U.start()!=H.start()&&0==H.parentOffset&&U.depth==H.depth&&P.sel&&P.sel.anchor==P.sel.head&&P.sel.head==L.endA&&(L.endB-=2,H=P.doc.resolveNoCache(L.endB-P.from),setTimeout(function(){r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))})},20));var J,Y=L.start,X=L.endA,Q=function mkTr(o){var i=o||r.state.tr.replace(Y,X,P.doc.slice(L.start-P.from,L.endB-P.from));if(P.sel){var a=resolveSelection(r,i.doc,P.sel);a&&!(z&&r.composing&&a.empty&&(L.start!=L.endB||r.input.lastChromeDelete<Date.now()-100)&&(a.head==Y||a.head==i.mapping.map(X)-1)||N&&a.empty&&a.head==Y)&&i.setSelection(a)}return g&&i.setMeta("composition",g),i.scrollIntoView()};if(G)if(U.pos==H.pos){N&&R<=11&&0==U.parentOffset&&(r.domObserver.suppressSelectionUpdates(),setTimeout(function(){return selectionToDOM(r)},20));var Z=Q(r.state.tr.delete(Y,X)),ee=A.resolve(L.start).marksAcross(A.resolve(L.endA));ee&&Z.ensureMarks(ee),r.dispatch(Z)}else if(L.endA==L.endB&&(J=function isMarkChange(r,o){for(var i,a,u,p=r.firstChild.marks,g=o.firstChild.marks,v=p,b=g,k=0;k<g.length;k++)v=g[k].removeFromSet(v);for(var E=0;E<p.length;E++)b=p[E].removeFromSet(b);if(1==v.length&&0==b.length)a=v[0],i="add",u=function update(r){return r.mark(a.addToSet(r.marks))};else{if(0!=v.length||1!=b.length)return null;a=b[0],i="remove",u=function update(r){return r.mark(a.removeFromSet(r.marks))}}for(var w=[],x=0;x<o.childCount;x++)w.push(u(o.child(x)));if(c.Fragment.from(w).eq(r))return{mark:a,type:i}}(U.parent.content.cut(U.parentOffset,H.parentOffset),K.parent.content.cut(K.parentOffset,L.endA-K.start())))){var te=Q(r.state.tr);"add"==J.type?te.addMark(Y,X,J.mark):te.removeMark(Y,X,J.mark),r.dispatch(te)}else if(U.parent.child(U.index()).isText&&U.index()==H.index()-(H.textOffset?0:1)){var ne=U.parent.textBetween(U.parentOffset,H.parentOffset),re=function deflt(){return Q(r.state.tr.insertText(ne,Y,X))};r.someProp("handleTextInput",function(o){return o(r,Y,X,ne,re)})||r.dispatch(re())}else r.dispatch(Q());else r.dispatch(Q())}}}}function resolveSelection(r,o,i){return Math.max(i.anchor,i.head)>o.content.size?null:selectionBetween(r,o.resolve(i.anchor),o.resolve(i.head))}function skipClosingAndOpening(r,o,i){for(var a=r.depth,c=o?r.end():r.pos;a>0&&(o||r.indexAfter(a)==r.node(a).childCount);)a--,c++,o=!1;if(i)for(var u=r.node(a).maybeChild(r.indexAfter(a));u&&!u.isLeaf;)u=u.firstChild,c++;return c}function isSurrogatePair(r){if(2!=r.length)return!1;var o=r.charCodeAt(0),i=r.charCodeAt(1);return o>=56320&&o<=57343&&i>=55296&&i<=56319}var He=parseFromClipboard,We=endComposition,qe=function(){function EditorView(r,o){var i=this;_classCallCheck(this,EditorView),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ke,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=o,this.state=o.state,this.directPlugins=o.plugins||[],this.directPlugins.forEach(checkStateComponent),this.dispatch=this.dispatch.bind(this),this.dom=r&&r.mount||document.createElement("div"),r&&(r.appendChild?r.appendChild(this.dom):"function"==typeof r?r(this.dom):r.mount&&(this.mounted=!0)),this.editable=getEditable(this),updateCursorWrapper(this),this.nodeViews=buildNodeViews(this),this.docView=docViewDesc(this.state.doc,computeDocDeco(this),viewDecorations(this),this.dom,this),this.domObserver=new Be(this,function(r,o,a,c){return readDOMChange(i,r,o,a,c)}),this.domObserver.start(),function initInput(r){var o=function _loop2(){var o=ve[i];r.dom.addEventListener(i,r.input.eventHandlers[i]=function(i){!function eventBelongsToView(r,o){if(!o.bubbles)return!0;if(o.defaultPrevented)return!1;for(var i=o.target;i!=r.dom;i=i.parentNode)if(!i||11==i.nodeType||i.pmViewDesc&&i.pmViewDesc.stopEvent(o))return!1;return!0}(r,i)||runCustomHandler(r,i)||!r.editable&&i.type in ye||o(r,i)},be[i]?{passive:!0}:void 0)};for(var i in ve)o();B&&r.dom.addEventListener("input",function(){return null}),ensureListeners(r)}(this),this.updatePluginViews()}return _createClass(EditorView,[{key:"composing",get:function get(){return this.input.composing}},{key:"props",get:function get(){if(this._props.state!=this.state){var r=this._props;for(var o in this._props={},r)this._props[o]=r[o];this._props.state=this.state}return this._props}},{key:"update",value:function update(r){r.handleDOMEvents!=this._props.handleDOMEvents&&ensureListeners(this);var o=this._props;this._props=r,r.plugins&&(r.plugins.forEach(checkStateComponent),this.directPlugins=r.plugins),this.updateStateInner(r.state,o)}},{key:"setProps",value:function setProps(r){var o={};for(var i in this._props)o[i]=this._props[i];for(var a in o.state=this.state,r)o[a]=r[a];this.update(o)}},{key:"updateState",value:function updateState(r){this.updateStateInner(r,this._props)}},{key:"updateStateInner",value:function updateStateInner(r,o){var i,a=this.state,c=!1,u=!1;r.storedMarks&&this.composing&&(clearComposition(this),u=!0),this.state=r;var p=a.plugins!=r.plugins||this._props.plugins!=o.plugins;if(p||this._props.plugins!=o.plugins||this._props.nodeViews!=o.nodeViews){var g=buildNodeViews(this);(function changedNodeViews(r,o){var i=0,a=0;for(var c in r){if(r[c]!=o[c])return!0;i++}for(var u in o)a++;return i!=a})(g,this.nodeViews)&&(this.nodeViews=g,c=!0)}(p||o.handleDOMEvents!=this._props.handleDOMEvents)&&ensureListeners(this),this.editable=getEditable(this),updateCursorWrapper(this);var v=viewDecorations(this),b=computeDocDeco(this),E=a.plugins==r.plugins||a.doc.eq(r.doc)?r.scrollToSelection>a.scrollToSelection?"to selection":"preserve":"reset",w=c||!this.docView.matchesNode(r.doc,b,v);!w&&r.selection.eq(a.selection)||(u=!0);var x="preserve"==E&&u&&null==this.dom.style.overflowAnchor&&function storeScrollPos(r){for(var o,i,a=r.dom.getBoundingClientRect(),c=Math.max(0,a.top),u=(a.left+a.right)/2,p=c+1;p<Math.min(innerHeight,a.bottom);p+=5){var g=r.root.elementFromPoint(u,p);if(g&&g!=r.dom&&r.dom.contains(g)){var v=g.getBoundingClientRect();if(v.top>=c-20){o=g,i=v.top;break}}}return{refDOM:o,refTop:i,stack:scrollStack(r.dom)}}(this);if(u){this.domObserver.stop();var C=w&&(N||z)&&!this.composing&&!a.selection.empty&&!r.selection.empty&&function selectionContextChanged(r,o){var i=Math.min(r.$anchor.sharedDepth(r.head),o.$anchor.sharedDepth(o.head));return r.$anchor.start(i)!=o.$anchor.start(i)}(a.selection,r.selection);if(w){var _=z?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=findCompositionNode(this)),!c&&this.docView.update(r.doc,b,v,this)||(this.docView.updateOuterDeco(b),this.docView.destroy(),this.docView=docViewDesc(r.doc,b,v,this.dom,this)),!_||this.trackWrites&&this.dom.contains(this.trackWrites)||(C=!0)}C||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function anchorInRightPlace(r){var o=r.docView.domFromPos(r.state.selection.anchor,0),i=r.domSelectionRange();return k(o.node,o.offset,i.anchorNode,i.anchorOffset)}(this))?selectionToDOM(this,C):(syncNodeSelection(this,r.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(a),(null===(i=this.dragging)||void 0===i?void 0:i.node)&&!a.doc.eq(r.doc)&&this.updateDraggedNode(this.dragging,a),"reset"==E?this.dom.scrollTop=0:"to selection"==E?this.scrollToSelection():x&&function resetScrollPos(r){var o=r.refDOM,i=r.refTop,a=r.stack,c=o?o.getBoundingClientRect().top:0;restoreScrollStack(a,0==c?0:c-i)}(x)}},{key:"scrollToSelection",value:function scrollToSelection(){var r=this,o=this.domSelectionRange().focusNode;if(o&&this.dom.contains(1==o.nodeType?o:o.parentNode))if(this.someProp("handleScrollToSelection",function(o){return o(r)}));else if(this.state.selection instanceof a.NodeSelection){var i=this.docView.domAfterPos(this.state.selection.from);1==i.nodeType&&scrollRectIntoView(this,i.getBoundingClientRect(),o)}else scrollRectIntoView(this,this.coordsAtPos(this.state.selection.head,1),o);else;}},{key:"destroyPluginViews",value:function destroyPluginViews(){for(var r;r=this.pluginViews.pop();)r.destroy&&r.destroy()}},{key:"updatePluginViews",value:function updatePluginViews(r){if(r&&r.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var o=0;o<this.pluginViews.length;o++){var i=this.pluginViews[o];i.update&&i.update(this,r)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var a=0;a<this.directPlugins.length;a++){var c=this.directPlugins[a];c.spec.view&&this.pluginViews.push(c.spec.view(this))}for(var u=0;u<this.state.plugins.length;u++){var p=this.state.plugins[u];p.spec.view&&this.pluginViews.push(p.spec.view(this))}}}},{key:"updateDraggedNode",value:function updateDraggedNode(r,o){var i=r.node,c=-1;if(this.state.doc.nodeAt(i.from)==i.node)c=i.from;else{var u=i.from+(this.state.doc.content.size-o.doc.content.size);(u>0&&this.state.doc.nodeAt(u))==i.node&&(c=u)}this.dragging=new Ce(r.slice,r.move,c<0?void 0:a.NodeSelection.create(this.state.doc,c))}},{key:"someProp",value:function someProp(r,o){var i,a=this._props&&this._props[r];if(null!=a&&(i=o?o(a):a))return i;for(var c=0;c<this.directPlugins.length;c++){var u=this.directPlugins[c].props[r];if(null!=u&&(i=o?o(u):u))return i}var p=this.state.plugins;if(p)for(var g=0;g<p.length;g++){var v=p[g].props[r];if(null!=v&&(i=o?o(v):v))return i}}},{key:"hasFocus",value:function hasFocus(){if(N){var r=this.root.activeElement;if(r==this.dom)return!0;if(!r||!this.dom.contains(r))return!1;for(;r&&this.dom!=r&&this.dom.contains(r);){if("false"==r.contentEditable)return!1;r=r.parentElement}return!0}return this.root.activeElement==this.dom}},{key:"focus",value:function focus(){this.domObserver.stop(),this.editable&&function focusPreventScroll(r){if(r.setActive)return r.setActive();if(J)return r.focus(J);var o=scrollStack(r);r.focus(null==J?{get preventScroll(){return J={preventScroll:!0},!0}}:void 0),J||(J=!1,restoreScrollStack(o,0))}(this.dom),selectionToDOM(this),this.domObserver.start()}},{key:"root",get:function get(){var r=this,o=this._root;if(null==o)for(var i,a=function _loop5(o){if(9==o.nodeType||11==o.nodeType&&o.host)return o.getSelection||(Object.getPrototypeOf(o).getSelection=function(){return o.ownerDocument.getSelection()}),{v:r._root=o}},c=this.dom.parentNode;c;c=c.parentNode)if(i=a(c))return i.v;return o||document}},{key:"updateRoot",value:function updateRoot(){this._root=null}},{key:"posAtCoords",value:function posAtCoords(r){return _posAtCoords(this,r)}},{key:"coordsAtPos",value:function coordsAtPos(r){return _coordsAtPos(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}},{key:"domAtPos",value:function domAtPos(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(r,o)}},{key:"nodeDOM",value:function nodeDOM(r){var o=this.docView.descAt(r);return o?o.nodeDOM:null}},{key:"posAtDOM",value:function posAtDOM(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=this.docView.posFromDOM(r,o,i);if(null==a)throw new RangeError("DOM position not inside the editor");return a}},{key:"endOfTextblock",value:function endOfTextblock(r,o){return _endOfTextblock(this,o||this.state,r)}},{key:"pasteHTML",value:function pasteHTML(r,o){return doPaste(this,"",r,!1,o||new ClipboardEvent("paste"))}},{key:"pasteText",value:function pasteText(r,o){return doPaste(this,r,null,!0,o||new ClipboardEvent("paste"))}},{key:"serializeForClipboard",value:function serializeForClipboard(r){return _serializeForClipboard(this,r)}},{key:"destroy",value:function destroy(){this.docView&&(function destroyInput(r){for(var o in r.domObserver.stop(),r.input.eventHandlers)r.dom.removeEventListener(o,r.input.eventHandlers[o]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],viewDecorations(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,function clearReusedRange(){v=null}())}},{key:"isDestroyed",get:function get(){return null==this.docView}},{key:"dispatchEvent",value:function dispatchEvent(r){return function _dispatchEvent(r,o){runCustomHandler(r,o)||!ve[o.type]||!r.editable&&o.type in ye||ve[o.type](r,o)}(this,r)}},{key:"domSelectionRange",value:function domSelectionRange(){var r=this.domSelection();return r?B&&11===this.root.nodeType&&function deepActiveElement(r){for(var o=r.activeElement;o&&o.shadowRoot;)o=o.shadowRoot.activeElement;return o}(this.dom.ownerDocument)==this.dom&&function safariShadowSelectionRange(r,o){if(o.getComposedRanges){var i=o.getComposedRanges(r.root)[0];if(i)return rangeToSelectionRange(r,i)}var a;function read(r){r.preventDefault(),r.stopImmediatePropagation(),a=r.getTargetRanges()[0]}return r.dom.addEventListener("beforeinput",read,!0),document.execCommand("indent"),r.dom.removeEventListener("beforeinput",read,!0),a?rangeToSelectionRange(r,a):null}(this,r)||r:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}},{key:"domSelection",value:function domSelection(){return this.root.getSelection()}}]),EditorView}();function computeDocDeco(r){var o=Object.create(null);return o.class="ProseMirror",o.contenteditable=String(r.editable),r.someProp("attributes",function(i){if("function"==typeof i&&(i=i(r.state)),i)for(var a in i)"class"==a?o.class+=" "+i[a]:"style"==a?o.style=(o.style?o.style+";":"")+i[a]:o[a]||"contenteditable"==a||"nodeName"==a||(o[a]=String(i[a]))}),o.translate||(o.translate="no"),[Me.node(0,r.state.doc.content.size,o)]}function updateCursorWrapper(r){if(r.markCursor){var o=document.createElement("img");o.className="ProseMirror-separator",o.setAttribute("mark-placeholder","true"),o.setAttribute("alt",""),r.cursorWrapper={dom:o,deco:Me.widget(r.state.selection.from,o,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function getEditable(r){return!r.someProp("editable",function(o){return!1===o(r.state)})}function buildNodeViews(r){var o=Object.create(null);function add(r){for(var i in r)Object.prototype.hasOwnProperty.call(o,i)||(o[i]=r[i])}return r.someProp("nodeViews",add),r.someProp("markViews",add),o}function checkStateComponent(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}qe.prototype.dispatch=function(r){var o=this._props.dispatchTransaction;o?o.call(this,r):this.updateState(this.state.apply(r))},o.Decoration=Me,o.DecorationSet=Ie,o.EditorView=qe,o.__endComposition=We,o.__parseFromClipboard=He},50976:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Text:()=>b,default:()=>k}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248).Node.create({name:"text",group:"inline",parseMarkdown:r=>({type:"text",text:r.text||""}),renderMarkdown:r=>r.text||""}),k=b},54631:function(r,o,i){"use strict";i.r(o),i.d(o,{MultiToken:function(){return MultiToken},Options:function(){return Options},State:function(){return State},createTokenClass:function(){return createTokenClass},find:function(){return find},init:function(){return init},multi:function(){return Ze},options:function(){return Ge},regexp:function(){return je},registerCustomProtocol:function(){return registerCustomProtocol},registerPlugin:function(){return registerPlugin},registerTokenPlugin:function(){return registerTokenPlugin},reset:function(){return reset},stringToArray:function(){return stringToArray},test:function(){return test},text:function(){return Ze},tokenize:function(){return tokenize}});const a="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",c="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",u="numeric",p="ascii",g="alpha",v="asciinumeric",b="alphanumeric",k="domain",E="emoji",w="scheme",x="slashscheme",C="whitespace";function registerGroup(r,o){return r in o||(o[r]=[]),o[r]}function addToGroups(r,o,i){o[u]&&(o[v]=!0,o[b]=!0),o[p]&&(o[v]=!0,o[g]=!0),o[v]&&(o[b]=!0),o[g]&&(o[b]=!0),o[b]&&(o[k]=!0),o[E]&&(o[k]=!0);for(const a in o){const o=registerGroup(a,i);o.indexOf(r)<0&&o.push(r)}}function State(r=null){this.j={},this.jr=[],this.jd=null,this.t=r}State.groups={},State.prototype={accepts(){return!!this.t},go(r){const o=this,i=o.j[r];if(i)return i;for(let i=0;i<o.jr.length;i++){const a=o.jr[i][0],c=o.jr[i][1];if(c&&a.test(r))return c}return o.jd},has(r,o=!1){return o?r in this.j:!!this.go(r)},ta(r,o,i,a){for(let c=0;c<r.length;c++)this.tt(r[c],o,i,a)},tr(r,o,i,a){let c;return a=a||State.groups,o&&o.j?c=o:(c=new State(o),i&&a&&addToGroups(o,i,a)),this.jr.push([r,c]),c},ts(r,o,i,a){let c=this;const u=r.length;if(!u)return c;for(let o=0;o<u-1;o++)c=c.tt(r[o]);return c.tt(r[u-1],o,i,a)},tt(r,o,i,a){a=a||State.groups;const c=this;if(o&&o.j)return c.j[r]=o,o;const u=o;let p,g=c.go(r);if(g?(p=new State,Object.assign(p.j,g.j),p.jr.push.apply(p.jr,g.jr),p.jd=g.jd,p.t=g.t):p=new State,u){if(a)if(p.t&&"string"==typeof p.t){const r=Object.assign(function flagsForToken(r,o){const i={};for(const a in o)o[a].indexOf(r)>=0&&(i[a]=!0);return i}(p.t,a),i);addToGroups(u,r,a)}else i&&addToGroups(u,i,a);p.t=u}return c.j[r]=p,p}};const ta=(r,o,i,a,c)=>r.ta(o,i,a,c),tr=(r,o,i,a,c)=>r.tr(o,i,a,c),ts=(r,o,i,a,c)=>r.ts(o,i,a,c),tt=(r,o,i,a,c)=>r.tt(o,i,a,c),_="WORD",T="UWORD",P="ASCIINUMERICAL",A="ALPHANUMERICAL",N="LOCALHOST",R="TLD",I="UTLD",L="SCHEME",z="SLASH_SCHEME",j="NUM",B="WS",V="NL",U="OPENBRACE",H="CLOSEBRACE",W="OPENBRACKET",K="CLOSEBRACKET",G="OPENPAREN",J="CLOSEPAREN",Y="OPENANGLEBRACKET",X="CLOSEANGLEBRACKET",Q="FULLWIDTHLEFTPAREN",Z="FULLWIDTHRIGHTPAREN",ee="LEFTCORNERBRACKET",te="RIGHTCORNERBRACKET",ne="LEFTWHITECORNERBRACKET",re="RIGHTWHITECORNERBRACKET",oe="FULLWIDTHLESSTHAN",ie="FULLWIDTHGREATERTHAN",ae="AMPERSAND",se="APOSTROPHE",le="ASTERISK",ce="AT",ue="BACKSLASH",pe="BACKTICK",de="CARET",fe="COLON",he="COMMA",me="DOLLAR",ge="DOT",ve="EQUALS",ye="EXCLAMATION",be="HYPHEN",ke="PERCENT",Ee="PIPE",Se="PLUS",we="POUND",xe="QUERY",Ce="QUOTE",_e="FULLWIDTHMIDDLEDOT",Te="SEMI",Oe="SLASH",Pe="TILDE",Ae="UNDERSCORE",Me="EMOJI",Ne="SYM";var Re=Object.freeze({__proto__:null,ALPHANUMERICAL:A,AMPERSAND:ae,APOSTROPHE:se,ASCIINUMERICAL:P,ASTERISK:le,AT:ce,BACKSLASH:ue,BACKTICK:pe,CARET:de,CLOSEANGLEBRACKET:X,CLOSEBRACE:H,CLOSEBRACKET:K,CLOSEPAREN:J,COLON:fe,COMMA:he,DOLLAR:me,DOT:ge,EMOJI:Me,EQUALS:ve,EXCLAMATION:ye,FULLWIDTHGREATERTHAN:ie,FULLWIDTHLEFTPAREN:Q,FULLWIDTHLESSTHAN:oe,FULLWIDTHMIDDLEDOT:_e,FULLWIDTHRIGHTPAREN:Z,HYPHEN:be,LEFTCORNERBRACKET:ee,LEFTWHITECORNERBRACKET:ne,LOCALHOST:N,NL:V,NUM:j,OPENANGLEBRACKET:Y,OPENBRACE:U,OPENBRACKET:W,OPENPAREN:G,PERCENT:ke,PIPE:Ee,PLUS:Se,POUND:we,QUERY:xe,QUOTE:Ce,RIGHTCORNERBRACKET:te,RIGHTWHITECORNERBRACKET:re,SCHEME:L,SEMI:Te,SLASH:Oe,SLASH_SCHEME:z,SYM:Ne,TILDE:Pe,TLD:R,UNDERSCORE:Ae,UTLD:I,UWORD:T,WORD:_,WS:B});const Ie=/[a-z]/,De=/\p{L}/u,Le=/\p{Emoji}/u,Fe=/\d/,ze=/\s/;var je=Object.freeze({__proto__:null,ASCII_LETTER:Ie,DIGIT:Fe,EMOJI:Le,EMOJI_VARIATION:/\ufe0f/,LETTER:De,SPACE:ze});const Be="\r",Ve="\n",$e="️",Ue="‍",He="";let We=null,qe=null;function run$1(r,o){const i=stringToArray(o.replace(/[A-Z]/g,r=>r.toLowerCase())),a=i.length,c=[];let u=0,p=0;for(;p<a;){let g=r,v=null,b=0,k=null,E=-1,w=-1;for(;p<a&&(v=g.go(i[p]));)g=v,g.accepts()?(E=0,w=0,k=g):E>=0&&(E+=i[p].length,w++),b+=i[p].length,u+=i[p].length,p++;u-=E,p-=w,b-=E,c.push({t:k.t,v:o.slice(u-b,u),s:u-b,e:u})}return c}function stringToArray(r){const o=[],i=r.length;let a=0;for(;a<i;){let c,u=r.charCodeAt(a),p=u<55296||u>56319||a+1===i||(c=r.charCodeAt(a+1))<56320||c>57343?r[a]:r.slice(a,a+2);o.push(p),a+=p.length}return o}function fastts(r,o,i,a,c){let u;const p=o.length;for(let i=0;i<p-1;i++){const p=o[i];r.j[p]?u=r.j[p]:(u=new State(a),u.jr=c.slice(),r.j[p]=u),r=u}return u=new State(i),u.jr=c.slice(),r.j[o[p-1]]=u,u}function decodeTlds(r){const o=[],i=[];let a=0;for(;a<r.length;){let c=0;for(;"0123456789".indexOf(r[a+c])>=0;)c++;if(c>0){o.push(i.join(""));for(let o=parseInt(r.substring(a,a+c),10);o>0;o--)i.pop();a+=c}else i.push(r[a]),a++}return o}const Ke={defaultProtocol:"http",events:null,format:noop,formatHref:noop,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Options(r,o=null){let i=Object.assign({},Ke);r&&(i=Object.assign(i,r instanceof Options?r.o:r));const a=i.ignoreTags,c=[];for(let r=0;r<a.length;r++)c.push(a[r].toUpperCase());this.o=i,o&&(this.defaultRender=o),this.ignoreTags=c}function noop(r){return r}Options.prototype={o:Ke,ignoreTags:[],defaultRender(r){return r},check(r){return this.get("validate",r.toString(),r)},get(r,o,i){const a=null!=o;let c=this.o[r];return c?("object"==typeof c?(c=i.t in c?c[i.t]:Ke[r],"function"==typeof c&&a&&(c=c(o,i))):"function"==typeof c&&a&&(c=c(o,i.t,i)),c):c},getObj(r,o,i){let a=this.o[r];return"function"==typeof a&&null!=o&&(a=a(o,i.t,i)),a},render(r){const o=r.render(this);return(this.get("render",null,r)||this.defaultRender)(o,r.t,r)}};var Ge=Object.freeze({__proto__:null,Options:Options,defaults:Ke});function MultiToken(r,o){this.t="token",this.v=r,this.tk=o}function createTokenClass(r,o){class Token extends MultiToken{constructor(o,i){super(o,i),this.t=r}}for(const r in o)Token.prototype[r]=o[r];return Token.t=r,Token}MultiToken.prototype={isLink:!1,toString(){return this.v},toHref(r){return this.toString()},toFormattedString(r){const o=this.toString(),i=r.get("truncate",o,this),a=r.get("format",o,this);return i&&a.length>i?a.substring(0,i)+"…":a},toFormattedHref(r){return r.get("formatHref",this.toHref(r.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(r=Ke.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(r),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(r){return{type:this.t,value:this.toFormattedString(r),isLink:this.isLink,href:this.toFormattedHref(r),start:this.startIndex(),end:this.endIndex()}},validate(r){return r.get("validate",this.toString(),this)},render(r){const o=this,i=this.toHref(r.get("defaultProtocol")),a=r.get("formatHref",i,this),c=r.get("tagName",i,o),u=this.toFormattedString(r),p={},g=r.get("className",i,o),v=r.get("target",i,o),b=r.get("rel",i,o),k=r.getObj("attributes",i,o),E=r.getObj("events",i,o);return p.href=a,g&&(p.class=g),v&&(p.target=v),b&&(p.rel=b),k&&Object.assign(p,k),{tagName:c,attributes:p,content:u,eventListeners:E}}};const Je=createTokenClass("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ye=createTokenClass("text"),Xe=createTokenClass("nl"),Qe=createTokenClass("url",{isLink:!0,toHref(r=Ke.defaultProtocol){return this.hasProtocol()?this.v:`${r}://${this.v}`},hasProtocol(){const r=this.tk;return r.length>=2&&r[0].t!==N&&r[1].t===fe}});var Ze=Object.freeze({__proto__:null,Base:MultiToken,Email:Je,MultiToken:MultiToken,Nl:Xe,Text:Ye,Url:Qe,createTokenClass:createTokenClass});const makeState=r=>new State(r);function initMultiToken(r,o,i){const a=i[0].s,c=i[i.length-1].e;return new r(o.slice(a,c),i)}const et="undefined"!=typeof console&&console&&console.warn||(()=>{}),nt="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",rt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function reset(){return State.groups={},rt.scanner=null,rt.parser=null,rt.tokenQueue=[],rt.pluginQueue=[],rt.customSchemes=[],rt.initialized=!1,rt}function registerTokenPlugin(r,o){if("function"!=typeof o)throw new Error(`linkifyjs: Invalid token plugin ${o} (expects function)`);for(let i=0;i<rt.tokenQueue.length;i++)if(r===rt.tokenQueue[i][0])return et(`linkifyjs: token plugin "${r}" already registered - will be overwritten`),void(rt.tokenQueue[i]=[r,o]);rt.tokenQueue.push([r,o]),rt.initialized&&et(`linkifyjs: already initialized - will not register token plugin "${r}" ${nt}`)}function registerPlugin(r,o){if("function"!=typeof o)throw new Error(`linkifyjs: Invalid plugin ${o} (expects function)`);for(let i=0;i<rt.pluginQueue.length;i++)if(r===rt.pluginQueue[i][0])return et(`linkifyjs: plugin "${r}" already registered - will be overwritten`),void(rt.pluginQueue[i]=[r,o]);rt.pluginQueue.push([r,o]),rt.initialized&&et(`linkifyjs: already initialized - will not register plugin "${r}" ${nt}`)}function registerCustomProtocol(r,o=!1){if(rt.initialized&&et(`linkifyjs: already initialized - will not register custom scheme "${r}" ${nt}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(r))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');rt.customSchemes.push([r,o])}function init(){rt.scanner=function init$2(r=[]){const o={};State.groups=o;const i=new State;null==We&&(We=decodeTlds(a)),null==qe&&(qe=decodeTlds(c)),tt(i,"'",se),tt(i,"{",U),tt(i,"}",H),tt(i,"[",W),tt(i,"]",K),tt(i,"(",G),tt(i,")",J),tt(i,"<",Y),tt(i,">",X),tt(i,"(",Q),tt(i,")",Z),tt(i,"「",ee),tt(i,"」",te),tt(i,"『",ne),tt(i,"』",re),tt(i,"<",oe),tt(i,">",ie),tt(i,"&",ae),tt(i,"*",le),tt(i,"@",ce),tt(i,"`",pe),tt(i,"^",de),tt(i,":",fe),tt(i,",",he),tt(i,"$",me),tt(i,".",ge),tt(i,"=",ve),tt(i,"!",ye),tt(i,"-",be),tt(i,"%",ke),tt(i,"|",Ee),tt(i,"+",Se),tt(i,"#",we),tt(i,"?",xe),tt(i,'"',Ce),tt(i,"/",Oe),tt(i,";",Te),tt(i,"~",Pe),tt(i,"_",Ae),tt(i,"\\",ue),tt(i,"・",_e);const je=tr(i,Fe,j,{[u]:!0});tr(je,Fe,je);const Ke=tr(je,Ie,P,{[v]:!0}),Ge=tr(je,De,A,{[b]:!0}),Je=tr(i,Ie,_,{[p]:!0});tr(Je,Fe,Ke),tr(Je,Ie,Je),tr(Ke,Fe,Ke),tr(Ke,Ie,Ke);const Ye=tr(i,De,T,{[g]:!0});tr(Ye,Ie),tr(Ye,Fe,Ge),tr(Ye,De,Ye),tr(Ge,Fe,Ge),tr(Ge,Ie),tr(Ge,De,Ge);const Xe=tt(i,Ve,V,{[C]:!0}),Qe=tt(i,Be,B,{[C]:!0}),Ze=tr(i,ze,B,{[C]:!0});tt(i,He,Ze),tt(Qe,Ve,Xe),tt(Qe,He,Ze),tr(Qe,ze,Ze),tt(Ze,Be),tt(Ze,Ve),tr(Ze,ze,Ze),tt(Ze,He,Ze);const et=tr(i,Le,Me,{[E]:!0});tt(et,"#"),tr(et,Le,et),tt(et,$e,et);const nt=tt(et,Ue);tt(nt,"#"),tr(nt,Le,et);const rt=[[Ie,Je],[Fe,Ke]],ot=[[Ie,null],[De,Ye],[Fe,Ge]];for(let r=0;r<We.length;r++)fastts(i,We[r],R,_,rt);for(let r=0;r<qe.length;r++)fastts(i,qe[r],I,T,ot);addToGroups(R,{tld:!0,ascii:!0},o),addToGroups(I,{utld:!0,alpha:!0},o),fastts(i,"file",L,_,rt),fastts(i,"mailto",L,_,rt),fastts(i,"http",z,_,rt),fastts(i,"https",z,_,rt),fastts(i,"ftp",z,_,rt),fastts(i,"ftps",z,_,rt),addToGroups(L,{scheme:!0,ascii:!0},o),addToGroups(z,{slashscheme:!0,ascii:!0},o),r=r.sort((r,o)=>r[0]>o[0]?1:-1);for(let o=0;o<r.length;o++){const a=r[o][0],c=r[o][1]?{[w]:!0}:{[x]:!0};a.indexOf("-")>=0?c[k]=!0:Ie.test(a)?Fe.test(a)?c[v]=!0:c[p]=!0:c[u]=!0,ts(i,a,a,c)}return ts(i,"localhost",N,{ascii:!0}),i.jd=new State(Ne),{start:i,tokens:Object.assign({groups:o},Re)}}(rt.customSchemes);for(let r=0;r<rt.tokenQueue.length;r++)rt.tokenQueue[r][1]({scanner:rt.scanner});rt.parser=function init$1({groups:r}){const o=r.domain.concat([ae,le,ce,ue,pe,de,me,ve,be,j,ke,Ee,Se,we,Oe,Ne,Pe,Ae]),i=[se,fe,he,ge,ye,ke,xe,Ce,Te,Y,X,U,H,K,W,G,J,Q,Z,ee,te,ne,re,oe,ie],a=[ae,se,le,ue,pe,de,me,ve,be,U,H,ke,Ee,Se,we,xe,Oe,Ne,Pe,Ae],c=makeState(),u=tt(c,Pe);ta(u,a,u),ta(u,r.domain,u);const p=makeState(),g=makeState(),v=makeState();ta(c,r.domain,p),ta(c,r.scheme,g),ta(c,r.slashscheme,v),ta(p,a,u),ta(p,r.domain,p);const b=tt(p,ce);tt(u,ce,b),tt(g,ce,b),tt(v,ce,b);const k=tt(u,ge);ta(k,a,u),ta(k,r.domain,u);const E=makeState();ta(b,r.domain,E),ta(E,r.domain,E);const w=tt(E,ge);ta(w,r.domain,E);const x=makeState(Je);ta(w,r.tld,x),ta(w,r.utld,x),tt(b,N,x);const C=tt(E,be);tt(C,be,C),ta(C,r.domain,E),ta(x,r.domain,E),tt(x,ge,w),tt(x,be,C);const _=tt(x,fe);ta(_,r.numeric,Je);const T=tt(p,be),P=tt(p,ge);tt(T,be,T),ta(T,r.domain,p),ta(P,a,u),ta(P,r.domain,p);const A=makeState(Qe);ta(P,r.tld,A),ta(P,r.utld,A),ta(A,r.domain,p),ta(A,a,u),tt(A,ge,P),tt(A,be,T),tt(A,ce,b);const R=tt(A,fe),I=makeState(Qe);ta(R,r.numeric,I);const L=makeState(Qe),z=makeState();ta(L,o,L),ta(L,i,z),ta(z,o,L),ta(z,i,z),tt(A,Oe,L),tt(I,Oe,L);const B=tt(g,fe),_e=tt(v,fe),Me=tt(_e,Oe),Ie=tt(Me,Oe);ta(g,r.domain,p),tt(g,ge,P),tt(g,be,T),ta(v,r.domain,p),tt(v,ge,P),tt(v,be,T),ta(B,r.domain,L),tt(B,Oe,L),tt(B,xe,L),ta(Ie,r.domain,L),ta(Ie,o,L),tt(Ie,Oe,L);const De=[[U,H],[W,K],[G,J],[Y,X],[Q,Z],[ee,te],[ne,re],[oe,ie]];for(let r=0;r<De.length;r++){const[a,c]=De[r],u=tt(L,a);tt(z,a,u),tt(u,c,L);const p=makeState(Qe);ta(u,o,p);const g=makeState();ta(u,i),ta(p,o,p),ta(p,i,g),ta(g,o,p),ta(g,i,g),tt(p,c,L),tt(g,c,L)}return tt(c,N,A),tt(c,V,Xe),{start:c,tokens:Re}}(rt.scanner.tokens);for(let r=0;r<rt.pluginQueue.length;r++)rt.pluginQueue[r][1]({scanner:rt.scanner,parser:rt.parser});return rt.initialized=!0,rt}function tokenize(r){return rt.initialized||init(),function run(r,o,i){let a=i.length,c=0,u=[],p=[];for(;c<a;){let g=r,v=null,b=null,k=0,E=null,w=-1;for(;c<a&&!(v=g.go(i[c].t));)p.push(i[c++]);for(;c<a&&(b=v||g.go(i[c].t));)v=null,g=b,g.accepts()?(w=0,E=g):w>=0&&w++,c++,k++;if(w<0)c-=k,c<a&&(p.push(i[c]),c++);else{p.length>0&&(u.push(initMultiToken(Ye,o,p)),p=[]),c-=w,k-=w;const r=E.t,a=i.slice(c-k,c);u.push(initMultiToken(r,o,a))}}return p.length>0&&u.push(initMultiToken(Ye,o,p)),u}(rt.parser.start,r,run$1(rt.scanner.start,r))}function find(r,o=null,i=null){if(o&&"object"==typeof o){if(i)throw Error(`linkifyjs: Invalid link type ${o}; must be a string`);i=o,o=null}const a=new Options(i),c=tokenize(r),u=[];for(let r=0;r<c.length;r++){const i=c[r];!i.isLink||o&&i.t!==o||!a.check(i)||u.push(i.toFormattedObject(a))}return u}function test(r,o=null){const i=tokenize(r);return 1===i.length&&i[0].isLink&&(!o||i[0].t===o)}tokenize.scan=run$1},57449:function(r,o,i){"use strict";var a=i(36553),c=i(77712),u=i(37820),p=function deleteSelection(r,o){return!r.selection.empty&&(o&&o(r.tr.deleteSelection().scrollIntoView()),!0)};function atBlockStart(r,o){var i=r.selection.$cursor;return!i||(o?!o.endOfTextblock("backward",r):i.parentOffset>0)?null:i}var g=function joinBackward(r,o,i){var p=atBlockStart(r,i);if(!p)return!1;var g=findCutBefore(p);if(!g){var v=p.blockRange(),b=v&&a.liftTarget(v);return null!=b&&(o&&o(r.tr.lift(v,b).scrollIntoView()),!0)}var k=g.nodeBefore;if(deleteBarrier(r,g,o,-1))return!0;if(0==p.parent.content.size&&(textblockAt(k,"end")||u.NodeSelection.isSelectable(k)))for(var E=p.depth;;E--){var w=a.replaceStep(r.doc,p.before(E),p.after(E),c.Slice.empty);if(w&&w.slice.size<w.to-w.from){if(o){var x=r.tr.step(w);x.setSelection(textblockAt(k,"end")?u.Selection.findFrom(x.doc.resolve(x.mapping.map(g.pos,-1)),-1):u.NodeSelection.create(x.doc,g.pos-k.nodeSize)),o(x.scrollIntoView())}return!0}if(1==E||p.node(E-1).childCount>1)break}return!(!k.isAtom||g.depth!=p.depth-1)&&(o&&o(r.tr.delete(g.pos-k.nodeSize,g.pos).scrollIntoView()),!0)};function joinTextblocksAround(r,o,i){for(var p=o.nodeBefore,g=o.pos-1;!p.isTextblock;g--){if(p.type.spec.isolating)return!1;var v=p.lastChild;if(!v)return!1;p=v}for(var b=o.nodeAfter,k=o.pos+1;!b.isTextblock;k++){if(b.type.spec.isolating)return!1;var E=b.firstChild;if(!E)return!1;b=E}var w=a.replaceStep(r.doc,g,k,c.Slice.empty);if(!w||w.from!=g||w instanceof a.ReplaceStep&&w.slice.size>=k-g)return!1;if(i){var x=r.tr.step(w);x.setSelection(u.TextSelection.create(x.doc,g)),i(x.scrollIntoView())}return!0}function textblockAt(r,o){for(var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=r;a;a="start"==o?a.firstChild:a.lastChild){if(a.isTextblock)return!0;if(i&&1!=a.childCount)return!1}return!1}var v=function selectNodeBackward(r,o,i){var a=r.selection,c=a.$head,p=c;if(!a.empty)return!1;if(c.parent.isTextblock){if(i?!i.endOfTextblock("backward",r):c.parentOffset>0)return!1;p=findCutBefore(c)}var g=p&&p.nodeBefore;return!(!g||!u.NodeSelection.isSelectable(g))&&(o&&o(r.tr.setSelection(u.NodeSelection.create(r.doc,p.pos-g.nodeSize)).scrollIntoView()),!0)};function findCutBefore(r){if(!r.parent.type.spec.isolating)for(var o=r.depth-1;o>=0;o--){if(r.index(o)>0)return r.doc.resolve(r.before(o+1));if(r.node(o).type.spec.isolating)break}return null}function atBlockEnd(r,o){var i=r.selection.$cursor;return!i||(o?!o.endOfTextblock("forward",r):i.parentOffset<i.parent.content.size)?null:i}var b=function joinForward(r,o,i){var p=atBlockEnd(r,i);if(!p)return!1;var g=findCutAfter(p);if(!g)return!1;var v=g.nodeAfter;if(deleteBarrier(r,g,o,1))return!0;if(0==p.parent.content.size&&(textblockAt(v,"start")||u.NodeSelection.isSelectable(v))){var b=a.replaceStep(r.doc,p.before(),p.after(),c.Slice.empty);if(b&&b.slice.size<b.to-b.from){if(o){var k=r.tr.step(b);k.setSelection(textblockAt(v,"start")?u.Selection.findFrom(k.doc.resolve(k.mapping.map(g.pos)),1):u.NodeSelection.create(k.doc,k.mapping.map(g.pos))),o(k.scrollIntoView())}return!0}}return!(!v.isAtom||g.depth!=p.depth-1)&&(o&&o(r.tr.delete(g.pos,g.pos+v.nodeSize).scrollIntoView()),!0)},k=function selectNodeForward(r,o,i){var a=r.selection,c=a.$head,p=c;if(!a.empty)return!1;if(c.parent.isTextblock){if(i?!i.endOfTextblock("forward",r):c.parentOffset<c.parent.content.size)return!1;p=findCutAfter(c)}var g=p&&p.nodeAfter;return!(!g||!u.NodeSelection.isSelectable(g))&&(o&&o(r.tr.setSelection(u.NodeSelection.create(r.doc,p.pos)).scrollIntoView()),!0)};function findCutAfter(r){if(!r.parent.type.spec.isolating)for(var o=r.depth-1;o>=0;o--){var i=r.node(o);if(r.index(o)+1<i.childCount)return r.doc.resolve(r.after(o+1));if(i.type.spec.isolating)break}return null}var E=function newlineInCode(r,o){var i=r.selection,a=i.$head,c=i.$anchor;return!(!a.parent.type.spec.code||!a.sameParent(c))&&(o&&o(r.tr.insertText("\n").scrollIntoView()),!0)};function defaultBlockAt(r){for(var o=0;o<r.edgeCount;o++){var i=r.edge(o).type;if(i.isTextblock&&!i.hasRequiredAttrs())return i}return null}var w=function exitCode(r,o){var i=r.selection,a=i.$head,c=i.$anchor;if(!a.parent.type.spec.code||!a.sameParent(c))return!1;var p=a.node(-1),g=a.indexAfter(-1),v=defaultBlockAt(p.contentMatchAt(g));if(!v||!p.canReplaceWith(g,g,v))return!1;if(o){var b=a.after(),k=r.tr.replaceWith(b,b,v.createAndFill());k.setSelection(u.Selection.near(k.doc.resolve(b),1)),o(k.scrollIntoView())}return!0},x=function createParagraphNear(r,o){var i=r.selection,a=i.$from,c=i.$to;if(i instanceof u.AllSelection||a.parent.inlineContent||c.parent.inlineContent)return!1;var p=defaultBlockAt(c.parent.contentMatchAt(c.indexAfter()));if(!p||!p.isTextblock)return!1;if(o){var g=(!a.parentOffset&&c.index()<c.parent.childCount?a:c).pos,v=r.tr.insert(g,p.createAndFill());v.setSelection(u.TextSelection.create(v.doc,g+1)),o(v.scrollIntoView())}return!0},C=function liftEmptyBlock(r,o){var i=r.selection.$cursor;if(!i||i.parent.content.size)return!1;if(i.depth>1&&i.after()!=i.end(-1)){var c=i.before();if(a.canSplit(r.doc,c))return o&&o(r.tr.split(c).scrollIntoView()),!0}var u=i.blockRange(),p=u&&a.liftTarget(u);return null!=p&&(o&&o(r.tr.lift(u,p).scrollIntoView()),!0)};function splitBlockAs(r){return function(o,i){var c=o.selection,p=c.$from,g=c.$to;if(o.selection instanceof u.NodeSelection&&o.selection.node.isBlock)return!(!p.parentOffset||!a.canSplit(o.doc,p.pos))&&(i&&i(o.tr.split(p.pos).scrollIntoView()),!0);if(!p.depth)return!1;for(var v,b,k=[],E=!1,w=!1,x=p.depth;;x--){if(p.node(x).isBlock){E=p.end(x)==p.pos+(p.depth-x),w=p.start(x)==p.pos-(p.depth-x),b=defaultBlockAt(p.node(x-1).contentMatchAt(p.indexAfter(x-1)));var C=r&&r(g.parent,E,p);k.unshift(C||(E&&b?{type:b}:null)),v=x;break}if(1==x)return!1;k.unshift(null)}var _=o.tr;(o.selection instanceof u.TextSelection||o.selection instanceof u.AllSelection)&&_.deleteSelection();var T=_.mapping.map(p.pos),P=a.canSplit(_.doc,T,k.length,k);if(P||(k[0]=b?{type:b}:null,P=a.canSplit(_.doc,T,k.length,k)),!P)return!1;if(_.split(T,k.length,k),!E&&w&&p.node(v).type!=b){var A=_.mapping.map(p.before(v)),N=_.doc.resolve(A);b&&p.node(v-1).canReplaceWith(N.index(),N.index()+1,b)&&_.setNodeMarkup(_.mapping.map(p.before(v)),b)}return i&&i(_.scrollIntoView()),!0}}var _=splitBlockAs(),T=function selectAll(r,o){return o&&o(r.tr.setSelection(new u.AllSelection(r.doc))),!0};function deleteBarrier(r,o,i,p){var g,v,b=o.nodeBefore,k=o.nodeAfter,E=b.type.spec.isolating||k.type.spec.isolating;if(!E&&function joinMaybeClear(r,o,i){var c=o.nodeBefore,u=o.nodeAfter,p=o.index();return!(!(c&&u&&c.type.compatibleContent(u.type))||(!c.content.size&&o.parent.canReplace(p-1,p)?(i&&i(r.tr.delete(o.pos-c.nodeSize,o.pos).scrollIntoView()),0):!o.parent.canReplace(p,p+1)||!u.isTextblock&&!a.canJoin(r.doc,o.pos)||(i&&i(r.tr.join(o.pos).scrollIntoView()),0)))}(r,o,i))return!0;var w=!E&&o.parent.canReplace(o.index(),o.index()+1);if(w&&(g=(v=b.contentMatchAt(b.childCount)).findWrapping(k.type))&&v.matchType(g[0]||k.type).validEnd){if(i){for(var x=o.pos+k.nodeSize,C=c.Fragment.empty,_=g.length-1;_>=0;_--)C=c.Fragment.from(g[_].create(null,C));C=c.Fragment.from(b.copy(C));var T=r.tr.step(new a.ReplaceAroundStep(o.pos-1,x,o.pos,x,new c.Slice(C,1,0),g.length,!0)),P=T.doc.resolve(x+2*g.length);P.nodeAfter&&P.nodeAfter.type==b.type&&a.canJoin(T.doc,P.pos)&&T.join(P.pos),i(T.scrollIntoView())}return!0}var A=k.type.spec.isolating||p>0&&E?null:u.Selection.findFrom(o,1),N=A&&A.$from.blockRange(A.$to),R=N&&a.liftTarget(N);if(null!=R&&R>=o.depth)return i&&i(r.tr.lift(N,R).scrollIntoView()),!0;if(w&&textblockAt(k,"start",!0)&&textblockAt(b,"end")){for(var I=b,L=[];L.push(I),!I.isTextblock;)I=I.lastChild;for(var z=k,j=1;!z.isTextblock;z=z.firstChild)j++;if(I.canReplace(I.childCount,I.childCount,z.content)){if(i){for(var B=c.Fragment.empty,V=L.length-1;V>=0;V--)B=c.Fragment.from(L[V].copy(B));i(r.tr.step(new a.ReplaceAroundStep(o.pos-L.length,o.pos+k.nodeSize,o.pos+j,o.pos+k.nodeSize-j,new c.Slice(B,L.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function selectTextblockSide(r){return function(o,i){for(var a=o.selection,c=r<0?a.$from:a.$to,p=c.depth;c.node(p).isInline;){if(!p)return!1;p--}return!!c.node(p).isTextblock&&(i&&i(o.tr.setSelection(u.TextSelection.create(o.doc,r<0?c.start(p):c.end(p)))),!0)}}var P=selectTextblockSide(-1),A=selectTextblockSide(1);function chainCommands(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return function(r,i,a){for(var c=0;c<o.length;c++)if(o[c](r,i,a))return!0;return!1}}var N=chainCommands(p,g,v),R=chainCommands(p,b,k),I={Enter:chainCommands(E,x,C,_),"Mod-Enter":w,Backspace:N,"Mod-Backspace":N,"Shift-Backspace":N,Delete:R,"Mod-Delete":R,"Mod-a":T},L={"Ctrl-h":I.Backspace,"Alt-Backspace":I["Mod-Backspace"],"Ctrl-d":I.Delete,"Ctrl-Alt-Backspace":I["Mod-Delete"],"Alt-Delete":I["Mod-Delete"],"Alt-d":I["Mod-Delete"],"Ctrl-a":P,"Ctrl-e":A};for(var z in I)L[z]=I[z];var j=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?L:I;o.autoJoin=function autoJoin(r,o){var i=Array.isArray(o)?function(r){return o.indexOf(r.type.name)>-1}:o;return function(o,c,u){return r(o,c&&function wrapDispatchForJoin(r,o){return function(i){if(!i.isGeneric)return r(i);for(var c=[],u=0;u<i.mapping.maps.length;u++){for(var p=i.mapping.maps[u],g=0;g<c.length;g++)c[g]=p.map(c[g]);p.forEach(function(r,o,i,a){return c.push(i,a)})}for(var v=[],b=0;b<c.length;b+=2)for(var k=c[b],E=c[b+1],w=i.doc.resolve(k),x=w.sharedDepth(E),C=w.node(x),_=w.indexAfter(x),T=w.after(x+1);T<=E;++_){var P=C.maybeChild(_);if(!P)break;if(_&&-1==v.indexOf(T)){var A=C.child(_-1);A.type==P.type&&o(A,P)&&v.push(T)}T+=P.nodeSize}v.sort(function(r,o){return r-o});for(var N=v.length-1;N>=0;N--)a.canJoin(i.doc,v[N])&&i.join(v[N]);r(i)}}(c,i),u)}},o.baseKeymap=j,o.chainCommands=chainCommands,o.createParagraphNear=x,o.deleteSelection=p,o.exitCode=w,o.joinBackward=g,o.joinDown=function joinDown(r,o){var i,c=r.selection;if(c instanceof u.NodeSelection){if(c.node.isTextblock||!a.canJoin(r.doc,c.to))return!1;i=c.to}else if(null==(i=a.joinPoint(r.doc,c.to,1)))return!1;return o&&o(r.tr.join(i).scrollIntoView()),!0},o.joinForward=b,o.joinTextblockBackward=function joinTextblockBackward(r,o,i){var a=atBlockStart(r,i);if(!a)return!1;var c=findCutBefore(a);return!!c&&joinTextblocksAround(r,c,o)},o.joinTextblockForward=function joinTextblockForward(r,o,i){var a=atBlockEnd(r,i);if(!a)return!1;var c=findCutAfter(a);return!!c&&joinTextblocksAround(r,c,o)},o.joinUp=function joinUp(r,o){var i,c=r.selection,p=c instanceof u.NodeSelection;if(p){if(c.node.isTextblock||!a.canJoin(r.doc,c.from))return!1;i=c.from}else if(null==(i=a.joinPoint(r.doc,c.from,-1)))return!1;if(o){var g=r.tr.join(i);p&&g.setSelection(u.NodeSelection.create(g.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),o(g.scrollIntoView())}return!0},o.lift=function lift(r,o){var i=r.selection,c=i.$from,u=i.$to,p=c.blockRange(u),g=p&&a.liftTarget(p);return null!=g&&(o&&o(r.tr.lift(p,g).scrollIntoView()),!0)},o.liftEmptyBlock=C,o.macBaseKeymap=L,o.newlineInCode=E,o.pcBaseKeymap=I,o.selectAll=T,o.selectNodeBackward=v,o.selectNodeForward=k,o.selectParentNode=function selectParentNode(r,o){var i,a=r.selection,c=a.$from,p=a.to,g=c.sharedDepth(p);return 0!=g&&(i=c.before(g),o&&o(r.tr.setSelection(u.NodeSelection.create(r.doc,i))),!0)},o.selectTextblockEnd=A,o.selectTextblockStart=P,o.setBlockType=function setBlockType(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(i,a){for(var c=!1,u=0;u<i.selection.ranges.length&&!c;u++){var p=i.selection.ranges[u],g=p.$from.pos,v=p.$to.pos;i.doc.nodesBetween(g,v,function(a,u){if(c)return!1;if(a.isTextblock&&!a.hasMarkup(r,o))if(a.type==r)c=!0;else{var p=i.doc.resolve(u),g=p.index();c=p.parent.canReplaceWith(g,g+1,r)}})}if(!c)return!1;if(a){for(var b=i.tr,k=0;k<i.selection.ranges.length;k++){var E=i.selection.ranges[k],w=E.$from.pos,x=E.$to.pos;b.setBlockType(w,x,r,o)}a(b.scrollIntoView())}return!0}},o.splitBlock=_,o.splitBlockAs=splitBlockAs,o.splitBlockKeepMarks=function splitBlockKeepMarks(r,o){return _(r,o&&function(i){var a=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();a&&i.ensureMarks(a),o(i)})},o.toggleMark=function toggleMark(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,a=!1!==(i&&i.removeWhenPresent),c=!1!==(i&&i.enterInlineAtoms),p=!(i&&i.includeWhitespace);return function(i,g){var v=i.selection,b=v.empty,k=v.$cursor,E=v.ranges;if(b&&!k||!function markApplies(r,o,i,a){for(var c,u=function _loop(){var c=o[p],u=c.$from,g=c.$to,v=0==u.depth&&r.inlineContent&&r.type.allowsMarkType(i);if(r.nodesBetween(u.pos,g.pos,function(r,o){if(v||!a&&r.isAtom&&r.isInline&&o>=u.pos&&o+r.nodeSize<=g.pos)return!1;v=r.inlineContent&&r.type.allowsMarkType(i)}),v)return{v:!0}},p=0;p<o.length;p++)if(c=u())return c.v;return!1}(i.doc,E,r,c))return!1;if(g)if(k)r.isInSet(i.storedMarks||k.marks())?g(i.tr.removeStoredMark(r)):g(i.tr.addStoredMark(r.create(o)));else{var w,x=i.tr;c||(E=function removeInlineAtoms(r){for(var o=[],i=function _loop2(){var i=r[a],c=i.$from,p=i.$to;c.doc.nodesBetween(c.pos,p.pos,function(r,i){if(r.isAtom&&r.content.size&&r.isInline&&i>=c.pos&&i+r.nodeSize<=p.pos)return i+1>c.pos&&o.push(new u.SelectionRange(c,c.doc.resolve(i+1))),c=c.doc.resolve(i+1+r.content.size),!1}),c.pos<p.pos&&o.push(new u.SelectionRange(c,p))},a=0;a<r.length;a++)i();return o}(E)),w=a?!E.some(function(o){return i.doc.rangeHasMark(o.$from.pos,o.$to.pos,r)}):!E.every(function(o){var i=!1;return x.doc.nodesBetween(o.$from.pos,o.$to.pos,function(a,c,u){if(i)return!1;i=!r.isInSet(a.marks)&&!!u&&u.type.allowsMarkType(r)&&!(a.isText&&/^\s*$/.test(a.textBetween(Math.max(0,o.$from.pos-c),Math.min(a.nodeSize,o.$to.pos-c))))}),!i});for(var C=0;C<E.length;C++){var _=E[C],T=_.$from,P=_.$to;if(w){var A=T.pos,N=P.pos,R=T.nodeAfter,I=P.nodeBefore,L=p&&R&&R.isText?/^\s*/.exec(R.text)[0].length:0,z=p&&I&&I.isText?/\s*$/.exec(I.text)[0].length:0;A+L<N&&(A+=L,N-=z),x.addMark(A,N,r.create(o))}else x.removeMark(T.pos,P.pos,r)}g(x.scrollIntoView())}return!0}},o.wrapIn=function wrapIn(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(i,c){var u=i.selection,p=u.$from,g=u.$to,v=p.blockRange(g),b=v&&a.findWrapping(v,r,o);return!!b&&(c&&c(i.tr.wrap(v,b).scrollIntoView()),!0)}}},58493:function(r,o,i){"use strict";var a=i(97557);var c="function"==typeof Object.is?Object.is:function is(r,o){return r===o&&(0!==r||1/r==1/o)||r!=r&&o!=o},u=a.useState,p=a.useEffect,g=a.useLayoutEffect,v=a.useDebugValue;function checkIfSnapshotChanged(r){var o=r.getSnapshot;r=r.value;try{var i=o();return!c(r,i)}catch(r){return!0}}var b="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function useSyncExternalStore$1(r,o){return o()}:function useSyncExternalStore$2(r,o){var i=o(),a=u({inst:{value:i,getSnapshot:o}}),c=a[0].inst,b=a[1];return g(function(){c.value=i,c.getSnapshot=o,checkIfSnapshotChanged(c)&&b({inst:c})},[r,i,o]),p(function(){return checkIfSnapshotChanged(c)&&b({inst:c}),r(function(){checkIfSnapshotChanged(c)&&b({inst:c})})},[r]),v(i),i};o.useSyncExternalStore=void 0!==a.useSyncExternalStore?a.useSyncExternalStore:b},59618:function(r){"use strict";r.exports=window.elementorV2.schema},62430:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Document:()=>b,default:()=>k}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248).Node.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(r,o)=>r.content?o.renderChildren(r.content,"\n\n"):""}),k=b},63717:function(r){"use strict";function OrderedMap(r){this.content=r}OrderedMap.prototype={constructor:OrderedMap,find:function(r){for(var o=0;o<this.content.length;o+=2)if(this.content[o]===r)return o;return-1},get:function(r){var o=this.find(r);return-1==o?void 0:this.content[o+1]},update:function(r,o,i){var a=i&&i!=r?this.remove(i):this,c=a.find(r),u=a.content.slice();return-1==c?u.push(i||r,o):(u[c+1]=o,i&&(u[c]=i)),new OrderedMap(u)},remove:function(r){var o=this.find(r);if(-1==o)return this;var i=this.content.slice();return i.splice(o,2),new OrderedMap(i)},addToStart:function(r,o){return new OrderedMap([r,o].concat(this.remove(r).content))},addToEnd:function(r,o){var i=this.remove(r).content.slice();return i.push(r,o),new OrderedMap(i)},addBefore:function(r,o,i){var a=this.remove(o),c=a.content.slice(),u=a.find(r);return c.splice(-1==u?c.length:u,0,o,i),new OrderedMap(c)},forEach:function(r){for(var o=0;o<this.content.length;o+=2)r(this.content[o],this.content[o+1])},prepend:function(r){return(r=OrderedMap.from(r)).size?new OrderedMap(r.content.concat(this.subtract(r).content)):this},append:function(r){return(r=OrderedMap.from(r)).size?new OrderedMap(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var o=this;r=OrderedMap.from(r);for(var i=0;i<r.content.length;i+=2)o=o.remove(r.content[i]);return o},toObject:function(){var r={};return this.forEach(function(o,i){r[o]=i}),r},get size(){return this.content.length>>1}},OrderedMap.from=function(r){if(r instanceof OrderedMap)return r;var o=[];if(r)for(var i in r)o.push(i,r[i]);return new OrderedMap(o)},r.exports=OrderedMap},69242:function(r,o,i){"use strict";r.exports=i(22162)},70374:function(r){"use strict";r.exports=window.elementorV2.editorUi},70975:function(r){"use strict";r.exports=window.elementorV2.editorElements},74353:function(r){r.exports=function(){"use strict";var r=1e3,o=6e4,i=36e5,a="millisecond",c="second",u="minute",p="hour",g="day",v="week",b="month",k="quarter",E="year",w="date",x="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var o=["th","st","nd","rd"],i=r%100;return"["+r+(o[(i-20)%10]||o[i]||o[0])+"]"}},m=function(r,o,i){var a=String(r);return!a||a.length>=o?r:""+Array(o+1-a.length).join(i)+r},P={s:m,z:function(r){var o=-r.utcOffset(),i=Math.abs(o),a=Math.floor(i/60),c=i%60;return(o<=0?"+":"-")+m(a,2,"0")+":"+m(c,2,"0")},m:function t(r,o){if(r.date()<o.date())return-t(o,r);var i=12*(o.year()-r.year())+(o.month()-r.month()),a=r.clone().add(i,b),c=o-a<0,u=r.clone().add(i+(c?-1:1),b);return+(-(i+(o-a)/(c?a-u:u-a))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:b,y:E,w:v,d:g,D:w,h:p,m:u,s:c,ms:a,Q:k}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return void 0===r}},A="en",N={};N[A]=T;var R="$isDayjsObject",S=function(r){return r instanceof z||!(!r||!r[R])},I=function t(r,o,i){var a;if(!r)return A;if("string"==typeof r){var c=r.toLowerCase();N[c]&&(a=c),o&&(N[c]=o,a=c);var u=r.split("-");if(!a&&u.length>1)return t(u[0])}else{var p=r.name;N[p]=r,a=p}return!i&&a&&(A=a),a||!i&&A},O=function(r,o){if(S(r))return r.clone();var i="object"==typeof o?o:{};return i.date=r,i.args=arguments,new z(i)},L=P;L.l=I,L.i=S,L.w=function(r,o){return O(r,{locale:o.$L,utc:o.$u,x:o.$x,$offset:o.$offset})};var z=function(){function M(r){this.$L=I(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[R]=!0}var T=M.prototype;return T.parse=function(r){this.$d=function(r){var o=r.date,i=r.utc;if(null===o)return new Date(NaN);if(L.u(o))return new Date;if(o instanceof Date)return new Date(o);if("string"==typeof o&&!/Z$/i.test(o)){var a=o.match(C);if(a){var c=a[2]-1||0,u=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,u)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,u)}}return new Date(o)}(r),this.init()},T.init=function(){var r=this.$d;this.$y=r.getFullYear(),this.$M=r.getMonth(),this.$D=r.getDate(),this.$W=r.getDay(),this.$H=r.getHours(),this.$m=r.getMinutes(),this.$s=r.getSeconds(),this.$ms=r.getMilliseconds()},T.$utils=function(){return L},T.isValid=function(){return!(this.$d.toString()===x)},T.isSame=function(r,o){var i=O(r);return this.startOf(o)<=i&&i<=this.endOf(o)},T.isAfter=function(r,o){return O(r)<this.startOf(o)},T.isBefore=function(r,o){return this.endOf(o)<O(r)},T.$g=function(r,o,i){return L.u(r)?this[o]:this.set(i,r)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(r,o){var i=this,a=!!L.u(o)||o,k=L.p(r),l=function(r,o){var c=L.w(i.$u?Date.UTC(i.$y,o,r):new Date(i.$y,o,r),i);return a?c:c.endOf(g)},$=function(r,o){return L.w(i.toDate()[r].apply(i.toDate("s"),(a?[0,0,0,0]:[23,59,59,999]).slice(o)),i)},x=this.$W,C=this.$M,_=this.$D,T="set"+(this.$u?"UTC":"");switch(k){case E:return a?l(1,0):l(31,11);case b:return a?l(1,C):l(0,C+1);case v:var P=this.$locale().weekStart||0,A=(x<P?x+7:x)-P;return l(a?_-A:_+(6-A),C);case g:case w:return $(T+"Hours",0);case p:return $(T+"Minutes",1);case u:return $(T+"Seconds",2);case c:return $(T+"Milliseconds",3);default:return this.clone()}},T.endOf=function(r){return this.startOf(r,!1)},T.$set=function(r,o){var i,v=L.p(r),k="set"+(this.$u?"UTC":""),x=(i={},i[g]=k+"Date",i[w]=k+"Date",i[b]=k+"Month",i[E]=k+"FullYear",i[p]=k+"Hours",i[u]=k+"Minutes",i[c]=k+"Seconds",i[a]=k+"Milliseconds",i)[v],C=v===g?this.$D+(o-this.$W):o;if(v===b||v===E){var _=this.clone().set(w,1);_.$d[x](C),_.init(),this.$d=_.set(w,Math.min(this.$D,_.daysInMonth())).$d}else x&&this.$d[x](C);return this.init(),this},T.set=function(r,o){return this.clone().$set(r,o)},T.get=function(r){return this[L.p(r)]()},T.add=function(a,k){var w,x=this;a=Number(a);var C=L.p(k),y=function(r){var o=O(x);return L.w(o.date(o.date()+Math.round(r*a)),x)};if(C===b)return this.set(b,this.$M+a);if(C===E)return this.set(E,this.$y+a);if(C===g)return y(1);if(C===v)return y(7);var _=(w={},w[u]=o,w[p]=i,w[c]=r,w)[C]||1,T=this.$d.getTime()+a*_;return L.w(T,this)},T.subtract=function(r,o){return this.add(-1*r,o)},T.format=function(r){var o=this,i=this.$locale();if(!this.isValid())return i.invalidDate||x;var a=r||"YYYY-MM-DDTHH:mm:ssZ",c=L.z(this),u=this.$H,p=this.$m,g=this.$M,v=i.weekdays,b=i.months,k=i.meridiem,h=function(r,i,c,u){return r&&(r[i]||r(o,a))||c[i].slice(0,u)},d=function(r){return L.s(u%12||12,r,"0")},E=k||function(r,o,i){var a=r<12?"AM":"PM";return i?a.toLowerCase():a};return a.replace(_,function(r,a){return a||function(r){switch(r){case"YY":return String(o.$y).slice(-2);case"YYYY":return L.s(o.$y,4,"0");case"M":return g+1;case"MM":return L.s(g+1,2,"0");case"MMM":return h(i.monthsShort,g,b,3);case"MMMM":return h(b,g);case"D":return o.$D;case"DD":return L.s(o.$D,2,"0");case"d":return String(o.$W);case"dd":return h(i.weekdaysMin,o.$W,v,2);case"ddd":return h(i.weekdaysShort,o.$W,v,3);case"dddd":return v[o.$W];case"H":return String(u);case"HH":return L.s(u,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return E(u,p,!0);case"A":return E(u,p,!1);case"m":return String(p);case"mm":return L.s(p,2,"0");case"s":return String(o.$s);case"ss":return L.s(o.$s,2,"0");case"SSS":return L.s(o.$ms,3,"0");case"Z":return c}return null}(r)||c.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(a,w,x){var C,_=this,T=L.p(w),P=O(a),A=(P.utcOffset()-this.utcOffset())*o,N=this-P,D=function(){return L.m(_,P)};switch(T){case E:C=D()/12;break;case b:C=D();break;case k:C=D()/3;break;case v:C=(N-A)/6048e5;break;case g:C=(N-A)/864e5;break;case p:C=N/i;break;case u:C=N/o;break;case c:C=N/r;break;default:C=N}return x?C:L.a(C)},T.daysInMonth=function(){return this.endOf(b).$D},T.$locale=function(){return N[this.$L]},T.locale=function(r,o){if(!r)return this.$L;var i=this.clone(),a=I(r,o,!0);return a&&(i.$L=a),i},T.clone=function(){return L.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},M}(),j=z.prototype;return O.prototype=j,[["$ms",a],["$s",c],["$m",u],["$H",p],["$W",g],["$M",b],["$y",E],["$D",w]].forEach(function(r){j[r[1]]=function(o){return this.$g(o,r[0],r[1])}}),O.extend=function(r,o){return r.$i||(r(o,z,O),r.$i=!0),O},O.locale=I,O.isDayjs=S,O.unix=function(r){return O(1e3*r)},O.en=N[A],O.Ls=N,O.p={},O}()},74518:function(r){"use strict";r.exports=window.elementorV2.editorResponsive},74848:function(r,o,i){"use strict";r.exports=i(21020)},74951:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Heading:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Node.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:o}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,(0,b.mergeAttributes)(this.options.HTMLAttributes,o),0]},parseMarkdown:(r,o)=>o.createNode("heading",{level:r.depth||1},o.parseInline(r.tokens||[])),renderMarkdown:(r,o)=>{var i;const a=(null==(i=r.attrs)?void 0:i.level)?parseInt(r.attrs.level,10):1,c="#".repeat(a);return r.content?`${c} ${o.renderChildren(r.content)}`:""},addCommands(){return{setHeading:r=>({commands:o})=>!!this.options.levels.includes(r.level)&&o.setNode(this.name,r),toggleHeading:r=>({commands:o})=>!!this.options.levels.includes(r.level)&&o.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return this.options.levels.reduce((r,o)=>({...r,[`Mod-Alt-${o}`]:()=>this.editor.commands.toggleHeading({level:o})}),{})},addInputRules(){return this.options.levels.map(r=>(0,b.textblockTypeInputRule)({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}}),E=k},76237:function(r,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});for(var i={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:"'"},a={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},c="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),u="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),p=0;p<10;p++)i[48+p]=i[96+p]=String(p);for(p=1;p<=24;p++)i[p+111]="F"+p;for(p=65;p<=90;p++)i[p]=String.fromCharCode(p+32),a[p]=String.fromCharCode(p);for(var g in i)a.hasOwnProperty(g)||(a[g]=i[g]);o.base=i,o.keyName=function keyName(r){var o=!(c&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||u&&r.shiftKey&&r.key&&1==r.key.length||"Unidentified"==r.key)&&r.key||(r.shiftKey?a:i)[r.keyCode]||r.key||"Unidentified";return"Esc"==o&&(o="Escape"),"Del"==o&&(o="Delete"),"Left"==o&&(o="ArrowLeft"),"Up"==o&&(o="ArrowUp"),"Right"==o&&(o="ArrowRight"),"Down"==o&&(o="ArrowDown"),o},o.shift=a},77048:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(88136))},77712:function(r,o,i){"use strict";function _createForOfIteratorHelper(r,o){var i="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function _unsupportedIterableToArray(r,o){if(!r)return;if("string"==typeof r)return _arrayLikeToArray(r,o);var i=Object.prototype.toString.call(r).slice(8,-1);"Object"===i&&r.constructor&&(i=r.constructor.name);if("Map"===i||"Set"===i)return Array.from(r);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(r,o)}(r))||o&&r&&"number"==typeof r.length){i&&(r=i);var a=0,c=function F(){};return{s:c,n:function n(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function e(r){throw r},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,p=!0,g=!1;return{s:function s(){i=i.call(r)},n:function n(){var r=i.next();return p=r.done,r},e:function e(r){g=!0,u=r},f:function f(){try{p||null==i.return||i.return()}finally{if(g)throw u}}}}function _arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=new Array(o);i<o;i++)a[i]=r[i];return a}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(r,o,i){var a=function _superPropBase(r,o){for(;!Object.prototype.hasOwnProperty.call(r,o)&&null!==(r=_getPrototypeOf(r)););return r}(r,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(arguments.length<3?r:i):c.value}},_get.apply(this,arguments)}function _inherits(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),o&&_setPrototypeOf(r,o)}function _createSuper(r){var o=_isNativeReflectConstruct();return function _createSuperInternal(){var i,a=_getPrototypeOf(r);if(o){var c=_getPrototypeOf(this).constructor;i=Reflect.construct(a,arguments,c)}else i=a.apply(this,arguments);return function _possibleConstructorReturn(r,o){if(o&&("object"===_typeof(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,i)}}function _wrapNativeSuper(r){var o="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(r){if(null===r||!function _isNativeFunction(r){try{return-1!==Function.toString.call(r).indexOf("[native code]")}catch(o){return"function"==typeof r}}(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(r))return o.get(r);o.set(r,Wrapper)}function Wrapper(){return _construct(r,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(r.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,r)},_wrapNativeSuper(r)}function _construct(r,o,i){return _construct=_isNativeReflectConstruct()?Reflect.construct.bind():function _construct(r,o,i){var a=[null];a.push.apply(a,o);var c=new(Function.bind.apply(r,a));return i&&_setPrototypeOf(c,i.prototype),c},_construct.apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,_toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _toPropertyKey(r){var o=function _toPrimitive(r,o){if("object"!==_typeof(r)||null===r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"===_typeof(o)?o:String(o)}var a=i(63717);function _findDiffStart(r,o,i){for(var a=0;;a++){if(a==r.childCount||a==o.childCount)return r.childCount==o.childCount?null:i;var c=r.child(a),u=o.child(a);if(c!=u){if(!c.sameMarkup(u))return i;if(c.isText&&c.text!=u.text){for(var p=0;c.text[p]==u.text[p];p++)i++;return i}if(c.content.size||u.content.size){var g=_findDiffStart(c.content,u.content,i+1);if(null!=g)return g}i+=c.nodeSize}else i+=c.nodeSize}}function _findDiffEnd(r,o,i,a){for(var c=r.childCount,u=o.childCount;;){if(0==c||0==u)return c==u?null:{a:i,b:a};var p=r.child(--c),g=o.child(--u),v=p.nodeSize;if(p!=g){if(!p.sameMarkup(g))return{a:i,b:a};if(p.isText&&p.text!=g.text){for(var b=0,k=Math.min(p.text.length,g.text.length);b<k&&p.text[p.text.length-b-1]==g.text[g.text.length-b-1];)b++,i--,a--;return{a:i,b:a}}if(p.content.size||g.content.size){var E=_findDiffEnd(p.content,g.content,i-1,a-1);if(E)return E}i-=v,a-=v}else i-=v,a-=v}}var c=function(){function Fragment(r,o){if(_classCallCheck(this,Fragment),this.content=r,this.size=o||0,null==o)for(var i=0;i<r.length;i++)this.size+=r[i].nodeSize}return _createClass(Fragment,[{key:"nodesBetween",value:function nodesBetween(r,o,i){for(var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=arguments.length>4?arguments[4]:void 0,u=0,p=0;p<o;u++){var g=this.content[u],v=p+g.nodeSize;if(v>r&&!1!==i(g,a+p,c||null,u)&&g.content.size){var b=p+1;g.nodesBetween(Math.max(0,r-b),Math.min(g.content.size,o-b),i,a+b)}p=v}}},{key:"descendants",value:function descendants(r){this.nodesBetween(0,this.size,r)}},{key:"textBetween",value:function textBetween(r,o,i,a){var c="",u=!0;return this.nodesBetween(r,o,function(p,g){var v=p.isText?p.text.slice(Math.max(r,g)-g,o-g):p.isLeaf?a?"function"==typeof a?a(p):a:p.type.spec.leafText?p.type.spec.leafText(p):"":"";p.isBlock&&(p.isLeaf&&v||p.isTextblock)&&i&&(u?u=!1:c+=i),c+=v},0),c}},{key:"append",value:function append(r){if(!r.size)return this;if(!this.size)return r;var o=this.lastChild,i=r.firstChild,a=this.content.slice(),c=0;for(o.isText&&o.sameMarkup(i)&&(a[a.length-1]=o.withText(o.text+i.text),c=1);c<r.content.length;c++)a.push(r.content[c]);return new Fragment(a,this.size+r.size)}},{key:"cut",value:function cut(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==r&&o==this.size)return this;var i=[],a=0;if(o>r)for(var c=0,u=0;u<o;c++){var p=this.content[c],g=u+p.nodeSize;g>r&&((u<r||g>o)&&(p=p.isText?p.cut(Math.max(0,r-u),Math.min(p.text.length,o-u)):p.cut(Math.max(0,r-u-1),Math.min(p.content.size,o-u-1))),i.push(p),a+=p.nodeSize),u=g}return new Fragment(i,a)}},{key:"cutByIndex",value:function cutByIndex(r,o){return r==o?Fragment.empty:0==r&&o==this.content.length?this:new Fragment(this.content.slice(r,o))}},{key:"replaceChild",value:function replaceChild(r,o){var i=this.content[r];if(i==o)return this;var a=this.content.slice(),c=this.size+o.nodeSize-i.nodeSize;return a[r]=o,new Fragment(a,c)}},{key:"addToStart",value:function addToStart(r){return new Fragment([r].concat(this.content),this.size+r.nodeSize)}},{key:"addToEnd",value:function addToEnd(r){return new Fragment(this.content.concat(r),this.size+r.nodeSize)}},{key:"eq",value:function eq(r){if(this.content.length!=r.content.length)return!1;for(var o=0;o<this.content.length;o++)if(!this.content[o].eq(r.content[o]))return!1;return!0}},{key:"firstChild",get:function get(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function get(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function get(){return this.content.length}},{key:"child",value:function child(r){var o=this.content[r];if(!o)throw new RangeError("Index "+r+" out of range for "+this);return o}},{key:"maybeChild",value:function maybeChild(r){return this.content[r]||null}},{key:"forEach",value:function forEach(r){for(var o=0,i=0;o<this.content.length;o++){var a=this.content[o];r(a,i,o),i+=a.nodeSize}}},{key:"findDiffStart",value:function findDiffStart(r){return _findDiffStart(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}},{key:"findDiffEnd",value:function findDiffEnd(r){return _findDiffEnd(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.size)}},{key:"findIndex",value:function findIndex(r){if(0==r)return retIndex(0,r);if(r==this.size)return retIndex(this.content.length,r);if(r>this.size||r<0)throw new RangeError("Position ".concat(r," outside of fragment (").concat(this,")"));for(var o=0,i=0;;o++){var a=i+this.child(o).nodeSize;if(a>=r)return a==r?retIndex(o+1,a):retIndex(o,i);i=a}}},{key:"toString",value:function toString(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function toStringInner(){return this.content.join(", ")}},{key:"toJSON",value:function toJSON(){return this.content.length?this.content.map(function(r){return r.toJSON()}):null}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o)return Fragment.empty;if(!Array.isArray(o))throw new RangeError("Invalid input for Fragment.fromJSON");return new Fragment(o.map(r.nodeFromJSON))}},{key:"fromArray",value:function fromArray(r){if(!r.length)return Fragment.empty;for(var o,i=0,a=0;a<r.length;a++){var c=r[a];i+=c.nodeSize,a&&c.isText&&r[a-1].sameMarkup(c)?(o||(o=r.slice(0,a)),o[o.length-1]=c.withText(o[o.length-1].text+c.text)):o&&o.push(c)}return new Fragment(o||r,i)}},{key:"from",value:function from(r){if(!r)return Fragment.empty;if(r instanceof Fragment)return r;if(Array.isArray(r))return this.fromArray(r);if(r.attrs)return new Fragment([r],r.nodeSize);throw new RangeError("Can not convert "+r+" to a Fragment"+(r.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),Fragment}();c.empty=new c([],0);var u={index:0,offset:0};function retIndex(r,o){return u.index=r,u.offset=o,u}function compareDeep(r,o){if(r===o)return!0;if(!r||"object"!=_typeof(r)||!o||"object"!=_typeof(o))return!1;var i=Array.isArray(r);if(Array.isArray(o)!=i)return!1;if(i){if(r.length!=o.length)return!1;for(var a=0;a<r.length;a++)if(!compareDeep(r[a],o[a]))return!1}else{for(var c in r)if(!(c in o)||!compareDeep(r[c],o[c]))return!1;for(var u in o)if(!(u in r))return!1}return!0}var p=function(){function Mark(r,o){_classCallCheck(this,Mark),this.type=r,this.attrs=o}return _createClass(Mark,[{key:"addToSet",value:function addToSet(r){for(var o,i=!1,a=0;a<r.length;a++){var c=r[a];if(this.eq(c))return r;if(this.type.excludes(c.type))o||(o=r.slice(0,a));else{if(c.type.excludes(this.type))return r;!i&&c.type.rank>this.type.rank&&(o||(o=r.slice(0,a)),o.push(this),i=!0),o&&o.push(c)}}return o||(o=r.slice()),i||o.push(this),o}},{key:"removeFromSet",value:function removeFromSet(r){for(var o=0;o<r.length;o++)if(this.eq(r[o]))return r.slice(0,o).concat(r.slice(o+1));return r}},{key:"isInSet",value:function isInSet(r){for(var o=0;o<r.length;o++)if(this.eq(r[o]))return!0;return!1}},{key:"eq",value:function eq(r){return this==r||this.type==r.type&&compareDeep(this.attrs,r.attrs)}},{key:"toJSON",value:function toJSON(){var r={type:this.type.name};for(var o in this.attrs){r.attrs=this.attrs;break}return r}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o)throw new RangeError("Invalid input for Mark.fromJSON");var i=r.marks[o.type];if(!i)throw new RangeError("There is no mark type ".concat(o.type," in this schema"));var a=i.create(o.attrs);return i.checkAttrs(a.attrs),a}},{key:"sameSet",value:function sameSet(r,o){if(r==o)return!0;if(r.length!=o.length)return!1;for(var i=0;i<r.length;i++)if(!r[i].eq(o[i]))return!1;return!0}},{key:"setFrom",value:function setFrom(r){if(!r||Array.isArray(r)&&0==r.length)return Mark.none;if(r instanceof Mark)return[r];var o=r.slice();return o.sort(function(r,o){return r.type.rank-o.type.rank}),o}}]),Mark}();p.none=[];var g=function(r){_inherits(ReplaceError,r);var o=_createSuper(ReplaceError);function ReplaceError(){return _classCallCheck(this,ReplaceError),o.apply(this,arguments)}return _createClass(ReplaceError)}(_wrapNativeSuper(Error)),v=function(){function Slice(r,o,i){_classCallCheck(this,Slice),this.content=r,this.openStart=o,this.openEnd=i}return _createClass(Slice,[{key:"size",get:function get(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function insertAt(r,o){var i=insertInto(this.content,r+this.openStart,o);return i&&new Slice(i,this.openStart,this.openEnd)}},{key:"removeBetween",value:function removeBetween(r,o){return new Slice(removeRange(this.content,r+this.openStart,o+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function eq(r){return this.content.eq(r.content)&&this.openStart==r.openStart&&this.openEnd==r.openEnd}},{key:"toString",value:function toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function toJSON(){if(!this.content.size)return null;var r={content:this.content.toJSON()};return this.openStart>0&&(r.openStart=this.openStart),this.openEnd>0&&(r.openEnd=this.openEnd),r}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o)return Slice.empty;var i=o.openStart||0,a=o.openEnd||0;if("number"!=typeof i||"number"!=typeof a)throw new RangeError("Invalid input for Slice.fromJSON");return new Slice(c.fromJSON(r,o.content),i,a)}},{key:"maxOpen",value:function maxOpen(r){for(var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=0,a=0,c=r.firstChild;c&&!c.isLeaf&&(o||!c.type.spec.isolating);c=c.firstChild)i++;for(var u=r.lastChild;u&&!u.isLeaf&&(o||!u.type.spec.isolating);u=u.lastChild)a++;return new Slice(r,i,a)}}]),Slice}();function removeRange(r,o,i){var a=r.findIndex(o),c=a.index,u=a.offset,p=r.maybeChild(c),g=r.findIndex(i),v=g.index,b=g.offset;if(u==o||p.isText){if(b!=i&&!r.child(v).isText)throw new RangeError("Removing non-flat range");return r.cut(0,o).append(r.cut(i))}if(c!=v)throw new RangeError("Removing non-flat range");return r.replaceChild(c,p.copy(removeRange(p.content,o-u-1,i-u-1)))}function insertInto(r,o,i,a){var c=r.findIndex(o),u=c.index,p=c.offset,g=r.maybeChild(u);if(p==o||g.isText)return a&&!a.canReplace(u,u,i)?null:r.cut(0,o).append(i).append(r.cut(o));var v=insertInto(g.content,o-p-1,i,g);return v&&r.replaceChild(u,g.copy(v))}function _replace(r,o,i){if(i.openStart>r.depth)throw new g("Inserted content deeper than insertion position");if(r.depth-i.openStart!=o.depth-i.openEnd)throw new g("Inconsistent open depths");return replaceOuter(r,o,i,0)}function replaceOuter(r,o,i,a){var u=r.index(a),p=r.node(a);if(u==o.index(a)&&a<r.depth-i.openStart){var g=replaceOuter(r,o,i,a+1);return p.copy(p.content.replaceChild(u,g))}if(i.content.size){if(i.openStart||i.openEnd||r.depth!=a||o.depth!=a){var v=function prepareSliceForReplace(r,o){for(var i=o.depth-r.openStart,a=o.node(i).copy(r.content),u=i-1;u>=0;u--)a=o.node(u).copy(c.from(a));return{start:a.resolveNoCache(r.openStart+i),end:a.resolveNoCache(a.content.size-r.openEnd-i)}}(i,r);return close(p,replaceThreeWay(r,v.start,v.end,o,a))}var b=r.parent,k=b.content;return close(b,k.cut(0,r.parentOffset).append(i.content).append(k.cut(o.parentOffset)))}return close(p,replaceTwoWay(r,o,a))}function checkJoin(r,o){if(!o.type.compatibleContent(r.type))throw new g("Cannot join "+o.type.name+" onto "+r.type.name)}function joinable(r,o,i){var a=r.node(i);return checkJoin(a,o.node(i)),a}function addNode(r,o){var i=o.length-1;i>=0&&r.isText&&r.sameMarkup(o[i])?o[i]=r.withText(o[i].text+r.text):o.push(r)}function addRange(r,o,i,a){var c=(o||r).node(i),u=0,p=o?o.index(i):c.childCount;r&&(u=r.index(i),r.depth>i?u++:r.textOffset&&(addNode(r.nodeAfter,a),u++));for(var g=u;g<p;g++)addNode(c.child(g),a);o&&o.depth==i&&o.textOffset&&addNode(o.nodeBefore,a)}function close(r,o){return r.type.checkContent(o),r.copy(o)}function replaceThreeWay(r,o,i,a,u){var p=r.depth>u&&joinable(r,o,u+1),g=a.depth>u&&joinable(i,a,u+1),v=[];return addRange(null,r,u,v),p&&g&&o.index(u)==i.index(u)?(checkJoin(p,g),addNode(close(p,replaceThreeWay(r,o,i,a,u+1)),v)):(p&&addNode(close(p,replaceTwoWay(r,o,u+1)),v),addRange(o,i,u,v),g&&addNode(close(g,replaceTwoWay(i,a,u+1)),v)),addRange(a,null,u,v),new c(v)}function replaceTwoWay(r,o,i){var a=[];(addRange(null,r,i,a),r.depth>i)&&addNode(close(joinable(r,o,i+1),replaceTwoWay(r,o,i+1)),a);return addRange(o,null,i,a),new c(a)}v.empty=new v(c.empty,0,0);var b=function(){function ResolvedPos(r,o,i){_classCallCheck(this,ResolvedPos),this.pos=r,this.path=o,this.parentOffset=i,this.depth=o.length/3-1}return _createClass(ResolvedPos,[{key:"resolveDepth",value:function resolveDepth(r){return null==r?this.depth:r<0?this.depth+r:r}},{key:"parent",get:function get(){return this.node(this.depth)}},{key:"doc",get:function get(){return this.node(0)}},{key:"node",value:function node(r){return this.path[3*this.resolveDepth(r)]}},{key:"index",value:function index(r){return this.path[3*this.resolveDepth(r)+1]}},{key:"indexAfter",value:function indexAfter(r){return r=this.resolveDepth(r),this.index(r)+(r!=this.depth||this.textOffset?1:0)}},{key:"start",value:function start(r){return 0==(r=this.resolveDepth(r))?0:this.path[3*r-1]+1}},{key:"end",value:function end(r){return r=this.resolveDepth(r),this.start(r)+this.node(r).content.size}},{key:"before",value:function before(r){if(!(r=this.resolveDepth(r)))throw new RangeError("There is no position before the top-level node");return r==this.depth+1?this.pos:this.path[3*r-1]}},{key:"after",value:function after(r){if(!(r=this.resolveDepth(r)))throw new RangeError("There is no position after the top-level node");return r==this.depth+1?this.pos:this.path[3*r-1]+this.path[3*r].nodeSize}},{key:"textOffset",get:function get(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function get(){var r=this.parent,o=this.index(this.depth);if(o==r.childCount)return null;var i=this.pos-this.path[this.path.length-1],a=r.child(o);return i?r.child(o).cut(i):a}},{key:"nodeBefore",get:function get(){var r=this.index(this.depth),o=this.pos-this.path[this.path.length-1];return o?this.parent.child(r).cut(0,o):0==r?null:this.parent.child(r-1)}},{key:"posAtIndex",value:function posAtIndex(r,o){o=this.resolveDepth(o);for(var i=this.path[3*o],a=0==o?0:this.path[3*o-1]+1,c=0;c<r;c++)a+=i.child(c).nodeSize;return a}},{key:"marks",value:function marks(){var r=this.parent,o=this.index();if(0==r.content.size)return p.none;if(this.textOffset)return r.child(o).marks;var i=r.maybeChild(o-1),a=r.maybeChild(o);if(!i){var c=i;i=a,a=c}for(var marks=i.marks,u=0;u<marks.length;u++)!1!==marks[u].type.spec.inclusive||a&&marks[u].isInSet(a.marks)||(marks=marks[u--].removeFromSet(marks));return marks}},{key:"marksAcross",value:function marksAcross(r){var o=this.parent.maybeChild(this.index());if(!o||!o.isInline)return null;for(var i=o.marks,a=r.parent.maybeChild(r.index()),c=0;c<i.length;c++)!1!==i[c].type.spec.inclusive||a&&i[c].isInSet(a.marks)||(i=i[c--].removeFromSet(i));return i}},{key:"sharedDepth",value:function sharedDepth(r){for(var o=this.depth;o>0;o--)if(this.start(o)<=r&&this.end(o)>=r)return o;return 0}},{key:"blockRange",value:function blockRange(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,o=arguments.length>1?arguments[1]:void 0;if(r.pos<this.pos)return r.blockRange(this);for(var i=this.depth-(this.parent.inlineContent||this.pos==r.pos?1:0);i>=0;i--)if(r.pos<=this.end(i)&&(!o||o(this.node(i))))return new x(this,r,i);return null}},{key:"sameParent",value:function sameParent(r){return this.pos-this.parentOffset==r.pos-r.parentOffset}},{key:"max",value:function max(r){return r.pos>this.pos?r:this}},{key:"min",value:function min(r){return r.pos<this.pos?r:this}},{key:"toString",value:function toString(){for(var r="",o=1;o<=this.depth;o++)r+=(r?"/":"")+this.node(o).type.name+"_"+this.index(o-1);return r+":"+this.parentOffset}}],[{key:"resolve",value:function resolve(r,o){if(!(o>=0&&o<=r.content.size))throw new RangeError("Position "+o+" out of range");for(var i=[],a=0,c=o,u=r;;){var p=u.content.findIndex(c),g=p.index,v=p.offset,b=c-v;if(i.push(u,g,a+v),!b)break;if((u=u.child(g)).isText)break;c=b-1,a+=v+1}return new ResolvedPos(o,i,c)}},{key:"resolveCached",value:function resolveCached(r,o){var i=w.get(r);if(i)for(var a=0;a<i.elts.length;a++){var c=i.elts[a];if(c.pos==o)return c}else w.set(r,i=new k);var u=i.elts[i.i]=ResolvedPos.resolve(r,o);return i.i=(i.i+1)%E,u}}]),ResolvedPos}(),k=_createClass(function ResolveCache(){_classCallCheck(this,ResolveCache),this.elts=[],this.i=0}),E=12,w=new WeakMap,x=function(){function NodeRange(r,o,i){_classCallCheck(this,NodeRange),this.$from=r,this.$to=o,this.depth=i}return _createClass(NodeRange,[{key:"start",get:function get(){return this.$from.before(this.depth+1)}},{key:"end",get:function get(){return this.$to.after(this.depth+1)}},{key:"parent",get:function get(){return this.$from.node(this.depth)}},{key:"startIndex",get:function get(){return this.$from.index(this.depth)}},{key:"endIndex",get:function get(){return this.$to.indexAfter(this.depth)}}]),NodeRange}(),C=Object.create(null),_=function(){function Node(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:p.none;_classCallCheck(this,Node),this.type=r,this.attrs=o,this.marks=a,this.content=i||c.empty}return _createClass(Node,[{key:"children",get:function get(){return this.content.content}},{key:"nodeSize",get:function get(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function get(){return this.content.childCount}},{key:"child",value:function child(r){return this.content.child(r)}},{key:"maybeChild",value:function maybeChild(r){return this.content.maybeChild(r)}},{key:"forEach",value:function forEach(r){this.content.forEach(r)}},{key:"nodesBetween",value:function nodesBetween(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(r,o,i,a,this)}},{key:"descendants",value:function descendants(r){this.nodesBetween(0,this.content.size,r)}},{key:"textContent",get:function get(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function textBetween(r,o,i,a){return this.content.textBetween(r,o,i,a)}},{key:"firstChild",get:function get(){return this.content.firstChild}},{key:"lastChild",get:function get(){return this.content.lastChild}},{key:"eq",value:function eq(r){return this==r||this.sameMarkup(r)&&this.content.eq(r.content)}},{key:"sameMarkup",value:function sameMarkup(r){return this.hasMarkup(r.type,r.attrs,r.marks)}},{key:"hasMarkup",value:function hasMarkup(r,o,i){return this.type==r&&compareDeep(this.attrs,o||r.defaultAttrs||C)&&p.sameSet(this.marks,i||p.none)}},{key:"copy",value:function copy(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return r==this.content?this:new Node(this.type,this.attrs,r,this.marks)}},{key:"mark",value:function mark(r){return r==this.marks?this:new Node(this.type,this.attrs,this.content,r)}},{key:"cut",value:function cut(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==r&&o==this.content.size?this:this.copy(this.content.cut(r,o))}},{key:"slice",value:function slice(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r==o)return v.empty;var a=this.resolve(r),c=this.resolve(o),u=i?0:a.sharedDepth(o),p=a.start(u),g=a.node(u).content.cut(a.pos-p,c.pos-p);return new v(g,a.depth-u,c.depth-u)}},{key:"replace",value:function replace(r,o,i){return _replace(this.resolve(r),this.resolve(o),i)}},{key:"nodeAt",value:function nodeAt(r){for(var o=this;;){var i=o.content.findIndex(r),a=i.index,c=i.offset;if(!(o=o.maybeChild(a)))return null;if(c==r||o.isText)return o;r-=c+1}}},{key:"childAfter",value:function childAfter(r){var o=this.content.findIndex(r),i=o.index,a=o.offset;return{node:this.content.maybeChild(i),index:i,offset:a}}},{key:"childBefore",value:function childBefore(r){if(0==r)return{node:null,index:0,offset:0};var o=this.content.findIndex(r),i=o.index,a=o.offset;if(a<r)return{node:this.content.child(i),index:i,offset:a};var c=this.content.child(i-1);return{node:c,index:i-1,offset:a-c.nodeSize}}},{key:"resolve",value:function resolve(r){return b.resolveCached(this,r)}},{key:"resolveNoCache",value:function resolveNoCache(r){return b.resolve(this,r)}},{key:"rangeHasMark",value:function rangeHasMark(r,o,i){var a=!1;return o>r&&this.nodesBetween(r,o,function(r){return i.isInSet(r.marks)&&(a=!0),!a}),a}},{key:"isBlock",get:function get(){return this.type.isBlock}},{key:"isTextblock",get:function get(){return this.type.isTextblock}},{key:"inlineContent",get:function get(){return this.type.inlineContent}},{key:"isInline",get:function get(){return this.type.isInline}},{key:"isText",get:function get(){return this.type.isText}},{key:"isLeaf",get:function get(){return this.type.isLeaf}},{key:"isAtom",get:function get(){return this.type.isAtom}},{key:"toString",value:function toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var r=this.type.name;return this.content.size&&(r+="("+this.content.toStringInner()+")"),wrapMarks(this.marks,r)}},{key:"contentMatchAt",value:function contentMatchAt(r){var o=this.type.contentMatch.matchFragment(this.content,0,r);if(!o)throw new Error("Called contentMatchAt on a node with invalid content");return o}},{key:"canReplace",value:function canReplace(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.empty,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.childCount,p=this.contentMatchAt(r).matchFragment(i,a,u),g=p&&p.matchFragment(this.content,o);if(!g||!g.validEnd)return!1;for(var v=a;v<u;v++)if(!this.type.allowsMarks(i.child(v).marks))return!1;return!0}},{key:"canReplaceWith",value:function canReplaceWith(r,o,i,a){if(a&&!this.type.allowsMarks(a))return!1;var c=this.contentMatchAt(r).matchType(i),u=c&&c.matchFragment(this.content,o);return!!u&&u.validEnd}},{key:"canAppend",value:function canAppend(r){return r.content.size?this.canReplace(this.childCount,this.childCount,r.content):this.type.compatibleContent(r.type)}},{key:"check",value:function check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);for(var r=p.none,o=0;o<this.marks.length;o++){var i=this.marks[o];i.type.checkAttrs(i.attrs),r=i.addToSet(r)}if(!p.sameSet(r,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map(function(r){return r.type.name})));this.content.forEach(function(r){return r.check()})}},{key:"toJSON",value:function toJSON(){var r={type:this.type.name};for(var o in this.attrs){r.attrs=this.attrs;break}return this.content.size&&(r.content=this.content.toJSON()),this.marks.length&&(r.marks=this.marks.map(function(r){return r.toJSON()})),r}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o)throw new RangeError("Invalid input for Node.fromJSON");var i=void 0;if(o.marks){if(!Array.isArray(o.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=o.marks.map(r.markFromJSON)}if("text"==o.type){if("string"!=typeof o.text)throw new RangeError("Invalid text node in JSON");return r.text(o.text,i)}var a=c.fromJSON(r,o.content),u=r.nodeType(o.type).create(o.attrs,a,i);return u.type.checkAttrs(u.attrs),u}}]),Node}();_.prototype.text=void 0;var T=function(r){_inherits(TextNode,r);var o=_createSuper(TextNode);function TextNode(r,i,a,c){var u;if(_classCallCheck(this,TextNode),u=o.call(this,r,i,null,c),!a)throw new RangeError("Empty text nodes are not allowed");return u.text=a,u}return _createClass(TextNode,[{key:"toString",value:function toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wrapMarks(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function get(){return this.text}},{key:"textBetween",value:function textBetween(r,o){return this.text.slice(r,o)}},{key:"nodeSize",get:function get(){return this.text.length}},{key:"mark",value:function mark(r){return r==this.marks?this:new TextNode(this.type,this.attrs,this.text,r)}},{key:"withText",value:function withText(r){return r==this.text?this:new TextNode(this.type,this.attrs,r,this.marks)}},{key:"cut",value:function cut(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==r&&o==this.text.length?this:this.withText(this.text.slice(r,o))}},{key:"eq",value:function eq(r){return this.sameMarkup(r)&&this.text==r.text}},{key:"toJSON",value:function toJSON(){var r=_get(_getPrototypeOf(TextNode.prototype),"toJSON",this).call(this);return r.text=this.text,r}}]),TextNode}(_);function wrapMarks(r,o){for(var i=r.length-1;i>=0;i--)o=r[i].type.name+"("+o+")";return o}var P=function(){function ContentMatch(r){_classCallCheck(this,ContentMatch),this.validEnd=r,this.next=[],this.wrapCache=[]}return _createClass(ContentMatch,[{key:"matchType",value:function matchType(r){for(var o=0;o<this.next.length;o++)if(this.next[o].type==r)return this.next[o].next;return null}},{key:"matchFragment",value:function matchFragment(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.childCount,a=this,c=o;a&&c<i;c++)a=a.matchType(r.child(c).type);return a}},{key:"inlineContent",get:function get(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function get(){for(var r=0;r<this.next.length;r++){var o=this.next[r].type;if(!o.isText&&!o.hasRequiredAttrs())return o}return null}},{key:"compatible",value:function compatible(r){for(var o=0;o<this.next.length;o++)for(var i=0;i<r.next.length;i++)if(this.next[o].type==r.next[i].type)return!0;return!1}},{key:"fillBefore",value:function fillBefore(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=[this];return function search(u,p){var g=u.matchFragment(r,i);if(g&&(!o||g.validEnd))return c.from(p.map(function(r){return r.createAndFill()}));for(var v=0;v<u.next.length;v++){var b=u.next[v],k=b.type,E=b.next;if(!k.isText&&!k.hasRequiredAttrs()&&-1==a.indexOf(E)){a.push(E);var w=search(E,p.concat(k));if(w)return w}}return null}(this,[])}},{key:"findWrapping",value:function findWrapping(r){for(var o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==r)return this.wrapCache[o+1];var i=this.computeWrapping(r);return this.wrapCache.push(r,i),i}},{key:"computeWrapping",value:function computeWrapping(r){for(var o=Object.create(null),i=[{match:this,type:null,via:null}];i.length;){var a=i.shift(),c=a.match;if(c.matchType(r)){for(var u=[],p=a;p.type;p=p.via)u.push(p.type);return u.reverse()}for(var g=0;g<c.next.length;g++){var v=c.next[g],b=v.type,k=v.next;b.isLeaf||b.hasRequiredAttrs()||b.name in o||a.type&&!k.validEnd||(i.push({match:b.contentMatch,type:b,via:a}),o[b.name]=!0)}}return null}},{key:"edgeCount",get:function get(){return this.next.length}},{key:"edge",value:function edge(r){if(r>=this.next.length)throw new RangeError("There's no ".concat(r,"th edge in this content match"));return this.next[r]}},{key:"toString",value:function toString(){var r=[];return function scan(o){r.push(o);for(var i=0;i<o.next.length;i++)-1==r.indexOf(o.next[i].next)&&scan(o.next[i].next)}(this),r.map(function(o,i){for(var a=i+(o.validEnd?"*":" ")+" ",c=0;c<o.next.length;c++)a+=(c?", ":"")+o.next[c].type.name+"->"+r.indexOf(o.next[c].next);return a}).join("\n")}}],[{key:"parse",value:function parse(r,o){var i=new A(r,o);if(null==i.next)return ContentMatch.empty;var a=parseExpr(i);i.next&&i.err("Unexpected trailing text");var c=dfa(function nfa(r){var o=[[]];return connect(compile(r,0),node()),o;function node(){return o.push([])-1}function edge(r,i,a){var c={term:a,to:i};return o[r].push(c),c}function connect(r,o){r.forEach(function(r){return r.to=o})}function compile(r,o){if("choice"==r.type)return r.exprs.reduce(function(r,i){return r.concat(compile(i,o))},[]);if("seq"!=r.type){if("star"==r.type){var i=node();return edge(o,i),connect(compile(r.expr,i),i),[edge(i)]}if("plus"==r.type){var a=node();return connect(compile(r.expr,o),a),connect(compile(r.expr,a),a),[edge(a)]}if("opt"==r.type)return[edge(o)].concat(compile(r.expr,o));if("range"==r.type){for(var c=o,u=0;u<r.min;u++){var p=node();connect(compile(r.expr,c),p),c=p}if(-1==r.max)connect(compile(r.expr,c),c);else for(var g=r.min;g<r.max;g++){var v=node();edge(c,v),connect(compile(r.expr,c),v),c=v}return[edge(c)]}if("name"==r.type)return[edge(o,void 0,r.value)];throw new Error("Unknown expr type")}for(var b=0;;b++){var k=compile(r.exprs[b],o);if(b==r.exprs.length-1)return k;connect(k,o=node())}}}(a));return function checkForDeadEnds(r,o){for(var i=0,a=[r];i<a.length;i++){for(var c=a[i],u=!c.validEnd,p=[],g=0;g<c.next.length;g++){var v=c.next[g],b=v.type,k=v.next;p.push(b.name),!u||b.isText||b.hasRequiredAttrs()||(u=!1),-1==a.indexOf(k)&&a.push(k)}u&&o.err("Only non-generatable nodes ("+p.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(c,i),c}}]),ContentMatch}();P.empty=new P(!0);var A=function(){function TokenStream(r,o){_classCallCheck(this,TokenStream),this.string=r,this.nodeTypes=o,this.inline=null,this.pos=0,this.tokens=r.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return _createClass(TokenStream,[{key:"next",get:function get(){return this.tokens[this.pos]}},{key:"eat",value:function eat(r){return this.next==r&&(this.pos++||!0)}},{key:"err",value:function err(r){throw new SyntaxError(r+" (in content expression '"+this.string+"')")}}]),TokenStream}();function parseExpr(r){var o=[];do{o.push(parseExprSeq(r))}while(r.eat("|"));return 1==o.length?o[0]:{type:"choice",exprs:o}}function parseExprSeq(r){var o=[];do{o.push(parseExprSubscript(r))}while(r.next&&")"!=r.next&&"|"!=r.next);return 1==o.length?o[0]:{type:"seq",exprs:o}}function parseExprSubscript(r){for(var o=function parseExprAtom(r){if(r.eat("(")){var o=parseExpr(r);return r.eat(")")||r.err("Missing closing paren"),o}if(!/\W/.test(r.next)){var i=function resolveName(r,o){var i=r.nodeTypes,a=i[o];if(a)return[a];var c=[];for(var u in i){var p=i[u];p.isInGroup(o)&&c.push(p)}0==c.length&&r.err("No node type or group '"+o+"' found");return c}(r,r.next).map(function(o){return null==r.inline?r.inline=o.isInline:r.inline!=o.isInline&&r.err("Mixing inline and block content"),{type:"name",value:o}});return r.pos++,1==i.length?i[0]:{type:"choice",exprs:i}}r.err("Unexpected token '"+r.next+"'")}(r);;)if(r.eat("+"))o={type:"plus",expr:o};else if(r.eat("*"))o={type:"star",expr:o};else if(r.eat("?"))o={type:"opt",expr:o};else{if(!r.eat("{"))break;o=parseExprRange(r,o)}return o}function parseNum(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");var o=Number(r.next);return r.pos++,o}function parseExprRange(r,o){var i=parseNum(r),a=i;return r.eat(",")&&(a="}"!=r.next?parseNum(r):-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:i,max:a,expr:o}}function cmp(r,o){return o-r}function nullFrom(r,o){var i=[];return function scan(o){var a=r[o];if(1==a.length&&!a[0].term)return scan(a[0].to);i.push(o);for(var c=0;c<a.length;c++){var u=a[c],p=u.term,g=u.to;p||-1!=i.indexOf(g)||scan(g)}}(o),i.sort(cmp)}function dfa(r){var o=Object.create(null);return function explore(i){var a=[];i.forEach(function(o){r[o].forEach(function(o){var i=o.term,c=o.to;if(i){for(var u,p=0;p<a.length;p++)a[p][0]==i&&(u=a[p][1]);nullFrom(r,c).forEach(function(r){u||a.push([i,u=[]]),-1==u.indexOf(r)&&u.push(r)})}})});for(var c=o[i.join(",")]=new P(i.indexOf(r.length-1)>-1),u=0;u<a.length;u++){var p=a[u][1].sort(cmp);c.next.push({type:a[u][0],next:o[p.join(",")]||explore(p)})}return c}(nullFrom(r,0))}function defaultAttrs(r){var o=Object.create(null);for(var i in r){var a=r[i];if(!a.hasDefault)return null;o[i]=a.default}return o}function _computeAttrs(r,o){var i=Object.create(null);for(var a in r){var c=o&&o[a];if(void 0===c){var u=r[a];if(!u.hasDefault)throw new RangeError("No value supplied for attribute "+a);c=u.default}i[a]=c}return i}function _checkAttrs(r,o,i,a){for(var c in o)if(!(c in r))throw new RangeError("Unsupported attribute ".concat(c," for ").concat(i," of type ").concat(c));for(var u in r){var p=r[u];p.validate&&p.validate(o[u])}}function initAttrs(r,o){var i=Object.create(null);if(o)for(var a in o)i[a]=new R(r,a,o[a]);return i}var N=function(){function NodeType(r,o,i){_classCallCheck(this,NodeType),this.name=r,this.schema=o,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=initAttrs(r,i.attrs),this.defaultAttrs=defaultAttrs(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==r),this.isText="text"==r}return _createClass(NodeType,[{key:"isInline",get:function get(){return!this.isBlock}},{key:"isTextblock",get:function get(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function get(){return this.contentMatch==P.empty}},{key:"isAtom",get:function get(){return this.isLeaf||!!this.spec.atom}},{key:"isInGroup",value:function isInGroup(r){return this.groups.indexOf(r)>-1}},{key:"whitespace",get:function get(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function hasRequiredAttrs(){for(var r in this.attrs)if(this.attrs[r].isRequired)return!0;return!1}},{key:"compatibleContent",value:function compatibleContent(r){return this==r||this.contentMatch.compatible(r.contentMatch)}},{key:"computeAttrs",value:function computeAttrs(r){return!r&&this.defaultAttrs?this.defaultAttrs:_computeAttrs(this.attrs,r)}},{key:"create",value:function create(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new _(this,this.computeAttrs(r),c.from(o),p.setFrom(i))}},{key:"createChecked",value:function createChecked(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;return o=c.from(o),this.checkContent(o),new _(this,this.computeAttrs(r),o,p.setFrom(i))}},{key:"createAndFill",value:function createAndFill(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(r=this.computeAttrs(r),(o=c.from(o)).size){var a=this.contentMatch.fillBefore(o);if(!a)return null;o=a.append(o)}var u=this.contentMatch.matchFragment(o),g=u&&u.fillBefore(c.empty,!0);return g?new _(this,r,o.append(g),p.setFrom(i)):null}},{key:"validContent",value:function validContent(r){var o=this.contentMatch.matchFragment(r);if(!o||!o.validEnd)return!1;for(var i=0;i<r.childCount;i++)if(!this.allowsMarks(r.child(i).marks))return!1;return!0}},{key:"checkContent",value:function checkContent(r){if(!this.validContent(r))throw new RangeError("Invalid content for node ".concat(this.name,": ").concat(r.toString().slice(0,50)))}},{key:"checkAttrs",value:function checkAttrs(r){_checkAttrs(this.attrs,r,"node",this.name)}},{key:"allowsMarkType",value:function allowsMarkType(r){return null==this.markSet||this.markSet.indexOf(r)>-1}},{key:"allowsMarks",value:function allowsMarks(r){if(null==this.markSet)return!0;for(var o=0;o<r.length;o++)if(!this.allowsMarkType(r[o].type))return!1;return!0}},{key:"allowedMarks",value:function allowedMarks(r){if(null==this.markSet)return r;for(var o,i=0;i<r.length;i++)this.allowsMarkType(r[i].type)?o&&o.push(r[i]):o||(o=r.slice(0,i));return o?o.length?o:p.none:r}}],[{key:"compile",value:function compile(r,o){var i=Object.create(null);r.forEach(function(r,a){return i[r]=new NodeType(r,o,a)});var a=o.spec.topNode||"doc";if(!i[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(var c in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}}]),NodeType}();var R=function(){function Attribute(r,o,i){_classCallCheck(this,Attribute),this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate="string"==typeof i.validate?function validateType(r,o,i){var a=i.split("|");return function(i){var c=null===i?"null":_typeof(i);if(a.indexOf(c)<0)throw new RangeError("Expected value of type ".concat(a," for attribute ").concat(o," on type ").concat(r,", got ").concat(c))}}(r,o,i.validate):i.validate}return _createClass(Attribute,[{key:"isRequired",get:function get(){return!this.hasDefault}}]),Attribute}(),I=function(){function MarkType(r,o,i,a){_classCallCheck(this,MarkType),this.name=r,this.rank=o,this.schema=i,this.spec=a,this.attrs=initAttrs(r,a.attrs),this.excluded=null;var c=defaultAttrs(this.attrs);this.instance=c?new p(this,c):null}return _createClass(MarkType,[{key:"create",value:function create(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!r&&this.instance?this.instance:new p(this,_computeAttrs(this.attrs,r))}},{key:"removeFromSet",value:function removeFromSet(r){for(var o=0;o<r.length;o++)r[o].type==this&&(r=r.slice(0,o).concat(r.slice(o+1)),o--);return r}},{key:"isInSet",value:function isInSet(r){for(var o=0;o<r.length;o++)if(r[o].type==this)return r[o]}},{key:"checkAttrs",value:function checkAttrs(r){_checkAttrs(this.attrs,r,"mark",this.name)}},{key:"excludes",value:function excludes(r){return this.excluded.indexOf(r)>-1}}],[{key:"compile",value:function compile(r,o){var i=Object.create(null),a=0;return r.forEach(function(r,c){return i[r]=new MarkType(r,a++,o,c)}),i}}]),MarkType}(),L=function(){function Schema(r){var o=this;_classCallCheck(this,Schema),this.linebreakReplacement=null,this.cached=Object.create(null);var i=this.spec={};for(var c in r)i[c]=r[c];i.nodes=a.from(r.nodes),i.marks=a.from(r.marks||{}),this.nodes=N.compile(this.spec.nodes,this),this.marks=I.compile(this.spec.marks,this);var u=Object.create(null);for(var g in this.nodes){if(g in this.marks)throw new RangeError(g+" can not be both a node and a mark");var v=this.nodes[g],b=v.spec.content||"",k=v.spec.marks;if(v.contentMatch=u[b]||(u[b]=P.parse(b,this.nodes)),v.inlineContent=v.contentMatch.inlineContent,v.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!v.isInline||!v.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=v}v.markSet="_"==k?null:k?gatherMarks(this,k.split(" ")):""!=k&&v.inlineContent?null:[]}for(var E in this.marks){var w=this.marks[E],x=w.spec.excludes;w.excluded=null==x?[w]:""==x?[]:gatherMarks(this,x.split(" "))}this.nodeFromJSON=function(r){return _.fromJSON(o,r)},this.markFromJSON=function(r){return p.fromJSON(o,r)},this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}return _createClass(Schema,[{key:"node",value:function node(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;if("string"==typeof r)r=this.nodeType(r);else{if(!(r instanceof N))throw new RangeError("Invalid node type: "+r);if(r.schema!=this)throw new RangeError("Node type from different schema used ("+r.name+")")}return r.createChecked(o,i,a)}},{key:"text",value:function text(r,o){var i=this.nodes.text;return new T(i,i.defaultAttrs,r,p.setFrom(o))}},{key:"mark",value:function mark(r,o){return"string"==typeof r&&(r=this.marks[r]),r.create(o)}},{key:"nodeType",value:function nodeType(r){var o=this.nodes[r];if(!o)throw new RangeError("Unknown node type: "+r);return o}}]),Schema}();function gatherMarks(r,o){for(var i=[],a=0;a<o.length;a++){var c=o[a],u=r.marks[c],p=u;if(u)i.push(u);else for(var g in r.marks){var v=r.marks[g];("_"==c||v.spec.group&&v.spec.group.split(" ").indexOf(c)>-1)&&i.push(p=v)}if(!p)throw new SyntaxError("Unknown mark type: '"+o[a]+"'")}return i}var z=function(){function DOMParser(r,o){var i=this;_classCallCheck(this,DOMParser),this.schema=r,this.rules=o,this.tags=[],this.styles=[];var a=this.matchedStyles=[];o.forEach(function(r){if(function isTagRule(r){return null!=r.tag}(r))i.tags.push(r);else if(function isStyleRule(r){return null!=r.style}(r)){var o=/[^=]*/.exec(r.style)[0];a.indexOf(o)<0&&a.push(o),i.styles.push(r)}}),this.normalizeLists=!this.tags.some(function(o){if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;var i=r.nodes[o.node];return i.contentMatch.matchType(i)})}return _createClass(DOMParser,[{key:"parse",value:function parse(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new H(this,o,!1);return i.addAll(r,p.none,o.from,o.to),i.finish()}},{key:"parseSlice",value:function parseSlice(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new H(this,o,!0);return i.addAll(r,p.none,o.from,o.to),v.maxOpen(i.finish())}},{key:"matchTag",value:function matchTag(r,o,i){for(var a=i?this.tags.indexOf(i)+1:0;a<this.tags.length;a++){var c=this.tags[a];if(matches(r,c.tag)&&(void 0===c.namespace||r.namespaceURI==c.namespace)&&(!c.context||o.matchesContext(c.context))){if(c.getAttrs){var u=c.getAttrs(r);if(!1===u)continue;c.attrs=u||void 0}return c}}}},{key:"matchStyle",value:function matchStyle(r,o,i,a){for(var c=a?this.styles.indexOf(a)+1:0;c<this.styles.length;c++){var u=this.styles[c],p=u.style;if(!(0!=p.indexOf(r)||u.context&&!i.matchesContext(u.context)||p.length>r.length&&(61!=p.charCodeAt(r.length)||p.slice(r.length+1)!=o))){if(u.getAttrs){var g=u.getAttrs(o);if(!1===g)continue;u.attrs=g||void 0}return u}}}}],[{key:"schemaRules",value:function schemaRules(r){var o=[];function insert(r){for(var i=null==r.priority?50:r.priority,a=0;a<o.length;a++){var c=o[a];if((null==c.priority?50:c.priority)<i)break}o.splice(a,0,r)}var i=function _loop2(o){var i=r.marks[o].spec.parseDOM;i&&i.forEach(function(r){insert(r=copy(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})};for(var a in r.marks)i(a);var c=function _loop3(o){var i=r.nodes[o].spec.parseDOM;i&&i.forEach(function(r){insert(r=copy(r)),r.node||r.ignore||r.mark||(r.node=o)})};for(var u in r.nodes)c(u);return o}},{key:"fromSchema",value:function fromSchema(r){return r.cached.domParser||(r.cached.domParser=new DOMParser(r,DOMParser.schemaRules(r)))}}]),DOMParser}(),j={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},B={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},V={ol:!0,ul:!0};function wsOptionsFor(r,o,i){return null!=o?(o?1:0)|("full"===o?2:0):r&&"pre"==r.whitespace?3:-5&i}var U=function(){function NodeContext(r,o,i,a,c,u){_classCallCheck(this,NodeContext),this.type=r,this.attrs=o,this.marks=i,this.solid=a,this.options=u,this.content=[],this.activeMarks=p.none,this.match=c||(4&u?null:r.contentMatch)}return _createClass(NodeContext,[{key:"findWrapping",value:function findWrapping(r){if(!this.match){if(!this.type)return[];var o=this.type.contentMatch.fillBefore(c.from(r));if(!o){var i,a=this.type.contentMatch;return(i=a.findWrapping(r.type))?(this.match=a,i):null}this.match=this.type.contentMatch.matchFragment(o)}return this.match.findWrapping(r.type)}},{key:"finish",value:function finish(r){if(!(1&this.options)){var o,i=this.content[this.content.length-1];if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){var a=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-o[0].length))}}var u=c.from(this.content);return!r&&this.match&&(u=u.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,u,this.marks):u}},{key:"inlineContext",value:function inlineContext(r){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:r.parentNode&&!j.hasOwnProperty(r.parentNode.nodeName.toLowerCase())}}]),NodeContext}(),H=function(){function ParseContext(r,o,i){_classCallCheck(this,ParseContext),this.parser=r,this.options=o,this.isOpen=i,this.open=0,this.localPreserveWS=!1;var a,c=o.topNode,u=wsOptionsFor(null,o.preserveWhitespace,0)|(i?4:0);a=c?new U(c.type,c.attrs,p.none,!0,o.topMatch||c.type.contentMatch,u):new U(i?null:r.schema.topNodeType,null,p.none,!0,null,u),this.nodes=[a],this.find=o.findPositions,this.needsBlock=!1}return _createClass(ParseContext,[{key:"top",get:function get(){return this.nodes[this.open]}},{key:"addDOM",value:function addDOM(r,o){3==r.nodeType?this.addTextNode(r,o):1==r.nodeType&&this.addElement(r,o)}},{key:"addTextNode",value:function addTextNode(r,o){var i=r.nodeValue,a=this.top,c=2&a.options?"full":this.localPreserveWS||(1&a.options)>0,u=this.parser.schema;if("full"===c||a.inlineContext(r)||/[^ \t\r\n\u000c]/.test(i)){if(c)if("full"===c)i=i.replace(/\r\n?/g,"\n");else if(u.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(u.linebreakReplacement.create())){for(var p=i.split(/\r?\n|\r/),g=0;g<p.length;g++)g&&this.insertNode(u.linebreakReplacement.create(),o,!0),p[g]&&this.insertNode(u.text(p[g]),o,!/\S/.test(p[g]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){var v=a.content[a.content.length-1],b=r.previousSibling;(!v||b&&"BR"==b.nodeName||v.isText&&/[ \t\r\n\u000c]$/.test(v.text))&&(i=i.slice(1))}i&&this.insertNode(u.text(i),o,!/\S/.test(i)),this.findInText(r)}else this.findInside(r)}},{key:"addElement",value:function addElement(r,o,i){var a=this.localPreserveWS,c=this.top;("PRE"==r.tagName||/pre/.test(r.style&&r.style.whiteSpace))&&(this.localPreserveWS=!0);var u,p=r.nodeName.toLowerCase();V.hasOwnProperty(p)&&this.parser.normalizeLists&&function normalizeList(r){for(var o=r.firstChild,i=null;o;o=o.nextSibling){var a=1==o.nodeType?o.nodeName.toLowerCase():null;a&&V.hasOwnProperty(a)&&i?(i.appendChild(o),o=i):"li"==a?i=o:a&&(i=null)}}(r);var g=this.options.ruleFromNode&&this.options.ruleFromNode(r)||(u=this.parser.matchTag(r,this,i));e:if(g?g.ignore:B.hasOwnProperty(p))this.findInside(r),this.ignoreFallback(r,o);else if(!g||g.skip||g.closeParent){g&&g.closeParent?this.open=Math.max(0,this.open-1):g&&g.skip.nodeType&&(r=g.skip);var v,b=this.needsBlock;if(j.hasOwnProperty(p))c.content.length&&c.content[0].isInline&&this.open&&(this.open--,c=this.top),v=!0,c.type||(this.needsBlock=!0);else if(!r.firstChild){this.leafFallback(r,o);break e}var k=g&&g.skip?o:this.readStyles(r,o);k&&this.addAll(r,k),v&&this.sync(c),this.needsBlock=b}else{var E=this.readStyles(r,o);E&&this.addElementByRule(r,g,E,!1===g.consuming?u:void 0)}this.localPreserveWS=a}},{key:"leafFallback",value:function leafFallback(r,o){"BR"==r.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(r.ownerDocument.createTextNode("\n"),o)}},{key:"ignoreFallback",value:function ignoreFallback(r,o){"BR"!=r.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),o,!0)}},{key:"readStyles",value:function readStyles(r,o){var i=this,a=r.style;if(a&&a.length)for(var c=0;c<this.parser.matchedStyles.length;c++){var u=this.parser.matchedStyles[c],p=a.getPropertyValue(u);if(p)for(var g,v=function _loop4(r){var a=i.parser.matchStyle(u,p,i,r);return a?a.ignore?{v:null}:(o=a.clearMark?o.filter(function(r){return!a.clearMark(r)}):o.concat(i.parser.schema.marks[a.mark].create(a.attrs)),!1!==a.consuming?(b=r,0):void(b=r=a)):(b=r,0)},b=void 0;0!==(g=v(b));)if(g)return g.v}return o}},{key:"addElementByRule",value:function addElementByRule(r,o,i,a){var c,u,p=this;if(o.node)if((u=this.parser.schema.nodes[o.node]).isLeaf)this.insertNode(u.create(o.attrs),i,"BR"==r.nodeName)||this.leafFallback(r,i);else{var g=this.enter(u,o.attrs||null,i,o.preserveWhitespace);g&&(c=!0,i=g)}else{var v=this.parser.schema.marks[o.mark];i=i.concat(v.create(o.attrs))}var b=this.top;if(u&&u.isLeaf)this.findInside(r);else if(a)this.addElement(r,i,a);else if(o.getContent)this.findInside(r),o.getContent(r,this.parser.schema).forEach(function(r){return p.insertNode(r,i,!1)});else{var k=r;"string"==typeof o.contentElement?k=r.querySelector(o.contentElement):"function"==typeof o.contentElement?k=o.contentElement(r):o.contentElement&&(k=o.contentElement),this.findAround(r,k,!0),this.addAll(k,i),this.findAround(r,k,!1)}c&&this.sync(b)&&this.open--}},{key:"addAll",value:function addAll(r,o,i,a){for(var c=i||0,u=i?r.childNodes[i]:r.firstChild,p=null==a?null:r.childNodes[a];u!=p;u=u.nextSibling,++c)this.findAtPoint(r,c),this.addDOM(u,o);this.findAtPoint(r,c)}},{key:"findPlace",value:function findPlace(r,o,i){for(var a,c,u=this.open,p=0;u>=0;u--){var g=this.nodes[u],v=g.findWrapping(r);if(v&&(!a||a.length>v.length+p)&&(a=v,c=g,!v.length))break;if(g.solid){if(i)break;p+=2}}if(!a)return null;this.sync(c);for(var b=0;b<a.length;b++)o=this.enterInner(a[b],null,o,!1);return o}},{key:"insertNode",value:function insertNode(r,o,i){if(r.isInline&&this.needsBlock&&!this.top.type){var a=this.textblockFromContext();a&&(o=this.enterInner(a,null,o))}var c=this.findPlace(r,o,i);if(c){this.closeExtra();var u=this.top;u.match&&(u.match=u.match.matchType(r.type));var g,v=p.none,b=_createForOfIteratorHelper(c.concat(r.marks));try{for(b.s();!(g=b.n()).done;){var k=g.value;(u.type?u.type.allowsMarkType(k.type):markMayApply(k.type,r.type))&&(v=k.addToSet(v))}}catch(r){b.e(r)}finally{b.f()}return u.content.push(r.mark(v)),!0}return!1}},{key:"enter",value:function enter(r,o,i,a){var c=this.findPlace(r.create(o),i,!1);return c&&(c=this.enterInner(r,o,i,!0,a)),c}},{key:"enterInner",value:function enterInner(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=arguments.length>4?arguments[4]:void 0;this.closeExtra();var u=this.top;u.match=u.match&&u.match.matchType(r);var g=wsOptionsFor(r,c,u.options);4&u.options&&0==u.content.length&&(g|=4);var v=p.none;return i=i.filter(function(o){return!(u.type?u.type.allowsMarkType(o.type):markMayApply(o.type,r))||(v=o.addToSet(v),!1)}),this.nodes.push(new U(r,o,v,a,null,g)),this.open++,i}},{key:"closeExtra",value:function closeExtra(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=this.nodes.length-1;if(o>this.open){for(;o>this.open;o--)this.nodes[o-1].content.push(this.nodes[o].finish(r));this.nodes.length=this.open+1}}},{key:"finish",value:function finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}},{key:"sync",value:function sync(r){for(var o=this.open;o>=0;o--){if(this.nodes[o]==r)return this.open=o,!0;this.localPreserveWS&&(this.nodes[o].options|=1)}return!1}},{key:"currentPos",get:function get(){this.closeExtra();for(var r=0,o=this.open;o>=0;o--){for(var i=this.nodes[o].content,a=i.length-1;a>=0;a--)r+=i[a].nodeSize;o&&r++}return r}},{key:"findAtPoint",value:function findAtPoint(r,o){if(this.find)for(var i=0;i<this.find.length;i++)this.find[i].node==r&&this.find[i].offset==o&&(this.find[i].pos=this.currentPos)}},{key:"findInside",value:function findInside(r){if(this.find)for(var o=0;o<this.find.length;o++)null==this.find[o].pos&&1==r.nodeType&&r.contains(this.find[o].node)&&(this.find[o].pos=this.currentPos)}},{key:"findAround",value:function findAround(r,o,i){if(r!=o&&this.find)for(var a=0;a<this.find.length;a++){if(null==this.find[a].pos&&1==r.nodeType&&r.contains(this.find[a].node))o.compareDocumentPosition(this.find[a].node)&(i?2:4)&&(this.find[a].pos=this.currentPos)}}},{key:"findInText",value:function findInText(r){if(this.find)for(var o=0;o<this.find.length;o++)this.find[o].node==r&&(this.find[o].pos=this.currentPos-(r.nodeValue.length-this.find[o].offset))}},{key:"matchesContext",value:function matchesContext(r){var o=this;if(r.indexOf("|")>-1)return r.split(/\s*\|\s*/).some(this.matchesContext,this);var i=r.split("/"),a=this.options.context,c=!(this.isOpen||a&&a.parent.type!=this.nodes[0].type),u=-(a?a.depth+1:0)+(c?0:1);return function match(r,p){for(;r>=0;r--){var g=i[r];if(""==g){if(r==i.length-1||0==r)continue;for(;p>=u;p--)if(match(r-1,p))return!0;return!1}var v=p>0||0==p&&c?o.nodes[p].type:a&&p>=u?a.node(p-u).type:null;if(!v||v.name!=g&&!v.isInGroup(g))return!1;p--}return!0}(i.length-1,this.open)}},{key:"textblockFromContext",value:function textblockFromContext(){var r=this.options.context;if(r)for(var o=r.depth;o>=0;o--){var i=r.node(o).contentMatchAt(r.indexAfter(o)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(var a in this.parser.schema.nodes){var c=this.parser.schema.nodes[a];if(c.isTextblock&&c.defaultAttrs)return c}}}]),ParseContext}();function matches(r,o){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,o)}function copy(r){var o={};for(var i in r)o[i]=r[i];return o}function markMayApply(r,o){var i,a=o.schema.nodes,c=function _loop5(){var i=a[u];if(!i.allowsMarkType(r))return 0;var c=[];return function scan(r){c.push(r);for(var i=0;i<r.edgeCount;i++){var a=r.edge(i),u=a.type,p=a.next;if(u==o)return!0;if(c.indexOf(p)<0&&scan(p))return!0}}(i.contentMatch)?{v:!0}:void 0};for(var u in a)if(0!==(i=c())&&i)return i.v}var W=function(){function DOMSerializer(r,o){_classCallCheck(this,DOMSerializer),this.nodes=r,this.marks=o}return _createClass(DOMSerializer,[{key:"serializeFragment",value:function serializeFragment(r){var o=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;a||(a=doc(i).createDocumentFragment());var c=a,u=[];return r.forEach(function(r){if(u.length||r.marks.length){for(var a=0,p=0;a<u.length&&p<r.marks.length;){var g=r.marks[p];if(o.marks[g.type.name]){if(!g.eq(u[a][0])||!1===g.type.spec.spanning)break;a++,p++}else p++}for(;a<u.length;)c=u.pop()[1];for(;p<r.marks.length;){var v=r.marks[p++],b=o.serializeMark(v,r.isInline,i);b&&(u.push([v,c]),c.appendChild(b.dom),c=b.contentDOM||b.dom)}}c.appendChild(o.serializeNodeInner(r,i))}),a}},{key:"serializeNodeInner",value:function serializeNodeInner(r,o){var i=_renderSpec(doc(o),this.nodes[r.type.name](r),null,r.attrs),a=i.dom,c=i.contentDOM;if(c){if(r.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(r.content,o,c)}return a}},{key:"serializeNode",value:function serializeNode(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.serializeNodeInner(r,o),a=r.marks.length-1;a>=0;a--){var c=this.serializeMark(r.marks[a],r.isInline,o);c&&((c.contentDOM||c.dom).appendChild(i),i=c.dom)}return i}},{key:"serializeMark",value:function serializeMark(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=this.marks[r.type.name];return a&&_renderSpec(doc(i),a(r,o),null,r.attrs)}}],[{key:"renderSpec",value:function renderSpec(r,o){return _renderSpec(r,o,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0)}},{key:"fromSchema",value:function fromSchema(r){return r.cached.domSerializer||(r.cached.domSerializer=new DOMSerializer(this.nodesFromSchema(r),this.marksFromSchema(r)))}},{key:"nodesFromSchema",value:function nodesFromSchema(r){var o=gatherToDOM(r.nodes);return o.text||(o.text=function(r){return r.text}),o}},{key:"marksFromSchema",value:function marksFromSchema(r){return gatherToDOM(r.marks)}}]),DOMSerializer}();function gatherToDOM(r){var o={};for(var i in r){var a=r[i].spec.toDOM;a&&(o[i]=a)}return o}function doc(r){return r.document||window.document}var K=new WeakMap;function suspiciousAttributes(r){var o=K.get(r);return void 0===o&&K.set(r,o=function suspiciousAttributesInner(r){var o=null;function scan(r){if(r&&"object"==_typeof(r))if(Array.isArray(r))if("string"==typeof r[0])o||(o=[]),o.push(r);else for(var i=0;i<r.length;i++)scan(r[i]);else for(var a in r)scan(r[a])}return scan(r),o}(r)),o}function _renderSpec(r,o,i,a){if("string"==typeof o)return{dom:r.createTextNode(o)};if(null!=o.nodeType)return{dom:o};if(o.dom&&null!=o.dom.nodeType)return o;var c,u=o[0];if("string"!=typeof u)throw new RangeError("Invalid array passed to renderSpec");if(a&&(c=suspiciousAttributes(a))&&c.indexOf(o)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");var p,g=u.indexOf(" ");g>0&&(i=u.slice(0,g),u=u.slice(g+1));var v=i?r.createElementNS(i,u):r.createElement(u),b=o[1],k=1;if(b&&"object"==_typeof(b)&&null==b.nodeType&&!Array.isArray(b))for(var E in k=2,b)if(null!=b[E]){var w=E.indexOf(" ");w>0?v.setAttributeNS(E.slice(0,w),E.slice(w+1),b[E]):"style"==E&&v.style?v.style.cssText=b[E]:v.setAttribute(E,b[E])}for(var x=k;x<o.length;x++){var C=o[x];if(0===C){if(x<o.length-1||x>k)throw new RangeError("Content hole must be the only child of its parent node");return{dom:v,contentDOM:v}}var _=_renderSpec(r,C,i,a),T=_.dom,P=_.contentDOM;if(v.appendChild(T),P){if(p)throw new RangeError("Multiple content holes");p=P}}return{dom:v,contentDOM:p}}o.ContentMatch=P,o.DOMParser=z,o.DOMSerializer=W,o.Fragment=c,o.Mark=p,o.MarkType=I,o.Node=_,o.NodeRange=x,o.NodeType=N,o.ReplaceError=g,o.ResolvedPos=b,o.Schema=L,o.Slice=v},78187:function(r){"use strict";r.exports=window.elementorV2.session},78806:function(r){"use strict";r.exports=window.elementorV2.env},79513:function(r){"use strict";r.exports=window.elementorV2.ui},81531:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Link:()=>z,default:()=>j,isAllowedUri:()=>isAllowedUri,pasteRegex:()=>L}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=i(54631),E=i(99248),w=i(49162),x=i(54631),C="[\0-   ᠎ -\u2029  ]",_=new RegExp(C),T=new RegExp(`${C}$`),P=new RegExp(C,"g");var A=i(99248),N=i(49162);var R=i(49162),I=i(54631);var L=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;function isAllowedUri(r,o){const i=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return o&&o.forEach(r=>{const o="string"==typeof r?r:r.scheme;o&&i.push(o)}),!r||r.replace(P,"").match(new RegExp(`^(?:(?:${i.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var z=b.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(r=>{"string"!=typeof r?(0,k.registerCustomProtocol)(r.scheme,r.optionalSlashes):(0,k.registerCustomProtocol)(r)})},onDestroy(){(0,k.reset)()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(r,o)=>!!isAllowedUri(r,o.protocols),validate:r=>!!r,shouldAutoLink:r=>{const o=/^[a-z][a-z0-9+.-]*:\/\//i.test(r),i=/^[a-z][a-z0-9+.-]*:/i.test(r);if(o||i&&!r.includes("@"))return!0;const a=(r.includes("@")?r.split("@").pop():r).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(a)&&!!/\./.test(a)}}},addAttributes(){return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:r=>{const o=r.getAttribute("href");return!(!o||!this.options.isAllowedUri(o,{defaultValidate:r=>!!isAllowedUri(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:r}){return this.options.isAllowedUri(r.href,{defaultValidate:r=>!!isAllowedUri(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]:["a",(0,b.mergeAttributes)(this.options.HTMLAttributes,{...r,href:""}),0]},markdownTokenName:"link",parseMarkdown:(r,o)=>o.applyMark("link",o.parseInline(r.tokens||[]),{href:r.href,title:r.title||null}),renderMarkdown:(r,o)=>{var i,a,c,u;const p=null!=(a=null==(i=r.attrs)?void 0:i.href)?a:"",g=null!=(u=null==(c=r.attrs)?void 0:c.title)?u:"",v=o.renderChildren(r);return g?`[${v}](${p} "${g}")`:`[${v}](${p})`},addCommands(){return{setLink:r=>({chain:o})=>{const{href:i}=r;return!!this.options.isAllowedUri(i,{defaultValidate:r=>!!isAllowedUri(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&o().setMark(this.name,r).setMeta("preventAutolink",!0).run()},toggleLink:r=>({chain:o})=>{const{href:i}=r||{};return!(i&&!this.options.isAllowedUri(i,{defaultValidate:r=>!!isAllowedUri(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&o().toggleMark(this.name,r,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:r})=>r().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,b.markPasteRule)({find:r=>{const o=[];if(r){const{protocols:i,defaultProtocol:a}=this.options,c=(0,k.find)(r).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:r=>!!isAllowedUri(r,i),protocols:i,defaultProtocol:a}));c.length&&c.forEach(r=>{this.options.shouldAutoLink(r.value)&&o.push({text:r.value,data:{href:r.href},index:r.start})})}return o},type:this.type,getAttributes:r=>{var o;return{href:null==(o=r.data)?void 0:o.href}}})]},addProseMirrorPlugins(){const r=[],{protocols:o,defaultProtocol:i}=this.options;return this.options.autolink&&r.push(function autolink(r){return new w.Plugin({key:new w.PluginKey("autolink"),appendTransaction:(o,i,a)=>{const c=o.some(r=>r.docChanged)&&!i.doc.eq(a.doc),u=o.some(r=>r.getMeta("preventAutolink"));if(!c||u)return;const{tr:p}=a,g=(0,E.combineTransactionSteps)(i.doc,[...o]);return(0,E.getChangedRanges)(g).forEach(({newRange:o})=>{const i=(0,E.findChildrenInRange)(a.doc,o,r=>r.isTextblock);let c,u;if(i.length>1)c=i[0],u=a.doc.textBetween(c.pos,c.pos+c.node.nodeSize,void 0," ");else if(i.length){const r=a.doc.textBetween(o.from,o.to," "," ");if(!T.test(r))return;c=i[0],u=a.doc.textBetween(c.pos,o.to,void 0," ")}if(c&&u){const o=u.split(_).filter(Boolean);if(o.length<=0)return!1;const i=o[o.length-1],g=c.pos+u.lastIndexOf(i);if(!i)return!1;const v=(0,x.tokenize)(i).map(o=>o.toObject(r.defaultProtocol));if(!function isValidLinkStructure(r){return 1===r.length?r[0].isLink:!(3!==r.length||!r[1].isLink)&&["()","[]"].includes(r[0].value+r[2].value)}(v))return!1;v.filter(r=>r.isLink).map(r=>({...r,from:g+r.start+1,to:g+r.end+1})).filter(r=>!a.schema.marks.code||!a.doc.rangeHasMark(r.from,r.to,a.schema.marks.code)).filter(o=>r.validate(o.value)).filter(o=>r.shouldAutoLink(o.value)).forEach(o=>{(0,E.getMarksBetween)(o.from,o.to,a.doc).some(o=>o.mark.type===r.type)||p.addMark(o.from,o.to,r.type.create({href:o.href}))})}}),p.steps.length?p:void 0}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:r=>!!isAllowedUri(r,o),protocols:o,defaultProtocol:i}),shouldAutoLink:this.options.shouldAutoLink})),r.push(function clickHandler(r){return new N.Plugin({key:new N.PluginKey("handleClickLink"),props:{handleClick:(o,i,a)=>{var c,u;if(0!==a.button)return!1;if(!o.editable)return!1;let p=null;if(a.target instanceof HTMLAnchorElement)p=a.target;else{const o=a.target;if(!o)return!1;const i=r.editor.view.dom;p=o.closest("a"),p&&!i.contains(p)&&(p=null)}if(!p)return!1;let g=!1;if(r.enableClickSelection&&(g=r.editor.commands.extendMarkRange(r.type.name)),r.openOnClick){const i=(0,A.getAttributes)(o.state,r.type.name),a=null!=(c=p.href)?c:i.href,v=null!=(u=p.target)?u:i.target;a&&(window.open(a,v),g=!0)}return g}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&r.push(function pasteHandler(r){return new R.Plugin({key:new R.PluginKey("handlePasteLink"),props:{handlePaste:(o,i,a)=>{const{shouldAutoLink:c}=r,{state:u}=o,{selection:p}=u,{empty:g}=p;if(g)return!1;let v="";a.content.forEach(r=>{v+=r.textContent});const b=(0,I.find)(v,{defaultProtocol:r.defaultProtocol}).find(r=>r.isLink&&r.value===v);return!(!v||!b||void 0!==c&&!c(b.value))&&r.editor.commands.setMark(r.type,{href:b.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),r}}),j=z},83574:function(r,o,i){"use strict";var a,c=Object.create,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,__copyProps=(r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of g(o))b.call(r,c)||c===i||u(r,c,{get:()=>o[c],enumerable:!(a=p(o,c))||a.enumerable});return r},__toESM=(r,o,i)=>(i=null!=r?c(v(r)):{},__copyProps(!o&&r&&r.__esModule?i:u(i,"default",{value:r,enumerable:!0}),r)),k={};((r,o)=>{for(var i in o)u(r,i,{get:o[i],enumerable:!0})})(k,{EditorConsumer:()=>J,EditorContent:()=>A,EditorContext:()=>G,EditorProvider:()=>EditorProvider,MarkViewContent:()=>MarkViewContent,NodeViewContent:()=>NodeViewContent,NodeViewWrapper:()=>te,PureEditorContent:()=>T,ReactMarkView:()=>ue,ReactMarkViewContext:()=>ce,ReactMarkViewRenderer:()=>ReactMarkViewRenderer,ReactNodeView:()=>he,ReactNodeViewContentProvider:()=>ReactNodeViewContentProvider,ReactNodeViewContext:()=>X,ReactNodeViewRenderer:()=>ReactNodeViewRenderer,ReactRenderer:()=>se,Tiptap:()=>ye,TiptapContent:()=>TiptapContent,TiptapContext:()=>ve,TiptapWrapper:()=>TiptapWrapper,useCurrentEditor:()=>useCurrentEditor,useEditor:()=>useEditor,useEditorState:()=>useEditorState,useReactNodeView:()=>useReactNodeView,useTiptap:()=>useTiptap,useTiptapState:()=>useTiptapState}),r.exports=(a=k,__copyProps(u({},"__esModule",{value:!0}),a));var E=i(97557),w=__toESM(i(97557),1),x=__toESM(i(43617),1),C=i(19888),_=i(74848),mergeRefs=(...r)=>o=>{r.forEach(r=>{"function"==typeof r?r(o):r&&(r.current=o)})},Portals=({contentComponent:r})=>{const o=(0,C.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getServerSnapshot);return(0,_.jsx)(_.Fragment,{children:Object.values(o)})};var T=class extends w.default.Component{constructor(r){var o;super(r),this.editorContentRef=w.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(o=r.editor)?void 0:o.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var r;const o=this.props.editor;if(o&&!o.isDestroyed&&(null==(r=o.view.dom)?void 0:r.parentNode)){if(o.contentComponent)return;const r=this.editorContentRef.current;r.append(...o.view.dom.parentNode.childNodes),o.setOptions({element:r}),o.contentComponent=function getInstance(){const r=new Set;let o={};return{subscribe(o){return r.add(o),()=>{r.delete(o)}},getSnapshot(){return o},getServerSnapshot(){return o},setRenderer(i,a){o={...o,[i]:x.default.createPortal(a.reactElement,a.element,i)},r.forEach(r=>r())},removeRenderer(i){const a={...o};delete a[i],o=a,r.forEach(r=>r())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=o.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),o.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var r;const o=this.props.editor;if(o){this.initialized=!1,o.isDestroyed||o.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),o.contentComponent=null;try{if(!(null==(r=o.view.dom)?void 0:r.parentNode))return;const i=document.createElement("div");i.append(...o.view.dom.parentNode.childNodes),o.setOptions({element:i})}catch{}}}render(){const{editor:r,innerRef:o,...i}=this.props;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{ref:mergeRefs(o,this.editorContentRef),...i}),(null==r?void 0:r.contentComponent)&&(0,_.jsx)(Portals,{contentComponent:r.contentComponent})]})}},P=(0,w.forwardRef)((r,o)=>{const i=w.default.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[r.editor]);return w.default.createElement(T,{key:i,innerRef:o,...r})}),A=w.default.memo(P),N=i(99248),R=i(97557),I=i(19888),L=i(40331),z=i(97557),j=i(69242),B="undefined"!=typeof window?z.useLayoutEffect:z.useEffect,V=class{constructor(r){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=r,this.lastSnapshot={editor:r,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(r){return this.subscribers.add(r),()=>{this.subscribers.delete(r)}}watch(r){if(this.editor=r,this.editor){const fn=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},r=this.editor;return r.on("transaction",fn),()=>{r.off("transaction",fn)}}}};function useEditorState(r){var o;const[i]=(0,z.useState)(()=>new V(r.editor)),a=(0,j.useSyncExternalStoreWithSelector)(i.subscribe,i.getSnapshot,i.getServerSnapshot,r.selector,null!=(o=r.equalityFn)?o:L.deepEqual);return B(()=>i.watch(r.editor),[r.editor,i]),(0,z.useDebugValue)(a),a}var U="undefined"==typeof window,H=U||Boolean("undefined"!=typeof window&&window.next),W=class _EditorInstanceManager{constructor(r){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=r,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(r){this.editor=r,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?U||H?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const r={...this.options.current,onBeforeCreate:(...r)=>{var o,i;return null==(i=(o=this.options.current).onBeforeCreate)?void 0:i.call(o,...r)},onBlur:(...r)=>{var o,i;return null==(i=(o=this.options.current).onBlur)?void 0:i.call(o,...r)},onCreate:(...r)=>{var o,i;return null==(i=(o=this.options.current).onCreate)?void 0:i.call(o,...r)},onDestroy:(...r)=>{var o,i;return null==(i=(o=this.options.current).onDestroy)?void 0:i.call(o,...r)},onFocus:(...r)=>{var o,i;return null==(i=(o=this.options.current).onFocus)?void 0:i.call(o,...r)},onSelectionUpdate:(...r)=>{var o,i;return null==(i=(o=this.options.current).onSelectionUpdate)?void 0:i.call(o,...r)},onTransaction:(...r)=>{var o,i;return null==(i=(o=this.options.current).onTransaction)?void 0:i.call(o,...r)},onUpdate:(...r)=>{var o,i;return null==(i=(o=this.options.current).onUpdate)?void 0:i.call(o,...r)},onContentError:(...r)=>{var o,i;return null==(i=(o=this.options.current).onContentError)?void 0:i.call(o,...r)},onDrop:(...r)=>{var o,i;return null==(i=(o=this.options.current).onDrop)?void 0:i.call(o,...r)},onPaste:(...r)=>{var o,i;return null==(i=(o=this.options.current).onPaste)?void 0:i.call(o,...r)},onDelete:(...r)=>{var o,i;return null==(i=(o=this.options.current).onDelete)?void 0:i.call(o,...r)}};return new N.Editor(r)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(r){return this.subscriptions.add(r),()=>{this.subscriptions.delete(r)}}static compareOptions(r,o){return Object.keys(r).every(i=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(i)||("extensions"===i&&r.extensions&&o.extensions?r.extensions.length===o.extensions.length&&r.extensions.every((r,i)=>{var a;return r===(null==(a=o.extensions)?void 0:a[i])}):r[i]===o[i]))}onRender(r){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===r.length?_EditorInstanceManager.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(r),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(r){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=r);if(this.previousDeps.length===r.length&&this.previousDeps.every((o,i)=>o===r[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=r}scheduleDestroy(){const r=this.instanceId,o=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===r?o&&o.setOptions(this.options.current):o&&!o.isDestroyed&&(o.destroy(),this.instanceId===r&&this.setEditor(null))},1)}};function useEditor(r={},o=[]){const i=(0,R.useRef)(r);i.current=r;const[a]=(0,R.useState)(()=>new W(i)),c=(0,I.useSyncExternalStore)(a.subscribe,a.getEditor,a.getServerSnapshot);return(0,R.useDebugValue)(c),(0,R.useEffect)(a.onRender(o)),useEditorState({editor:c,selector:({transactionNumber:o})=>!1===r.shouldRerenderOnTransaction||void 0===r.shouldRerenderOnTransaction?null:r.immediatelyRender&&0===o?0:o+1}),c}var K=i(74848),G=(0,E.createContext)({editor:null}),J=G.Consumer,useCurrentEditor=()=>(0,E.useContext)(G);function EditorProvider({children:r,slotAfter:o,slotBefore:i,editorContainerProps:a={},...c}){const u=useEditor(c),p=(0,E.useMemo)(()=>({editor:u}),[u]);return u?(0,K.jsxs)(G.Provider,{value:p,children:[i,(0,K.jsx)(J,{children:({editor:r})=>(0,K.jsx)(A,{editor:r,...a})}),r,o]}):null}var Y=i(97557),X=(0,Y.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),ReactNodeViewContentProvider=({children:r,content:o})=>(0,Y.createElement)(X.Provider,{value:{nodeViewContentChildren:o}},r),useReactNodeView=()=>(0,Y.useContext)(X),Q=i(74848);function NodeViewContent({as:r="div",...o}){const{nodeViewContentRef:i,nodeViewContentChildren:a}=useReactNodeView();return(0,Q.jsx)(r,{...o,ref:i,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...o.style},children:a})}var Z=__toESM(i(97557),1),ee=i(74848),te=Z.default.forwardRef((r,o)=>{const{onDragStart:i}=useReactNodeView(),a=r.as||"div";return(0,ee.jsx)(a,{...r,ref:o,"data-node-view-wrapper":"",onDragStart:i,style:{whiteSpace:"normal",...r.style}})}),ne=i(99248),re=__toESM(i(97557),1),oe=i(97557),ie=i(43617),ae=i(74848);function isClassComponent(r){return!("function"!=typeof r||!r.prototype||!r.prototype.isReactComponent)}function isForwardRefComponent(r){return!("object"!=typeof r||!r.$$typeof||"Symbol(react.forward_ref)"!==r.$$typeof.toString()&&"react.forward_ref"!==r.$$typeof.description)}var se=class{constructor(r,{editor:o,props:i={},as:a="div",className:c=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=r,this.editor=o,this.props=i,this.element=document.createElement(a),this.element.classList.add("react-renderer"),c&&this.element.classList.add(...c.split(" ")),this.editor.isInitialized?(0,ie.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var r;if(this.destroyed)return;const o=this.component,i=this.props,a=this.editor,c=function isReact19Plus(){try{if(oe.version)return parseInt(oe.version.split(".")[0],10)>=19}catch{}return!1}(),u=function canReceiveRef(r){if(isClassComponent(r))return!0;if(isForwardRefComponent(r))return!0;if(function isMemoComponent(r){return!("object"!=typeof r||!r.$$typeof||"Symbol(react.memo)"!==r.$$typeof.toString()&&"react.memo"!==r.$$typeof.description)}(r)){const o=r.type;if(o)return isClassComponent(o)||isForwardRefComponent(o)}return!1}(o),p={...i};!p.ref||c||u||delete p.ref,p.ref||!c&&!u||(p.ref=r=>{this.ref=r}),this.reactElement=(0,ae.jsx)(o,{...p}),null==(r=null==a?void 0:a.contentComponent)||r.setRenderer(this.id,this)}updateProps(r={}){this.destroyed||(this.props={...this.props,...r},this.render())}destroy(){var r;this.destroyed=!0;const o=this.editor;null==(r=null==o?void 0:o.contentComponent)||r.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(r){Object.keys(r).forEach(o=>{this.element.setAttribute(o,r[o])})}},le=i(74848),ce=re.default.createContext({markViewContentRef:()=>{}}),MarkViewContent=r=>{const{as:o="span",...i}=r,{markViewContentRef:a}=re.default.useContext(ce);return(0,le.jsx)(o,{...i,ref:a,"data-mark-view-content":""})},ue=class extends ne.MarkView{constructor(r,o,i){super(r,o,i);const{as:a="span",attrs:c,className:u=""}=i||{},p={...o,updateAttributes:this.updateAttributes.bind(this)};this.contentDOMElement=document.createElement("span");const g={markViewContentRef:r=>{r&&!r.contains(this.contentDOMElement)&&r.appendChild(this.contentDOMElement)}},v=re.default.memo(o=>(0,le.jsx)(ce.Provider,{value:g,children:re.default.createElement(r,o)}));v.displayName="ReactMarkView",this.renderer=new se(v,{editor:o.editor,props:p,as:a,className:`mark-${o.mark.type.name} ${u}`.trim()}),c&&this.renderer.updateAttributes(c)}get dom(){return this.renderer.element}get contentDOM(){return this.contentDOMElement}};function ReactMarkViewRenderer(r,o={}){return i=>new ue(r,i,o)}var pe=i(99248),de=i(97557),fe=i(74848),he=class extends pe.NodeView{constructor(r,o,i){if(super(r,o,i),this.selectionRafId=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const r=this.editor,o=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(o,{get(i,a,c){var u;return"storage"===a?null!=(u=r.storage[o.name])?u:{}:Reflect.get(i,a,c)}})}return this.cachedExtensionWithSyncedStorage}mount(){const r={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(r={})=>this.updateAttributes(r),deleteNode:()=>this.deleteNode(),ref:(0,de.createRef)()};if(!this.component.displayName){const capitalizeFirstChar=r=>r.charAt(0).toUpperCase()+r.substring(1);this.component.displayName=capitalizeFirstChar(this.extension.name)}const o={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:r=>{r&&this.contentDOMElement&&r.firstChild!==this.contentDOMElement&&(r.hasAttribute("data-node-view-wrapper")&&r.removeAttribute("data-node-view-wrapper"),r.appendChild(this.contentDOMElement))}},i=this.component,a=(0,de.memo)(r=>(0,fe.jsx)(X.Provider,{value:o,children:(0,de.createElement)(i,r)}));a.displayName="ReactNodeView";let c=this.node.isInline?"span":"div";this.options.as&&(c=this.options.as);const{className:u=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new se(a,{editor:this.editor,props:r,as:c,className:`node-${this.node.type.name} ${u}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var r;if(this.renderer.element.firstElementChild&&!(null==(r=this.renderer.element.firstElementChild)?void 0:r.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:r,to:o}=this.editor.state.selection,i=this.getPos();if("number"==typeof i)if(r<=i&&o>=i+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(r,o,i){const rerenderComponent=r=>{this.renderer.updateProps(r),"function"==typeof this.options.attrs&&this.updateElementAttributes()};if(r.type!==this.node.type)return!1;if("function"==typeof this.options.update){const a=this.node,c=this.decorations,u=this.innerDecorations;return this.node=r,this.decorations=o,this.innerDecorations=i,this.options.update({oldNode:a,oldDecorations:c,newNode:r,newDecorations:o,oldInnerDecorations:u,innerDecorations:i,updateProps:()=>rerenderComponent({node:r,decorations:o,innerDecorations:i,extension:this.extensionWithSyncedStorage})})}return r===this.node&&this.decorations===o&&this.innerDecorations===i||(this.node=r,this.decorations=o,this.innerDecorations=i,rerenderComponent({node:r,decorations:o,innerDecorations:i,extension:this.extensionWithSyncedStorage})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let r={};if("function"==typeof this.options.attrs){const o=this.editor.extensionManager.attributes,i=(0,pe.getRenderedAttributes)(this.node,o);r=this.options.attrs({node:this.node,HTMLAttributes:i})}else r=this.options.attrs;this.renderer.updateAttributes(r)}}};function ReactNodeViewRenderer(r,o){return i=>i.editor.contentComponent?new he(r,i,o):{}}var me=i(97557),ge=i(74848),ve=(0,me.createContext)({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});ve.displayName="TiptapContext";var useTiptap=()=>(0,me.useContext)(ve);function useTiptapState(r,o){const{editor:i}=useTiptap();return useEditorState({editor:i,selector:r,equalityFn:o})}function TiptapWrapper({editor:r,instance:o,children:i}){const a=null!=r?r:o;if(!a)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const c=(0,me.useMemo)(()=>({editor:a}),[a]),u=(0,me.useMemo)(()=>({editor:a}),[a]);return(0,ge.jsx)(G.Provider,{value:u,children:(0,ge.jsx)(ve.Provider,{value:c,children:i})})}function TiptapContent({...r}){const{editor:o}=useTiptap();return(0,ge.jsx)(A,{editor:o,...r})}TiptapWrapper.displayName="Tiptap",TiptapContent.displayName="Tiptap.Content";var ye=Object.assign(TiptapWrapper,{Content:TiptapContent});((r,o,i)=>{__copyProps(r,o,"default"),i&&__copyProps(i,o,"default")})(k,i(99248),r.exports)},84792:function(r){"use strict";r.exports=window.elementorV2.wpMedia},87627:function(r){"use strict";r.exports=window.elementorV2.locations},88136:function(r,o,i){"use strict";var a=i(76237),c=i(37820),u="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),p="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function normalizeKeyName(r){var o,i,a,c,p=r.split(/-(?!$)/),g=p[p.length-1];"Space"==g&&(g=" ");for(var v=0;v<p.length-1;v++){var b=p[v];if(/^(cmd|meta|m)$/i.test(b))c=!0;else if(/^a(lt)?$/i.test(b))o=!0;else if(/^(c|ctrl|control)$/i.test(b))i=!0;else if(/^s(hift)?$/i.test(b))a=!0;else{if(!/^mod$/i.test(b))throw new Error("Unrecognized modifier name: "+b);u?c=!0:i=!0}}return o&&(g="Alt-"+g),i&&(g="Ctrl-"+g),c&&(g="Meta-"+g),a&&(g="Shift-"+g),g}function modifiers(r,o){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return o.altKey&&(r="Alt-"+r),o.ctrlKey&&(r="Ctrl-"+r),o.metaKey&&(r="Meta-"+r),i&&o.shiftKey&&(r="Shift-"+r),r}function keydownHandler(r){var o=function normalize(r){var o=Object.create(null);for(var i in r)o[normalizeKeyName(i)]=r[i];return o}(r);return function(r,i){var c,u=a.keyName(i),g=o[modifiers(u,i)];if(g&&g(r.state,r.dispatch,r))return!0;if(1==u.length&&" "!=u){if(i.shiftKey){var v=o[modifiers(u,i,!1)];if(v&&v(r.state,r.dispatch,r))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(p&&i.ctrlKey&&i.altKey)&&(c=a.base[i.keyCode])&&c!=u){var b=o[modifiers(c,i)];if(b&&b(r.state,r.dispatch,r))return!0}}return!1}}o.keydownHandler=keydownHandler,o.keymap=function keymap(r){return new c.Plugin({props:{handleKeyDown:keydownHandler(r)}})}},90990:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(49454))},97557:function(r){"use strict";r.exports=window.React},99248:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,__export=(r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})},v={};function createChainableState(r){const{state:o,transaction:i}=r;let{selection:a}=i,{doc:c}=i,{storedMarks:u}=i;return{...o,apply:o.apply.bind(o),applyTransaction:o.applyTransaction.bind(o),plugins:o.plugins,schema:o.schema,reconfigure:o.reconfigure.bind(o),toJSON:o.toJSON.bind(o),get storedMarks(){return u},get selection(){return a},get doc(){return c},get tr(){return a=i.selection,c=i.doc,u=i.storedMarks,i}}}__export(v,{CommandManager:()=>b,Editor:()=>it,Extendable:()=>Oe,Extension:()=>Fe,Fragment:()=>Fragment6,InputRule:()=>Te,MappablePosition:()=>le,Mark:()=>Pe,MarkView:()=>pt,Node:()=>dt,NodePos:()=>ot,NodeView:()=>ht,PasteRule:()=>Ne,ResizableNodeView:()=>st,ResizableNodeview:()=>lt,Tracker:()=>mt,callOrReturn:()=>callOrReturn,canInsertNode:()=>canInsertNode,combineTransactionSteps:()=>combineTransactionSteps,commands:()=>k,createAtomBlockMarkdownSpec:()=>createAtomBlockMarkdownSpec,createBlockMarkdownSpec:()=>createBlockMarkdownSpec,createChainableState:()=>createChainableState,createDocument:()=>createDocument,createElement:()=>h,createInlineMarkdownSpec:()=>createInlineMarkdownSpec,createMappablePosition:()=>createMappablePosition,createNodeFromContent:()=>createNodeFromContent,createStyleTag:()=>createStyleTag,defaultBlockAt:()=>defaultBlockAt,deleteProps:()=>deleteProps,elementFromString:()=>elementFromString,escapeForRegEx:()=>escapeForRegEx,extensions:()=>De,findChildren:()=>findChildren,findChildrenInRange:()=>findChildrenInRange,findDuplicates:()=>findDuplicates,findParentNode:()=>findParentNode,findParentNodeClosestToPos:()=>findParentNodeClosestToPos,flattenExtensions:()=>flattenExtensions,fromString:()=>fromString,generateHTML:()=>generateHTML,generateJSON:()=>generateJSON,generateText:()=>generateText,getAttributes:()=>getAttributes,getAttributesFromExtensions:()=>getAttributesFromExtensions,getChangedRanges:()=>getChangedRanges,getDebugJSON:()=>getDebugJSON,getExtensionField:()=>getExtensionField,getHTMLFromFragment:()=>getHTMLFromFragment,getMarkAttributes:()=>getMarkAttributes,getMarkRange:()=>getMarkRange,getMarkType:()=>getMarkType,getMarksBetween:()=>getMarksBetween,getNodeAtPosition:()=>getNodeAtPosition,getNodeAttributes:()=>getNodeAttributes,getNodeType:()=>getNodeType,getRenderedAttributes:()=>getRenderedAttributes,getSchema:()=>getSchema,getSchemaByResolvedExtensions:()=>getSchemaByResolvedExtensions,getSchemaTypeByName:()=>getSchemaTypeByName,getSchemaTypeNameByName:()=>getSchemaTypeNameByName,getSplittedAttributes:()=>getSplittedAttributes,getText:()=>getText,getTextBetween:()=>getTextBetween,getTextContentFromNodes:()=>getTextContentFromNodes,getTextSerializersFromSchema:()=>getTextSerializersFromSchema,getUpdatedPosition:()=>getUpdatedPosition,h:()=>h,injectExtensionAttributesToParseRule:()=>injectExtensionAttributesToParseRule,inputRulesPlugin:()=>inputRulesPlugin,isActive:()=>isActive,isAndroid:()=>isAndroid,isAtEndOfNode:()=>isAtEndOfNode,isAtStartOfNode:()=>isAtStartOfNode,isEmptyObject:()=>isEmptyObject,isExtensionRulesEnabled:()=>isExtensionRulesEnabled,isFirefox:()=>isFirefox,isFunction:()=>isFunction,isList:()=>isList,isMacOS:()=>isMacOS,isMarkActive:()=>isMarkActive,isNodeActive:()=>isNodeActive,isNodeEmpty:()=>isNodeEmpty,isNodeSelection:()=>isNodeSelection,isNumber:()=>isNumber,isPlainObject:()=>isPlainObject,isRegExp:()=>isRegExp,isSafari:()=>isSafari,isString:()=>isString,isTextSelection:()=>isTextSelection,isiOS:()=>isiOS,markInputRule:()=>markInputRule,markPasteRule:()=>markPasteRule,markdown:()=>ut,mergeAttributes:()=>mergeAttributes,mergeDeep:()=>mergeDeep,minMax:()=>minMax,nodeInputRule:()=>nodeInputRule,nodePasteRule:()=>nodePasteRule,objectIncludes:()=>objectIncludes,parseAttributes:()=>parseAttributes,parseIndentedBlocks:()=>parseIndentedBlocks,pasteRulesPlugin:()=>pasteRulesPlugin,posToDOMRect:()=>posToDOMRect,removeDuplicates:()=>removeDuplicates,renderNestedMarkdownContent:()=>renderNestedMarkdownContent,resolveExtensions:()=>resolveExtensions,resolveFocusPosition:()=>resolveFocusPosition,rewriteUnknownContent:()=>rewriteUnknownContent,selectionToInsertionEnd:()=>selectionToInsertionEnd,serializeAttributes:()=>serializeAttributes,sortExtensions:()=>sortExtensions,splitExtensions:()=>splitExtensions,textInputRule:()=>textInputRule,textPasteRule:()=>textPasteRule,textblockTypeInputRule:()=>textblockTypeInputRule,updateMarkViewAttributes:()=>updateMarkViewAttributes,wrappingInputRule:()=>wrappingInputRule}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=class{constructor(r){this.editor=r.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=r.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:r,editor:o,state:i}=this,{view:a}=o,{tr:c}=i,u=this.buildProps(c);return Object.fromEntries(Object.entries(r).map(([r,o])=>[r,(...r)=>{const i=o(...r)(u);return c.getMeta("preventDispatch")||this.hasCustomState||a.dispatch(c),i}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(r,o=!0){const{rawCommands:i,editor:a,state:c}=this,{view:u}=a,p=[],g=!!r,v=r||c.tr,b={...Object.fromEntries(Object.entries(i).map(([r,i])=>[r,(...r)=>{const a=this.buildProps(v,o),c=i(...r)(a);return p.push(c),b}])),run:()=>(g||!o||v.getMeta("preventDispatch")||this.hasCustomState||u.dispatch(v),p.every(r=>!0===r))};return b}createCan(r){const{rawCommands:o,state:i}=this,a=!1,c=r||i.tr,u=this.buildProps(c,a);return{...Object.fromEntries(Object.entries(o).map(([r,o])=>[r,(...r)=>o(...r)({...u,dispatch:void 0})])),chain:()=>this.createChain(c,a)}}buildProps(r,o=!0){const{rawCommands:i,editor:a,state:c}=this,{view:u}=a,p={tr:r,editor:a,view:u,state:createChainableState({state:c,transaction:r}),dispatch:o?()=>{}:void 0,chain:()=>this.createChain(r,o),can:()=>this.createCan(r),get commands(){return Object.fromEntries(Object.entries(i).map(([r,o])=>[r,(...r)=>o(...r)(p)]))}};return p}},k={};__export(k,{blur:()=>blur,clearContent:()=>clearContent,clearNodes:()=>clearNodes,command:()=>command,createParagraphNear:()=>createParagraphNear,cut:()=>cut,deleteCurrentNode:()=>deleteCurrentNode,deleteNode:()=>deleteNode,deleteRange:()=>deleteRange,deleteSelection:()=>deleteSelection,enter:()=>enter,exitCode:()=>exitCode,extendMarkRange:()=>extendMarkRange,first:()=>first,focus:()=>focus,forEach:()=>forEach,insertContent:()=>insertContent,insertContentAt:()=>insertContentAt,joinBackward:()=>joinBackward,joinDown:()=>joinDown,joinForward:()=>joinForward,joinItemBackward:()=>joinItemBackward,joinItemForward:()=>joinItemForward,joinTextblockBackward:()=>joinTextblockBackward,joinTextblockForward:()=>joinTextblockForward,joinUp:()=>joinUp,keyboardShortcut:()=>keyboardShortcut,lift:()=>lift,liftEmptyBlock:()=>liftEmptyBlock,liftListItem:()=>liftListItem,newlineInCode:()=>newlineInCode,resetAttributes:()=>resetAttributes,scrollIntoView:()=>scrollIntoView,selectAll:()=>selectAll,selectNodeBackward:()=>selectNodeBackward,selectNodeForward:()=>selectNodeForward,selectParentNode:()=>selectParentNode,selectTextblockEnd:()=>selectTextblockEnd,selectTextblockStart:()=>selectTextblockStart,setContent:()=>setContent,setMark:()=>setMark,setMeta:()=>setMeta,setNode:()=>setNode,setNodeSelection:()=>setNodeSelection,setTextDirection:()=>setTextDirection,setTextSelection:()=>setTextSelection,sinkListItem:()=>sinkListItem,splitBlock:()=>splitBlock,splitListItem:()=>splitListItem,toggleList:()=>toggleList,toggleMark:()=>toggleMark,toggleNode:()=>toggleNode,toggleWrap:()=>toggleWrap,undoInputRule:()=>undoInputRule,unsetAllMarks:()=>unsetAllMarks,unsetMark:()=>unsetMark,unsetTextDirection:()=>unsetTextDirection,updateAttributes:()=>updateAttributes,wrapIn:()=>wrapIn,wrapInList:()=>wrapInList});var blur=()=>({editor:r,view:o})=>(requestAnimationFrame(()=>{var i;r.isDestroyed||(o.dom.blur(),null==(i=null==window?void 0:window.getSelection())||i.removeAllRanges())}),!0),clearContent=(r=!0)=>({commands:o})=>o.setContent("",{emitUpdate:r}),E=i(26401),clearNodes=()=>({state:r,tr:o,dispatch:i})=>{const{selection:a}=o,{ranges:c}=a;return!i||(c.forEach(({$from:i,$to:a})=>{r.doc.nodesBetween(i.pos,a.pos,(r,i)=>{if(r.type.isText)return;const{doc:a,mapping:c}=o,u=a.resolve(c.map(i)),p=a.resolve(c.map(i+r.nodeSize)),g=u.blockRange(p);if(!g)return;const v=(0,E.liftTarget)(g);if(r.type.isTextblock){const{defaultType:r}=u.parent.contentMatchAt(u.index());o.setNodeMarkup(g.start,r)}(v||0===v)&&o.lift(g,v)})}),!0)},command=r=>o=>r(o),w=i(24007),createParagraphNear=()=>({state:r,dispatch:o})=>(0,w.createParagraphNear)(r,o),x=i(49162),cut=(r,o)=>({editor:i,tr:a})=>{const{state:c}=i,u=c.doc.slice(r.from,r.to);a.deleteRange(r.from,r.to);const p=a.mapping.map(o);return a.insert(p,u.content),a.setSelection(new x.TextSelection(a.doc.resolve(Math.max(p-1,0)))),!0},deleteCurrentNode=()=>({tr:r,dispatch:o})=>{const{selection:i}=r,a=i.$anchor.node();if(a.content.size>0)return!1;const c=r.selection.$anchor;for(let i=c.depth;i>0;i-=1){if(c.node(i).type===a.type){if(o){const o=c.before(i),a=c.after(i);r.delete(o,a).scrollIntoView()}return!0}}return!1};function getNodeType(r,o){if("string"==typeof r){if(!o.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return o.nodes[r]}return r}var deleteNode=r=>({tr:o,state:i,dispatch:a})=>{const c=getNodeType(r,i.schema),u=o.selection.$anchor;for(let r=u.depth;r>0;r-=1){if(u.node(r).type===c){if(a){const i=u.before(r),a=u.after(r);o.delete(i,a).scrollIntoView()}return!0}}return!1},deleteRange=r=>({tr:o,dispatch:i})=>{const{from:a,to:c}=r;return i&&o.delete(a,c),!0},C=i(24007),deleteSelection=()=>({state:r,dispatch:o})=>(0,C.deleteSelection)(r,o),enter=()=>({commands:r})=>r.keyboardShortcut("Enter"),_=i(24007),exitCode=()=>({state:r,dispatch:o})=>(0,_.exitCode)(r,o),T=i(49162);function isRegExp(r){return"[object RegExp]"===Object.prototype.toString.call(r)}function objectIncludes(r,o,i={strict:!0}){const a=Object.keys(o);return!a.length||a.every(a=>i.strict?o[a]===r[a]:isRegExp(o[a])?o[a].test(r[a]):o[a]===r[a])}function findMarkInSet(r,o,i={}){return r.find(r=>r.type===o&&objectIncludes(Object.fromEntries(Object.keys(i).map(o=>[o,r.attrs[o]])),i))}function isMarkInSet(r,o,i={}){return!!findMarkInSet(r,o,i)}function getMarkRange(r,o,i){var a;if(!r||!o)return;let c=r.parent.childAfter(r.parentOffset);if(c.node&&c.node.marks.some(r=>r.type===o)||(c=r.parent.childBefore(r.parentOffset)),!c.node||!c.node.marks.some(r=>r.type===o))return;i=i||(null==(a=c.node.marks[0])?void 0:a.attrs);if(!findMarkInSet([...c.node.marks],o,i))return;let u=c.index,p=r.start()+c.offset,g=u+1,v=p+c.node.nodeSize;for(;u>0&&isMarkInSet([...r.parent.child(u-1).marks],o,i);)u-=1,p-=r.parent.child(u).nodeSize;for(;g<r.parent.childCount&&isMarkInSet([...r.parent.child(g).marks],o,i);)v+=r.parent.child(g).nodeSize,g+=1;return{from:p,to:v}}function getMarkType(r,o){if("string"==typeof r){if(!o.marks[r])throw Error(`There is no mark type named '${r}'. Maybe you forgot to add the extension?`);return o.marks[r]}return r}var extendMarkRange=(r,o={})=>({tr:i,state:a,dispatch:c})=>{const u=getMarkType(r,a.schema),{doc:p,selection:g}=i,{$from:v,from:b,to:k}=g;if(c){const r=getMarkRange(v,u,o);if(r&&r.from<=b&&r.to>=k){const o=T.TextSelection.create(p,r.from,r.to);i.setSelection(o)}}return!0},first=r=>o=>{const i="function"==typeof r?r(o):r;for(let r=0;r<i.length;r+=1)if(i[r](o))return!0;return!1},P=i(49162);function isTextSelection(r){return r instanceof P.TextSelection}var A=i(49162);function minMax(r=0,o=0,i=0){return Math.min(Math.max(r,o),i)}function resolveFocusPosition(r,o=null){if(!o)return null;const i=A.Selection.atStart(r),a=A.Selection.atEnd(r);if("start"===o||!0===o)return i;if("end"===o)return a;const c=i.from,u=a.to;return"all"===o?A.TextSelection.create(r,minMax(0,c,u),minMax(r.content.size,c,u)):A.TextSelection.create(r,minMax(o,c,u),minMax(o,c,u))}function isAndroid(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function isiOS(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function isSafari(){return"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var focus=(r=null,o={})=>({editor:i,view:a,tr:c,dispatch:u})=>{o={scrollIntoView:!0,...o};const delayedFocus=()=>{(isiOS()||isAndroid())&&a.dom.focus(),!isSafari()||isiOS()||isAndroid()||a.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{i.isDestroyed||(a.focus(),(null==o?void 0:o.scrollIntoView)&&i.commands.scrollIntoView())})};try{if(a.hasFocus()&&null===r||!1===r)return!0}catch{return!1}if(u&&null===r&&!isTextSelection(i.state.selection))return delayedFocus(),!0;const p=resolveFocusPosition(c.doc,r)||i.state.selection,g=i.state.selection.eq(p);return u&&(g||c.setSelection(p),g&&c.storedMarks&&c.setStoredMarks(c.storedMarks),delayedFocus()),!0},forEach=(r,o)=>i=>r.every((r,a)=>o(r,{...i,index:a})),insertContent=(r,o)=>({tr:i,commands:a})=>a.insertContentAt({from:i.selection.from,to:i.selection.to},r,o),N=i(32386),R=i(32386),removeWhitespaces=r=>{const o=r.childNodes;for(let i=o.length-1;i>=0;i-=1){const a=o[i];3===a.nodeType&&a.nodeValue&&/^(\n\s\s|\n)$/.test(a.nodeValue)?r.removeChild(a):1===a.nodeType&&removeWhitespaces(a)}return r};function elementFromString(r){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const o=`<body>${r}</body>`,i=(new window.DOMParser).parseFromString(o,"text/html").body;return removeWhitespaces(i)}function createNodeFromContent(r,o,i){if(r instanceof R.Node||r instanceof R.Fragment)return r;i={slice:!0,parseOptions:{},...i};const a="string"==typeof r;if("object"==typeof r&&null!==r)try{if(Array.isArray(r)&&r.length>0)return R.Fragment.fromArray(r.map(r=>o.nodeFromJSON(r)));const a=o.nodeFromJSON(r);return i.errorOnInvalidContent&&a.check(),a}catch(a){if(i.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",a),createNodeFromContent("",o,i)}if(a){if(i.errorOnInvalidContent){let a=!1,c="";const u=new R.Schema({topNode:o.spec.topNode,marks:o.spec.marks,nodes:o.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:r=>(a=!0,c="string"==typeof r?r:r.outerHTML,null)}]}})});if(i.slice?R.DOMParser.fromSchema(u).parseSlice(elementFromString(r),i.parseOptions):R.DOMParser.fromSchema(u).parse(elementFromString(r),i.parseOptions),i.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const a=R.DOMParser.fromSchema(o);return i.slice?a.parseSlice(elementFromString(r),i.parseOptions).content:a.parse(elementFromString(r),i.parseOptions)}return createNodeFromContent("",o,i)}var I=i(49162),L=i(26401);function selectionToInsertionEnd(r,o,i){const a=r.steps.length-1;if(a<o)return;const c=r.steps[a];if(!(c instanceof L.ReplaceStep||c instanceof L.ReplaceAroundStep))return;const u=r.mapping.maps[a];let p=0;u.forEach((r,o,i,a)=>{0===p&&(p=a)}),r.setSelection(I.Selection.near(r.doc.resolve(p),i))}var insertContentAt=(r,o,i)=>({tr:a,dispatch:c,editor:u})=>{var p;if(c){let c;const emitContentError=r=>{u.emit("contentError",{editor:u,error:r,disableCollaboration:()=>{"collaboration"in u.storage&&"object"==typeof u.storage.collaboration&&u.storage.collaboration&&(u.storage.collaboration.isDisabled=!0)}})},g={preserveWhitespace:"full",...(i={parseOptions:u.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...i}).parseOptions};if(!i.errorOnInvalidContent&&!u.options.enableContentCheck&&u.options.emitContentError)try{createNodeFromContent(o,u.schema,{parseOptions:g,errorOnInvalidContent:!0})}catch(r){emitContentError(r)}try{c=createNodeFromContent(o,u.schema,{parseOptions:g,errorOnInvalidContent:null!=(p=i.errorOnInvalidContent)?p:u.options.enableContentCheck})}catch(r){return emitContentError(r),!1}let{from:v,to:b}="number"==typeof r?{from:r,to:r}:{from:r.from,to:r.to},k=!0,E=!0;if(("type"in c?[c]:c).forEach(r=>{r.check(),k=!!k&&(r.isText&&0===r.marks.length),E=!!E&&r.isBlock}),v===b&&E){const{parent:r}=a.doc.resolve(v);r.isTextblock&&!r.type.spec.code&&!r.childCount&&(v-=1,b+=1)}let w;if(k){if(Array.isArray(o))w=o.map(r=>r.text||"").join("");else if(o instanceof N.Fragment){let r="";o.forEach(o=>{o.text&&(r+=o.text)}),w=r}else w="object"==typeof o&&o&&o.text?o.text:o;a.insertText(w,v,b)}else{w=c;const r=a.doc.resolve(v),o=r.node(),i=0===r.parentOffset,u=o.isText||o.isTextblock,p=o.content.size>0;i&&u&&p&&(v=Math.max(0,v-1)),a.replaceWith(v,b,w)}i.updateSelection&&selectionToInsertionEnd(a,a.steps.length-1,-1),i.applyInputRules&&a.setMeta("applyInputRules",{from:v,text:w}),i.applyPasteRules&&a.setMeta("applyPasteRules",{from:v,text:w})}return!0},z=i(24007),joinUp=()=>({state:r,dispatch:o})=>(0,z.joinUp)(r,o),joinDown=()=>({state:r,dispatch:o})=>(0,z.joinDown)(r,o),joinBackward=()=>({state:r,dispatch:o})=>(0,z.joinBackward)(r,o),joinForward=()=>({state:r,dispatch:o})=>(0,z.joinForward)(r,o),j=i(26401),joinItemBackward=()=>({state:r,dispatch:o,tr:i})=>{try{const a=(0,j.joinPoint)(r.doc,r.selection.$from.pos,-1);return null!=a&&(i.join(a,2),o&&o(i),!0)}catch{return!1}},B=i(26401),joinItemForward=()=>({state:r,dispatch:o,tr:i})=>{try{const a=(0,B.joinPoint)(r.doc,r.selection.$from.pos,1);return null!=a&&(i.join(a,2),o&&o(i),!0)}catch{return!1}},V=i(24007),joinTextblockBackward=()=>({state:r,dispatch:o})=>(0,V.joinTextblockBackward)(r,o),U=i(24007),joinTextblockForward=()=>({state:r,dispatch:o})=>(0,U.joinTextblockForward)(r,o);function isMacOS(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var keyboardShortcut=r=>({editor:o,view:i,tr:a,dispatch:c})=>{const u=function normalizeKeyName(r){const o=r.split(/-(?!$)/);let i,a,c,u,p=o[o.length-1];"Space"===p&&(p=" ");for(let r=0;r<o.length-1;r+=1){const p=o[r];if(/^(cmd|meta|m)$/i.test(p))u=!0;else if(/^a(lt)?$/i.test(p))i=!0;else if(/^(c|ctrl|control)$/i.test(p))a=!0;else if(/^s(hift)?$/i.test(p))c=!0;else{if(!/^mod$/i.test(p))throw new Error(`Unrecognized modifier name: ${p}`);isiOS()||isMacOS()?u=!0:a=!0}}return i&&(p=`Alt-${p}`),a&&(p=`Ctrl-${p}`),u&&(p=`Meta-${p}`),c&&(p=`Shift-${p}`),p}(r).split(/-(?!$)/),p=u.find(r=>!["Alt","Ctrl","Meta","Shift"].includes(r)),g=new KeyboardEvent("keydown",{key:"Space"===p?" ":p,altKey:u.includes("Alt"),ctrlKey:u.includes("Ctrl"),metaKey:u.includes("Meta"),shiftKey:u.includes("Shift"),bubbles:!0,cancelable:!0}),v=o.captureTransaction(()=>{i.someProp("handleKeyDown",r=>r(i,g))});return null==v||v.steps.forEach(r=>{const o=r.map(a.mapping);o&&c&&a.maybeStep(o)}),!0},H=i(24007);function isNodeActive(r,o,i={}){const{from:a,to:c,empty:u}=r.selection,p=o?getNodeType(o,r.schema):null,g=[];r.doc.nodesBetween(a,c,(r,o)=>{if(r.isText)return;const i=Math.max(a,o),u=Math.min(c,o+r.nodeSize);g.push({node:r,from:i,to:u})});const v=c-a,b=g.filter(r=>!p||p.name===r.node.type.name).filter(r=>objectIncludes(r.node.attrs,i,{strict:!1}));if(u)return!!b.length;return b.reduce((r,o)=>r+o.to-o.from,0)>=v}var lift=(r,o={})=>({state:i,dispatch:a})=>!!isNodeActive(i,getNodeType(r,i.schema),o)&&(0,H.lift)(i,a),W=i(24007),liftEmptyBlock=()=>({state:r,dispatch:o})=>(0,W.liftEmptyBlock)(r,o),K=i(35423),liftListItem=r=>({state:o,dispatch:i})=>{const a=getNodeType(r,o.schema);return(0,K.liftListItem)(a)(o,i)},G=i(24007),newlineInCode=()=>({state:r,dispatch:o})=>(0,G.newlineInCode)(r,o);function getSchemaTypeNameByName(r,o){return o.nodes[r]?"node":o.marks[r]?"mark":null}function deleteProps(r,o){const i="string"==typeof o?[o]:o;return Object.keys(r).reduce((o,a)=>(i.includes(a)||(o[a]=r[a]),o),{})}var resetAttributes=(r,o)=>({tr:i,state:a,dispatch:c})=>{let u=null,p=null;const g=getSchemaTypeNameByName("string"==typeof r?r:r.name,a.schema);if(!g)return!1;"node"===g&&(u=getNodeType(r,a.schema)),"mark"===g&&(p=getMarkType(r,a.schema));let v=!1;return i.selection.ranges.forEach(r=>{a.doc.nodesBetween(r.$from.pos,r.$to.pos,(r,a)=>{u&&u===r.type&&(v=!0,c&&i.setNodeMarkup(a,void 0,deleteProps(r.attrs,o))),p&&r.marks.length&&r.marks.forEach(u=>{p===u.type&&(v=!0,c&&i.addMark(a,a+r.nodeSize,p.create(deleteProps(u.attrs,o))))})})}),v},scrollIntoView=()=>({tr:r,dispatch:o})=>(o&&r.scrollIntoView(),!0),J=i(49162),selectAll=()=>({tr:r,dispatch:o})=>{if(o){const o=new J.AllSelection(r.doc);r.setSelection(o)}return!0},Y=i(24007),selectNodeBackward=()=>({state:r,dispatch:o})=>(0,Y.selectNodeBackward)(r,o),X=i(24007),selectNodeForward=()=>({state:r,dispatch:o})=>(0,X.selectNodeForward)(r,o),Q=i(24007),selectParentNode=()=>({state:r,dispatch:o})=>(0,Q.selectParentNode)(r,o),Z=i(24007),selectTextblockEnd=()=>({state:r,dispatch:o})=>(0,Z.selectTextblockEnd)(r,o),ee=i(24007),selectTextblockStart=()=>({state:r,dispatch:o})=>(0,ee.selectTextblockStart)(r,o);function createDocument(r,o,i={},a={}){return createNodeFromContent(r,o,{slice:!1,parseOptions:i,errorOnInvalidContent:a.errorOnInvalidContent})}var setContent=(r,{errorOnInvalidContent:o,emitUpdate:i=!0,parseOptions:a={}}={})=>({editor:c,tr:u,dispatch:p,commands:g})=>{const{doc:v}=u;if("full"!==a.preserveWhitespace){const g=createDocument(r,c.schema,a,{errorOnInvalidContent:null!=o?o:c.options.enableContentCheck});return p&&u.replaceWith(0,v.content.size,g).setMeta("preventUpdate",!i),!0}return p&&u.setMeta("preventUpdate",!i),g.insertContentAt({from:0,to:v.content.size},r,{parseOptions:a,errorOnInvalidContent:null!=o?o:c.options.enableContentCheck})};function getMarkAttributes(r,o){const i=getMarkType(o,r.schema),{from:a,to:c,empty:u}=r.selection,p=[];u?(r.storedMarks&&p.push(...r.storedMarks),p.push(...r.selection.$head.marks())):r.doc.nodesBetween(a,c,r=>{p.push(...r.marks)});const g=p.find(r=>r.type.name===i.name);return g?{...g.attrs}:{}}var te=i(26401);function combineTransactionSteps(r,o){const i=new te.Transform(r);return o.forEach(r=>{r.steps.forEach(r=>{i.step(r)})}),i}function defaultBlockAt(r){for(let o=0;o<r.edgeCount;o+=1){const{type:i}=r.edge(o);if(i.isTextblock&&!i.hasRequiredAttrs())return i}return null}function findChildren(r,o){const i=[];return r.descendants((r,a)=>{o(r)&&i.push({node:r,pos:a})}),i}function findChildrenInRange(r,o,i){const a=[];return r.nodesBetween(o.from,o.to,(r,o)=>{i(r)&&a.push({node:r,pos:o})}),a}function findParentNodeClosestToPos(r,o){for(let i=r.depth;i>0;i-=1){const a=r.node(i);if(o(a))return{pos:i>0?r.before(i):0,start:r.start(i),depth:i,node:a}}}function findParentNode(r){return o=>findParentNodeClosestToPos(o.$from,r)}function getExtensionField(r,o,i){if(void 0===r.config[o]&&r.parent)return getExtensionField(r.parent,o,i);if("function"==typeof r.config[o]){return r.config[o].bind({...i,parent:r.parent?getExtensionField(r.parent,o,i):null})}return r.config[o]}function flattenExtensions(r){return r.map(r=>{const o=getExtensionField(r,"addExtensions",{name:r.name,options:r.options,storage:r.storage});return o?[r,...flattenExtensions(o())]:r}).flat(10)}var ne=i(32386),re=i(32386);function getHTMLFromFragment(r,o){const i=re.DOMSerializer.fromSchema(o).serializeFragment(r),a=document.implementation.createHTMLDocument().createElement("div");return a.appendChild(i),a.innerHTML}var oe=i(32386);function isFunction(r){return"function"==typeof r}function callOrReturn(r,o=void 0,...i){return isFunction(r)?o?r.bind(o)(...i):r(...i):r}function isEmptyObject(r={}){return 0===Object.keys(r).length&&r.constructor===Object}function splitExtensions(r){return{baseExtensions:r.filter(r=>"extension"===r.type),nodeExtensions:r.filter(r=>"node"===r.type),markExtensions:r.filter(r=>"mark"===r.type)}}function getAttributesFromExtensions(r){const o=[],{nodeExtensions:i,markExtensions:a}=splitExtensions(r),c=[...i,...a],u={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},p=i.filter(r=>"text"!==r.name).map(r=>r.name),g=a.map(r=>r.name),v=[...p,...g];return r.forEach(r=>{const i=getExtensionField(r,"addGlobalAttributes",{name:r.name,options:r.options,storage:r.storage,extensions:c});if(!i)return;i().forEach(r=>{let i;i=Array.isArray(r.types)?r.types:"*"===r.types?v:"nodes"===r.types?p:"marks"===r.types?g:[],i.forEach(i=>{Object.entries(r.attributes).forEach(([r,a])=>{o.push({type:i,name:r,attribute:{...u,...a}})})})})}),c.forEach(r=>{const i={name:r.name,options:r.options,storage:r.storage},a=getExtensionField(r,"addAttributes",i);if(!a)return;const c=a();Object.entries(c).forEach(([i,a])=>{const c={...u,...a};"function"==typeof(null==c?void 0:c.default)&&(c.default=c.default()),(null==c?void 0:c.isRequired)&&void 0===(null==c?void 0:c.default)&&delete c.default,o.push({type:r.name,name:i,attribute:c})})}),o}function mergeAttributes(...r){return r.filter(r=>!!r).reduce((r,o)=>{const i={...r};return Object.entries(o).forEach(([r,o])=>{if(i[r])if("class"===r){const a=o?String(o).split(" "):[],c=i[r]?i[r].split(" "):[],u=a.filter(r=>!c.includes(r));i[r]=[...c,...u].join(" ")}else if("style"===r){const a=o?o.split(";").map(r=>r.trim()).filter(Boolean):[],c=i[r]?i[r].split(";").map(r=>r.trim()).filter(Boolean):[],u=new Map;c.forEach(r=>{const[o,i]=r.split(":").map(r=>r.trim());u.set(o,i)}),a.forEach(r=>{const[o,i]=r.split(":").map(r=>r.trim());u.set(o,i)}),i[r]=Array.from(u.entries()).map(([r,o])=>`${r}: ${o}`).join("; ")}else i[r]=o;else i[r]=o}),i},{})}function getRenderedAttributes(r,o){return o.filter(o=>o.type===r.type.name).filter(r=>r.attribute.rendered).map(o=>o.attribute.renderHTML?o.attribute.renderHTML(r.attrs)||{}:{[o.name]:r.attrs[o.name]}).reduce((r,o)=>mergeAttributes(r,o),{})}function fromString(r){return"string"!=typeof r?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r}function injectExtensionAttributesToParseRule(r,o){return"style"in r?r:{...r,getAttrs:i=>{const a=r.getAttrs?r.getAttrs(i):r.attrs;if(!1===a)return!1;const c=o.reduce((r,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(i):fromString(i.getAttribute(o.name));return null==a?r:{...r,[o.name]:a}},{});return{...a,...c}}}}function cleanUpSchemaItem(r){return Object.fromEntries(Object.entries(r).filter(([r,o])=>("attrs"!==r||!isEmptyObject(o))&&null!=o))}function buildAttributeSpec(r){var o,i;const a={};return!(null==(o=null==r?void 0:r.attribute)?void 0:o.isRequired)&&"default"in((null==r?void 0:r.attribute)||{})&&(a.default=r.attribute.default),void 0!==(null==(i=null==r?void 0:r.attribute)?void 0:i.validate)&&(a.validate=r.attribute.validate),[r.name,a]}function getSchemaByResolvedExtensions(r,o){var i;const a=getAttributesFromExtensions(r),{nodeExtensions:c,markExtensions:u}=splitExtensions(r),p=null==(i=c.find(r=>getExtensionField(r,"topNode")))?void 0:i.name,g=Object.fromEntries(c.map(i=>{const c=a.filter(r=>r.type===i.name),u={name:i.name,options:i.options,storage:i.storage,editor:o},p=cleanUpSchemaItem({...r.reduce((r,o)=>{const a=getExtensionField(o,"extendNodeSchema",u);return{...r,...a?a(i):{}}},{}),content:callOrReturn(getExtensionField(i,"content",u)),marks:callOrReturn(getExtensionField(i,"marks",u)),group:callOrReturn(getExtensionField(i,"group",u)),inline:callOrReturn(getExtensionField(i,"inline",u)),atom:callOrReturn(getExtensionField(i,"atom",u)),selectable:callOrReturn(getExtensionField(i,"selectable",u)),draggable:callOrReturn(getExtensionField(i,"draggable",u)),code:callOrReturn(getExtensionField(i,"code",u)),whitespace:callOrReturn(getExtensionField(i,"whitespace",u)),linebreakReplacement:callOrReturn(getExtensionField(i,"linebreakReplacement",u)),defining:callOrReturn(getExtensionField(i,"defining",u)),isolating:callOrReturn(getExtensionField(i,"isolating",u)),attrs:Object.fromEntries(c.map(buildAttributeSpec))}),g=callOrReturn(getExtensionField(i,"parseHTML",u));g&&(p.parseDOM=g.map(r=>injectExtensionAttributesToParseRule(r,c)));const v=getExtensionField(i,"renderHTML",u);v&&(p.toDOM=r=>v({node:r,HTMLAttributes:getRenderedAttributes(r,c)}));const b=getExtensionField(i,"renderText",u);return b&&(p.toText=b),[i.name,p]})),v=Object.fromEntries(u.map(i=>{const c=a.filter(r=>r.type===i.name),u={name:i.name,options:i.options,storage:i.storage,editor:o},p=cleanUpSchemaItem({...r.reduce((r,o)=>{const a=getExtensionField(o,"extendMarkSchema",u);return{...r,...a?a(i):{}}},{}),inclusive:callOrReturn(getExtensionField(i,"inclusive",u)),excludes:callOrReturn(getExtensionField(i,"excludes",u)),group:callOrReturn(getExtensionField(i,"group",u)),spanning:callOrReturn(getExtensionField(i,"spanning",u)),code:callOrReturn(getExtensionField(i,"code",u)),attrs:Object.fromEntries(c.map(buildAttributeSpec))}),g=callOrReturn(getExtensionField(i,"parseHTML",u));g&&(p.parseDOM=g.map(r=>injectExtensionAttributesToParseRule(r,c)));const v=getExtensionField(i,"renderHTML",u);return v&&(p.toDOM=r=>v({mark:r,HTMLAttributes:getRenderedAttributes(r,c)})),[i.name,p]}));return new oe.Schema({topNode:p,nodes:g,marks:v})}function findDuplicates(r){const o=r.filter((o,i)=>r.indexOf(o)!==i);return Array.from(new Set(o))}function sortExtensions(r){return r.sort((r,o)=>{const i=getExtensionField(r,"priority")||100,a=getExtensionField(o,"priority")||100;return i>a?-1:i<a?1:0})}function resolveExtensions(r){const o=sortExtensions(flattenExtensions(r)),i=findDuplicates(o.map(r=>r.name));return i.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${i.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),o}function getSchema(r,o){return getSchemaByResolvedExtensions(resolveExtensions(r),o)}function generateHTML(r,o){const i=getSchema(o);return getHTMLFromFragment(ne.Node.fromJSON(i,r).content,i)}var ie=i(32386);function generateJSON(r,o){const i=getSchema(o),a=elementFromString(r);return ie.DOMParser.fromSchema(i).parse(a).toJSON()}var ae=i(32386);function getTextBetween(r,o,i){const{from:a,to:c}=o,{blockSeparator:u="\n\n",textSerializers:p={}}=i||{};let g="";return r.nodesBetween(a,c,(r,i,v,b)=>{var k;r.isBlock&&i>a&&(g+=u);const E=null==p?void 0:p[r.type.name];if(E)return v&&(g+=E({node:r,pos:i,parent:v,index:b,range:o})),!1;r.isText&&(g+=null==(k=null==r?void 0:r.text)?void 0:k.slice(Math.max(a,i)-i,c-i))}),g}function getText(r,o){return getTextBetween(r,{from:0,to:r.content.size},o)}function getTextSerializersFromSchema(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,r])=>r.spec.toText).map(([r,o])=>[r,o.spec.toText]))}function generateText(r,o,i){const{blockSeparator:a="\n\n",textSerializers:c={}}=i||{},u=getSchema(o);return getText(ae.Node.fromJSON(u,r),{blockSeparator:a,textSerializers:{...getTextSerializersFromSchema(u),...c}})}function getNodeAttributes(r,o){const i=getNodeType(o,r.schema),{from:a,to:c}=r.selection,u=[];r.doc.nodesBetween(a,c,r=>{u.push(r)});const p=u.reverse().find(r=>r.type.name===i.name);return p?{...p.attrs}:{}}function getAttributes(r,o){const i=getSchemaTypeNameByName("string"==typeof o?o:o.name,r.schema);return"node"===i?getNodeAttributes(r,o):"mark"===i?getMarkAttributes(r,o):{}}function removeDuplicates(r,o=JSON.stringify){const i={};return r.filter(r=>{const a=o(r);return!Object.prototype.hasOwnProperty.call(i,a)&&(i[a]=!0)})}function getChangedRanges(r){const{mapping:o,steps:i}=r,a=[];return o.maps.forEach((r,c)=>{const u=[];if(r.ranges.length)r.forEach((r,o)=>{u.push({from:r,to:o})});else{const{from:r,to:o}=i[c];if(void 0===r||void 0===o)return;u.push({from:r,to:o})}u.forEach(({from:r,to:i})=>{const u=o.slice(c).map(r,-1),p=o.slice(c).map(i),g=o.invert().map(u,-1),v=o.invert().map(p);a.push({oldRange:{from:g,to:v},newRange:{from:u,to:p}})})}),function simplifyChangedRanges(r){const o=removeDuplicates(r);return 1===o.length?o:o.filter((r,i)=>!o.filter((r,o)=>o!==i).some(o=>r.oldRange.from>=o.oldRange.from&&r.oldRange.to<=o.oldRange.to&&r.newRange.from>=o.newRange.from&&r.newRange.to<=o.newRange.to))}(a)}function getDebugJSON(r,o=0){const i=r.type===r.type.schema.topNodeType?0:1,a=o,c=a+r.nodeSize,u=r.marks.map(r=>{const o={type:r.type.name};return Object.keys(r.attrs).length&&(o.attrs={...r.attrs}),o}),p={...r.attrs},g={type:r.type.name,from:a,to:c};return Object.keys(p).length&&(g.attrs=p),u.length&&(g.marks=u),r.content.childCount&&(g.content=[],r.forEach((r,a)=>{var c;null==(c=g.content)||c.push(getDebugJSON(r,o+a+i))})),r.text&&(g.text=r.text),g}function getMarksBetween(r,o,i){const a=[];return r===o?i.resolve(r).marks().forEach(o=>{const c=getMarkRange(i.resolve(r),o.type);c&&a.push({mark:o,...c})}):i.nodesBetween(r,o,(r,o)=>{r&&void 0!==(null==r?void 0:r.nodeSize)&&a.push(...r.marks.map(i=>({from:o,to:o+r.nodeSize,mark:i})))}),a}var getNodeAtPosition=(r,o,i,a=20)=>{const c=r.doc.resolve(i);let u=a,p=null;for(;u>0&&null===p;){const r=c.node(u);(null==r?void 0:r.type.name)===o?p=r:u-=1}return[p,u]};function getSchemaTypeByName(r,o){return o.nodes[r]||o.marks[r]||null}function getSplittedAttributes(r,o,i){return Object.fromEntries(Object.entries(i).filter(([i])=>{const a=r.find(r=>r.type===o&&r.name===i);return!!a&&a.attribute.keepOnSplit}))}var getTextContentFromNodes=(r,o=500)=>{let i="";const a=r.parentOffset;return r.parent.nodesBetween(Math.max(0,a-o),a,(r,o,c,u)=>{var p,g;const v=(null==(g=(p=r.type.spec).toText)?void 0:g.call(p,{node:r,pos:o,parent:c,index:u}))||r.textContent||"%leaf%";i+=r.isAtom&&!r.isText?v:v.slice(0,Math.max(0,a-o))}),i};function isMarkActive(r,o,i={}){const{empty:a,ranges:c}=r.selection,u=o?getMarkType(o,r.schema):null;if(a)return!!(r.storedMarks||r.selection.$from.marks()).filter(r=>!u||u.name===r.type.name).find(r=>objectIncludes(r.attrs,i,{strict:!1}));let p=0;const g=[];if(c.forEach(({$from:o,$to:i})=>{const a=o.pos,c=i.pos;r.doc.nodesBetween(a,c,(r,o)=>{if(u&&r.inlineContent&&!r.type.allowsMarkType(u))return!1;if(!r.isText&&!r.marks.length)return;const i=Math.max(a,o),v=Math.min(c,o+r.nodeSize);p+=v-i,g.push(...r.marks.map(r=>({mark:r,from:i,to:v})))})}),0===p)return!1;const v=g.filter(r=>!u||u.name===r.mark.type.name).filter(r=>objectIncludes(r.mark.attrs,i,{strict:!1})).reduce((r,o)=>r+o.to-o.from,0),b=g.filter(r=>!u||r.mark.type!==u&&r.mark.type.excludes(u)).reduce((r,o)=>r+o.to-o.from,0);return(v>0?v+b:v)>=p}function isActive(r,o,i={}){if(!o)return isNodeActive(r,null,i)||isMarkActive(r,null,i);const a=getSchemaTypeNameByName(o,r.schema);return"node"===a?isNodeActive(r,o,i):"mark"===a&&isMarkActive(r,o,i)}var isAtEndOfNode=(r,o)=>{const{$from:i,$to:a,$anchor:c}=r.selection;if(o){const i=findParentNode(r=>r.type.name===o)(r.selection);if(!i)return!1;const a=r.doc.resolve(i.pos+1);return c.pos+1===a.end()}return!(a.parentOffset<a.parent.nodeSize-2||i.pos!==a.pos)},isAtStartOfNode=r=>{const{$from:o,$to:i}=r.selection;return!(o.parentOffset>0||o.pos!==i.pos)};function isExtensionRulesEnabled(r,o){return Array.isArray(o)?o.some(o=>("string"==typeof o?o:o.name)===r.name):o}function isList(r,o){const{nodeExtensions:i}=splitExtensions(o),a=i.find(o=>o.name===r);if(!a)return!1;const c=callOrReturn(getExtensionField(a,"group",{name:a.name,options:a.options,storage:a.storage}));return"string"==typeof c&&c.split(" ").includes("list")}function isNodeEmpty(r,{checkChildren:o=!0,ignoreWhitespace:i=!1}={}){var a;if(i){if("hardBreak"===r.type.name)return!0;if(r.isText)return/^\s*$/m.test(null!=(a=r.text)?a:"")}if(r.isText)return!r.text;if(r.isAtom||r.isLeaf)return!1;if(0===r.content.childCount)return!0;if(o){let a=!0;return r.content.forEach(r=>{!1!==a&&(isNodeEmpty(r,{ignoreWhitespace:i,checkChildren:o})||(a=!1))}),a}return!1}var se=i(49162);function isNodeSelection(r){return r instanceof se.NodeSelection}var le=class _MappablePosition{constructor(r){this.position=r}static fromJSON(r){return new _MappablePosition(r.position)}toJSON(){return{position:this.position}}};function getUpdatedPosition(r,o){const i=o.mapping.mapResult(r.position);return{position:new le(i.pos),mapResult:i}}function createMappablePosition(r){return new le(r)}function posToDOMRect(r,o,i){const a=r.state.doc.content.size,c=minMax(o,0,a),u=minMax(i,0,a),p=r.coordsAtPos(c),g=r.coordsAtPos(u,-1),v=Math.min(p.top,g.top),b=Math.max(p.bottom,g.bottom),k=Math.min(p.left,g.left),E=Math.max(p.right,g.right),w={top:v,bottom:b,left:k,right:E,width:E-k,height:b-v,x:k,y:v};return{...w,toJSON:()=>w}}function rewriteUnknownContentInner({json:r,validMarks:o,validNodes:i,options:a,rewrittenContent:c=[]}){return r.marks&&Array.isArray(r.marks)&&(r.marks=r.marks.filter(r=>{const i="string"==typeof r?r:r.type;return!!o.has(i)||(c.push({original:JSON.parse(JSON.stringify(r)),unsupported:i}),!1)})),r.content&&Array.isArray(r.content)&&(r.content=r.content.map(r=>rewriteUnknownContentInner({json:r,validMarks:o,validNodes:i,options:a,rewrittenContent:c}).json).filter(r=>null!=r)),r.type&&!i.has(r.type)?(c.push({original:JSON.parse(JSON.stringify(r)),unsupported:r.type}),r.content&&Array.isArray(r.content)&&!1!==(null==a?void 0:a.fallbackToParagraph)?(r.type="paragraph",{json:r,rewrittenContent:c}):{json:null,rewrittenContent:c}):{json:r,rewrittenContent:c}}function rewriteUnknownContent(r,o,i){return rewriteUnknownContentInner({json:r,validNodes:new Set(Object.keys(o.nodes)),validMarks:new Set(Object.keys(o.marks)),options:i})}var setMark=(r,o={})=>({tr:i,state:a,dispatch:c})=>{const{selection:u}=i,{empty:p,ranges:g}=u,v=getMarkType(r,a.schema);if(c)if(p){const r=getMarkAttributes(a,v);i.addStoredMark(v.create({...r,...o}))}else g.forEach(r=>{const c=r.$from.pos,u=r.$to.pos;a.doc.nodesBetween(c,u,(r,a)=>{const p=Math.max(a,c),g=Math.min(a+r.nodeSize,u);r.marks.find(r=>r.type===v)?r.marks.forEach(r=>{v===r.type&&i.addMark(p,g,v.create({...r.attrs,...o}))}):i.addMark(p,g,v.create(o))})});return function canSetMark(r,o,i){var a;const{selection:c}=o;let u=null;if(isTextSelection(c)&&(u=c.$cursor),u){const o=null!=(a=r.storedMarks)?a:u.marks();return u.parent.type.allowsMarkType(i)&&(!!i.isInSet(o)||!o.some(r=>r.type.excludes(i)))}const{ranges:p}=c;return p.some(({$from:o,$to:a})=>{let c=0===o.depth&&r.doc.inlineContent&&r.doc.type.allowsMarkType(i);return r.doc.nodesBetween(o.pos,a.pos,(r,o,a)=>{if(c)return!1;if(r.isInline){const o=!a||a.type.allowsMarkType(i),u=!!i.isInSet(r.marks)||!r.marks.some(r=>r.type.excludes(i));c=o&&u}return!c}),c})}(a,i,v)},setMeta=(r,o)=>({tr:i})=>(i.setMeta(r,o),!0),ce=i(24007),setNode=(r,o={})=>({state:i,dispatch:a,chain:c})=>{const u=getNodeType(r,i.schema);let p;return i.selection.$anchor.sameParent(i.selection.$head)&&(p=i.selection.$anchor.parent.attrs),u.isTextblock?c().command(({commands:r})=>!!(0,ce.setBlockType)(u,{...p,...o})(i)||r.clearNodes()).command(({state:r})=>(0,ce.setBlockType)(u,{...p,...o})(r,a)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ue=i(49162),setNodeSelection=r=>({tr:o,dispatch:i})=>{if(i){const{doc:i}=o,a=minMax(r,0,i.content.size),c=ue.NodeSelection.create(i,a);o.setSelection(c)}return!0},setTextDirection=(r,o)=>({tr:i,state:a,dispatch:c})=>{const{selection:u}=a;let p,g;return"number"==typeof o?(p=o,g=o):o&&"from"in o&&"to"in o?(p=o.from,g=o.to):(p=u.from,g=u.to),c&&i.doc.nodesBetween(p,g,(o,a)=>{o.isText||i.setNodeMarkup(a,void 0,{...o.attrs,dir:r})}),!0},pe=i(49162),setTextSelection=r=>({tr:o,dispatch:i})=>{if(i){const{doc:i}=o,{from:a,to:c}="number"==typeof r?{from:r,to:r}:r,u=pe.TextSelection.atStart(i).from,p=pe.TextSelection.atEnd(i).to,g=minMax(a,u,p),v=minMax(c,u,p),b=pe.TextSelection.create(i,g,v);o.setSelection(b)}return!0},de=i(35423),sinkListItem=r=>({state:o,dispatch:i})=>{const a=getNodeType(r,o.schema);return(0,de.sinkListItem)(a)(o,i)},fe=i(49162),he=i(26401);function ensureMarks(r,o){const i=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(i){const a=i.filter(r=>null==o?void 0:o.includes(r.type.name));r.tr.ensureMarks(a)}}var splitBlock=({keepMarks:r=!0}={})=>({tr:o,state:i,dispatch:a,editor:c})=>{const{selection:u,doc:p}=o,{$from:g,$to:v}=u,b=getSplittedAttributes(c.extensionManager.attributes,g.node().type.name,g.node().attrs);if(u instanceof fe.NodeSelection&&u.node.isBlock)return!(!g.parentOffset||!(0,he.canSplit)(p,g.pos))&&(a&&(r&&ensureMarks(i,c.extensionManager.splittableMarks),o.split(g.pos).scrollIntoView()),!0);if(!g.parent.isBlock)return!1;const k=v.parentOffset===v.parent.content.size,E=0===g.depth?void 0:defaultBlockAt(g.node(-1).contentMatchAt(g.indexAfter(-1)));let w=k&&E?[{type:E,attrs:b}]:void 0,x=(0,he.canSplit)(o.doc,o.mapping.map(g.pos),1,w);if(w||x||!(0,he.canSplit)(o.doc,o.mapping.map(g.pos),1,E?[{type:E}]:void 0)||(x=!0,w=E?[{type:E,attrs:b}]:void 0),a){if(x&&(u instanceof fe.TextSelection&&o.deleteSelection(),o.split(o.mapping.map(g.pos),1,w),E&&!k&&!g.parentOffset&&g.parent.type!==E)){const r=o.mapping.map(g.before()),i=o.doc.resolve(r);g.node(-1).canReplaceWith(i.index(),i.index()+1,E)&&o.setNodeMarkup(o.mapping.map(g.before()),E)}r&&ensureMarks(i,c.extensionManager.splittableMarks),o.scrollIntoView()}return x},me=i(32386),ge=i(49162),ve=i(26401),splitListItem=(r,o={})=>({tr:i,state:a,dispatch:c,editor:u})=>{var p;const g=getNodeType(r,a.schema),{$from:v,$to:b}=a.selection,k=a.selection.node;if(k&&k.isBlock||v.depth<2||!v.sameParent(b))return!1;const E=v.node(-1);if(E.type!==g)return!1;const w=u.extensionManager.attributes;if(0===v.parent.content.size&&v.node(-1).childCount===v.indexAfter(-1)){if(2===v.depth||v.node(-3).type!==g||v.index(-2)!==v.node(-2).childCount-1)return!1;if(c){let r=me.Fragment.empty;const a=v.index(-1)?1:v.index(-2)?2:3;for(let o=v.depth-a;o>=v.depth-3;o-=1)r=me.Fragment.from(v.node(o).copy(r));const c=v.indexAfter(-1)<v.node(-2).childCount?1:v.indexAfter(-2)<v.node(-3).childCount?2:3,u={...getSplittedAttributes(w,v.node().type.name,v.node().attrs),...o},b=(null==(p=g.contentMatch.defaultType)?void 0:p.createAndFill(u))||void 0;r=r.append(me.Fragment.from(g.createAndFill(null,b)||void 0));const k=v.before(v.depth-(a-1));i.replace(k,v.after(-c),new me.Slice(r,4-a,0));let E=-1;i.doc.nodesBetween(k,i.doc.content.size,(r,o)=>{if(E>-1)return!1;r.isTextblock&&0===r.content.size&&(E=o+1)}),E>-1&&i.setSelection(ge.TextSelection.near(i.doc.resolve(E))),i.scrollIntoView()}return!0}const x=b.pos===v.end()?E.contentMatchAt(0).defaultType:null,C={...getSplittedAttributes(w,E.type.name,E.attrs),...o},_={...getSplittedAttributes(w,v.node().type.name,v.node().attrs),...o};i.delete(v.pos,b.pos);const T=x?[{type:g,attrs:C},{type:x,attrs:_}]:[{type:g,attrs:C}];if(!(0,ve.canSplit)(i.doc,v.pos,2))return!1;if(c){const{selection:r,storedMarks:o}=a,{splittableMarks:p}=u.extensionManager,g=o||r.$to.parentOffset&&r.$from.marks();if(i.split(v.pos,2,T).scrollIntoView(),!g||!c)return!0;const b=g.filter(r=>p.includes(r.type.name));i.ensureMarks(b)}return!0},ye=i(26401),joinListBackwards=(r,o)=>{const i=findParentNode(r=>r.type===o)(r.selection);if(!i)return!0;const a=r.doc.resolve(Math.max(0,i.pos-1)).before(i.depth);if(void 0===a)return!0;const c=r.doc.nodeAt(a);return i.node.type!==(null==c?void 0:c.type)||!(0,ye.canJoin)(r.doc,i.pos)||(r.join(i.pos),!0)},joinListForwards=(r,o)=>{const i=findParentNode(r=>r.type===o)(r.selection);if(!i)return!0;const a=r.doc.resolve(i.start).after(i.depth);if(void 0===a)return!0;const c=r.doc.nodeAt(a);return i.node.type!==(null==c?void 0:c.type)||!(0,ye.canJoin)(r.doc,a)||(r.join(a),!0)},toggleList=(r,o,i,a={})=>({editor:c,tr:u,state:p,dispatch:g,chain:v,commands:b,can:k})=>{const{extensions:E,splittableMarks:w}=c.extensionManager,x=getNodeType(r,p.schema),C=getNodeType(o,p.schema),{selection:_,storedMarks:T}=p,{$from:P,$to:A}=_,N=P.blockRange(A),R=T||_.$to.parentOffset&&_.$from.marks();if(!N)return!1;const I=findParentNode(r=>isList(r.type.name,E))(_);if(N.depth>=1&&I&&N.depth-I.depth<=1){if(I.node.type===x)return b.liftListItem(C);if(isList(I.node.type.name,E)&&x.validContent(I.node.content)&&g)return v().command(()=>(u.setNodeMarkup(I.pos,x),!0)).command(()=>joinListBackwards(u,x)).command(()=>joinListForwards(u,x)).run()}return i&&R&&g?v().command(()=>{const r=k().wrapInList(x,a),o=R.filter(r=>w.includes(r.type.name));return u.ensureMarks(o),!!r||b.clearNodes()}).wrapInList(x,a).command(()=>joinListBackwards(u,x)).command(()=>joinListForwards(u,x)).run():v().command(()=>!!k().wrapInList(x,a)||b.clearNodes()).wrapInList(x,a).command(()=>joinListBackwards(u,x)).command(()=>joinListForwards(u,x)).run()},toggleMark=(r,o={},i={})=>({state:a,commands:c})=>{const{extendEmptyMarkRange:u=!1}=i,p=getMarkType(r,a.schema);return isMarkActive(a,p,o)?c.unsetMark(p,{extendEmptyMarkRange:u}):c.setMark(p,o)},toggleNode=(r,o,i={})=>({state:a,commands:c})=>{const u=getNodeType(r,a.schema),p=getNodeType(o,a.schema),g=isNodeActive(a,u,i);let v;return a.selection.$anchor.sameParent(a.selection.$head)&&(v=a.selection.$anchor.parent.attrs),g?c.setNode(p,v):c.setNode(u,{...v,...i})},toggleWrap=(r,o={})=>({state:i,commands:a})=>{const c=getNodeType(r,i.schema);return isNodeActive(i,c,o)?a.lift(c):a.wrapIn(c,o)},undoInputRule=()=>({state:r,dispatch:o})=>{const i=r.plugins;for(let a=0;a<i.length;a+=1){const c=i[a];let u;if(c.spec.isInputRules&&(u=c.getState(r))){if(o){const o=r.tr,i=u.transform;for(let r=i.steps.length-1;r>=0;r-=1)o.step(i.steps[r].invert(i.docs[r]));if(u.text){const i=o.doc.resolve(u.from).marks();o.replaceWith(u.from,u.to,r.schema.text(u.text,i))}else o.delete(u.from,u.to)}return!0}}return!1},unsetAllMarks=()=>({tr:r,dispatch:o})=>{const{selection:i}=r,{empty:a,ranges:c}=i;return a||o&&c.forEach(o=>{r.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark=(r,o={})=>({tr:i,state:a,dispatch:c})=>{var u;const{extendEmptyMarkRange:p=!1}=o,{selection:g}=i,v=getMarkType(r,a.schema),{$from:b,empty:k,ranges:E}=g;if(!c)return!0;if(k&&p){let{from:r,to:o}=g;const a=null==(u=b.marks().find(r=>r.type===v))?void 0:u.attrs,c=getMarkRange(b,v,a);c&&(r=c.from,o=c.to),i.removeMark(r,o,v)}else E.forEach(r=>{i.removeMark(r.$from.pos,r.$to.pos,v)});return i.removeStoredMark(v),!0},unsetTextDirection=r=>({tr:o,state:i,dispatch:a})=>{const{selection:c}=i;let u,p;return"number"==typeof r?(u=r,p=r):r&&"from"in r&&"to"in r?(u=r.from,p=r.to):(u=c.from,p=c.to),a&&o.doc.nodesBetween(u,p,(r,i)=>{if(r.isText)return;const a={...r.attrs};delete a.dir,o.setNodeMarkup(i,void 0,a)}),!0},updateAttributes=(r,o={})=>({tr:i,state:a,dispatch:c})=>{let u=null,p=null;const g=getSchemaTypeNameByName("string"==typeof r?r:r.name,a.schema);if(!g)return!1;"node"===g&&(u=getNodeType(r,a.schema)),"mark"===g&&(p=getMarkType(r,a.schema));let v=!1;return i.selection.ranges.forEach(r=>{const g=r.$from.pos,b=r.$to.pos;let k,E,w,x;i.selection.empty?a.doc.nodesBetween(g,b,(r,o)=>{u&&u===r.type&&(v=!0,w=Math.max(o,g),x=Math.min(o+r.nodeSize,b),k=o,E=r)}):a.doc.nodesBetween(g,b,(r,a)=>{a<g&&u&&u===r.type&&(v=!0,w=Math.max(a,g),x=Math.min(a+r.nodeSize,b),k=a,E=r),a>=g&&a<=b&&(u&&u===r.type&&(v=!0,c&&i.setNodeMarkup(a,void 0,{...r.attrs,...o})),p&&r.marks.length&&r.marks.forEach(u=>{if(p===u.type&&(v=!0,c)){const c=Math.max(a,g),v=Math.min(a+r.nodeSize,b);i.addMark(c,v,p.create({...u.attrs,...o}))}}))}),E&&(void 0!==k&&c&&i.setNodeMarkup(k,void 0,{...E.attrs,...o}),p&&E.marks.length&&E.marks.forEach(r=>{p===r.type&&c&&i.addMark(w,x,p.create({...r.attrs,...o}))}))}),v},be=i(24007),wrapIn=(r,o={})=>({state:i,dispatch:a})=>{const c=getNodeType(r,i.schema);return(0,be.wrapIn)(c,o)(i,a)},ke=i(35423),wrapInList=(r,o={})=>({state:i,dispatch:a})=>{const c=getNodeType(r,i.schema);return(0,ke.wrapInList)(c,o)(i,a)},Ee=i(49162),Se=i(90990),we=class{constructor(){this.callbacks={}}on(r,o){return this.callbacks[r]||(this.callbacks[r]=[]),this.callbacks[r].push(o),this}emit(r,...o){const i=this.callbacks[r];return i&&i.forEach(r=>r.apply(this,o)),this}off(r,o){const i=this.callbacks[r];return i&&(o?this.callbacks[r]=i.filter(r=>r!==o):delete this.callbacks[r]),this}once(r,o){const onceFn=(...i)=>{this.off(r,onceFn),o.apply(this,i)};return this.on(r,onceFn)}removeAllListeners(){this.callbacks={}}},xe=i(77048),Ce=i(32386),_e=i(49162),Te=class{constructor(r){var o;this.find=r.find,this.handler=r.handler,this.undoable=null==(o=r.undoable)||o}},inputRuleMatcherHandler=(r,o)=>{if(isRegExp(o))return o.exec(r);const i=o(r);if(!i)return null;const a=[i.text];return a.index=i.index,a.input=r,a.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),a.push(i.replaceWith)),a};function run(r){var o;const{editor:i,from:a,to:c,text:u,rules:p,plugin:g}=r,{view:v}=i;if(v.composing)return!1;const k=v.state.doc.resolve(a);if(k.parent.type.spec.code||(null==(o=k.nodeBefore||k.nodeAfter)?void 0:o.marks.find(r=>r.type.spec.code)))return!1;let E=!1;const w=getTextContentFromNodes(k)+u;return p.forEach(r=>{if(E)return;const o=inputRuleMatcherHandler(w,r.find);if(!o)return;const p=v.state.tr,k=createChainableState({state:v.state,transaction:p}),x={from:a-(o[0].length-u.length),to:c},{commands:C,chain:_,can:T}=new b({editor:i,state:k});null!==r.handler({state:k,range:x,match:o,commands:C,chain:_,can:T})&&p.steps.length&&(r.undoable&&p.setMeta(g,{transform:p,from:a,to:c,text:u}),v.dispatch(p),E=!0)}),E}function inputRulesPlugin(r){const{editor:o,rules:i}=r,a=new _e.Plugin({state:{init(){return null},apply(r,c,u){const p=r.getMeta(a);if(p)return p;const g=r.getMeta("applyInputRules");return!!g&&setTimeout(()=>{let{text:r}=g;"string"==typeof r||(r=getHTMLFromFragment(Ce.Fragment.from(r),u.schema));const{from:c}=g,p=c+r.length;run({editor:o,from:c,to:p,text:r,rules:i,plugin:a})}),r.selectionSet||r.docChanged?null:c}},props:{handleTextInput(r,c,u,p){return run({editor:o,from:c,to:u,text:p,rules:i,plugin:a})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:c}=r.state.selection;c&&run({editor:o,from:c.pos,to:c.pos,text:"",rules:i,plugin:a})}),!1)},handleKeyDown(r,c){if("Enter"!==c.key)return!1;const{$cursor:u}=r.state.selection;return!!u&&run({editor:o,from:u.pos,to:u.pos,text:"\n",rules:i,plugin:a})}},isInputRules:!0});return a}function isPlainObject(r){return"Object"===function getType(r){return Object.prototype.toString.call(r).slice(8,-1)}(r)&&(r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype)}function mergeDeep(r,o){const i={...r};return isPlainObject(r)&&isPlainObject(o)&&Object.keys(o).forEach(a=>{isPlainObject(o[a])&&isPlainObject(r[a])?i[a]=mergeDeep(r[a],o[a]):i[a]=o[a]}),i}var Oe=class{constructor(r={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...r},this.name=this.config.name}get options(){return{...callOrReturn(getExtensionField(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...callOrReturn(getExtensionField(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(r={}){const o=this.extend({...this.config,addOptions:()=>mergeDeep(this.options,r)});return o.name=this.name,o.parent=this.parent,o}extend(r={}){const o=new this.constructor({...this.config,...r});return o.parent=this,this.child=o,o.name="name"in r?r.name:o.parent.name,o}},Pe=class _Mark extends Oe{constructor(){super(...arguments),this.type="mark"}static create(r={}){const o="function"==typeof r?r():r;return new _Mark(o)}static handleExit({editor:r,mark:o}){const{tr:i}=r.state,a=r.state.selection.$from;if(a.pos===a.end()){const c=a.marks();if(!!!c.find(r=>(null==r?void 0:r.type.name)===o.name))return!1;const u=c.find(r=>(null==r?void 0:r.type.name)===o.name);return u&&i.removeStoredMark(u),i.insertText(" ",a.pos),r.view.dispatch(i),!0}return!1}configure(r){return super.configure(r)}extend(r){const o="function"==typeof r?r():r;return super.extend(o)}},Ae=i(32386),Me=i(49162);function isNumber(r){return"number"==typeof r}var Ne=class{constructor(r){this.find=r.find,this.handler=r.handler}},pasteRuleMatcherHandler=(r,o,i)=>{if(isRegExp(o))return[...r.matchAll(o)];const a=o(r,i);return a?a.map(o=>{const i=[o.text];return i.index=o.index,i.input=r,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};var Re=null,createClipboardPasteEvent=r=>{var o;const i=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(o=i.clipboardData)||o.setData("text/html",r),i};function pasteRulesPlugin(r){const{editor:o,rules:i}=r;let a,c=null,u=!1,p=!1,g="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{a="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{a=null}const processEvent=({state:r,from:i,to:c,rule:u,pasteEvt:p})=>{const v=r.tr,k=createChainableState({state:r,transaction:v}),E=function run2(r){const{editor:o,state:i,from:a,to:c,rule:u,pasteEvent:p,dropEvent:g}=r,{commands:v,chain:k,can:E}=new b({editor:o,state:i}),w=[];return i.doc.nodesBetween(a,c,(r,o)=>{var b,x,C,_,T;if((null==(x=null==(b=r.type)?void 0:b.spec)?void 0:x.code)||!(r.isText||r.isTextblock||r.isInline))return;const P=null!=(T=null!=(_=null==(C=r.content)?void 0:C.size)?_:r.nodeSize)?T:0,A=Math.max(a,o),N=Math.min(c,o+P);if(A>=N)return;const R=r.isText?r.text||"":r.textBetween(A-o,N-o,void 0,"");pasteRuleMatcherHandler(R,u.find,p).forEach(r=>{if(void 0===r.index)return;const o=A+r.index+1,a=o+r[0].length,c={from:i.tr.mapping.map(o),to:i.tr.mapping.map(a)},b=u.handler({state:i,range:c,match:r,commands:v,chain:k,can:E,pasteEvent:p,dropEvent:g});w.push(b)})}),w.every(r=>null!==r)}({editor:o,state:k,from:Math.max(i-1,0),to:c.b-1,rule:u,pasteEvent:p,dropEvent:a});if(E&&v.steps.length){try{a="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{a=null}return g="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,v}};return i.map(r=>new Me.Plugin({view(r){const handleDragstart=i=>{var a;c=(null==(a=r.dom.parentElement)?void 0:a.contains(i.target))?r.dom.parentElement:null,c&&(Re=o)},handleDragend=()=>{Re&&(Re=null)};return window.addEventListener("dragstart",handleDragstart),window.addEventListener("dragend",handleDragend),{destroy(){window.removeEventListener("dragstart",handleDragstart),window.removeEventListener("dragend",handleDragend)}}},props:{handleDOMEvents:{drop:(r,o)=>{if(p=c===r.dom.parentElement,a=o,!p){const r=Re;(null==r?void 0:r.isEditable)&&setTimeout(()=>{const o=r.state.selection;o&&r.commands.deleteRange({from:o.from,to:o.to})},10)}return!1},paste:(r,o)=>{var i;const a=null==(i=o.clipboardData)?void 0:i.getData("text/html");return g=o,u=!!(null==a?void 0:a.includes("data-pm-slice")),!1}}},appendTransaction:(o,i,a)=>{const c=o[0],v="paste"===c.getMeta("uiEvent")&&!u,b="drop"===c.getMeta("uiEvent")&&!p,k=c.getMeta("applyPasteRules"),E=!!k;if(!v&&!b&&!E)return;if(E){let{text:o}=k;"string"==typeof o||(o=getHTMLFromFragment(Ae.Fragment.from(o),a.schema));const{from:i}=k,c=i+o.length,u=createClipboardPasteEvent(o);return processEvent({rule:r,state:a,from:i,to:{b:c},pasteEvt:u})}const w=i.doc.content.findDiffStart(a.doc.content),x=i.doc.content.findDiffEnd(a.doc.content);return isNumber(w)&&x&&w!==x.b?processEvent({rule:r,state:a,from:w,to:x,pasteEvt:g}):void 0}}))}var Ie=class{constructor(r,o){this.splittableMarks=[],this.editor=o,this.baseExtensions=r,this.extensions=resolveExtensions(r),this.schema=getSchemaByResolvedExtensions(this.extensions,o),this.setupExtensions()}get commands(){return this.extensions.reduce((r,o)=>{const i=getExtensionField(o,"addCommands",{name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:this.editor,type:getSchemaTypeByName(o.name,this.schema)});return i?{...r,...i()}:r},{})}get plugins(){const{editor:r}=this;return sortExtensions([...this.extensions].reverse()).flatMap(o=>{const i={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:r,type:getSchemaTypeByName(o.name,this.schema)},a=[],c=getExtensionField(o,"addKeyboardShortcuts",i);let u={};if("mark"===o.type&&getExtensionField(o,"exitable",i)&&(u.ArrowRight=()=>Pe.handleExit({editor:r,mark:o})),c){const o=Object.fromEntries(Object.entries(c()).map(([o,i])=>[o,()=>i({editor:r})]));u={...u,...o}}const p=(0,xe.keymap)(u);a.push(p);const g=getExtensionField(o,"addInputRules",i);if(isExtensionRulesEnabled(o,r.options.enableInputRules)&&g){const o=g();if(o&&o.length){const i=inputRulesPlugin({editor:r,rules:o}),c=Array.isArray(i)?i:[i];a.push(...c)}}const v=getExtensionField(o,"addPasteRules",i);if(isExtensionRulesEnabled(o,r.options.enablePasteRules)&&v){const o=v();if(o&&o.length){const i=pasteRulesPlugin({editor:r,rules:o});a.push(...i)}}const b=getExtensionField(o,"addProseMirrorPlugins",i);if(b){const r=b();a.push(...r)}return a})}get attributes(){return getAttributesFromExtensions(this.extensions)}get nodeViews(){const{editor:r}=this,{nodeExtensions:o}=splitExtensions(this.extensions);return Object.fromEntries(o.filter(r=>!!getExtensionField(r,"addNodeView")).map(o=>{const i=this.attributes.filter(r=>r.type===o.name),a={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:r,type:getNodeType(o.name,this.schema)},c=getExtensionField(o,"addNodeView",a);if(!c)return[];const u=c();if(!u)return[];return[o.name,(a,c,p,g,v)=>{const b=getRenderedAttributes(a,i);return u({node:a,view:c,getPos:p,decorations:g,innerDecorations:v,editor:r,extension:o,HTMLAttributes:b})}]}))}dispatchTransaction(r){const{editor:o}=this;return sortExtensions([...this.extensions].reverse()).reduceRight((r,i)=>{const a={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:o,type:getSchemaTypeByName(i.name,this.schema)},c=getExtensionField(i,"dispatchTransaction",a);return c?o=>{c.call(a,{transaction:o,next:r})}:r},r)}transformPastedHTML(r){const{editor:o}=this;return sortExtensions([...this.extensions]).reduce((r,i)=>{const a={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:o,type:getSchemaTypeByName(i.name,this.schema)},c=getExtensionField(i,"transformPastedHTML",a);return c?(o,i)=>{const u=r(o,i);return c.call(a,u)}:r},r||(r=>r))}get markViews(){const{editor:r}=this,{markExtensions:o}=splitExtensions(this.extensions);return Object.fromEntries(o.filter(r=>!!getExtensionField(r,"addMarkView")).map(o=>{const i=this.attributes.filter(r=>r.type===o.name),a={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:r,type:getMarkType(o.name,this.schema)},c=getExtensionField(o,"addMarkView",a);if(!c)return[];return[o.name,(a,u,p)=>{const g=getRenderedAttributes(a,i);return c()({mark:a,view:u,inline:p,editor:r,extension:o,HTMLAttributes:g,updateAttributes:o=>{updateMarkViewAttributes(a,r,o)}})}]}))}setupExtensions(){const r=this.extensions;this.editor.extensionStorage=Object.fromEntries(r.map(r=>[r.name,r.storage])),r.forEach(r=>{var o;const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:this.editor,type:getSchemaTypeByName(r.name,this.schema)};if("mark"===r.type){(null==(o=callOrReturn(getExtensionField(r,"keepOnSplit",i)))||o)&&this.splittableMarks.push(r.name)}const a=getExtensionField(r,"onBeforeCreate",i),c=getExtensionField(r,"onCreate",i),u=getExtensionField(r,"onUpdate",i),p=getExtensionField(r,"onSelectionUpdate",i),g=getExtensionField(r,"onTransaction",i),v=getExtensionField(r,"onFocus",i),b=getExtensionField(r,"onBlur",i),k=getExtensionField(r,"onDestroy",i);a&&this.editor.on("beforeCreate",a),c&&this.editor.on("create",c),u&&this.editor.on("update",u),p&&this.editor.on("selectionUpdate",p),g&&this.editor.on("transaction",g),v&&this.editor.on("focus",v),b&&this.editor.on("blur",b),k&&this.editor.on("destroy",k)})}};Ie.resolve=resolveExtensions,Ie.sort=sortExtensions,Ie.flatten=flattenExtensions;var De={};__export(De,{ClipboardTextSerializer:()=>ze,Commands:()=>je,Delete:()=>Ve,Drop:()=>Ue,Editable:()=>We,FocusEvents:()=>Ge,Keymap:()=>Ye,Paste:()=>Qe,Tabindex:()=>et,TextDirection:()=>rt,focusEventsPluginKey:()=>Ke});var Le=i(49162),Fe=class _Extension extends Oe{constructor(){super(...arguments),this.type="extension"}static create(r={}){const o="function"==typeof r?r():r;return new _Extension(o)}configure(r){return super.configure(r)}extend(r){const o="function"==typeof r?r():r;return super.extend(o)}},ze=Fe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Le.Plugin({key:new Le.PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:o,schema:i}=r,{doc:a,selection:c}=o,{ranges:u}=c,p=Math.min(...u.map(r=>r.$from.pos)),g=Math.max(...u.map(r=>r.$to.pos)),v=getTextSerializersFromSchema(i);return getTextBetween(a,{from:p,to:g},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:v})}}})]}}),je=Fe.create({name:"commands",addCommands(){return{...k}}}),Be=i(26401),Ve=Fe.create({name:"delete",onUpdate({transaction:r,appendedTransactions:o}){var i,a,c;const callback=()=>{var i,a,c,u;if(null!=(u=null==(c=null==(a=null==(i=this.editor.options.coreExtensionOptions)?void 0:i.delete)?void 0:a.filterTransaction)?void 0:c.call(a,r))?u:r.getMeta("y-sync$"))return;const p=combineTransactionSteps(r.before,[r,...o]);getChangedRanges(p).forEach(o=>{p.mapping.mapResult(o.oldRange.from).deletedAfter&&p.mapping.mapResult(o.oldRange.to).deletedBefore&&p.before.nodesBetween(o.oldRange.from,o.oldRange.to,(i,a)=>{const c=a+i.nodeSize-2,u=o.oldRange.from<=a&&c<=o.oldRange.to;this.editor.emit("delete",{type:"node",node:i,from:a,to:c,newFrom:p.mapping.map(a),newTo:p.mapping.map(c),deletedRange:o.oldRange,newRange:o.newRange,partial:!u,editor:this.editor,transaction:r,combinedTransform:p})})});const g=p.mapping;p.steps.forEach((o,i)=>{var a,c;if(o instanceof Be.RemoveMarkStep){const u=g.slice(i).map(o.from,-1),v=g.slice(i).map(o.to),b=g.invert().map(u,-1),k=g.invert().map(v),E=null==(a=p.doc.nodeAt(u-1))?void 0:a.marks.some(r=>r.eq(o.mark)),w=null==(c=p.doc.nodeAt(v))?void 0:c.marks.some(r=>r.eq(o.mark));this.editor.emit("delete",{type:"mark",mark:o.mark,from:o.from,to:o.to,deletedRange:{from:b,to:k},newRange:{from:u,to:v},partial:Boolean(w||E),editor:this.editor,transaction:r,combinedTransform:p})}})};null==(c=null==(a=null==(i=this.editor.options.coreExtensionOptions)?void 0:i.delete)?void 0:a.async)||c?setTimeout(callback,0):callback()}}),$e=i(49162),Ue=Fe.create({name:"drop",addProseMirrorPlugins(){return[new $e.Plugin({key:new $e.PluginKey("tiptapDrop"),props:{handleDrop:(r,o,i,a)=>{this.editor.emit("drop",{editor:this.editor,event:o,slice:i,moved:a})}}})]}}),He=i(49162),We=Fe.create({name:"editable",addProseMirrorPlugins(){return[new He.Plugin({key:new He.PluginKey("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qe=i(49162),Ke=new qe.PluginKey("focusEvents"),Ge=Fe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new qe.Plugin({key:Ke,props:{handleDOMEvents:{focus:(o,i)=>{r.isFocused=!0;const a=r.state.tr.setMeta("focus",{event:i}).setMeta("addToHistory",!1);return o.dispatch(a),!1},blur:(o,i)=>{r.isFocused=!1;const a=r.state.tr.setMeta("blur",{event:i}).setMeta("addToHistory",!1);return o.dispatch(a),!1}}}})]}}),Je=i(49162),Ye=Fe.create({name:"keymap",addKeyboardShortcuts(){const handleBackspace=()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:o})=>{const{selection:i,doc:a}=o,{empty:c,$anchor:u}=i,{pos:p,parent:g}=u,v=u.parent.isTextblock&&p>0?o.doc.resolve(p-1):u,b=v.parent.type.spec.isolating,k=u.pos-u.parentOffset,E=b&&1===v.parent.childCount?k===u.pos:Je.Selection.atStart(a).from===p;return!(!c||!g.type.isTextblock||g.textContent.length||!E||E&&"paragraph"===u.parent.type.name)&&r.clearNodes()}),()=>r.deleteSelection(),()=>r.joinBackward(),()=>r.selectNodeBackward()]),handleDelete=()=>this.editor.commands.first(({commands:r})=>[()=>r.deleteSelection(),()=>r.deleteCurrentNode(),()=>r.joinForward(),()=>r.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:r})=>[()=>r.newlineInCode(),()=>r.createParagraphNear(),()=>r.liftEmptyBlock(),()=>r.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:handleBackspace,"Mod-Backspace":handleBackspace,"Shift-Backspace":handleBackspace,Delete:handleDelete,"Mod-Delete":handleDelete,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":handleBackspace,"Alt-Backspace":handleBackspace,"Ctrl-d":handleDelete,"Ctrl-Alt-Backspace":handleDelete,"Alt-Delete":handleDelete,"Alt-d":handleDelete,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return isiOS()||isMacOS()?i:o},addProseMirrorPlugins(){return[new Je.Plugin({key:new Je.PluginKey("clearDocument"),appendTransaction:(r,o,i)=>{if(r.some(r=>r.getMeta("composition")))return;const a=r.some(r=>r.docChanged)&&!o.doc.eq(i.doc),c=r.some(r=>r.getMeta("preventClearDocument"));if(!a||c)return;const{empty:u,from:p,to:g}=o.selection,v=Je.Selection.atStart(o.doc).from,k=Je.Selection.atEnd(o.doc).to;if(u||!(p===v&&g===k))return;if(!isNodeEmpty(i.doc))return;const E=i.tr,w=createChainableState({state:i,transaction:E}),{commands:x}=new b({editor:this.editor,state:w});return x.clearNodes(),E.steps.length?E:void 0}})]}}),Xe=i(49162),Qe=Fe.create({name:"paste",addProseMirrorPlugins(){return[new Xe.Plugin({key:new Xe.PluginKey("tiptapPaste"),props:{handlePaste:(r,o,i)=>{this.editor.emit("paste",{editor:this.editor,event:o,slice:i})}}})]}}),Ze=i(49162),et=Fe.create({name:"tabindex",addProseMirrorPlugins(){return[new Ze.Plugin({key:new Ze.PluginKey("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),nt=i(49162),rt=Fe.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:r}=splitExtensions(this.extensions);return[{types:r.filter(r=>"text"!==r.name).map(r=>r.name),attributes:{dir:{default:this.options.direction,parseHTML:r=>{const o=r.getAttribute("dir");return!o||"ltr"!==o&&"rtl"!==o&&"auto"!==o?this.options.direction:o},renderHTML:r=>r.dir?{dir:r.dir}:{}}}}]},addProseMirrorPlugins(){return[new nt.Plugin({key:new nt.PluginKey("textDirection"),props:{attributes:()=>{const r=this.options.direction;return r?{dir:r}:{}}}})]}}),ot=class _NodePos{constructor(r,o,i=!1,a=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=r,this.editor=o,this.currentNode=a}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var r;return null!=(r=this.actualDepth)?r:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(r){let o=this.from,i=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);o=this.from+1,i=this.to-1}this.editor.commands.insertContentAt({from:o,to:i},r)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const r=this.resolvedPos.start(this.resolvedPos.depth-1),o=this.resolvedPos.doc.resolve(r);return new _NodePos(o,this.editor)}get before(){let r=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return r.depth!==this.depth&&(r=this.resolvedPos.doc.resolve(this.from-3)),new _NodePos(r,this.editor)}get after(){let r=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return r.depth!==this.depth&&(r=this.resolvedPos.doc.resolve(this.to+3)),new _NodePos(r,this.editor)}get children(){const r=[];return this.node.content.forEach((o,i)=>{const a=o.isBlock&&!o.isTextblock,c=o.isAtom&&!o.isText,u=o.isInline,p=this.pos+i+(c?0:1);if(p<0||p>this.resolvedPos.doc.nodeSize-2)return;const g=this.resolvedPos.doc.resolve(p);if(!a&&!u&&g.depth<=this.depth)return;const v=new _NodePos(g,this.editor,a,a||u?o:null);a&&(v.actualDepth=this.depth+1),r.push(v)}),r}get firstChild(){return this.children[0]||null}get lastChild(){const r=this.children;return r[r.length-1]||null}closest(r,o={}){let i=null,a=this.parent;for(;a&&!i;){if(a.node.type.name===r)if(Object.keys(o).length>0){const r=a.node.attrs,i=Object.keys(o);for(let a=0;a<i.length;a+=1){const c=i[a];if(r[c]!==o[c])break}}else i=a;a=a.parent}return i}querySelector(r,o={}){return this.querySelectorAll(r,o,!0)[0]||null}querySelectorAll(r,o={},i=!1){let a=[];if(!this.children||0===this.children.length)return a;const c=Object.keys(o);return this.children.forEach(u=>{if(!(i&&a.length>0)){if(u.node.type.name===r){c.every(r=>o[r]===u.node.attrs[r])&&a.push(u)}i&&a.length>0||(a=a.concat(u.querySelectorAll(r,o,i)))}}),a}setAttribute(r){const{tr:o}=this.editor.state;o.setNodeMarkup(this.from,void 0,{...this.node.attrs,...r}),this.editor.view.dispatch(o)}};function createStyleTag(r,o,i){const a=document.querySelector(`style[data-tiptap-style${i?`-${i}`:""}]`);if(null!==a)return a;const c=document.createElement("style");return o&&c.setAttribute("nonce",o),c.setAttribute("data-tiptap-style"+(i?`-${i}`:""),""),c.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(c),c}var it=class extends we{constructor(r={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:getUpdatedPosition,createMappablePosition:createMappablePosition},this.setOptions(r),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:o,moved:i})=>this.options.onDrop(r,o,i)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const o=this.createDoc(),i=resolveFocusPosition(o,this.options.autofocus);this.editorState=Ee.EditorState.create({doc:o,schema:this.schema,selection:i||void 0}),this.options.element&&this.mount(this.options.element)}mount(r){if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(r),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const r=this.editorView.dom;(null==r?void 0:r.editor)&&delete r.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(r){console.warn("Failed to remove CSS element:",r)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=createStyleTag('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',this.options.injectNonce))}setOptions(r={}){this.options={...this.options,...r},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(r,o=!0){this.setOptions({editable:r}),o&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:r=>{this.editorState=r},dispatch:r=>{this.dispatchTransaction(r)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(r,o)=>{if(this.editorView)return this.editorView[o];if("state"===o)return this.editorState;if(o in r)return Reflect.get(r,o);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${o}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(r,o){const i=isFunction(o)?o(r,[...this.state.plugins]):[...this.state.plugins,r],a=this.state.reconfigure({plugins:i});return this.view.updateState(a),a}unregisterPlugin(r){if(this.isDestroyed)return;const o=this.state.plugins;let i=o;if([].concat(r).forEach(r=>{const o="string"==typeof r?`${r}$`:r.key;i=i.filter(r=>!r.key.startsWith(o))}),o.length===i.length)return;const a=this.state.reconfigure({plugins:i});return this.view.updateState(a),a}createExtensionManager(){var r,o;const i=[...this.options.enableCoreExtensions?[We,ze.configure({blockSeparator:null==(o=null==(r=this.options.coreExtensionOptions)?void 0:r.clipboardTextSerializer)?void 0:o.blockSeparator}),je,Ge,Ye,et,Ue,Qe,Ve,rt.configure({direction:this.options.textDirection})].filter(r=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[r.name]):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(null==r?void 0:r.type));this.extensionManager=new Ie(i,this)}createCommandManager(){this.commandManager=new b({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let r;try{r=createDocument(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message)))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>"collaboration"!==r.name),this.createExtensionManager()}}),r=createDocument(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return r}createView(r){const{editorProps:o,enableExtensionDispatchTransaction:i}=this.options,a=o.dispatchTransaction||this.dispatchTransaction.bind(this),c=i?this.extensionManager.dispatchTransaction(a):a,u=o.transformPastedHTML,p=this.extensionManager.transformPastedHTML(u);this.editorView=new Se.EditorView(r,{...o,attributes:{role:"textbox",...null==o?void 0:o.attributes},dispatchTransaction:c,transformPastedHTML:p,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const g=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(g),this.prependClass(),this.injectCSS();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(r){this.isCapturingTransaction=!0,r(),this.isCapturingTransaction=!1;const o=this.capturedTransaction;return this.capturedTransaction=null,o}dispatchTransaction(r){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void r.steps.forEach(r=>{var o;return null==(o=this.capturedTransaction)?void 0:o.step(r)}):void(this.capturedTransaction=r);const{state:o,transactions:i}=this.state.applyTransaction(r),a=!this.state.selection.eq(o.selection),c=i.includes(r),u=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:r,nextState:o}),!c)return;this.view.updateState(o),this.emit("transaction",{editor:this,transaction:r,appendedTransactions:i.slice(1)}),a&&this.emit("selectionUpdate",{editor:this,transaction:r});const p=i.findLast(r=>r.getMeta("focus")||r.getMeta("blur")),g=null==p?void 0:p.getMeta("focus"),v=null==p?void 0:p.getMeta("blur");g&&this.emit("focus",{editor:this,event:g.event,transaction:p}),v&&this.emit("blur",{editor:this,event:v.event,transaction:p}),r.getMeta("preventUpdate")||!i.some(r=>r.docChanged)||u.doc.eq(o.doc)||this.emit("update",{editor:this,transaction:r,appendedTransactions:i.slice(1)})}getAttributes(r){return getAttributes(this.state,r)}isActive(r,o){const i="string"==typeof r?r:null,a="string"==typeof r?o:r;return isActive(this.state,i,a)}getJSON(){return this.state.doc.toJSON()}getHTML(){return getHTMLFromFragment(this.state.doc.content,this.schema)}getText(r){const{blockSeparator:o="\n\n",textSerializers:i={}}=r||{};return getText(this.state.doc,{blockSeparator:o,textSerializers:{...getTextSerializersFromSchema(this.schema),...i}})}get isEmpty(){return isNodeEmpty(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var r,o;return null==(o=null==(r=this.editorView)?void 0:r.isDestroyed)||o}$node(r,o){var i;return(null==(i=this.$doc)?void 0:i.querySelector(r,o))||null}$nodes(r,o){var i;return(null==(i=this.$doc)?void 0:i.querySelectorAll(r,o))||null}$pos(r){const o=this.state.doc.resolve(r);return new ot(o,this)}get $doc(){return this.$pos(0)}};function markInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a})=>{const c=callOrReturn(r.getAttributes,void 0,a);if(!1===c||null===c)return null;const{tr:u}=o,p=a[a.length-1],g=a[0];if(p){const a=g.search(/\S/),v=i.from+g.indexOf(p),b=v+p.length;if(getMarksBetween(i.from,i.to,o.doc).filter(o=>o.mark.type.excluded.find(i=>i===r.type&&i!==o.mark.type)).filter(r=>r.to>v).length)return null;b<i.to&&u.delete(b,i.to),v>i.from&&u.delete(i.from+a,v);const k=i.from+a+p.length;u.addMark(i.from+a,k,r.type.create(c||{})),u.removeStoredMark(r.type)}},undoable:r.undoable})}function nodeInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a})=>{const c=callOrReturn(r.getAttributes,void 0,a)||{},{tr:u}=o,p=i.from;let g=i.to;const v=r.type.create(c);if(a[1]){let r=p+a[0].lastIndexOf(a[1]);r>g?r=g:g=r+a[1].length;const o=a[0][a[0].length-1];u.insertText(o,p+a[0].length-1),u.replaceWith(r,g,v)}else if(a[0]){const o=r.type.isInline?p:p-1;u.insert(o,r.type.create(c)).delete(u.mapping.map(p),u.mapping.map(g))}u.scrollIntoView()},undoable:r.undoable})}function textblockTypeInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a})=>{const c=o.doc.resolve(i.from),u=callOrReturn(r.getAttributes,void 0,a)||{};if(!c.node(-1).canReplaceWith(c.index(-1),c.indexAfter(-1),r.type))return null;o.tr.delete(i.from,i.to).setBlockType(i.from,i.from,r.type,u)},undoable:r.undoable})}function textInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a})=>{let c=r.replace,u=i.from;const p=i.to;if(a[1]){const r=a[0].lastIndexOf(a[1]);c+=a[0].slice(r+a[1].length),u+=r;const o=u-p;o>0&&(c=a[0].slice(r-o,r)+c,u=p)}o.tr.insertText(c,u,p)},undoable:r.undoable})}var at=i(26401);function wrappingInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a,chain:c})=>{const u=callOrReturn(r.getAttributes,void 0,a)||{},p=o.tr.delete(i.from,i.to),g=p.doc.resolve(i.from).blockRange(),v=g&&(0,at.findWrapping)(g,r.type,u);if(!v)return null;if(p.wrap(g,v),r.keepMarks&&r.editor){const{selection:i,storedMarks:a}=o,{splittableMarks:c}=r.editor.extensionManager,u=a||i.$to.parentOffset&&i.$from.marks();if(u){const r=u.filter(r=>c.includes(r.type.name));p.ensureMarks(r)}}if(r.keepAttributes){const o="bulletList"===r.type.name||"orderedList"===r.type.name?"listItem":"taskList";c().updateAttributes(o,u).run()}const b=p.doc.resolve(i.from-1).nodeBefore;b&&b.type===r.type&&(0,at.canJoin)(p.doc,i.from-1)&&(!r.joinPredicate||r.joinPredicate(a,b))&&p.join(i.from-1)},undoable:r.undoable})}function Fragment6(r){return r.children}var h=(r,o)=>{if("slot"===r)return 0;if(r instanceof Function)return r(o);const{children:i,...a}=null!=o?o:{};if("svg"===r)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[r,a,i]},st=class{constructor(r){var o,i,a,c,u,p;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=r=>{if(!this.isResizing||!this.activeHandle)return;const o=r.clientX-this.startX,i=r.clientY-this.startY;this.handleResize(o,i)},this.handleTouchMove=r=>{if(!this.isResizing||!this.activeHandle)return;const o=r.touches[0];if(!o)return;const i=o.clientX-this.startX,a=o.clientY-this.startY;this.handleResize(i,a)},this.handleMouseUp=()=>{if(!this.isResizing)return;const r=this.element.offsetWidth,o=this.element.offsetHeight;this.onCommit(r,o),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=r=>{"Shift"===r.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=r=>{"Shift"===r.key&&(this.isShiftKeyPressed=!1)},this.node=r.node,this.editor=r.editor,this.element=r.element,this.contentElement=r.contentElement,this.getPos=r.getPos,this.onResize=r.onResize,this.onCommit=r.onCommit,this.onUpdate=r.onUpdate,(null==(o=r.options)?void 0:o.min)&&(this.minSize={...this.minSize,...r.options.min}),(null==(i=r.options)?void 0:i.max)&&(this.maxSize=r.options.max),(null==(a=null==r?void 0:r.options)?void 0:a.directions)&&(this.directions=r.options.directions),(null==(c=r.options)?void 0:c.preserveAspectRatio)&&(this.preserveAspectRatio=r.options.preserveAspectRatio),(null==(u=r.options)?void 0:u.className)&&(this.classNames={container:r.options.className.container||"",wrapper:r.options.className.wrapper||"",handle:r.options.className.handle||"",resizing:r.options.className.resizing||""}),(null==(p=r.options)?void 0:p.createCustomHandle)&&(this.createCustomHandle=r.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var r;return null!=(r=this.contentElement)?r:null}handleEditorUpdate(){const r=this.editor.isEditable;r!==this.lastEditableState&&(this.lastEditableState=r,r?r&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(r,o,i){return r.type===this.node.type&&(this.node=r,!this.onUpdate||this.onUpdate(r,o,i))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const r=document.createElement("div");return r.dataset.resizeContainer="",r.dataset.node=this.node.type.name,r.style.display="flex",this.classNames.container&&(r.className=this.classNames.container),r.appendChild(this.wrapper),r}createWrapper(){const r=document.createElement("div");return r.style.position="relative",r.style.display="block",r.dataset.resizeWrapper="",this.classNames.wrapper&&(r.className=this.classNames.wrapper),r.appendChild(this.element),r}createHandle(r){const o=document.createElement("div");return o.dataset.resizeHandle=r,o.style.position="absolute",this.classNames.handle&&(o.className=this.classNames.handle),o}positionHandle(r,o){const i=o.includes("top"),a=o.includes("bottom"),c=o.includes("left"),u=o.includes("right");i&&(r.style.top="0"),a&&(r.style.bottom="0"),c&&(r.style.left="0"),u&&(r.style.right="0"),"top"!==o&&"bottom"!==o||(r.style.left="0",r.style.right="0"),"left"!==o&&"right"!==o||(r.style.top="0",r.style.bottom="0")}attachHandles(){this.directions.forEach(r=>{let o;o=this.createCustomHandle?this.createCustomHandle(r):this.createHandle(r),o instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${r}") did not return an HTMLElement. Falling back to default handle.`),o=this.createHandle(r)),this.createCustomHandle||this.positionHandle(o,r),o.addEventListener("mousedown",o=>this.handleResizeStart(o,r)),o.addEventListener("touchstart",o=>this.handleResizeStart(o,r)),this.handleMap.set(r,o),this.wrapper.appendChild(o)})}removeHandles(){this.handleMap.forEach(r=>r.remove()),this.handleMap.clear()}applyInitialSize(){const r=this.node.attrs.width,o=this.node.attrs.height;r?(this.element.style.width=`${r}px`,this.initialWidth=r):this.initialWidth=this.element.offsetWidth,o?(this.element.style.height=`${o}px`,this.initialHeight=o):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(r,o){r.preventDefault(),r.stopPropagation(),this.isResizing=!0,this.activeHandle=o,"touches"in r?(this.startX=r.touches[0].clientX,this.startY=r.touches[0].clientY):(this.startX=r.clientX,this.startY=r.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight);this.getPos();this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(r,o){if(!this.activeHandle)return;const i=this.preserveAspectRatio||this.isShiftKeyPressed,{width:a,height:c}=this.calculateNewDimensions(this.activeHandle,r,o),u=this.applyConstraints(a,c,i);this.element.style.width=`${u.width}px`,this.element.style.height=`${u.height}px`,this.onResize&&this.onResize(u.width,u.height)}calculateNewDimensions(r,o,i){let a=this.startWidth,c=this.startHeight;const u=r.includes("right"),p=r.includes("left"),g=r.includes("bottom"),v=r.includes("top");u?a=this.startWidth+o:p&&(a=this.startWidth-o),g?c=this.startHeight+i:v&&(c=this.startHeight-i),"right"!==r&&"left"!==r||(a=this.startWidth+(u?o:-o)),"top"!==r&&"bottom"!==r||(c=this.startHeight+(g?i:-i));return this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(a,c,r):{width:a,height:c}}applyConstraints(r,o,i){var a,c,u,p;if(!i){let i=Math.max(this.minSize.width,r),u=Math.max(this.minSize.height,o);return(null==(a=this.maxSize)?void 0:a.width)&&(i=Math.min(this.maxSize.width,i)),(null==(c=this.maxSize)?void 0:c.height)&&(u=Math.min(this.maxSize.height,u)),{width:i,height:u}}let g=r,v=o;return g<this.minSize.width&&(g=this.minSize.width,v=g/this.aspectRatio),v<this.minSize.height&&(v=this.minSize.height,g=v*this.aspectRatio),(null==(u=this.maxSize)?void 0:u.width)&&g>this.maxSize.width&&(g=this.maxSize.width,v=g/this.aspectRatio),(null==(p=this.maxSize)?void 0:p.height)&&v>this.maxSize.height&&(v=this.maxSize.height,g=v*this.aspectRatio),{width:g,height:v}}applyAspectRatio(r,o,i){const a="top"===i||"bottom"===i;return"left"===i||"right"===i?{width:r,height:r/this.aspectRatio}:a?{width:o*this.aspectRatio,height:o}:{width:r,height:r/this.aspectRatio}}},lt=st,ct=i(49162);function canInsertNode(r,o){const{selection:i}=r,{$from:a}=i;if(i instanceof ct.NodeSelection){const r=a.index();return a.parent.canReplaceWith(r,r+1,o)}let c=a.depth;for(;c>=0;){const r=a.index(c);if(a.node(c).contentMatchAt(r).matchType(o))return!0;c-=1}return!1}function escapeForRegEx(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function isFirefox(){return"undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent)}function isString(r){return"string"==typeof r}var ut={};function parseAttributes(r){if(!(null==r?void 0:r.trim()))return{};const o={},i=[],a=r.replace(/["']([^"']*)["']/g,r=>(i.push(r),`__QUOTED_${i.length-1}__`)),c=a.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(c){const r=c.map(r=>r.trim().slice(1));o.class=r.join(" ")}const u=a.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);u&&(o.id=u[1]);Array.from(a.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,r,a])=>{var c;const u=parseInt((null==(c=a.match(/__QUOTED_(\d+)__/))?void 0:c[1])||"0",10),p=i[u];p&&(o[r]=p.slice(1,-1))});const p=a.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();if(p){p.split(/\s+/).filter(Boolean).forEach(r=>{r.match(/^[a-zA-Z][\w-]*$/)&&(o[r]=!0)})}return o}function serializeAttributes(r){if(!r||0===Object.keys(r).length)return"";const o=[];if(r.class){String(r.class).split(/\s+/).filter(Boolean).forEach(r=>o.push(`.${r}`))}return r.id&&o.push(`#${r.id}`),Object.entries(r).forEach(([r,i])=>{"class"!==r&&"id"!==r&&(!0===i?o.push(r):!1!==i&&null!=i&&o.push(`${r}="${String(i)}"`))}),o.join(" ")}function createAtomBlockMarkdownSpec(r){const{nodeName:o,name:i,parseAttributes:a=parseAttributes,serializeAttributes:c=serializeAttributes,defaultAttributes:u={},requiredAttributes:p=[],allowedAttributes:g}=r,v=i||o;return{parseMarkdown:(r,i)=>{const a={...u,...r.attributes};return i.createNode(o,a,[])},markdownTokenizer:{name:o,level:"block",start(r){var o;const i=new RegExp(`^:::${v}(?:\\s|$)`,"m"),a=null==(o=r.match(i))?void 0:o.index;return void 0!==a?a:-1},tokenize(r,i,c){const u=new RegExp(`^:::${v}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),g=r.match(u);if(!g)return;const b=g[1]||"",k=a(b);return p.find(r=>!(r in k))?void 0:{type:o,raw:g[0],attributes:k}}},renderMarkdown:r=>{const o=(r=>{if(!g)return r;const o={};return g.forEach(i=>{i in r&&(o[i]=r[i])}),o})(r.attrs||{}),i=c(o);return`:::${v}${i?` {${i}}`:""} :::`}}}function createBlockMarkdownSpec(r){const{nodeName:o,name:i,getContent:a,parseAttributes:c=parseAttributes,serializeAttributes:u=serializeAttributes,defaultAttributes:p={},content:g="block",allowedAttributes:v}=r,b=i||o;return{parseMarkdown:(r,i)=>{let c;if(a){const o=a(r);c="string"==typeof o?[{type:"text",text:o}]:o}else c="block"===g?i.parseChildren(r.tokens||[]):i.parseInline(r.tokens||[]);const u={...p,...r.attributes};return i.createNode(o,u,c)},markdownTokenizer:{name:o,level:"block",start(r){var o;const i=new RegExp(`^:::${b}`,"m"),a=null==(o=r.match(i))?void 0:o.index;return void 0!==a?a:-1},tokenize(r,i,a){var u;const p=new RegExp(`^:::${b}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),v=r.match(p);if(!v)return;const[k,E=""]=v,w=c(E);let x=1;const C=k.length;let _="";const T=/^:::([\w-]*)(\s.*)?/gm,P=r.slice(C);for(T.lastIndex=0;;){const i=T.exec(P);if(null===i)break;const c=i.index,p=i[1];if(!(null==(u=i[2])?void 0:u.endsWith(":::")))if(p)x+=1;else if(x-=1,0===x){const u=P.slice(0,c);_=u.trim();const p=r.slice(0,C+c+i[0].length);let v=[];if(_)if("block"===g)for(v=a.blockTokens(u),v.forEach(r=>{!r.text||r.tokens&&0!==r.tokens.length||(r.tokens=a.inlineTokens(r.text))});v.length>0;){const r=v[v.length-1];if("paragraph"!==r.type||r.text&&""!==r.text.trim())break;v.pop()}else v=a.inlineTokens(_);return{type:o,raw:p,attributes:w,content:_,tokens:v}}}}},renderMarkdown:(r,o)=>{const i=(r=>{if(!v)return r;const o={};return v.forEach(i=>{i in r&&(o[i]=r[i])}),o})(r.attrs||{}),a=u(i),c=a?` {${a}}`:"",p=o.renderChildren(r.content||[],"\n\n");return`:::${b}${c}\n\n${p}\n\n:::`}}}function parseShortcodeAttributes(r){if(!r.trim())return{};const o={},i=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let a=i.exec(r);for(;null!==a;){const[,c,u,p]=a;o[c]=u||p,a=i.exec(r)}return o}function serializeShortcodeAttributes(r){return Object.entries(r).filter(([,r])=>null!=r).map(([r,o])=>`${r}="${o}"`).join(" ")}function createInlineMarkdownSpec(r){const{nodeName:o,name:i,getContent:a,parseAttributes:c=parseShortcodeAttributes,serializeAttributes:u=serializeShortcodeAttributes,defaultAttributes:p={},selfClosing:g=!1,allowedAttributes:v}=r,b=i||o,k=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(r,i)=>{const c={...p,...r.attributes};if(g)return i.createNode(o,c);const u=a?a(r):r.content||"";return u?i.createNode(o,c,[i.createTextNode(u)]):i.createNode(o,c,[])},markdownTokenizer:{name:o,level:"inline",start(r){const o=g?new RegExp(`\\[${k}\\s*[^\\]]*\\]`):new RegExp(`\\[${k}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${k}\\]`),i=r.match(o),a=null==i?void 0:i.index;return void 0!==a?a:-1},tokenize(r,i,a){const u=g?new RegExp(`^\\[${k}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${k}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${k}\\]`),p=r.match(u);if(!p)return;let v="",b="";if(g){const[,r]=p;b=r}else{const[,r,o]=p;b=r,v=o||""}const E=c(b.trim());return{type:o,raw:p[0],content:v.trim(),attributes:E}}},renderMarkdown:r=>{let o="";a?o=a(r):r.content&&r.content.length>0&&(o=r.content.filter(r=>"text"===r.type).map(r=>r.text).join(""));const i=(r=>{if(!v)return r;const o={};return v.forEach(i=>{const a="string"==typeof i?i:i.name,c="string"==typeof i?void 0:i.skipIfDefault;if(a in r){const i=r[a];if(void 0!==c&&i===c)return;o[a]=i}}),o})(r.attrs||{}),c=u(i),p=c?` ${c}`:"";return g?`[${b}${p}]`:`[${b}${p}]${o}[/${b}]`}}}function parseIndentedBlocks(r,o,i){var a,c,u,p;const g=r.split("\n"),v=[];let b="",k=0;const E=o.baseIndentSize||2;for(;k<g.length;){const r=g[k],w=r.match(o.itemPattern);if(!w){if(v.length>0)break;if(""===r.trim()){k+=1,b=`${b}${r}\n`;continue}return}const x=o.extractItemData(w),{indentLevel:C,mainContent:_}=x;b=`${b}${r}\n`;const T=[_];for(k+=1;k<g.length;){const r=g[k];if(""===r.trim()){const o=g.slice(k+1).findIndex(r=>""!==r.trim());if(-1===o)break;if(((null==(c=null==(a=g[k+1+o].match(/^(\s*)/))?void 0:a[1])?void 0:c.length)||0)>C){T.push(r),b=`${b}${r}\n`,k+=1;continue}break}if(!(((null==(p=null==(u=r.match(/^(\s*)/))?void 0:u[1])?void 0:p.length)||0)>C))break;T.push(r),b=`${b}${r}\n`,k+=1}let P;const A=T.slice(1);if(A.length>0){const r=A.map(r=>r.slice(C+E)).join("\n");r.trim()&&(P=o.customNestedParser?o.customNestedParser(r):i.blockTokens(r))}const N=o.createToken(x,P);v.push(N)}if(0!==v.length)return{items:v,raw:b}}function renderNestedMarkdownContent(r,o,i,a){if(!r||!Array.isArray(r.content))return"";const c="function"==typeof i?i(a):i,[u,...p]=r.content,g=[`${c}${o.renderChildren([u])}`];return p&&p.length>0&&p.forEach(r=>{const i=o.renderChildren([r]);if(i){const r=i.split("\n").map(r=>r?o.indent(r):"").join("\n");g.push(r)}}),g.join("\n")}function updateMarkViewAttributes(r,o,i={}){const{state:a}=o,{doc:c,tr:u}=a,p=r;c.descendants((o,a)=>{const c=u.mapping.map(a),g=u.mapping.map(a)+o.nodeSize;let v=null;if(o.marks.forEach(r=>{if(r!==p)return!1;v=r}),!v)return;let b=!1;if(Object.keys(i).forEach(r=>{i[r]!==v.attrs[r]&&(b=!0)}),b){const o=r.type.create({...r.attrs,...i});u.removeMark(c,g,r.type),u.addMark(c,g,o)}}),u.docChanged&&o.view.dispatch(u)}__export(ut,{createAtomBlockMarkdownSpec:()=>createAtomBlockMarkdownSpec,createBlockMarkdownSpec:()=>createBlockMarkdownSpec,createInlineMarkdownSpec:()=>createInlineMarkdownSpec,parseAttributes:()=>parseAttributes,parseIndentedBlocks:()=>parseIndentedBlocks,renderNestedMarkdownContent:()=>renderNestedMarkdownContent,serializeAttributes:()=>serializeAttributes});var pt=class{constructor(r,o,i){this.component=r,this.editor=o.editor,this.options={...i},this.mark=o.mark,this.HTMLAttributes=o.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(r,o){updateMarkViewAttributes(o||this.mark,this.editor,r)}ignoreMutation(r){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:r});if("selection"===r.type)return!1;if(this.dom.contains(r.target)&&"childList"===r.type&&(isiOS()||isAndroid())&&this.editor.isFocused){if([...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(r=>r.isContentEditable))return!1}return this.contentDOM===r.target&&"attributes"===r.type||!this.contentDOM.contains(r.target)}},dt=class _Node extends Oe{constructor(){super(...arguments),this.type="node"}static create(r={}){const o="function"==typeof r?r():r;return new _Node(o)}configure(r){return super.configure(r)}extend(r){const o="function"==typeof r?r():r;return super.extend(o)}},ft=i(49162),ht=class{constructor(r,o,i){this.isDragging=!1,this.component=r,this.editor=o.editor,this.options={stopEvent:null,ignoreMutation:null,...i},this.extension=o.extension,this.node=o.node,this.decorations=o.decorations,this.innerDecorations=o.innerDecorations,this.view=o.view,this.HTMLAttributes=o.HTMLAttributes,this.getPos=o.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(r){var o,i,a,c,u,p,g;const{view:v}=this.editor,b=r.target,k=3===b.nodeType?null==(o=b.parentElement)?void 0:o.closest("[data-drag-handle]"):b.closest("[data-drag-handle]");if(!this.dom||(null==(i=this.contentDOM)?void 0:i.contains(b))||!k)return;let E=0,w=0;if(this.dom!==k){const o=this.dom.getBoundingClientRect(),i=k.getBoundingClientRect(),g=null!=(c=r.offsetX)?c:null==(a=r.nativeEvent)?void 0:a.offsetX,v=null!=(p=r.offsetY)?p:null==(u=r.nativeEvent)?void 0:u.offsetY;E=i.x-o.x+g,w=i.y-o.y+v}const x=this.dom.cloneNode(!0);try{const r=this.dom.getBoundingClientRect();x.style.width=`${Math.round(r.width)}px`,x.style.height=`${Math.round(r.height)}px`,x.style.boxSizing="border-box",x.style.pointerEvents="none"}catch{}let C=null;try{C=document.createElement("div"),C.style.position="absolute",C.style.top="-9999px",C.style.left="-9999px",C.style.pointerEvents="none",C.appendChild(x),document.body.appendChild(C),null==(g=r.dataTransfer)||g.setDragImage(x,E,w)}finally{C&&setTimeout(()=>{try{null==C||C.remove()}catch{}},0)}const _=this.getPos();if("number"!=typeof _)return;const T=ft.NodeSelection.create(v.state.doc,_),P=v.state.tr.setSelection(T);v.dispatch(P)}stopEvent(r){var o;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:r});const i=r.target;if(!(this.dom.contains(i)&&!(null==(o=this.contentDOM)?void 0:o.contains(i))))return!1;const a=r.type.startsWith("drag"),c="drop"===r.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(i.tagName)||i.isContentEditable)&&!c&&!a)return!0;const{isEditable:u}=this.editor,{isDragging:p}=this,g=!!this.node.type.spec.draggable,v=ft.NodeSelection.isSelectable(this.node),b="copy"===r.type,k="paste"===r.type,E="cut"===r.type,w="mousedown"===r.type;if(!g&&v&&a&&r.target===this.dom&&r.preventDefault(),g&&a&&!p&&r.target===this.dom)return r.preventDefault(),!1;if(g&&u&&!p&&w){const r=i.closest("[data-drag-handle]");r&&(this.dom===r||this.dom.contains(r))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(p||c||b||k||E||w&&v)}ignoreMutation(r){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:r});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===r.type)return!1;if(this.dom.contains(r.target)&&"childList"===r.type&&(isiOS()||isAndroid())&&this.editor.isFocused){if([...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(r=>r.isContentEditable))return!1}return this.contentDOM===r.target&&"attributes"===r.type||!this.contentDOM.contains(r.target)}updateAttributes(r){this.editor.commands.command(({tr:o})=>{const i=this.getPos();return"number"==typeof i&&(o.setNodeMarkup(i,void 0,{...this.node.attrs,...r}),!0)})}deleteNode(){const r=this.getPos();if("number"!=typeof r)return;const o=r+this.node.nodeSize;this.editor.commands.deleteRange({from:r,to:o})}};function markPasteRule(r){return new Ne({find:r.find,handler:({state:o,range:i,match:a,pasteEvent:c})=>{const u=callOrReturn(r.getAttributes,void 0,a,c);if(!1===u||null===u)return null;const{tr:p}=o,g=a[a.length-1],v=a[0];let b=i.to;if(g){const a=v.search(/\S/),c=i.from+v.indexOf(g),k=c+g.length;if(getMarksBetween(i.from,i.to,o.doc).filter(o=>o.mark.type.excluded.find(i=>i===r.type&&i!==o.mark.type)).filter(r=>r.to>c).length)return null;k<i.to&&p.delete(k,i.to),c>i.from&&p.delete(i.from+a,c),b=i.from+a+g.length,p.addMark(i.from+a,b,r.type.create(u||{})),p.removeStoredMark(r.type)}}})}function nodePasteRule(r){return new Ne({find:r.find,handler({match:o,chain:i,range:a,pasteEvent:c}){const u=callOrReturn(r.getAttributes,void 0,o,c),p=callOrReturn(r.getContent,void 0,u);if(!1===u||null===u)return null;const g={type:r.type.name,attrs:u};p&&(g.content=p),o.input&&i().deleteRange(a).insertContentAt(a.from,g)}})}function textPasteRule(r){return new Ne({find:r.find,handler:({state:o,range:i,match:a})=>{let c=r.replace,u=i.from;const p=i.to;if(a[1]){const r=a[0].lastIndexOf(a[1]);c+=a[0].slice(r+a[1].length),u+=r;const o=u-p;o>0&&(c=a[0].slice(r-o,r)+c,u=p)}o.tr.insertText(c,u,p)}})}var mt=class{constructor(r){this.transaction=r,this.currentStep=this.transaction.steps.length}map(r){let o=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((r,i)=>{const a=i.getMap().mapResult(r);return a.deleted&&(o=!0),a.pos},r),deleted:o}}}}},o={};function __webpack_require__(i){var a=o[i];if(void 0!==a)return a.exports;var c=o[i]={exports:{}};return r[i].call(c.exports,c,c.exports,__webpack_require__),c.exports}__webpack_require__.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return __webpack_require__.d(o,{a:o}),o},__webpack_require__.d=function(r,o){for(var i in o)__webpack_require__.o(o,i)&&!__webpack_require__.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:o[i]})},__webpack_require__.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},__webpack_require__.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var i=__webpack_require__(40002);(window.elementorV2=window.elementorV2||{}).editorControls=i}(),window.elementorV2.editorControls?.init?.();
88 +`,yr={mode:"browse"},br={mode:"upload"},vr=M(()=>{const{value:n,setValue:r}=b(t.imageSrcPropTypeUtil),{id:s,url:l}=n??{},{data:a,isFetching:c}=(0,$.useWpMediaAttachment)(s?.value||null),u=a?.url??l?.value??null,{data:d}=_(),[p,h]=(0,e.useState)(!1),{canUser:f}=(0,ir.useCurrentUserCapabilities)(),m=f("manage_options"),{open:g}=(0,$.useWpMediaFrame)({mediaTypes:["svg"],multiple:!1,selected:s?.value||null,onSelect:e=>{r({id:{$$type:"image-attachment-id",value:e.id},url:null})}}),y=e=>{d||e!==br?g(e):h(!0)},v={title:(0,i.__)("Sorry, you can't upload that file yet.","elementor"),description:e.createElement(e.Fragment,null,(0,i.__)("To upload them anyway, ask the site administrator to enable unfiltered","elementor"),e.createElement("br",null),(0,i.__)("file uploads.","elementor")),isEnabled:!m};return e.createElement(o.Stack,{gap:1},e.createElement(ur,{open:p,onClose:e=>{h(!1),e&&g(br)}}),e.createElement(G,null,e.createElement(mr,{variant:"outlined"},e.createElement(gr,null,c?e.createElement(o.CircularProgress,{role:"progressbar"}):e.createElement(o.CardMedia,{component:"img",image:u,alt:(0,i.__)("Preview SVG","elementor"),sx:{maxHeight:"140px",width:"50px"}})),e.createElement(o.CardOverlay,{sx:{"&:hover":{backgroundColor:"rgba( 0, 0, 0, 0.75 )"}}},e.createElement(o.Stack,{gap:1},e.createElement(o.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>y(yr)},(0,i.__)("Select SVG","elementor")),e.createElement(Kn,v,e.createElement("span",null,e.createElement(o.ThemeProvider,{colorScheme:m?"light":"dark"},e.createElement(o.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:e.createElement(R.UploadIcon,null),disabled:!m,onClick:()=>m&&y(br)},(0,i.__)("Upload","elementor"))))))))))});var wr=window.elementorV2.env;const{env:xr}=(0,wr.parseEnv)("@elementor/editor-controls"),Er=M(()=>{const{value:n,setValue:r}=b(t.backgroundGradientOverlayPropTypeUtil);return e.createElement(o.UnstableGradientBox,{sx:{width:"auto",padding:1.5},value:(()=>{if(!n)return;const{type:e,angle:t,stops:r,positions:o}=n;return{type:e.value,angle:t.value,stops:r.value.map(({value:{color:e,offset:t}})=>({color:e.value,offset:t.value})),positions:o?.value.split(" ")}})(),onChange:e=>{const n=(e=>({...e,type:t.stringPropTypeUtil.create(e.type),angle:t.numberPropTypeUtil.create(e.angle),stops:t.gradientColorStopPropTypeUtil.create(e.stops.map(({color:e,offset:n})=>t.colorStopPropTypeUtil.create({color:t.colorPropTypeUtil.create(e),offset:t.numberPropTypeUtil.create(n)})))}))(e);n.positions&&(n.positions=t.stringPropTypeUtil.create(e.positions.join(" "))),r(n)}})}),kr=t.backgroundGradientOverlayPropTypeUtil.create({type:t.stringPropTypeUtil.create("linear"),angle:t.numberPropTypeUtil.create(180),stops:t.gradientColorStopPropTypeUtil.create([t.colorStopPropTypeUtil.create({color:t.colorPropTypeUtil.create("rgb(0,0,0)"),offset:t.numberPropTypeUtil.create(0)}),t.colorStopPropTypeUtil.create({color:t.colorPropTypeUtil.create("rgb(255,255,255)"),offset:t.numberPropTypeUtil.create(100)})])}),Sr=[{value:"fixed",label:(0,i.__)("Fixed","elementor"),renderContent:({size:t})=>e.createElement(R.PinIcon,{fontSize:t}),showTooltip:!0},{value:"scroll",label:(0,i.__)("Scroll","elementor"),renderContent:({size:t})=>e.createElement(R.PinnedOffIcon,{fontSize:t}),showTooltip:!0}],Cr=()=>e.createElement(wt,null,e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,(0,i.__)("Attachment","elementor"))),e.createElement(o.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end",overflow:"hidden"}},e.createElement(pn,{options:Sr}))),Tr=[{label:(0,i.__)("Center center","elementor"),value:"center center"},{label:(0,i.__)("Center left","elementor"),value:"center left"},{label:(0,i.__)("Center right","elementor"),value:"center right"},{label:(0,i.__)("Top center","elementor"),value:"top center"},{label:(0,i.__)("Top left","elementor"),value:"top left"},{label:(0,i.__)("Top right","elementor"),value:"top right"},{label:(0,i.__)("Bottom center","elementor"),value:"bottom center"},{label:(0,i.__)("Bottom left","elementor"),value:"bottom left"},{label:(0,i.__)("Bottom right","elementor"),value:"bottom right"},{label:(0,i.__)("Custom","elementor"),value:"custom"}],Mr=()=>{const n=b(t.backgroundImagePositionOffsetPropTypeUtil),r=b(t.stringPropTypeUtil),s=!!n.value,l=(0,e.useRef)(null);return e.createElement(o.Grid,{container:!0,spacing:1.5},e.createElement(o.Grid,{item:!0,xs:12},e.createElement(wt,null,e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,(0,i.__)("Position","elementor"))),e.createElement(o.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end",overflow:"hidden"}},e.createElement(G,null,e.createElement(o.Select,{fullWidth:!0,size:"tiny",onChange:e=>{const t=e.target.value||null;"custom"===t?n.setValue({x:null,y:null}):r.setValue(t)},disabled:r.disabled,value:(n.value?"custom":r.value)??""},Tr.map(({label:t,value:n})=>e.createElement(q.MenuListItem,{key:n,value:n??""},t))))))),s?e.createElement(d,n,e.createElement(o.Grid,{item:!0,xs:12},e.createElement(o.Grid,{container:!0,spacing:1.5,ref:l},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"x"},e.createElement(xe,{startIcon:e.createElement(R.LetterXIcon,{fontSize:"tiny"}),anchorRef:l,min:-Number.MAX_SAFE_INTEGER}))),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"y"},e.createElement(xe,{startIcon:e.createElement(R.LetterYIcon,{fontSize:"tiny"}),anchorRef:l,min:-Number.MAX_SAFE_INTEGER})))))):null)},Or=[{value:"repeat",label:(0,i.__)("Repeat","elementor"),renderContent:({size:t})=>e.createElement(R.GridDotsIcon,{fontSize:t}),showTooltip:!0},{value:"repeat-x",label:(0,i.__)("Repeat-x","elementor"),renderContent:({size:t})=>e.createElement(R.DotsHorizontalIcon,{fontSize:t}),showTooltip:!0},{value:"repeat-y",label:(0,i.__)("Repeat-y","elementor"),renderContent:({size:t})=>e.createElement(R.DotsVerticalIcon,{fontSize:t}),showTooltip:!0},{value:"no-repeat",label:(0,i.__)("No-repeat","elementor"),renderContent:({size:t})=>e.createElement(R.XIcon,{fontSize:t}),showTooltip:!0}],Ir=()=>e.createElement(wt,null,e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,(0,i.__)("Repeat","elementor"))),e.createElement(o.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end"}},e.createElement(pn,{options:Or}))),Pr=[{value:"auto",label:(0,i.__)("Auto","elementor"),renderContent:({size:t})=>e.createElement(R.LetterAIcon,{fontSize:t}),showTooltip:!0},{value:"cover",label:(0,i.__)("Cover","elementor"),renderContent:({size:t})=>e.createElement(R.ArrowsMaximizeIcon,{fontSize:t}),showTooltip:!0},{value:"contain",label:(0,i.__)("Contain","elementor"),renderContent:({size:t})=>e.createElement(R.ArrowBarBothIcon,{fontSize:t}),showTooltip:!0},{value:"custom",label:(0,i.__)("Custom","elementor"),renderContent:({size:t})=>e.createElement(R.PencilIcon,{fontSize:t}),showTooltip:!0}],Nr=()=>{const n=b(t.backgroundImageSizeScalePropTypeUtil),r=b(t.stringPropTypeUtil),s=!!n.value,l=(0,e.useRef)(null);return e.createElement(o.Grid,{container:!0,spacing:1.5},e.createElement(o.Grid,{item:!0,xs:12},e.createElement(wt,null,e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,(0,i.__)("Size","elementor"))),e.createElement(o.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end"}},e.createElement(an,{exclusive:!0,items:Pr,onChange:e=>{"custom"===e?n.setValue({width:null,height:null}):r.setValue(e)},disabled:r.disabled,value:n.value?"custom":r.value})))),s?e.createElement(d,n,e.createElement(o.Grid,{item:!0,xs:12,ref:l},e.createElement(wt,null,e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"width"},e.createElement(xe,{startIcon:e.createElement(R.ArrowsMoveHorizontalIcon,{fontSize:"tiny"}),extendedOptions:["auto"],anchorRef:l}))),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"height"},e.createElement(xe,{startIcon:e.createElement(R.ArrowsMoveVerticalIcon,{fontSize:"tiny"}),extendedOptions:["auto"],anchorRef:l})))))):null)};function Dr(){return Dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dr.apply(null,arguments)}const Ar=t.backgroundColorOverlayPropTypeUtil.create({color:t.colorPropTypeUtil.create("#00000033")}),_r=()=>({$$type:"background-image-overlay",value:{image:{$$type:"image",value:{src:{$$type:"image-src",value:{url:{$$type:"url",value:xr.background_placeholder_image},id:null}},size:{$$type:"string",value:"large"}}}}}),zr=[{label:(0,i.__)("Thumbnail - 150 x 150","elementor"),value:"thumbnail"},{label:(0,i.__)("Medium - 300 x 300","elementor"),value:"medium"},{label:(0,i.__)("Large 1024 x 1024","elementor"),value:"large"},{label:(0,i.__)("Full","elementor"),value:"full"}],Rr=M(()=>{const{propType:n,value:r,setValue:o}=b(t.backgroundOverlayPropTypeUtil);return e.createElement(d,{propType:n,value:r,setValue:o},e.createElement(lt,{initial:_r(),propTypeUtil:t.backgroundOverlayPropTypeUtil},e.createElement(Ct,{label:(0,i.__)("Overlay","elementor")},e.createElement(Ve,{newItemIndex:0})),e.createElement(qe,null,e.createElement(st,{Icon:Br,Label:Ur,actions:e.createElement(e.Fragment,null,e.createElement(dt,null),e.createElement(ct,null),e.createElement(ht,null))})),e.createElement(yt,null,e.createElement($r,null))))}),$r=()=>{const{getTabsProps:n,getTabProps:r,getTabPanelProps:s}=(({color:n,image:r,gradient:i})=>{const{value:s,setValue:l}=b(t.backgroundImageOverlayPropTypeUtil),{value:a,setValue:c}=b(t.backgroundColorOverlayPropTypeUtil),{value:u,setValue:d}=b(t.backgroundGradientOverlayPropTypeUtil),{getTabsProps:p,getTabProps:h,getTabPanelProps:f}=(0,o.useTabs)(a?"color":u?"gradient":"image"),m=(0,e.useRef)({image:r,color:n,gradient:i}),g=(e,t)=>{t&&(m.current[e]=t)},y=(e,t)=>{switch(t){case"image":l(m.current.image),g("color",a),g("gradient",u);break;case"gradient":d(m.current.gradient),g("color",a),g("image",s);break;case"color":c(m.current.color),g("image",s),g("gradient",u)}return p().onChange(e,t)};return{getTabProps:h,getTabPanelProps:f,getTabsProps:()=>({...p(),onChange:y})}})({image:_r().value,color:Ar.value,gradient:kr.value}),{rowRef:l}=ze();return e.createElement(o.Box,{sx:{width:"100%"}},e.createElement(o.Box,{sx:{borderBottom:1,borderColor:"divider"}},e.createElement(o.Tabs,Dr({size:"small",variant:"fullWidth"},n(),{"aria-label":(0,i.__)("Background Overlay","elementor")}),e.createElement(o.Tab,Dr({label:(0,i.__)("Image","elementor")},r("image"))),e.createElement(o.Tab,Dr({label:(0,i.__)("Gradient","elementor")},r("gradient"))),e.createElement(o.Tab,Dr({label:(0,i.__)("Color","elementor")},r("color"))))),e.createElement(o.TabPanel,Dr({sx:{p:1.5}},s("image")),e.createElement(vt,null,e.createElement(Jr,null))),e.createElement(o.TabPanel,Dr({sx:{p:1.5}},s("gradient")),e.createElement(Er,null)),e.createElement(o.TabPanel,Dr({sx:{p:1.5}},s("color")),e.createElement(vt,null,e.createElement(qr,{anchorEl:l}))))},Br=({value:t})=>{switch(t.$$type){case"background-image-overlay":return e.createElement(Fr,{value:t});case"background-color-overlay":return e.createElement(Lr,{value:t});case"background-gradient-overlay":return e.createElement(jr,{value:t});default:return null}},Vr=e=>e?.value?.color?.value?e.value.color.value:"",Lr=({value:t})=>{const n=Vr(t);return e.createElement(Kr,{size:"inherit",component:"span",value:n})},Fr=({value:t})=>{const{imageUrl:n}=Yr(t);return e.createElement(o.CardMedia,{image:n,sx:e=>({height:"1rem",width:"1rem",borderRadius:e.shape.borderRadius/2+"px",outline:`1px solid ${e.palette.action.disabled}`})})},jr=({value:t})=>{const n=Zr(t);return e.createElement(Kr,{size:"inherit",component:"span",value:n})},Ur=({value:t})=>{switch(t.$$type){case"background-image-overlay":return e.createElement(Gr,{value:t});case"background-color-overlay":return e.createElement(Wr,{value:t});case"background-gradient-overlay":return e.createElement(Hr,{value:t});default:return null}},Wr=({value:t})=>{const n=Vr(t);return e.createElement("span",null,n)},Gr=({value:t})=>{const{imageTitle:n}=Yr(t);return e.createElement("span",null,n)},Hr=({value:t})=>"linear"===t.value.type.value?e.createElement("span",null,(0,i.__)("Linear Gradient","elementor")):e.createElement("span",null,(0,i.__)("Radial Gradient","elementor")),qr=({anchorEl:n})=>{const r=b(t.backgroundColorOverlayPropTypeUtil);return e.createElement(d,r,e.createElement(f,{bind:"color"},e.createElement(Oe,{anchorEl:n})))},Jr=()=>{const n=b(t.backgroundImageOverlayPropTypeUtil);return e.createElement(d,n,e.createElement(f,{bind:"image"},e.createElement(Y,{sizes:zr})),e.createElement(f,{bind:"position"},e.createElement(Mr,null)),e.createElement(f,{bind:"repeat"},e.createElement(Ir,null)),e.createElement(f,{bind:"size"},e.createElement(Nr,null)),e.createElement(f,{bind:"attachment"},e.createElement(Cr,null)))},Kr=(0,o.styled)(o.UnstableColorIndicator)(({theme:e})=>({height:"1rem",width:"1rem",borderRadius:e.shape.borderRadius/2+"px"})),Yr=e=>{let t,n=null;const r=e?.value.image.value?.src.value,{data:o}=(0,$.useWpMediaAttachment)(r.id?.value||null);if(r.id){const e=Xr(o?.filename);t=`${o?.title}${e}`||null,n=o?.url||null}else r.url&&(n=r.url.value,t=n?.substring(n.lastIndexOf("/")+1)||null);return{imageTitle:t,imageUrl:n}},Xr=e=>e?`.${e.substring(e.lastIndexOf(".")+1)}`:"",Zr=e=>{const t=e.value,n=t.stops.value?.map(({value:{color:e,offset:t}})=>`${e.value} ${t.value??0}%`)?.join(",");return"linear"===t.type.value?`linear-gradient(${t.angle.value}deg, ${n})`:`radial-gradient(circle at ${t.positions.value}, ${n})`},Qr=[{label:(0,i.__)("Full element","elementor"),value:"border-box"},{label:(0,i.__)("Padding edges","elementor"),value:"padding-box"},{label:(0,i.__)("Content edges","elementor"),value:"content-box"},{label:(0,i.__)("Text","elementor"),value:"text"}],eo=(0,i.__)("Color","elementor"),to=(0,i.__)("Clipping","elementor"),no=M(()=>{const n=b(t.backgroundPropTypeUtil);return e.createElement(d,n,e.createElement(f,{bind:"background-overlay"},e.createElement(Rr,null)),e.createElement(ro,null),e.createElement(oo,null))}),ro=()=>e.createElement(f,{bind:"color"},e.createElement(o.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(mn,null,eo)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(Oe,null)))),oo=()=>e.createElement(f,{bind:"clip"},e.createElement(o.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(mn,null,to)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(K,{options:Qr}))));function io(){return io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},io.apply(null,arguments)}const so=/\$\{([^}]+)\}/g,lo=M(({repeaterLabel:n,childControlConfig:r,showDuplicate:o,showToggle:i,initialValues:s,patternLabel:l,placeholder:a,propKey:c,addItemTooltipProps:u})=>{const{propTypeUtil:p,isItemDisabled:h}=r;if(!p)return null;const f=(0,e.useMemo)(()=>(0,t.createArrayPropUtils)(p.key,p.schema,c),[p.key,p.schema,c]),m=(0,e.useMemo)(()=>({...r,placeholder:a||"",patternLabel:l||""}),[r,a,l]),{propType:g,value:y,setValue:v}=b(f);return e.createElement(d,{propType:g,value:y,setValue:v},e.createElement(Je.Provider,{value:m},e.createElement(lt,{initial:p.create(s||null),propTypeUtil:f,isItemDisabled:h},e.createElement(Ct,{label:n},e.createElement(Ve,io({},u,{newItemIndex:0,ariaLabel:n}))),e.createElement(qe,{isSortable:!1},e.createElement(st,{Icon:ao,Label:ho,actions:e.createElement(e.Fragment,null,o&&e.createElement(dt,null),i&&e.createElement(ct,null),e.createElement(ht,null))})),e.createElement(yt,null,e.createElement(co,null)))))}),ao=()=>e.createElement(e.Fragment,null),co=()=>{const{component:t,props:n={}}=Ke();return e.createElement(vt,{p:1.5},e.createElement(wt,null,e.createElement(t,n)))},uo=(e,t)=>{let n={};const r=t.split("."),o=r.slice(-1)[0];let i=r.reduce((e,t,o)=>(o===r.length-2&&(n=e),e&&"object"==typeof e?e[t]:{}),e);i=i||"";const s=n?.$$type,l=n?.value;return"unit"===o&&"size"===s&&"custom"===l?.unit?l?.size?"":we:i},po=e=>"string"==typeof e?""===e.trim():!!Number.isNaN(e)||(Array.isArray(e)?0===e.length:"object"==typeof e&&null!==e&&0===Object.keys(e).length),ho=({value:t})=>{const{placeholder:n,patternLabel:r,props:i}=Ke(),s=((e,t)=>{const n=fo(e).map(e=>uo(t,e));return!(0===n.length||!n.some(e=>null==e)&&!n.every(po))})(r,t),l=s?n:(a=r,(c=t)?a.replace(so,(e,t)=>{const n=uo(c,t);return"object"!=typeof n||null===n||Array.isArray(n)?Array.isArray(n)?n.join(", "):String(n??""):"name"in n&&n.name?n.name:JSON.stringify(n)}):a);var a,c;const u=((e,t)=>e?"text.disabled":t?"text.tertiary":"text.primary")(!!i?.readOnly,s);return e.createElement(o.Box,{component:"span",color:u},l)},fo=e=>e.match(so)?.map(e=>e.slice(2,-1))||[],mo=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"};return e.replace(/[&<>'"]/g,e=>t[e]||e)};function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},go.apply(null,arguments)}const yo=M((n={})=>{const{value:r,setValue:s,...l}=b(t.keyValuePropTypeUtil),[a,c]=(0,e.useState)(""),[u,p]=(0,e.useState)(""),[h,m]=(0,e.useState)({key:r?.key?.value||"",value:r?.value?.value||""}),g=n.keyName||(0,i.__)("Key","elementor"),y=n.valueName||(0,i.__)("Value","elementor"),{keyHelper:v,valueHelper:w}=n.getHelperText?.(h.key,h.value)||{keyHelper:void 0,valueHelper:void 0},[x,E,k]=(0,e.useMemo)(()=>[n.regexKey?new RegExp(n.regexKey):void 0,n.regexValue?new RegExp(n.regexValue):void 0,n.validationErrorMessage||(0,i.__)("Invalid Format","elementor")],[n.regexKey,n.regexValue,n.validationErrorMessage]);return e.createElement(d,go({},l,{value:r,setValue:(e,n,o)=>{const i=o?.bind;if(!i)return;const l=e[i];if((0,t.isTransformable)(l)&&"dynamic"===l.$$type)return void s({...r,[i]:l});const a=t.stringPropTypeUtil.extract(l);m(e=>({...e,[i]:a})),a&&((e,t)=>{if("key"===t&&x){const t=x.test(e);return c(t?"":k),t}if("value"===t&&E){const t=E.test(e);return p(t?"":k),t}return!0})(a,i)?s({...r,[i]:l}):s({...r,[i]:{value:"",$$type:"string"}})}}),e.createElement(o.Grid,{container:!0,gap:1.5},e.createElement(o.Grid,{item:!0,xs:12,display:"flex",flexDirection:"column"},e.createElement(o.FormLabel,{size:"tiny",sx:{pb:1}},g),e.createElement(f,{bind:"key"},e.createElement(Q,{inputValue:n.escapeHtml?mo(h.key):h.key,error:!!a,helperText:v})),!!a&&e.createElement(o.FormHelperText,{error:!0},a)),e.createElement(o.Grid,{item:!0,xs:12,display:"flex",flexDirection:"column"},e.createElement(o.FormLabel,{size:"tiny",sx:{pb:1}},y),e.createElement(f,{bind:"value"},e.createElement(Q,{inputValue:n.escapeHtml?mo(h.value):h.value,error:!!u,inputDisabled:!!a,helperText:w})),!!u&&e.createElement(o.FormHelperText,{error:!0},u))))}),bo=[{label:(0,i.__)("Center center","elementor"),value:"center center"},{label:(0,i.__)("Center left","elementor"),value:"center left"},{label:(0,i.__)("Center right","elementor"),value:"center right"},{label:(0,i.__)("Top center","elementor"),value:"top center"},{label:(0,i.__)("Top left","elementor"),value:"top left"},{label:(0,i.__)("Top right","elementor"),value:"top right"},{label:(0,i.__)("Bottom center","elementor"),value:"bottom center"},{label:(0,i.__)("Bottom left","elementor"),value:"bottom left"},{label:(0,i.__)("Bottom right","elementor"),value:"bottom right"},{label:(0,i.__)("Custom","elementor"),value:"custom"}],vo=()=>{const n=b(t.positionPropTypeUtil),r=b(t.stringPropTypeUtil),s=!!n.value;return e.createElement(o.Grid,{container:!0,spacing:1.5},e.createElement(o.Grid,{item:!0,xs:12},e.createElement(o.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,(0,i.__)("Object position","elementor"))),e.createElement(o.Grid,{item:!0,xs:6,sx:{overflow:"hidden"}},e.createElement(o.Select,{size:"tiny",disabled:r.disabled,value:(n.value?"custom":r.value)??"",onChange:e=>{const t=e.target.value||null;"custom"===t?n.setValue({x:null,y:null}):r.setValue(t)},fullWidth:!0},bo.map(({label:t,value:n})=>e.createElement(q.MenuListItem,{key:n,value:n??""},t)))))),s&&e.createElement(d,n,e.createElement(o.Grid,{item:!0,xs:12},e.createElement(o.Grid,{container:!0,spacing:1.5},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"x"},e.createElement(xe,{startIcon:e.createElement(R.LetterXIcon,{fontSize:"tiny"}),min:-Number.MAX_SAFE_INTEGER}))),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"y"},e.createElement(xe,{startIcon:e.createElement(R.LetterYIcon,{fontSize:"tiny"}),min:-Number.MAX_SAFE_INTEGER})))))))},wo="transform-move",xo="transform-scale",Eo="transform-rotate",ko="transform-skew",So={move:{size:0,unit:"px"},scale:1,rotate:{size:0,unit:"deg"},skew:{size:0,unit:"deg"}},Co={$$type:wo,value:{x:{$$type:"size",value:{size:So.move.size,unit:So.move.unit}},y:{$$type:"size",value:{size:So.move.size,unit:So.move.unit}},z:{$$type:"size",value:{size:So.move.size,unit:So.move.unit}}}},To=t.scaleTransformPropTypeUtil.create({x:t.numberPropTypeUtil.create(So.scale),y:t.numberPropTypeUtil.create(So.scale),z:t.numberPropTypeUtil.create(So.scale)}),Mo=t.rotateTransformPropTypeUtil.create({x:{$$type:"size",value:{size:So.rotate.size,unit:So.rotate.unit}},y:{$$type:"size",value:{size:So.rotate.size,unit:So.rotate.unit}},z:{$$type:"size",value:{size:So.rotate.size,unit:So.rotate.unit}}}),Oo=t.skewTransformPropTypeUtil.create({x:{$$type:"size",value:{size:So.skew.size,unit:So.skew.unit}},y:{$$type:"size",value:{size:So.skew.size,unit:So.skew.unit}}}),Io=({label:t,bind:n,startIcon:r,anchorRef:i,units:s,variant:l="angle"})=>{const a=t.replace(/\s+/g,"-").toLowerCase();return e.createElement(o.Grid,{item:!0,xs:12},e.createElement(wt,{ref:i},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(mn,{htmlFor:a},t)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:n},e.createElement(xe,{anchorRef:i,startIcon:r,units:s,variant:l,min:-Number.MAX_SAFE_INTEGER,isRepeaterControl:!0,id:a})))))};function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Po.apply(null,arguments)}const No=[{label:(0,i.__)("Move X","elementor"),bind:"x",startIcon:e.createElement(R.ArrowRightIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vw"]},{label:(0,i.__)("Move Y","elementor"),bind:"y",startIcon:e.createElement(R.ArrowDownSmallIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vh"]},{label:(0,i.__)("Move Z","elementor"),bind:"z",startIcon:e.createElement(R.ArrowDownLeftIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vw","vh"]}],Do=()=>{const n=b(t.moveTransformPropTypeUtil),r=[(0,e.useRef)(null),(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(o.Grid,{container:!0,spacing:1.5},e.createElement(d,n,e.createElement(f,{bind:wo},No.map((t,n)=>e.createElement(Io,Po({key:t.bind},t,{anchorRef:r[n],units:t.units,variant:"length"}))))))};function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ao.apply(null,arguments)}const _o=[{label:(0,i.__)("Rotate X","elementor"),bind:"x",startIcon:e.createElement(R.Arrow360Icon,{fontSize:"tiny"})},{label:(0,i.__)("Rotate Y","elementor"),bind:"y",startIcon:e.createElement(R.Arrow360Icon,{fontSize:"tiny",style:{transform:"scaleX(-1) rotate(-90deg)"}})},{label:(0,i.__)("Rotate Z","elementor"),bind:"z",startIcon:e.createElement(R.RotateClockwiseIcon,{fontSize:"tiny"})}],zo=["deg","rad","grad","turn"],Ro=()=>{const n=b(t.rotateTransformPropTypeUtil),r=[(0,e.useRef)(null),(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(o.Grid,{container:!0,spacing:1.5},e.createElement(d,n,e.createElement(f,{bind:Eo},_o.map((t,n)=>e.createElement(Io,Ao({key:t.bind},t,{anchorRef:r[n],units:zo}))))))},$o=({label:t,bind:n,startIcon:r,anchorRef:i})=>e.createElement(o.Grid,{item:!0,xs:12},e.createElement(wt,{ref:i},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(mn,null,t)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:n},e.createElement(fn,{step:.1,placeholder:"1",startIcon:r})))));function Bo(){return Bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bo.apply(null,arguments)}const Vo=[{label:(0,i.__)("Scale X","elementor"),bind:"x",startIcon:e.createElement(R.ArrowRightIcon,{fontSize:"tiny"})},{label:(0,i.__)("Scale Y","elementor"),bind:"y",startIcon:e.createElement(R.ArrowDownSmallIcon,{fontSize:"tiny"})},{label:(0,i.__)("Scale Z","elementor"),bind:"z",startIcon:e.createElement(R.ArrowDownLeftIcon,{fontSize:"tiny"})}],Lo=()=>{const n=b(t.scaleTransformPropTypeUtil),r=[(0,e.useRef)(null),(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(o.Grid,{container:!0,spacing:1.5},e.createElement(d,n,e.createElement(f,{bind:xo},Vo.map((t,n)=>e.createElement($o,Bo({key:t.bind},t,{anchorRef:r[n]}))))))};function Fo(){return Fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fo.apply(null,arguments)}const jo=[{label:(0,i.__)("Skew X","elementor"),bind:"x",startIcon:e.createElement(R.ArrowRightIcon,{fontSize:"tiny"})},{label:(0,i.__)("Skew Y","elementor"),bind:"y",startIcon:e.createElement(R.ArrowLeftIcon,{fontSize:"tiny",style:{transform:"scaleX(-1) rotate(-90deg)"}})}],Uo=["deg","rad","grad","turn"],Wo=()=>{const n=b(t.skewTransformPropTypeUtil),r=[(0,e.useRef)(null),(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(o.Grid,{container:!0,spacing:1.5},e.createElement(d,n,e.createElement(f,{bind:ko},jo.map((t,n)=>e.createElement(Io,Fo({key:t.bind},t,{anchorRef:r[n],units:Uo}))))))};function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Go.apply(null,arguments)}const Ho=()=>{const{getTabsProps:n,getTabProps:r,getTabPanelProps:s}=(({move:n,scale:r,rotate:i,skew:s})=>{const{value:l,setValue:a}=b(t.moveTransformPropTypeUtil),{value:c,setValue:u}=b(t.scaleTransformPropTypeUtil),{value:d,setValue:p}=b(t.rotateTransformPropTypeUtil),{value:h,setValue:f}=b(t.skewTransformPropTypeUtil),{openItemIndex:m,items:g}=ze(),{getTabsProps:y,getTabProps:v,getTabPanelProps:w}=(0,o.useTabs)((()=>{switch(!0){case!!c:return xo;case!!d:return Eo;case!!h:return ko;default:return wo}})()),x=(0,e.useRef)({move:n,scale:r,rotate:i,skew:s}),E=(e,t)=>{t&&(x.current[e]=t)},k=(e,t)=>{switch(t){case wo:a(x.current.move),E("scale",c),E("rotate",d),E("skew",h);break;case xo:u(x.current.scale),E("move",l),E("rotate",d),E("skew",h);break;case Eo:p(x.current.rotate),E("move",l),E("scale",c),E("skew",h);break;case ko:f(x.current.skew),E("move",l),E("scale",c),E("rotate",d)}return y().onChange(e,t)};return{getTabProps:e=>{return{...v(e),disabled:(t=e,!!g.find(({item:{$$type:e}},n)=>t===e&&n!==m))};var t},getTabPanelProps:w,getTabsProps:()=>({...y(),onChange:k})}})({move:Co.value,scale:To.value,rotate:Mo.value,skew:Oo.value});return e.createElement(vt,null,e.createElement(o.Box,{sx:{width:"100%"}},e.createElement(o.Box,{sx:{borderBottom:1,borderColor:"divider"}},e.createElement(o.Tabs,Go({size:"small",variant:"fullWidth",sx:{"& .MuiTab-root":{minWidth:"62px"}}},n(),{"aria-label":(0,i.__)("Transform","elementor")}),e.createElement(o.Tab,Go({label:(0,i.__)("Move","elementor")},r(wo))),e.createElement(o.Tab,Go({label:(0,i.__)("Scale","elementor")},r(xo))),e.createElement(o.Tab,Go({label:(0,i.__)("Rotate","elementor")},r(Eo))),e.createElement(o.Tab,Go({label:(0,i.__)("Skew","elementor")},r(ko))))),e.createElement(o.TabPanel,Go({sx:{p:1.5}},s(wo)),e.createElement(Do,null)),e.createElement(o.TabPanel,Go({sx:{p:1.5}},s(xo)),e.createElement(Lo,null)),e.createElement(o.TabPanel,Go({sx:{p:1.5}},s(Eo)),e.createElement(Ro,null)),e.createElement(o.TabPanel,Go({sx:{p:1.5}},s(ko)),e.createElement(Wo,null))))},qo=({value:t})=>{switch(t.$$type){case wo:return e.createElement(R.ArrowsMaximizeIcon,{fontSize:"tiny"});case xo:return e.createElement(R.ArrowAutofitHeightIcon,{fontSize:"tiny"});case Eo:return e.createElement(R.RotateClockwise2Icon,{fontSize:"tiny"});case ko:return e.createElement(R.SkewXIcon,{fontSize:"tiny"});default:return null}},Jo=(e,t)=>Object.values(e).map(e=>{if("scale"===t)return e?.value||So[t];const n=So[t],r=e?.value?.size??n.size,o=e?.value?.unit??n.unit;return"custom"===o?r||we:`${r}${o}`}).join(", "),Ko=t=>{const{$$type:n,value:r}=t.value;switch(n){case wo:return e.createElement(Yo,{label:(0,i.__)("Move","elementor"),value:Jo(r,"move")});case xo:return e.createElement(Yo,{label:(0,i.__)("Scale","elementor"),value:Jo(r,"scale")});case Eo:return e.createElement(Yo,{label:(0,i.__)("Rotate","elementor"),value:Jo(r,"rotate")});case ko:return e.createElement(Yo,{label:(0,i.__)("Skew","elementor"),value:Jo(r,"skew")});default:return""}},Yo=({label:t,value:n})=>e.createElement(o.Box,{component:"span"},t,": ",n),Xo=["px","%","em","rem"],Zo={label:(0,i.__)("Perspective","elementor"),bind:"perspective",units:["px","em","rem","vw","vh"]},Qo=[{label:(0,i.__)("Origin X","elementor"),bind:"x",units:Xo},{label:(0,i.__)("Origin Y","elementor"),bind:"y",units:Xo}],ei=()=>e.createElement(o.Stack,{direction:"column",spacing:1.5},e.createElement(E,null,(0,i.__)("Children perspective","elementor")),e.createElement(ti,null),e.createElement(ni,null)),ti=()=>e.createElement(f,{bind:"perspective"},e.createElement(oi,{control:Zo,key:Zo.bind})),ni=()=>e.createElement(f,{bind:"perspective-origin"},e.createElement(ri,null)),ri=()=>{const n=b(t.perspectiveOriginPropTypeUtil);return e.createElement(d,n,Qo.map(t=>e.createElement(f,{bind:t.bind,key:t.bind},e.createElement(oi,{control:t}))))},oi=({control:t})=>{const n=e.useRef(null);return e.createElement(wt,{ref:n},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,t.label)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(xe,{variant:"length",units:t.units,anchorRef:n,disableCustom:!0})))},ii=["px","%","em","rem"],si=ii.filter(e=>"%"!==e),li=[{label:(0,i.__)("Origin X","elementor"),bind:"x",units:ii},{label:(0,i.__)("Origin Y","elementor"),bind:"y",units:ii},{label:(0,i.__)("Origin Z","elementor"),bind:"z",units:si}],ai=()=>e.createElement(o.Stack,{direction:"column",spacing:1.5},e.createElement(E,null,(0,i.__)("Transform","elementor")),li.map(t=>e.createElement(ci,{control:t,key:t.bind}))),ci=({control:n})=>{const r=b(t.transformOriginPropTypeUtil),i=e.useRef(null);return e.createElement(d,r,e.createElement(f,{bind:n.bind},e.createElement(wt,{ref:i},e.createElement(o.Grid,{item:!0,xs:6},e.createElement(E,null,n.label)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(xe,{variant:"length",units:n.units,anchorRef:i,disableCustom:!0})))))};function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ui.apply(null,arguments)}const di=({popupState:t,anchorRef:n})=>{const r=(0,o.bindPopover)({...t,anchorEl:n.current??void 0});return e.createElement(o.Popover,ui({disablePortal:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{width:(n.current?.offsetWidth||0)-6+"px",mt:.5}}}},r),e.createElement(q.PopoverHeader,{title:(0,i.__)("Transform settings","elementor"),onClose:t.close,icon:e.createElement(R.AdjustmentsIcon,{fontSize:"tiny"})}),e.createElement(o.Divider,null),e.createElement(vt,{sx:{px:2,py:1.5}},e.createElement(f,{bind:"transform-origin"},e.createElement(ai,null)),e.createElement(o.Box,{sx:{my:.5}},e.createElement(o.Divider,null)),e.createElement(ei,null)))};function pi(){return pi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pi.apply(null,arguments)}const hi="tiny",fi=M(()=>{const n=b(t.transformPropTypeUtil),r=(0,e.useRef)(null),i=(0,o.usePopupState)({variant:"popover"});return e.createElement(d,n,e.createElement(di,{popupState:i,anchorRef:r}),e.createElement(f,{bind:"transform-functions"},e.createElement(gi,{headerRef:r,propType:n.propType,popupState:i})))}),mi=e.createElement(o.Box,{component:"span","aria-label":void 0,sx:{display:"flex",gap:.5,p:2,width:320,borderRadius:1}},e.createElement(R.InfoCircleFilledIcon,{sx:{color:"secondary.main"}}),e.createElement(o.Typography,{variant:"body2",color:"text.secondary",fontSize:"14px"},(0,i.__)("You can use each kind of transform only once per element.","elementor"))),gi=({headerRef:n,propType:r,popupState:o})=>{const s=b(t.transformFunctionsPropTypeUtil),l=[Co,To,Mo,Oo],{value:a,bind:c}=s,u=()=>l.find(e=>!a?.some(t=>t.$$type===e.$$type)),p=!u();return e.createElement(d,s,e.createElement(lt,{initial:u()??Co,propTypeUtil:t.transformFunctionsPropTypeUtil},e.createElement(Ct,{label:(0,i.__)("Transform","elementor"),adornment:()=>e.createElement(St,{customContext:{path:["transform"],propType:r}}),ref:n},e.createElement(yi,{popupState:o,repeaterBindKey:c}),e.createElement(Ve,{disabled:p,tooltipContent:mi,enableTooltip:p,ariaLabel:"transform"})),e.createElement(qe,null,e.createElement(st,{Icon:qo,Label:Ko,actions:e.createElement(e.Fragment,null,e.createElement(ct,null),e.createElement(ht,null))})),e.createElement(yt,null,e.createElement(Ho,null))))},yi=({popupState:t,repeaterBindKey:n})=>{const{bind:r}=b(),s=(0,i.__)("Transform settings","elementor");return r!==n?null:e.createElement(o.Tooltip,{title:s,placement:"top"},e.createElement(o.IconButton,pi({size:hi,"aria-label":s},(0,o.bindTrigger)(t)),e.createElement(R.AdjustmentsIcon,{fontSize:hi})))},bi=M(({selectionLabel:n,sizeLabel:r,selectionConfig:i,sizeConfigMap:s,isRepeaterControl:l=!1})=>{const{value:a,setValue:c,propType:u}=b(t.selectionSizePropTypeUtil),p=(0,e.useRef)(null),h=r.replace(/\s+/g,"-").toLowerCase(),m=(0,e.useMemo)(()=>{switch(a.selection.$$type){case"key-value":return s[a?.selection?.value.value.value||""];case"string":return s[a?.selection?.value||""];default:return null}},[a,s]),g=i.component;return e.createElement(d,{value:a,setValue:c,propType:u},e.createElement(o.Grid,{container:!0,spacing:1.5,ref:p},e.createElement(o.Grid,{item:!0,xs:6,sx:{display:"flex",alignItems:"center"}},e.createElement(E,null,n)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"selection"},e.createElement(g,i.props))),m&&e.createElement(e.Fragment,null,e.createElement(o.Grid,{item:!0,xs:6,sx:{display:"flex",alignItems:"center"}},e.createElement(E,{htmlFor:h},r)),e.createElement(o.Grid,{item:!0,xs:6},e.createElement(f,{bind:"size"},e.createElement(xe,{anchorRef:p,variant:m.variant,units:m.units,defaultUnit:m.defaultUnit,id:h,isRepeaterControl:l}))))))}),vi={selection:{$$type:"key-value",value:{key:{value:(0,i.__)("All properties","elementor"),$$type:"string"},value:{value:"all",$$type:"string"}}},size:{$$type:"size",value:{size:200,unit:"ms"}}},wi=[{label:(0,i.__)("Default","elementor"),type:"category",properties:[{label:(0,i.__)("All properties","elementor"),value:"all"}]}],xi=wi.map(e=>({label:e.label,items:e.properties.map(e=>e.label)}));var Ei=window.elementorV2.mixpanel;const ki={eventName:"click_added_transition",location:"V4 Style Tab",secondaryLocation:"Transition control",trigger:"click"};function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Si.apply(null,arguments)}function Ci(e){if(!e?.value)return null;for(const t of wi)for(const n of t.properties)if(n.value===e.value)return n;return null}const Ti=(e,t)=>t.filter(t=>t!==e.key.value),Mi=({recentlyUsedList:n=[],disabledItems:r=[]})=>{const{value:s,setValue:l}=b(t.keyValuePropTypeUtil),{key:{value:a}}=s,c=(0,e.useRef)(null),u=(0,o.usePopupState)({variant:"popover"});return e.createElement(o.Box,{ref:c},e.createElement(G,null,e.createElement(o.UnstableTag,Si({variant:"outlined",label:a,endIcon:e.createElement(R.ChevronDownIcon,{fontSize:"tiny"})},(0,o.bindTrigger)(u),{fullWidth:!0}))),e.createElement(o.Popover,Si({disablePortal:!0,disableScrollLock:!0},(0,o.bindPopover)(u),{anchorReference:"anchorPosition",anchorPosition:(()=>{if(!c.current)return;const e=c.current.getBoundingClientRect();return{top:e.top,left:e.right+36}})(),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}}),e.createElement(kn,{itemsList:(()=>{const e=n.map(e=>Ci({value:e,$$type:"string"})?.label).filter(e=>!!e),t=xi.map(t=>({...t,items:t.items.filter(t=>!e.includes(t))}));if(0===e.length)return t;const[r,...o]=t;return[r,{label:(0,i.__)("Recently Used","elementor"),items:e},...o]})(),selectedItem:a,onItemChange:e=>{const t=(e=>{for(const t of wi){const n=t.properties.find(t=>t.label===e);if(n)return{key:{value:n.label,$$type:"string"},value:{value:n.value,$$type:"string"}}}return null})(e);t&&(l(t),u.close())},onClose:u.close,sectionWidth:268,title:(0,i.__)("Transition Property","elementor"),icon:R.VariationsIcon,disabledItems:Ti(s,r)})))},Oi={variant:"time",units:["s","ms"],defaultUnit:"ms"},Ii=(0,t.createArrayPropUtils)(t.selectionSizePropTypeUtil.key,t.selectionSizePropTypeUtil.schema,"transition");De.subscribe("transition-item-added",e=>{const t=e,n=t?.itemValue?.selection?.value?.value?.value,r=(0,Pn.getSelectedElements)(),o=r[0]?.type??null;(0,Ei.trackEvent)({transition_type:n??"unknown",...ki,widget_type:o})});const Pi=(e,t)=>({selectionLabel:(0,i.__)("Type","elementor"),sizeLabel:(0,i.__)("Duration","elementor"),selectionConfig:{component:Mi,props:{recentlyUsedList:e,disabledItems:t}},isRepeaterControl:!0,sizeConfigMap:{...wi.reduce((e,t)=>(t.properties.forEach(t=>{e[t.value]=Oi}),e),{})}}),Ni=e=>{const t=Ci(e.value.selection.value?.value);return!!t&&!!t.isDisabled},Di=(e,n)=>({propTypeUtil:t.selectionSizePropTypeUtil,component:bi,props:Pi(e,n),isItemDisabled:Ni}),Ai=(e,t)=>(e??[]).some(e=>e?.value?.selection?.value?.value?.value===t.value),_i=(e=[])=>{if(!e?.length)return vi;for(const t of wi)for(const n of t.properties)if(!Ai(e,n))return{...vi,selection:{$$type:"key-value",value:{key:{value:n.label,$$type:"string"},value:{value:n.value,$$type:"string"}}}};return vi},zi=e.createElement(o.Alert,{sx:{width:280,gap:.5},color:"secondary",icon:e.createElement(R.InfoCircleFilledIcon,null)},e.createElement(o.AlertTitle,null,(0,i.__)("Transitions","elementor")),e.createElement(o.Box,{component:"span"},e.createElement(o.Typography,{variant:"body2"},(0,i.__)("Switch to 'Normal' state to add a transition.","elementor")))),Ri=M(({recentlyUsedListGetter:t,currentStyleState:n})=>{const r=null===n,[o,s]=(0,e.useState)([]),{value:l,setValue:a}=b(Ii),c=(0,e.useMemo)(()=>((e=[])=>{const t=(e||[]).map(e=>e.value?.selection?.value?.key?.value);return wi.forEach(e=>{const n=e.properties.filter(e=>e.isDisabled&&!t.includes(e.label)).map(e=>e.label);t.push(...n)}),t})(l),[l]),u=(0,e.useMemo)(()=>{const e=new Set;return wi.forEach(t=>{t.properties.forEach(t=>e.add(t.value))}),e},[]);(0,e.useEffect)(()=>{if(!l||0===l.length)return;const e=l.filter(e=>{const t=e?.value?.selection?.value?.value?.value??"";return u.has(t)});e.length!==l.length&&a(e)},[u]),(0,e.useEffect)(()=>{t().then(s)},[t]);const d=(0,e.useMemo)(()=>((e=[])=>!!e?.length&&wi.every(t=>t.properties.every(t=>t.isDisabled||!!e?.find(e=>e.value?.selection?.value?.value?.value===t.value))))(l),[l]),p=!r||d;return e.createElement(lo,{label:(0,i.__)("Transitions","elementor"),repeaterLabel:(0,i.__)("Transitions","elementor"),patternLabel:"${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",placeholder:(0,i.__)("Empty Transition","elementor"),showDuplicate:!1,showToggle:!0,initialValues:_i(l),childControlConfig:Di(o,c),propKey:"transition",addItemTooltipProps:{disabled:p,enableTooltip:!r,tooltipContent:zi}})});var $i=n(9091),Bi=n.n($i);function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vi.apply(null,arguments)}const Li=M(({inputDisabled:n})=>{const{value:r,setValue:i,...s}=b(t.DateTimePropTypeUtil),l=(e,n)=>{const o=n.bind,s=e[o];if((0,t.isTransformable)(s))return i({...r,[o]:s});let l="";if(s){const e=s;l="date"===o?e.format("YYYY-MM-DD"):e.format("HH:mm")}i({...r,[o]:{$$type:"string",value:l}})};return e.createElement(d,Vi({},s,{value:r,setValue:i}),e.createElement(G,null,e.createElement(o.LocalizationProvider,null,e.createElement(o.Box,{display:"flex",gap:1,alignItems:"center"},e.createElement(f,{bind:"date"},e.createElement(o.DatePicker,{value:(e=>{if(!e)return null;const t=Bi()(e);return t&&"function"==typeof t.isValid&&t.isValid()?t:null})(t.stringPropTypeUtil.extract(r?.date)),onChange:e=>l({date:e},{bind:"date"}),disabled:n,slotProps:{textField:{size:"tiny"},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}}})),e.createElement(f,{bind:"time"},e.createElement(o.TimePicker,{value:(e=>{if(!e)return null;const[t,n]=e.split(":"),r=Number.parseInt(t??"",10),o=Number.parseInt(n??"",10);return Number.isNaN(r)||Number.isNaN(o)?null:Bi()().hour(r).minute(o).second(0).millisecond(0)})(t.stringPropTypeUtil.extract(r?.time)),onChange:e=>l({time:e},{bind:"time"}),disabled:n,slotProps:{textField:{size:"tiny"},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}}}))))))});function Fi(e){this.content=e}Fi.prototype={constructor:Fi,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Fi(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Fi(n)},addToStart:function(e,t){return new Fi([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Fi(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new Fi(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=Fi.from(e)).size?new Fi(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Fi.from(e)).size?new Fi(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Fi.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Fi.from=function(e){if(e instanceof Fi)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Fi(t)};var ji=Fi;function Ui(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=Ui(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function Wi(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),l=t.child(--i),a=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let e=0,t=Math.min(s.text.length,l.text.length);for(;e<t&&s.text[s.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let e=Wi(s.content,l.content,n-1,r-1);if(e)return e}n-=a,r-=a}else n-=a,r-=a}}class Gi{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let l=this.content[i],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,o||null,i)&&l.content.size){let o=s+1;l.nodesBetween(Math.max(0,e-o),Math.min(l.content.size,t-o),n,r+o)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=a},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new Gi(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],l=i+s.nodeSize;l>e&&((i<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=l}return new Gi(n,r)}cutByIndex(e,t){return e==t?Gi.empty:0==e&&t==this.content.length?this:new Gi(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new Gi(r,o)}addToStart(e){return new Gi([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Gi(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Ui(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Wi(this,e,t,n)}findIndex(e){if(0==e)return qi(0,e);if(e==this.size)return qi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?qi(t+1,r):qi(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Gi.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Gi(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Gi.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new Gi(t||e,n)}static from(e){if(!e)return Gi.empty;if(e instanceof Gi)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Gi([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Gi.empty=new Gi([],0);const Hi={index:0,offset:0};function qi(e,t){return Hi.index=e,Hi.offset=t,Hi}function Ji(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Ji(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Ji(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class Ki{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ji(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return Ki.none;if(e instanceof Ki)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}Ki.none=[];class Yi extends Error{}class Xi{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Qi(this.content,e+this.openStart,t);return n&&new Xi(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Xi(Zi(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Xi.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Xi(Gi.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new Xi(e,n,r)}}function Zi(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:l}=e.findIndex(n);if(o==t||i.isText){if(l!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(Zi(i.content,t-o-1,n-o-1)))}function Qi(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Qi(s.content,t-i-1,n,s);return l&&e.replaceChild(o,s.copy(l))}function es(e,t,n){if(n.openStart>e.depth)throw new Yi("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Yi("Inconsistent open depths");return ts(e,t,n,0)}function ts(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=ts(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Gi.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return ls(i,as(e,o,s,t,r))}{let r=e.parent,o=r.content;return ls(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return ls(i,cs(e,t,r))}function ns(e,t){if(!t.type.compatibleContent(e.type))throw new Yi("Cannot join "+t.type.name+" onto "+e.type.name)}function rs(e,t,n){let r=e.node(n);return ns(r,t.node(n)),r}function is(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ss(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(is(e.nodeAfter,r),i++));for(let e=i;e<s;e++)is(o.child(e),r);t&&t.depth==n&&t.textOffset&&is(t.nodeBefore,r)}function ls(e,t){return e.type.checkContent(t),e.copy(t)}function as(e,t,n,r,o){let i=e.depth>o&&rs(e,t,o+1),s=r.depth>o&&rs(n,r,o+1),l=[];return ss(null,e,o,l),i&&s&&t.index(o)==n.index(o)?(ns(i,s),is(ls(i,as(e,t,n,r,o+1)),l)):(i&&is(ls(i,cs(e,t,o+1)),l),ss(t,n,o,l),s&&is(ls(s,cs(n,r,o+1)),l)),ss(r,null,o,l),new Gi(l)}function cs(e,t,n){let r=[];return ss(null,e,n,r),e.depth>n&&is(ls(rs(e,t,n+1),cs(e,t,n+1)),r),ss(t,null,n,r),new Gi(r)}Xi.empty=new Xi(Gi.empty,0,0);class us{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Ki.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new fs(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new us(t,n,o)}static resolveCached(e,t){let n=hs.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else hs.set(e,n=new ds);let r=n.elts[n.i]=us.resolve(e,t);return n.i=(n.i+1)%ps,r}}class ds{constructor(){this.elts=[],this.i=0}}const ps=12,hs=new WeakMap;class fs{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ms=Object.create(null);class gs{constructor(e,t,n,r=Ki.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Gi.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Ji(this.attrs,t||e.defaultAttrs||ms)&&Ki.sameSet(this.marks,n||Ki.none)}copy(e=null){return e==this.content?this:new gs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new gs(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Xi.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),l=r.node(i).content.cut(r.pos-s,o.pos-s);return new Xi(l,r.depth-i,o.depth-i)}replace(e,t,n){return es(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return us.resolveCached(this,e)}resolveNoCache(e){return us.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),bs(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Gi.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ki.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Ki.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Gi.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}gs.prototype.text=void 0;class ys extends gs{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bs(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ys(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ys(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function bs(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class vs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ws(e,t);if(null==n.next)return vs.empty;let r=xs(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return function n(r){let o=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);Ms(e,n).forEach(e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})})});let i=t[r.join(",")]=new vs(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(Ts);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}(Ms(e,0))}(function(e){let t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,i)),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(i,s),o(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(e(t.expr,i),s),o(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){let s=i;for(let r=0;r<t.min;r++){let r=n();o(e(t.expr,s),r),s=r}if(-1==t.max)o(e(t.expr,s),s);else for(let i=t.min;i<t.max;i++){let i=n();r(s,i),o(e(t.expr,s),i),s=i}return[r(s)]}if("name"==t.type)return[r(i,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],i);if(r==t.exprs.length-1)return s;o(s,i=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let l=i.matchFragment(e,n);if(l&&(!t||l.validEnd))return Gi.from(s.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}vs.empty=new vs(!0);class ws{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function xs(e){let t=[];do{t.push(Es(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Es(e){let t=[];do{t.push(ks(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function ks(e){let t=function(e){if(e.eat("(")){let t=xs(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.isInGroup(t)&&o.push(r)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Cs(e,t)}return t}function Ss(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Cs(e,t){let n=Ss(e),r=n;return e.eat(",")&&(r="}"!=e.next?Ss(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Ts(e,t){return t-e}function Ms(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(Ts)}function Os(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Is(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function Ps(e,t,n,r){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Ns(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new As(e,r,t[r]);return n}class Ds{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Ns(e,n.attrs),this.defaultAttrs=Os(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==vs.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Is(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new gs(this,this.computeAttrs(e),Gi.from(t),Ki.setFrom(n))}createChecked(e=null,t,n){return t=Gi.from(t),this.checkContent(t),new gs(this,this.computeAttrs(e),t,Ki.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Gi.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(Gi.empty,!0);return o?new gs(this,e,t.append(o),Ki.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ps(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Ki.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new Ds(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class As{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class _s{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ns(e,r.attrs),this.excluded=null;let o=Os(this.attrs);this.instance=o?new Ki(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ki(this,Is(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,o)=>n[e]=new _s(e,r++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ps(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class zs{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=ji.from(e.nodes),t.marks=ji.from(e.marks||{}),this.nodes=Ds.compile(this.spec.nodes,this),this.marks=_s.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=vs.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==o?null:o?Rs(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Rs(this,n.split(" "))}this.nodeFromJSON=e=>gs.fromJSON(this,e),this.markFromJSON=e=>Ki.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ds))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ys(n,n.defaultAttrs,e,Ki.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Rs(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class $s{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Us(this,t,!1);return n.addAll(e,Ki.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Us(this,t,!0);return n.addAll(e,Ki.none,t.from,t.to),Xi.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Ws(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Gs(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Gs(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $s(e,$s.schemaRules(e)))}}const Bs={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},Vs={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ls={ol:!0,ul:!0};function Fs(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class js{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=Ki.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Gi.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Gi.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Gi.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Bs.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Us{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,o=t.topNode,i=Fs(null,t.preserveWhitespace,0)|(n?4:0);r=o?new js(o.type,o.attrs,Ki.none,!0,t.topMatch||o.type.contentMatch,i):new js(n?null:e.schema.topNodeType,null,Ki.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(i.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i,s=e.nodeName.toLowerCase();Ls.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Ls.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));e:if(l?l.ignore:Vs.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(Bs.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let i=l&&l.skip?t:this.readStyles(e,t);i&&this.addAll(e,i),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?i:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],o=n.getPropertyValue(r);if(o)for(let e;;){let n=this.parser.matchStyle(r,o,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;e=n}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let t=this.open,i=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+i)&&(r=l,o=s,!l.length))break;if(s.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=Ki.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):Hs(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=Fs(e,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let l=Ki.none;return n=n.filter(t=>!(i.type?i.type.allowsMarkType(t.type):Hs(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new js(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function Ws(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Gs(e){let t={};for(let n in e)t[n]=e[n];return t}function Hs(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class qs{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Ks(t).createDocumentFragment());let r=n,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Xs(Ks(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Xs(Ks(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Xs(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new qs(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Js(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Js(e.marks)}}function Js(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Ks(e){return e.document||window.document}const Ys=new WeakMap;function Xs(e,t,n,r){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let o,i=t[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=function(e){let t=Ys.get(e);return void 0===t&&Ys.set(e,t=function(e){let t=null;return function e(n){if(n&&"object"==typeof n)if(Array.isArray(n))if("string"==typeof n[0])t||(t=[]),t.push(n);else for(let t=0;t<n.length;t++)e(n[t]);else for(let t in n)e(n[t])}(e),t}(e)),t}(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,l=i.indexOf(" ");l>0&&(n=i.slice(0,l),i=i.slice(l+1));let a=n?e.createElementNS(n,i):e.createElement(i),c=t[1],u=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){u=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&a.style?a.style.cssText=c[e]:a.setAttribute(e,c[e])}}for(let o=u;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:t,contentDOM:o}=Xs(e,i,n,r);if(a.appendChild(t),o){if(s)throw new RangeError("Multiple content holes");s=o}}}return{dom:a,contentDOM:s}}const Zs=Math.pow(2,16);function Qs(e,t){return e+t*Zs}function el(e){return 65535&e}class tl{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class nl{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&nl.empty)return nl.empty}recover(e){let t=0,n=el(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Zs}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[s+o],c=this.ranges[s+i],u=l+a;if(e<=u){let o=l+r+((a?e==l?-1:e==u?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?l:u)?null:Qs(s/3,e-l),d=e==l?2:e==u?1:4;return(t<0?e!=l:e!=u)&&(d|=8),new tl(o,d,i)}r+=c-a}return n?e+r:new tl(e+r,0,null)}touches(e,t){let n=0,r=el(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+o];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+i]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),l=i+(this.inverted?0:o),a=this.ranges[r+t],c=this.ranges[r+n];e(s,s+a,l,l+c),o+=c-a}}invert(){return new nl(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?nl.empty:new nl(e<0?[0,-e,0]:[0,0,e])}}nl.empty=new nl([]);class rl{constructor(e,t,n=0,r=(e?e.length:0)){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new rl(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new rl;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this._maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new tl(e,r,null)}}const ol=Object.create(null);class il{getMap(){return nl.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=ol[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ol)throw new RangeError("Duplicate use of step JSON ID "+e);return ol[e]=t,t.prototype.jsonID=e,t}}class sl{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new sl(e,null)}static fail(e){return new sl(null,e)}static fromReplace(e,t,n,r){try{return sl.ok(e.replace(t,n,r))}catch(e){if(e instanceof Yi)return sl.fail(e.message);throw e}}}function ll(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(ll(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return Gi.fromArray(r)}class al extends il{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new Xi(ll(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return sl.fromReplace(e,this.from,this.to,o)}invert(){return new cl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new al(t.pos,n.pos,this.mark)}merge(e){return e instanceof al&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new al(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new al(t.from,t.to,e.markFromJSON(t.mark))}}il.jsonID("addMark",al);class cl extends il{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Xi(ll(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return sl.fromReplace(e,this.from,this.to,n)}invert(){return new al(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new cl(t.pos,n.pos,this.mark)}merge(e){return e instanceof cl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new cl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new cl(t.from,t.to,e.markFromJSON(t.mark))}}il.jsonID("removeMark",cl);class ul extends il{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return sl.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return sl.fromReplace(e,this.pos,this.pos+1,new Xi(Gi.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new ul(this.pos,t.marks[n]);return new ul(this.pos,this.mark)}}return new dl(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ul(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ul(t.pos,e.markFromJSON(t.mark))}}il.jsonID("addNodeMark",ul);class dl extends il{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return sl.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return sl.fromReplace(e,this.pos,this.pos+1,new Xi(Gi.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new ul(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new dl(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new dl(t.pos,e.markFromJSON(t.mark))}}il.jsonID("removeNodeMark",dl);class pl extends il{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&fl(e,this.from,this.to)?sl.fail("Structure replace would overwrite content"):sl.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new nl([this.from,this.to-this.from,this.slice.size])}invert(e){return new pl(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new pl(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof pl)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?Xi.empty:new Xi(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new pl(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?Xi.empty:new Xi(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new pl(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new pl(t.from,t.to,Xi.fromJSON(e,t.slice),!!t.structure)}}il.jsonID("replace",pl);class hl extends il{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(fl(e,this.from,this.gapFrom)||fl(e,this.gapTo,this.to)))return sl.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return sl.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?sl.fromReplace(e,this.from,this.to,n):sl.fail("Content does not fit in gap")}getMap(){return new nl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new hl(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new hl(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new hl(t.from,t.to,t.gapFrom,t.gapTo,Xi.fromJSON(e,t.slice),t.insert,!!t.structure)}}function fl(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function ml(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],l=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),c=l+a.nodeSize,u=r.matchType(a.type);if(u){r=u;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new cl(l,c,a.marks[t]));if(o&&a.isText&&"pre"!=n.whitespace){let e,t,r=/\r?\n|\r/g;for(;e=r.exec(a.text);)t||(t=new Xi(Gi.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),s.push(new pl(l+e.index,l+e.index+e[0].length,t))}}else s.push(new pl(l,c,Xi.empty));l=c}if(!r.validEnd){let t=r.fillBefore(Gi.empty,!0);e.replace(l,l,new Xi(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function gl(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function yl(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let i=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-o;if(n<e.depth&&i.canReplace(s,l,t))return n;if(0==n||i.type.spec.isolating||!gl(i,s,l))break;s&&(r=1),l<i.childCount&&(o=1)}return null}function bl(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<o;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return i?o.map(vl).concat({type:t,attrs:n}).concat(i.map(vl)):null}function vl(e){return{type:e,attrs:null}}function wl(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function xl(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function El(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function kl(e,t){let n=e.resolve(t),r=n.index();return Sl(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Sl(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==r?e.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function Cl(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,i,s=r.index(e);if(e==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(e+1),s++,i=r.node(e).maybeChild(s)):(o=r.node(e).maybeChild(s-1),i=r.node(e+1)),o&&!o.isTextblock&&Sl(o,i)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function Tl(e,t,n=t,r=Xi.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return Ml(o,i,r)?new pl(t,n,r):new Ol(o,i,r).fit()}function Ml(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}il.jsonID("replaceAround",hl);class Ol{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Gi.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=Gi.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let l=new Xi(o,i,s);return e>-1?new hl(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new pl(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Nl(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let e=this.depth;e>=0;e--){let i,{type:s,match:l}=this.frontier[e],a=null;if(1==t&&(o?l.matchType(o.type)||(a=l.fillBefore(Gi.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:a};if(2==t&&o&&(i=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:i};if(r&&l.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Nl(e,t);return!(!r.childCount||r.firstChild.isLeaf||(this.unplaced=new Xi(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Nl(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new Xi(Il(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new Xi(Il(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,l=i.openStart-e,a=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let p=s.size+e-(i.content.size-i.openEnd);for(;a<s.childCount;){let e=s.child(a),t=u.matchType(e.type);if(!t)break;a++,(a>1||0==l||e.content.size)&&(u=t,c.push(Dl(e.mark(d.allowedMarks(e.marks)),1==a?l:0,a==s.childCount?p:-1)))}let h=a==s.childCount;h||(p=-1),this.placed=Pl(this.placed,t,Gi.from(c)),this.frontier[t].match=u,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?Xi.empty:new Xi(Il(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new Xi(Il(i.content,e,a),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Al(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=Al(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=Al(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Pl(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Pl(this.placed,this.depth,Gi.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Gi.empty,!0);e.childCount&&(this.placed=Pl(this.placed,this.frontier.length,e))}}function Il(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Il(e.firstChild.content,t-1,n)))}function Pl(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Pl(e.lastChild.content,t-1,n)))}function Nl(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Dl(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Dl(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Gi.empty,!0)))),e.copy(r)}function Al(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?l:null}function _l(e){return e.spec.defining||e.spec.definingForContent}function zl(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(zl(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Gi.empty,!0))}return e}function Rl(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class $l extends il{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return sl.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return sl.fromReplace(e,this.pos,this.pos+1,new Xi(Gi.from(r),0,t.isLeaf?0:1))}getMap(){return nl.empty}invert(e){return new $l(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $l(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new $l(t.pos,t.attr,t.value)}}il.jsonID("attr",$l);class Bl extends il{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return sl.ok(n)}getMap(){return nl.empty}invert(e){return new Bl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Bl(t.attr,t.value)}}il.jsonID("docAttr",Bl);let Vl=class extends Error{};Vl=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Vl.prototype=Object.create(Error.prototype)).constructor=Vl,Vl.prototype.name="TransformError";class Ll{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Vl(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Xi.empty){let r=Tl(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Xi(Gi.from(n),0,0))}delete(e,t){return this.replace(e,t,Xi.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(Ml(o,i,r))return e.step(new pl(t,n,r));let s=Rl(o,i);0==s[s.length-1]&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?l=e:o.before(e)==t&&s.splice(1,0,-e)}let a=s.indexOf(l),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=c[e],n=_l(t.type);if(n&&!t.sameMarkup(o.node(Math.abs(l)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let l=(t+u+1)%(r.openStart+1),d=c[l];if(d)for(let t=0;t<s.length;t++){let c=s[(t+a)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),h=o.index(c-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(o.before(c),u?i.after(c):n,new Xi(zl(r.content,0,r.openStart,l),l,r.openEnd))}}let d=e.steps.length;for(let l=s.length-1;l>=0&&(e.replace(t,n,r),!(e.steps.length>d));l--){let e=s[l];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new Xi(Gi.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=Rl(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),l=o.after(i+1),a=s,c=l,u=Gi.empty,d=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=Gi.from(r.node(e).copy(u)),d++):a--;let p=Gi.empty,h=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,p=Gi.from(o.node(e).copy(p)),h++):c++;e.step(new hl(a,c,s,l,new Xi(u.append(p),d,h),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-n),s=i.node().type;if(o&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(o);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);xl(e,r.node(),r.before(),l)}s.inlineContent&&ml(e,t+n-1,s,i.node().contentMatchAt(i.index()),null==r);let a=e.mapping.slice(l),c=a.map(t-n);if(e.step(new pl(c,a.map(t+n,-1),Xi.empty,!0)),!0===r){let t=e.doc.resolve(c);wl(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Gi.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Gi.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new hl(o,i,o,i,new Xi(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let s="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(r,s)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){let o=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&xl(e,t,n,i),ml(e,e.mapping.slice(i).map(n,1),r,void 0,null===o);let l=e.mapping.slice(i),a=l.map(n,1),c=l.map(n+t.nodeSize,1);return e.step(new hl(a,c,a+1,c-1,new Xi(Gi.from(r.create(s,null,t.marks)),0,0),1,!0)),!0===o&&wl(e,t,n,i),!1}})}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new hl(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Xi(Gi.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new $l(e,t,n)),this}setDocAttribute(e,t){return this.step(new Bl(e,t)),this}addNodeMark(e,t){return this.step(new ul(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Ki)t.isInSet(n.marks)&&this.step(new dl(e,t));else{let r,o=n.marks,i=[];for(;r=t.isInSet(o);)i.push(new dl(e,r)),o=r.removeFromSet(o);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=Gi.empty,s=Gi.empty;for(let e=o.depth,t=o.depth-n,l=n-1;e>t;e--,l--){i=Gi.from(o.node(e).copy(i));let t=r&&r[l];s=Gi.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new pl(t,t,new Xi(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],l=[];e.doc.nodesBetween(t,n,(e,a,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,t),d=Math.min(a+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=d:s.push(o=new cl(c,d,u[e])));i&&i.to==c?i.to=d:l.push(i=new al(c,d,r))}}),s.forEach(t=>e.step(t)),l.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(e,s)=>{if(!e.isInline)return;i++;let l=null;if(r instanceof _s){let t,n=e.marks;for(;t=r.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(l=[r]):l=e.marks;if(l&&l.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<l.length;e++){let n,a=l[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&a.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:a,from:Math.max(s,t),to:r,step:i})}}}),o.forEach(t=>e.step(new cl(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return ml(this,e,t,n),this}}const Fl=Object.create(null);class jl{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Ul(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Xi.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:l,$to:a}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(a.pos),s?Xi.empty:t),0==s&&Ql(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],l=e.mapping.slice(n),a=l.map(i.pos),c=l.map(s.pos);o?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),Ql(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Hl(e):Zl(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?Zl(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Zl(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Yl(e.node(0))}static atStart(e){return Zl(e,e,0,0,1)||new Yl(e)}static atEnd(e){return Zl(e,e,e.content.size,e.childCount,-1)||new Yl(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Fl[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Fl)throw new RangeError("Duplicate use of selection JSON ID "+e);return Fl[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Hl.between(this.$anchor,this.$head).getBookmark()}}jl.prototype.visible=!0;class Ul{constructor(e,t){this.$from=e,this.$to=t}}let Wl=!1;function Gl(e){Wl||e.parent.inlineContent||(Wl=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Hl extends jl{constructor(e,t=e){Gl(e),Gl(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return jl.near(n);let r=e.resolve(t.map(this.anchor));return new Hl(r.parent.inlineContent?r:n,n)}replace(e,t=Xi.empty){if(super.replace(e,t),t==Xi.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Hl&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ql(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Hl(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=jl.findFrom(t,n,!0)||jl.findFrom(t,-n,!0);if(!e)return jl.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(jl.findFrom(e,-n,!0)||jl.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new Hl(e,t)}}jl.jsonID("text",Hl);class ql{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ql(e.map(this.anchor),e.map(this.head))}resolve(e){return Hl.between(e.resolve(this.anchor),e.resolve(this.head))}}class Jl extends jl{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?jl.near(o):new Jl(o)}content(){return new Xi(Gi.from(this.node),0,0)}eq(e){return e instanceof Jl&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Kl(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Jl(e.resolve(t.anchor))}static create(e,t){return new Jl(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Jl.prototype.visible=!1,jl.jsonID("node",Jl);class Kl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new ql(n,n):new Kl(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Jl.isSelectable(n)?new Jl(t):jl.near(t)}}class Yl extends jl{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Xi.empty){if(t==Xi.empty){e.delete(0,e.doc.content.size);let t=jl.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Yl(e)}map(e){return new Yl(e)}eq(e){return e instanceof Yl}getBookmark(){return Xl}}jl.jsonID("all",Yl);const Xl={map(){return this},resolve(e){return new Yl(e)}};function Zl(e,t,n,r,o,i=!1){if(t.inlineContent)return Hl.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&Jl.isSelectable(r))return Jl.create(e,n-(o<0?r.nodeSize:0))}else{let t=Zl(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function Ql(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof pl||i instanceof hl)&&(e.mapping.maps[r].forEach((e,t,n,r)=>{null==o&&(o=r)}),e.setSelection(jl.near(e.doc.resolve(o),n)))}class ea extends Ll{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Ki.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ki.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(jl.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function ta(e,t){return t&&e?e.bind(t):e}class na{constructor(e,t,n){this.name=e,this.init=ta(t.init,n),this.apply=ta(t.apply,n)}}const ra=[new na("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new na("selection",{init(e,t){return e.selection||jl.atStart(t.doc)},apply(e){return e.selection}}),new na("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new na("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class oa{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ra.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new na(e.key,e.spec.state,e))})}}class ia{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let l=r?r[i].n:0,a=r?r[i].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new ia(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new ea(this)}static create(e){let t=new oa(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new ia(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new oa(this.schema,e.plugins),n=t.fields,r=new ia(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new oa(e.schema,e.plugins),o=new ia(r);return r.fields.forEach(r=>{if("doc"==r.name)o.doc=gs.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=jl.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=l.fromJSON.call(s,e,t[i],o))}o[r.name]=r.init(e,o)}}),o}}function sa(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=sa(o,t,{})),n[r]=o}return n}class la{constructor(e){this.spec=e,this.props={},e.props&&sa(e.props,this,this.props),this.key=e.key?e.key.key:ca("plugin")}getState(e){return e[this.key]}}const aa=Object.create(null);function ca(e){return e in aa?e+"$"+ ++aa[e]:(aa[e]=0,e+"$")}class ua{constructor(e="key"){this.key=ca(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const da=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function pa(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const ha=(e,t,n)=>{let r=pa(e,n);if(!r)return!1;let o=ya(r);if(!o){let n=r.blockRange(),o=n&&yl(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(Oa(e,o,t,-1))return!0;if(0==r.parent.content.size&&(ma(i,"end")||Jl.isSelectable(i)))for(let n=r.depth;;n--){let s=Tl(e.doc,r.before(n),r.after(n),Xi.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(ma(i,"end")?jl.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):Jl.create(n.doc,o.pos-i.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))};function fa(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let i=t.nodeAfter,s=t.pos+1;for(;!i.isTextblock;s++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let l=Tl(e.doc,o,s,Xi.empty);if(!l||l.from!=o||l instanceof pl&&l.slice.size>=s-o)return!1;if(n){let t=e.tr.step(l);t.setSelection(Hl.create(t.doc,o)),n(t.scrollIntoView())}return!0}function ma(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const ga=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=ya(r)}let s=i&&i.nodeBefore;return!(!s||!Jl.isSelectable(s)||(t&&t(e.tr.setSelection(Jl.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),0))};function ya(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function ba(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const va=(e,t,n)=>{let r=ba(e,n);if(!r)return!1;let o=xa(r);if(!o)return!1;let i=o.nodeAfter;if(Oa(e,o,t,1))return!0;if(0==r.parent.content.size&&(ma(i,"start")||Jl.isSelectable(i))){let n=Tl(e.doc,r.before(),r.after(),Xi.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(ma(i,"start")?jl.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Jl.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))},wa=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=xa(r)}let s=i&&i.nodeAfter;return!(!s||!Jl.isSelectable(s)||(t&&t(e.tr.setSelection(Jl.create(e.doc,i.pos)).scrollIntoView()),0))};function xa(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const Ea=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))};function ka(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Sa=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=ka(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(jl.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},Ca=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof Yl||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=ka(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(Hl.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},Ta=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(El(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&yl(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};var Ma;function Oa(e,t,n,r){let o,i,s=t.nodeBefore,l=t.nodeAfter,a=s.type.spec.isolating||l.type.spec.isolating;if(!a&&function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!kl(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!a&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(l.type))&&i.matchType(o[0]||l.type).validEnd){if(n){let r=t.pos+l.nodeSize,i=Gi.empty;for(let e=o.length-1;e>=0;e--)i=Gi.from(o[e].create(null,i));i=Gi.from(s.copy(i));let a=e.tr.step(new hl(t.pos-1,r,t.pos,r,new Xi(i,1,0),o.length,!0)),c=a.doc.resolve(r+2*o.length);c.nodeAfter&&c.nodeAfter.type==s.type&&kl(a.doc,c.pos)&&a.join(c.pos),n(a.scrollIntoView())}return!0}let u=l.type.spec.isolating||r>0&&a?null:jl.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),p=d&&yl(d);if(null!=p&&p>=t.depth)return n&&n(e.tr.lift(d,p).scrollIntoView()),!0;if(c&&ma(l,"start",!0)&&ma(s,"end")){let r=s,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=l,a=1;for(;!i.isTextblock;i=i.firstChild)a++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=Gi.empty;for(let e=o.length-1;e>=0;e--)r=Gi.from(o[e].copy(r));n(e.tr.step(new hl(t.pos-o.length,t.pos+l.nodeSize,t.pos+a,t.pos+l.nodeSize-a,new Xi(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Ia(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(Hl.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const Pa=Ia(-1),Na=Ia(1);function Da(e,t=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(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}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,e,t)}r(o.scrollIntoView())}return!0}}function Aa(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let _a=Aa(da,ha,ga),za=Aa(da,va,wa);const Ra={Enter:Aa(Ea,Ca,Ta,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Jl&&e.selection.node.isBlock)return!(!n.parentOffset||!El(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let o,i,s=[],l=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){l=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),i=ka(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));let t=Ma;s.unshift(t||(l&&i?{type:i}:null)),o=e;break}if(1==e)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof Hl||e.selection instanceof Yl)&&c.deleteSelection();let u=c.mapping.map(n.pos),d=El(c.doc,u,s.length,s);if(d||(s[0]=i?{type:i}:null,d=El(c.doc,u,s.length,s)),!d)return!1;if(c.split(u,s.length,s),!l&&a&&n.node(o).type!=i){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);i&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,i)&&c.setNodeMarkup(c.mapping.map(n.before(o)),i)}return t&&t(c.scrollIntoView()),!0}),"Mod-Enter":Sa,Backspace:_a,"Mod-Backspace":_a,"Shift-Backspace":_a,Delete:za,"Mod-Delete":za,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Yl(e.doc))),!0)},$a={"Ctrl-h":Ra.Backspace,"Alt-Backspace":Ra["Mod-Backspace"],"Ctrl-d":Ra.Delete,"Ctrl-Alt-Backspace":Ra["Mod-Delete"],"Alt-Delete":Ra["Mod-Delete"],"Alt-d":Ra["Mod-Delete"],"Ctrl-a":Pa,"Ctrl-e":Na};for(let e in Ra)$a[e]=Ra[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();const Ba=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Va=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let La=null;const Fa=function(e,t,n){let r=La||(La=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},ja=function(e,t,n,r){return n&&(Wa(e,t,n,r,-1)||Wa(e,t,n,r,1))},Ua=/^(img|br|input|textarea|hr)$/i;function Wa(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Ga(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Ha(e)||Ua.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Ba(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(i=n.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;t+=o}else e=n,t=o<0?Ga(e):0}}}}function Ga(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ha(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const qa=function(e){return e.focusNode&&ja(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ja(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Ka="undefined"!=typeof navigator?navigator:null,Ya="undefined"!=typeof document?document:null,Xa=Ka&&Ka.userAgent||"",Za=/Edge\/(\d+)/.exec(Xa),Qa=/MSIE \d/.exec(Xa),ec=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xa),tc=!!(Qa||ec||Za),nc=Qa?document.documentMode:ec?+ec[1]:Za?+Za[1]:0,rc=!tc&&/gecko\/(\d+)/i.test(Xa);rc&&(/Firefox\/(\d+)/.exec(Xa)||[0,0])[1];const oc=!tc&&/Chrome\/(\d+)/.exec(Xa),ic=!!oc,sc=oc?+oc[1]:0,lc=!tc&&!!Ka&&/Apple Computer/.test(Ka.vendor),ac=lc&&(/Mobile\/\w+/.test(Xa)||!!Ka&&Ka.maxTouchPoints>2),cc=ac||!!Ka&&/Mac/.test(Ka.platform),uc=!!Ka&&/Win/.test(Ka.platform),dc=/Android \d/.test(Xa),pc=!!Ya&&"webkitFontSmoothing"in Ya.documentElement.style,hc=pc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function fc(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function mc(e,t){return"number"==typeof e?e:e[t]}function gc(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function yc(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=Va(s);continue}let e=s,n=e==i.body,l=n?fc(i):gc(e),a=0,c=0;if(t.top<l.top+mc(r,"top")?c=-(l.top-t.top+mc(o,"top")):t.bottom>l.bottom-mc(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+mc(o,"top")-l.top:t.bottom-l.bottom+mc(o,"bottom")),t.left<l.left+mc(r,"left")?a=-(l.left-t.left+mc(o,"left")):t.right>l.right-mc(r,"right")&&(a=t.right-l.right+mc(o,"right")),a||c)if(n)i.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let u=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(u))break;s="absolute"==u?s.offsetParent:Va(s)}}function bc(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Va(r));return t}function vc(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let wc=null;function xc(e,t){let n,r,o,i,s=2e8,l=0,a=t.top,c=t.top;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(1==u.nodeType)e=u.getClientRects();else{if(3!=u.nodeType)continue;e=Fa(u).getClientRects()}for(let p=0;p<e.length;p++){let h=e[p];if(h.top<=a&&h.bottom>=c){a=Math.max(h.bottom,a),c=Math.min(h.top,c);let e=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(e<s){n=u,s=e,r=e&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==u.nodeType&&e&&(l=d+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!o&&h.left<=t.left&&h.right>=t.left&&(o=u,i={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(l=d+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=Tc(r,1);if(n.top!=n.bottom&&Ec(t,n))return{node:e,offset:o+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:l}:xc(n,r)}function Ec(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function kc(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(Ec(t,o))return kc(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function Sc(e,t){let n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Ga(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Ga(r.startContainer),r.startOffset)}}}(r,t.left,t.top);i&&({node:n,offset:o}=i);let s,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=e.dom.getBoundingClientRect();if(!Ec(t,n))return null;if(l=kc(e.dom,t,n),!l)return null}if(lc)for(let e=l;n&&e;e=Va(e))e.draggable&&(n=void 0);if(l=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(rc&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}let r;pc&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t,s=e.docView.nearestDesc(n,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((t=s.dom.getBoundingClientRect()).width||t.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!i&&t.left>r.left||t.top>r.top?o=s.posBefore:(!i&&t.right<r.left||t.bottom<r.top)&&(o=s.posAfter),i=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2)?s.posBefore:s.posAfter;n=s.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=xc(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,l,t));let a=e.docView.nearestDesc(l,!0);return{pos:s,inside:a?a.posAtStart-a.border:-1}}function Cc(e){return e.top<e.bottom||e.left<e.right}function Tc(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Cc(e))return e}return Array.prototype.find.call(n,Cc)||e.getBoundingClientRect()}const Mc=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Oc(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=pc||rc;if(3==r.nodeType){if(!s||!Mc.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,Ic(Tc(Fa(r,e,t),i),i<0)}{let e=Tc(Fa(r,o,o),n);if(rc&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=Tc(Fa(r,o-1,o-1),-1);if(t.top==e.top){let n=Tc(Fa(r,o,o+1),-1);if(n.top!=e.top)return Ic(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==Ga(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return Pc(e.getBoundingClientRect(),!1)}if(null==i&&o<Ga(r)){let e=r.childNodes[o];if(1==e.nodeType)return Pc(e.getBoundingClientRect(),!0)}return Pc(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==Ga(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Fa(e,Ga(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Ic(Tc(t,1),!1)}if(null==i&&o<Ga(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Fa(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Ic(Tc(t,-1),!0)}return Ic(Tc(3==r.nodeType?Fa(r):r,-n),n>=0)}function Ic(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Pc(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Nc(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const Dc=/[\u0590-\u08ac]/;let Ac=null,_c=null,zc=!1;class Rc{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Ba(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let o=this.children[n],i=t+o.size;if(i>e||o instanceof Uc){r=e-t;break}t=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof $c&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Ba(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Ba(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],l=i+n.size;if(-1==r&&e<=l){let o=i+n.border;if(e>=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Ba(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=Ba(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],c=l+a.size;if(o>l&&i<c)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=c}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),c=n.domSelectionRange(),u=!1;if((rc||lc)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=l={node:t.parentNode,offset:Ba(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(rc&&c.focusNode&&c.focusNode!=l.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&lc)&&ja(s.node,s.offset,c.anchorNode,c.anchorOffset)&&ja(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((a.extend||e==t)&&(!u||!rc)){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),d=!0}catch(e){}}if(!d){if(e>t){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class $c extends Rc{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Bc extends Rc{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Vc extends Rc{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=qs.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Vc(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=Vc.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=nu(o,t,i,n)),e>0&&(o=nu(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Lc extends Rc{constructor(e,t,n,r,o,i,s,l,a){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,o,i){let s,l=o.nodeViews[t.type.name],a=l&&l(t,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i,n,r),c=a&&a.dom,u=a&&a.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=qs.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:u}=e)}u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=Xc(c,n,t),a?s=new Wc(e,t,n,r,c,u||null,d,a,o,i+1):t.isText?new jc(e,t,n,r,c,d,o):new Lc(e,t,n,r,c,u||null,d,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Gi.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Zc(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new eu(this,i&&i.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let u,d,p,h;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(u?(d||(d=[u])).push(e):u=e)}if(u)if(d){d.sort(tu);for(let e=0;e<d.length;e++)n(d[e],c,!!a)}else n(u,c,!!a);if(a)h=-1,p=a,a=null;else{if(!(c<e.childCount))break;h=c,p=e.child(c++)}for(let e=0;e<l.length;e++)l[e].to<=i&&l.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let f=i+p.nodeSize;if(p.isText){let e=f;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=p.cut(e-i),p=p.cut(0,e-i),f=e,h=-1)}else for(;s<o.length&&o[s].to<f;)s++;r(p,p.isInline&&!p.isLeaf?l.filter(e=>!e.inline):l.slice(),t.forChild(i,p),h),i=f}}(this.node,this.innerDeco,(t,o,i)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!i&&l.syncToMarks(o==this.node.childCount?Ki.none:this.node.child(o).marks,n,e),l.placeWidget(t,e,r)},(t,i,a,c)=>{let u;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,i,a,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(t,i,a,u,e)||l.updateNextNode(t,i,a,e,c,r)||l.addNode(t,i,a,e,r),r+=t.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),Gc(this.contentDOM,this.children,e),ac&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Hl)||n<t||r>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;a+=t.text}if(i>=n){if(i>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Bc(this,o,t,r);e.input.compositionNodes.push(i),this.children=nu(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Zc(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Kc(this.dom,this.nodeDOM,Jc(this.outerDeco,this.node,t),Jc(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Fc(e,t,n,r,o){Xc(r,t,e);let i=new Lc(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class jc extends Lc{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new jc(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Uc extends Rc{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Wc extends Lc{constructor(e,t,n,r,o,i,s,l,a,c){super(e,t,n,r,o,i,s,a,c),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Gc(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],l=s.dom;if(l.parentNode==e){for(;l!=r;)r=Qc(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(l,r);if(s instanceof Vc){let t=r?r.previousSibling:e.lastChild;Gc(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Qc(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Hc=function(e){e&&(this.nodeName=e)};Hc.prototype=Object.create(null);const qc=[new Hc];function Jc(e,t,n){if(0==e.length)return qc;let r=n?qc[0]:new Hc,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new Hc(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new Hc(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function Kc(e,t,n,r){if(n==qc&&r==qc)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=qc[0]),o=t}Yc(o,s||qc[0],i)}return o}function Yc(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Xc(e,t,n){return Kc(e,e,qc,Jc(t,n,1!=e.nodeType))}function Zc(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Qc(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class eu{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Vc)){l=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=e.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,o=this.stack.length>>1,i=Math.min(o,e.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Vc.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof Lc){let a=this.preMatch.matched.get(l);if(null!=a&&a!=o)return!1;let c,u=l.dom,d=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&Zc(t,l.outerDeco));if(!d&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(c=this.recreateWrapper(l,e,t,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Zc(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=Lc.create(this.top,t,n,r,o,i);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,o){let i=Lc.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new $c(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Vc;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof jc)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((lc||ic)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Uc(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function tu(e,t){return e.type.side-t.type.side}function nu(e,t,n,r,o){let i=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,u=l+=a.size;c>=n||u<=t?i.push(a):(c<t&&i.push(a.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function ru(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l,a,c=r.resolve(s);if(qa(n)){for(l=s;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Jl.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==Ga(e);r||o;){if(e==n)return!0;let t=Ba(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==Ga(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;a=new Jl(s==e?c:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[l,s]=o==e.state.selection.anchor?[o,t]:[t,o],c=r.resolve(s)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);return a||(a=pu(e,u,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)),a}function ou(e){return e.editable?e.hasFocus():fu(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function iu(e,t=!1){let n=e.state.selection;if(uu(e,n),ou(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&ic){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&ja(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,Ba(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&tc&&nc<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let r,o,{anchor:i,head:s}=n;!su||n instanceof Hl||(n.$from.parent.inlineContent||(r=lu(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=lu(e,n.to))),e.docView.setSelection(i,s,e,t),su&&(r&&cu(r),o&&cu(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{ou(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const su=lc||ic&&sc<63;function lu(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(lc&&o&&"false"==o.contentEditable)return au(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return au(o);if(i)return au(i)}}function au(e){return e.contentEditable="true",lc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function cu(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function uu(e,t){if(t instanceof Jl){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(du(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else du(e)}function du(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function pu(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||Hl.between(t,n,r)}function hu(e){return!(e.editable&&!e.hasFocus())&&fu(e)}function fu(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function mu(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&jl.findFrom(i,t)}function gu(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function yu(e,t,n){let r=e.state.selection;if(!(r instanceof Hl)){if(r instanceof Jl&&r.node.isInline)return gu(e,new Hl(t>0?r.$to:r.$from));{let n=mu(e.state,t);return!!n&&gu(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return gu(e,new Hl(r.$anchor,i))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=mu(e.state,t);return!!(n&&n instanceof Jl)&&gu(e,n)}if(!(cc&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Jl.isSelectable(i)?gu(e,new Jl(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!pc&&gu(e,new Hl(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function bu(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function vu(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function wu(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(rc&&1==n.nodeType&&r<bu(n)&&vu(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(vu(e,-1))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(xu(n))break;{let t=n.previousSibling;for(;t&&vu(t,-1);)o=n.parentNode,i=Ba(t),t=t.previousSibling;if(t)n=t,r=bu(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Eu(e,n,r):o&&Eu(e,o,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=bu(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!vu(n.childNodes[r],1))break;o=n,i=++r}else{if(xu(n))break;{let t=n.nextSibling;for(;t&&vu(t,1);)o=t.parentNode,i=Ba(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=bu(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&Eu(e,o,i)}(e)}function xu(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Eu(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Ha(e);)t=Ba(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Ha(e);)t=Ba(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(qa(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&iu(e)},50)}function ku(e,t){let n=e.state.doc.resolve(t);if(!ic&&!uc&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Su(e,t,n){let r=e.state.selection;if(r instanceof Hl&&!r.empty||n.indexOf("s")>-1)return!1;if(cc&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=mu(e.state,t);if(n&&n instanceof Jl)return gu(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof Yl?jl.near(n,t):jl.findFrom(n,t);return!!s&&gu(e,s)}return!1}function Cu(e,t){if(!(e.state.selection instanceof Hl))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function Tu(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Mu(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||qs.fromSchema(e.state.schema),l=$u(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c,u=a.firstChild,d=0;for(;u&&1==u.nodeType&&(c=zu[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),d++}u=a.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function Ou(e,t,n,r,o){let i,s,l=o.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(r||l||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,l||r,e)}),l)return s=new Xi(Gi.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let n=e.someProp("clipboardTextParser",n=>n(t,o,r,e));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=qs.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=$u().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);if((n=o&&zu[o[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join("")),r.innerHTML=function(e){let t=window.trustedTypes;return t?(Bu||(Bu=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),Bu.createHTML(e)):e}(e),n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),pc&&function(e){let t=e.querySelectorAll(ic?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0;e--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||$s.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!a&&!u),context:o,ruleFromNode(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Iu.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(u)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:i,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=Gi.from(t.create(n[e+1],o)),i++,s++}return new Xi(o,i,s)}(_u(s,+u[1],+u[2]),u[4]);else if(s=Xi.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach(e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&Nu(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Du(i[i.length-1],r.length));let t=Pu(e,n);i.push(t),o=o.matchType(t.type),r=n}}),i)return Gi.from(i)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=_u(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,a)}),s}const Iu=/^(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 Pu(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Gi.from(e));return e}function Nu(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=Nu(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(Gi.from(Pu(n,e,o+1))))}}function Du(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Du(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Gi.empty,!0);return e.copy(n.append(r))}function Au(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,l=s.content;return e.childCount>1&&(i=0),o<r-1&&(l=Au(l,t,n,r,o+1,i)),o>=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(Gi.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function _u(e,t,n){return t<e.openStart&&(e=new Xi(Au(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Xi(Au(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const zu={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 Ru=null;function $u(){return Ru||(Ru=document.implementation.createHTMLDocument("title"))}let Bu=null;const Vu={},Lu={},Fu={touchstart:!0,touchmove:!0};class ju{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Uu(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Wu(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Gu(e,t))})}function Gu(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function Hu(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function qu(e){return{left:e.clientX,top:e.clientY}}function Ju(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)))return!0;return!1}function Ku(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Yu(e,t,n,r){return Ju(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}function Xu(e,t,n,r){return Ju(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Ku(e,Hl.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(n.inlineContent)Ku(e,Hl.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Jl.isSelectable(n))continue;Ku(e,Jl.create(r,i),"pointer")}return!0}}(e,n,r)}function Zu(e){return id(e)}Lu.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!td(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!dc||!ic||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!ac||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||function(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||cc&&72==n&&"c"==r)return Cu(e,-1)||wu(e,-1);if(46==n&&!t.shiftKey||cc&&68==n&&"c"==r)return Cu(e,1)||wu(e,1);if(13==n||27==n)return!0;if(37==n||cc&&66==n&&"c"==r){let t=37==n?"ltr"==ku(e,e.state.selection.from)?-1:1:-1;return yu(e,t,r)||wu(e,t)}if(39==n||cc&&70==n&&"c"==r){let t=39==n?"ltr"==ku(e,e.state.selection.from)?1:-1:1;return yu(e,t,r)||wu(e,t)}return 38==n||cc&&80==n&&"c"==r?Su(e,-1,r)||wu(e,-1):40==n||cc&&78==n&&"c"==r?function(e){if(!lc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Tu(e,n,"true"),setTimeout(()=>Tu(e,n,"false"),20)}return!1}(e)||Su(e,1,r)||wu(e,1):r==(cc?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():Uu(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,Ja(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},Lu.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Lu.keypress=(e,t)=>{let n=t;if(td(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||cc&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Hl&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,r.$from.pos,r.$to.pos,t,o))||e.dispatch(o()),n.preventDefault()}};const Qu=cc?"metaKey":"ctrlKey";Vu.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Zu(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Qu]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=e.posAtCoords(qu(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ed(e,s,n,!!r)):("doubleClick"==i?Yu:Xu)(e,s.pos,s.inside,n)?n.preventDefault():Uu(e,"pointer"))};class ed{constructor(e,t,n,r){let o,i;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Qu],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.nodeDOM.nodeType?l.nodeDOM:null;let{selection:a}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||a instanceof Jl&&a.from<=i&&a.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!rc||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Uu(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>iu(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(qu(e))),this.updateAllowDefault(e),this.allowDefault||!t?Uu(this.view,"pointer"):function(e,t,n,r,o){return Ju(e,"handleClickOn",t,n,r)||e.someProp("handleClick",n=>n(e,t,r))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof Jl&&(n=o.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(Jl.isSelectable(t)){r=n&&o.$from.depth>0&&e>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(e);break}}return null!=r&&(Ku(e,Jl.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Jl.isSelectable(r))&&(Ku(e,new Jl(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||lc&&this.mightDrag&&!this.mightDrag.node.isAtom||ic&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ku(this.view,jl.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Uu(this.view,"pointer")}move(e){this.updateAllowDefault(e),Uu(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function td(e,t){return!!e.composing||!!(lc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Vu.touchstart=e=>{e.input.lastTouch=Date.now(),Zu(e),Uu(e,"pointer")},Vu.touchmove=e=>{e.input.lastTouch=Date.now(),Uu(e,"pointer")},Vu.contextmenu=e=>Zu(e);const nd=dc?5e3:-1;function rd(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>id(e),t))}function od(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function id(e,t=!1){if(!(dc&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),od(e),t||e.docView&&e.docView.dirty){let n=ru(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}Lu.compositionstart=Lu.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Hl&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)))e.markCursor=e.state.storedMarks||n.marks(),id(e,!0),e.markCursor=null;else if(id(e,!t.selection.empty),rc&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}rd(e,nd)},Lu.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,rd(e,20))};const sd=tc&&nc<15||ac&&hc<604;function ld(e,t,n,r,o){let i=Ou(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,i||Xi.empty)))return!0;if(!i)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ad(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Vu.copy=Lu.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=sd?null:n.clipboardData,s=r.content(),{dom:l,text:a}=Mu(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,l),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Lu.paste=(e,t)=>{let n=t;if(e.composing&&!dc)return;let r=sd?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&ld(e,ad(r),r.getData("text/html"),o,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ld(e,r.value,null,o,t):ld(e,r.textContent,r.innerHTML,o,t)},50)}(e,n)};class cd{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const ud=cc?"altKey":"ctrlKey";function dd(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[ud]}Vu.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=e.state.selection,s=i.empty?null:e.posAtCoords(qu(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof Jl?i.to-1:i.to));else if(r&&r.mightDrag)o=Jl.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Jl.create(e.state.doc,t.posBefore))}let l=(o||e.state.selection).content(),{dom:a,text:c,slice:u}=Mu(e,l);(!n.dataTransfer.files.length||!ic||sc>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(sd?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",sd||n.dataTransfer.setData("text/plain",c),e.dragging=new cd(u,dd(e,n),o)},Vu.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Lu.dragover=Lu.dragenter=(e,t)=>t.preventDefault(),Lu.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(qu(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",t=>{s=t(s,e,!1)}):s=Ou(e,ad(n.dataTransfer),sd?null:n.dataTransfer.getData("text/html"),!1,i);let l=!(!r||!dd(e,n));if(e.someProp("handleDrop",t=>t(e,n,s||Xi.empty,l)))return void n.preventDefault();if(!s)return;n.preventDefault();let a=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+(n>0?1:0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);l=e&&s.canReplaceWith(i,i,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}(e.state.doc,i.pos,s):i.pos;null==a&&(a=i.pos);let c=e.state.tr;if(l){let{node:e}=r;e?e.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let h=c.doc.resolve(u);if(d&&Jl.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Jl(h));else{let t=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),c.setSelection(pu(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Vu.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&iu(e)},20))},Vu.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Vu.beforeinput=(e,t)=>{if(ic&&dc&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,Ja(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Lu)Vu[e]=Lu[e];function pd(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class hd{constructor(e,t){this.toDOM=e,this.spec=t||bd,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new gd(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof hd&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&pd(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class fd{constructor(e,t){this.attrs=e,this.spec=t||bd}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new gd(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof fd&&pd(this.attrs,e.attrs)&&pd(this.spec,e.spec)}static is(e){return e.type instanceof fd}destroy(){}}class md{constructor(e,t){this.attrs=e,this.spec=t||bd}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new gd(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof md&&pd(this.attrs,e.attrs)&&pd(this.spec,e.spec)}destroy(){}}class gd{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new gd(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new gd(e,e,new hd(t,n))}static inline(e,t,n,r){return new gd(e,t,new fd(n,r))}static node(e,t,n,r){return new gd(e,t,new md(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof fd}get widget(){return this.type instanceof hd}}const yd=[],bd={};class vd{constructor(e,t){this.local=e.length?e:yd,this.children=t.length?t:yd}static create(e,t){return t.length?Cd(t,e,0,bd):wd}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==wd||0==e.maps.length?this:this.mapInner(e,t,0,0,n||bd)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(i||(i=[])).push(l):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let l=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,o,i)=>{let s=i-o-(n-e);for(let o=0;o<l.length;o+=3){let i=l[o+1];if(i<0||e>i+t-r)continue;let a=l[o]+t-r;n>=a?l[o+1]=e<=a?-2:-1:e>=t&&s&&(l[o]+=s,l[o+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let c=n.map(e[t]+i),u=c-o;if(u<0||u>=r.content.size){a=!0;continue}let d=n.map(e[t+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=l[t+2].mapInner(n,f,c+1,e[t]+i+1,s);r!=wd?(l[t]=u,l[t+1]=d,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=function(e,t,n,r,o,i,s){function l(e,t){for(let i=0;i<e.local.length;i++){let l=e.local[i].map(r,o,t);l?n.push(l):s.onRemove&&s.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&l(e[n+2],t[n]+i+1);return n}(l,e,t,n,o,i,s),c=Cd(a,r,0,s);t=c.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new vd(t.sort(Td),l)}(this.children,i||[],e,t,n,r,o):i?new vd(i.sort(Td),yd):wd}add(e,t){return t.length?this==wd?vd.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach((e,i)=>{let s,l=i+n;if(s=kd(t,e,l)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,l+1):r.splice(o,0,i,i+e.nodeSize,Cd(s,e,l+1,bd)),o+=3}});let i=Ed(o?Sd(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new vd(i.length?this.local.concat(i).sort(Td):this.local,r||this.children)}remove(e){return 0==e.length||this==wd?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(o,i+1);l!=wd?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new vd(r,n):wd}forChild(e,t){if(this==wd)return this;if(t.isLeaf)return vd.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof fd){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new vd(r.sort(Td),yd);return n?new xd([e,n]):e}return n||wd}eq(e){if(this==e)return!0;if(!(e instanceof vd)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Md(this.localsInner(e))}localsInner(e){if(this==wd)return yd;if(e.inlineContent||!this.local.some(fd.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof fd||t.push(this.local[e]);return t}forEachSet(e){e(this)}}vd.empty=new vd([],[]),vd.removeOverlap=Md;const wd=vd.empty;class xd{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,bd));return xd.from(n)}forChild(e,t){if(t.isLeaf)return vd.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=wd&&(o instanceof xd?n=n.concat(o.members):n.push(o))}return xd.from(n)}eq(e){if(!(e instanceof xd)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?Md(n?t:t.sort(Td)):yd}static from(e){switch(e.length){case 0:return wd;case 1:return e[0];default:return new xd(e.every(e=>e instanceof vd)?e:e.reduce((e,t)=>e.concat(t instanceof vd?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Ed(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new gd(o.from+t,o.to+t,o.type))}return n}function kd(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function Sd(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Cd(e,t,n,r){let o=[],i=!1;t.forEach((t,s)=>{let l=kd(e,t,s+n);if(l){i=!0;let e=Cd(l,t,n+s+1,r);e!=wd&&o.push(s,s+t.nodeSize,e)}});let s=Ed(i?Sd(e):e,-n).sort(Td);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new vd(s,o):wd}function Td(e,t){return e.from-t.from||e.to-t.to}function Md(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Od(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Od(t,o+1,i.copy(r.to,i.to)))}}return t}function Od(e,t,n){for(;t<e.length&&Td(n,e[t])>0;)t++;e.splice(t,0,n)}function Id(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=wd&&t.push(r)}),e.cursorWrapper&&t.push(vd.create(e.state.doc,[e.cursorWrapper.deco])),xd.from(t)}const Pd={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Nd=tc&&nc<=11;class Dd{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Ad{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Dd,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);tc&&nc<=11&&e.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),Nd&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Pd)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(hu(this.view)){if(this.suppressingSelectionUpdates)return iu(this.view);if(tc&&nc<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ja(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=Va(t))n.add(t);for(let r=e.anchorNode;r;r=Va(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&hu(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,s=!1,l=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],l);n&&(o=o<0?n.from:Math.min(n.from,o),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(s=!0))}if(rc&&l.length){let t=l.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&$d(e,n)==t||r.remove()}}}let a=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&qa(n)&&(a=ru(e))&&a.eq(jl.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,iu(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(!_d.has(e)&&(_d.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=rc,zd)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),zd=!0}}(e)),this.handleDOMChange(o,i,s,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||iu(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(tc&&nc<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?Ba(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?Ba(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let _d=new WeakMap,zd=!1;function Rd(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return ja(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function $d(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Bd(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(lc&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||lc&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Vd=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ld(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:pu(e,t.resolve(n.anchor),t.resolve(n.head))}function Fd(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function jd(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Ud{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ju,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Jd),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Hd(this),Gd(this),this.nodeViews=qd(this),this.docView=Fc(this.state.doc,Wd(this),Id(this),this.dom,this),this.domObserver=new Ad(this,(e,t,n,r)=>function(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ru(e,t);if(n&&!e.state.selection.eq(n)){if(ic&&dc&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,Ja(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),i&&r.setMeta("composition",i),e.dispatch(r)}return}let s=e.state.doc.resolve(t),l=s.sharedDepth(n);t=s.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a,c,u=e.state.selection,d=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],qa(c)||r.push({node:c.focusNode,offset:c.focusOffset})),ic&&8===e.input.lastKeyCode)for(let e=s;e>i;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let d=e.state.doc,p=e.someProp("domParser")||$s.fromSchema(e.state.schema),h=d.resolve(l),f=null,m=p.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Bd,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,n),p=e.state.doc,h=p.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,c="end"):(a=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o&&(r-=s+Math.max(0,i-Math.min(s,l))-i),s<i&&e.size<t.size){let e=r<=i&&r>=s?i-r:0;i-=e,i&&i<t.size&&jd(t.textBetween(i-1,i+1))&&(i+=e?1:-1),l=i+(l-s),s=i}else if(l<i){let t=r<=i&&r>=l?i-r:0;i-=t,i&&i<e.size&&jd(e.textBetween(i-1,i+1))&&(i+=t?1:-1),s=i+(s-l),l=i}return{start:i,endA:s,endB:l}}(h.content,d.doc.content,d.from,a,c);if(f&&e.input.domChangeCount++,(ac&&e.input.lastIOSEnter>Date.now()-225||dc)&&o.some(e=>1==e.nodeType&&!Vd.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,Ja(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&u instanceof Hl&&!u.empty&&u.$head.sameParent(u.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let t=Ld(e,e.state.doc,d.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}f={start:u.from,endA:u.to,endB:u.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Hl&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),tc&&nc<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>d.from&&"  "==d.doc.textBetween(f.start-d.from-1,f.start-d.from+1)&&(f.start--,f.endA--,f.endB--);let m=d.doc.resolveNoCache(f.start-d.from),g=d.doc.resolveNoCache(f.endB-d.from),y=p.resolve(f.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((ac&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!b&&m.pos<d.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(d.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,Ja(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||Fd(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(Fd(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Fd(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(p,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",t=>t(e,Ja(8,"Backspace"))))return void(dc&&ic&&e.domObserver.suppressSelectionUpdates());ic&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),dc&&!b&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==f.endA&&(f.endB-=2,g=d.doc.resolveNoCache(f.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,Ja(13,"Enter"))})},20));let v,w=f.start,x=f.endA,E=t=>{let n=t||e.state.tr.replace(w,x,d.doc.slice(f.start-d.from,f.endB-d.from));if(d.sel){let t=Ld(e,n.doc,d.sel);t&&!(ic&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==w||t.head==n.mapping.map(x)-1)||tc&&t.empty&&t.head==w)&&n.setSelection(t)}return i&&n.setMeta("composition",i),n.scrollIntoView()};if(b)if(m.pos==g.pos){tc&&nc<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>iu(e),20));let t=E(e.state.tr.delete(w,x)),n=p.resolve(f.start).marksAcross(p.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(v=function(e,t){let n,r,o,i=e.firstChild.marks,s=t.firstChild.marks,l=i,a=s;for(let e=0;e<s.length;e++)l=s[e].removeFromSet(l);for(let e=0;e<i.length;e++)a=i[e].removeFromSet(a);if(1==l.length&&0==a.length)r=l[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=a.length)return null;r=a[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(o(t.child(e)));if(Gi.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let t=E(e.state.tr);"add"==v.type?t.addMark(w,x,v.mark):t.removeMark(w,x,v.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>E(e.state.tr.insertText(t,w,x));e.someProp("handleTextInput",r=>r(e,w,x,t,n))||e.dispatch(n())}else e.dispatch(E());else e.dispatch(E())}(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in Vu){let n=Vu[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Hu(e,t)||Gu(e,t)||!e.editable&&t.type in Lu||n(e,t)},Fu[t]?{passive:!0}:void 0)}lc&&e.dom.addEventListener("input",()=>null),Wu(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Wu(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Jd),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(od(this),i=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=qd(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Wu(this),this.editable=Hd(this),Gd(this);let l=Id(this),a=Wd(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=o||!this.docView.matchesNode(e.doc,a,l);!u&&e.selection.eq(r.selection)||(i=!0);let d="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:bc(e.dom)}}(this);if(i){this.domObserver.stop();let t=u&&(tc||ic)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(u){let n=ic?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=Ga(e=e.childNodes[t-1])}else{if(!e.parentNode||Ha(e))return null;t=Ba(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||Ha(e))return null;t=Ba(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}(this)),!o&&this.docView.update(e.doc,a,l,this)||(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=Fc(e.doc,a,l,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return ja(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?iu(this,t):(uu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():d&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;vc(n,0==r?0:r-t)}(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof Jl){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&yc(this,t.getBoundingClientRect(),e)}else yc(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new cd(e.slice,e.move,r<0?void 0:Jl.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){if(tc){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(wc)return e.focus(wc);let t=bc(e);e.focus(null==wc?{get preventScroll(){return wc={preventScroll:!0},!0}}:void 0),wc||(wc=!1,vc(t,0))}(this.dom),iu(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}updateRoot(){this._root=null}posAtCoords(e){return Sc(this,e)}coordsAtPos(e,t=1){return Oc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){return Ac==t&&_c==n?zc:(Ac=t,_c=n,zc="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return Nc(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Oc(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Fa(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=e.domSelection();return l?Dc.test(r.parent.textContent)&&l.modify?Nc(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),p=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&o==d;try{l.collapse(i,s),t&&(t!=i||o!=s)&&l.extend&&l.extend(t,o)}catch(e){}return null!=a&&(l.caretBidiLevel=a),p}):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return ld(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ld(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Mu(this,e)}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Id(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,La=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Gu(e,t)||!Vu[t.type]||!e.editable&&t.type in Lu||Vu[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?lc&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Rd(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Rd(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Wd(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[gd.node(0,e.state.doc.content.size,t)]}function Gd(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:gd.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Hd(e){return!e.someProp("editable",t=>!1===t(e.state))}function qd(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Jd(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Ud.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var Kd={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:"'"},Yd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Xd="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Zd="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Qd=0;Qd<10;Qd++)Kd[48+Qd]=Kd[96+Qd]=String(Qd);for(Qd=1;Qd<=24;Qd++)Kd[Qd+111]="F"+Qd;for(Qd=65;Qd<=90;Qd++)Kd[Qd]=String.fromCharCode(Qd+32),Yd[Qd]=String.fromCharCode(Qd);for(var ep in Kd)Yd.hasOwnProperty(ep)||(Yd[ep]=Kd[ep]);const tp="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),np="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function rp(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);tp?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function op(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function ip(e){let t=function(e){let t=Object.create(null);for(let n in e)t[rp(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!(Xd&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Zd&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Yd:Kd)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=t[op(o,n)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[op(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(np&&n.ctrlKey&&n.altKey)&&(r=Kd[n.keyCode])&&r!=o){let o=t[op(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}var sp=Object.defineProperty,lp=(e,t)=>{for(var n in t)sp(e,n,{get:t[n],enumerable:!0})};function ap(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var cp=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],l=!!e,a=e||o.tr,c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{const r=this.buildProps(a,t),o=n(...e)(r);return s.push(o),c}])),run:()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(a),s.every(e=>!0===e))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:ap({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},up={};lp(up,{blur:()=>dp,clearContent:()=>pp,clearNodes:()=>hp,command:()=>fp,createParagraphNear:()=>mp,cut:()=>gp,deleteCurrentNode:()=>yp,deleteNode:()=>vp,deleteRange:()=>wp,deleteSelection:()=>xp,enter:()=>Ep,exitCode:()=>kp,extendMarkRange:()=>Pp,first:()=>Np,focus:()=>Rp,forEach:()=>$p,insertContent:()=>Bp,insertContentAt:()=>jp,joinBackward:()=>Gp,joinDown:()=>Wp,joinForward:()=>Hp,joinItemBackward:()=>qp,joinItemForward:()=>Jp,joinTextblockBackward:()=>Kp,joinTextblockForward:()=>Yp,joinUp:()=>Up,keyboardShortcut:()=>Zp,lift:()=>eh,liftEmptyBlock:()=>th,liftListItem:()=>nh,newlineInCode:()=>rh,resetAttributes:()=>sh,scrollIntoView:()=>lh,selectAll:()=>ah,selectNodeBackward:()=>ch,selectNodeForward:()=>uh,selectParentNode:()=>dh,selectTextblockEnd:()=>ph,selectTextblockStart:()=>hh,setContent:()=>mh,setMark:()=>Fh,setMeta:()=>jh,setNode:()=>Uh,setNodeSelection:()=>Wh,setTextDirection:()=>Gh,setTextSelection:()=>Hh,sinkListItem:()=>qh,splitBlock:()=>Kh,splitListItem:()=>Yh,toggleList:()=>Qh,toggleMark:()=>ef,toggleNode:()=>tf,toggleWrap:()=>nf,undoInputRule:()=>rf,unsetAllMarks:()=>of,unsetMark:()=>sf,unsetTextDirection:()=>lf,updateAttributes:()=>af,wrapIn:()=>cf,wrapInList:()=>uf});var dp=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),pp=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),hp=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return!n||(o.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),l=i.blockRange(s);if(!l)return;const a=yl(l);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(l.start,e)}(a||0===a)&&t.lift(l,a)})}),!0)},fp=e=>t=>e(t),mp=()=>({state:e,dispatch:t})=>Ca(e,t),gp=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new Hl(r.doc.resolve(Math.max(s-1,0)))),!0},yp=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1)if(o.node(n).type===r.type){if(t){const t=o.before(n),r=o.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function bp(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var vp=e=>({tr:t,state:n,dispatch:r})=>{const o=bp(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},wp=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},xp=()=>({state:e,dispatch:t})=>da(e,t),Ep=()=>({commands:e})=>e.keyboardShortcut("Enter"),kp=()=>({state:e,dispatch:t})=>Sa(e,t);function Sp(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Cp(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:Sp(t[r])?t[r].test(e[r]):t[r]===e[r])}function Tp(e,t,n={}){return e.find(e=>e.type===t&&Cp(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Mp(e,t,n={}){return!!Tp(e,t,n)}function Op(e,t,n){var r;if(!e||!t)return;let o=e.parent.childAfter(e.parentOffset);if(o.node&&o.node.marks.some(e=>e.type===t)||(o=e.parent.childBefore(e.parentOffset)),!o.node||!o.node.marks.some(e=>e.type===t))return;if(n=n||(null==(r=o.node.marks[0])?void 0:r.attrs),!Tp([...o.node.marks],t,n))return;let i=o.index,s=e.start()+o.offset,l=i+1,a=s+o.node.nodeSize;for(;i>0&&Mp([...e.parent.child(i-1).marks],t,n);)i-=1,s-=e.parent.child(i).nodeSize;for(;l<e.parent.childCount&&Mp([...e.parent.child(l).marks],t,n);)a+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function Ip(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var Pp=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const i=Ip(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:c,to:u}=l;if(o){const e=Op(a,i,t);if(e&&e.from<=c&&e.to>=u){const t=Hl.create(s,e.from,e.to);n.setSelection(t)}}return!0},Np=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function Dp(e){return e instanceof Hl}function Ap(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function _p(e,t=null){if(!t)return null;const n=jl.atStart(e),r=jl.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?Hl.create(e,Ap(0,o,i),Ap(e.content.size,o,i)):Hl.create(e,Ap(t,o,i),Ap(t,o,i))}function zp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Rp=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{(zp()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};if(r.hasFocus()&&null===e||!1===e)return!0;if(i&&null===e&&!Dp(n.state.selection))return s(),!0;const l=_p(o.doc,e)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},$p=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Bp=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Vp=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&Vp(r)}return e};function Lp(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return Vp(n)}function Fp(e,t,n){if(e instanceof gs||e instanceof Gi)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return Gi.fromArray(e.map(e=>t.nodeFromJSON(e)));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Fp("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,o="";const i=new zs({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?$s.fromSchema(i).parseSlice(Lp(e),n.parseOptions):$s.fromSchema(i).parse(Lp(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const r=$s.fromSchema(t);return n.slice?r.parseSlice(Lp(e),n.parseOptions).content:r.parse(Lp(e),n.parseOptions)}return Fp("",t,n)}var jp=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){let o;const l=e=>{i.emit("contentError",{editor:i,error:e,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},a={preserveWhitespace:"full",...(n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Fp(t,i.schema,{parseOptions:a,errorOnInvalidContent:!0})}catch(e){l(e)}try{o=Fp(t,i.schema,{parseOptions:a,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:i.options.enableContentCheck})}catch(e){return l(e),!1}let c,{from:u,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},p=!0,h=!0;if(("type"in o?[o]:o).forEach(e=>{e.check(),p=!!p&&e.isText&&0===e.marks.length,h=!!h&&e.isBlock}),u===d&&h){const{parent:e}=r.doc.resolve(u);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(u-=1,d+=1)}if(p){if(Array.isArray(t))c=t.map(e=>e.text||"").join("");else if(t instanceof Gi){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),c=e}else c="object"==typeof t&&t&&t.text?t.text:t;r.insertText(c,u,d)}else{c=o;const e=r.doc.resolve(u),t=e.node(),n=0===e.parentOffset,i=t.isText||t.isTextblock,s=t.content.size>0;n&&i&&s&&(u=Math.max(0,u-1)),r.replaceWith(u,d,c)}n.updateSelection&&function(e,t){const n=e.steps.length-1;if(n<t)return;const r=e.steps[n];if(!(r instanceof pl||r instanceof hl))return;const o=e.mapping.maps[n];let i=0;o.forEach((e,t,n,r)=>{0===i&&(i=r)}),e.setSelection(jl.near(e.doc.resolve(i),-1))}(r,r.steps.length-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:c}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:c})}return!0},Up=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,o=r instanceof Jl;if(o){if(r.node.isTextblock||!kl(e.doc,r.from))return!1;n=r.from}else if(n=Cl(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);o&&r.setSelection(Jl.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),Wp=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof Jl){if(r.node.isTextblock||!kl(e.doc,r.to))return!1;n=r.to}else if(n=Cl(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),Gp=()=>({state:e,dispatch:t})=>ha(e,t),Hp=()=>({state:e,dispatch:t})=>va(e,t),qp=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Cl(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Jp=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Cl(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Kp=()=>({state:e,dispatch:t})=>((e,t)=>{let n=pa(e,void 0);if(!n)return!1;let r=ya(n);return!!r&&fa(e,r,t)})(e,t),Yp=()=>({state:e,dispatch:t})=>((e,t)=>{let n=ba(e,void 0);if(!n)return!1;let r=xa(n);return!!r&&fa(e,r,t)})(e,t);function Xp(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Zp=e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);zp()||Xp()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=i.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=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}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{const t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0};function Qp(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?bp(t,e.schema):null,l=[];e.doc.nodesBetween(r,o,(e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);l.push({node:e,from:n,to:i})});const a=o-r,c=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>Cp(e.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=a}var eh=(e,t={})=>({state:n,dispatch:r})=>!!Qp(n,bp(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&yl(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r),th=()=>({state:e,dispatch:t})=>Ta(e,t),nh=e=>({state:t,dispatch:n})=>{return(r=bp(e,t.schema),function(e,t){let{$from:n,$to:o}=e.selection,i=n.blockRange(o,e=>e.childCount>0&&e.firstChild.type==r);return!!i&&(!t||(n.node(i.depth-1).type==r?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new hl(i-1,s,i,s,new Xi(Gi.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new fs(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const l=yl(r);if(null==l)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(i,-1)-1);return kl(o.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&o.join(a.pos),t(o.scrollIntoView()),!0}(e,t,r,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,a=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?Gi.empty:Gi.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new hl(d-(l?1:0),p+(a?1:0),d+1,p-1,new Xi((l?Gi.empty:Gi.from(o.copy(Gi.empty))).append(a?Gi.empty:Gi.from(o.copy(Gi.empty))),l?0:1,a?0:1),l?0:1)),t(r.scrollIntoView()),!0}(e,t,i)))})(t,n);var r},rh=()=>({state:e,dispatch:t})=>Ea(e,t);function oh(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function ih(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var sh=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const l=oh("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(i=bp(e,r.schema)),"mark"===l&&(s=Ip(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&(a=!0,o&&n.setNodeMarkup(r,void 0,ih(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&(a=!0,o&&n.addMark(r,r+e.nodeSize,s.create(ih(i.attrs,t))))})})}),a},lh=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),ah=()=>({tr:e,dispatch:t})=>{if(t){const t=new Yl(e.doc);e.setSelection(t)}return!0},ch=()=>({state:e,dispatch:t})=>ga(e,t),uh=()=>({state:e,dispatch:t})=>wa(e,t),dh=()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(Jl.create(e.doc,n))),!0)})(e,t),ph=()=>({state:e,dispatch:t})=>Na(e,t),hh=()=>({state:e,dispatch:t})=>Pa(e,t);function fh(e,t,n={},r={}){return Fp(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var mh=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:l})=>{const{doc:a}=i;if("full"!==r.preserveWhitespace){const l=fh(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return s&&i.replaceWith(0,a.content.size,l).setMeta("preventUpdate",!n),!0}return s&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function gh(e,t){const n=Ip(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{s.push(...e.marks)});const l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function yh(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function bh(e,t,n){return void 0===e.config[t]&&e.parent?bh(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?bh(e.parent,t,n):null}):e.config[t]}function vh(e){return e.map(e=>{const t=bh(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...vh(t())]:e}).flat(10)}function wh(e,t){const n=qs.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function xh(e){return"function"==typeof e}function Eh(e,t=void 0,...n){return xh(e)?t?e.bind(t)(...n):e(...n):e}function kh(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function Sh(e){const t=[],{nodeExtensions:n,markExtensions:r}=kh(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{const n=bh(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:o});n&&n().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})})})})}),o.forEach(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=bh(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach(([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})})}),t}function Ch(...e){return e.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter(e=>!o.includes(e));n[e]=[...o,...i].join(" ")}else if("style"===e){const r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],o=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],i=new Map;o.forEach(e=>{const[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),r.forEach(e=>{const[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),n[e]=Array.from(i.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t;else n[e]=t}),n},{})}function Th(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Ch(e,t),{})}function Mh(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}},{});return{...r,...o}}}}function Oh(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function Ih(e){var t,n;const r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function Ph(e){return e.sort((e,t)=>{const n=bh(e,"priority")||100,r=bh(t,"priority")||100;return n>r?-1:n<r?1:0})}function Nh(e){const t=Ph(vh(e)),n=function(e){const t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),t}function Dh(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let l="";return e.nodesBetween(r,o,(e,n,a,c)=>{var u;e.isBlock&&n>r&&(l+=i);const d=null==s?void 0:s[e.type.name];if(d)return a&&(l+=d({node:e,pos:n,parent:a,index:c,range:t})),!1;e.isText&&(l+=null==(u=null==e?void 0:e.text)?void 0:u.slice(Math.max(r,n)-n,o-n))}),l}function Ah(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function _h(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(t=>{const o=Op(n.resolve(e),t.type);o&&r.push({mark:t,...o})}):n.nodesBetween(e,t,(e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function zh(e,t){return t.nodes[e]||t.marks[e]||null}function Rh(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{const r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function $h(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Ip(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>Cp(e.attrs,n,{strict:!1}));let s=0;const l=[];if(o.forEach(({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,(e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);s+=i-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:i})))})}),0===s)return!1;const a=l.filter(e=>!i||i.name===e.mark.type.name).filter(e=>Cp(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=l.filter(e=>!i||e.mark.type!==i&&e.mark.type.excludes(i)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+c:a)>=s}function Bh(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function Vh(e,t){const{nodeExtensions:n}=kh(t),r=n.find(t=>t.name===e);if(!r)return!1;const o=Eh(bh(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function Lh(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(Lh(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}var Fh=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:l}=i,a=Ip(e,r.schema);if(o)if(s){const e=gh(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,(e,r)=>{const s=Math.max(r,o),l=Math.min(r+e.nodeSize,i);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){var r;const{selection:o}=t;let i=null;if(Dp(o)&&(i=o.$cursor),i){const t=null!=(r=e.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}const{ranges:s}=o;return s.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&i}return!o}),o})}(r,n,a)},jh=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Uh=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=bp(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:e})=>!!Da(i,{...s,...t})(n)||e.clearNodes()).command(({state:e})=>Da(i,{...s,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Wh=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Ap(e,0,n.content.size),o=Jl.create(n,r);t.setSelection(o)}return!0},Gh=(e,t)=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=r;let s,l;return"number"==typeof t?(s=t,l=t):t&&"from"in t&&"to"in t?(s=t.from,l=t.to):(s=i.from,l=i.to),o&&n.doc.nodesBetween(s,l,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},Hh=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=Hl.atStart(n).from,s=Hl.atEnd(n).to,l=Ap(r,i,s),a=Ap(o,i,s),c=Hl.create(n,l,a);t.setSelection(c)}return!0},qh=e=>({state:t,dispatch:n})=>{const r=bp(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,i=n.blockRange(r,e=>e.childCount>0&&e.firstChild.type==o);if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=o)return!1;if(t){let n=a.lastChild&&a.lastChild.type==l.type,r=Gi.from(n?o.create():null),s=new Xi(Gi.from(o.create(null,Gi.from(l.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;t(e.tr.step(new hl(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(t,n);var o};function Jh(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var Kh=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:l,$to:a}=i,c=Rh(o.extensionManager.attributes,l.node().type.name,l.node().attrs);if(i instanceof Jl&&i.node.isBlock)return!(!l.parentOffset||!El(s,l.pos)||(r&&(e&&Jh(n,o.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),0));if(!l.parent.isBlock)return!1;const u=a.parentOffset===a.parent.content.size,d=0===l.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=u&&d?[{type:d,attrs:c}]:void 0,h=El(t.doc,t.mapping.map(l.pos),1,p);if(p||h||!El(t.doc,t.mapping.map(l.pos),1,d?[{type:d}]:void 0)||(h=!0,p=d?[{type:d,attrs:c}]:void 0),r){if(h&&(i instanceof Hl&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,p),d&&!u&&!l.parentOffset&&l.parent.type!==d)){const e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,d)&&t.setNodeMarkup(t.mapping.map(l.before()),d)}e&&Jh(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return h},Yh=(e,t={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const l=bp(e,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const d=a.node(-1);if(d.type!==l)return!1;const p=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let e=Gi.empty;const r=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-r;t>=a.depth-3;t-=1)e=Gi.from(a.node(t).copy(e));const o=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i={...Rh(p,a.node().type.name,a.node().attrs),...t},c=(null==(s=l.contentMatch.defaultType)?void 0:s.createAndFill(i))||void 0;e=e.append(Gi.from(l.createAndFill(null,c)||void 0));const u=a.before(a.depth-(r-1));n.replace(u,a.after(-o),new Xi(e,4-r,0));let d=-1;n.doc.nodesBetween(u,n.doc.content.size,(e,t)=>{if(d>-1)return!1;e.isTextblock&&0===e.content.size&&(d=t+1)}),d>-1&&n.setSelection(Hl.near(n.doc.resolve(d))),n.scrollIntoView()}return!0}const h=c.pos===a.end()?d.contentMatchAt(0).defaultType:null,f={...Rh(p,d.type.name,d.attrs),...t},m={...Rh(p,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,c.pos);const g=h?[{type:l,attrs:f},{type:h,attrs:m}]:[{type:l,attrs:f}];if(!El(n.doc,a.pos,2))return!1;if(o){const{selection:e,storedMarks:t}=r,{splittableMarks:s}=i.extensionManager,l=t||e.$to.parentOffset&&e.$from.marks();if(n.split(a.pos,2,g).scrollIntoView(),!l||!o)return!0;const c=l.filter(e=>s.includes(e.type.name));n.ensureMarks(c)}return!0},Xh=(e,t)=>{const n=yh(e=>e.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!kl(e.doc,n.pos)||(e.join(n.pos),!0)},Zh=(e,t)=>{const n=yh(e=>e.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!kl(e.doc,r)||(e.join(r),!0)},Qh=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:p}=o.extensionManager,h=bp(e,s.schema),f=bp(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,v=y.blockRange(b),w=g||m.$to.parentOffset&&m.$from.marks();if(!v)return!1;const x=yh(e=>Vh(e.type.name,d))(m);if(v.depth>=1&&x&&v.depth-x.depth<=1){if(x.node.type===h)return c.liftListItem(f);if(Vh(x.node.type.name,d)&&h.validContent(x.node.content)&&l)return a().command(()=>(i.setNodeMarkup(x.pos,h),!0)).command(()=>Xh(i,h)).command(()=>Zh(i,h)).run()}return n&&w&&l?a().command(()=>{const e=u().wrapInList(h,r),t=w.filter(e=>p.includes(e.type.name));return i.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(h,r).command(()=>Xh(i,h)).command(()=>Zh(i,h)).run():a().command(()=>!!u().wrapInList(h,r)||c.clearNodes()).wrapInList(h,r).command(()=>Xh(i,h)).command(()=>Zh(i,h)).run()},ef=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Ip(e,r.schema);return $h(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},tf=(e,t,n={})=>({state:r,commands:o})=>{const i=bp(e,r.schema),s=bp(t,r.schema),l=Qp(r,i,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?o.setNode(s,a):o.setNode(i,{...a,...n})},nf=(e,t={})=>({state:n,commands:r})=>{const o=bp(e,n.schema);return Qp(n,o,t)?r.lift(o):r.wrapIn(o,t)},rf=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},of=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},sf=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=Ip(e,r.schema),{$from:c,empty:u,ranges:d}=l;if(!o)return!0;if(u&&s){let{from:e,to:t}=l;const r=null==(i=c.marks().find(e=>e.type===a))?void 0:i.attrs,o=Op(c,a,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,a)}else d.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},lf=e=>({tr:t,state:n,dispatch:r})=>{const{selection:o}=n;let i,s;return"number"==typeof e?(i=e,s=e):e&&"from"in e&&"to"in e?(i=e.from,s=e.to):(i=o.from,s=o.to),r&&t.doc.nodesBetween(i,s,(e,n)=>{if(e.isText)return;const r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},af=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const l=oh("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(i=bp(e,r.schema)),"mark"===l&&(s=Ip(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{const l=e.$from.pos,c=e.$to.pos;let u,d,p,h;n.selection.empty?r.doc.nodesBetween(l,c,(e,t)=>{i&&i===e.type&&(a=!0,p=Math.max(t,l),h=Math.min(t+e.nodeSize,c),u=t,d=e)}):r.doc.nodesBetween(l,c,(e,r)=>{r<l&&i&&i===e.type&&(a=!0,p=Math.max(r,l),h=Math.min(r+e.nodeSize,c),u=r,d=e),r>=l&&r<=c&&(i&&i===e.type&&(a=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type&&(a=!0,o)){const o=Math.max(r,l),a=Math.min(r+e.nodeSize,c);n.addMark(o,a,s.create({...i.attrs,...t}))}}))}),d&&(void 0!==u&&o&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),s&&d.marks.length&&d.marks.forEach(e=>{s===e.type&&o&&n.addMark(p,h,s.create({...e.attrs,...t}))}))}),a},cf=(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&bl(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}(bp(e,n.schema),t)(n,r),uf=(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let l=r?n.tr:null;return!!function(e,t,n,r=null){let o=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);i=new fs(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new fs(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let l=bl(i,n,r,t);return!!l&&(e&&function(e,t,n,r,o){let i=Gi.empty;for(let e=n.length-1;e>=0;e--)i=Gi.from(n[e].type.create(n[e].attrs,i));e.step(new hl(t.start-(r?2:0),t.end,t.start,t.end,new Xi(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let l=n.length-s,a=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&El(e.doc,a,l)&&(e.split(a,l),a+=2*l),a+=c.child(n).nodeSize}(e,t,l,o,n),!0)}(l,s,e,t)&&(r&&r(l.scrollIntoView()),!0)}}(bp(e,n.schema),t)(n,r),df=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},pf=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function hf(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let u=!1;const d=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,o,i)=>{var s,l;const a=(null==(l=(s=e.type.spec).toText)?void 0:l.call(s,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(c)+i;return s.forEach(e=>{if(u)return;const t=((e,t)=>{if(Sp(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,e.find);if(!t)return;const s=a.state.tr,c=ap({state:a.state,transaction:s}),p={from:r-(t[0].length-i.length),to:o},{commands:h,chain:f,can:m}=new cp({editor:n,state:c});null!==e.handler({state:c,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(l,{transform:s,from:r,to:o,text:i}),a.dispatch(s),u=!0)}),u}function ff(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function mf(e,t){const n={...e};return ff(e)&&ff(t)&&Object.keys(t).forEach(r=>{ff(t[r])&&ff(e[r])?n[r]=mf(e[r],t[r]):n[r]=t[r]}),n}var gf=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Eh(bh(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Eh(bh(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>mf(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},yf=class e extends gf{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;const i=o.find(e=>(null==e?void 0:e.type.name)===t.name);return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},bf=class{constructor(e){this.find=e.find,this.handler=e.handler}};var vf=null;function wf(e){const{editor:t,rules:n}=e;let r,o=null,i=!1,s=!1,l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const a=({state:e,from:n,to:o,rule:i,pasteEvt:s})=>{const a=e.tr,c=ap({state:e,transaction:a});if(function(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:c,can:u}=new cp({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,o,(e,t)=>{var p,h,f,m,g;if((null==(h=null==(p=e.type)?void 0:p.spec)?void 0:h.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,b=Math.max(r,t),v=Math.min(o,t+y);b>=v||((e,t,n)=>{if(Sp(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(b-t,v-t,void 0,""),i.find,s).forEach(e=>{if(void 0===e.index)return;const t=b+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:e,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});d.push(p)})}),d.every(e=>null!==e)}({editor:t,state:c,from:Math.max(n-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:r})&&a.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return n.map(e=>new la({view(e){const n=n=>{var r;o=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,o&&(vf=t)},r=()=>{vf&&(vf=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(s=o===e.dom.parentElement,r=t,!s){const e=vf;(null==e?void 0:e.isEditable)&&setTimeout(()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return l=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const o=t[0],c="paste"===o.getMeta("uiEvent")&&!i,u="drop"===o.getMeta("uiEvent")&&!s,d=o.getMeta("applyPasteRules"),p=!!d;if(!c&&!u&&!p)return;if(p){let{text:t}=d;"string"==typeof t||(t=wh(Gi.from(t),r.schema));const{from:n}=d,o=n+t.length,i=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return a({rule:e,state:r,from:n,to:{b:o},pasteEvt:i})}const h=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof h&&f&&h!==f.b?a({rule:e,state:r,from:h,to:f,pasteEvt:l}):void 0}}))}var xf=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Nh(e),this.schema=function(e,t){var n;const r=Sh(e),{nodeExtensions:o,markExtensions:i}=kh(e),s=null==(n=o.find(e=>bh(e,"topNode")))?void 0:n.name,l=Object.fromEntries(o.map(n=>{const o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=Oh({...e.reduce((e,t)=>{const r=bh(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),content:Eh(bh(n,"content",i)),marks:Eh(bh(n,"marks",i)),group:Eh(bh(n,"group",i)),inline:Eh(bh(n,"inline",i)),atom:Eh(bh(n,"atom",i)),selectable:Eh(bh(n,"selectable",i)),draggable:Eh(bh(n,"draggable",i)),code:Eh(bh(n,"code",i)),whitespace:Eh(bh(n,"whitespace",i)),linebreakReplacement:Eh(bh(n,"linebreakReplacement",i)),defining:Eh(bh(n,"defining",i)),isolating:Eh(bh(n,"isolating",i)),attrs:Object.fromEntries(o.map(Ih))}),l=Eh(bh(n,"parseHTML",i));l&&(s.parseDOM=l.map(e=>Mh(e,o)));const a=bh(n,"renderHTML",i);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:Th(e,o)}));const c=bh(n,"renderText",i);return c&&(s.toText=c),[n.name,s]})),a=Object.fromEntries(i.map(n=>{const o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=Oh({...e.reduce((e,t)=>{const r=bh(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),inclusive:Eh(bh(n,"inclusive",i)),excludes:Eh(bh(n,"excludes",i)),group:Eh(bh(n,"group",i)),spanning:Eh(bh(n,"spanning",i)),code:Eh(bh(n,"code",i)),attrs:Object.fromEntries(o.map(Ih))}),l=Eh(bh(n,"parseHTML",i));l&&(s.parseDOM=l.map(e=>Mh(e,o)));const a=bh(n,"renderHTML",i);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:Th(e,o)})),[n.name,s]}));return new zs({topNode:s,nodes:l,marks:a})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n=bh(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:zh(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this;return Ph([...this.extensions].reverse()).flatMap(t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:zh(t.name,this.schema)},r=[],o=bh(t,"addKeyboardShortcuts",n);let i={};if("mark"===t.type&&bh(t,"exitable",n)&&(i.ArrowRight=()=>yf.handleExit({editor:e,mark:t})),o){const t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));i={...i,...t}}const s=new la({props:{handleKeyDown:ip(i)}});r.push(s);const l=bh(t,"addInputRules",n);if(Bh(t,e.options.enableInputRules)&&l){const t=l();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new la({state:{init(){return null},apply(e,o,i){const s=e.getMeta(r);if(s)return s;const l=e.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=wh(Gi.from(e),i.schema));const{from:o}=l,s=o+e.length;hf({editor:t,from:o,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput(e,o,i,s){return hf({editor:t,from:o,to:i,text:s,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{const{$cursor:o}=e.state.selection;o&&hf({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&hf({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}const a=bh(t,"addPasteRules",n);if(Bh(t,e.options.enablePasteRules)&&a){const t=a();if(t&&t.length){const n=wf({editor:e,rules:t});r.push(...n)}}const c=bh(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r})}get attributes(){return Sh(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=kh(this.extensions);return Object.fromEntries(t.filter(e=>!!bh(e,"addNodeView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:bp(t.name,this.schema)},o=bh(t,"addNodeView",r);if(!o)return[];const i=o();return i?[t.name,(r,o,s,l,a)=>{const c=Th(r,n);return i({node:r,view:o,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:c})}]:[]}))}get markViews(){const{editor:e}=this,{markExtensions:t}=kh(this.extensions);return Object.fromEntries(t.filter(e=>!!bh(e,"addMarkView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ip(t.name,this.schema)},o=bh(t,"addMarkView",r);return o?[t.name,(r,i,s)=>{const l=Th(r,n);return o()({mark:r,view:i,inline:s,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{!function(e,t,n={}){const{state:r}=t,{doc:o,tr:i}=r,s=e;o.descendants((t,r)=>{const o=i.mapping.map(r),l=i.mapping.map(r)+t.nodeSize;let a=null;if(t.marks.forEach(e=>{if(e!==s)return!1;a=e}),!a)return;let c=!1;if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(c=!0)}),c){const t=e.type.create({...e.attrs,...n});i.removeMark(o,l,e.type),i.addMark(o,l,t)}}),i.docChanged&&t.view.dispatch(i)}(r,e,t)}})}]:[]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:zh(e.name,this.schema)};"mark"===e.type&&(null==(t=Eh(bh(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);const r=bh(e,"onBeforeCreate",n),o=bh(e,"onCreate",n),i=bh(e,"onUpdate",n),s=bh(e,"onSelectionUpdate",n),l=bh(e,"onTransaction",n),a=bh(e,"onFocus",n),c=bh(e,"onBlur",n),u=bh(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),a&&this.editor.on("focus",a),c&&this.editor.on("blur",c),u&&this.editor.on("destroy",u)})}};xf.resolve=Nh,xf.sort=Ph,xf.flatten=vh,lp({},{ClipboardTextSerializer:()=>kf,Commands:()=>Sf,Delete:()=>Cf,Drop:()=>Tf,Editable:()=>Mf,FocusEvents:()=>If,Keymap:()=>Pf,Paste:()=>Nf,Tabindex:()=>Df,TextDirection:()=>Af,focusEventsPluginKey:()=>Of});var Ef=class e extends gf{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},kf=Ef.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new la({key:new ua("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map(e=>e.$from.pos)),l=Math.max(...i.map(e=>e.$to.pos)),a=Ah(n);return Dh(r,{from:s,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Sf=Ef.create({name:"commands",addCommands(){return{...up}}}),Cf=Ef.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;const i=()=>{var n,r,o,i;if(null!=(i=null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:o.call(r,e))?i:e.getMeta("y-sync$"))return;const s=function(e,t){const n=new Ll(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}(e.before,[e,...t]),l=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,o)=>{const i=[];if(e.ranges.length)e.forEach((e,t)=>{i.push({from:e,to:t})});else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach(({from:e,to:n})=>{const i=t.slice(o).map(e,-1),s=t.slice(o).map(n),l=t.invert().map(i,-1),a=t.invert().map(s);r.push({oldRange:{from:l,to:a},newRange:{from:i,to:s}})})}),function(e){const t=function(e,t=JSON.stringify){const n={};return e.filter(e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(e);return 1===t.length?t:t.filter((e,n)=>{const r=t.filter((e,t)=>t!==n);return!r.some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to)})}(r)}(s);l.forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{const o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})})});const a=s.mapping;s.steps.forEach((t,n)=>{var r,o;if(t instanceof cl){const i=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),c=a.invert().map(i,-1),u=a.invert().map(l),d=null==(r=s.doc.nodeAt(i-1))?void 0:r.marks.some(e=>e.eq(t.mark)),p=null==(o=s.doc.nodeAt(l))?void 0:o.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:u},newRange:{from:i,to:l},partial:Boolean(p||d),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||o?setTimeout(i,0):i()}}),Tf=Ef.create({name:"drop",addProseMirrorPlugins(){return[new la({key:new ua("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Mf=Ef.create({name:"editable",addProseMirrorPlugins(){return[new la({key:new ua("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Of=new ua("focusEvents"),If=Ef.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new la({key:Of,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Pf=Ef.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{const{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:s,parent:l}=i,a=i.parent.isTextblock&&s>0?t.doc.resolve(s-1):i,c=a.parent.type.spec.isolating,u=i.pos-i.parentOffset,d=c&&1===a.parent.childCount?u===i.pos:jl.atStart(r).from===s;return!(!o||!l.type.isTextblock||l.textContent.length||!d||d&&"paragraph"===i.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return zp()||Xp()?o:r},addProseMirrorPlugins(){return[new la({key:new ua("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;const r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:l}=t.selection,a=jl.atStart(t.doc).from,c=jl.atEnd(t.doc).to;if(i||s!==a||l!==c)return;if(!Lh(n.doc))return;const u=n.tr,d=ap({state:n,transaction:u}),{commands:p}=new cp({editor:this.editor,state:d});return p.clearNodes(),u.steps.length?u:void 0}})]}}),Nf=Ef.create({name:"paste",addProseMirrorPlugins(){return[new la({key:new ua("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Df=Ef.create({name:"tabindex",addProseMirrorPlugins(){return[new la({key:new ua("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Af=Ef.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=kh(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return!t||"ltr"!==t&&"rtl"!==t&&"auto"!==t?this.options.direction:t},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new la({key:new ua("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),_f=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+(i?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(s);if(!o&&l.depth<=this.depth)return;const a=new e(l,this.editor,o,o?n:null);o&&(a.actualDepth=this.depth+1),t.push(new e(l,this.editor,o,o?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];if(e[o]!==t[o])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(t);return this.children.forEach(i=>{n&&r.length>0||(i.node.type.name===e&&o.every(e=>t[e]===i.node.attrs[e])&&r.push(i),n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n))))}),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},zf=class extends df{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=_p(t,this.options.autofocus);this.editorState=ia.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML='.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',document.getElementsByTagName("head")[0].appendChild(r),r}(0,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=xh(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(e=>{const t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[Mf,kf.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),Sf,If,Pf,Df,Tf,Nf,Cf,Af.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new xf(n,this)}createCommandManager(){this.commandManager=new cp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=fh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=fh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var t;this.editorView=new Ud(e,{...this.options.editorProps,attributes:{role:"textbox",...null==(t=this.options.editorProps)?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)}):void(this.capturedTransaction=e);const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==s?void 0:s.getMeta("focus"),a=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return function(e,t){const n=oh("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=bp(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,e=>{i.push(e)});const s=i.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?gh(e,t):{}}(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Qp(e,null,n)||$h(e,null,n);const r=oh(t,e.schema);return"node"===r?Qp(e,t,n):"mark"===r&&$h(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return wh(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Dh(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...Ah(this.schema),...n}})}get isEmpty(){return Lh(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new _f(t,this)}get $doc(){return this.$pos(0)}};function Rf(e){return new pf({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Eh(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],l=r[0];if(s){const r=l.search(/\S/),a=n.from+l.indexOf(s),c=a+s.length;if(_h(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;c<n.to&&i.delete(c,n.to),a>n.from&&i.delete(n.from+r,a);const u=n.from+r+s.length;i.addMark(n.from+r,u,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function $f(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const e=o.map(e=>e.trim().slice(1));t.class=e.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(t.id=i[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var o;const i=parseInt((null==(o=r.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10),s=n[i];s&&(t[e]=s.slice(1,-1))});const s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function Bf(e){if(!e||0===Object.keys(e).length)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function Vf(e){const{nodeName:t,name:n,parseAttributes:r=$f,serializeAttributes:o=Bf,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:l}=e,a=n||t;return{parseMarkdown:(e,n)=>{const r={...i,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${a}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,o){const i=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),l=e.match(i);if(!l)return;const c=l[1]||"",u=r(c);return s.find(e=>!(e in u))?void 0:{type:t,raw:l[0],attributes:u}}},renderMarkdown:e=>{const t=(e=>{if(!l)return e;const t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}),n=o(t);return`:::${a}${n?` {${n}}`:""} :::`}}}function Lf(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=$f,serializeAttributes:i=Bf,defaultAttributes:s={},content:l="block",allowedAttributes:a}=e,c=n||t;return{parseMarkdown:(e,n)=>{let o;if(r){const t=r(e);o="string"==typeof t?[{type:"text",text:t}]:t}else o="block"===l?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const i={...s,...e.attributes};return n.createNode(t,i,o)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var i;const s=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),a=e.match(s);if(!a)return;const[u,d=""]=a,p=o(d);let h=1;const f=u.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const o=n.index,s=n[1];if(!(null==(i=n[2])?void 0:i.endsWith(":::")))if(s)h+=1;else if(h-=1,0===h){const i=y.slice(0,o);m=i.trim();const s=e.slice(0,f+o+n[0].length);let a=[];if(m)if("block"===l)for(a=r.blockTokens(i),a.forEach(e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))});a.length>0;){const e=a[a.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;a.pop()}else a=r.inlineTokens(m);return{type:t,raw:s,attributes:p,content:m,tokens:a}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!a)return e;const t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}),r=i(n),o=r?` {${r}}`:"",s=t.renderChildren(e.content||[],"\n\n");return`:::${c}${o}\n\n${s}\n\n:::`}}}function Ff(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,o,i,s]=r;t[o]=i||s,r=n.exec(e)}return t}function jf(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function Uf(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=Ff,serializeAttributes:i=jf,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=e,c=n||t,u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const o={...s,...e.attributes};if(l)return n.createNode(t,o);const i=r?r(e):e.content||"";return i?n.createNode(t,o,[n.createTextNode(i)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const i=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),s=e.match(i);if(!s)return;let a="",c="";if(l){const[,e]=s;c=e}else{const[,e,t]=s;c=e,a=t||""}const d=o(c.trim());return{type:t,raw:s[0],content:a.trim(),attributes:d}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));const n=(e=>{if(!a)return e;const t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}),o=i(n),s=o?` ${o}`:"";return l?`[${c}${s}]`:`[${c}${s}]${t}[/${c}]`}}}function Wf(e,t,n){var r,o,i,s;const l=e.split("\n"),a=[];let c="",u=0;const d=t.baseIndentSize||2;for(;u<l.length;){const e=l[u],p=e.match(t.itemPattern);if(!p){if(a.length>0)break;if(""===e.trim()){u+=1,c=`${c}${e}\n`;continue}return}const h=t.extractItemData(p),{indentLevel:f,mainContent:m}=h;c=`${c}${e}\n`;const g=[m];for(u+=1;u<l.length;){const e=l[u];if(""===e.trim()){const t=l.slice(u+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null==(o=null==(r=l[u+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){g.push(e),c=`${c}${e}\n`,u+=1;continue}break}if(!(((null==(s=null==(i=e.match(/^(\s*)/))?void 0:i[1])?void 0:s.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,u+=1}let y;const b=g.slice(1);if(b.length>0){const e=b.map(e=>e.slice(f+d)).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const v=t.createToken(h,y);a.push(v)}if(0!==a.length)return{items:a,raw:c}}function Gf(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const o="function"==typeof n?n(r):n,[i,...s]=e.content,l=[`${o}${t.renderChildren([i])}`];return s&&s.length>0&&s.forEach(e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map(e=>e?t.indent(e):"").join("\n");l.push(e)}}),l.join("\n")}lp({},{createAtomBlockMarkdownSpec:()=>Vf,createBlockMarkdownSpec:()=>Lf,createInlineMarkdownSpec:()=>Uf,parseAttributes:()=>$f,parseIndentedBlocks:()=>Wf,renderNestedMarkdownContent:()=>Gf,serializeAttributes:()=>Bf});var Hf=class e extends gf{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};function qf(e){return new bf({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=Eh(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;const{tr:s}=t,l=r[r.length-1],a=r[0];let c=n.to;if(l){const r=a.search(/\S/),o=n.from+a.indexOf(l),u=o+l.length;if(_h(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>o).length)return null;u<n.to&&s.delete(u,n.to),o>n.from&&s.delete(n.from+r,o),c=n.from+r+l.length,s.addMark(n.from+r,c,e.type.create(i||{})),s.removeStoredMark(e.type)}}})}var Jf=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);const{children:n,...r}=null!=t?t:{};if("svg"===e)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},Kf=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Yf=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Xf=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Zf=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Qf=yf.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Jf("strong",{...Ch(this.options.HTMLAttributes,e),children:Jf("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Rf({find:Kf,type:this.type}),Rf({find:Xf,type:this.type})]},addPasteRules(){return[qf({find:Yf,type:this.type}),qf({find:Zf,type:this.type})]}}),em=Hf.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),tm=Hf.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Ch(this.options.HTMLAttributes,e)]},renderText(){return"\n"},renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,l=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&i){const t=l.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),nm=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,rm=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,om=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,im=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,sm=yf.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Ch(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Rf({find:nm,type:this.type}),Rf({find:om,type:this.type})]},addPasteRules(){return[qf({find:rm,type:this.type}),qf({find:im,type:this.type})]}}),lm=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,am=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,cm=yf.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}]},renderHTML({HTMLAttributes:e}){return["s",Ch(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Rf({find:lm,type:this.type})]},addPasteRules(){return[qf({find:am,type:this.type})]}}),um=yf.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(e){return"sub"===e&&null}}]},renderHTML({HTMLAttributes:e}){return["sub",Ch(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),dm=yf.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(e){return"super"===e&&null}}]},renderHTML({HTMLAttributes:e}){return["sup",Ch(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),pm=Hf.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),hm=yf.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}]},renderHTML({HTMLAttributes:e}){return["u",Ch(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),fm=window.ReactDOM,mm=n(6886),gm=n(9370),ym=n(8061),bm=n(5544),vm=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},wm=({contentComponent:e})=>{const t=(0,mm.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,gm.jsx)(gm.Fragment,{children:Object.values(t)})},xm=class extends e.Component{constructor(t){var n;super(t),this.editorContentRef=e.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(n=t.editor)?void 0:n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(e.view.dom),e.setOptions({element:t}),e.contentComponent=function(){const e=new Set;let t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:fm.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(e=>e())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.firstChild))return;const n=document.createElement("div");n.append(t.view.dom),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return(0,gm.jsxs)(gm.Fragment,{children:[(0,gm.jsx)("div",{ref:vm(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,gm.jsx)(wm,{contentComponent:e.contentComponent})]})}},Em=(0,e.forwardRef)((t,n)=>{const r=e.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[t.editor]);return e.createElement(xm,{key:r,innerRef:n,...t})}),km=e.memo(Em),Sm="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Cm=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function Tm(t){var n;const[r]=(0,e.useState)(()=>new Cm(t.editor)),o=(0,bm.useSyncExternalStoreWithSelector)(r.subscribe,r.getSnapshot,r.getServerSnapshot,t.selector,null!=(n=t.equalityFn)?n:ym);return Sm(()=>r.watch(t.editor),[t.editor,r]),(0,e.useDebugValue)(o),o}var Mm="undefined"==typeof window,Om=Mm||Boolean("undefined"!=typeof window&&window.next),Im=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?Mm||Om?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new zf(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};(0,e.createContext)({editor:null}).Consumer;var Pm=(0,e.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});e.forwardRef((t,n)=>{const{onDragStart:r}=(0,e.useContext)(Pm),o=t.as||"div";return(0,gm.jsx)(o,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})}),e.createContext({markViewContentRef:()=>{}});const Nm={clear:{label:(0,i.__)("Clear","elementor"),icon:e.createElement(R.MinusIcon,{fontSize:"tiny"}),action:"clear",method:e=>{e.chain().focus().clearNodes().unsetAllMarks().run()}},bold:{label:(0,i.__)("Bold","elementor"),icon:e.createElement(R.BoldIcon,{fontSize:"tiny"}),action:"bold",method:e=>{e.chain().focus().toggleBold().run()}},italic:{label:(0,i.__)("Italic","elementor"),icon:e.createElement(R.ItalicIcon,{fontSize:"tiny"}),action:"italic",method:e=>{e.chain().focus().toggleItalic().run()}},underline:{label:(0,i.__)("Underline","elementor"),icon:e.createElement(R.UnderlineIcon,{fontSize:"tiny"}),action:"underline",method:e=>{e.chain().focus().toggleUnderline().run()}},strike:{label:(0,i.__)("Strikethrough","elementor"),icon:e.createElement(R.StrikethroughIcon,{fontSize:"tiny"}),action:"strike",method:e=>{e.chain().focus().toggleStrike().run()}},superscript:{label:(0,i.__)("Superscript","elementor"),icon:e.createElement(R.SuperscriptIcon,{fontSize:"tiny"}),action:"superscript",method:e=>{e.chain().focus().toggleSuperscript().run()}},subscript:{label:(0,i.__)("Subscript","elementor"),icon:e.createElement(R.SubscriptIcon,{fontSize:"tiny"}),action:"subscript",method:e=>{e.chain().focus().toggleSubscript().run()}}},{clear:Dm,...Am}=Nm,_m=Object.keys(Am),zm=({editor:t})=>{const n=Tm({editor:t,selector:e=>_m.filter(t=>e.editor.isActive(t))}),r=(0,e.useMemo)(()=>Object.values(Am),[]);return e.createElement(o.Box,{sx:{position:"absolute",top:-40,display:"inline-flex",gap:.5,padding:.5,borderRadius:1,backgroundColor:"background.paper",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)",alignItems:"center"}},e.createElement(o.Tooltip,{title:Dm.label,placement:"top"},e.createElement(o.IconButton,{"aria-label":Dm.label,onClick:()=>Dm.method(t),size:"tiny"},Dm.icon)),e.createElement(o.ToggleButtonGroup,{value:n,size:"tiny",sx:{display:"flex",gap:.5}},r.map(n=>e.createElement(o.Tooltip,{title:n.label,key:n.action,placement:"top"},e.createElement(o.ToggleButton,{value:n.action,"aria-label":n.label,size:"tiny",onClick:()=>n.method(t)},n.icon)))))};function Rm(){return Rm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rm.apply(null,arguments)}const $m=e.forwardRef(({value:t,setValue:n,attributes:r={},showToolbar:i=!1,sx:s},l)=>{const a=function(t={},n=[]){const r=(0,e.useRef)(t);r.current=t;const[o]=(0,e.useState)(()=>new Im(r)),i=(0,mm.useSyncExternalStore)(o.subscribe,o.getEditor,o.getServerSnapshot);return(0,e.useDebugValue)(i),(0,e.useEffect)(o.onRender(n)),Tm({editor:i,selector:({transactionNumber:e})=>!1===t.shouldRerenderOnTransaction||void 0===t.shouldRerenderOnTransaction?null:t.immediatelyRender&&0===e?0:e+1}),i}({extensions:[em.extend({content:"inline*"}),pm,Qf,sm,cm,hm,dm,um,tm.extend({addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.setHardBreak()}}})],content:t,onUpdate:({editor:e})=>n(e.getHTML())});return((n,r)=>{const o=(0,e.useRef)(!1);(0,e.useEffect)(()=>{o.current?(()=>{if(!a)return;a.getHTML()!==t&&a.commands.setContent(t,{emitUpdate:!1})})():o.current=!0},r)})(0,[a,t]),e.createElement(o.Box,Rm({ref:l,sx:{p:.8,border:"1px solid",borderColor:"grey.200",borderRadius:"8px",transition:"border-color .2s ease, box-shadow .2s ease","&:hover":{borderColor:"black"},"&:focus-within":{borderColor:"black",boxShadow:"0 0 0 1px black"},"& .ProseMirror:focus":{outline:"none"},"& .ProseMirror":{minHeight:"70px",fontSize:"12px"},...s}},r),i&&e.createElement(zm,{editor:a}),e.createElement(km,{editor:a}))}),Bm=M(()=>{const{value:n,setValue:r}=b(t.htmlPropTypeUtil);return e.createElement(G,null,e.createElement($m,{value:n||"",setValue:e=>r(e)}))}),Vm=(0,o.styled)(o.IconButton)(({theme:e})=>({width:e.spacing(2.5),height:e.spacing(2.5)})),Lm=({tooltipText:t,onClick:n,disabled:r,size:i="tiny"})=>e.createElement(o.Tooltip,{title:t,placement:"top",disableInteractive:!0},e.createElement(Vm,{"aria-label":t,size:i,onClick:n,disabled:r},e.createElement(R.BrushBigIcon,{fontSize:i})));function Fm(){return Fm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fm.apply(null,arguments)}const jm="tiny",Um=({label:t,itemSettings:n,disabled:r=!1,openOnAdd:s=!1,values:l=[],setValues:a,showDuplicate:c=!0,showToggle:u=!0,showRemove:d=!0,disableAddItemButton:p=!1,addButtonInfotipContent:h,openItem:f=-1,isSortable:m=!0})=>{const[g,y]=(0,e.useState)(f),b=l.map((e,t)=>m&&"getId"in n?n.getId({item:e,index:t}):String(t)),v=r||p,w=v&&h,x=e.createElement(o.IconButton,{size:jm,sx:{ml:"auto"},disabled:v,onClick:()=>{const e=structuredClone(n.initialValues),t=l.length;a([...l,e],{},{action:{type:"add",payload:[{index:t,item:e}]}}),s&&y(t)},"aria-label":(0,i.__)("Add item","elementor")},e.createElement(R.PlusIcon,{fontSize:jm}));return e.createElement(Te,{gap:2},e.createElement(Ct,{label:t,adornment:St},w?e.createElement(o.Infotip,{placement:"right",content:h,color:"secondary",slotProps:{popper:{sx:{width:300}}}},e.createElement(o.Box,{sx:{...v?{cursor:"not-allowed"}:{}}},x)):x),0<b.length&&e.createElement(je,{value:b,onChange:(e,t)=>{a(e.map(e=>l[b.indexOf(e)]),{},{action:{type:"reorder",payload:{...t}}})}},b.map(t=>{const o=b.indexOf(t),i=l[o];return i?e.createElement(Ue,{id:t,key:`sortable-${t}`,disabled:!m},e.createElement(Wm,{disabled:r,propDisabled:i?.disabled,label:e.createElement(tt,{value:i},e.createElement(n.Label,{value:i,index:o})),startIcon:e.createElement(Qe,{value:i},e.createElement(n.Icon,{value:i})),removeItem:()=>(e=>{const t=l[e];a(l.filter((t,n)=>n!==e),{},{action:{type:"remove",payload:[{index:e,item:t}]}})})(o),duplicateItem:()=>(e=>{const t=structuredClone(l[e]),n=1+e;a([...l.slice(0,n),t,...l.slice(n)],{},{action:{type:"duplicate",payload:[{index:e,item:t}]}})})(o),toggleDisableItem:()=>(e=>{a(l.map((t,n)=>{if(n===e){const{disabled:e,...n}=t;return{...n,...e?{}:{disabled:!0}}}return t}),{},{action:{type:"toggle-disable"}})})(o),openOnMount:s&&g===o,onOpen:()=>y(-1),showDuplicate:c,showToggle:u,showRemove:d,actions:n.actions,value:i},t=>e.createElement(n.Content,Fm({},t,{value:i,bind:String(o),index:o})))):null})))},Wm=({label:t,propDisabled:n,startIcon:r,children:s,removeItem:l,duplicateItem:a,toggleDisableItem:c,openOnMount:u,onOpen:d,showDuplicate:p,showToggle:h,showRemove:f,disabled:m,actions:g,value:y})=>{const{popoverState:b,popoverProps:v,ref:w,setRef:x}=Gm(u,d),E=(0,i.__)("Duplicate","elementor"),k=n?(0,i.__)("Show","elementor"):(0,i.__)("Hide","elementor"),S=(0,i.__)("Remove","elementor");return e.createElement(e.Fragment,null,e.createElement(Xe,Fm({disabled:m,label:t,ref:x,"aria-label":(0,i.__)("Open item","elementor")},(0,o.bindTrigger)(b),{startIcon:r,actions:e.createElement(e.Fragment,null,p&&e.createElement(o.Tooltip,{title:E,placement:"top"},e.createElement(o.IconButton,{size:jm,onClick:a,"aria-label":E},e.createElement(R.CopyIcon,{fontSize:jm}))),h&&e.createElement(o.Tooltip,{title:k,placement:"top"},e.createElement(o.IconButton,{size:jm,onClick:c,"aria-label":k},n?e.createElement(R.EyeOffIcon,{fontSize:jm}):e.createElement(R.EyeIcon,{fontSize:jm}))),g?.(y),f&&e.createElement(o.Tooltip,{title:S,placement:"top"},e.createElement(o.IconButton,{size:jm,onClick:l,"aria-label":S},e.createElement(R.XIcon,{fontSize:jm}))))})),e.createElement(mt,Fm({width:w?.getBoundingClientRect().width},v,{anchorEl:w}),e.createElement(o.Box,null,s({anchorEl:w}))))},Gm=(t,n)=>{const[r,i]=(0,e.useState)(null),s=(0,o.usePopupState)({variant:"popover"}),l=(0,o.bindPopover)(s);return(0,e.useEffect)(()=>{t&&r&&(s.open(r),n?.())},[r]),{popoverState:s,ref:r,setRef:i,popoverProps:l}}}(),(window.elementorV2=window.elementorV2||{}).editorControls=r}(),window.elementorV2.editorControls?.init?.();