From 3019c5d3b41971b45c0aff95a89781e692404d40 Mon Sep 17 00:00:00 2001 From: splincode Date: Thu, 21 Sep 2023 15:04:16 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20taiga-fa?= =?UTF-8?q?mily/tui-editor@6bde7c191a4c7f4bda4f5e9e69f79b0589ce3cff=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- 7080.2f11dcbd55521c369d3b.js | 1 - 7080.b3cc0188b4eea7f56942.js | 1 + index.html | 2 +- main.eb475ca1cd25c32a414d.js => main.ba11674f3b3b320534b0.js | 0 ...e.6b0290cd14c71e9d8adb.js => runtime.03991e47a4a33f623901.js | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 7080.2f11dcbd55521c369d3b.js create mode 100644 7080.b3cc0188b4eea7f56942.js rename main.eb475ca1cd25c32a414d.js => main.ba11674f3b3b320534b0.js (100%) rename runtime.6b0290cd14c71e9d8adb.js => runtime.03991e47a4a33f623901.js (99%) diff --git a/404.html b/404.html index fd33a4bb8..98e98d50b 100644 --- a/404.html +++ b/404.html @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/7080.2f11dcbd55521c369d3b.js b/7080.2f11dcbd55521c369d3b.js deleted file mode 100644 index 0dc1206c5..000000000 --- a/7080.2f11dcbd55521c369d3b.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunktui_editor=self.webpackChunktui_editor||[]).push([[7080],{13449:(t,e,n)=>{n.d(e,{h:()=>A});var o=n(74788),i=n(64642),r=n(1065),s=n(75747),a=n(16331),l=n(28986),c=n(99036),d=n(24751),u=n(65266),h=n(12057),p=n(32188),f=n(87624),m=n(38190),g=n(22545),b=n(91283),v=n(75526),y=n(19042),w=n(4642),k=n(45642);function x(t,e){if(1&t&&(o.TgZ(0,"button",7),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.hij(" ",t," ")}}function C(t,e){if(1&t&&(o.TgZ(0,"tui-data-list",5),o.YNc(1,x,2,2,"button",6),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngForOf",t.modes)}}function M(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tui-primitive-textfield",8),o.NdJ("valueChange",(function(e){return o.CHM(t),o.oxw().onHexChange(e)})),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("maskito",t.hexMask)("tuiTextfieldLabelOutside",!0)("value",t.hex)}}function S(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tui-input-count",9),o.NdJ("ngModelChange",(function(e){o.CHM(t);const n=o.oxw();return n.onRgbChange(e,n.color[1],n.color[2],n.color[3])})),o.qZA(),o.TgZ(1,"tui-input-count",9),o.NdJ("ngModelChange",(function(e){o.CHM(t);const n=o.oxw();return n.onRgbChange(n.color[0],e,n.color[2],n.color[3])})),o.qZA(),o.TgZ(2,"tui-input-count",9),o.NdJ("ngModelChange",(function(e){o.CHM(t);const n=o.oxw();return n.onRgbChange(n.color[0],n.color[1],e,n.color[3])})),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("hideButtons",!0)("max",255)("ngModel",t.color[0])("tuiTextfieldLabelOutside",!0),o.xp6(1),o.Q6J("hideButtons",!0)("max",255)("ngModel",t.color[1])("tuiTextfieldLabelOutside",!0),o.xp6(1),o.Q6J("hideButtons",!0)("max",255)("ngModel",t.color[2])("tuiTextfieldLabelOutside",!0)}}let A=(()=>{class t{constructor(){this.color=[0,0,0,1],this.colorChange=new o.vpe,this.hexMask={mask:new RegExp("^[A-F\\d]{0,6}$","gi")},this.modes=["HEX","RGB"],this.mode=this.modes[0]}get isHex(){return this.mode===this.modes[0]}get hex(){return(0,i.WSX)(this.color[0],this.color[1],this.color[2]).replace("#","")}get opacity(){return Math.round(100*this.color[3])}onHexChange(t){if(6!==t.length)return;const e=(0,i.ROF)(t);this.updateColor([e[0],e[1],e[2],this.color[3]])}onRgbChange(...t){this.updateColor(t)}updateColor(t){this.color=t,this.colorChange.emit(t)}}return t.ɵfac=function(e){return new(e||t)},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-color-edit"]],inputs:{color:"color"},outputs:{colorChange:"colorChange"},decls:6,vars:8,consts:[["tuiDropdownAlign","left","tuiDropdownLimitWidth","min","tuiTextfieldSize","m",1,"t-select","tui-group__auto-width-item",3,"tuiTextfieldLabelOutside","ngModel","ngModelChange"],["size","s",4,"tuiDataList"],["tuiTextfieldSize","m","tuiValueAccessor","",3,"maskito","tuiTextfieldLabelOutside","value","valueChange",4,"ngIf","ngIfElse"],["rgb",""],["tuiTextfieldPostfix","%","tuiTextfieldSize","m",1,"t-opacity","tui-group__auto-width-item",3,"hideButtons","max","ngModel","tuiTextfieldLabelOutside","ngModelChange"],["size","s"],["tuiOption","",3,"value",4,"ngFor","ngForOf"],["tuiOption","",3,"value"],["tuiTextfieldSize","m","tuiValueAccessor","",3,"maskito","tuiTextfieldLabelOutside","value","valueChange"],["tuiTextfieldSize","m",3,"hideButtons","max","ngModel","tuiTextfieldLabelOutside","ngModelChange"]],template:function(t,e){if(1&t&&(o.TgZ(0,"tui-select",0),o.NdJ("ngModelChange",(function(t){return e.mode=t})),o.YNc(1,C,2,1,"tui-data-list",1),o.qZA(),o.YNc(2,M,1,3,"tui-primitive-textfield",2),o.YNc(3,S,3,12,"ng-template",null,3,o.W1O),o.TgZ(5,"tui-input-count",4),o.NdJ("ngModelChange",(function(t){return e.onRgbChange(e.color[0],e.color[1],e.color[2],t/100)})),o.qZA()),2&t){const t=o.MAs(4);o.Q6J("tuiTextfieldLabelOutside",!0)("ngModel",e.mode),o.xp6(2),o.Q6J("ngIf",e.isHex)("ngIfElse",t),o.xp6(3),o.Q6J("hideButtons",!0)("max",100)("ngModel",e.opacity)("tuiTextfieldLabelOutside",!0)}},directives:[r.u,s.O,a.Ek,l.s,c.x,d.JJ,d.On,u.g,h.O5,p.E,f.a,m.T,g.q,h.sg,b.v,v.y,y.B,w.n,k.ro],styles:["[_nghost-%COMP%]{display:flex}.t-select[_ngcontent-%COMP%]{width:4.875rem}.t-opacity[_ngcontent-%COMP%]{width:4.275rem}"],changeDetection:0}),t})()},49294:(t,e,n)=>{n.d(e,{$:()=>c});var o=n(97582),i=n(74788),r=n(91211),s=n(64642),a=n(79012),l=n(74331);class c{constructor(t){this.sanitizer=t,this.colorChange=new i.vpe,this.point=[0,1],this.hue=0,this.opacity=1}set color(t){if(this.currentColor.every(((e,n)=>e===t[n]))&&t[3]===this.opacity)return;const[e,n,o]=(0,s.bDt)(t[0],t[1],t[2]);this.opacity=t[3],this.hue=e/360,this.point=[n,1-o/255]}get currentColor(){return this.getCurrentColor(this.hue,this.point)}get base(){return`rgb(${(0,s.qZG)(360*this.hue,1,255)})`}get gradient(){return this.sanitizer.bypassSecurityTrustStyle(`linear-gradient(to right, rgba(${this.currentColor.join(",")}, 0), rgb(${this.currentColor.join(",")}))`)}onPointChange(t){this.point=t,this.updateColor()}onHueChange(t){this.hue=t,this.updateColor()}onOpacityChange(t){this.opacity=(0,s.FGw)(t,2),this.updateColor()}getCurrentColor(t,e){return(0,s.qZG)(360*t,e[0],255*(1-e[1]))}updateColor(){this.colorChange.emit([...this.currentColor,this.opacity])}}c.ɵfac=function(t){return new(t||c)(i.Y36(r.H7))},c.ɵcmp=i.Xpm({type:c,selectors:[["tui-color-picker"]],inputs:{color:"color"},outputs:{colorChange:"colorChange"},decls:5,vars:7,consts:[[1,"t-flat",3,"value","valueChange"],[1,"t-wrapper","t-wrapper_hue"],[1,"t-hue",3,"value","valueChange"],[1,"t-wrapper","t-wrapper_opacity"],[1,"t-opacity",3,"value","valueChange"]],template:function(t,e){1&t&&(i.TgZ(0,"tui-flat-picker",0),i.NdJ("valueChange",(function(t){return e.onPointChange(t)})),i.qZA(),i.TgZ(1,"div",1),i.TgZ(2,"tui-linear-picker",2),i.NdJ("valueChange",(function(t){return e.onHueChange(t)})),i.qZA(),i.qZA(),i.TgZ(3,"div",3),i.TgZ(4,"tui-linear-picker",4),i.NdJ("valueChange",(function(t){return e.onOpacityChange(t)})),i.qZA(),i.qZA()),2&t&&(i.Udp("background-color",e.base),i.Q6J("value",e.point),i.xp6(2),i.Q6J("value",e.hue),i.xp6(1),i.Udp("background",e.gradient),i.xp6(1),i.Q6J("value",e.opacity))},directives:[a.J,l.P],styles:['[_nghost-%COMP%]{position:relative;z-index:0;display:block}.t-flat[_ngcontent-%COMP%]{height:14rem;background:linear-gradient(rgba(0,0,0,0),#000000),linear-gradient(to right,#ffffff,rgba(255,255,255,0));margin-bottom:.25rem;overflow:hidden}.t-wrapper[_ngcontent-%COMP%]{position:relative;margin:1rem 1.25rem;border-radius:.5rem}.t-wrapper[_ngcontent-%COMP%]:after{position:absolute;top:0;left:0;width:100%;height:100%;content:"";box-shadow:inset 0 0 0 1px #00000014;pointer-events:none;border-radius:inherit}.t-wrapper_hue[_ngcontent-%COMP%]{background:#ff0000}.t-wrapper_opacity[_ngcontent-%COMP%]:before{position:absolute;top:0;left:0;width:100%;height:100%;content:"";z-index:-1;background-image:linear-gradient(45deg,var(--tui-base-03) 25%,transparent 25%,transparent 75%,var(--tui-base-03) 75%,var(--tui-base-03)),linear-gradient(45deg,var(--tui-base-03) 25%,transparent 25%,transparent 75%,var(--tui-base-03) 75%,var(--tui-base-03));background-size:.375rem .375rem;background-position:0 0,.1875rem .1875rem;border-radius:inherit}.t-hue[_ngcontent-%COMP%]{background:linear-gradient(to right,#ff0000,#ffff00,#00ff00,#00ffff,#0000ff,#ff00ff,#ff0000);border-radius:inherit;margin:0 .5rem}.t-opacity[_ngcontent-%COMP%]{border-radius:inherit;margin:0 .5rem}'],changeDetection:0}),(0,o.gn)([s.UMq],c.prototype,"getCurrentColor",null)},26383:(t,e,n)=>{n.d(e,{s:()=>_});var o=n(97582),i=n(74788),r=n(91211),s=n(64642),a=n(71831),l=n(39425),c=n(98778),d=n(18289),u=n(12057),h=n(49294),p=n(77825),f=n(22545),m=n(91283),g=n(7176),b=n(44099),v=n(13938),y=n(10406),w=n(63790),k=n(51928),x=n(13449),C=n(20690),M=n(59113);function S(t,e){if(1&t&&i._UZ(0,"tui-svg",9),2&t){const t=i.oxw(),e=i.MAs(1);i.ekj("t-arrow_rotated",e.open),i.Q6J("src",t.options.icons.colorSelectorDropdownChevron)}}function A(t,e){if(1&t&&i._UZ(0,"tui-svg",14),2&t){const t=i.oxw(3);i.Q6J("src",t.options.icons.colorSelectorDropdownCheck)}}function O(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",12),i.NdJ("click",(function(){const e=i.CHM(t).$implicit,n=i.oxw(2),o=i.MAs(1);return n.onModeSelect(e,o)}))("keydown.enter.prevent",(function(){const e=i.CHM(t).$implicit,n=i.oxw(2),o=i.MAs(1);return n.onModeSelect(e,o)}))("keydown.space.prevent",(function(){const e=i.CHM(t).$implicit,n=i.oxw(2),o=i.MAs(1);return n.onModeSelect(e,o)})),i._uU(1),i.YNc(2,A,1,1,"tui-svg",13),i.qZA()}if(2&t){const t=e.$implicit,n=i.oxw(2);i.uIk("aria-checked",n.isModeActive(t)),i.xp6(1),i.hij(" ",t," "),i.xp6(1),i.Q6J("ngIf",n.isModeActive(t))}}function T(t,e){if(1&t&&(i.TgZ(0,"tui-data-list",10),i.YNc(1,O,3,3,"button",11),i.qZA()),2&t){const t=i.oxw();i.xp6(1),i.Q6J("ngForOf",t.modes)}}function N(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",20),i.NdJ("click",(function(){const e=i.CHM(t).$implicit;return i.oxw(2).onDirectionChange(e)})),i.qZA()}if(2&t){const t=e.$implicit,n=i.oxw(2);i.ekj("t-direction_active",n.isDirectionActive(t)),i.Q6J("icon",n.getIcon(t))("tuiHint",t)}}function E(t,e){if(1&t){const t=i.EpF();i.ynx(0),i._UZ(1,"hr",15),i.TgZ(2,"div",16),i.TgZ(3,"tui-linear-multi-picker",17),i.NdJ("indexChange",(function(e){return i.CHM(t),i.oxw().onIndexChange(e)}))("valueChange",(function(e){return i.CHM(t),i.oxw().onStopsChange(e)})),i.qZA(),i.qZA(),i.TgZ(4,"div",18),i.YNc(5,N,1,4,"button",19),i.qZA(),i.BQk()}if(2&t){const t=i.oxw();i.xp6(2),i.Udp("background",t.gradient),i.xp6(1),i.Q6J("value",t.stopsKeys),i.xp6(2),i.Q6J("ngForOf",t.buttons)}}function I(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-color-edit",21),i.NdJ("colorChange",(function(e){return i.CHM(t),i.oxw().onColorChange(e)})),i.qZA()}if(2&t){const t=i.oxw();i.Q6J("color",t.color)}}function D(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-palette",22),i.NdJ("selectedColor",(function(e){return i.CHM(t),i.oxw().onPalettePick(e)})),i.qZA()}if(2&t){const t=i.oxw();i.Q6J("colors",t.palette)}}const P=[0,0,0,0],H=[[0,[0,0,0,1]],[1,[255,255,255,1]]],L={"to top right":"tuiIconArrowUpRight","to right":"tuiIconArrowRight","to bottom right":"tuiIconArrowDownRight","to bottom":"tuiIconArrowDown","to bottom left":"tuiIconArrowDownLeft","to left":"tuiIconArrowLeft","to top left":"tuiIconArrowUpLeft","to top":"tuiIconArrowUp"};class _{constructor(t,e,n){this.options=t,this.sanitizer=e,this.modes=n,this.stops=new Map(H),this.currentStop=0,this.direction="to bottom",this.colors=new Map,this.colorChange=new i.vpe,this.color=[0,0,0,1],this.currentMode=this.modes[0],this.buttons=["to top right","to right","to bottom right","to bottom","to bottom left","to left","to top left","to top"]}set colorSetter(t){this.parse(t)}get palette(){return this.filterPalette(this.colors,this.isGradient)}get stopsKeys(){return this.getStopsKeys(this.stops)}get currentColor(){return this.isGradient?this.getStop(this.currentStop):this.color}get gradient(){return this.sanitizer.bypassSecurityTrustStyle(this.getGradient("to right"))}get isGradient(){return this.currentMode===this.modes[1]}getIcon(t){return L[t]}isModeActive(t){return this.currentMode===t}isDirectionActive(t){return this.direction===t}onPalettePick(t){this.updateColor(t)}onDirectionChange(t){this.direction=t,this.updateColor(this.getGradient(t))}onModeSelect(t,e){this.currentMode=t,e.open=!1,this.updateColor(t===this.modes[0]?`rgba(${this.color.join(", ")})`:this.getGradient(this.direction))}onIndexChange(t){this.currentStop=this.stopsKeys[t]}onColorChange(t){this.isGradient?(this.stops.set(this.currentStop,t),this.updateColor(this.getGradient(this.direction))):this.updateColor(`rgba(${t.join(", ")})`)}onStopsChange(t){const e=this.stopsKeys.find((e=>!t.includes(e))),n=t.find((t=>!this.stopsKeys.includes(t)));void 0===e&&void 0!==n&&this.addStop(n),void 0!==e&&void 0===n&&this.removeStop(e),void 0!==e&&void 0!==n&&this.replaceStop(e,n),this.updateColor(this.getGradient(this.direction))}getStopsKeys(t){return Array.from(t.keys())}filterPalette(t,e){const n=new Map(t);return n.forEach(((t,o)=>{(t.startsWith("linear-gradient")&&!e||!t.startsWith("linear-gradient")&&e)&&n.delete(o)})),n}updateColor(t){this.colorChange.emit(t)}getGradient(t){return`linear-gradient(${t}, ${[...this.stopsKeys].sort(s.A2j).map((t=>`rgba(${this.getStop(t).join(", ")}) ${100*t}%`)).join(", ")})`}getStop(t){return this.stops.get(t)||P}addStop(t){const e=this.stopsKeys.reduce(((e,n)=>Math.abs(n-t)o===t?[e,n]:[o,this.getStop(o)])))}parse(t){t.startsWith("linear-gradient")?this.parseGradient(t):this.parseColor(t)}parseGradient(t){if(t===this.getGradient(this.direction))return;const e=(0,l._N)((0,l.U5)(t));this.currentMode=this.modes[1],this.direction=e.side,this.currentStop=0,this.stops=new Map(e.stops.length?e.stops.map((({color:t,position:e})=>[parseFloat(e)/100,(0,s.MpC)(t)])):H)}parseColor(t){this.currentMode=this.modes[0],this.currentStop=0,this.color=(0,s.MpC)(t)}}_.ɵfac=function(t){return new(t||_)(i.Y36(a.mJ),i.Y36(r.H7),i.Y36(a.dj))},_.ɵcmp=i.Xpm({type:_,selectors:[["tui-color-selector"]],inputs:{colors:"colors",colorSetter:["color","colorSetter"]},outputs:{colorChange:"colorChange"},decls:12,vars:7,consts:[[1,"t-select",3,"content"],["dropdown",""],["appearance","","size","s","tuiButton","","type","button",3,"iconRight"],["arrow",""],["menu",""],[4,"ngIf"],[3,"color","colorChange"],["tuiGroup","","class","t-edit",3,"color","colorChange",4,"ngIf"],["class","t-palette",3,"colors","selectedColor",4,"ngIf"],[1,"t-arrow",3,"src"],["role","menu","size","s",1,"t-menu"],["role","menuitemradio","tuiOption","",3,"click","keydown.enter.prevent","keydown.space.prevent",4,"ngFor","ngForOf"],["role","menuitemradio","tuiOption","",3,"click","keydown.enter.prevent","keydown.space.prevent"],["class","t-checkmark",3,"src",4,"ngIf"],[1,"t-checkmark",3,"src"],[1,"t-hr"],[1,"t-wrapper"],[1,"t-gradient",3,"value","indexChange","valueChange"],[1,"t-buttons"],["appearance","","size","xs","tuiHintDescribe","","tuiIconButton","","type","button","class","t-direction",3,"t-direction_active","icon","tuiHint","click",4,"ngFor","ngForOf"],["appearance","","size","xs","tuiHintDescribe","","tuiIconButton","","type","button",1,"t-direction",3,"icon","tuiHint","click"],["tuiGroup","",1,"t-edit",3,"color","colorChange"],[1,"t-palette",3,"colors","selectedColor"]],template:function(t,e){if(1&t&&(i.TgZ(0,"tui-hosted-dropdown",0,1),i.TgZ(2,"button",2),i._uU(3),i.qZA(),i.YNc(4,S,1,3,"ng-template",null,3,i.W1O),i.YNc(6,T,2,1,"ng-template",null,4,i.W1O),i.qZA(),i.YNc(8,E,6,4,"ng-container",5),i.TgZ(9,"tui-color-picker",6),i.NdJ("colorChange",(function(t){return e.onColorChange(t)})),i.qZA(),i.YNc(10,I,1,1,"tui-color-edit",7),i.YNc(11,D,1,1,"tui-palette",8)),2&t){const t=i.MAs(5),n=i.MAs(7);i.Q6J("content",n),i.xp6(2),i.Q6J("iconRight",t),i.xp6(1),i.hij(" ",e.currentMode," "),i.xp6(5),i.Q6J("ngIf",e.isGradient),i.xp6(1),i.Q6J("color",e.currentColor),i.xp6(1),i.Q6J("ngIf",!e.isGradient),i.xp6(1),i.Q6J("ngIf",e.palette.size)}},directives:[c.o,d.v,u.O5,h.$,p.P,f.q,u.sg,m.v,g.e,b.$,v.D,y.x,w.t,k.D,x.h,C.g,M.R],styles:['[_nghost-%COMP%]{position:relative;z-index:0;display:block;width:22.6rem}.t-wrapper[_ngcontent-%COMP%]{position:relative;margin:1.25rem;border-radius:.5rem}.t-wrapper[_ngcontent-%COMP%]:after{position:absolute;top:0;left:0;width:100%;height:100%;content:"";box-shadow:inset 0 0 0 1px #00000014;pointer-events:none;border-radius:inherit}.t-wrapper[_ngcontent-%COMP%]:before{position:absolute;top:0;left:0;width:100%;height:100%;content:"";z-index:-1;background-image:linear-gradient(45deg,var(--tui-base-03) 25%,transparent 25%,transparent 75%,var(--tui-base-03) 75%,var(--tui-base-03)),linear-gradient(45deg,var(--tui-base-03) 25%,transparent 25%,transparent 75%,var(--tui-base-03) 75%,var(--tui-base-03));background-size:.375rem .375rem;background-position:0 0,.1875rem .1875rem;border-radius:inherit}.t-hr[_ngcontent-%COMP%]{height:1px;margin:0 0 0 -1px;border:none;background:var(--tui-base-03)}.t-gradient[_ngcontent-%COMP%]{margin:0 .5rem;border-radius:inherit}.t-select[_ngcontent-%COMP%]{margin:.75rem .5rem}.t-arrow[_ngcontent-%COMP%]{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-arrow_rotated[_ngcontent-%COMP%]{transform:rotate(180deg)}.t-menu[_ngcontent-%COMP%]{width:11.25rem}.t-checkmark[_ngcontent-%COMP%]{margin-left:auto;width:1rem;height:1rem}.t-buttons[_ngcontent-%COMP%]{display:flex;padding:0 .75rem 1.25rem}.t-direction[_ngcontent-%COMP%]{color:var(--tui-text-02);margin:0 .375rem}.t-direction[_ngcontent-%COMP%]:hover, .t-direction_active[_ngcontent-%COMP%]{color:var(--tui-text-01);background:var(--tui-secondary-hover)}.t-edit[_ngcontent-%COMP%]{margin:1.25rem}.t-palette[_ngcontent-%COMP%]{box-sizing:border-box;box-shadow:inset 0 1px var(--tui-base-03)}'],changeDetection:0}),(0,o.gn)([s.UMq],_.prototype,"getStopsKeys",null),(0,o.gn)([s.UMq],_.prototype,"filterPalette",null)},79012:(t,e,n)=>{n.d(e,{J:()=>s});var o=n(74788),i=n(64642),r=n(20755);let s=(()=>{class t{constructor(t){this.value=[0,0],this.valueChange=new o.vpe,t.subscribe((t=>{this.value=t,this.valueChange.emit([t[0],t[1]])}))}get left(){return 100*this.value[0]}get top(){return 100*this.value[1]}}return t.ɵfac=function(e){return new(e||t)(o.Y36(r.i))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-flat-picker"]],inputs:{value:"value"},outputs:{valueChange:"valueChange"},features:[o._Bn([i.a31,r.i])],decls:1,vars:4,consts:[[1,"t-circle"]],template:function(t,e){1&t&&o._UZ(0,"div",0),2&t&&o.Udp("left",e.left,"%")("top",e.top,"%")},styles:["[_nghost-%COMP%]{position:relative;display:block}.t-circle[_ngcontent-%COMP%]{position:absolute;width:1rem;height:1rem;border-radius:100%;margin:-.5rem 0 0 -.5rem;box-shadow:inset 0 0 0 1px var(--tui-base-01),0 0 0 1px var(--tui-base-03)}"],changeDetection:0}),t})()},96472:(t,e,n)=>{n.d(e,{H9:()=>h,wl:()=>g,VM:()=>m}),n(13449);var o=n(12057),i=n(24751),r=n(45642),s=n(67274),a=n(78639),l=n(74788);let c=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,i.u5,r.U5,a.SCC,a.Jyo,s.KWI,s.cnw,s.dpK,a.$HZ,s.pcV]]}),t})();n(49294);let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez]]}),t})(),u=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez]]}),t})(),h=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,d,u]]}),t})();n(26383);var p=n(64642);let f=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez]]}),t})(),m=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,s.goS]]}),t})(),g=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,s.fNO,s.jhF,h,f,s.goS,s.EIu,s.pcV,p.Ah6,c,s.n6B,m]]}),t})();n(79012),n(7176),n(74331),n(59113)},7176:(t,e,n)=>{n.d(e,{e:()=>l});var o=n(74788),i=n(64642),r=n(20755),s=n(12057);function a(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",1),o.NdJ("dblclick",(function(){const e=o.CHM(t).index;return o.oxw().onClick(e)}))("mousedown",(function(){const e=o.CHM(t).index;return o.oxw().onMouseDown(e)})),o.qZA()}if(2&t){const t=e.$implicit;o.Udp("left",100*t,"%")}}let l=(()=>{class t{constructor(t){this.value=[0,1],this.valueChange=new o.vpe,this.indexChange=new o.vpe,this.index=NaN,t.subscribe((([t])=>{this.onPicker(t)}))}onMouseUp(){this.index=NaN}onMouseDown(t){this.updateIndex(t)}onClick(t){this.value.length>2&&this.updateValue(this.value.filter(((e,n)=>n!==t)))}onPicker(t){Number.isNaN(this.index)&&(this.updateIndex(this.value.length),this.value=[...this.value,0]),this.value.some(((e,n)=>e===t&&n!==this.index))||this.updateValue(this.value.map(((e,n)=>n===this.index?t:e)))}updateIndex(t){this.index=t,this.indexChange.emit(t)}updateValue(t){this.value=t,this.valueChange.emit(t)}}return t.ɵfac=function(e){return new(e||t)(o.Y36(r.i))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-linear-multi-picker"]],hostBindings:function(t,e){1&t&&o.NdJ("mouseup",(function(){return e.onMouseUp()}),!1,o.evT)},inputs:{value:"value"},outputs:{valueChange:"valueChange",indexChange:"indexChange"},features:[o._Bn([i.a31,r.i])],decls:1,vars:1,consts:[["class","t-circle",3,"left","dblclick","mousedown",4,"ngFor","ngForOf"],[1,"t-circle",3,"dblclick","mousedown"]],template:function(t,e){1&t&&o.YNc(0,a,1,2,"div",0),2&t&&o.Q6J("ngForOf",e.value)},directives:[s.sg],styles:["[_nghost-%COMP%]{position:relative;display:block;height:1rem;box-sizing:border-box}.t-circle[_ngcontent-%COMP%]{position:absolute;width:1rem;height:1rem;border-radius:100%;margin:0 -.5rem;box-shadow:inset 0 0 0 2px var(--tui-base-01),0 0 0 1px var(--tui-base-03)}"],changeDetection:0}),t})()},74331:(t,e,n)=>{n.d(e,{P:()=>s});var o=n(74788),i=n(64642),r=n(20755);let s=(()=>{class t{constructor(t){this.value=0,this.valueChange=new o.vpe,t.subscribe((([t])=>{this.value=t,this.valueChange.emit(t)}))}get left(){return 100*this.value}}return t.ɵfac=function(e){return new(e||t)(o.Y36(r.i))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-linear-picker"]],inputs:{value:"value"},outputs:{valueChange:"valueChange"},features:[o._Bn([i.a31,r.i])],decls:1,vars:2,consts:[[1,"t-circle"]],template:function(t,e){1&t&&o._UZ(0,"div",0),2&t&&o.Udp("left",e.left,"%")},styles:["[_nghost-%COMP%]{position:relative;display:block;height:1rem;box-sizing:border-box}.t-circle[_ngcontent-%COMP%]{position:absolute;width:1rem;height:1rem;border-radius:100%;margin:0 -.5rem;box-shadow:inset 0 0 0 2px var(--tui-base-01),0 0 0 1px var(--tui-base-03)}"],changeDetection:0}),t})()},59113:(t,e,n)=>{n.d(e,{R:()=>u});var o=n(74788),i=n(12057),r=n(13938),s=n(10406),a=n(63790),l=n(51928),c=n(44099);function d(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",1),o.NdJ("click",(function(){const e=o.CHM(t).$implicit;return o.oxw().selectedColor.emit(e.value)})),o.qZA()}if(2&t){const t=e.$implicit;o.Udp("background",t.value),o.Q6J("id",t.key)("tuiHint",t.key)("tuiHintDescribe",t.key)}}let u=(()=>{class t{constructor(){this.colors=new Map,this.selectedColor=new o.vpe,this.originalOrder=(t,e)=>0}}return t.ɵfac=function(e){return new(e||t)},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-palette"]],inputs:{colors:"colors"},outputs:{selectedColor:"selectedColor"},decls:2,vars:4,consts:[["type","button","class","t-button",3,"id","background","tuiHint","tuiHintDescribe","click",4,"ngFor","ngForOf"],["type","button",1,"t-button",3,"id","tuiHint","tuiHintDescribe","click"]],template:function(t,e){1&t&&(o.YNc(0,d,1,5,"button",0),o.ALo(1,"keyvalue")),2&t&&o.Q6J("ngForOf",o.xi3(1,1,e.colors,e.originalOrder))},directives:[i.sg,r.D,s.x,a.t,l.D,c.$],pipes:[i.Nd],styles:["[_nghost-%COMP%]{display:flex;flex-wrap:wrap;padding:.875rem}.t-button[_ngcontent-%COMP%]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;width:1.5625rem;height:1.5625rem;box-sizing:border-box;margin:.375rem;border-radius:var(--tui-radius-m);border:1px solid rgba(0,0,0,.08)}"],changeDetection:0}),t})()},41039:(t,e,n)=>{n.d(e,{l:()=>T});var o=n(12057),i=n(74788),r=n(64642),s=n(18892),a=n(86114),l=n(71831),c=n(68838),d=n(36866),u=n(30528),h=n(24751),p=n(77825),f=n(18289),m=n(73460),g=n(96281),b=n(79550);let v=(()=>{class t{transform(t,e,n){return"#"===e?t.filter((t=>t!==n)):t}}return t.ɵfac=function(e){return new(e||t)},t.ɵpipe=i.Yjl({name:"tuiFilterAnchors",type:t,pure:!0}),t})();function y(t,e){1&t&&(i.ynx(0),i._uU(1,"Edit anchor"),i.BQk())}function w(t,e){1&t&&(i.TgZ(0,"span"),i._uU(1,"Link to anchor"),i.qZA())}function k(t,e){1&t&&(i.TgZ(0,"span"),i._uU(1,"URL"),i.qZA())}function x(t,e){if(1&t&&(i.YNc(0,w,2,0,"span",1),i.YNc(1,k,2,0,"ng-template",null,12,i.W1O)),2&t){const t=i.MAs(2),e=i.oxw(2);i.Q6J("ngIf",e.prefixIsHashMode)("ngIfElse",t)}}function C(t,e){if(1&t&&(i.ynx(0),i._uU(1),i.BQk()),2&t){const t=e.ngIf,n=i.oxw(2);i.xp6(1),i.hij(" ",n.prefixIsHashMode?t.anchorExample:t.urlExample," ")}}function M(t,e){if(1&t){const t=i.EpF();i.ynx(0),i.TgZ(1,"label",4),i.TgZ(2,"div",5),i.YNc(3,y,2,0,"ng-container",1),i.YNc(4,x,3,2,"ng-template",null,6,i.W1O),i.qZA(),i.TgZ(6,"div",7),i.TgZ(7,"div",8),i._uU(8),i.qZA(),i.TgZ(9,"tui-input-inline",9),i.NdJ("ngModelChange",(function(e){return i.CHM(t),i.oxw().url=e}))("input",(function(e){let n;return i.CHM(t),i.oxw().onChange(null==(n=e.target)?null:n.value)}))("keydown.backspace",(function(){return i.CHM(t),i.oxw().onBackspace()}))("keydown.prevent.enter",(function(){return i.CHM(t),i.oxw().onSave()})),i.YNc(10,C,2,1,"ng-container",3),i.ALo(11,"async"),i.qZA(),i.qZA(),i.qZA(),i.TgZ(12,"tui-svg",10),i.NdJ("click",(function(){return i.CHM(t),i.oxw().onClear()})),i.qZA(),i.TgZ(13,"button",11),i.NdJ("click",(function(){return i.CHM(t),i.oxw().onSave()})),i.qZA(),i.BQk()}if(2&t){const t=i.MAs(5),e=i.oxw();i.xp6(3),i.Q6J("ngIf",e.anchorMode)("ngIfElse",t),i.xp6(5),i.Oqu(e.prefix),i.xp6(1),i.ekj("t-input_filled",e.hasUrl),i.Q6J("ngModel",e.url),i.xp6(1),i.Q6J("ngIf",i.lcZ(11,11,e.texts$)),i.xp6(2),i.ekj("t-cleaner_hidden",!e.hasUrl),i.Q6J("src",e.options.icons.popupLinkRemove),i.xp6(1),i.Q6J("icon",e.options.icons.popupLinkSave)}}function S(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"a",13),i._uU(1),i.ALo(2,"tuiShortUrl"),i.qZA(),i.TgZ(3,"button",14),i.NdJ("click",(function(){return i.CHM(t),i.oxw().onEdit()})),i.qZA(),i.TgZ(4,"button",15),i.NdJ("click",(function(){return i.CHM(t),i.oxw().onRemove()})),i.qZA()}if(2&t){const t=i.oxw();i.Q6J("href",t.href,i.LSH)("icon",t.prefixIsHashMode?"tuiIconHash":"tuiIconExternalLink"),i.xp6(1),i.hij(" ",i.lcZ(2,5,t.url)," "),i.xp6(2),i.Q6J("icon",t.options.icons.popupPreviewLinkEdit),i.xp6(1),i.Q6J("icon",t.options.icons.popupPreviewLinkClear)}}function A(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",19),i.NdJ("click",(function(){const e=i.CHM(t).$implicit;return i.oxw(2).setAnchor(e)})),i._uU(1),i.qZA()}if(2&t){const t=e.$implicit;i.xp6(1),i.hij(" #",t," ")}}function O(t,e){if(1&t&&(i.ynx(0),i._UZ(1,"hr",16),i.TgZ(2,"tui-scrollbar"),i.TgZ(3,"div",17),i.YNc(4,A,2,1,"button",18),i.ALo(5,"tuiFilterAnchors"),i.qZA(),i.qZA(),i.BQk()),2&t){const t=i.oxw();i.xp6(4),i.Q6J("ngForOf",i.Dn7(5,1,t.anchorIds,t.prefix,t.url))}}let T=(()=>{class t{constructor(t,e,n,o){this.doc=t,this.texts$=e,this.editor=n,this.options=o,this.isOnlyAnchorMode=this.detectAnchorMode(),this.addLink=new i.vpe,this.removeLink=new i.vpe,this.url=this.getHrefOrAnchorId(),this.edit=!this.url,this.prefix=this.makeDefaultPrefix(),this.anchorIds=this.getAllAnchorsIds()}get defaultProtocol(){var t,e;return null!==(e=null===(t=this.options.linkOptions)||void 0===t?void 0:t.protocol)&&void 0!==e?e:s.Ci}set anchorMode(t){this.isOnlyAnchorMode=t,this.prefix=t?s._s:this.makeDefaultPrefix()}get anchorMode(){return this.isOnlyAnchorMode}get prefixIsHashMode(){return this.prefix===s._s}get hasUrl(){return!!this.url}get href(){return`${this.prefix}${this.url}`}get showAnchorsList(){return!this.anchorMode&&this.edit&&this.anchorIds.length>0}get isViewMode(){return!this.edit}onSelectionChange(){this.isViewMode&&(this.url=this.getHrefOrAnchorId(),this.anchorMode=this.detectAnchorMode())}onMouseDown(t){(0,r.veZ)(t.target)&&!t.target.matches("a, button, input")&&t.preventDefault()}setAnchor(t){this.url=t,this.changePrefix(!0)}changePrefix(t){this.prefix=t?s._s:this.defaultProtocol}onSave(){this.url?this.addLink.emit(this.href):this.removeLink.emit()}onBackspace(){this.url||(this.prefix=this.isOnlyAnchorMode?s._s:this.defaultProtocol)}onEdit(){this.edit=!0}onRemove(){this.removeLink.emit()}onChange(t){this.url=this.removePrefix(t)}onClear(){this.url=""}makeDefaultPrefix(){var t,e;const n=this.getAnchorElement(),o=(0,c.$)(null!==(t=null==n?void 0:n.getAttribute("href"))&&void 0!==t?t:"").prefix||this.defaultProtocol;return n&&(!n.getAttribute("href")&&n.getAttribute("id")||(null===(e=n.getAttribute("href"))||void 0===e?void 0:e.startsWith(s._s)))?s._s:o}detectAnchorMode(){const t=this.getAnchorElement();return!(null==t?void 0:t.href)&&!!(null==t?void 0:t.getAttribute("id"))}getFocusedParentElement(){var t,e;return(null===(e=null===(t=this.doc.getSelection())||void 0===t?void 0:t.focusNode)||void 0===e?void 0:e.parentElement)||null}getAnchorElement(){var t,e,n;const o=this.getFocusedParentElement();return null!==(n=null!==(t=null==o?void 0:o.closest("a"))&&void 0!==t?t:null===(e=null==o?void 0:o.querySelector("img"))||void 0===e?void 0:e.closest("a"))&&void 0!==n?n:null}getHrefOrAnchorId(){const t=this.getAnchorElement();return t?this.removePrefix(t.getAttribute("href")||t.getAttribute("id")||""):this.url}removePrefix(t){var e;const n=t.startsWith(s._s)||this.prefix===s._s?t:`${null!==(e=this.prefix)&&void 0!==e?e:""}${t}`,{prefix:o,path:i}=(0,c.$)(n),r=this.isOnlyAnchorMode||o===s._s||""===o&&this.prefix===s._s;return this.prefix=r?s._s:""===o?this.defaultProtocol:o,i}getAllAnchorsIds(){var t;const e=Array.from(null!==(t=this.editor.getOriginTiptapEditor().view.dom.querySelectorAll('[data-type="jump-anchor"]'))&&void 0!==t?t:[]);return Array.from(e).map((t=>t.getAttribute("id")||"")).filter(Boolean)}}return t.ɵfac=function(e){return new(e||t)(i.Y36(o.K0),i.Y36(l.b$),i.Y36(a.$3),i.Y36(l.mJ))},t.ɵcmp=i.Xpm({type:t,selectors:[["tui-edit-link"]],hostBindings:function(t,e){1&t&&i.NdJ("selectionchange",(function(){return e.onSelectionChange()}),!1,i.evT)("mousedown",(function(t){return e.onMouseDown(t)}))},inputs:{anchorMode:"anchorMode"},outputs:{addLink:"addLink",removeLink:"removeLink"},decls:5,vars:3,consts:[[1,"t-edit-link",3,"mousedown"],[4,"ngIf","ngIfElse"],["view",""],[4,"ngIf"],[1,"t-label"],[1,"t-label-properties"],["fullOptions",""],[1,"t-url"],[1,"t-prefix"],["tuiAutoFocus","",1,"t-input",3,"ngModel","ngModelChange","input","keydown.backspace","keydown.prevent.enter"],[1,"t-cleaner",3,"src","click"],["appearance","icon","shape","rounded","size","s","title","Insert link","tuiIconButton","","type","button",1,"t-button",3,"icon","click"],["urlTitle",""],["iconAlign","left","target","_blank","tuiLink","",1,"t-link",3,"href","icon"],["appearance","icon","shape","rounded","size","s","title","Change link","tuiIconButton","","type","button",1,"t-button","t-edit-button",3,"icon","click"],["appearance","icon","automation-id","toolbar__popup-link-clear-button","shape","rounded","size","s","title","Remove link","tuiIconButton","","type","button",1,"t-button",3,"icon","click"],[1,"t-hr"],[1,"t-anchor-list"],["type","button","class","t-anchor",3,"click",4,"ngFor","ngForOf"],["type","button",1,"t-anchor",3,"click"]],template:function(t,e){if(1&t&&(i.TgZ(0,"div",0),i.NdJ("mousedown",(function(t){return t.stopImmediatePropagation()})),i.YNc(1,M,14,13,"ng-container",1),i.YNc(2,S,5,7,"ng-template",null,2,i.W1O),i.qZA(),i.YNc(4,O,6,5,"ng-container",3)),2&t){const t=i.MAs(3);i.xp6(1),i.Q6J("ngIf",e.edit)("ngIfElse",t),i.xp6(3),i.Q6J("ngIf",e.showAnchorsList)}},directives:[o.O5,d.l,u.k,h.JJ,h.On,p.P,f.v,m.V,g.I,o.sg],pipes:[o.Ov,b.X,v],styles:["[_nghost-%COMP%]{display:block;min-width:18.75rem}.t-edit-link[_ngcontent-%COMP%]{display:flex;min-height:4rem;align-items:center;padding-right:.75rem}.t-label[_ngcontent-%COMP%]{font:var(--tui-font-text-s);height:var(--tui-height-l);box-sizing:border-box;padding:.4375rem 1rem;min-width:12.5rem;max-width:25rem;width:100%}.t-label-properties[_ngcontent-%COMP%]{display:flex;align-items:center;max-width:8.375rem;justify-content:space-between}.t-property_inactive[_ngcontent-%COMP%]{opacity:.5}.t-url[_ngcontent-%COMP%]{display:flex;font:var(--tui-font-text-m);color:var(--tui-text-02)}.t-input[_ngcontent-%COMP%]{flex:1}.t-input_filled[_ngcontent-%COMP%]{color:var(--tui-text-01)}.t-button[_ngcontent-%COMP%]{width:2rem;height:2rem;margin:0 .25rem;transition:background .2s}.t-edit-button[_ngcontent-%COMP%]{margin-left:auto}.t-link[_ngcontent-%COMP%]{margin:0 1rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.t-cleaner[_ngcontent-%COMP%]{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;color:var(--tui-base-06);cursor:pointer;margin-left:auto}.t-cleaner[_ngcontent-%COMP%]:hover{color:var(--tui-base-07)}.t-cleaner_hidden[_ngcontent-%COMP%]{visibility:hidden}.t-anchor-list[_ngcontent-%COMP%]{display:flex;max-height:12.5rem;flex-direction:column}.t-anchor[_ngcontent-%COMP%]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;background:none;font-size:inherit;line-height:inherit;min-height:2.75rem;padding:.375rem .5rem;margin:.125rem .5rem;border-radius:var(--tui-radius-m);text-align:left}.t-anchor[_ngcontent-%COMP%]:hover{background:var(--tui-base-02);cursor:pointer}"],changeDetection:0}),t})()},8674:(t,e,n)=>{n.d(e,{Fu:()=>c}),n(41039);var o=n(12057),i=n(24751),r=n(64642),s=n(67274),a=n(78639),l=n(74788);let c=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,i.u5,r.Q7V,s.fNO,s.EIu,s.jzK,a.z$l,a.YMv,s.Jyu]]}),t})();n(79550),n(68838)},79550:(t,e,n)=>{n.d(e,{X:()=>i});var o=n(74788);let i=(()=>{class t{transform(t){return t.length<60?t:`${t.slice(0,Math.max(0,40))}...${t.slice(t.length-10)}`}}return t.ɵfac=function(e){return new(e||t)},t.ɵpipe=o.Yjl({name:"tuiShortUrl",type:t,pure:!0}),t})()},68838:(t,e,n)=>{n.d(e,{$:()=>r});var o=n(64642),i=n(18892);function r(t=""){if(t.startsWith(i._s))return{prefix:i._s,path:t.slice(1)};const[e="",n=""]=t.includes(i.jU)?s(t):a(t);if(n.includes(i.DN)){const[t,e]=a(n);if(t&&e)return{prefix:t,path:e}}return{prefix:e,path:""===e?t:n}}function s(t=""){var e;const n=null!==(e=t.indexOf(i.jU))&&void 0!==e?e:-1,[o,r]=n>-1?[t.slice(0,n+i.jU.length),t.slice(n+i.jU.length,t.length)]:["",t],a=[o,r].filter(Boolean);return(null==r?void 0:r.includes("://"))&&a.length>1?s(r):a}function a(t=""){const[e,n]=t.split(/:/).slice(-2).filter(Boolean);return e&&n&&!(0,o.lj0)(t)?[`${e}:`,n]:[]}},61732:(t,e,n)=>{n.d(e,{V:()=>p});var o=n(74788),i=n(64642),r=n(76995),s=n(51703),a=n(12057);const l=function(){return[0,1]};function c(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.NdJ("tuiSizeChange",(function(e){return o.CHM(t),o.oxw().sizeChange.emit(e)})),o.qZA()}2&t&&o.Q6J("tuiResizer",o.DdM(1,l))}const d=function(t){return[t,0]},u=function(){return[1,0]},h=["*"];let p=(()=>{class t{constructor(){this.autoHeight=!1,this.width=null,this.height=null,this.sizeChange=new o.vpe}get hostWidth(){return(0,i.dtH)(this.width)?(0,i.O9r)(this.width):this.width}get hostHeight(){return this.autoHeight?null:(0,i.dtH)(this.height)?(0,i.O9r)(this.height):this.height}}return t.ɵfac=function(e){return new(e||t)},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-editor-resizable"]],hostVars:4,hostBindings:function(t,e){2&t&&o.Udp("width",e.hostWidth)("height",e.hostHeight)},inputs:{autoHeight:"autoHeight",width:"width",height:"height"},outputs:{sizeChange:"sizeChange"},ngContentSelectors:h,decls:5,vars:8,consts:[["tuiResizeable","",1,"t-resizable"],[1,"t-handle","t-handle-left-side",3,"tuiResizer","tuiSizeChange"],["class","t-handle t-handle-bottom-side",3,"tuiResizer","tuiSizeChange",4,"ngIf"],[1,"t-handle","t-handle-right-side",3,"tuiResizer","tuiSizeChange"],[1,"t-handle","t-handle-bottom-side",3,"tuiResizer","tuiSizeChange"]],template:function(t,e){1&t&&(o.F$t(),o.TgZ(0,"div",0),o.Hsn(1),o.TgZ(2,"div",1),o.NdJ("tuiSizeChange",(function(t){return e.sizeChange.emit(t)})),o.qZA(),o.YNc(3,c,1,2,"div",2),o.TgZ(4,"div",3),o.NdJ("tuiSizeChange",(function(t){return e.sizeChange.emit(t)})),o.qZA(),o.qZA()),2&t&&(o.ekj("t-resizable-auto-height",e.autoHeight),o.xp6(2),o.Q6J("tuiResizer",o.VKq(5,d,-1)),o.xp6(1),o.Q6J("ngIf",!e.autoHeight),o.xp6(1),o.Q6J("tuiResizer",o.DdM(7,u)))},directives:[r.U,s.L,a.O5],styles:['[_nghost-%COMP%]{position:relative;display:inline-block;box-sizing:border-box}[_nghost-%COMP%] .t-resizable[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%] .t-resizable-auto-height[_ngcontent-%COMP%]{height:auto!important}[_nghost-%COMP%] iframe[_ngcontent-%COMP%]{display:inline;pointer-events:none}[_nghost-%COMP%]:hover .t-handle[_ngcontent-%COMP%]:after{opacity:1}.t-handle[_ngcontent-%COMP%]{position:absolute;top:0;display:flex;width:.75rem;cursor:col-resize;justify-content:center;align-items:center;height:100%}.t-handle[_ngcontent-%COMP%]:after{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:"";width:50%;height:33%;box-sizing:border-box;border-radius:var(--tui-radius-m);background:var(--tui-base-08);border:1px solid var(--tui-base-03);opacity:0}.t-handle-left-side[_ngcontent-%COMP%]{left:0}.t-handle-bottom-side[_ngcontent-%COMP%]{top:unset;bottom:.3125rem;height:.95rem;width:100%}.t-handle-right-side[_ngcontent-%COMP%]{right:0}'],changeDetection:0}),t})()},12368:(t,e,n)=>{n.d(e,{_3:()=>l,Sl:()=>d});var o=n(64642),i=n(87187),r=n(66682),s=n(46782),a=n(74788);let l=(()=>{class t extends i.d{constructor(t,e){super(),this.doc=t,this.destroy$=e,this._height=0,this._width=0,(0,r.T)((0,o.mLY)(t,"touchend"),(0,o.mLY)(t,"mouseup")).pipe((0,s.R)(e)).subscribe((()=>this.updateAttributes({width:this.width,height:this.height})))}get attrs(){var t;return(null===(t=this.node)||void 0===t?void 0:t.attrs)||{src:""}}get width(){return this._width||this.attrs.width||null}get height(){return this._height||this.attrs.height||null}}return t.ɵfac=function(e){return new(e||t)(a.Y36(Document),a.Y36(o.a31))},t.ɵdir=a.lG2({type:t,features:[a.qOj]}),t})();n(61732);var c=n(12057);let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=a.oAB({type:t}),t.ɵinj=a.cJS({imports:[[c.ez,o.k54,o.gjW]]}),t})()},96152:(t,e,n)=>{n.d(e,{D:()=>l});var o=n(12057),i=n(74788),r=n(64642),s=n(67274),a=n(79698);let l=(()=>{class t{constructor(t,e,n,o,i,r){this.el=t,this.renderer=e,this.sanitizer=n,this.tuiSanitizer=o,this.document=i,this.editor=r}set content(t){var e;this.renderer.setProperty(this.el.nativeElement,"innerHTML",this.tuiSanitizer?this.tuiSanitizer.sanitize(i.q3G.HTML,null!==(e=null==t?void 0:t.replace(/colwidth/g,"width"))&&void 0!==e?e:""):this.sanitizer.sanitize(i.q3G.HTML,null!=t?t:""))}click(t){var e,n;if(this.editor||!(0,r.veZ)(t.target))return;const o=(null===(n=null===(e=t.target)||void 0===e?void 0:e.closest("a"))||void 0===n?void 0:n.getAttribute("href"))||"";o.startsWith("#")&&(this.document.location.hash=o.replace("#",""),t.preventDefault())}}return t.ɵfac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(i.Qsj),i.Y36(i.Tiy),i.Y36(s.hmb,8),i.Y36(o.K0),i.Y36(a.JU,8))},t.ɵcmp=i.Xpm({type:t,selectors:[["tui-editor-socket"]],hostAttrs:[1,"tui-editor-socket"],hostBindings:function(t,e){1&t&&i.NdJ("click",(function(t){return e.click(t)}))},inputs:{content:"content"},decls:0,vars:0,template:function(t,e){},styles:['.tui-editor-socket{display:block;margin:0;color:var(--tui-text-01);font:var(--tui-font-text-m)}.tui-editor-socket[tuiTiptapEditor]{overflow:hidden}.tui-editor-socket .ProseMirror{min-height:5.375rem;padding:.2rem 1rem;outline:none;white-space:pre-wrap}.tui-editor-socket .resize-cursor{cursor:ew-resize;cursor:col-resize}.tui-editor-socket h1,.tui-editor-socket h2,.tui-editor-socket h3,.tui-editor-socket h4,.tui-editor-socket h5,.tui-editor-socket h6{word-break:break-word;line-height:normal}.tui-editor-socket h1:first-child,.tui-editor-socket h2:first-child,.tui-editor-socket p:last-child{margin-bottom:0}.tui-editor-socket p:last-child,.tui-editor-socket pre:last-child{margin-bottom:0}.tui-editor-socket p:empty:after{content:" ";white-space:pre}.tui-editor-socket p:first-child{margin-top:0}.tui-editor-socket p{margin:1rem 0}.tui-editor-socket p>span{line-height:initial}.tui-editor-socket blockquote{margin:1.25rem 0 1.25rem 1.5rem;padding-left:1.0625rem;border-left:1px solid var(--tui-base-04)}.tui-editor-socket hr{border:none;border-top:1px solid var(--tui-base-03);margin:1rem 0}.tui-editor-socket mark{background:unset;color:inherit}.tui-editor-socket font[face="Courier New"]{display:inline-block;padding:.25rem .5rem;border-radius:.25rem;background-color:#ecf1f7;word-break:break-word}.tui-editor-socket a:not([data-type="jump-anchor"]){color:var(--tui-link);text-decoration:none;outline:none}.tui-editor-socket a:not([data-type="jump-anchor"]):hover{color:var(--tui-link-hover);text-decoration:underline}.tui-editor-socket a:not([data-type="jump-anchor"]):active{color:var(--tui-primary-active)}.tui-editor-socket .ProseMirror a[data-type=jump-anchor]{text-decoration:underline;-webkit-text-decoration-color:var(--tui-link);text-decoration-color:var(--tui-link)}.tui-editor-socket .ProseMirror a[data-type=jump-anchor]:before{content:"#"}.tui-editor-socket .ProseMirror a[data-type=jump-anchor]:hover{color:var(--tui-link)}.tui-editor-socket .ProseMirror a:hover img[contenteditable=false]{cursor:pointer;outline:.25rem solid var(--tui-link)}.tui-editor-socket ul,.tui-editor-socket ol{list-style-type:none;margin:1rem 1rem 1rem 1.5rem;padding:0}.tui-editor-socket li{margin:.75rem 0}.tui-editor-socket li>p{display:inline;margin:0 auto;word-break:break-word}.tui-editor-socket ul li>p{display:block}.tui-editor-socket li:before{unicode-bidi:-webkit-isolate;unicode-bidi:isolate;font-feature-settings:"tnum";font-variant-numeric:tabular-nums;text-transform:none;text-indent:0;text-align:start;text-align-last:start}.tui-editor-socket ul>li:before{content:"";display:inline-block;width:.5rem;height:.5rem;border-radius:100%;margin:.5rem .875rem .0625rem -1.375rem;background-color:var(--tui-primary);vertical-align:top;box-sizing:border-box;float:left}.tui-editor-socket li ul>li:before{background:none;border:.125rem solid var(--tui-primary)}.tui-editor-socket li ul>li>ul>li:before{background:var(--tui-primary);border-radius:0;width:.375rem;height:.375rem}.tui-editor-socket ol{counter-reset:item}.tui-editor-socket ol>li:before{content:counters(item,".") ".";display:block;margin:0 .75rem 0 -1.5rem;counter-increment:item;color:var(--tui-base-05);vertical-align:top;float:left;white-space:nowrap}.tui-editor-socket._preview-image img{cursor:pointer}.tui-editor-socket .ProseMirror video,.tui-editor-socket .ProseMirror audio{pointer-events:none}.tui-editor-socket img.ProseMirror-selectednode{outline:.25rem solid var(--tui-primary-hover)}.tui-editor-socket .t-editor-placeholder:before{content:attr(data-placeholder);float:left;color:var(--tui-base-05);pointer-events:none;height:0}.tui-editor-socket table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;overflow:hidden}.tui-editor-socket table .tableWrapper{overflow-x:auto}.tui-editor-socket .tableWrapper,.tui-editor-socket .tui-table-wrapper{overflow-x:auto}.tui-editor-socket table td{position:relative;min-width:1em;height:2rem;border:2px solid var(--tui-base-03);padding:3px 5px;vertical-align:top;box-sizing:border-box;word-break:break-word}.tui-editor-socket table th{position:relative;min-width:1em;height:2rem;border:2px solid var(--tui-base-03);padding:3px 5px;vertical-align:top;box-sizing:border-box;word-break:break-word;font-weight:bold;text-align:left;background-color:var(--tui-base-02);min-height:2rem}.tui-editor-socket table .column-resize-handle{position:absolute;right:-2px;top:0;bottom:-2px;width:4px;background-color:#adf;pointer-events:none}.tui-editor-socket table td>*{margin-top:0;margin-bottom:0}.tui-editor-socket table th>*{margin-top:0;margin-bottom:0}.tui-editor-socket .selectedCell:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:var(--tui-selection);pointer-events:none}.tui-editor-socket summary{display:flex;align-items:center;min-height:3.5rem;width:100%;padding:0 1.25rem;box-sizing:border-box;border-radius:var(--tui-radius-l);pointer-events:none;outline:none}.tui-editor-socket summary:focus-visible{outline:2px solid var(--tui-link)}.tui-editor-socket summary p{min-width:1px;margin:0}.tui-editor-socket summary::-webkit-details-marker{display:none}.tui-editor-socket details[open] summary{border-radius:var(--tui-radius-l) var(--tui-radius-l) 0 0}.tui-editor-socket .details-arrow,.tui-editor-socket .t-details-arrow{position:absolute;top:1.5rem;right:1.25rem;height:.575rem;width:.575rem;border:1px solid var(--tui-base-06);border-width:0 2px 2px 0;transform:rotate(45deg);transition:var(--tui-duration, .3s);-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;padding:0;background:none;cursor:pointer;outline:none}.tui-editor-socket details{width:100%;border:1px solid var(--tui-base-04);border-radius:var(--tui-radius-l)}.tui-editor-socket div[data-type=details-content]{padding:1.25rem;min-height:3rem;border:1px solid var(--tui-base-04);border-width:1px 0 0}.tui-editor-socket div[data-type=details-content] h1:first-child,.tui-editor-socket div[data-type=details-content] h2:first-child,.tui-editor-socket div[data-type=details-content] pre:first-child,.tui-editor-socket div[data-type=details-content] ul:first-child,.tui-editor-socket div[data-type=details-content] ol:first-child,.tui-editor-socket div[data-type=details-content] ol li:first-child,.tui-editor-socket div[data-type=details-content] ul li:first-child{margin-top:0}.tui-editor-socket .details-wrapper,.tui-editor-socket .t-details-wrapper{margin-bottom:.5rem;position:relative;display:flex}.tui-editor-socket .details-wrapper_rendered .details-arrow,.tui-editor-socket .t-details-wrapper_rendered .details-arrow,.tui-editor-socket .details-wrapper_rendered .t-details-arrow,.tui-editor-socket .t-details-wrapper_rendered .t-details-arrow{pointer-events:none}.tui-editor-socket .details-wrapper_rendered summary,.tui-editor-socket .t-details-wrapper_rendered summary{transition:transform var(--tui-duration, .3s);cursor:pointer;pointer-events:auto}.tui-editor-socket .details-wrapper_rendered summary:hover,.tui-editor-socket .t-details-wrapper_rendered summary:hover{background:var(--tui-base-02)}.tui-editor-socket details[open]+.details-arrow,.tui-editor-socket details[open]+.t-details-arrow{top:1.75rem;transform:rotate(225deg)}.tui-editor-socket pre{white-space:pre-wrap;word-break:break-word;border-radius:.25rem;margin:1rem 0;padding:.75rem 1rem;font-family:Courier,monospace;color:var(--tui-text-02);background:var(--tui-base-02)}.tui-editor-socket .tui-group-node{display:flex;flex-direction:row}.tui-editor-socket .tui-group-node:hover>.tui-group-pointer{pointer-events:auto;opacity:1}.tui-editor-socket .tui-group-pointer{opacity:0;min-height:.8125rem;max-height:.8125rem;min-width:.8125rem;max-width:.8125rem;margin:.3125rem .3125rem 0 0;cursor:grab;background-image:url(\'data:image/svg+xml;charset=UTF-8,\');background-repeat:no-repeat;background-size:contain;background-position:center}.tui-editor-socket [data-mode=onDark] .tui-group-pointer{background-image:url(\'data:image/svg+xml;charset=UTF-8,\')}\n'],encapsulation:2,changeDetection:0}),t})()},19586:(t,e,n)=>{n.d(e,{a:()=>R});var o=n(12057),i=n(74788),r=n(24751),s=n(64642),a=n(67274),l=n(51618),c=n(18892),d=n(86114),u=n(71831),h=n(39425),p=n(87874),f=n(46782),m=n(46015),g=n(42),b=n(55788),v=n(17999),y=n(96281),w=n(66654),k=n(16331),x=n(82335),C=n(80475),M=n(62541),S=n(37365),A=n(96152),O=n(87429),T=n(98230),N=n(41039);function E(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-toolbar",7),i.NdJ("fileAttached",(function(e){return i.CHM(t),i.oxw(2).fileAttached.emit(e)})),i.Hsn(1,1),i.qZA()}if(2&t){const t=i.oxw(2);i.Q6J("disabled",!t.interactive)("tools",t.tools)}}function I(t,e){if(1&t&&(i.TgZ(0,"div",8),i._uU(1),i.qZA()),2&t){const t=i.oxw(2);i.xp6(1),i.hij(" ",t.exampleText," ")}}function D(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-edit-link",13,14),i.NdJ("addLink",(function(e){i.CHM(t);const n=i.MAs(1),o=i.oxw(3);return n.anchorMode?o.addAnchor(e):o.addLink(e)}))("removeLink",(function(){i.CHM(t);const e=i.MAs(1),n=i.oxw(3);return e.anchorMode?n.removeAnchor():n.removeLink()})),i.qZA()}}function P(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-scrollbar",9),i.NdJ("mousedown",(function(e){return i.CHM(t),i.oxw(2).focus(e)})),i.TgZ(1,"div",10),i.TgZ(2,"tui-editor-socket",11),i.NdJ("stateChange",(function(){return 0}))("valueChange",(function(e){return i.CHM(t),i.oxw(2).onModelChange(e)})),i.qZA(),i.qZA(),i.YNc(3,D,2,0,"ng-template",null,12,i.W1O),i._UZ(5,"tui-editor-portal-host"),i.qZA()}if(2&t){const t=i.MAs(4),e=i.oxw(2);i.xp6(1),i.Q6J("tuiDropdown",t)("tuiDropdownSelection",e.dropdownSelectionHandler),i.xp6(1),i.Q6J("editable",e.interactive)("value",e.value)}}function H(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"div",1),i.NdJ("tuiActiveZoneChange",(function(e){return i.CHM(t),i.oxw().onActiveZone(e)})),i.TgZ(1,"div",2),i.YNc(2,E,2,2,"tui-toolbar",3),i.TgZ(3,"div",4),i.Hsn(4),i.qZA(),i.YNc(5,I,2,1,"div",5),i.qZA(),i.YNc(6,P,6,4,"tui-scrollbar",6),i.qZA()}if(2&t){const t=e.ngIf,n=i.oxw();i.Q6J("disabled",n.disabled)("focus",n.computedFocused)("hover",n.pseudoHover)("invalid",n.computedInvalid)("readOnly",n.readOnly),i.xp6(2),i.Q6J("ngIf",t),i.xp6(1),i.ekj("t-placeholder_raised",n.placeholderRaised),i.xp6(2),i.Q6J("ngIf",n.hasExampleText),i.xp6(1),i.Q6J("ngIf",t)}}const L=["*",[["tools"]]],_=["*","tools"];let R=(()=>{class t extends s.M$T{constructor(t,e,n,o,r,s,a,l){super(t,e,a),this.editorLoaded$=n,this.editorService=o,this.contentProcessor=r,this.doc=s,this.options=l,this.exampleText="",this.tools=c.Db,this.fileAttached=new i.vpe,this.focused=!1,this.isSelectionLink=t=>this.currentFocusedNodeIsTextAnchor(t)||this.currentFocusedNodeIsImageAnchor,this.editorLoaded$.pipe((0,p.g)(0),(0,f.R)(this.destroy$)).subscribe((()=>this.patchContentEditableElement()))}get nativeFocusableElement(){var t,e;return this.computedDisabled?null:(null===(e=null===(t=this.el)||void 0===t?void 0:t.nativeElement)||void 0===e?void 0:e.querySelector("[contenteditable].ProseMirror"))||null}get dropdownSelectionHandler(){return this.focused?this.isSelectionLink:s.IyD}get editor(){return this.editorService.getOriginTiptapEditor()?this.editorService:null}get placeholderRaised(){return this.computedFocused&&!this.readOnly||this.hasValue}get hasExampleText(){return!!this.exampleText&&this.computedFocused&&!this.hasValue&&!this.readOnly}writeValue(t){var e;if(t===this.value)return;const n=this.contentProcessor(t||"");super.writeValue(n),n!==t&&(null===(e=this.control)||void 0===e||e.setValue(n,{onlySelf:!1,emitEvent:!1,emitModelToViewChange:!1,emitViewToModelChange:!1}))}onActiveZone(t){var e;this.focused=t,this.updateFocused(t),null===(e=this.control)||void 0===e||e.updateValueAndValidity()}onModelChange(t){this.value=t}addAnchor(t){var e;null===(e=this.editor)||void 0===e||e.setAnchor(t)}removeAnchor(){var t;null===(t=this.editor)||void 0===t||t.removeAnchor()}addLink(t){var e,n;null===(e=this.editor)||void 0===e||e.selectClosest(),null===(n=this.editor)||void 0===n||n.setLink(t)}removeLink(){var t;null===(t=this.editor)||void 0===t||t.unsetLink()}focus(t){var e,n;(null===(e=this.nativeFocusableElement)||void 0===e?void 0:e.contains(t.target))||(t.preventDefault(),null===(n=this.nativeFocusableElement)||void 0===n||n.focus())}ngOnDestroy(){var t;null===(t=this.editor)||void 0===t||t.destroy()}getFallbackValue(){return""}currentFocusedNodeIsTextAnchor(t){var e,n;return!!(null===(n=null===(e=t.startContainer.parentElement)||void 0===e?void 0:e.closest("a"))||void 0===n?void 0:n.contains(this.focusNode))&&(0,h.nC)(t)}get focusNode(){var t,e;return null!==(e=null===(t=this.doc.getSelection())||void 0===t?void 0:t.focusNode)&&void 0!==e?e:null}get hasValue(){return!!this.value}get currentFocusedNodeIsImageAnchor(){var t,e,n;return"A"===(null===(t=this.focusNode)||void 0===t?void 0:t.nodeName)&&["IMG","TUI-IMAGE-EDITOR"].includes(null===(n=null===(e=this.focusNode)||void 0===e?void 0:e.childNodes[0])||void 0===n?void 0:n.nodeName)}patchContentEditableElement(){var t,e;null===(t=this.nativeFocusableElement)||void 0===t||t.setAttribute("translate",this.options.translate),null===(e=this.nativeFocusableElement)||void 0===e||e.setAttribute("spellcheck",String(this.options.spellcheck))}}return t.ɵfac=function(e){return new(e||t)(i.Y36(r.a5,10),i.Y36(i.sBO),i.Y36(u.ZW),i.Y36(d.$3),i.Y36(u.F1),i.Y36(o.K0),i.Y36(u.bK,8),i.Y36(u.mJ))},t.ɵcmp=i.Xpm({type:t,selectors:[["tui-editor"]],viewQuery:function(t,e){if(1&t&&(i.Gf(d.JU,5,i.SBq),i.Gf(l.M6,5)),2&t){let t;i.iGM(t=i.CRH())&&(e.el=t.first),i.iGM(t=i.CRH())&&(e.toolbar=t.first)}},inputs:{exampleText:"exampleText",tools:"tools"},outputs:{fileAttached:"fileAttached"},features:[i._Bn([(0,s.FTc)(t),(0,s.f$T)({delay:a.GcO}),m.m]),i.qOj],ngContentSelectors:_,decls:2,vars:3,consts:[["appearance","textfield","tuiWrapper","","class","t-wrapper",3,"disabled","focus","hover","invalid","readOnly","tuiActiveZoneChange",4,"ngIf"],["appearance","textfield","tuiWrapper","",1,"t-wrapper",3,"disabled","focus","hover","invalid","readOnly","tuiActiveZoneChange"],[1,"t-toolbar-wrapper"],[3,"disabled","tools","fileAttached",4,"ngIf"],[1,"t-placeholder"],["class","t-example-text",4,"ngIf"],["tuiEditorPortal","","class","t-scrollbar",3,"mousedown",4,"ngIf"],[3,"disabled","tools","fileAttached"],[1,"t-example-text"],["tuiEditorPortal","",1,"t-scrollbar",3,"mousedown"],["tuiDropdownLimitWidth","auto","tuiDropdownSelectionPosition","tag",3,"tuiDropdown","tuiDropdownSelection"],["tuiTiptapEditor","",1,"tui-editor-socket",3,"editable","value","stateChange","valueChange"],["dropdown",""],[3,"addLink","removeLink"],["link",""]],template:function(t,e){1&t&&(i.F$t(L),i.YNc(0,H,7,10,"div",0),i.ALo(1,"async")),2&t&&i.Q6J("ngIf",i.lcZ(1,1,e.editorLoaded$))},directives:[o.O5,g.o,b.e,v.M,y.I,w.A,k.Ek,x.t,C.V,M.A,S.y,A.D,O.J,T.d,N.l],pipes:[o.Ov],styles:["[_nghost-%COMP%]{position:relative;z-index:0;display:block;font:var(--tui-font-text-m);border-radius:var(--tui-radius-m);max-height:inherit;min-height:10rem;box-sizing:border-box}.t-wrapper[_ngcontent-%COMP%]{display:flex;max-height:inherit;min-height:inherit;cursor:text;overflow:hidden;flex-direction:column;border-radius:inherit}.t-placeholder[_ngcontent-%COMP%]{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;font:var(--tui-font-text-s);color:var(--tui-text-02);pointer-events:none;will-change:transform;transform:translateY(0);margin:1rem 1rem -1rem;min-height:1.625rem;width:95%;font-size:.9375rem}.t-placeholder_raised[_ngcontent-%COMP%]{transform:translateY(-.625rem)}[data-size=m][_nghost-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{font:var(--tui-font-text-xs);line-height:1.25rem;transform:translateY(-.5rem);letter-spacing:.025rem}._invalid[_nghost-%COMP%]:not(._focused) .t-placeholder_raised[_ngcontent-%COMP%], ._invalid[_nghost-%COMP%]:not(._focused):hover .t-placeholder_raised[_ngcontent-%COMP%]{color:var(--tui-error-fill)}._invalid[_nghost-%COMP%]:not(._focused) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%], ._invalid[_nghost-%COMP%]:not(._focused):hover [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{color:var(--tui-error-fill-night)}._focused[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=m]._focused._label-outside[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused._label-outside[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-03)}[data-size=l][_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%]{font:var(--tui-font-text-m);line-height:1.25rem}[data-size=l][_nghost-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{font-size:.8156rem}[data-size=m]._focused[_nghost-%COMP%]:not(._label-outside) .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused[_nghost-%COMP%]:not(._label-outside) .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-01)}[tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-02-night)}[data-size=m]._focused[_nghost-%COMP%]:not(._label-outside) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused[_nghost-%COMP%]:not(._label-outside) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-01-night)}._focused[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=m]._focused._label-outside[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused._label-outside[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-02-night)}@supports (-webkit-hyphens: none){.t-placeholder[_ngcontent-%COMP%]{will-change:unset;transition-property:transform,color,letter-spacing}}.t-placeholder_raised[_ngcontent-%COMP%]{width:110%}.t-placeholder[_ngcontent-%COMP%]:empty{min-height:.8rem}.t-example-text[_ngcontent-%COMP%]{position:absolute;left:1rem;margin-top:1.6rem;color:var(--tui-base-06);letter-spacing:normal;text-transform:none}.t-example-text_light[_ngcontent-%COMP%]{color:var(--tui-text-03-night)}.t-example-text_dark[_ngcontent-%COMP%]{color:var(--tui-text-03)}.t-scrollbar[_ngcontent-%COMP%]{display:flex;border-bottom:.3125rem solid transparent;padding-bottom:1.3125rem;box-sizing:border-box;flex:1}"],changeDetection:0}),t})()},46015:(t,e,n)=>{n.d(e,{m:()=>h});var o=n(74788),i=n(86114),r=n(71831),s=n(74235),a=n(9112),l=n(15257),c=n(88002),d=n(47349),u=n(22648);const h=[{provide:r.F4,deps:[r.Wf],useFactory:t=>{const e=new s.t(1);return Promise.all(t).then((t=>e.next(t))),e}},{provide:r.Y1,deps:[o.Qsj],useFactory:t=>t.createElement("div")},{provide:r.ZW,deps:[r.Y1,r.F4,r.bG],useFactory:(t,e,n)=>(0,a.aj)([n,e]).pipe((0,l.q)(1),(0,c.U)((([e,n])=>new e({element:t,extensions:n}))),(0,d.d)({bufferSize:1,refCount:!0}))},i.$3,u.Y]},98230:(t,e,n)=>{n.d(e,{d:()=>r});var o=n(64642),i=n(74788);let r=(()=>{class t extends o.ErH{}return t.ɵfac=function(){let e;return function(n){return(e||(e=i.n5z(t)))(n||t)}}(),t.ɵcmp=i.Xpm({type:t,selectors:[["tui-editor-portal-host"]],features:[i._Bn([{provide:o.N9Y,useExisting:o.ae2},{provide:o.ErH,useExisting:t}]),i.qOj],decls:2,vars:0,consts:[["viewContainer",""]],template:function(t,e){1&t&&i.GkF(0,null,0)},styles:["[_nghost-%COMP%]{position:absolute;top:0;left:0;display:block;height:100%;width:100%;pointer-events:none}"],changeDetection:0}),t})()},66654:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(74788),i=n(64642),r=n(67274),s=n(22648);let a=(()=>{class t extends r.O4x{constructor(t){super(),this.el=t,this.type="viewport"}getClientRect(){return this.el.nativeElement.getBoundingClientRect()}}return t.ɵfac=function(e){return new(e||t)(o.Y36(o.SBq))},t.ɵdir=o.lG2({type:t,selectors:[["","tuiEditorPortal",""]],features:[o._Bn([{provide:i.ae2,useExisting:s.Y},(0,r.ckU)(t)]),o.qOj]}),t})()},22648:(t,e,n)=>{n.d(e,{Y:()=>r});var o=n(64642),i=n(74788);let r=(()=>{class t extends o.N9Y{}return t.ɵfac=function(){let e;return function(n){return(e||(e=i.n5z(t)))(n||t)}}(),t.ɵprov=i.Yz7({token:t,factory:t.ɵfac}),t})()},31496:(t,e,n)=>{n.d(e,{j:()=>v});var o=n(97582),i=n(74788),r=n(24751),s=n(91211),a=n(64642),l=n(67274),c=n(39425),d=n(98778),u=n(75526),h=n(19042),p=n(61183),f=n(26383),m=n(55788);function g(t,e){if(1&t&&i._UZ(0,"div",4),2&t){const t=i.oxw();i.Udp("background",t.background)}}function b(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-color-selector",5),i.NdJ("colorChange",(function(e){return i.CHM(t),i.oxw().value=e})),i.qZA()}if(2&t){const t=e.$implicit,n=i.oxw();i.Q6J("colors",n.colors)("tuiActiveZoneParent",t)("color",n.value)}}class v extends a.M$T{constructor(t,e,n){super(t,e),this.domSanitizer=n,this.colors=new Map,this.open=!1}get nativeFocusableElement(){return this.computedDisabled||!this.textfield?null:this.textfield.nativeFocusableElement}get focused(){return!!this.dropdown&&this.dropdown.focused}get background(){return this.sanitize(this.value,this.domSanitizer)}onClick(){this.open=!this.open}onValueChange(t){this.value=t}onFocused(t){this.updateFocused(t)}getFallbackValue(){return"#000000"}sanitize(t,e){return t.startsWith("linear-gradient(")?e.bypassSecurityTrustStyle((0,c.CH)((0,c._N)((0,c.U5)(t)))):t}}v.ɵfac=function(t){return new(t||v)(i.Y36(r.a5,10),i.Y36(i.sBO),i.Y36(s.H7))},v.ɵcmp=i.Xpm({type:v,selectors:[["tui-input-color"]],viewQuery:function(t,e){if(1&t&&(i.Gf(l.ycg,5),i.Gf(l.o1K,5)),2&t){let t;i.iGM(t=i.CRH())&&(e.textfield=t.first),i.iGM(t=i.CRH())&&(e.dropdown=t.first)}},hostBindings:function(t,e){1&t&&i.NdJ("click",(function(){return e.onClick()}))},inputs:{colors:"colors"},features:[i._Bn([],[(0,l.fxH)({maxHeight:600})]),i.qOj],ngContentSelectors:["*"],decls:7,vars:12,consts:[[1,"t-wrapper",3,"content","open","openChange"],[1,"t-textfield",3,"disabled","focusable","invalid","nativeId","pseudoActive","pseudoFocus","pseudoHover","readOnly","tuiTextfieldIconLeft","value","valueChange","focusedChange"],["color",""],["picker",""],[1,"t-color"],[3,"colors","tuiActiveZoneParent","color","colorChange"]],template:function(t,e){if(1&t&&(i.F$t(),i.TgZ(0,"tui-hosted-dropdown",0),i.NdJ("openChange",(function(t){return e.open=t})),i.TgZ(1,"tui-primitive-textfield",1),i.NdJ("valueChange",(function(t){return e.value=t}))("focusedChange",(function(t){return e.onFocused(t)})),i.Hsn(2),i.qZA(),i.qZA(),i.YNc(3,g,1,2,"ng-template",null,2,i.W1O),i.YNc(5,b,1,3,"ng-template",null,3,i.W1O)),2&t){const t=i.MAs(4),n=i.MAs(6);i.Q6J("content",n)("open",e.open),i.xp6(1),i.Q6J("disabled",e.disabled)("focusable",e.focusable)("invalid",e.computedInvalid)("nativeId",e.nativeId)("pseudoActive",e.pseudoActive)("pseudoFocus",e.computedFocused)("pseudoHover",e.pseudoHover)("readOnly",e.readOnly)("tuiTextfieldIconLeft",t)("value",e.value)}},directives:[d.o,u.y,h.B,p.a,f.s,m.e],styles:["[_nghost-%COMP%]{display:block;border-radius:var(--tui-radius-m);text-align:left}.t-wrapper[_ngcontent-%COMP%]{display:flex;border-radius:inherit}.t-textfield[_ngcontent-%COMP%]{border-radius:inherit;text-align:inherit}.t-color[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;box-shadow:inset 0 0 0 1px var(--tui-base-03-dark);border-radius:.125rem;pointer-events:auto!important}"],changeDetection:0}),(0,o.gn)([a.UMq],v.prototype,"sanitize",null)},20719:(t,e,n)=>{n.d(e,{X:()=>w});var o=n(86114),i=n(71831),r=n(9112),s=n(88002),a=n(74788),l=n(12057),c=n(42486),d=n(98778),u=n(18289),h=n(44099),p=n(13938),f=n(10406),m=n(63790),g=n(51928);function b(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"div",6),a.TgZ(1,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.onAlign("left")})),a.qZA(),a.TgZ(2,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.onAlign("center")})),a.qZA(),a.TgZ(3,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.onAlign("right")})),a.qZA(),a.TgZ(4,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.onAlign("justify")})),a.qZA(),a.qZA()}if(2&t){const t=a.oxw().tuiLet,e=a.oxw().ngIf,n=a.oxw();a.xp6(1),a.Q6J("icon",n.options.icons.textAlignLeft)("pseudoActive",!(null==t||!t.left))("tuiHint",e.justifyLeft),a.xp6(1),a.Q6J("icon",n.options.icons.textAlignCenter)("pseudoActive",!(null==t||!t.center))("tuiHint",e.justifyCenter),a.xp6(1),a.Q6J("icon",n.options.icons.textAlignRight)("pseudoActive",!(null==t||!t.right))("tuiHint",e.justifyRight),a.xp6(1),a.Q6J("icon",n.options.icons.textAlignJustify)("pseudoActive",!(null==t||!t.justify))("tuiHint",e.justifyFull)}}function v(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",2,3),a._UZ(2,"button",4),a.YNc(3,b,5,12,"ng-template",null,5,a.W1O),a.qZA()),2&t){const t=a.MAs(1),e=a.MAs(4),n=a.oxw().ngIf,o=a.oxw();a.Q6J("content",e),a.xp6(2),a.Q6J("focusable",t.open)("icon",o.options.icons.textAlignPreview)("pseudoActive",t.open)("tuiHint",n.justify)}}function y(t,e){if(1&t&&(a.ynx(0),a.YNc(1,v,5,5,"tui-hosted-dropdown",1),a.ALo(2,"async"),a.BQk()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("tuiLet",a.lcZ(2,1,t.alignState$))}}let w=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.alignState$=(0,r.aj)([this.editor.isActive$({textAlign:"left"}),this.editor.isActive$({textAlign:"right"}),this.editor.isActive$({textAlign:"center"}),this.editor.isActive$({textAlign:"justify"})]).pipe((0,s.U)((([t,e,n,o])=>({left:t,right:e,center:n,justify:o}))))}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-align-content"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"content",4,"tuiLet"],[3,"content"],["align",""],["appearance","icon","automation-id","toolbar__align-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["alignDropdown",""],[1,"t-dropdown"],["appearance","icon","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"icon","pseudoActive","tuiHint","click"]],template:function(t,e){1&t&&(a.YNc(0,y,3,3,"ng-container",0),a.ALo(1,"async")),2&t&&a.Q6J("ngIf",a.lcZ(1,1,e.texts$))},directives:[l.O5,c.L,d.o,u.v,h.$,p.D,f.x,m.t,g.D],pipes:[l.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},57289:(t,e,n)=>{n.d(e,{T:()=>w});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(98778),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928),m=n(22545),g=n(12057),b=n(91283);function v(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",5),a.NdJ("click",(function(){const e=a.CHM(t).index;return a.oxw(2).onCode(!!e)})),a._uU(1),a.qZA()}if(2&t){const t=e.$implicit;a.xp6(1),a.hij(" ",t," ")}}function y(t,e){if(1&t&&(a.TgZ(0,"tui-data-list"),a.YNc(1,v,2,1,"button",4),a.ALo(2,"async"),a.qZA()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("ngForOf",a.lcZ(2,1,t.codeOptionsTexts$))}}let w=(()=>{class t{constructor(t,e,n,o){this.options=t,this.editor=e,this.texts$=n,this.codeOptionsTexts$=o,this.hintText$=this.texts$.pipe((0,r.U)((t=>t.code))),this.insideCode$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.isActive("code")||this.editor.isActive("codeBlock"))),(0,s.x)())}onCode(t){t?this.editor.toggleCodeBlock():this.editor.toggleCode()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf),a.Y36(i.Mr))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-code"]],decls:7,vars:9,consts:[[3,"content"],["codes",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["codesDropdown",""],["tuiOption","",3,"click",4,"ngFor","ngForOf"],["tuiOption","",3,"click"]],template:function(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",0,1),a._UZ(2,"button",2),a.ALo(3,"async"),a.ALo(4,"async"),a.YNc(5,y,3,3,"ng-template",null,3,a.W1O),a.qZA()),2&t){const t=a.MAs(1),n=a.MAs(6);a.Q6J("content",n),a.xp6(2),a.Q6J("focusable",t.open)("icon",e.options.icons.code)("pseudoActive",t.open||a.lcZ(3,5,e.insideCode$))("tuiHint",a.lcZ(4,7,e.hintText$))}},directives:[l.o,c.v,d.$,u.D,h.x,p.t,f.D,m.q,g.sg,b.v],pipes:[g.Ov],encapsulation:2,changeDetection:0}),t})()},49382:(t,e,n)=>{n.d(e,{U:()=>g});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(12057),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928);function m(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",1),a.NdJ("click",(function(){return a.CHM(t),a.oxw().removeDetails()})),a.ALo(1,"async"),a.qZA()}if(2&t){const t=e.ngIf,n=a.oxw();a.Q6J("disabled",!!a.lcZ(1,4,n.disabled$))("focusable",!1)("icon",n.options.icons.detailsRemove)("tuiHint",t.removeDetails)}}let g=(()=>{class t{constructor(t,e,n){this.editor=t,this.texts$=e,this.options=n,this.disabled$=this.editor.stateChange$.pipe((0,r.U)((()=>!this.editor.isActive("details"))),(0,s.x)())}removeDetails(){this.editor.removeDetails()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(o.$3),a.Y36(i.rf),a.Y36(i.mJ))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-details-remove"]],decls:2,vars:3,consts:[["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click"]],template:function(t,e){1&t&&(a.YNc(0,m,2,6,"button",0),a.ALo(1,"async")),2&t&&a.Q6J("ngIf",a.lcZ(1,1,e.texts$))},directives:[l.O5,c.v,d.$,u.D,h.x,p.t,f.D],pipes:[l.Ov],encapsulation:2,changeDetection:0}),t})()},18885:(t,e,n)=>{n.d(e,{y:()=>f});var o=n(86114),i=n(71831),r=n(74788),s=n(12057),a=n(18289),l=n(44099),c=n(13938),d=n(10406),u=n(63790),h=n(51928);function p(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"button",1),r.NdJ("click",(function(){return r.CHM(t),r.oxw().setDetails()})),r.qZA()}if(2&t){const t=e.ngIf,n=r.oxw();r.Q6J("focusable",!1)("icon",n.options.icons.detailsAdd)("tuiHint",t.setDetails)}}let f=(()=>{class t{constructor(t,e,n){this.editor=t,this.texts$=e,this.options=n}setDetails(){this.editor.setDetails()}}return t.ɵfac=function(e){return new(e||t)(r.Y36(o.$3),r.Y36(i.rf),r.Y36(i.mJ))},t.ɵcmp=r.Xpm({type:t,selectors:[["tui-details"]],decls:2,vars:3,consts:[["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","tuiHint","click"]],template:function(t,e){1&t&&(r.YNc(0,p,1,3,"button",0),r.ALo(1,"async")),2&t&&r.Q6J("ngIf",r.lcZ(1,1,e.texts$))},directives:[s.O5,a.v,l.$,c.D,d.x,u.t,h.D],pipes:[s.Ov],encapsulation:2,changeDetection:0}),t})()},73688:(t,e,n)=>{n.d(e,{m:()=>k});var o=n(64642),i=n(86114),r=n(71831),s=n(88002),a=n(74788),l=n(98778),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928),m=n(22545),g=n(12057),b=n(91283);const v=function(){return{}};function y(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",5),a.NdJ("click",(function(){const e=a.CHM(t).$implicit;return a.oxw(2).setFontOption(e)})),a.ALo(1,"lowercase"),a._uU(2),a.qZA()}if(2&t){const t=e.$implicit;a.Udp("font-family",t.family)("font-size",t.px,"px")("font-weight",t.weight),a.Q6J("ngClass",(null==t?null:t.ngClass)||a.DdM(12,v))("ngStyle",(null==t?null:t.ngStyle)||a.DdM(13,v)),a.uIk("automation-id","tui_font__"+a.lcZ(1,10,t.name||"")),a.xp6(2),a.hij(" ",t.name," ")}}function w(t,e){if(1&t&&(a.TgZ(0,"tui-data-list"),a.YNc(1,y,3,14,"button",4),a.ALo(2,"async"),a.qZA()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("ngForOf",a.lcZ(2,1,t.fontsOptions$))}}let k=(()=>{class t{constructor(t,e,n,o){this.options=t,this.editor=e,this.texts$=n,this.fontOptionsTexts$=o,this.fontsOptions$=this.fontOptionsTexts$.pipe((0,s.U)((t=>this.options.fontOptions(t)))),this.fontText$=this.texts$.pipe((0,s.U)((t=>t.font)))}onClick({headingLevel:t,px:e}){this.setFontOption({headingLevel:t,px:e})}setFontOption({headingLevel:t,px:e}){this.clearPreviousTextStyles(),t?this.editor.setHeading(t):this.editor.setParagraph({fontSize:(0,o.O9r)(e||0)})}clearPreviousTextStyles(){this.editor.removeEmptyTextStyle(),this.editor.toggleMark("textStyle")}}return t.ɵfac=function(e){return new(e||t)(a.Y36(r.mJ),a.Y36(i.$3),a.Y36(r.rf),a.Y36(r.UN))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-font-size"]],decls:6,vars:7,consts:[[3,"content"],["fonts",""],["appearance","icon","automation-id","toolbar__font-size-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["fontsDropdown",""],["tuiOption","",3,"ngClass","ngStyle","fontFamily","fontSize","fontWeight","click",4,"ngFor","ngForOf"],["tuiOption","",3,"ngClass","ngStyle","click"]],template:function(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",0,1),a._UZ(2,"button",2),a.ALo(3,"async"),a.YNc(4,w,3,3,"ng-template",null,3,a.W1O),a.qZA()),2&t){const t=a.MAs(1),n=a.MAs(5);a.Q6J("content",n),a.xp6(2),a.Q6J("focusable",t.open)("icon",e.options.icons.fontSize)("pseudoActive",t.open)("tuiHint",a.lcZ(3,5,e.fontText$))}},directives:[l.o,c.v,d.$,u.D,h.x,p.t,f.D,m.q,g.sg,b.v,g.mk,g.PC],pipes:[g.Ov,g.i8],encapsulation:2,changeDetection:0}),t})()},81618:(t,e,n)=>{n.d(e,{h:()=>S});var o=n(18892),i=n(86114),r=n(95161),s=n(71831),a=n(9112),l=n(88002),c=n(74788),d=n(12057),u=n(98778),h=n(18289),p=n(44099),f=n(13938),m=n(10406),g=n(63790),b=n(51928);function v(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",8),c.NdJ("click",(function(){return c.CHM(t),c.oxw(4).editor.toggleBold()})),c.qZA()}if(2&t){const t=c.oxw(2).ngIf,e=c.oxw().ngIf,n=c.oxw();c.Q6J("icon",n.options.icons.fontStyleBold)("pseudoActive",t.bold)("tuiHint",e.bold)}}function y(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",8),c.NdJ("click",(function(){return c.CHM(t),c.oxw(4).editor.toggleItalic()})),c.qZA()}if(2&t){const t=c.oxw(2).ngIf,e=c.oxw().ngIf,n=c.oxw();c.Q6J("icon",n.options.icons.fontStyleItalic)("pseudoActive",t.italic)("tuiHint",e.italic)}}function w(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",8),c.NdJ("click",(function(){return c.CHM(t),c.oxw(4).editor.toggleUnderline()})),c.qZA()}if(2&t){const t=c.oxw(2).ngIf,e=c.oxw().ngIf,n=c.oxw();c.Q6J("icon",n.options.icons.fontStyleUnderline)("pseudoActive",t.underline)("tuiHint",e.underline)}}function k(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",8),c.NdJ("click",(function(){return c.CHM(t),c.oxw(4).editor.toggleStrike()})),c.qZA()}if(2&t){const t=c.oxw(2).ngIf,e=c.oxw().ngIf,n=c.oxw();c.Q6J("icon",n.options.icons.fontStyleStrike)("pseudoActive",t.strike)("tuiHint",e.strikeThrough)}}function x(t,e){if(1&t&&(c.TgZ(0,"div",6),c.YNc(1,v,1,3,"button",7),c.YNc(2,y,1,3,"button",7),c.YNc(3,w,1,3,"button",7),c.YNc(4,k,1,3,"button",7),c.qZA()),2&t){const t=c.oxw(3);c.xp6(1),c.Q6J("ngIf",t.isEnabled(t.TuiEditorTool.Bold)),c.xp6(1),c.Q6J("ngIf",t.isEnabled(t.TuiEditorTool.Italic)),c.xp6(1),c.Q6J("ngIf",t.isEnabled(t.TuiEditorTool.Underline)),c.xp6(1),c.Q6J("ngIf",t.isEnabled(t.TuiEditorTool.Strikethrough))}}function C(t,e){if(1&t&&(c.TgZ(0,"tui-hosted-dropdown",2,3),c._UZ(2,"button",4),c.YNc(3,x,5,4,"ng-template",null,5,c.W1O),c.qZA()),2&t){const t=e.ngIf,n=c.MAs(1),o=c.MAs(4),i=c.oxw().ngIf,r=c.oxw();c.Q6J("content",o),c.xp6(2),c.Q6J("focusable",n.open)("icon",r.options.icons.fontStylePreview)("pseudoActive",n.open||t.bold||t.italic||t.underline||t.strike)("tuiHint",i.fontStyle)}}function M(t,e){if(1&t&&(c.ynx(0),c.YNc(1,C,5,5,"tui-hosted-dropdown",1),c.ALo(2,"async"),c.BQk()),2&t){const t=c.oxw();c.xp6(1),c.Q6J("ngIf",c.lcZ(2,1,t.fontStyleState$))}}let S=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.toolsSet=new Set(o.Db),this.TuiEditorTool=r._,this.fontStyleState$=(0,a.aj)([this.editor.isActive$("bold"),this.editor.isActive$("italic"),this.editor.isActive$("underline"),this.editor.isActive$("strike")]).pipe((0,l.U)((([t,e,n,o])=>({bold:t,italic:e,underline:n,strike:o}))))}set enabledTools(t){this.toolsSet=new Set(t)}isEnabled(t){return this.toolsSet.has(t)}}return t.ɵfac=function(e){return new(e||t)(c.Y36(s.mJ),c.Y36(i.$3),c.Y36(s.rf))},t.ɵcmp=c.Xpm({type:t,selectors:[["tui-font-style"]],inputs:{enabledTools:"enabledTools"},decls:2,vars:3,consts:[[4,"ngIf"],[3,"content",4,"ngIf"],[3,"content"],["format",""],["appearance","icon","automation-id","toolbar__font-style-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["formatDropdown",""],[1,"t-dropdown"],["appearance","icon","size","s","tuiIconButton","","type","button","class","t-option t-option_margin",3,"icon","pseudoActive","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"icon","pseudoActive","tuiHint","click"]],template:function(t,e){1&t&&(c.YNc(0,M,3,3,"ng-container",0),c.ALo(1,"async")),2&t&&c.Q6J("ngIf",c.lcZ(1,1,e.texts$))},directives:[d.O5,u.o,h.v,p.$,f.D,m.x,g.t,b.D],pipes:[d.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},52187:(t,e,n)=>{n.d(e,{d:()=>m});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(18289),c=n(44099),d=n(13938),u=n(10406),h=n(63790),p=n(51928),f=n(12057);let m=(()=>{class t{constructor(t,e,n){this.editor=t,this.texts$=e,this.options=n,this.insertGroupText$=this.texts$.pipe((0,r.U)((t=>t.insertGroup))),this.removeGroupText$=this.texts$.pipe((0,r.U)((t=>t.removeGroup))),this.disabled$=this.editor.stateChange$.pipe((0,r.U)((()=>!this.editor.isActive("group"))),(0,s.x)())}addGroup(){this.editor.setGroup()}removeGroup(){this.editor.removeGroup()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(o.$3),a.Y36(i.rf),a.Y36(i.mJ))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-editor-group-tool"]],decls:5,vars:13,consts:[["appearance","icon","automation-id","toolbar__group-add-button","size","s","tuiHintDescribe","","tuiIconButton","","type","button",3,"focusable","icon","tuiHint","click"],["appearance","icon","automation-id","toolbar__group-remove-button","size","s","tuiHintDescribe","","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click"]],template:function(t,e){1&t&&(a.TgZ(0,"button",0),a.NdJ("click",(function(){return e.addGroup()})),a.ALo(1,"async"),a.qZA(),a.TgZ(2,"button",1),a.NdJ("click",(function(){return e.removeGroup()})),a.ALo(3,"async"),a.ALo(4,"async"),a.qZA()),2&t&&(a.Q6J("focusable",!1)("icon",e.options.icons.groupAdd)("tuiHint",a.lcZ(1,7,e.insertGroupText$)),a.xp6(2),a.Q6J("disabled",!!a.lcZ(3,9,e.disabled$))("focusable",!1)("icon",e.options.icons.groupRemove)("tuiHint",a.lcZ(4,11,e.removeGroupText$)))},directives:[l.v,c.$,d.D,u.x,h.t,p.D],pipes:[f.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},73545:(t,e,n)=>{n.d(e,{U:()=>C});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(42486),c=n(98778),d=n(16331),u=n(18289),h=n(44099),p=n(13938),f=n(10406),m=n(63790),g=n(51928),b=n(12057),v=n(59113),y=n(55788);function w(t,e){if(1&t&&a._UZ(0,"div",6),2&t){const t=a.oxw().tuiLet;a.Udp("background",t)}}function k(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"tui-palette",7),a.NdJ("selectedColor",(function(e){return a.CHM(t),a.oxw(2).editor.setBackgroundColor(e)})),a.qZA()}if(2&t){const t=e.$implicit,n=a.oxw(2);a.Q6J("colors",n.colors)("tuiActiveZoneParent",t)}}function x(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",1,2),a._UZ(2,"button",3),a.ALo(3,"async"),a.YNc(4,w,1,2,"div",4),a.YNc(5,k,1,2,"ng-template",null,5,a.W1O),a.qZA()),2&t){const t=e.tuiLet,n=a.MAs(1),o=a.MAs(6),i=a.oxw();a.Q6J("content",o)("tuiDropdownMaxHeight",999),a.xp6(2),a.Q6J("focusable",n.open)("icon",i.options.icons.textHilite)("pseudoActive",n.open)("tuiHint",a.lcZ(3,7,i.backColorText$)),a.xp6(2),a.Q6J("ngIf",!i.isBlankColor(t||""))}}let C=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.colors=this.options.colors,this.backgroundColor$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.getBackgroundColor()||this.options.blankColor)),(0,s.x)()),this.backColorText$=this.texts$.pipe((0,r.U)((t=>t.backColor)))}isBlankColor(t){return t===this.options.blankColor}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-highlight-color"]],inputs:{colors:"colors"},decls:2,vars:3,consts:[[3,"content","tuiDropdownMaxHeight",4,"tuiLet"],[3,"content","tuiDropdownMaxHeight"],["hilite",""],["appearance","icon","automation-id","toolbar__hilite-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",1,"t-tool",3,"focusable","icon","pseudoActive","tuiHint"],["class","t-plate",3,"background",4,"ngIf"],["hiliteDropdown",""],[1,"t-plate"],[1,"t-color-picker",3,"colors","tuiActiveZoneParent","selectedColor"]],template:function(t,e){1&t&&(a.YNc(0,x,7,9,"tui-hosted-dropdown",0),a.ALo(1,"async")),2&t&&a.Q6J("tuiLet",a.lcZ(1,1,e.backgroundColor$))},directives:[l.L,c.o,d.Ek,u.v,h.$,p.D,f.x,m.t,g.D,b.O5,v.R,y.e],pipes:[b.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},78790:(t,e,n)=>{n.d(e,{pu:()=>a,P_:()=>l,y9:()=>c,jP:()=>h,p7:()=>d,Zv:()=>u,XC:()=>f,Ur:()=>m,mp:()=>g,iA:()=>v,er:()=>y,__:()=>w,_t:()=>k}),n(20719);var o=n(12057),i=n(64642),r=n(67274),s=n(74788);let a=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS,i.WDk]]}),t})();n(57289);let l=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS,r.pcV]]}),t})();n(18885);let c=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.fNO,r.goS]]}),t})();n(49382),n(73688);let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS,r.pcV]]}),t})();n(81618);let u=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS]]}),t})();n(52187);let h=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.fNO,r.goS]]}),t})();n(73545);var p=n(96472);let f=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,p.VM,r.goS,r.dpK,i.Ah6,i.WDk]]}),t})();n(30928);let m=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS,i.WDk]]}),t})();n(61899);let g=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,p.VM,r.fNO,r.goS,i.Ah6,r.dpK,i.WDk]]}),t})();n(31433),n(87048);let b=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,i.IhY]]}),t})(),v=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.dpK,r.fNO,r.goS,b]]}),t})();n(41218);let y=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.fNO,r.goS,i.WDk]]}),t})();n(34773);let w=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.goS,r.fNO,r.pcV,i.WDk]]}),t})();n(57891);let k=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.fNO,r.jhF,r.dpK,r.goS,p.VM,i.Ah6,i.WDk]]}),t})()},30928:(t,e,n)=>{n.d(e,{w:()=>w});var o=n(86114),i=n(71831),r=n(9112),s=n(88002),a=n(74788),l=n(12057),c=n(42486),d=n(98778),u=n(18289),h=n(44099),p=n(13938),f=n(10406),m=n(63790),g=n(51928);function b(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"div",6),a.TgZ(1,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.toggleUnorderedList()})),a.qZA(),a.TgZ(2,"button",8),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.toggleOrderedList()})),a.qZA(),a.TgZ(3,"button",9),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).sinkListItem()})),a.qZA(),a.TgZ(4,"button",10),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).liftListItem()})),a.qZA(),a.qZA()}if(2&t){const t=a.oxw().tuiLet,e=a.oxw().ngIf,n=a.oxw();a.xp6(1),a.Q6J("icon",n.options.icons.listUnOrdered)("pseudoActive",!(null==t||!t.unordered))("tuiHint",e.unorderedList),a.xp6(1),a.Q6J("icon",n.options.icons.listOrdered)("pseudoActive",!(null==t||!t.ordered))("tuiHint",e.orderedList),a.xp6(1),a.Q6J("disabled",!(null!=t&&t.ordered||null!=t&&t.unordered))("icon",n.options.icons.indent)("tuiHint",e.indent),a.xp6(1),a.Q6J("disabled",!(null!=t&&t.ordered||null!=t&&t.unordered))("icon",n.options.icons.outdent)("tuiHint",e.outdent)}}function v(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",2,3),a._UZ(2,"button",4),a.YNc(3,b,5,12,"ng-template",null,5,a.W1O),a.qZA()),2&t){const t=e.tuiLet,n=a.MAs(1),o=a.MAs(4),i=a.oxw().ngIf,r=a.oxw();a.Q6J("content",o),a.xp6(2),a.Q6J("focusable",n.open)("icon",r.options.icons.listPreview)("pseudoActive",(null==n?null:n.open)||(null==t?null:t.unordered)||(null==t?null:t.ordered)||!1)("tuiHint",i.list)}}function y(t,e){if(1&t&&(a.ynx(0),a.YNc(1,v,5,5,"tui-hosted-dropdown",1),a.ALo(2,"async"),a.BQk()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("tuiLet",a.lcZ(2,1,t.listState$))}}let w=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.listState$=(0,r.aj)([this.editor.isActive$("orderedList"),this.editor.isActive$("bulletList")]).pipe((0,s.U)((([t,e])=>({ordered:t,unordered:e}))))}sinkListItem(){this.editor.sinkListItem()}liftListItem(){this.editor.liftListItem()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-list-configs"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"content",4,"tuiLet"],[3,"content"],["list",""],["appearance","icon","automation-id","toolbar__ordering-list-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["listDropdown",""],[1,"t-dropdown"],["appearance","icon","automation-id","toolbar__un-ordered-list-button","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"icon","pseudoActive","tuiHint","click"],["appearance","icon","automation-id","toolbar__ordered-list-button","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"icon","pseudoActive","tuiHint","click"],["appearance","icon","automation-id","toolbar_indent-button","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"disabled","icon","tuiHint","click"],["appearance","icon","automation-id","toolbar_outdent-button","size","s","tuiIconButton","","type","button",1,"t-option",3,"disabled","icon","tuiHint","click"]],template:function(t,e){1&t&&(a.YNc(0,y,3,3,"ng-container",0),a.ALo(1,"async")),2&t&&a.Q6J("ngIf",a.lcZ(1,1,e.texts$))},directives:[l.O5,c.L,d.o,u.v,h.$,p.D,f.x,m.t,g.D],pipes:[l.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},61899:(t,e,n)=>{n.d(e,{p:()=>S});var o=n(86114),i=n(71831),r=n(9112),s=n(88002),a=n(87519),l=n(74788),c=n(42486),d=n(98778),u=n(16331),h=n(18289),p=n(44099),f=n(13938),m=n(10406),g=n(63790),b=n(51928),v=n(12057),y=n(59113),w=n(55788);function k(t,e){if(1&t&&l._UZ(0,"div",7),2&t){const t=l.oxw(2).tuiLet;l.Udp("background",t)}}function x(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tui-palette",8),l.NdJ("selectedColor",(function(e){l.CHM(t),l.oxw();const n=l.MAs(1);return l.oxw(2).setCellColor(e),n.close()})),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw(3);l.Q6J("colors",n.colors)("tuiActiveZoneParent",t)}}function C(t,e){if(1&t&&(l.TgZ(0,"tui-hosted-dropdown",2,3),l._UZ(2,"button",4),l.ALo(3,"async"),l.YNc(4,k,1,2,"div",5),l.YNc(5,x,1,2,"ng-template",null,6,l.W1O),l.qZA()),2&t){const t=e.tuiLet,n=l.MAs(1),o=l.MAs(6),i=l.oxw().tuiLet,r=l.oxw();l.Q6J("canOpen",!!t)("content",o)("tuiDropdownMaxHeight",999),l.xp6(2),l.Q6J("disabled",!t)("focusable",n.open)("icon",r.options.icons.paint)("pseudoActive",n.open)("tuiHint",l.lcZ(3,9,r.colorText$)),l.xp6(2),l.Q6J("ngIf",!r.isBlankColor(i||""))}}function M(t,e){if(1&t&&(l.ynx(0),l.YNc(1,C,7,11,"tui-hosted-dropdown",1),l.ALo(2,"async"),l.BQk()),2&t){const t=l.oxw();l.xp6(1),l.Q6J("tuiLet",l.lcZ(2,1,t.isActive$))}}let S=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.colors=this.options.colors,this.colorText$=this.texts$.pipe((0,s.U)((t=>this.editor.isActive("group")&&t.hiliteGroup||this.editor.isActive("table")&&t.cellColor||""))),this.isActive$=(0,r.aj)([this.editor.isActive$("table"),this.editor.isActive$("group")]).pipe((0,s.U)((([t,e])=>t||e))),this.color$=this.editor.stateChange$.pipe((0,s.U)((()=>this.editor.getCellColor()||this.editor.getGroupColor()||this.options.blankColor)),(0,a.x)())}isBlankColor(t){return t===this.options.blankColor}setCellColor(t){this.editor.isActive("group")?this.editor.setGroupHilite(t):this.editor.isActive("table")&&this.editor.setCellColor(t)}}return t.ɵfac=function(e){return new(e||t)(l.Y36(i.mJ),l.Y36(o.$3),l.Y36(i.rf))},t.ɵcmp=l.Xpm({type:t,selectors:[["tui-table-cell-color"]],inputs:{colors:"colors"},decls:2,vars:3,consts:[[4,"tuiLet"],[3,"canOpen","content","tuiDropdownMaxHeight",4,"tuiLet"],[3,"canOpen","content","tuiDropdownMaxHeight"],["colorSelect",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","pseudoActive","tuiHint"],["class","t-plate t-plate_paint",3,"background",4,"ngIf"],["cellColorDropdown",""],[1,"t-plate","t-plate_paint"],[1,"t-color-picker",3,"colors","tuiActiveZoneParent","selectedColor"]],template:function(t,e){1&t&&(l.YNc(0,M,3,3,"ng-container",0),l.ALo(1,"async")),2&t&&l.Q6J("tuiLet",l.lcZ(1,1,e.color$))},directives:[c.L,d.o,u.Ek,h.v,p.$,f.D,m.x,g.t,b.D,v.O5,y.R,w.e],pipes:[v.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},31433:(t,e,n)=>{n.d(e,{l:()=>v});var o=n(86114),i=n(71831),r=n(88002),s=n(74788),a=n(98778),l=n(16331),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928),m=n(87048),g=n(12057);function b(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"tui-table-size-selector",4),s.NdJ("selectSize",(function(e){return s.CHM(t),s.oxw().addTable(e)})),s.qZA()}}let v=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.insertTableText$=this.texts$.pipe((0,r.U)((t=>t.insertTable)))}addTable({rows:t,cols:e}){this.editor.enter();const n=this.editor.state.selection.anchor;this.editor.enter(),this.editor.enter(),this.editor.setTextSelection(n),this.editor.insertTable(t,e)}}return t.ɵfac=function(e){return new(e||t)(s.Y36(i.mJ),s.Y36(o.$3),s.Y36(i.rf))},t.ɵcmp=s.Xpm({type:t,selectors:[["tui-table-create"]],decls:6,vars:6,consts:[["tuiDropdownAlign","left","tuiDropdownDirection","bottom",3,"content"],["table",""],["appearance","icon","automation-id","toolbar__insert-table-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","tuiHint"],["tableDropdown",""],[3,"selectSize"]],template:function(t,e){if(1&t&&(s.TgZ(0,"tui-hosted-dropdown",0,1),s._UZ(2,"button",2),s.ALo(3,"async"),s.qZA(),s.YNc(4,b,1,0,"ng-template",null,3,s.W1O)),2&t){const t=s.MAs(1),n=s.MAs(5);s.Q6J("content",n),s.xp6(2),s.Q6J("focusable",t.open)("icon",e.options.icons.insertTable)("tuiHint",s.lcZ(3,4,e.insertTableText$))}},directives:[a.o,l.Ek,c.v,d.$,u.D,h.x,p.t,f.D,m.M],pipes:[g.Ov],encapsulation:2,changeDetection:0}),t})()},41218:(t,e,n)=>{n.d(e,{Y:()=>y});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(42486),c=n(12057),d=n(18289),u=n(44099),h=n(13938),p=n(10406),f=n(63790),m=n(51928);function g(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",2),a.NdJ("click",(function(){a.CHM(t);const e=a.oxw().tuiLet,n=a.oxw();return e.mergeCells?n.mergeCells():n.splitCell()})),a.qZA()}if(2&t){const t=e.ngIf,n=a.oxw().tuiLet;a.Q6J("disabled",!n.mergeCells&&!n.splitCells)("focusable",!1)("icon",n.mergeCells?"tuiIconTableMergeLarge":"tuiIconTableSplitLarge")("tuiHint",n.mergeCells?t.mergeCells:t.splitCells)}}function b(t,e){if(1&t&&(a.ynx(0),a.YNc(1,g,1,4,"button",1),a.ALo(2,"async"),a.BQk()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("ngIf",a.lcZ(2,1,t.texts$))}}const v=function(t,e){return{mergeCells:t,splitCells:e}};let y=(()=>{class t{constructor(t,e){this.editor=t,this.texts$=e,this.canMergeCells$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.canMergeCells())),(0,s.x)()),this.canSplitCells$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.canSplitCells())),(0,s.x)())}mergeCells(){this.editor.mergeCells()}splitCell(){this.editor.splitCell()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-table-merge-cells"]],decls:3,vars:8,consts:[[4,"tuiLet"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click"]],template:function(t,e){1&t&&(a.YNc(0,b,3,3,"ng-container",0),a.ALo(1,"async"),a.ALo(2,"async")),2&t&&a.Q6J("tuiLet",a.WLB(5,v,a.lcZ(1,1,e.canMergeCells$),a.lcZ(2,3,e.canSplitCells$)))},directives:[l.L,c.O5,d.v,u.$,h.D,p.x,f.t,m.D],pipes:[c.Ov],encapsulation:2,changeDetection:0}),t})()},34773:(t,e,n)=>{n.d(e,{_:()=>M});var o=n(86114),i=n(71831),r=n(88002),s=n(74788),a=n(42486),l=n(98778),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928),m=n(22545),g=n(12057),b=n(94052),v=n(91283);function y(t,e){if(1&t&&(s.TgZ(0,"tui-hosted-dropdown",2,3),s._UZ(2,"button",4),s.ALo(3,"async"),s.qZA()),2&t){const t=e.tuiLet,n=s.MAs(1),o=s.oxw(),i=s.MAs(3);s.Q6J("canOpen",!!t)("content",i),s.xp6(2),s.Q6J("disabled",!t)("focusable",n.open)("icon",o.options.icons.addRowTable)("tuiHint",s.lcZ(3,6,o.rowsColumnsManagingText$))}}function w(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"button",7),s.NdJ("click",(function(){const e=s.CHM(t).index,n=s.oxw().index;return s.oxw(2).onTableOption(2*n+e)})),s._uU(1),s.qZA()}if(2&t){const t=e.$implicit;s.xp6(1),s.hij(" ",t," ")}}function k(t,e){if(1&t&&(s.TgZ(0,"tui-opt-group"),s.YNc(1,w,2,1,"button",6),s.qZA()),2&t){const t=e.$implicit;s.xp6(1),s.Q6J("ngForOf",t)}}function x(t,e){if(1&t&&(s.TgZ(0,"tui-data-list"),s.YNc(1,k,2,1,"tui-opt-group",5),s.ALo(2,"async"),s.qZA()),2&t){const t=s.oxw();s.xp6(1),s.Q6J("ngForOf",s.lcZ(2,1,t.tableCommandTexts$))}}var C=(()=>(function(t){t[t.InsertColumnBefore=0]="InsertColumnBefore",t[t.InsertColumnAfter=1]="InsertColumnAfter",t[t.InsertRowBefore=2]="InsertRowBefore",t[t.InsertRowAfter=3]="InsertRowAfter",t[t.DeleteColumn=4]="DeleteColumn",t[t.DeleteRow=5]="DeleteRow"}(C||(C={})),C))();let M=(()=>{class t{constructor(t,e,n,o){this.options=t,this.editor=e,this.texts$=n,this.tableCommandTexts$=o,this.commandsRegistry={[C.InsertColumnAfter]:()=>this.editor.addColumnAfter(),[C.InsertColumnBefore]:()=>this.editor.addColumnBefore(),[C.InsertRowAfter]:()=>this.editor.addRowAfter(),[C.InsertRowBefore]:()=>this.editor.addRowBefore(),[C.DeleteColumn]:()=>this.editor.deleteColumn(),[C.DeleteRow]:()=>this.editor.deleteRow()},this.isActive$=this.editor.isActive$("table"),this.rowsColumnsManagingText$=this.texts$.pipe((0,r.U)((t=>t.rowsColumnsManaging)))}onTableOption(t){this.commandsRegistry[t]()}}return t.ɵfac=function(e){return new(e||t)(s.Y36(i.mJ),s.Y36(o.$3),s.Y36(i.rf),s.Y36(i.$i))},t.ɵcmp=s.Xpm({type:t,selectors:[["tui-table-row-column-manager"]],decls:4,vars:3,consts:[[3,"canOpen","content",4,"tuiLet"],["tableOptionsDropdown",""],[3,"canOpen","content"],["tableCommand",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint"],[4,"ngFor","ngForOf"],["tuiOption","",3,"click",4,"ngFor","ngForOf"],["tuiOption","",3,"click"]],template:function(t,e){1&t&&(s.YNc(0,y,4,8,"tui-hosted-dropdown",0),s.ALo(1,"async"),s.YNc(2,x,3,3,"ng-template",null,1,s.W1O)),2&t&&s.Q6J("tuiLet",s.lcZ(1,1,e.isActive$))},directives:[a.L,l.o,c.v,d.$,u.D,h.x,p.t,f.D,m.q,g.sg,b.R,v.v],pipes:[g.Ov],encapsulation:2,changeDetection:0}),t})()},87048:(t,e,n)=>{n.d(e,{M:()=>c});var o=n(74788),i=n(62579),r=n(67274),s=n(46648);function a(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.NdJ("click",(function(){return o.CHM(t),o.oxw(2).select()}))("mouseenter",(function(e){const n=o.CHM(t).$implicit,i=o.oxw().$implicit;return o.oxw().updateCurrentSize(n+1,i+1,e)})),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw().$implicit,i=o.oxw();o.ekj("t-cell_hovered",i.tableSelectHovered(t,n))}}function l(t,e){if(1&t&&(o.TgZ(0,"div",2),o.YNc(1,a,1,2,"div",3),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("tuiRepeatTimesOf",t.rowsNumber)}}let c=(()=>{class t{constructor(t){this.win=t,this.selectSize=new o.vpe,this.onSelectSize=this.selectSize,this.tableSize={rows:1,cols:1}}get columnsNumber(){return Math.min(Math.max(3,this.tableSize.cols+1),15)}get rowsNumber(){return Math.min(Math.max(3,this.tableSize.rows+1),15)}tableSelectHovered(t,e){return t70&&(this.tableSize={rows:t,cols:e})}onClick(){this.select()}select(){this.selectSize.emit(this.tableSize)}}return t.ɵfac=function(e){return new(e||t)(o.Y36(i.m9))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-table-size-selector"]],outputs:{selectSize:"selectSize",onSelectSize:"onSelectSize"},decls:3,vars:3,consts:[["class","t-column",4,"tuiRepeatTimes","tuiRepeatTimesOf"],[1,"t-description"],[1,"t-column"],["class","t-cell",3,"t-cell_hovered","click","mouseenter",4,"tuiRepeatTimes","tuiRepeatTimesOf"],[1,"t-cell",3,"click","mouseenter"]],template:function(t,e){1&t&&(o.YNc(0,l,2,1,"div",0),o.TgZ(1,"div",1),o._uU(2),o.qZA()),2&t&&(o.Q6J("tuiRepeatTimesOf",e.columnsNumber),o.xp6(2),o.AsE("",e.tableSize.cols,"×",e.tableSize.rows,""))},directives:[s.X],styles:["[_nghost-%COMP%]{display:block;padding:.75rem}.t-cell[_ngcontent-%COMP%]{display:inline-block;background-color:var(--tui-base-01);width:1.25rem;height:1.25rem;border-radius:.25rem;margin:.125rem;border:1px solid var(--tui-base-04);cursor:pointer}.t-cell_hovered[_ngcontent-%COMP%]{background-color:var(--tui-base-02)}.t-column[_ngcontent-%COMP%]{white-space:nowrap}.t-description[_ngcontent-%COMP%]{text-align:center}"],changeDetection:0}),t})()},57891:(t,e,n)=>{n.d(e,{G:()=>x});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(42486),c=n(98778),d=n(16331),u=n(18289),h=n(44099),p=n(13938),f=n(10406),m=n(63790),g=n(51928),b=n(59113),v=n(55788),y=n(12057);function w(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"tui-palette",6),a.NdJ("selectedColor",(function(e){return a.CHM(t),a.oxw(2).editor.setFontColor(e)})),a.qZA()}if(2&t){const t=e.$implicit,n=a.oxw(2);a.Q6J("colors",n.colors)("tuiActiveZoneParent",t)}}function k(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",1,2),a._UZ(2,"button",3),a.ALo(3,"async"),a._UZ(4,"div",4),a.YNc(5,w,1,2,"ng-template",null,5,a.W1O),a.qZA()),2&t){const t=e.tuiLet,n=a.MAs(1),o=a.MAs(6),i=a.oxw();a.Q6J("content",o)("tuiDropdownMaxHeight",999),a.xp6(2),a.Q6J("focusable",n.open)("icon",i.options.icons.textColor)("pseudoActive",n.open)("tuiHint",a.lcZ(3,8,i.foreColorText$)),a.xp6(2),a.Udp("background",t)}}let x=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.colors=this.options.colors,this.fontColor$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.getFontColor()||this.options.blankColor)),(0,s.x)()),this.foreColorText$=this.texts$.pipe((0,r.U)((t=>t.foreColor)))}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-text-color"]],inputs:{colors:"colors"},decls:2,vars:3,consts:[[3,"content","tuiDropdownMaxHeight",4,"tuiLet"],[3,"content","tuiDropdownMaxHeight"],["color",""],["appearance","icon","automation-id","toolbar__color-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],[1,"t-plate"],["colorDropdown",""],[1,"t-color-picker",3,"colors","tuiActiveZoneParent","selectedColor"]],template:function(t,e){1&t&&(a.YNc(0,k,7,10,"tui-hosted-dropdown",0),a.ALo(1,"async")),2&t&&a.Q6J("tuiLet",a.lcZ(1,1,e.fontColor$))},directives:[l.L,c.o,d.Ek,u.v,h.$,p.D,f.x,m.t,g.D,b.R,v.e],pipes:[y.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},51618:(t,e,n)=>{n.d(e,{M6:()=>o.M,yB:()=>d});var o=n(17999),i=n(12057),r=n(64642),s=n(67274),a=n(8674),l=n(78790),c=n(74788);let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=c.oAB({type:t}),t.ɵinj=c.cJS({imports:[[i.ez,s.goS,r.udY,s.fNO,s.jhF,a.Fu,l.er,l.mp,l.__,l.iA,l.p7,l.Zv,l.pu,l.Ur,l._t,l.XC,l.P_,l.y9,r.HOV,l.jP]]}),t})();n(96827)},96827:(t,e,n)=>{n.d(e,{B:()=>r});var o=n(74788),i=n(64642);let r=(()=>{class t{constructor(t){this.el=t}get toolsContainers(){return Array.from(this.el.nativeElement.querySelectorAll("[tuiItem]"))}onHorizontalNavigation(t){const{toolsContainers:e}=this,n=e.findIndex(i.zb4),o=e[(0,i.Kiv)(n+(t?-1:1),0,e.length-1)],r=t?this.findPreviousTool(o):this.findNextTool(o);r&&r.focus()}findFirstFocusableTool(t=!1){const e=t?this.toolsContainers.slice().reverse():this.toolsContainers;for(const t of e){const e=(0,i._hh)(t)?t:(0,i.BWF)({initial:t,root:t,keyboard:!1});if(e)return e}return null}findPreviousTool(t){return(0,i._hh)(t)?t:(0,i.BWF)({initial:t,root:t,keyboard:!1})||(0,i.BWF)({initial:t,root:this.el.nativeElement,previous:!0,keyboard:!1})}findNextTool(t){return(0,i._hh)(t)?t:(0,i.BWF)({initial:t,root:this.el.nativeElement,keyboard:!1})}}return t.ɵfac=function(e){return new(e||t)(o.Y36(o.SBq))},t.ɵdir=o.lG2({type:t,selectors:[["","tuiToolbarNavigationManager",""]],hostBindings:function(t,e){1&t&&o.NdJ("keydown.arrowRight.prevent",(function(){return e.onHorizontalNavigation(!1)}))("keydown.arrowLeft.prevent",(function(){return e.onHorizontalNavigation(!0)}))}}),t})()},17999:(t,e,n)=>{n.d(e,{M:()=>mt});var o=n(74788),i=n(64642),r=n(18892),s=n(86114),a=n(95161),l=n(71831),c=n(15257),d=n(46782),u=n(96827),h=n(12057),p=n(63973),f=n(18289),m=n(44099),g=n(32489),b=n(13938),v=n(10406),y=n(63790),w=n(51928),k=n(73688),x=n(81618),C=n(20719),M=n(30928),S=n(98778),A=n(41039),O=n(57891),T=n(73545),N=n(57289),E=n(18885),I=n(49382),D=n(52187),P=n(61899),H=n(31433),L=n(34773),_=n(41218);const R=["dropdown"];function z(t,e){1&t&&o.GkF(0)}function $(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",6),o.TgZ(1,"button",7),o.NdJ("click",(function(){return o.CHM(t),o.oxw(2).undo()})),o.qZA(),o.TgZ(2,"button",8),o.NdJ("click",(function(){return o.CHM(t),o.oxw(2).redo()})),o.qZA(),o.qZA()}if(2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(1),o.Q6J("disabled",e.undoDisabled)("focusable",!1)("icon",e.options.icons.undo)("tuiHint",t.undo),o.xp6(1),o.Q6J("disabled",e.redoDisabled)("focusable",!1)("icon",e.options.icons.redo)("tuiHint",t.redo)}}function B(t,e){1&t&&(o.TgZ(0,"div",6),o._UZ(1,"tui-font-size",9),o.qZA())}function F(t,e){if(1&t&&o._UZ(0,"tui-font-style",15),2&t){const t=o.oxw(3);o.Q6J("enabledTools",t.toolsSet)}}function J(t,e){1&t&&o._UZ(0,"tui-align-content",9)}function Z(t,e){1&t&&o._UZ(0,"tui-list-configs",9)}function Y(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",16,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).toggleQuote()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("disabled",e.unorderedList||e.orderedList)("focusable",!1)("icon",e.options.icons.quote)("pseudoActive",e.blockquote)("tuiHint",t.quote)}}function j(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tui-edit-link",22,23),o.NdJ("addLink",(function(e){o.CHM(t),o.oxw();const n=o.MAs(1);return o.oxw(3).onLink(n,e)}))("removeLink",(function(){o.CHM(t),o.oxw();const e=o.MAs(1);return o.oxw(3).onLink(e)})),o.qZA()}}function q(t,e){if(1&t&&(o.TgZ(0,"tui-hosted-dropdown",18,19),o._UZ(2,"button",20,17),o.YNc(4,j,2,0,"ng-template",null,21,o.W1O),o.qZA()),2&t){const t=o.MAs(1),e=o.MAs(5),n=o.oxw(2).ngIf,i=o.oxw();o.Q6J("canOpen",i.canOpenAnchor)("content",e),o.xp6(2),o.Q6J("focusable",t.open)("icon",i.options.icons.link)("pseudoActive",t.open||i.a)("tuiHint",n.link)}}function V(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tui-edit-link",28),o.NdJ("addLink",(function(e){o.CHM(t),o.oxw();const n=o.MAs(1);return o.oxw(3).setAnchor(n,e)}))("removeLink",(function(){return o.CHM(t),o.oxw(4).removeAnchor()})),o.qZA()}2&t&&o.Q6J("anchorMode",!0)}function U(t,e){if(1&t&&(o.TgZ(0,"tui-hosted-dropdown",24,25),o._UZ(2,"button",26),o.YNc(3,V,1,1,"ng-template",null,27,o.W1O),o.qZA()),2&t){const t=o.MAs(1),e=o.MAs(4),n=o.oxw(2).ngIf,i=o.oxw();o.Q6J("canOpen",i.canOpenAnchor)("content",e),o.xp6(2),o.Q6J("focusable",!1)("icon",i.options.icons.anchor)("pseudoActive",t.open||i.jumpAnchor)("tuiHint",n.insertAnchor)}}function W(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"button",29,17),o.NdJ("click",(function(){return o.CHM(t),o.MAs(4).click()})),o.qZA(),o.TgZ(3,"input",30,31),o.NdJ("change",(function(){o.CHM(t);const e=o.MAs(4);return o.oxw(3).onAttach(e)})),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.xp6(1),o.Q6J("focusable",!1)("icon",e.options.icons.attach)("tuiHint",t.attach),o.xp6(2),o.Q6J("accept",e.attachOptions.accept)("multiple",e.attachOptions.multiple)("tuiFocusable",!1)}}function Q(t,e){if(1&t&&(o.TgZ(0,"div",6),o.YNc(1,F,1,1,"tui-font-style",10),o.YNc(2,J,1,0,"tui-align-content",11),o.YNc(3,Z,1,0,"tui-list-configs",11),o.YNc(4,Y,2,5,"button",12),o.YNc(5,q,6,6,"tui-hosted-dropdown",13),o.YNc(6,U,5,6,"tui-hosted-dropdown",14),o.YNc(7,W,5,6,"ng-container",1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.formatEnabled),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Align)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.List)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Quote)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Link)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Anchor)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Attach))}}function K(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",33,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).toggleSubscript()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("focusable",!1)("icon",e.options.icons.sub)("pseudoActive",e.subscript)("tuiHint",t.subscript)}}function G(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",33,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).toggleSuperscript()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("focusable",!1)("icon",e.options.icons.sup)("pseudoActive",e.superscript)("tuiHint",t.superscript)}}function X(t,e){if(1&t&&(o.TgZ(0,"div",6),o.YNc(1,K,2,4,"button",32),o.YNc(2,G,2,4,"button",32),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Sub)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Sup))}}function tt(t,e){if(1&t&&o._UZ(0,"tui-text-color",35),2&t){const t=o.oxw(3);o.Q6J("colors",t.colors)}}function et(t,e){if(1&t&&o._UZ(0,"tui-highlight-color",35),2&t){const t=o.oxw(3);o.Q6J("colors",t.colors)}}function nt(t,e){if(1&t&&(o.TgZ(0,"div",6),o.YNc(1,tt,1,1,"tui-text-color",34),o.YNc(2,et,1,1,"tui-highlight-color",34),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Color)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Hilite))}}function ot(t,e){1&t&&o._UZ(0,"tui-code",9)}function it(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",39,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).onTeX()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("focusable",!1)("icon",e.options.icons.tex)("tuiHint",t.tex)}}function rt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",40),o.TgZ(1,"button",41,17),o.NdJ("click",(function(){return o.CHM(t),o.MAs(4).click()})),o.qZA(),o.TgZ(3,"input",42,43),o.NdJ("change",(function(){o.CHM(t);const e=o.MAs(4);return o.oxw(3).onImage(e)})),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.xp6(1),o.Q6J("focusable",!1)("icon",e.options.icons.image)("tuiHint",t.image),o.xp6(2),o.Q6J("tuiFocusable",!1)}}function st(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",29,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).insertHorizontalRule()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("focusable",!1)("icon",e.options.icons.hr)("tuiHint",t.insertHorizontalRule)}}function at(t,e){if(1&t&&(o.TgZ(0,"div",6),o.YNc(1,ot,1,0,"tui-code",11),o.YNc(2,it,2,3,"button",36),o.YNc(3,rt,5,4,"div",37),o.YNc(4,st,2,3,"button",38),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Code)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Tex)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Img)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.HR))}}function lt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",6),o.TgZ(1,"button",29,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(2).removeFormat()})),o.qZA(),o.qZA()}if(2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(1),o.Q6J("focusable",!1)("icon",e.options.icons.clear)("tuiHint",t.clear)}}function ct(t,e){1&t&&(o.TgZ(0,"div",6),o._UZ(1,"tui-details",44),o._UZ(2,"tui-details-remove",44),o.qZA())}function dt(t,e){if(1&t&&o._UZ(0,"tui-table-cell-color",35),2&t){const t=o.oxw(3);o.Q6J("colors",t.colors)}}function ut(t,e){if(1&t&&(o.TgZ(0,"div",6),o._UZ(1,"tui-editor-group-tool",44),o.YNc(2,dt,1,1,"tui-table-cell-color",34),o.qZA()),2&t){const t=o.oxw(2);o.xp6(2),o.Q6J("ngIf",!t.enabled(t.TuiEditorTool.Table))}}function ht(t,e){if(1&t&&(o.TgZ(0,"div",6),o._UZ(1,"tui-table-create",44),o._UZ(2,"tui-table-row-column-manager",44),o._UZ(3,"tui-table-merge-cells",44),o._UZ(4,"tui-table-cell-color",35),o.qZA()),2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("colors",t.colors)}}function pt(t,e){if(1&t&&(o.TgZ(0,"section",4),o.YNc(1,$,3,8,"div",5),o.YNc(2,B,2,0,"div",5),o.YNc(3,Q,8,7,"div",5),o.YNc(4,X,3,2,"div",5),o.YNc(5,nt,3,2,"div",5),o.YNc(6,at,5,4,"div",5),o.YNc(7,lt,3,3,"div",5),o.YNc(8,ct,3,0,"div",5),o.YNc(9,ut,3,1,"div",5),o.YNc(10,ht,5,1,"div",5),o.TgZ(11,"div",6),o.Hsn(12),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Undo)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Size)),o.xp6(1),o.Q6J("ngIf",t.firstBigBlockEnabled),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Sub)||t.enabled(t.TuiEditorTool.Sup)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Color)||t.enabled(t.TuiEditorTool.Hilite)),o.xp6(1),o.Q6J("ngIf",t.secondBigBlockEnabled),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Clear)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Details)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Group)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Table))}}const ft=["*"];let mt=(()=>{class t{constructor(t,e,n,s,l,c,d,u){this.el=t,this.editor=e,this.imageLoader=n,this.attachOptions=s,this.filesLoader=l,this.texts$=c,this.options=d,this.destroy$=u,this.dropdowns=i.Mmc,this.colors=this.options.colors,this.disabled=!1,this.linkAdded=new o.vpe,this.texClicked=new o.vpe,this.fileAttached=new o.vpe,this.TuiEditorTool=a._,this.toolsSet=new Set(r.Db)}set tools(t){this.toolsSet=new Set(t)}get focused(){return(0,i.zb4)(this.el.nativeElement)||!!this.dropdowns.find((({nativeElement:t})=>(0,i.zb4)(t)))}get focusable(){return!this.focused&&!this.disabled}get unorderedList(){return this.editor.isActive("bulletList")}get orderedList(){return this.editor.isActive("orderedList")}get blockquote(){return this.editor.isActive("blockquote")}get a(){return this.editor.isActive("link")}get jumpAnchor(){return this.editor.isActive("jumpAnchor")}get canOpenAnchor(){return!this.a&&!this.jumpAnchor}get undoDisabled(){return this.editor.undoDisabled()}get redoDisabled(){return this.editor.redoDisabled()}get subscript(){return this.editor.isActive("subscript")}get superscript(){return this.editor.isActive("superscript")}get formatEnabled(){return this.enabled(a._.Bold)||this.enabled(a._.Italic)||this.enabled(a._.Underline)||this.enabled(a._.Strikethrough)}get firstBigBlockEnabled(){return this.formatEnabled||this.enabled(a._.Align)||this.enabled(a._.List)||this.enabled(a._.Quote)||this.enabled(a._.Link)||this.enabled(a._.Anchor)||this.enabled(a._.Attach)}get secondBigBlockEnabled(){return this.enabled(a._.Code)||this.enabled(a._.Tex)||this.enabled(a._.Img)||this.enabled(a._.HR)}onMouseDown(t,e){e.closest("button")||(t.preventDefault(),this.editor.focus())}onBottomFocus(){this.focusLast()}onTopFocus(){this.focusFirst()}onImage(t){var e;const n=null===(e=t.files)||void 0===e?void 0:e[0];t.value="",n&&this.imageLoader(n).pipe((0,c.q)(1),(0,d.R)(this.destroy$)).subscribe((t=>this.addImage(t)))}onAttach(t){var e;const n=Array.from(t.files||[]);t.value="",n&&(null===(e=this.filesLoader)||void 0===e||e.call(this,n).pipe((0,c.q)(1),(0,d.R)(this.destroy$)).subscribe((t=>this.fileAttached.emit(t))))}onTeX(){this.texClicked.emit()}onLink(t,e){t.open=!1,e&&this.editor.toggleLink(e)}setAnchor(t,e){t.open=!1,e&&(this.editor.setAnchor(e),this.editor.selectClosest())}removeAnchor(){this.editor.removeAnchor()}enabled(t){return this.toolsSet.has(t)}undo(){this.editor.undo()}redo(){this.editor.redo()}insertHorizontalRule(){this.editor.setHorizontalRule()}removeFormat(){this.editor.removeFormat()}toggleOrderedList(){this.editor.toggleOrderedList()}toggleQuote(){this.editor.toggleBlockquote()}toggleSubscript(){this.editor.toggleSubscript()}toggleSuperscript(){this.editor.toggleSuperscript()}addImage(t){this.editor.setImage(t)}focusFirst(){var t;const e=null===(t=this.navigationManager)||void 0===t?void 0:t.findFirstFocusableTool();e&&e.focus()}focusLast(){var t;const e=null===(t=this.navigationManager)||void 0===t?void 0:t.findFirstFocusableTool(!0);e&&e.focus()}}return t.ɵfac=function(e){return new(e||t)(o.Y36(o.SBq,8),o.Y36(s.$3),o.Y36(l.p7),o.Y36(l.dR),o.Y36(l.zc,8),o.Y36(l.rf),o.Y36(l.mJ),o.Y36(i.a31,2))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-toolbar"]],viewQuery:function(t,e){if(1&t&&(o.Gf(u.B,5),o.Gf(R,5,o.SBq)),2&t){let t;o.iGM(t=o.CRH())&&(e.navigationManager=t.first),o.iGM(t=o.CRH())&&(e.dropdowns=t)}},hostAttrs:["role","toolbar"],hostVars:2,hostBindings:function(t,e){1&t&&o.NdJ("mousedown",(function(t){return e.onMouseDown(t,t.target)})),2&t&&o.ekj("_disabled",e.disabled)},inputs:{colors:"colors",disabled:"disabled",tools:"tools"},outputs:{linkAdded:"linkAdded",texClicked:"texClicked",fileAttached:"fileAttached"},features:[o._Bn([i.a31])],ngContentSelectors:ft,decls:7,vars:8,consts:[["type","button",1,"t-prevent-parent-label-behavior"],[4,"ngIf"],[3,"tuiFocusable","focus"],["tuiToolbarNavigationManager","","class","t-tools-wrapper",4,"ngIf"],["tuiToolbarNavigationManager","",1,"t-tools-wrapper"],["class","t-block",4,"ngIf"],[1,"t-block"],["appearance","icon","automation-id","toolbar__undo-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"disabled","focusable","icon","tuiHint","click"],["appearance","icon","automation-id","toolbar__redo-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"disabled","focusable","icon","tuiHint","click"],["tuiItem","",1,"t-tool","t-wrapper"],["tuiItem","","class","t-tool t-wrapper",3,"enabledTools",4,"ngIf"],["tuiItem","","class","t-tool t-wrapper",4,"ngIf"],["appearance","icon","automation-id","toolbar__quote-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button","class","t-tool t-tool_margin",3,"disabled","focusable","icon","pseudoActive","tuiHint","click",4,"ngIf"],["tuiItem","","class","t-wrapper",3,"canOpen","content",4,"ngIf"],["class","t-wrapper",3,"canOpen","content",4,"ngIf"],["tuiItem","",1,"t-tool","t-wrapper",3,"enabledTools"],["appearance","icon","automation-id","toolbar__quote-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"disabled","focusable","icon","pseudoActive","tuiHint","click"],["button",""],["tuiItem","",1,"t-wrapper",3,"canOpen","content"],["link",""],["appearance","icon","automation-id","toolbar__link-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",1,"t-tool",3,"focusable","icon","pseudoActive","tuiHint"],["linkDropdown",""],[3,"addLink","removeLink"],["dropdown",""],[1,"t-wrapper",3,"canOpen","content"],["anchor",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["anchorDropdown",""],[3,"anchorMode","addLink","removeLink"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"focusable","icon","tuiHint","click"],["type","file",1,"t-file-upload",3,"accept","multiple","tuiFocusable","change"],["fileUpload",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button","class","t-tool t-tool_margin",3,"focusable","icon","pseudoActive","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"focusable","icon","pseudoActive","tuiHint","click"],["tuiItem","","class","t-tool t-wrapper",3,"colors",4,"ngIf"],["tuiItem","",1,"t-tool","t-wrapper",3,"colors"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button","class","t-tool",3,"focusable","icon","tuiHint","click",4,"ngIf"],["tuiItem","","class","t-wrapper",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button","class","t-tool t-tool_margin",3,"focusable","icon","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool",3,"focusable","icon","tuiHint","click"],["tuiItem","",1,"t-wrapper"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",1,"t-tool",3,"focusable","icon","tuiHint","click"],["accept","image/*","type","file",1,"t-image",3,"tuiFocusable","change"],["image",""],["tuiItem","",1,"t-tool","t-tool_margin"]],template:function(t,e){1&t&&(o.F$t(),o._UZ(0,"button",0),o.YNc(1,z,1,0,"ng-container",1),o.ALo(2,"async"),o.TgZ(3,"div",2),o.NdJ("focus",(function(){return e.onTopFocus()})),o.qZA(),o.TgZ(4,"div",2),o.NdJ("focus",(function(){return e.onBottomFocus()})),o.qZA(),o.YNc(5,pt,13,10,"section",3),o.ALo(6,"async")),2&t&&(o.xp6(1),o.Q6J("ngIf",o.lcZ(2,4,e.editor.stateChange$)),o.xp6(2),o.Q6J("tuiFocusable",e.focusable),o.xp6(1),o.Q6J("tuiFocusable",e.focusable),o.xp6(1),o.Q6J("ngIf",o.lcZ(6,6,e.texts$)))},directives:[h.O5,p.t,u.B,f.v,m.$,g.w,b.D,v.x,y.t,w.D,k.m,x.h,C.X,M.w,S.o,A.l,O.G,T.U,N.T,E.y,I.U,D.d,P.p,H.l,L._,_.Y],pipes:[h.Ov],styles:['.t-tools-wrapper[_ngcontent-%COMP%]{scrollbar-width:none;-ms-overflow-style:none;display:flex;padding:.25rem .75rem;overflow:auto;flex-wrap:wrap;box-shadow:0 .125rem .1875rem #0000001a}.t-tools-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar, .t-tools-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:transparent;width:0;height:0}.t-tools-wrapper._disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:var(--tui-disabled-opacity)}.t-block[_ngcontent-%COMP%]{display:flex;padding:.25rem 0}.t-block[_ngcontent-%COMP%]:not(:last-child):after{content:"";display:block;margin:0 .25rem;width:1px;background:var(--tui-secondary-active)}.t-tool[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}button.t-tool[_ngcontent-%COMP%]:hover, .t-tool[_ngcontent-%COMP%] button:hover{background:var(--tui-secondary-hover)}.t-tool_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-wrapper[_ngcontent-%COMP%]{position:relative;margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-font[_ngcontent-%COMP%]{padding:.3em 0;outline:none;width:100%;pointer-events:none}.t-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;font-size:0;opacity:0;cursor:pointer}.t-image[_ngcontent-%COMP%]::-webkit-file-upload-button{display:none}.t-file-upload[_ngcontent-%COMP%]{display:none}.t-color-picker[_ngcontent-%COMP%] tui-hosted-dropdown, .t-color-picker[_ngcontent-%COMP%] tui-color-picker, .t-color-picker[_ngcontent-%COMP%] tui-color-edit{display:none}.t-prevent-parent-label-behavior[_ngcontent-%COMP%]{display:none}'],changeDetection:0}),t})()},18892:(t,e,n)=>{n.d(e,{hK:()=>i,pH:()=>l,pL:()=>p,_s:()=>c,Ci:()=>d,jU:()=>h,DN:()=>u,sw:()=>o,Db:()=>s,RR:()=>a});const o=new Map([["color-black-100","#909090"],["color-black-200","#666666"],["color-black-300","#333333"],["color-blue-100","#1771e6"],["color-blue-200","#1464cc"],["color-blue-300","#0953b3"],["color-gray-100","#f5f5f6"],["color-gray-200","#e7e8ea"],["color-gray-300","#cbcfd3"],["color-gray-400","#959ba4"],["color-gray-500","#79818c"],["color-gray-600","#616871"],["color-green-100","#39b54a"],["color-green-200","#2ca53a"],["color-green-300","#168a21"],["color-light-blue-100","#ecf1f7"],["color-light-blue-200","#e4ebf3"],["color-light-blue-300","#dde4ed"],["color-red-100","#e01f19"],["color-red-200","#d3120e"],["color-red-300","#c40b08"],["color-yellow-100","#FFDD2C"],["color-yellow-200","#FCC521"],["color-yellow-300","#FAB618"],["transparent","transparent"]]),i="rgb(51, 51, 51)";var r=n(95161);const s=[r._.Undo,r._.Size,r._.Bold,r._.Italic,r._.Underline,r._.Align,r._.List,r._.Quote,r._.Link,r._.Anchor,r._.Color,r._.Hilite,r._.Clear,r._.Strikethrough,r._.Code,r._.Img,r._.HR,r._.Sup,r._.Sub,r._.Table,r._.Details];function a(t){return[{px:13,name:t.small},{px:15,name:t.normal},{px:17,name:t.large},{px:24,family:"var(--tui-font-heading)",name:t.subtitle,headingLevel:2,weight:"bold"},{px:30,family:"var(--tui-font-heading)",name:t.title,headingLevel:1,weight:"bold"}]}const l=["id","class","src","style","controls","loop","muted","preload","autoplay","width","height","controlsList"],c="#",d="https://",u=":",h="://",p={protocol:d}},86114:(t,e,n)=>{n.d(e,{BN:()=>i,JU:()=>r.JU,mJ:()=>r.mJ,$3:()=>r.$3});var o=n(74788);let i=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=o.oAB({type:t}),t.ɵinj=o.cJS({}),t})();var r=n(79698)},79698:(t,e,n)=>{n.d(e,{JU:()=>o.J,mJ:()=>r,$3:()=>s.$});var o=n(87429),i=n(74788);let r=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=i.oAB({type:t}),t.ɵinj=i.cJS({}),t})();var s=n(26710)},87429:(t,e,n)=>{n.d(e,{J:()=>l});var o=n(74788),i=n(64642),r=n(71831),s=n(46782),a=n(26710);let l=(()=>{class t{constructor(t,e,n,o,i,r){this.el=t,this.renderer=e,this.editor=n,this.editorContainer=o,this.editorLoaded$=i,this.valueChange=this.editor.valueChange$,this.stateChange=this.editor.stateChange$,this.editorLoaded$.pipe((0,s.R)(r)).subscribe((()=>{this.renderer.appendChild(this.el.nativeElement,this.editorContainer)}))}set value(t){this.editor.setValue(t)}set editable(t){this.editor.editable=t}}return t.ɵfac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(o.Qsj),o.Y36(a.$),o.Y36(r.Y1),o.Y36(r.ZW),o.Y36(i.a31,2))},t.ɵdir=o.lG2({type:t,selectors:[["","tuiTiptapEditor",""]],inputs:{value:"value",editable:"editable"},outputs:{valueChange:"valueChange",stateChange:"stateChange"},features:[o._Bn([i.a31])]}),t})()},26710:(t,e,n)=>{n.d(e,{$:()=>f});var o=n(64642),i=n(79765),r=n(74788);let s=(()=>{class t{constructor(){this.stateChange$=new i.xQ,this.valueChange$=new i.xQ}}return t.ɵfac=function(e){return new(e||t)},t.ɵdir=r.lG2({type:t}),t})();var a=n(18892),l=n(71831),c=n(39425),d=n(62463),u=n(39761),h=n(88002),p=n(87519);let f=(()=>{class t extends s{constructor(t){super(),this.editorRef=t,this.editorRef.subscribe((t=>{this.editor=t,t.on("transaction",(()=>{this.stateChange$.next()})),t.on("update",(()=>{const e=t.getHTML(),n=(o=t.getJSON().content,Array.isArray(o)&&1===o.length&&"paragraph"===o[0].type&&!o[0].hasOwnProperty("content")?"":e);var o;this.valueChange$.next(n)}))}))}get isFocused(){return this.editor.isFocused}get html(){return this.editor.getHTML()}get editable(){return this.editor.isEditable}set editable(t){this.editor.setEditable(t,!1)}get state(){return this.editor.state}getOriginTiptapEditor(){return this.editor}undoDisabled(){return!this.editor.can().undo()}redoDisabled(){return!this.editor.can().redo()}getFontColor(){return this.editor.getAttributes("textStyle").fontColor||a.hK}getFontSize(){return parseInt(this.editor.getAttributes("textStyle").fontSize,10)}setFontSize(t){this.editor.chain().setMark("textStyle",{fontSize:(0,o.O9r)(t)}).run()}getBackgroundColor(){var t;return(null===(t=this.editor)||void 0===t?void 0:t.getAttributes("textStyle").backgroundColor)||"transparent"}getCellColor(){return this.editor.getAttributes("tableCell").background||this.editor.getAttributes("tableHeader").background}getGroupColor(){var t,e,n,o;if(this.editor.isActive("group")){const i=null!==(e=null===(t=this.editor.getAttributes("group"))||void 0===t?void 0:t.style)&&void 0!==e?e:"",r=(0,c.jx)(i);return null!==(o=null!==(n=r["background-color"])&&void 0!==n?n:r.background)&&void 0!==o?o:""}return""}onAlign(t){this.editor.chain().focus().setTextAlign(t).run()}setImage(t){this.editor.chain().focus().command((({commands:e,state:n})=>{var o;const i=null!==(o=e.setEditableImage)&&void 0!==o?o:e.setImage;if(i){const o=n.selection.anchor;return i({src:t}),e.setTextSelection(o),!0}return!1})).run()}undo(){this.editor.chain().undo().run()}redo(){this.editor.chain().redo().run()}setHorizontalRule(){this.editor.chain().focus().setHorizontalRule().run()}removeFormat(){this.editor.commands.unsetAllMarks(),this.editor.commands.clearNodes()}setFontColor(t){this.editor.chain().focus().setFontColor(t).run()}setBackgroundColor(t){this.editor.chain().focus().setBackgroundColor(t).run()}toggleUnderline(){this.editor.chain().focus().toggleUnderline().run()}toggleStrike(){this.editor.chain().focus().toggleStrike().run()}toggleOrderedList(){this.editor.chain().focus().toggleOrderedList().run()}toggleUnorderedList(){this.editor.chain().focus().toggleBulletList().run()}togglePre(){this.editor.chain().focus().toggleCodeBlock().run()}sinkListItem(){this.editor.chain().focus().sinkListItem("listItem").run()}liftListItem(){this.editor.chain().focus().liftListItem("listItem").run()}isActive(t){return this.editor.isActive(t)}isActive$(t){return this.stateChange$.pipe((0,u.O)(null),(0,h.U)((()=>this.isActive(t))),(0,p.x)())}toggleBold(){this.editor.chain().focus().toggleBold().run()}toggleCode(){this.editor.chain().focus().toggleCode().run()}toggleItalic(){this.editor.chain().focus().toggleItalic().run()}toggleBlockquote(){this.editor.chain().focus().toggleBlockquote().run()}toggleSubscript(){this.editor.chain().focus().toggleSubscript().run()}toggleSuperscript(){this.editor.chain().focus().toggleSuperscript().run()}toggleCodeBlock(){this.editor.chain().focus().toggleCodeBlock().run()}insertTable(t,e){this.editor.chain().focus().insertTable({cols:t,rows:e}).run()}addColumnAfter(){this.editor.chain().focus().addColumnAfter().run()}addColumnBefore(){this.editor.chain().focus().addColumnBefore().run()}addRowAfter(){this.editor.chain().focus().addRowAfter().run()}addRowBefore(){this.editor.chain().focus().addRowBefore().run()}deleteColumn(){this.editor.chain().focus().deleteColumn().run()}deleteRow(){this.editor.chain().focus().deleteRow().run()}mergeCells(){this.editor.chain().focus().mergeCells().run()}splitCell(){this.editor.chain().focus().splitCell().run()}canMergeCells(){return this.editor.can().mergeCells()}canSplitCells(){return this.editor.can().splitCell()}setHeading(t){this.editor.chain().focus().setHeading({level:t}).run()}setParagraph(t){this.editor.chain().focus().setParagraph().run(),t&&this.editor.chain().setMark("textStyle",t).run()}setHardBreak(){this.editor.chain().setHardBreak().run()}setTextSelection(t){this.editor.commands.setTextSelection(t)}toggleLink(t){this.editor.chain().focus().toggleLink({href:t}).run()}setLink(t){this.editor.chain().focus().setLink({href:t}).run()}unsetLink(){this.editor.chain().focus().unsetLink().run()}focus(){this.editor.chain().focus().run()}setValue(t){t===this.html||""===t&&"

"===this.html||(this.editor.commands.setContent(t),this.editor.view.updateState(d.yy.create({schema:this.editor.state.schema,doc:this.editor.state.doc,selection:this.editor.state.selection,storedMarks:this.editor.state.storedMarks,plugins:this.editor.state.plugins})))}destroy(){this.editor.destroy()}setCellColor(t){this.editor.chain().focus().setCellBackground(t).run()}selectClosest(){const t=this.editor.state.selection.anchor,{schema:e,doc:n}=this.editor.state,o=(0,c.Yz)(n.resolve(t),e.marks.link);o&&this.editor.chain().setTextSelection(o).run()}enter(){this.editor.commands.enter()}setDetails(){this.editor.commands.setDetails()}removeDetails(){this.editor.commands.removeDetails()}setGroup(){this.editor.commands.setGroup()}removeGroup(){this.editor.commands.removeGroup()}setGroupHilite(t){this.editor.commands.setGroupHilite(t)}setAnchor(t){this.editor.commands.setAnchor(t.replace("#",""))}removeAnchor(){this.editor.commands.removeAnchor()}setFileLink(t){this.editor.commands.setFileLink(t)}setYoutubeVideo(t){this.editor.commands.setYoutubeVideo(t)}setIframe(t){this.editor.commands.setIframe(t)}removeEmptyTextStyle(){this.editor.commands.removeEmptyTextStyle()}toggleMark(t,e,n){this.editor.commands.toggleMark(t,e,n)}}return t.ɵfac=function(e){return new(e||t)(r.LFG(l.ZW))},t.ɵprov=r.Yz7({token:t,factory:t.ɵfac}),t})()},95161:(t,e,n)=>{n.d(e,{_:()=>o});var o=(()=>(function(t){t.Align="justify",t.Anchor="anchor",t.Attach="attach",t.Bold="bold",t.Clear="clear",t.Code="code",t.Color="foreColor",t.Details="details",t.Group="group",t.HR="insertHorizontalRule",t.Hilite="hiliteColor",t.Img="image",t.Italic="italic",t.Link="link",t.List="list",t.MergeCells="mergeCells",t.Quote="quote",t.RowsColumnsManaging="rowsColumnsManaging",t.Size="fontSize",t.SplitCells="splitCells",t.Strikethrough="strikeThrough",t.Sub="subscript",t.Sup="superscript",t.Table="insertTable",t.Tex="tex",t.Underline="underline",t.Undo="undo"}(o||(o={})),o))()},13511:(t,e,n)=>{n.r(e),n.d(e,{BackgroundColor:()=>o}),n(84402);const o=n(11046).Extension.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,renderHTML:({backgroundColor:t})=>t?{style:`background-color: ${t}`}:{},parseHTML:({style:t})=>t.backgroundColor.replace(/['"]+/g,""),keepOnSplit:!1}}}]},addCommands:()=>({setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).run()})})},41131:(t,e,n)=>{n.r(e),n.d(e,{TuiFileLink:()=>o});const o=n(11046).Extension.create({name:"fileLink",addCommands:()=>({setFileLink:t=>({state:e,chain:n})=>{const{selection:o}=e,i=' ';return(Math.abs(o.to-o.from)>0?n().toggleMark("link",{href:t.link},{extendEmptyMarkRange:!0}).setTextSelection(o.to).insertContent(i):n().insertContent(`${t.name}${i}`)).setTextSelection(o.to).run()}})})},47841:(t,e,n)=>{n.r(e),n.d(e,{FontColor:()=>o}),n(84402);const o=n(11046).Extension.create({name:"fontColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontColor:{default:null,renderHTML:({fontColor:t})=>t?{style:`color: ${t}`}:{},parseHTML:({style:t})=>t.color.replace(/['"]+/g,""),keepOnSplit:!1}}}]},addCommands:()=>({setFontColor:t=>({chain:e})=>e().setMark("textStyle",{fontColor:t}).run(),unsetFontColor:()=>({chain:t})=>t().setMark("textStyle",{fontColor:null}).run()})})},83120:(t,e,n)=>{n.r(e),n.d(e,{TuiFontSize:()=>o}),n(84402);const o=n(11046).Extension.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:({style:t})=>t.fontSize,renderHTML:({fontSize:t})=>t?{style:`font-size: ${t}`}:{}}}}]},addCommands:()=>({setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})})},38981:(t,e,n)=>{n.r(e),n.d(e,{TUI_EDITOR_GROUP_DEFAULT_OPTIONS:()=>r,createGroupExtension:()=>s});var o=n(39425),i=n(11046);const r={groupNodeClass:"tui-group-node",groupPointerNodeClass:"tui-group-pointer",nested:!0,draggable:!0,createOnEnter:!1},s=(t={})=>{const{draggable:e,nested:n,groupNodeClass:s,groupPointerNodeClass:a,createOnEnter:l}=Object.assign(Object.assign({},r),t);return i.Node.create({name:"group",draggable:e,group:"block",content:n?"block+":"block",addAttributes:()=>({style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>t.style?{style:t.style}:{}}}),parseHTML:()=>[{tag:'div[data-type="group"]'}],renderHTML:({HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{"data-type":"group"}),0],addNodeView:()=>({HTMLAttributes:t,node:n})=>{const o=document.createElement("div"),i=document.createElement("div");if(o.classList.add(s),i.setAttribute("data-type","group"),t.style&&(n.attrs.style=t.style,i.setAttribute("style",t.style)),e){const t=document.createElement("div");t.classList.add(a),t.innerHTML="",t.contentEditable="false",o.append(t,i)}else o.append(i);return{dom:o,contentDOM:i}},addCommands(){return{setGroup:()=>({commands:t,state:e})=>{this.editor.chain().focus().run();const n=(0,o.Ap)(e,""),i=`
${n.trim().startsWith("

")?n:`

${n}

`}
`;return t.insertContent(i)},setGroupHilite:t=>({editor:e})=>{for(let n=e.state.selection.$anchor,o=n.depth;o>0;o--){const i=n.node(o);if(i.type.name===this.name){setTimeout((()=>e.commands.updateAttributes(i.type,{style:`background: ${t}`})));break}}return!0},removeGroup:()=>({state:t,dispatch:e})=>(0,o.yU)(t,e,this.name)}},addKeyboardShortcuts(){return l?{Enter:()=>this.editor.commands.setGroup()}:{}}})}},91876:(t,e,n)=>{n.r(e),n.d(e,{TUI_IFRAME_EDITOR_OPTIONS:()=>l,TuiIframeEditorComponent:()=>d,TuiIframeEditorModule:()=>f,createIframeEditorExtension:()=>p});var o=n(12057),i=n(91211),r=n(64642),s=n(12368),a=n(74788);const l=new a.OlP("[TUI_IFRAME_EDITOR_OPTIONS]",{factory:()=>({minWidth:100,maxWidth:1/0,minHeight:100,maxHeight:1/0})});var c=n(61732);let d=(()=>{class t extends s._3{constructor(t,e,n,o){super(e,o),this.options=t,this.sanitizer=n}get src(){var t;return this.sanitizer.bypassSecurityTrustResourceUrl(null!==(t=this.attrs.src)&&void 0!==t?t:"")}updateSize([t,e]){this._width=Math.max(this.options.minWidth,Math.min(this.options.maxWidth,t)),this._height=Math.max(this.options.minHeight,Math.min(this.options.maxHeight,e))}}return t.ɵfac=function(e){return new(e||t)(a.Y36(l),a.Y36(o.K0),a.Y36(i.H7),a.Y36(r.a31,2))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-iframe-editor"]],features:[a._Bn([r.a31]),a.qOj],decls:2,vars:13,consts:[[3,"height","width","sizeChange"],[3,"height","src","width"]],template:function(t,e){1&t&&(a.TgZ(0,"tui-editor-resizable",0),a.NdJ("sizeChange",(function(t){return e.updateSize(t)})),a._UZ(1,"iframe",1),a.qZA()),2&t&&(a.Q6J("height",e.height)("width",e.width),a.xp6(1),a.Udp("max-height",e.options.maxHeight)("max-width",e.options.maxWidth)("min-height",e.options.minHeight)("min-width",e.options.minWidth),a.Q6J("height",e.height)("src",e.src,a.uOi)("width",e.width))},directives:[c.V],styles:["iframe[_ngcontent-%COMP%]{display:inline;pointer-events:none}"],changeDetection:0}),t})();var u=n(87187),h=n(11046);const p=t=>h.Node.create({name:"iframe",group:"block",atom:!0,draggable:!1,parseHTML:()=>[{tag:'iframe[data-type="iframe-editor"]'}],addAttributes(){return{src:{default:null,keepOnSplit:!1,parseHTML:t=>t.getAttribute("src")},frameborder:{default:0,keepOnSplit:!1,parseHTML:t=>t.getAttribute("frameborder")},width:{default:"100%",keepOnSplit:!1,parseHTML:t=>t.getAttribute("width")},height:{default:null,keepOnSplit:!1,parseHTML:t=>t.getAttribute("height")},allowfullscreen:{keepOnSplit:!1,default:this.options.allowFullscreen,parseHTML:t=>t.getAttribute("allowfullscreen")}}},renderHTML:({HTMLAttributes:t})=>["iframe",(0,h.mergeAttributes)(t,{"data-type":"iframe-editor"})],addNodeView:()=>e=>new u.y(d,e,Object.assign({injector:t},e)),addCommands(){return{setIframe:t=>({commands:e,state:n})=>{const o=n.selection.anchor;return e.enter(),e.setTextSelection(o),e.insertContent({type:this.name,attrs:t}),e.setTextSelection(n.selection.anchor),!0}}}});let f=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=a.oAB({type:t}),t.ɵinj=a.cJS({imports:[[s.Sl]]}),t})()},45267:(t,e,n)=>{n.r(e),n.d(e,{TUI_EDITOR_MAX_IMAGE_WIDTH:()=>d,TUI_EDITOR_MIN_IMAGE_WIDTH:()=>c,TUI_IMAGE_EDITOR_OPTIONS:()=>u,TuiImageEditorComponent:()=>p,TuiImageEditorModule:()=>C,createImageEditorExtension:()=>w,tuiCreateImageEditorExtension:()=>x});var o=n(12057),i=n(74788),r=n(91211),s=n(62579),a=n(64642),l=n(12368);const c=new i.OlP("[TUI_EDITOR_MIN_IMAGE_WIDTH]",{factory:()=>null}),d=new i.OlP("[TUI_EDITOR_MAX_IMAGE_WIDTH]",{factory:()=>null}),u=new i.OlP("[TUI_IMAGE_EDITOR_OPTIONS]",{factory:()=>({minWidth:100,maxWidth:1/0})});var h=n(61732);let p=(()=>{class t extends l._3{constructor(t,e,n,o,i,r,s,a){super(o,r),this.minWidth=t,this.maxWidth=e,this.options=n,this.sanitizer=i,this.el=s,this.win=a,this.contenteditable=!0,this.focused=!1}get dragHandle(){var t;return null!==(t=this.attrs.draggable)&&void 0!==t?t:null}get height(){return null}get alt(){return this.attrs.alt||""}get title(){return this.attrs.title||""}get src(){return this.sanitizer.bypassSecurityTrustResourceUrl(this.attrs.src)}currentTargetIsFocused(t){this.focused=this.el.nativeElement.contains(t),this.focused&&this.selectFakeText()}updateSize([t]){var e,n;const o=null!==(e=this.minWidth)&&void 0!==e?e:this.options.minWidth,i=null!==(n=this.maxWidth)&&void 0!==n?n:this.options.maxWidth;this._width=Math.max(o,Math.min(i,t))}selectFakeText(){var t,e,n;const o=this.doc.createRange();null===(t=this.el.nativeElement.querySelector("p"))||void 0===t||t.focus(),o.selectNode(this.el.nativeElement),null===(e=this.win.getSelection())||void 0===e||e.removeAllRanges(),null===(n=this.win.getSelection())||void 0===n||n.addRange(o)}}return t.ɵfac=function(e){return new(e||t)(i.Y36(c),i.Y36(d),i.Y36(u),i.Y36(o.K0),i.Y36(r.H7),i.Y36(a.a31,2),i.Y36(i.SBq),i.Y36(s.m9))},t.ɵcmp=i.Xpm({type:t,selectors:[["tui-image-editor"]],hostVars:2,hostBindings:function(t,e){1&t&&i.NdJ("click.silent",(function(t){return e.currentTargetIsFocused(t.target)}),!1,i.evT),2&t&&i.uIk("contenteditable",e.contenteditable)("data-drag-handle",e.dragHandle)},features:[i._Bn([a.a31]),i.qOj],decls:4,vars:12,consts:[["contenteditable","false",1,"t-emulate-inline-node"],[3,"autoHeight","width","sizeChange"],["contenteditable","false",3,"alt","src","title","width"]],template:function(t,e){1&t&&(i._UZ(0,"p",0),i.TgZ(1,"tui-editor-resizable",1),i.NdJ("sizeChange",(function(t){return e.updateSize(t)})),i._UZ(2,"img",2),i.qZA(),i._UZ(3,"p",0)),2&t&&(i.xp6(1),i.Q6J("autoHeight",!0)("width",e.width),i.xp6(1),i.Udp("max-width",e.options.maxWidth,"px")("min-width",e.options.minWidth,"px"),i.ekj("ProseMirror-selectednode",e.focused),i.Q6J("alt",e.alt)("src",e.src,i.LSH)("title",e.title)("width",e.width))},directives:[h.V],styles:["[data-drag-handle][_nghost-%COMP%]{cursor:move}img[_ngcontent-%COMP%]{pointer-events:none}.t-emulate-inline-node[_ngcontent-%COMP%]{display:inline-block;margin:0;height:0}"],changeDetection:0}),t})();var f=n(87187),m=n(11046),g=n(44632),b=n(62463);const v=[{tag:'img[data-type="image-editor"]'}],y={src:{default:"",keepOnSplit:!1},width:{default:300,keepOnSplit:!1},alt:{default:"",keepOnSplit:!1},title:{default:"",keepOnSplit:!1}};function w(t,{draggable:e}={}){const n=!(0,a.PcC)(e)||e;return g.Image.extend({name:"imageEditor",group:"inline",inline:!0,atom:!0,priority:0,selectable:!0,draggable:n,parseHTML:()=>v,addAttributes:()=>Object.assign(Object.assign({},y),{draggable:{default:n?"":null,keepOnSplit:!1}}),renderHTML:({HTMLAttributes:t})=>["img",(0,m.mergeAttributes)(t,{"data-type":"image-editor"})],addNodeView:()=>e=>new f.y(p,e,Object.assign({injector:t},e)),addCommands(){return{setEditableImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addProseMirrorPlugins:()=>[new b.Sy({props:{handleDOMEvents:{paste:k,drop:k}}})]})}function k(t,e){var n;const o=e instanceof DragEvent?e.dataTransfer:e.clipboardData,i=Array.from(null!==(n=null==o?void 0:o.files)&&void 0!==n?n:[]).filter((t=>/image/i.test(t.type)));i.length&&e.preventDefault();for(const e of i){const n=new FileReader;n.onload=e=>{var n;const o=t.state.schema.nodes.imageEditor.create({src:null===(n=e.target)||void 0===n?void 0:n.result}),i=t.state.tr.replaceSelectionWith(o);setTimeout((()=>t.dispatch(i)))},n.readAsDataURL(e)}}function x({injector:t,draggable:e}){return w(t,{draggable:e})}let C=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=i.oAB({type:t}),t.ɵinj=i.cJS({imports:[[o.ez,l.Sl]]}),t})()},73757:(t,e,n)=>{function o(t){return t.isActive("bulletList")||t.isActive("orderedList")}n.r(e),n.d(e,{TuiTabExtension:()=>i,tuiIsOrderedOrBulletList:()=>o});const i=n(11046).Extension.create({name:"indent",addKeyboardShortcuts(){return{Tab:()=>o(this.editor)?null:this.editor.commands.insertContent("\t")}}})},50822:(t,e,n)=>{n.r(e),n.d(e,{TuiLink:()=>jt});var o=n(39425),i=n(11046);const r="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",s="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو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",a=(t,e)=>{for(const n in e)t[n]=e[n];return t},l="numeric",c="ascii",d="alpha",u="asciinumeric",h="alphanumeric",p="domain",f="emoji",m="scheme",g="slashscheme",b="whitespace";function v(t,e){return t in e||(e[t]=[]),e[t]}function y(t,e,n){e[l]&&(e[u]=!0,e[h]=!0),e[c]&&(e[u]=!0,e[d]=!0),e[u]&&(e[h]=!0),e[d]&&(e[h]=!0),e[h]&&(e[p]=!0),e[f]&&(e[p]=!0);for(const o in e){const e=v(o,n);e.indexOf(t)<0&&e.push(t)}}function w(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}w.groups={},w.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n=0&&(n[o]=!0);return n}(s.t,o),n);y(r,t,o)}else n&&y(r,n,o);s.t=r}return i.j[t]=s,s}};const k=(t,e,n,o,i)=>t.ta(e,n,o,i),x=(t,e,n,o,i)=>t.tr(e,n,o,i),C=(t,e,n,o,i)=>t.ts(e,n,o,i),M=(t,e,n,o,i)=>t.tt(e,n,o,i),S="WORD",A="UWORD",O="LOCALHOST",T="TLD",N="UTLD",E="SCHEME",I="SLASH_SCHEME",D="NUM",P="WS",H="NL",L="OPENBRACE",_="OPENBRACKET",R="OPENANGLEBRACKET",z="OPENPAREN",$="CLOSEBRACE",B="CLOSEBRACKET",F="CLOSEANGLEBRACKET",J="CLOSEPAREN",Z="AMPERSAND",Y="APOSTROPHE",j="ASTERISK",q="AT",V="BACKSLASH",U="BACKTICK",W="CARET",Q="COLON",K="COMMA",G="DOLLAR",X="DOT",tt="EQUALS",et="EXCLAMATION",nt="HYPHEN",ot="PERCENT",it="PIPE",rt="PLUS",st="POUND",at="QUERY",lt="QUOTE",ct="SEMI",dt="SLASH",ut="TILDE",ht="UNDERSCORE",pt="EMOJI",ft="SYM";var mt=Object.freeze({__proto__:null,WORD:S,UWORD:A,LOCALHOST:O,TLD:T,UTLD:N,SCHEME:E,SLASH_SCHEME:I,NUM:D,WS:P,NL:H,OPENBRACE:L,OPENBRACKET:_,OPENANGLEBRACKET:R,OPENPAREN:z,CLOSEBRACE:$,CLOSEBRACKET:B,CLOSEANGLEBRACKET:F,CLOSEPAREN:J,AMPERSAND:Z,APOSTROPHE:Y,ASTERISK:j,AT:q,BACKSLASH:V,BACKTICK:U,CARET:W,COLON:Q,COMMA:K,DOLLAR:G,DOT:X,EQUALS:tt,EXCLAMATION:et,HYPHEN:nt,PERCENT:ot,PIPE:it,PLUS:rt,POUND:st,QUERY:at,QUOTE:lt,SEMI:ct,SLASH:dt,TILDE:ut,UNDERSCORE:ht,EMOJI:pt,SYM:ft});const gt=/[a-z]/,bt=/\p{L}/u,vt=/\p{Emoji}/u,yt=/\d/,wt=/\s/,kt="\n",xt="️",Ct="‍";let Mt=null,St=null;function At(t,e,n,o,i){let r;const s=e.length;for(let n=0;n=0;)i++;if(i>0){e.push(n.join(""));for(let e=parseInt(t.substring(o,o+i),10);e>0;e--)n.pop();o+=i}else n.push(t[o]),o++}return e}const Tt={defaultProtocol:"http",events:null,format:Et,formatHref:Et,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Nt(t,e){void 0===e&&(e=null);let n=a({},Tt);t&&(n=a(n,t instanceof Nt?t.o:t));const o=n.ignoreTags,i=[];for(let t=0;tt,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const o=null!=e;let i=this.o[t];return i?("object"==typeof i?(i=n.t in i?i[n.t]:Tt[t],"function"==typeof i&&o&&(i=i(e,n))):"function"==typeof i&&o&&(i=i(e,n.t,n)),i):i},getObj(t,e,n){let o=this.o[t];return"function"==typeof o&&null!=e&&(o=o(e,n.t,n)),o},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},It.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),o=t.get("format",e,this);return n&&o.length>n?o.substring(0,n)+"…":o},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=Tt.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),o=t.get("formatHref",n,this),i=t.get("tagName",n,e),r=this.toFormattedString(t),s={},l=t.get("className",n,e),c=t.get("target",n,e),d=t.get("rel",n,e),u=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=o,l&&(s.class=l),c&&(s.target=c),d&&(s.rel=d),u&&a(s,u),{tagName:i,attributes:s,content:r,eventListeners:h}}};const Pt=Dt("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ht=Dt("text"),Lt=Dt("nl"),_t=Dt("url",{isLink:!0,toHref(t){return void 0===t&&(t=Tt.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==O&&t[1].t===Q}}),Rt=t=>new w(t);function zt(t,e,n){const o=n[0].s,i=n[n.length-1].e;return new t(e.slice(o,i),n)}const $t="undefined"!=typeof console&&console&&console.warn||(()=>{}),Bt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ft(t,e){if(void 0===e&&(e=!1),Bt.initialized&&$t(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n 1. Must only contain digits, lowercase ASCII letters or "-"\n 2. Cannot start or end with "-"\n 3. "-" cannot repeat');Bt.customSchemes.push([t,e])}function Jt(t,e,n){if(void 0===e&&(e=null),void 0===n&&(n=null),e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const o=new Nt(n),i=function(t){return Bt.initialized||function(){Bt.scanner=function(t){void 0===t&&(t=[]);const e={};w.groups=e;const n=new w;null==Mt&&(Mt=Ot(r)),null==St&&(St=Ot(s)),M(n,"'",Y),M(n,"{",L),M(n,"[",_),M(n,"<",R),M(n,"(",z),M(n,"}",$),M(n,"]",B),M(n,">",F),M(n,")",J),M(n,"&",Z),M(n,"*",j),M(n,"@",q),M(n,"`",U),M(n,"^",W),M(n,":",Q),M(n,",",K),M(n,"$",G),M(n,".",X),M(n,"=",tt),M(n,"!",et),M(n,"-",nt),M(n,"%",ot),M(n,"|",it),M(n,"+",rt),M(n,"#",st),M(n,"?",at),M(n,'"',lt),M(n,"/",dt),M(n,";",ct),M(n,"~",ut),M(n,"_",ht),M(n,"\\",V);const o=x(n,yt,D,{[l]:!0});x(o,yt,o);const i=x(n,gt,S,{[c]:!0});x(i,gt,i);const h=x(n,bt,A,{[d]:!0});x(h,gt),x(h,bt,h);const v=x(n,wt,P,{[b]:!0});M(n,kt,H,{[b]:!0}),M(v,kt),x(v,wt,v);const k=x(n,vt,pt,{[f]:!0});x(k,vt,k),M(k,xt,k);const Tt=M(k,Ct);x(Tt,vt,k);const Nt=[[gt,i]],Et=[[gt,null],[bt,h]];for(let t=0;tt[0]>e[0]?1:-1));for(let e=0;e=0?i[p]=!0:gt.test(o)?yt.test(o)?i[u]=!0:i[c]=!0:i[l]=!0,C(n,o,o,i)}return C(n,"localhost",O,{ascii:!0}),n.jd=new w(ft),{start:n,tokens:a({groups:e},mt)}}(Bt.customSchemes);for(let t=0;t=0&&h++,i++,d++;if(h<0)i-=d,i0&&(r.push(zt(Ht,e,s)),s=[]),i-=h,d-=h;const t=u.t,o=n.slice(i-d,i);r.push(zt(t,e,o))}}return s.length>0&&r.push(zt(Ht,e,s)),r}(Bt.parser.start,t,function(t,e){const n=function(t){const e=[],n=t.length;let o=0;for(;o56319||o+1===n||(i=t.charCodeAt(o+1))<56320||i>57343?t[o]:t.slice(o,o+2);e.push(s),o+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),o=n.length,i=[];let r=0,s=0;for(;s=0&&(u+=n[s].length,h++),c+=n[s].length,r+=n[s].length,s++;r-=u,s-=h,c-=u,i.push({t:d.t,v:e.slice(r-c,r),s:r-c,e:r})}return i}(Bt.scanner.start,t))}(t),h=[];for(let t=0;t{"string"!=typeof t?Ft(t.scheme,t.optionalSlashes):Ft(t)}))},onDestroy(){w.groups={},Bt.scanner=null,Bt.parser=null,Bt.tokenQueue=[],Bt.pluginQueue=[],Bt.customSchemes=[],Bt.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",(0,i.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push((e={type:this.type,validate:this.options.validate},new Zt.Sy({key:new Zt.H$("autolink"),appendTransaction:(t,n,o)=>{const r=t.some((t=>t.docChanged))&&!n.doc.eq(o.doc),s=t.some((t=>t.getMeta("preventAutolink")));if(!r||s)return;const{tr:a}=o,l=(0,i.combineTransactionSteps)(n.doc,[...t]);return(0,i.getChangedRanges)(l).forEach((({newRange:t})=>{const n=(0,i.findChildrenInRange)(o.doc,t,(t=>t.isTextblock));let r,s;if(n.length>1?(r=n[0],s=o.doc.textBetween(r.pos,r.pos+r.node.nodeSize,void 0," ")):n.length&&o.doc.textBetween(t.from,t.to," "," ").endsWith(" ")&&(r=n[0],s=o.doc.textBetween(r.pos,t.to,void 0," ")),r&&s){const t=s.split(" ").filter((t=>""!==t));if(t.length<=0)return!1;const n=t[t.length-1],l=r.pos+s.lastIndexOf(n);if(!n)return!1;Jt(n).filter((t=>t.isLink)).map((t=>({...t,from:l+t.start+1,to:l+t.end+1}))).filter((t=>!o.schema.marks.code||!o.doc.rangeHasMark(t.from,t.to,o.schema.marks.code))).filter((t=>!e.validate||e.validate(t.value))).forEach((t=>{(0,i.getMarksBetween)(t.from,t.to,o.doc).some((t=>t.mark.type===e.type))||a.addMark(t.from,t.to,e.type.create({href:t.href}))}))}})),a.steps.length?a:void 0}}))),this.options.openOnClick&&t.push(function(t){return new Zt.Sy({key:new Zt.H$("handleClickLink"),props:{handleClick:(e,n,o)=>{var r,s;if(0!==o.button)return!1;if("A"!==o.target.nodeName)return!1;const a=(0,i.getAttributes)(e.state,t.type.name),l=o.target,c=null!==(r=null==l?void 0:l.href)&&void 0!==r?r:a.href,d=null!==(s=null==l?void 0:l.target)&&void 0!==s?s:a.target;return!(!l||!c||(e.editable&&window.open(c,d),0))}}})}({type:this.type})),t.push(function(t){return new Zt.Sy({key:new Zt.H$("handlePasteLink"),props:{handlePaste:(e,n,o)=>{var i,r;const{state:s}=e,{selection:a}=s;if(s.doc.resolve(a.from).parent.type.spec.code)return!1;let l="";o.content.forEach((t=>{l+=t.textContent}));let c=!1;if(o.content.descendants((e=>{e.marks.some((e=>e.type.name===t.type.name))&&(c=!0)})),c)return;const d=Jt(l).find((t=>t.isLink&&t.value===l));if(!a.empty&&t.linkOnPaste){const e=(null==d?void 0:d.href)||null;if(e)return t.editor.commands.setMark(t.type,{href:e}),!0}const u="text"===(null===(i=o.content.firstChild)||void 0===i?void 0:i.type.name),h=null===(r=o.content.firstChild)||void 0===r?void 0:r.marks.some((e=>e.type.name===t.type.name));if(u&&h||!t.linkOnPaste)return!1;if(d&&a.empty)return t.editor.commands.insertContent(`${d.href}`),!0;const{tr:p}=s;let f=!1;a.empty||(f=!0,p.delete(a.from,a.to));let m=a.from,g=[];o.content.forEach((e=>{g=Jt(e.textContent),p.insert(m-1,e),g.length>0&&(f=!1,g.forEach((e=>{const n=m+e.start,o=m+e.end;p.doc.rangeHasMark(n,o,t.type)||p.addMark(n,o,t.type.create({href:e.href}))}))),m+=e.nodeSize}));const b=g.length>0;return!(!p.docChanged||f||!b||(t.editor.view.dispatch(p),0))}}})}({editor:this.editor,type:this.type,linkOnPaste:this.options.linkOnPaste})),t;var e}}),jt=Yt.extend({addAttributes(){var t;return Object.assign(Object.assign({},null===(t=this.parent)||void 0===t?void 0:t.call(this)),(0,o.x6)(["download"]))},addCommands(){var t;return Object.assign(Object.assign({},null===(t=this.parent)||void 0===t?void 0:t.call(this)),{toggleLink:t=>({chain:e,state:n})=>{{const{selection:o,doc:r}=n,s=r.cut(o.to,o.to+1),a=" "===(0,i.getHTMLFromFragment)(s.content,n.schema).replace(/<\/?[^>]+(>|$)/g,""),l=e().toggleMark(this.name,t,{extendEmptyMarkRange:!0});return(a?l.setTextSelection(o.to+1):l.setTextSelection(o.to).insertContent(' ')).run()}}})}}).configure({openOnClick:!1})},12585:(t,e,n)=>{n.r(e),n.d(e,{TuiAudio:()=>s,TuiSource:()=>a,TuiVideo:()=>l});var o=n(18892),i=n(39425),r=n(11046);const s=r.Node.create({name:"audio",group:"block",content:"source+",addAttributes:()=>(0,i.x6)(o.pH),parseHTML:()=>[{tag:"audio"}],renderHTML:({node:t,HTMLAttributes:e})=>["audio",e,...(0,i.YX)(t)]}),a=r.Node.create({name:"source",addAttributes:()=>(0,i.x6)(["src","type","width","height","media","sizes","srcset"]),parseHTML:()=>[{tag:"source"}],renderHTML:({HTMLAttributes:t})=>["source",(0,r.mergeAttributes)(t)]}),l=r.Node.create({name:"video",group:"block",content:"source+",addAttributes:()=>(0,i.x6)(o.pH),parseHTML:()=>[{tag:"video"}],renderHTML:({node:t,HTMLAttributes:e})=>["video",e,...(0,i.YX)(t)]})},66826:(t,e,n)=>{n.r(e),n.d(e,{StarterKit:()=>Ct});var o=n(11046);const i=/^\s*>\s$/,r=o.Node.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,o.wrappingInputRule)({find:i,type:this.type})]}}),s=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,a=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,l=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,c=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,d=o.Mark.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,o.markInputRule)({find:s,type:this.type}),(0,o.markInputRule)({find:l,type:this.type})]},addPasteRules(){return[(0,o.markPasteRule)({find:a,type:this.type}),(0,o.markPasteRule)({find:c,type:this.type})]}}),u=o.Node.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),h=o.Mark.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=(0,o.getMarkAttributes)(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),p=/^\s*([-+*])\s$/,f=o.Node.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(u.name,this.editor.getAttributes(h.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=(0,o.wrappingInputRule)({find:p,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,o.wrappingInputRule)({find:p,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(h.name),editor:this.editor})),[t]}}),m=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,g=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,b=o.Mark.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,o.markInputRule)({find:m,type:this.type})]},addPasteRules(){return[(0,o.markPasteRule)({find:g,type:this.type})]}});var v=n(62463);const y=/^```([a-z]+)?[\s\n]$/,w=/^~~~([a-z]+)?[\s\n]$/,k=o.Node.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return[...(null===(e=t.firstElementChild)||void 0===e?void 0:e.classList)||[]].filter((t=>t.startsWith(n))).map((t=>t.replace(n,"")))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",(0,o.mergeAttributes)(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!(!t||e.parent.type.name!==this.name)&&!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;const r=o.parentOffset===o.parent.nodeSize-2,s=o.parent.textContent.endsWith("\n\n");return!(!r||!s)&&t.chain().command((({tr:t})=>(t.delete(o.pos-2,o.pos),!0))).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:o}=e,{$from:i,empty:r}=n;if(!r||i.parent.type!==this.type)return!1;if(i.parentOffset!==i.parent.nodeSize-2)return!1;const s=i.after();return void 0!==s&&!o.nodeAt(s)&&t.commands.exitCode()}}},addInputRules(){return[(0,o.textblockTypeInputRule)({find:y,type:this.type,getAttributes:t=>({language:t[1]})}),(0,o.textblockTypeInputRule)({find:w,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new v.Sy({key:new v.H$("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),o=e.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,r=null==i?void 0:i.mode;if(!n||!r)return!1;const{tr:s}=t.state;return s.replaceSelectionWith(this.type.create({language:r})),s.setSelection(v.Bs.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),x=o.Node.create({name:"doc",topNode:!0,content:"block+"});var C=n(38480);function M(t={}){return new v.Sy({view:e=>new S(e,t)})}class S{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map((e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}destroy(){this.handlers.forEach((({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e)))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent;if(n){let n=e.nodeBefore,o=e.nodeAfter;if(n||o){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let i=e.getBoundingClientRect(),r=n?i.bottom:i.top;n&&o&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:i.left,right:i.right,top:r-this.width/2,bottom:r+this.width/2}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos);t={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let o,i,r=this.editorView.dom.offsetParent;if(this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!r||r==document.body&&"static"==getComputedStyle(r).position)o=-pageXOffset,i=-pageYOffset;else{let t=r.getBoundingClientRect();o=t.left-r.scrollLeft,i=t.top-r.scrollTop}this.element.style.left=t.left-o+"px",this.element.style.top=t.top-i+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),o=n&&n.type.spec.disableDropCursor,i="function"==typeof o?o(this.editorView,e,t):o;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,C.nj)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const A=o.Extension.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[M(this.options)]}});var O=n(31690),T=n(27439),N=n(43594);class E extends v.Y1{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return E.valid(n)?new E(n):v.Y1.near(n)}content(){return T.p2.empty}eq(t){return t instanceof E&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new E(t.resolve(e.pos))}getBookmark(){return new I(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),o=t.node(e);if(0!=n)for(let t=o.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(o.type.spec.isolating)return!0}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),o=t.node(e);if(n!=o.childCount)for(let t=o.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(o.type.spec.isolating)return!0}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let o=e.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&E.valid(t))return t;let o=t.pos,i=null;for(let n=t.depth;;n--){let r=t.node(n);if(e>0?t.indexAfter(n)0){i=r.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;o+=e;let s=t.doc.resolve(o);if(E.valid(s))return s}for(;;){let r=e>0?i.firstChild:i.lastChild;if(!r){if(i.isAtom&&!i.isText&&!v.qv.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*e),n=!1;continue t}break}i=r,o+=e;let s=t.doc.resolve(o);if(E.valid(s))return s}return null}}}E.prototype.visible=!1,E.findFrom=E.findGapCursorFrom,v.Y1.jsonID("gapcursor",E);class I{constructor(t){this.pos=t}map(t){return new I(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return E.valid(e)?new E(e):v.Y1.near(e)}}const D=(0,O.$)({ArrowLeft:P("horiz",-1),ArrowRight:P("horiz",1),ArrowUp:P("vert",-1),ArrowDown:P("vert",1)});function P(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,o,i){let r=t.selection,s=e>0?r.$to:r.$from,a=r.empty;if(r instanceof v.Bs){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}let l=E.findGapCursorFrom(s,e,a);return!!l&&(o&&o(t.tr.setSelection(new E(l))),!0)}}function H(t,e,n){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!E.valid(o))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&v.qv.isSelectable(t.state.doc.nodeAt(i.inside))||(t.dispatch(t.state.tr.setSelection(new E(o))),0))}function L(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof E))return!1;let{$from:n}=t.state.selection,o=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let i=T.HY.empty;for(let t=o.length-1;t>=0;t--)i=T.HY.from(o[t].createAndFill(null,i));let r=t.state.tr.replace(n.pos,n.pos,new T.p2(i,0,0));return r.setSelection(v.Bs.near(r.doc.resolve(n.pos+1))),t.dispatch(r),!1}function _(t){if(!(t.selection instanceof E))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",N.EH.create(t.doc,[N.p.widget(t.selection.head,e,{key:"gapcursor"})])}const R=o.Extension.create({name:"gapCursor",addProseMirrorPlugins:()=>[new v.Sy({props:{decorations:_,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&E.valid(n)?new E(n):null,handleClick:H,handleKeyDown:D,handleDOMEvents:{beforeinput:L}}})],extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!==(e=(0,o.callOrReturn)((0,o.getExtensionField)(t,"allowGapCursor",n)))&&void 0!==e?e:null}}}),z=o.Node.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",(0,o.mergeAttributes)(this.options.HTMLAttributes,t)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:o})=>t.first([()=>t.exitCode(),()=>t.command((()=>{const{selection:t,storedMarks:i}=n;if(t.$from.parent.type.spec.isolating)return!1;const{keepMarks:r}=this.options,{splittableMarks:s}=o.extensionManager,a=i||t.$to.parentOffset&&t.$from.marks();return e().insertContent({type:this.name}).command((({tr:t,dispatch:e})=>{if(e&&a&&r){const e=a.filter((t=>s.includes(t.type.name)));t.ensureMarks(e)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var $=n(54424),B=200,F=function(){};F.prototype.append=function(t){return t.length?(t=F.from(t),!this.length&&t||t.length=e?F.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},F.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},F.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},F.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var o=[];return this.forEach((function(e,n){return o.push(t(e,n))}),e,n),o},F.from=function(t){return t instanceof F?t:t&&t.length?new J(t):F.empty};var J=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,o){for(var i=e;i=n;i--)if(!1===t(this.values[i],o+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=B)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=B)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(F);F.empty=new J([]);var Z=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return ti&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,o+i))&&void 0},e.prototype.forEachInvertedInner=function(t,e,n,o){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,o+i))&&!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(F);const Y=F;class j{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,o,i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}e&&(n=this.remapping(i,this.items.length),o=n.maps.length);let r,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(i,e+1),o=n.maps.length),o--,void c.push(t);if(n){c.push(new q(t.map));let e,i=t.step.map(n.slice(o));i&&a.maybeStep(i).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new q(e,void 0,void 0,l.length+c.length))),o--,e&&n.appendMap(e,o)}else a.maybeStep(t.step);return t.selection?(r=n?t.selection.map(n.slice(o)):t.selection,s=new j(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:r}}addTransform(t,e,n,o){let i=[],r=this.eventCount,s=this.items,a=!o&&s.length?s.get(s.length-1):null;for(let n=0;nU&&(s=function(t,e){let n;return t.forEach(((t,o)=>{if(t.selection&&0==e--)return n=o,!1})),t.slice(n)}(s,l),r-=l),new j(s.append(i),r)}remapping(t,e){let n=new C.vs;return this.items.forEach(((e,o)=>{let i=null!=e.mirrorOffset&&o-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new j(this.items.append(t.map((t=>new q(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-e),i=t.mapping,r=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),o);let a=e;this.items.forEach((e=>{let o=i.getMirror(--a);if(null==o)return;r=Math.min(r,o);let l=i.maps[o];if(e.step){let r=t.steps[o].invert(t.docs[o]),c=e.selection&&e.selection.map(i.slice(a+1,o));c&&s++,n.push(new q(l,r,c))}else n.push(new q(l))}),o);let l=[];for(let t=e;t500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,o=[],i=0;return this.items.forEach(((r,s)=>{if(s>=t)o.push(r),r.selection&&i++;else if(r.step){let t=r.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=r.selection&&r.selection.map(e.slice(n));a&&i++;let l,c=new q(s.invert(),t,a),d=o.length-1;(l=o.length&&o[d].merge(c))?o[d]=l:o.push(c)}}else r.map&&n--}),this.items.length,0),new j(Y.from(o.reverse()),i)}}j.empty=new j(Y.empty,0);class q{constructor(t,e,n,o){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new q(e.getMap().invert(),e,this.selection)}}}class V{constructor(t,e,n,o,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const U=20;function W(t){let e=[];return t.forEach(((t,n,o,i)=>e.push(o,i))),e}function Q(t,e){if(!t)return null;let n=[];for(let o=0;onew V(j.empty,j.empty,null,0,-1),apply:(e,n,o)=>function(t,e,n,o){let i,r=n.getMeta(et);if(r)return r.historyState;n.getMeta(nt)&&(t=new V(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(et))return s.getMeta(et).redo?new V(t.done.addTransform(n,void 0,o,tt(e)),t.undone,W(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new V(t.done,t.undone.addTransform(n,void 0,o,tt(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new V(t.done.rebased(n,i),t.undone.rebased(n,i),Q(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new V(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Q(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),r=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-o.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,o)=>{for(let i=0;i=e[i]&&(n=!0)})),n}(n,t.prevRanges)),a=s?Q(t.prevRanges,n.mapping):W(n.mapping.maps[n.steps.length-1]);return new V(t.done.addTransform(n,r?e.selection.getBookmark():void 0,o,tt(e)),j.empty,a,n.time,null==i?t.prevComposition:i)}}(n,o,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,o="historyUndo"==n?it:"historyRedo"==n?rt:null;return!!o&&(e.preventDefault(),o(t.state,t.dispatch))}}}})}const it=(t,e)=>{let n=et.getState(t);return!(!n||0==n.done.eventCount||(e&&K(n,t,e,!1),0))},rt=(t,e)=>{let n=et.getState(t);return!(!n||0==n.undone.eventCount||(e&&K(n,t,e,!0),0))},st=o.Extension.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>it(t,e),redo:()=>({state:t,dispatch:e})=>rt(t,e)}),addProseMirrorPlugins(){return[ot(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),at=o.Node.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",(0,o.mergeAttributes)(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,o=t();return 0===n.parentOffset?o.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):o.insertContent({type:this.name}),o.command((({tr:t,dispatch:e})=>{var n;if(e){const{$to:e}=t.selection,o=e.end();if(e.nodeAfter)e.nodeAfter.isTextblock?t.setSelection(v.Bs.create(t.doc,e.pos+1)):e.nodeAfter.isBlock?t.setSelection(v.qv.create(t.doc,e.pos)):t.setSelection(v.Bs.create(t.doc,e.pos));else{const i=null===(n=e.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(t.insert(o,i),t.setSelection(v.Bs.create(t.doc,o+1)))}t.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(0,o.nodeInputRule)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lt=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ct=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,dt=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,ut=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,ht=o.Mark.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,o.markInputRule)({find:lt,type:this.type}),(0,o.markInputRule)({find:dt,type:this.type})]},addPasteRules(){return[(0,o.markPasteRule)({find:ct,type:this.type}),(0,o.markPasteRule)({find:ut,type:this.type})]}}),pt=o.Node.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),ft=o.Node.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),mt=o.Mark.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=(0,o.getMarkAttributes)(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),gt=/^(\d+)\.\s$/,bt=o.Node.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return 1===e?["ol",(0,o.mergeAttributes)(this.options.HTMLAttributes,n),0]:["ol",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ft.name,this.editor.getAttributes(mt.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=(0,o.wrappingInputRule)({find:gt,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,o.wrappingInputRule)({find:gt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(mt.name)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),vt=o.Node.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),yt=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,wt=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,kt=o.Mark.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){const t={};return(0,o.isMacOS)()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[(0,o.markInputRule)({find:yt,type:this.type})]},addPasteRules(){return[(0,o.markPasteRule)({find:wt,type:this.type})]}}),xt=o.Node.create({name:"text",group:"inline"}),Ct=o.Extension.create({name:"starterKit",addExtensions(){const t=[],e=this.options;return!1!==(null==e?void 0:e.blockquote)&&t.push(r.configure(null==e?void 0:e.blockquote)),!1!==(null==e?void 0:e.bold)&&t.push(d.configure(null==e?void 0:e.bold)),!1!==(null==e?void 0:e.bulletList)&&t.push(f.configure(null==e?void 0:e.bulletList)),!1!==(null==e?void 0:e.code)&&t.push(b.configure(null==e?void 0:e.code)),!1!==(null==e?void 0:e.codeBlock)&&t.push(k.configure(null==e?void 0:e.codeBlock)),!1!==(null==e?void 0:e.document)&&t.push(x.configure(null==e?void 0:e.document)),!1!==(null==e?void 0:e.dropcursor)&&t.push(A.configure(null==e?void 0:e.dropcursor)),!1!==(null==e?void 0:e.gapcursor)&&t.push(R.configure(null==e?void 0:e.gapcursor)),!1!==(null==e?void 0:e.hardBreak)&&t.push(z.configure(null==e?void 0:e.hardBreak)),!1!==(null==e?void 0:e.heading)&&t.push($.Heading.configure(null==e?void 0:e.heading)),!1!==(null==e?void 0:e.history)&&t.push(st.configure(Object.assign({depth:10,newGroupDelay:100},null==e?void 0:e.history))),!1!==(null==e?void 0:e.horizontalRule)&&t.push(at.configure(null==e?void 0:e.horizontalRule)),!1!==(null==e?void 0:e.italic)&&t.push(ht.configure(null==e?void 0:e.italic)),!1!==(null==e?void 0:e.listItem)&&t.push(pt.configure(null==e?void 0:e.listItem)),!1!==(null==e?void 0:e.orderedList)&&t.push(bt.configure(null==e?void 0:e.orderedList)),!1!==(null==e?void 0:e.paragraph)&&t.push(vt.configure(null==e?void 0:e.paragraph)),!1!==(null==e?void 0:e.strike)&&t.push(kt.configure(null==e?void 0:e.strike)),!1!==(null==e?void 0:e.text)&&t.push(xt.configure(null==e?void 0:e.text)),t}})},58676:(t,e,n)=>{n.r(e),n.d(e,{TableCellBackground:()=>o});const o=n(11046).Extension.create({addGlobalAttributes:()=>[{types:["tableCell","tableHeader"],attributes:{background:{default:null,renderHTML:({background:t})=>t?{style:`background: ${t}`}:null,parseHTML:({style:t})=>t.background,keepOnSplit:!1}}}],addCommands:()=>({setCellBackground:t=>({chain:e})=>e().updateAttributes("tableCell",{background:t}).updateAttributes("tableHeader",{background:t}).run(),unsetCellBackground:()=>({chain:t})=>t().updateAttributes("tableCell",{background:null}).updateAttributes("tableHeader",{background:null}).run()})})},47745:(t,e,n)=>{n.r(e),n.d(e,{TuiTable:()=>mt});var o,i,r=n(11046),s=n(62463),a=n(27439),l=n(43594),c=n(31690),d=n(38480);if("undefined"!=typeof WeakMap){let t=new WeakMap;o=e=>t.get(e),i=(e,n)=>(t.set(e,n),n)}else{const t=[],e=10;let n=0;o=e=>{for(let n=0;n(n==e&&(n=0),t[n++]=o,t[n++]=i)}var u=class{constructor(t,e,n,o){this.width=t,this.height=e,this.map=n,this.problems=o}findCell(t){for(let e=0;eo&&(r+=i.attrs.colspan)}}for(let t=0;t1&&(n=!0)}-1==e?e=r:e!=r&&(e=Math.max(e,r))}return e}(t),n=t.childCount,o=[];let i=0,r=null;const s=[];for(let t=0,i=e*n;t=n){(r||(r=[])).push({type:"overlong_rowspan",pos:l,n:h-t});break}const c=i+t*e;for(let t=0;t0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function g(t){const e=t.selection.$head;for(let t=e.depth;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return!0;return!1}function b(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&"cell"==e.node.type.spec.tableRole)return e.$anchor;const n=m(e.$head)||function(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const o=e.type.spec.tableRole;if("cell"==o||"header_cell"==o)return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const o=e.type.spec.tableRole;if("cell"==o||"header_cell"==o)return t.doc.resolve(n-e.nodeSize)}}(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function v(t){return"row"==t.parent.type.spec.tableRole&&!!t.nodeAfter}function y(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function w(t,e,n){const o=t.node(-1),i=u.get(o),r=t.start(-1),s=i.nextCell(t.pos-r,e,n);return null==s?null:t.node(0).resolve(r+s)}function k(t,e,n=1){const o={...t,colspan:t.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(e,n),o.colwidth.some((t=>t>0))||(o.colwidth=null)),o}function x(t,e,n=1){const o={...t,colspan:t.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let t=0;tt!=e.pos-i));l.unshift(e.pos-i);const c=l.map((t=>{const e=n.nodeAt(t);if(!e)throw RangeError(`No cell with offset ${t} found`);const o=i+t+1;return new s.xm(a.resolve(o),a.resolve(o+e.content.size))}));super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=e}map(t,e){const n=t.resolve(e.map(this.$anchorCell.pos)),o=t.resolve(e.map(this.$headCell.pos));if(v(n)&&v(o)&&y(n,o)){const t=this.$anchorCell.node(-1)!=n.node(-1);return t&&this.isRowSelection()?C.rowSelection(n,o):t&&this.isColSelection()?C.colSelection(n,o):new C(n,o)}return s.Bs.between(n,o)}content(){const t=this.$anchorCell.node(-1),e=u.get(t),n=this.$anchorCell.start(-1),o=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},r=[];for(let n=o.top;n0||d>0){let t=l.attrs;if(c>0&&(t=k(t,0,c)),d>0&&(t=k(t,t.colspan-d,d)),a.lefto.bottom){const t={...l.attrs,rowspan:Math.min(a.bottom,o.bottom)-Math.max(a.top,o.top)};l=a.top0)return!1;const n=t+this.$anchorCell.nodeAfter.attrs.rowspan,o=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,o)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){const n=t.node(-1),o=u.get(n),i=t.start(-1),r=o.findCell(t.pos-i),s=o.findCell(e.pos-i),a=t.node(0);return r.top<=s.top?(r.top>0&&(t=a.resolve(i+o.map[r.left])),s.bottom0&&(e=a.resolve(i+o.map[s.left])),r.bottom0)return!1;const r=o+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(r,s)==e.width}eq(t){return t instanceof C&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){const n=t.node(-1),o=u.get(n),i=t.start(-1),r=o.findCell(t.pos-i),s=o.findCell(e.pos-i),a=t.node(0);return r.left<=s.left?(r.left>0&&(t=a.resolve(i+o.map[r.top*o.width])),s.right0&&(e=a.resolve(i+o.map[s.top*o.width])),r.right{e.push(l.p.node(n,n+t.nodeSize,{class:"selectedCell"}))})),l.EH.create(t.doc,e)}var A=new s.H$("fix-tables");function O(t,e,n,o){const i=t.childCount,r=e.childCount;t:for(let s=0,a=0;s{"table"==e.type.spec.tableRole&&(n=function(t,e,n,o){const i=u.get(e);if(!i.problems)return o;o||(o=t.tr);const r=[];for(let t=0;t0){let e="cell";n.firstChild&&(e=n.firstChild.type.spec.tableRole);const r=[];for(let n=0;ne.width)for(let r=0,a=0;re.height){const u=[];for(let t=0,o=(e.height-1)*e.width;t=e.width)&&n.nodeAt(e.map[o+t]).type==l.header_cell;u.push(i?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const h=l.row.create(null,a.HY.from(u)),p=[];for(let t=e.height;t{if(!i)return!1;const r=n.selection;if(r instanceof C)return H(n,o,s.Y1.near(r.$headCell,e));if("horiz"!=t&&!r.empty)return!1;const a=F(i,t,e);if(null==a)return!1;if("horiz"==t)return H(n,o,s.Y1.near(n.doc.resolve(r.head+e),e));{const i=n.doc.resolve(a),r=w(i,t,e);let l;return l=r?s.Y1.near(r,1):e<0?s.Y1.near(n.doc.resolve(i.before(-1)),-1):s.Y1.near(n.doc.resolve(i.after(-1)),1),H(n,o,l)}}}function _(t,e){return(n,o,i)=>{if(!i)return!1;const r=n.selection;let s;if(r instanceof C)s=r;else{const o=F(i,t,e);if(null==o)return!1;s=new C(n.doc.resolve(o))}const a=w(s.$headCell,t,e);return!!a&&H(n,o,new C(s.$anchorCell,a))}}function R(t,e){const n=t.selection;if(!(n instanceof C))return!1;if(e){const o=t.tr,i=p(t.schema).cell.createAndFill().content;n.forEachCell(((t,e)=>{t.content.eq(i)||o.replace(o.mapping.map(e+1),o.mapping.map(e+t.nodeSize-1),new a.p2(i,0,0))})),o.docChanged&&e(o)}return!0}function z(t,e){const n=m(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new C(n))),!0)}function $(t,e,n){if(!g(t.state))return!1;let o=function(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:o}=t;for(;1==e.childCount&&(n>0&&o>0||"table"==e.child(0).type.spec.tableRole);)n--,o--,e=e.child(0).content;const i=e.child(0),r=i.type.spec.tableRole,s=i.type.schema,l=[];if("row"==r)for(let t=0;t=0;e--){const{rowspan:i,colspan:r}=o.child(e).attrs;for(let e=t;e=e.length&&e.push(a.HY.empty),n[i]o&&(a=a.type.createChecked(k(a.attrs,a.attrs.colspan,n+a.attrs.colspan-o),a.content)),s.push(a),n+=a.attrs.colspan;for(let n=1;ni&&(e=e.type.create({...e.attrs,rowspan:Math.max(1,i-e.attrs.rowspan)},e.content)),s.push(e)}t.push(a.HY.from(s))}n=t,e=i}return{width:t,height:e,rows:n}}(o,s.right-s.left,s.bottom-s.top),D(t.state,t.dispatch,r,s,o),!0}if(o){const e=b(t.state),n=e.start(-1);return D(t.state,t.dispatch,n,u.get(e.node(-1)).findCell(e.pos-n),o),!0}return!1}function B(t,e){var n;if(e.ctrlKey||e.metaKey)return;const o=J(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof C)r(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&o&&null!=(i=m(t.state.selection.$anchor))&&(null==(n=Z(t,e))?void 0:n.pos)!=i.pos)r(i,e),e.preventDefault();else if(!o)return;function r(e,n){let o=Z(t,n);const i=null==f.getState(t.state);if(!o||!y(e,o)){if(!i)return;o=e}const r=new C(e,o);if(i||!t.state.selection.eq(r)){const n=t.state.tr.setSelection(r);i&&n.setMeta(f,e.pos),t.dispatch(n)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),null!=f.getState(t.state)&&t.dispatch(t.state.tr.setMeta(f,-1))}function a(n){const i=n,a=f.getState(t.state);let l;if(null!=a)l=t.state.doc.resolve(a);else if(J(t,i.target)!=o&&(l=Z(t,e),!l))return s();l&&r(l,i)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function F(t,e,n){if(!(t.state.selection instanceof s.Bs))return null;const{$head:o}=t.state.selection;for(let i=o.depth-1;i>=0;i--){const r=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:r.childCount))return null;if("cell"==r.type.spec.tableRole||"header_cell"==r.type.spec.tableRole){const r=o.before(i),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?r:null}}return null}function J(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e;return null}function Z(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?m(t.state.doc.resolve(n.pos)):null}var Y=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),j(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type==this.node.type&&(this.node=t,j(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))}};function j(t,e,n,o,i,r){var s;let a=0,l=!0,c=e.firstChild;const d=t.firstChild;if(d){for(let t=0,n=0;t(i.spec.props.nodeViews[p(o.schema).table.name]=(t,o)=>new n(t,e,o),new U(-1,!1)),apply:(t,e)=>e.apply(t)},props:{attributes:t=>{const e=q.getState(t);return e&&e.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(e,n)=>{!function(t,e,n,o,i){const r=q.getState(t.state);if(r&&!r.dragging){const o=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target);let s=-1;if(o){const{left:i,right:r}=o.getBoundingClientRect();e.clientX-i<=n?s=W(t,e,"left",n):r-e.clientX<=n&&(s=W(t,e,"right",n))}if(s!=r.activeHandle){if(!i&&-1!==s){const e=t.state.doc.resolve(s),n=e.node(-1),o=u.get(n),i=e.start(-1);if(o.colCount(e.pos-i)+e.nodeAfter.attrs.colspan-1==o.width-1)return}K(t,s)}}}(e,n,t,0,o)},mouseleave:t=>{!function(t){const e=q.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&K(t,-1)}(t)},mousedown:(t,n)=>{!function(t,e,n){const o=q.getState(t.state);if(!o||-1==o.activeHandle||o.dragging)return!1;const i=t.state.doc.nodeAt(o.activeHandle),r=function(t,e,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const r=t.domAtPos(e);let s=r.node.childNodes[r.offset].offsetWidth,a=n;if(o)for(let t=0;t{const e=q.getState(t);if(e&&e.activeHandle>-1)return function(t,e){const n=[],o=t.doc.resolve(e),i=o.node(-1);if(!i)return l.EH.empty;const r=u.get(i),s=o.start(-1),a=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan;for(let t=0;t-1&&t.docChanged){let n=t.mapping.map(e.activeHandle,-1);return v(t.doc.resolve(n))||(n=-1),new U(n,e.dragging)}return e}};function W(t,e,n,o){const i="right"==n?-o:o,r=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!r)return-1;const{pos:s}=r,a=m(t.state.doc.resolve(s));if(!a)return-1;if("right"==n)return a.pos;const l=u.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function Q(t,e,n){const o=e.clientX-t.startX;return Math.max(n,t.startWidth+o)}function K(t,e){t.dispatch(t.state.tr.setMeta(q,{setHandle:e}))}function G(t){const e=t.selection,n=b(t),o=n.node(-1),i=n.start(-1),r=u.get(o);return{...e instanceof C?r.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):r.findCell(n.pos-i),tableStart:i,map:r,table:o}}function X(t,{map:e,tableStart:n,table:o},i){let r=i>0?-1:0;(function(t,e,n){const o=p(e.type.schema).header_cell;for(let i=0;i0&&i0&&e.map[a-1]==l||i0?-1:0;(function(t,e,n){var o;const i=p(e.type.schema).header_cell;for(let r=0;r0&&i0&&l==e.map[s-e.width]){const e=n.nodeAt(l).attrs;t.setNodeMarkup(t.mapping.slice(a).map(l+o),null,{...e,rowspan:e.rowspan-1}),r+=e.colspan-1}else if(i0&&n[r]==n[r-1]||o.right0&&n[i]==n[i-t]||o.bottomn[t.type.spec.tableRole],(t,e)=>{var n;const i=t.selection;let r,s;if(i instanceof C){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(r=function(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(i.$from),!r)return!1;s=null==(n=m(i.$from))?void 0:n.pos}if(null==r||null==s)return!1;if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(e){let n=r.attrs;const a=[],l=n.colwidth;n.rowspan>1&&(n={...n,rowspan:1}),n.colspan>1&&(n={...n,colspan:1});const c=G(t),d=t.tr;for(let t=0;ti.table.nodeAt(t)));for(let t=0;t{const e=t+i.tableStart,n=r.doc.nodeAt(e);n&&r.setNodeMarkup(e,d,n.attrs)})),n(r)}return!0}}at("row",{useDeprecatedLogic:!0}),at("column",{useDeprecatedLogic:!0});var lt=at("cell",{useDeprecatedLogic:!0});function ct(t){return function(e,n){if(!g(e))return!1;const o=function(t,e){if(e<0){const e=t.nodeBefore;if(e)return t.pos-e.nodeSize;for(let e=t.index(-1)-1,n=t.before();e>=0;e--){const o=t.node(-1).child(e),i=o.lastChild;if(i)return n-1-i.nodeSize;n-=o.nodeSize}}else{if(t.index()null,apply(t,e){const n=t.getMeta(f);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;const{deleted:o,pos:i}=t.mapping.mapResult(e);return o?null:i}},props:{decorations:S,handleDOMEvents:{mousedown:B},createSelectionBetween:t=>null!=f.getState(t.state)?t.state.selection:null,handleTripleClick:z,handleKeyDown:P,handlePaste:$},appendTransaction:(e,n,o)=>function(t,e,n){const o=(e||t).selection,i=(e||t).doc;let r,a;if(o instanceof s.qv&&(a=o.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)r=C.create(i,o.from);else if("row"==a){const t=i.resolve(o.from+1);r=C.rowSelection(t,t)}else if(!n){const t=u.get(o.node),e=o.from+1,n=e+t.map[t.width*t.height-1];r=C.create(i,e+1,n)}}else o instanceof s.Bs&&function({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(t+1)>e.start(t));t--,o--);return n==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(o)?r=s.Bs.create(i,o.from):o instanceof s.Bs&&function({$from:t,$to:e}){let n,o;for(let e=t.depth;e>0;e--){const o=t.node(e);if("cell"===o.type.spec.tableRole||"header_cell"===o.type.spec.tableRole){n=o;break}}for(let t=e.depth;t>0;t--){const n=e.node(t);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){o=n;break}}return n!==o&&0===e.parentOffset}(o)&&(r=s.Bs.create(i,o.$from.start(),o.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}(o,T(o,n),t)})}function ut(t,e,n,o,i,r){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let t=0,n=0;t{const{selection:e}=t.state;if(!(e instanceof C))return!1;let n=0;const o=(0,r.findParentNodeClosestToPos)(e.ranges[0].$from,(t=>"table"===t.type.name));return null==o||o.node.descendants((t=>{if("table"===t.type.name)return!1;["tableCell","tableHeader"].includes(t.type.name)&&(n+=1)})),n===e.ranges.length&&(t.commands.deleteTable(),!0)},mt=r.Node.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:ht,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({HTMLAttributes:t}){return["table",(0,r.mergeAttributes)(this.options.HTMLAttributes,t),["tbody",0]]},addCommands:()=>({insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:o,dispatch:i,editor:r})=>{const a=function(t,e,n,o,i){const r=function(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach((n=>{const o=t.nodes[n];o.spec.tableRole&&(e[o.spec.tableRole]=o)})),t.cached.tableNodeTypes=e,e}(t),s=[],a=[];for(let t=0;t({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t);e(X(t.tr,n,n.left))}return!0}(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t);e(X(t.tr,n,n.right))}return!0}(t,e),deleteColumn:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t),o=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let t=n.right-1;tt(o,n,t),t!=n.left;t--){const t=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!t)throw RangeError("No table found");n.table=t,n.map=u.get(t)}e(o)}return!0}(t,e),addRowBefore:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t);e(et(t.tr,n,n.top))}return!0}(t,e),addRowAfter:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t);e(et(t.tr,n,n.bottom))}return!0}(t,e),deleteRow:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t),o=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let t=n.bottom-1;nt(o,n,t),t!=n.top;t--){const t=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!t)throw RangeError("No table found");n.table=t,n.map=u.get(n.table)}e(o)}return!0}(t,e),deleteTable:()=>({state:t,dispatch:e})=>function(t,e){const n=t.selection.$anchor;for(let o=n.depth;o>0;o--)if("table"==n.node(o).type.spec.tableRole)return e&&e(t.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}(t,e),mergeCells:()=>({state:t,dispatch:e})=>it(t,e),splitCell:()=>({state:t,dispatch:e})=>rt(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>at("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>at("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>lt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>!!it(t,e)||rt(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:o})=>function(t,e){return function(n,o){if(!g(n))return!1;const i=b(n);if(i.nodeAfter.attrs[t]===e)return!1;if(o){const r=n.tr;n.selection instanceof C?n.selection.forEachCell(((n,o)=>{n.attrs[t]!==e&&r.setNodeMarkup(o,null,{...n.attrs,[t]:e})})):r.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),o(r)}return!0}}(t,e)(n,o),goToNextCell:()=>({state:t,dispatch:e})=>ct(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>ct(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&T(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const n=C.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:ft,"Mod-Backspace":ft,Delete:ft,"Mod-Delete":ft}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[V({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],dt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:(0,r.callOrReturn)((0,r.getExtensionField)(t,"tableRole",e))}}}).extend({renderHTML({node:t,HTMLAttributes:e}){var n,o;let i=0,s=!0;try{const e=(null===(n=t.content)||void 0===n?void 0:n.content)[0];null===(o=null==e?void 0:e.content)||void 0===o||o.content.forEach((t=>{if(t.attrs.colwidth)t.attrs.colwidth.forEach((t=>{t?i+=t:(s=!1,i+=this.options.cellMinWidth)}));else{s=!1;const e=t.attrs.colspan||1;i+=this.options.cellMinWidth*e}}))}catch(t){s=!1}return e.style=s&&i>0?`width: ${i}px;`:i&&i>0?`min-width: ${i}px`:null,["div",{class:"tui-table-wrapper"},["table",(0,r.mergeAttributes)(this.options.HTMLAttributes,e),["tbody",0]]]}})},87187:(t,e,n)=>{n.d(e,{y:()=>l,d:()=>a});var o=n(12057),i=n(11046),r=n(74788);class s{constructor(t,e,n){const o=e.get(r.z2F),i=e.get(r._Vd).resolveComponentFactory(t);this.componentRef=i.create(e,[]),this.updateProps(n),o.attachView(this.componentRef.hostView)}get instance(){return this.componentRef.instance}get el(){return this.componentRef.injector.get(r.SBq)}get dom(){return this.el.nativeElement}updateProps(t){Object.entries(t).forEach((([t,e])=>{this.instance[t]=e}))}detectChanges(){this.componentRef.changeDetectorRef.detectChanges()}destroy(){this.componentRef.destroy()}}class a{}class l extends i.NodeView{constructor(t,e,n){super(t,e,n),this.contentDOMElement=null}mount(){const t=this.options.injector,e=t.get(o.K0),n={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(t={})=>this.updateAttributes(t),deleteNode:()=>this.deleteNode()};this.renderer=new s(this.component,t,n),this.extension.config.draggable&&(this.renderer.el.nativeElement.ondragstart=t=>{this.onDragStart(t)}),this.contentDOMElement=this.node.isLeaf?null:e.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit",this.renderer.detectChanges())}get dom(){return this.renderer.dom}get contentDOM(){return this.node.isLeaf?null:(this.maybeMoveContentDOM(),this.contentDOMElement)}update(t,e){return this.options.update?this.options.update(t,e):t.type===this.node.type&&(t===this.node&&this.decorations===e||(this.node=t,this.decorations=e,this.renderer.updateProps({node:t,decorations:e}),this.maybeMoveContentDOM()),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy()}maybeMoveContentDOM(){const t=this.dom.querySelector("[data-node-view-content]");this.contentDOMElement&&t&&!t.contains(this.contentDOMElement)&&t.appendChild(this.contentDOMElement)}}},57080:(t,e,n)=>{n.d(e,{zc:()=>y.zc,dR:()=>y.dR,F1:()=>y.F1,Wf:()=>y.Wf,VE:()=>v.TUI_EDITOR_MAX_IMAGE_WIDTH,kB:()=>v.TUI_EDITOR_MIN_IMAGE_WIDTH,mJ:()=>y.mJ,bK:()=>y.bK,p7:()=>y.p7,H9:()=>o.H9,wl:()=>o.wl,aI:()=>r.a,BN:()=>h.BN,T_:()=>p,GK:()=>d,_2:()=>g._,Sz:()=>f,VM:()=>o.VM,$3:()=>h.$3,sw:()=>m.sw,PD:()=>b,aU:()=>m.Db,Uv:()=>y.Uv,Er:()=>w.Er});var o=n(96472),i=n(8674),r=n(19586),s=n(12057),a=n(64642),l=n(67274),c=(n(96152),n(74788));let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=c.oAB({type:t}),t.ɵinj=c.cJS({}),t})();var u=n(51618),h=n(86114);let p=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=c.oAB({type:t}),t.ɵinj=c.cJS({imports:[[a.HOV,s.ez,u.yB,l.WUl,l.Jyu,i.Fu,a.Ah6,l.dpK,h.mJ,d]]}),t})();n(46015),n(66654),n(22648),n(98230),n(12368),n(31496);let f=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=c.oAB({type:t}),t.ɵinj=c.cJS({imports:[[s.ez,l.KWI,l.cnw,l.jhF,o.wl,a.Ah6]]}),t})();n(78790);var m=n(18892),g=n(95161);n(13511);const b=[Promise.resolve().then(n.bind(n,66826)).then((({StarterKit:t})=>t)).then((t=>t.configure({heading:{levels:[1,2,3,4,5,6]}}))),n.e(3336).then(n.bind(n,73336)).then((({default:t})=>t.configure({types:["heading","paragraph"]}))),Promise.resolve().then(n.bind(n,84402)).then((({default:t})=>t)),n.e(7991).then(n.bind(n,17991)).then((({default:t})=>t)),n.e(7147).then(n.bind(n,77147)).then((({default:t})=>t)),n.e(5034).then(n.bind(n,25034)).then((({default:t})=>t)),Promise.resolve().then(n.bind(n,47841)).then((({FontColor:t})=>t)),Promise.resolve().then(n.bind(n,44632)).then((({default:t})=>t.configure({inline:!0,allowBase64:!0}))),Promise.resolve().then(n.bind(n,50822)).then((({TuiLink:t})=>t)),n.e(8629).then(n.bind(n,88629)).then((({TuiJumpAnchor:t})=>t)),Promise.resolve().then(n.bind(n,41131)).then((({TuiFileLink:t})=>t)),Promise.resolve().then(n.bind(n,13511)).then((({BackgroundColor:t})=>t)),Promise.resolve().then(n.bind(n,47745)).then((({TuiTable:t})=>t.configure({resizable:!0}))),n.e(5213).then(n.bind(n,45213)).then((({default:t})=>t)),n.e(1397).then(n.bind(n,71397)).then((({default:t})=>t)),n.e(8840).then(n.bind(n,38840)).then((({TableHeader:t})=>t)),Promise.resolve().then(n.bind(n,73757)).then((({TuiTabExtension:t})=>t)),Promise.resolve().then(n.bind(n,58676)).then((({TableCellBackground:t})=>t)),n.e(7095).then(n.bind(n,77095)).then((({TuiDetailsContent:t})=>t)),n.e(7095).then(n.bind(n,77095)).then((({TuiDetails:t})=>t)),n.e(7095).then(n.bind(n,77095)).then((({TuiSummary:t})=>t)),Promise.resolve().then(n.bind(n,83120)).then((({TuiFontSize:t})=>t))];n(41131),n(47841),n(83120),n(38981),n(91876);var v=n(45267),y=(n(73757),n(50822),n(12585),n(66826),n(47745),n(58676),n(71831)),w=n(39425)},20755:(t,e,n)=>{n.d(e,{i:()=>h});var o=n(12057),i=n(74788),r=n(64642),s=n(39425),a=n(29856),l=n(43190),c=n(88002),d=n(46782),u=n(39761);let h=(()=>{class t extends a.y{constructor(t,{nativeElement:e},n){const o=(0,r.mLY)(e,"mousedown").pipe((0,r.mp3)(),(0,l.w)((t=>{const o=(0,r.mLY)(n,"mousemove").pipe((0,c.U)((({clientX:t,clientY:n})=>(0,s.Ws)(t,n,e))),(0,d.R)((0,r.mLY)(n,"mouseup")));return t.target===e?o.pipe((0,u.O)((0,s.Ws)(t.clientX,t.clientY,e))):o})),(0,d.R)(t));super((t=>o.subscribe(t)))}}return t.ɵfac=function(e){return new(e||t)(i.LFG(r.a31,2),i.LFG(i.SBq),i.LFG(o.K0))},t.ɵprov=i.Yz7({token:t,factory:t.ɵfac}),t})()},71831:(t,e,n)=>{n.d(e,{Y1:()=>T,F4:()=>r,bG:()=>O,ZW:()=>A,zc:()=>m,dR:()=>f,Mr:()=>k,dj:()=>b,F1:()=>h,Wf:()=>i,UN:()=>x,b$:()=>w,mJ:()=>c,$i:()=>y,rf:()=>v,bK:()=>p,p7:()=>M,Uv:()=>d});var o=n(74788);const i=new o.OlP("[TUI_EDITOR_EXTENSIONS]"),r=new o.OlP("[LAZY_EDITOR_EXTENSIONS]");var s=n(64642),a=n(18892);const l={translate:"no",spellcheck:!1,colors:a.sw,blankColor:a.hK,linkOptions:a.pL,fontOptions:a.RR,icons:{undo:"tuiIconUndoLarge",redo:"tuiIconRedoLarge",quote:"tuiIconQuoteLarge",link:"tuiIconLinkLarge",anchor:"tuiIconAnchorLarge",attach:"tuiIconPaperclipLarge",sub:"tuiIconSubscriptLarge",sup:"tuiIconSuperscriptLarge",tex:"tuiIconTeXLarge",image:"tuiIconImageLarge",hr:"tuiIconHrLarge",clear:"tuiIconClearFormatLarge",groupAdd:"tuiIconPlusLarge",groupRemove:"tuiIconCloseLarge",detailsAdd:"tuiIconSpoilerLarge",detailsRemove:"tuiIconSpoilerDeleteLarge",popupLinkSave:"tuiIconCheckCircleLarge",popupLinkRemove:"tuiIconCloseLarge",popupPreviewLinkEdit:"tuiIconEdit2Large",popupPreviewLinkClear:"tuiIconUnlinkLarge",paint:"tuiIconPaintLarge",textAlignPreview:"tuiIconAlignLeftLarge",textAlignLeft:"tuiIconAlignLeftLarge",textAlignCenter:"tuiIconAlignCenterLarge",textAlignRight:"tuiIconAlignRightLarge",textAlignJustify:"tuiIconAlignJustifyLarge",textColor:"tuiIconColorLarge",textHilite:"tuiIconHiliteLarge",listPreview:"tuiIconListLarge",listUnOrdered:"tuiIconListLarge",listOrdered:"tuiIconOLLarge",indent:"tuiIconIndentLarge",outdent:"tuiIconOutdentLarge",fontSize:"tuiIconFontLarge",insertTable:"tuiIconTableLarge",addRowTable:"tuiIconAddRowLarge",code:"tuiIconCodeLarge",fontStylePreview:"tuiIconFormatLarge",fontStyleBold:"tuiIconBoldLarge",fontStyleItalic:"tuiIconItalicLarge",fontStyleUnderline:"tuiIconUnderlineLarge",fontStyleStrike:"tuiIconStrikeThroughLarge",colorSelectorDropdownChevron:"tuiIconChevronDown",colorSelectorDropdownCheck:"tuiIconCheck"}},c=(0,s.jHx)(l);function d(t){return(0,s.vKU)(c,t,l)}var u=n(54487);const h=new o.OlP("[TUI_EDITOR_CONTENT_PROCESSOR]",{factory:()=>u.y}),p=new o.OlP("[TUI_EDITOR_VALUE_TRANSFORMER]"),f=new o.OlP("[TUI_ATTACH_FILES_OPTIONS]",{factory:()=>({accept:"*/*",multiple:!0})}),m=new o.OlP("[TUI_ATTACH_FILES_LOADER]");var g=n(75606);const b=new o.OlP("[TUI_EDITOR_COLOR_SELECTOR_MODE_NAMES]",{factory:()=>["Solid color","Gradient"]}),v=new o.OlP("[TUI_EDITOR_TOOLBAR_TEXTS]",{factory:(0,g.vv)("toolbarTools")}),y=new o.OlP("[TUI_EDITOR_TABLE_COMMANDS]",{factory:(0,g.vv)("editorTableCommands")}),w=new o.OlP("[TUI_EDITOR_LINK_TEXTS]",{factory:(0,g.vv)("editorEditLink")}),k=new o.OlP("[TUI_EDITOR_CODE_OPTIONS]",{factory:(0,g.vv)("editorCodeOptions")}),x=new o.OlP("[TUI_EDITOR_FONT_OPTIONS]",{factory:(0,g.vv)("editorFontOptions")});var C=n(88002);const M=new o.OlP("[TUI_IMAGE_LOADER]",{factory:()=>t=>{const e=new FileReader;return e.readAsDataURL(t),(0,s.mLY)(e,"load").pipe((0,C.U)((()=>String(e.result))))}});var S=n(74235);const A=new o.OlP("[TIPTAP_EDITOR]"),O=new o.OlP("[LAZY_TIPTAP_EDITOR]",{factory:()=>{const t=new S.t(1);return Promise.resolve().then(n.bind(n,11046)).then((e=>t.next(e.Editor))),t}}),T=new o.OlP("[INITIALIZATION_TIPTAP_CONTAINER]")},39425:(t,e,n)=>{function o(t,e,n){const o=t.selection.$anchor;for(let i=o.depth;i>0;i--)if(o.node(i).type.name===n)return e&&e(t.tr.delete(o.before(i),o.after(i)).scrollIntoView()),!0;return!1}n.d(e,{yU:()=>o,Ws:()=>r,U5:()=>s,Yz:()=>l,YX:()=>d,Ap:()=>h,nC:()=>C,Er:()=>p,_N:()=>y,x6:()=>k,jx:()=>x,CH:()=>M});var i=n(64642);function r(t,e,n){const{left:o,top:r,width:s,height:a}=n.getBoundingClientRect();return[(0,i.Kiv)(t-o,0,s)/s,(0,i.Kiv)(e-r,0,a)/a]}function s(t){return t.slice(0,Math.max(0,t.length-1)).replace("linear-gradient(","")}function a(t,e,n={}){return t.find((({attrs:t,type:o})=>o===e&&function(t,e){const n=Object.keys(e);return!n.length||!!n.filter((n=>e[n]===t[n])).length}(t,n)))||null}function l(t,e,n={}){if(!t||!e)return null;const{node:o,offset:i}=t.parent.childAfter(t.parentOffset);if(!o)return null;const r=a(o.marks,e,n);if(!r)return null;let s=t.index(),l=t.start()+i,c=s+1,d=l+o.nodeSize;for(a(o.marks,e,n);s>0&&r.isInSet(t.parent.child(s-1).marks);)s-=1,l-=t.parent.child(s).nodeSize;for(;c{t instanceof c.NB&&e.push([t.type.name,t.attrs])})),e}var u=n(11046);function h(t,e){const n=null!=e?e:t.selection.$head.parent.textContent,o=t.doc.cut(t.selection.from,t.selection.to);return o.content.size?(0,u.getHTMLFromFragment)(o.content,t.schema):n}function p(t){const e=(new DOMParser).parseFromString(t,"text/html");return f(e.body),e.body.innerHTML}function f(t){for(const e of Array.from(t.children))if(e.children.length&&f(e),"FONT"===e.tagName)if(e.hasAttribute("size"))switch(e.getAttribute("size")){case"6":m("h1",e);break;case"5":m("h2",e);break;case"4":g("17px",e);break;case"3":g("15px",e);break;case"2":g("13px",e)}else e.hasAttribute("color")&&b(e)}function m(t,e){var n,o,i,r,s,a,l,c,d;const u=document.createElement(t);if(u.innerHTML=e.innerHTML,"P"===(null===(n=e.parentElement)||void 0===n?void 0:n.tagName)){const t=null===(i=null===(o=e.parentElement)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.insertBefore(u,e.parentElement);null===(r=e.parentElement)||void 0===r||r.removeChild(e),(null==t?void 0:t.nextSibling)&&!(null===(a=null===(s=null==t?void 0:t.nextSibling)||void 0===s?void 0:s.textContent)||void 0===a?void 0:a.trim())&&(null===(c=null===(l=t.nextSibling)||void 0===l?void 0:l.parentElement)||void 0===c||c.removeChild(t.nextSibling))}else null===(d=e.parentElement)||void 0===d||d.replaceChild(u,e)}function g(t,e){var n;const o=document.createElement("p"),i=document.createElement("span");i.setAttribute("style",`font-size: ${t}`),i.innerHTML=e.innerHTML,o.append(i),null===(n=e.parentElement)||void 0===n||n.replaceChild("P"===e.parentElement.tagName?i:o,e)}function b(t){var e;const n=document.createElement("span");n.setAttribute("style",`color: ${t.getAttribute("color")}`),n.innerHTML=t.innerHTML,null===(e=t.parentElement)||void 0===e||e.replaceChild(n,t)}const v=["\\s*(","(?:","#(?:[a-f0-9]{6}|[a-f0-9]{3})","|","(?:rgb|hsl)","\\(\\s*(?:\\d{1,3}\\s*,\\s*){2}\\d{1,3}\\s*\\)","|","(?:rgba|hsla)","\\(\\s*(?:\\d{1,3}\\s*,\\s*){2}\\d{1,3}\\s*,\\s*\\d*\\.?\\d+\\)","|","[_a-z-][_a-z0-9-]*",")",")","(?:\\s+","(","(?:[+-]?\\d*\\.?\\d+)(?:%|[a-z]+)?","))?","(?:","\\s*,\\s*","\\s*)?"];function y(t){const e=new RegExp(v.join(""),"gi"),n=t.startsWith("to")||t.match(/^\d/)?t.slice(Math.max(0,t.indexOf(",")+1)).trim():t,o=t.startsWith("to")?t.split(",")[0]:"to bottom";let i=[],r=e.exec(n);for(;null!==r;)i=i.concat({color:r[1],position:w(r[2],i.length)}),r=e.exec(n);return i=i.filter((({color:t})=>t.startsWith("#")||t.startsWith("rgb"))),{stops:i,side:o}}function w(t,e){const n=1===e?"100%":`${e}%`;return(null==t?void 0:t.includes("%"))?t:n}function k(t){return t.reduce(((t,e)=>(t[e]={parseHTML:t=>null==t?void 0:t.getAttribute(`${e}`)},t)),{})}function x(t){return t.split(";").reduce(((t,e)=>{var n;const[o,i]=null!==(n=e.split(":"))&&void 0!==n?n:[];return o&&i&&(t[o.trim()]=i.trim()),t}),{})}function C(t){var e;const n=(null===(e=t.endContainer.nodeValue)||void 0===e?void 0:e.length)||0;return t.endOffset-t.startOffset>0||t.endOffset-t.startOffset==0&&1===n||0!==t.startOffset&&n>1&&t.endOffset!==n}function M({stops:t,side:e}){return`linear-gradient(${e}, ${t.map((({color:t,position:e})=>`rgba(${(0,i.MpC)(t).join(", ")}) ${e}`)).join(", ")})`}},11046:(t,e,n)=>{n.r(e),n.d(e,{CommandManager:()=>D,Editor:()=>ge,Extension:()=>ct,InputRule:()=>K,Mark:()=>xe,Node:()=>Ce,NodeView:()=>Me,PasteRule:()=>nt,Tracker:()=>Ee,callOrReturn:()=>F,combineTransactionSteps:()=>It,createChainableState:()=>I,createDocument:()=>Nt,createNodeFromContent:()=>Ct,createStyleTag:()=>me,defaultBlockAt:()=>Dt,deleteProps:()=>Tt,elementFromString:()=>xt,escapeForRegEx:()=>Ae,extensions:()=>fe,findChildren:()=>Pt,findChildrenInRange:()=>Ht,findDuplicates:()=>rt,findParentNode:()=>_t,findParentNodeClosestToPos:()=>Lt,fromString:()=>Z,generateHTML:()=>$t,generateJSON:()=>Bt,generateText:()=>Jt,getAttributes:()=>Yt,getAttributesFromExtensions:()=>_,getChangedRanges:()=>qt,getDebugJSON:()=>Vt,getExtensionField:()=>H,getHTMLFromFragment:()=>Rt,getMarkAttributes:()=>Et,getMarkRange:()=>gt,getMarkType:()=>bt,getMarksBetween:()=>Ut,getNodeAtPosition:()=>Wt,getNodeAttributes:()=>Zt,getNodeType:()=>R,getRenderedAttributes:()=>$,getSchema:()=>zt,getSchemaByResolvedExtensions:()=>q,getSchemaTypeByName:()=>V,getSchemaTypeNameByName:()=>Ot,getSplittedAttributes:()=>Qt,getText:()=>Ft,getTextBetween:()=>dt,getTextContentFromNodes:()=>W,getTextSerializersFromSchema:()=>ut,injectExtensionAttributesToParseRule:()=>Y,inputRulesPlugin:()=>tt,isActive:()=>Gt,isAtEndOfNode:()=>Xt,isAtStartOfNode:()=>te,isEmptyObject:()=>J,isExtensionRulesEnabled:()=>U,isFunction:()=>B,isList:()=>ee,isMacOS:()=>St,isMarkActive:()=>Kt,isNodeActive:()=>At,isNodeEmpty:()=>ne,isNodeSelection:()=>oe,isNumber:()=>et,isPlainObject:()=>at,isRegExp:()=>Q,isString:()=>Oe,isTextSelection:()=>vt,isiOS:()=>kt,markInputRule:()=>be,markPasteRule:()=>Se,mergeAttributes:()=>z,mergeDeep:()=>lt,minMax:()=>yt,nodeInputRule:()=>ve,nodePasteRule:()=>Te,objectIncludes:()=>pt,pasteRulesPlugin:()=>it,posToDOMRect:()=>ie,removeDuplicates:()=>jt,resolveFocusPosition:()=>wt,selectionToInsertionEnd:()=>Mt,splitExtensions:()=>L,textInputRule:()=>we,textPasteRule:()=>Ne,textblockTypeInputRule:()=>ye,wrappingInputRule:()=>ke});var o=n(62463),i=n(43594),r=n(31690),s=n(27439),a=n(38480);const l=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),c=(t,e,n)=>{let i=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!i)return!1;let r=h(i);if(!r){let n=i.blockRange(),o=n&&(0,a.k9)(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let l=r.nodeBefore;if(!l.type.spec.isolating&&k(t,r,e))return!0;if(0==i.parent.content.size&&(d(l,"end")||o.qv.isSelectable(l))){let n=(0,a.dR)(t.doc,i.before(),i.after(),s.p2.empty);if(n&&n.slice.size{let{$head:i,empty:r}=t.selection,s=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):i.parentOffset>0)return!1;s=h(i)}let a=s&&s.nodeBefore;return!(!a||!o.qv.isSelectable(a)||(e&&e(t.tr.setSelection(o.qv.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),0))};function h(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}const p=(t,e,n)=>{let i=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let{$head:i,empty:r}=t.selection,s=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):i.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let{$head:n,$anchor:o}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(o)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))};function b(t){for(let e=0;e{let{$head:n,$anchor:i}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),s=n.indexAfter(-1),a=b(r.contentMatchAt(s));if(!a||!r.canReplaceWith(s,s,a))return!1;if(e){let i=n.after(),r=t.tr.replaceWith(i,i,a.createAndFill());r.setSelection(o.Y1.near(r.doc.resolve(i),1)),e(r.scrollIntoView())}return!0},y=(t,e)=>{let n=t.selection,{$from:i,$to:r}=n;if(n instanceof o.C1||i.parent.inlineContent||r.parent.inlineContent)return!1;let s=b(r.parent.contentMatchAt(r.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let n=(!i.parentOffset&&r.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if((0,a.Ax)(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let o=n.blockRange(),i=o&&(0,a.k9)(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)};function k(t,e,n){let i,r,l=e.nodeBefore,c=e.nodeAfter;if(l.type.spec.isolating||c.type.spec.isolating)return!1;if(function(t,e,n){let o=e.nodeBefore,i=e.nodeAfter,r=e.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&e.parent.canReplace(r-1,r)?(n&&n(t.tr.delete(e.pos-o.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(r,r+1)||!i.isTextblock&&!(0,a.Mn)(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,o.type,o.contentMatchAt(o.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(r=l.contentMatchAt(l.childCount)).findWrapping(c.type))&&r.matchType(i[0]||c.type).validEnd){if(n){let o=e.pos+c.nodeSize,r=s.HY.empty;for(let t=i.length-1;t>=0;t--)r=s.HY.from(i[t].create(null,r));r=s.HY.from(l.copy(r));let d=t.tr.step(new a.FC(e.pos-1,o,e.pos,o,new s.p2(r,1,0),i.length,!0)),u=o+2*i.length;(0,a.Mn)(d.doc,u)&&d.join(u),n(d.scrollIntoView())}return!0}let h=o.Y1.findFrom(e,1),p=h&&h.$from.blockRange(h.$to),f=p&&(0,a.k9)(p);if(null!=f&&f>=e.depth)return n&&n(t.tr.lift(p,f).scrollIntoView()),!0;if(u&&d(c,"start",!0)&&d(l,"end")){let o=l,i=[];for(;i.push(o),!o.isTextblock;)o=o.lastChild;let r=c,d=1;for(;!r.isTextblock;r=r.firstChild)d++;if(o.canReplace(o.childCount,o.childCount,r.content)){if(n){let o=s.HY.empty;for(let t=i.length-1;t>=0;t--)o=s.HY.from(i[t].copy(o));n(t.tr.step(new a.FC(e.pos-i.length,e.pos+c.nodeSize,e.pos+d,e.pos+c.nodeSize-d,new s.p2(o,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function x(t){return function(e,n){let i=e.selection,r=t<0?i.$from:i.$to,s=r.depth;for(;r.node(s).isInline;){if(!s)return!1;s--}return!!r.node(s).isTextblock&&(n&&n(e.tr.setSelection(o.Bs.create(e.doc,t<0?r.start(s):r.end(s)))),!0)}}const C=x(-1),M=x(1);function S(t,e=null){return function(n,o){let i=!1;for(let o=0;o{if(i)return!1;if(o.isTextblock&&!o.hasMarkup(t,e))if(o.type==t)i=!0;else{let e=n.doc.resolve(r),o=e.index();i=e.parent.canReplaceWith(o,o+1,t)}}))}if(!i)return!1;if(o){let i=n.tr;for(let o=0;o{let{$from:n,$to:i}=t.selection;if(t.selection instanceof o.qv&&t.selection.node.isBlock)return!(!n.parentOffset||!(0,a.Ax)(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(e){let r=i.parentOffset==i.parent.content.size,s=t.tr;(t.selection instanceof o.Bs||t.selection instanceof o.C1)&&s.deleteSelection();let l=0==n.depth?null:b(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=r&&l?[{type:l}]:void 0,d=(0,a.Ax)(s.doc,s.mapping.map(n.pos),1,c);if(c||d||!(0,a.Ax)(s.doc,s.mapping.map(n.pos),1,l?[{type:l}]:void 0)||(l&&(c=[{type:l}]),d=!0),d&&(s.split(s.mapping.map(n.pos),1,c),!r&&!n.parentOffset&&n.parent.type!=l)){let t=s.mapping.map(n.before()),e=s.doc.resolve(t);l&&n.node(-1).canReplaceWith(e.index(),e.index()+1,l)&&s.setNodeMarkup(s.mapping.map(n.before()),l)}e(s.scrollIntoView())}return!0})),"Mod-Enter":v,Backspace:O,"Mod-Backspace":O,"Shift-Backspace":O,Delete:T,"Mod-Delete":T,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new o.C1(t.doc))),!0)},E={"Ctrl-h":N.Backspace,"Alt-Backspace":N["Mod-Backspace"],"Ctrl-d":N.Delete,"Ctrl-Alt-Backspace":N["Mod-Delete"],"Alt-Delete":N["Mod-Delete"],"Alt-d":N["Mod-Delete"],"Ctrl-a":C,"Ctrl-e":M};for(let t in N)E[t]=N[t];function I(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:i}=n,{storedMarks:r}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return r},get selection(){return o},get doc(){return i},get tr(){return o=n.selection,i=n.doc,r=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class D{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:i}=n,r=this.buildProps(i);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(r);return i.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:r}=o,s=[],a=!!t,l=t||i.tr,c={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const o=this.buildProps(l,e),i=n(...t)(o);return s.push(i),c}]))),run:()=>(a||!e||l.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(l),s.every((t=>!0===t)))};return c}createCan(t){const{rawCommands:e,state:n}=this,o=t||n.tr,i=this.buildProps(o,!1);return{...Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...i,dispatch:void 0})]))),chain:()=>this.createChain(o,!1)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:r}=o,s={tr:t,editor:o,view:r,state:I({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}class P{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function H(t,e,n){return void 0===t.config[e]&&t.parent?H(t.parent,e,n):"function"==typeof t.config[e]?t.config[e].bind({...n,parent:t.parent?H(t.parent,e,n):null}):t.config[e]}function L(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function _(t){const e=[],{nodeExtensions:n,markExtensions:o}=L(t),i=[...n,...o],r={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=H(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});n&&n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,o])=>{e.push({type:n,name:t,attribute:{...r,...o}})}))}))}))})),i.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},o=H(t,"addAttributes",n);if(!o)return;const i=o();Object.entries(i).forEach((([n,o])=>{const i={...r,...o};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,e.push({type:t.name,name:n,attribute:i})}))})),e}function R(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function z(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{if(n[t])if("class"===t){const o=e?e.split(" "):[],i=n[t]?n[t].split(" "):[],r=o.filter((t=>!i.includes(t)));n[t]=[...i,...r].join(" ")}else n[t]="style"===t?[n[t],e].join("; "):e;else n[t]=e})),n}),{})}function $(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>z(t,e)),{})}function B(t){return"function"==typeof t}function F(t,e=void 0,...n){return B(t)?e?t.bind(e)(...n):t(...n):t}function J(t={}){return 0===Object.keys(t).length&&t.constructor===Object}function Z(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}function Y(t,e){return t.style?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===o)return!1;const i=e.reduce(((t,e)=>{const o=e.attribute.parseHTML?e.attribute.parseHTML(n):Z(n.getAttribute(e.name));return null==o?t:{...t,[e.name]:o}}),{});return{...o,...i}}}}function j(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!J(e))&&null!=e)))}function q(t,e){var n;const o=_(t),{nodeExtensions:i,markExtensions:r}=L(t),a=null===(n=i.find((t=>H(t,"topNode"))))||void 0===n?void 0:n.name,l=Object.fromEntries(i.map((n=>{const i=o.filter((t=>t.type===n.name)),r={name:n.name,options:n.options,storage:n.storage,editor:e},s=j({...t.reduce(((t,e)=>{const o=H(e,"extendNodeSchema",r);return{...t,...o?o(n):{}}}),{}),content:F(H(n,"content",r)),marks:F(H(n,"marks",r)),group:F(H(n,"group",r)),inline:F(H(n,"inline",r)),atom:F(H(n,"atom",r)),selectable:F(H(n,"selectable",r)),draggable:F(H(n,"draggable",r)),code:F(H(n,"code",r)),defining:F(H(n,"defining",r)),isolating:F(H(n,"isolating",r)),attrs:Object.fromEntries(i.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=F(H(n,"parseHTML",r));a&&(s.parseDOM=a.map((t=>Y(t,i))));const l=H(n,"renderHTML",r);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:$(t,i)}));const c=H(n,"renderText",r);return c&&(s.toText=c),[n.name,s]}))),c=Object.fromEntries(r.map((n=>{const i=o.filter((t=>t.type===n.name)),r={name:n.name,options:n.options,storage:n.storage,editor:e},s=j({...t.reduce(((t,e)=>{const o=H(e,"extendMarkSchema",r);return{...t,...o?o(n):{}}}),{}),inclusive:F(H(n,"inclusive",r)),excludes:F(H(n,"excludes",r)),group:F(H(n,"group",r)),spanning:F(H(n,"spanning",r)),code:F(H(n,"code",r)),attrs:Object.fromEntries(i.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=F(H(n,"parseHTML",r));a&&(s.parseDOM=a.map((t=>Y(t,i))));const l=H(n,"renderHTML",r);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:$(t,i)})),[n.name,s]})));return new s.V_({topNode:a,nodes:l,marks:c})}function V(t,e){return e.nodes[t]||e.marks[t]||null}function U(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}const W=(t,e=500)=>{let n="";const o=t.parentOffset;return t.parent.nodesBetween(Math.max(0,o-e),o,((t,e,i,r)=>{var s,a;const l=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:e,parent:i,index:r}))||t.textContent||"%leaf%";n+=l.slice(0,Math.max(0,o-e))})),n};function Q(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class K{constructor(t){this.find=t.find,this.handler=t.handler}}const G=(t,e)=>{if(Q(e))return e.exec(t);const n=e(t);if(!n)return null;const o=[n.text];return o.index=n.index,o.input=t,o.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(n.replaceWith)),o};function X(t){var e;const{editor:n,from:o,to:i,text:r,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(o);if(c.parent.type.spec.code||(null===(e=c.nodeBefore||c.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let d=!1;const u=W(c)+r;return s.forEach((t=>{if(d)return;const e=G(u,t.find);if(!e)return;const s=l.state.tr,c=I({state:l.state,transaction:s}),h={from:o-(e[0].length-r.length),to:i},{commands:p,chain:f,can:m}=new D({editor:n,state:c});null!==t.handler({state:c,range:h,match:e,commands:p,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:o,to:i,text:r}),l.dispatch(s),d=!0)})),d}function tt(t){const{editor:e,rules:n}=t,i=new o.Sy({state:{init:()=>null,apply:(t,e)=>t.getMeta(i)||(t.selectionSet||t.docChanged?null:e)},props:{handleTextInput:(t,o,r,s)=>X({editor:e,from:o,to:r,text:s,rules:n,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&X({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:i})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:r}=t.state.selection;return!!r&&X({editor:e,from:r.pos,to:r.pos,text:"\n",rules:n,plugin:i})}},isInputRules:!0});return i}function et(t){return"number"==typeof t}class nt{constructor(t){this.find=t.find,this.handler=t.handler}}const ot=(t,e)=>{if(Q(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]};function it(t){const{editor:e,rules:n}=t;let i=null,r=!1,s=!1;const a=n.map((t=>new o.Sy({view(t){const e=e=>{var n;i=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:t=>(s=i===t.dom.parentElement,!1),paste:(t,e)=>{var n;const o=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return r=!!(null==o?void 0:o.includes("data-pm-slice")),!1}}},appendTransaction:(n,o,i)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!r,c="drop"===a.getMeta("uiEvent")&&!s;if(!l&&!c)return;const d=o.doc.content.findDiffStart(i.doc.content),u=o.doc.content.findDiffEnd(i.doc.content);if(!et(d)||!u||d===u.b)return;const h=i.tr,p=I({state:i,transaction:h}),f=function(t){const{editor:e,state:n,from:o,to:i,rule:r}=t,{commands:s,chain:a,can:l}=new D({editor:e,state:n}),c=[];return n.doc.nodesBetween(o,i,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const d=Math.max(o,e),u=Math.min(i,e+t.content.size),h=t.textBetween(d-e,u-e,void 0,"");ot(h,r.find).forEach((t=>{if(void 0===t.index)return;const e=d+t.index+1,o=e+t[0].length,i={from:n.tr.mapping.map(e),to:n.tr.mapping.map(o)},u=r.handler({state:n,range:i,match:t,commands:s,chain:a,can:l});c.push(u)}))})),c.every((t=>null!==t))}({editor:e,state:p,from:Math.max(d-1,0),to:u.b-1,rule:t});return f&&h.steps.length?h:void 0}})));return a}function rt(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}class st{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=st.resolve(t),this.schema=q(this.extensions,e),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:V(t.name,this.schema)};"mark"===t.type&&(null===(e=F(H(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name);const o=H(t,"onBeforeCreate",n);o&&this.editor.on("beforeCreate",o);const i=H(t,"onCreate",n);i&&this.editor.on("create",i);const r=H(t,"onUpdate",n);r&&this.editor.on("update",r);const s=H(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=H(t,"onTransaction",n);a&&this.editor.on("transaction",a);const l=H(t,"onFocus",n);l&&this.editor.on("focus",l);const c=H(t,"onBlur",n);c&&this.editor.on("blur",c);const d=H(t,"onDestroy",n);d&&this.editor.on("destroy",d)}))}static resolve(t){const e=st.sort(st.flatten(t)),n=rt(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=H(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=H(t,"priority")||100,o=H(e,"priority")||100;return n>o?-1:n{const n=H(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:V(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=st.sort([...this.extensions].reverse()),n=[],o=[],i=e.map((e=>{const i={name:e.name,options:e.options,storage:e.storage,editor:t,type:V(e.name,this.schema)},s=[],a=H(e,"addKeyboardShortcuts",i);let l={};if("mark"===e.type&&e.config.exitable&&(l.ArrowRight=()=>xe.handleExit({editor:t,mark:e})),a){const e=Object.fromEntries(Object.entries(a()).map((([e,n])=>[e,()=>n({editor:t})])));l={...l,...e}}const c=(0,r.h)(l);s.push(c);const d=H(e,"addInputRules",i);U(e,t.options.enableInputRules)&&d&&n.push(...d());const u=H(e,"addPasteRules",i);U(e,t.options.enablePasteRules)&&u&&o.push(...u());const h=H(e,"addProseMirrorPlugins",i);if(h){const t=h();s.push(...t)}return s})).flat();return[tt({editor:t,rules:n}),...it({editor:t,rules:o}),...i]}get attributes(){return _(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=L(this.extensions);return Object.fromEntries(e.filter((t=>!!H(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage,editor:t,type:R(e.name,this.schema)},i=H(e,"addNodeView",o);return i?[e.name,(o,r,s,a)=>{const l=$(o,n);return i()({editor:t,node:o,getPos:s,decorations:a,HTMLAttributes:l,extension:e})}]:[]})))}}function at(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function lt(t,e){const n={...t};return at(t)&&at(e)&&Object.keys(e).forEach((o=>{at(e[o])?o in t?n[o]=lt(t[o],e[o]):Object.assign(n,{[o]:e[o]}):Object.assign(n,{[o]:e[o]})})),n}class ct{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=F(H(this,"addOptions",{name:this.name}))),this.storage=F(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ct(t)}configure(t={}){const e=this.extend();return e.options=lt(this.options,t),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new ct(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(H(e,"addOptions",{name:e.name})),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}}function dt(t,e,n){const{from:o,to:i}=e,{blockSeparator:r="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(o,i,((t,n,c,d)=>{var u;const h=null==s?void 0:s[t.type.name];h?(t.isBlock&&!l&&(a+=r,l=!0),c&&(a+=h({node:t,pos:n,parent:c,index:d,range:e}))):t.isText?(a+=null===(u=null==t?void 0:t.text)||void 0===u?void 0:u.slice(Math.max(o,n)-n,i-n),l=!1):t.isBlock&&!l&&(a+=r,l=!0)})),a}function ut(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}const ht=ct.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:i}=e,{ranges:r}=i;return dt(o,{from:Math.min(...r.map((t=>t.$from.pos))),to:Math.max(...r.map((t=>t.$to.pos)))},{textSerializers:ut(n)})}}})]}});function pt(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every((o=>n.strict?e[o]===t[o]:Q(e[o])?e[o].test(t[o]):e[o]===t[o]))}function ft(t,e,n={}){return t.find((t=>t.type===e&&pt(t.attrs,n)))}function mt(t,e,n={}){return!!ft(t,e,n)}function gt(t,e,n={}){if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if(t.parentOffset===o.offset&&0!==o.offset&&(o=t.parent.childBefore(t.parentOffset)),!o.node)return;const i=ft([...o.node.marks],e,n);if(!i)return;let r=o.index,s=t.start()+o.offset,a=r+1,l=s+o.node.nodeSize;for(ft([...o.node.marks],e,n);r>0&&i.isInSet(t.parent.child(r-1).marks);)r-=1,s-=t.parent.child(r).nodeSize;for(;a${t}`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Ct(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?s.HY.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Ct("",e,n)}if("string"==typeof t){const o=s.aw.fromSchema(e);return n.slice?o.parseSlice(xt(t),n.parseOptions).content:o.parse(xt(t),n.parseOptions)}return Ct("",e,n)}function Mt(t,e,n){const i=t.steps.length-1;if(i{0===l&&(l=o)})),t.setSelection(o.Y1.near(t.doc.resolve(l),n))}function St(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function At(t,e,n={}){const{from:o,to:i,empty:r}=t.selection,s=e?R(e,t.schema):null,a=[];t.doc.nodesBetween(o,i,((t,e)=>{if(t.isText)return;const n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);a.push({node:t,from:n,to:r})}));const l=i-o,c=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>pt(t.node.attrs,n,{strict:!1})));return r?!!c.length:c.reduce(((t,e)=>t+e.to-e.from),0)>=l}function Ot(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Tt(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,o)=>(n.includes(o)||(e[o]=t[o]),e)),{})}function Nt(t,e,n={}){return Ct(t,e,{slice:!1,parseOptions:n})}function Et(t,e){const n=bt(e,t.schema),{from:o,to:i,empty:r}=t.selection,s=[];r?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,i,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function It(t,e){const n=new a.wx(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}function Dt(t){for(let e=0;e{e(t)&&n.push({node:t,pos:o})})),n}function Ht(t,e,n){const o=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&o.push({node:t,pos:e})})),o}function Lt(t,e){for(let n=t.depth;n>0;n-=1){const o=t.node(n);if(e(o))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:o}}}function _t(t){return e=>Lt(e.$from,t)}function Rt(t,e){const n=s.PW.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function zt(t,e){return q(st.resolve(t),e)}function $t(t,e){const n=zt(e);return Rt(s.NB.fromJSON(n,t).content,n)}function Bt(t,e){const n=zt(e),o=xt(t);return s.aw.fromSchema(n).parse(o).toJSON()}function Ft(t,e){return dt(t,{from:0,to:t.content.size},e)}function Jt(t,e,n){const{blockSeparator:o="\n\n",textSerializers:i={}}=n||{},r=zt(e);return Ft(s.NB.fromJSON(r,t),{blockSeparator:o,textSerializers:{...ut(r),...i}})}function Zt(t,e){const n=R(e,t.schema),{from:o,to:i}=t.selection,r=[];t.doc.nodesBetween(o,i,(t=>{r.push(t)}));const s=r.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}function Yt(t,e){const n=Ot("string"==typeof e?e:e.name,t.schema);return"node"===n?Zt(t,e):"mark"===n?Et(t,e):{}}function jt(t,e=JSON.stringify){const n={};return t.filter((t=>{const o=e(t);return!Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=!0)}))}function qt(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach(((t,i)=>{const r=[];if(t.ranges.length)t.forEach(((t,e)=>{r.push({from:t,to:e})}));else{const{from:t,to:e}=n[i];if(void 0===t||void 0===e)return;r.push({from:t,to:e})}r.forEach((({from:t,to:n})=>{const r=e.slice(i).map(t,-1),s=e.slice(i).map(n),a=e.invert().map(r,-1),l=e.invert().map(s);o.push({oldRange:{from:a,to:l},newRange:{from:r,to:s}})}))})),function(t){const e=jt(t);return 1===e.length?e:e.filter(((t,n)=>!e.filter(((t,e)=>e!==n)).some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))))}(o)}function Vt(t,e=0){const n=t.type===t.type.schema.topNodeType?0:1,o=e,i=o+t.nodeSize,r=t.marks.map((t=>{const e={type:t.type.name};return Object.keys(t.attrs).length&&(e.attrs={...t.attrs}),e})),s={...t.attrs},a={type:t.type.name,from:o,to:i};return Object.keys(s).length&&(a.attrs=s),r.length&&(a.marks=r),t.content.childCount&&(a.content=[],t.forEach(((t,o)=>{var i;null===(i=a.content)||void 0===i||i.push(Vt(t,e+o+n))}))),t.text&&(a.text=t.text),a}function Ut(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach((e=>{const i=gt(n.resolve(t-1),e.type);i&&o.push({mark:e,...i})})):n.nodesBetween(t,e,((t,e)=>{o.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),o}const Wt=(t,e,n,o=20)=>{const i=t.doc.resolve(n);let r=o,s=null;for(;r>0&&null===s;){const t=i.node(r);(null==t?void 0:t.type.name)===e?s=t:r-=1}return[s,r]};function Qt(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const o=t.find((t=>t.type===e&&t.name===n));return!!o&&o.attribute.keepOnSplit})))}function Kt(t,e,n={}){const{empty:o,ranges:i}=t.selection,r=e?bt(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!r||r.name===t.type.name)).find((t=>pt(t.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:e,$to:n})=>{const o=e.pos,i=n.pos;t.doc.nodesBetween(o,i,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);s+=r-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:r}))))}))})),0===s)return!1;const l=a.filter((t=>!r||r.name===t.mark.type.name)).filter((t=>pt(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),c=a.filter((t=>!r||t.mark.type!==r&&t.mark.type.excludes(r))).reduce(((t,e)=>t+e.to-e.from),0);return(l>0?l+c:l)>=s}function Gt(t,e,n={}){if(!e)return At(t,null,n)||Kt(t,null,n);const o=Ot(e,t.schema);return"node"===o?At(t,e,n):"mark"===o&&Kt(t,e,n)}const Xt=(t,e)=>{const{$from:n,$to:o,$anchor:i}=t.selection;if(e){const n=_t((t=>t.type.name===e))(t.selection);if(!n)return!1;const o=t.doc.resolve(n.pos+1);return i.pos+1===o.end()}return!(o.parentOffset{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function ee(t,e){const{nodeExtensions:n}=L(e),o=n.find((e=>e.name===t));if(!o)return!1;const i=F(H(o,"group",{name:o.name,options:o.options,storage:o.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function ne(t){var e;const n=null===(e=t.type.createAndFill())||void 0===e?void 0:e.toJSON(),o=t.toJSON();return JSON.stringify(n)===JSON.stringify(o)}function oe(t){return t instanceof o.qv}function ie(t,e,n){const o=t.state.doc.content.size,i=yt(e,0,o),r=yt(n,0,o),s=t.coordsAtPos(i),a=t.coordsAtPos(r,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),d=Math.min(s.left,a.left),u=Math.max(s.right,a.right),h={top:l,bottom:c,left:d,right:u,width:u-d,height:c-l,x:d,y:l};return{...h,toJSON:()=>h}}function re(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(o)}}const se=(t,e)=>{const n=_t((t=>t.type===e))(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(null==i?void 0:i.type)||!(0,a.Mn)(t.doc,n.pos)||(t.join(n.pos),!0)},ae=(t,e)=>{const n=_t((t=>t.type===e))(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(null==i?void 0:i.type)||!(0,a.Mn)(t.doc,o)||(t.join(o),!0)};var le=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:i}=o;return!n||(i.forEach((({$from:n,$to:o})=>{t.doc.nodesBetween(n.pos,o.pos,((t,n)=>{if(t.type.isText)return;const{doc:o,mapping:i}=e,r=o.resolve(i.map(n)),s=o.resolve(i.map(n+t.nodeSize)),l=r.blockRange(s);if(!l)return;const c=(0,a.k9)(l);if(t.type.isTextblock){const{defaultType:t}=r.parent.contentMatchAt(r.index());e.setNodeMarkup(l.start,t)}(c||0===c)&&e.lift(l,c)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>y(t,e),cut:(t,e)=>({editor:n,tr:i})=>{const{state:r}=n,s=r.doc.slice(t.from,t.to);i.deleteRange(t.from,t.to);const a=i.mapping.map(e);return i.insert(a,s.content),i.setSelection(new o.Bs(i.doc.resolve(a-1))),!0},deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const i=t.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===o.type){if(e){const e=i.before(n),o=i.after(n);t.delete(e,o).scrollIntoView()}return!0}return!1},deleteNode:t=>({tr:e,state:n,dispatch:o})=>{const i=R(t,n.schema),r=e.selection.$anchor;for(let t=r.depth;t>0;t-=1)if(r.node(t).type===i){if(o){const n=r.before(t),o=r.after(t);e.delete(n,o).scrollIntoView()}return!0}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:o,to:i}=t;return n&&e.delete(o,i),!0},deleteSelection:()=>({state:t,dispatch:e})=>l(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>v(t,e),extendMarkRange:(t,e={})=>({tr:n,state:i,dispatch:r})=>{const s=bt(t,i.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(r){const t=gt(c,s,e);if(t&&t.from<=d&&t.to>=u){const e=o.Bs.create(a,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t({editor:n,view:o,tr:i,dispatch:r})=>{e={scrollIntoView:!0,...e};const s=()=>{kt()&&o.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(o.hasFocus()&&null===t||!1===t)return!0;if(r&&null===t&&!vt(n.state.selection))return s(),!0;const a=wt(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return r&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,o)=>e(t,{...n,index:o}))),insertContent:(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:o,dispatch:i,editor:r})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=Ct(e,r.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},l=!0,c=!0;if((i.toString().startsWith("<")?i:[i]).forEach((t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,c=!!c&&t.isBlock})),s===a&&c){const{parent:t}=o.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}l?Array.isArray(e)?o.insertText(e.map((t=>t.text||"")).join(""),s,a):"object"==typeof e&&e&&e.text?o.insertText(e.text,s,a):o.insertText(e,s,a):o.replaceWith(s,a,i),n.updateSelection&&Mt(o,o.steps.length-1,-1)}return!0},joinUp:()=>({state:t,dispatch:e})=>((t,e)=>{let n,i=t.selection,r=i instanceof o.qv;if(r){if(i.node.isTextblock||!(0,a.Mn)(t.doc,i.from))return!1;n=i.from}else if(n=(0,a.GJ)(t.doc,i.from,-1),null==n)return!1;if(e){let i=t.tr.join(n);r&&i.setSelection(o.qv.create(i.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0})(t,e),joinDown:()=>({state:t,dispatch:e})=>((t,e)=>{let n,i=t.selection;if(i instanceof o.qv){if(i.node.isTextblock||!(0,a.Mn)(t.doc,i.to))return!1;n=i.to}else if(n=(0,a.GJ)(t.doc,i.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(t,e),joinBackward:()=>({state:t,dispatch:e})=>c(t,e),joinForward:()=>({state:t,dispatch:e})=>p(t,e),joinItemBackward:()=>({tr:t,state:e,dispatch:n})=>{try{const o=(0,a.GJ)(e.doc,e.selection.$from.pos,-1);return null!=o&&(t.join(o,2),n&&n(t),!0)}catch{return!1}},joinItemForward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=(0,a.GJ)(t.doc,t.selection.$from.pos,1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch(t){return!1}},keyboardShortcut:t=>({editor:e,view:n,tr:o,dispatch:i})=>{const r=function(t){const e=t.split(/-(?!$)/);let n,o,i,r,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==l||l.steps.forEach((t=>{const e=t.map(o.mapping);e&&i&&o.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:o})=>!!At(n,R(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:o}=t.selection,i=n.blockRange(o),r=i&&(0,a.k9)(i);return null!=r&&(e&&e(t.tr.lift(i,r).scrollIntoView()),!0)})(n,o),liftEmptyBlock:()=>({state:t,dispatch:e})=>w(t,e),liftListItem:t=>({state:e,dispatch:n})=>{return(o=R(t,e.schema),function(t,e){let{$from:n,$to:i}=t.selection,r=n.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==o));return!!r&&(!e||(n.node(r.depth-1).type==o?function(t,e,n,o){let i=t.tr,r=o.end,l=o.$to.end(o.depth);rr;e--)t-=i.child(e).nodeSize,o.delete(t-1,t+1);let r=o.doc.resolve(n.start),l=r.nodeAfter;if(o.mapping.map(n.end)!=n.start+r.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,d=n.endIndex==i.childCount,u=r.node(-1),h=r.index(-1);if(!u.canReplace(h+(c?0:1),h+1,l.content.append(d?s.HY.empty:s.HY.from(i))))return!1;let p=r.pos,f=p+l.nodeSize;return o.step(new a.FC(p-(c?1:0),f+(d?1:0),p+1,f-1,new s.p2((c?s.HY.empty:s.HY.from(i.copy(s.HY.empty))).append(d?s.HY.empty:s.HY.from(i.copy(s.HY.empty))),c?0:1,d?0:1),c?0:1)),e(o.scrollIntoView()),!0}(t,e,r)))})(e,n);var o},newlineInCode:()=>({state:t,dispatch:e})=>g(t,e),resetAttributes:(t,e)=>({tr:n,state:o,dispatch:i})=>{let r=null,s=null;const a=Ot("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(r=R(t,o.schema)),"mark"===a&&(s=bt(t,o.schema)),i&&n.selection.ranges.forEach((t=>{o.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,o)=>{r&&r===t.type&&n.setNodeMarkup(o,void 0,Tt(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((i=>{s===i.type&&n.addMark(o,o+t.nodeSize,s.create(Tt(i.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>u(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>f(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:i,to:r}=t.selection,s=i.sharedDepth(r);return 0!=s&&(n=i.before(s),e&&e(t.tr.setSelection(o.qv.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>M(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>C(t,e),setContent:(t,e=!1,n={})=>({tr:o,editor:i,dispatch:r})=>{const{doc:s}=o,a=Nt(t,i.schema,n);return r&&o.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:o,dispatch:i})=>{const{selection:r}=n,{empty:s,ranges:a}=r,l=bt(t,o.schema);if(i)if(s){const t=Et(o,l);n.addStoredMark(l.create({...t,...e}))}else a.forEach((t=>{const i=t.$from.pos,r=t.$to.pos;o.doc.nodesBetween(i,r,((t,o)=>{const s=Math.max(o,i),a=Math.min(o+t.nodeSize,r);t.marks.find((t=>t.type===l))?t.marks.forEach((t=>{l===t.type&&n.addMark(s,a,l.create({...t.attrs,...e}))})):n.addMark(s,a,l.create(e))}))}));return function(t,e,n){var o;const{selection:i}=e;let r=null;if(vt(i)&&(r=i.$cursor),r){const e=null!==(o=t.storedMarks)&&void 0!==o?o:r.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:s}=i;return s.some((({$from:e,$to:o})=>{let i=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,o.pos,((t,e,o)=>{if(i)return!1;if(t.isInline){const e=!o||o.type.allowsMarkType(n),r=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));i=e&&r}return!i})),i}))}(o,n,l)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:o,chain:i})=>{const r=R(t,n.schema);return r.isTextblock?i().command((({commands:t})=>!!S(r,e)(n)||t.clearNodes())).command((({state:t})=>S(r,e)(t,o))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,i=yt(t,0,n.content.size),r=o.qv.create(n,i);e.setSelection(r)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:i,to:r}="number"==typeof t?{from:t,to:t}:t,s=o.Bs.atStart(n).from,a=o.Bs.atEnd(n).to,l=yt(i,s,a),c=yt(r,s,a),d=o.Bs.create(n,l,c);e.setSelection(d)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const o=R(t,e.schema);return(i=o,function(t,e){let{$from:n,$to:o}=t.selection,r=n.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==i));if(!r)return!1;let l=r.startIndex;if(0==l)return!1;let c=r.parent,d=c.child(l-1);if(d.type!=i)return!1;if(e){let n=d.lastChild&&d.lastChild.type==c.type,o=s.HY.from(n?i.create():null),l=new s.p2(s.HY.from(i.create(null,s.HY.from(c.type.create(null,o)))),n?3:1,0),u=r.start,h=r.end;e(t.tr.step(new a.FC(u-(n?3:1),h,u,h,l,1,!0)).scrollIntoView())}return!0})(e,n);var i},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:i,editor:r})=>{const{selection:s,doc:l}=e,{$from:c,$to:d}=s,u=Qt(r.extensionManager.attributes,c.node().type.name,c.node().attrs);if(s instanceof o.qv&&s.node.isBlock)return!(!c.parentOffset||!(0,a.Ax)(l,c.pos)||(i&&(t&&re(n,r.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),0));if(!c.parent.isBlock)return!1;if(i){const i=d.parentOffset===d.parent.content.size;s instanceof o.Bs&&e.deleteSelection();const l=0===c.depth?void 0:Dt(c.node(-1).contentMatchAt(c.indexAfter(-1)));let h=i&&l?[{type:l,attrs:u}]:void 0,p=(0,a.Ax)(e.doc,e.mapping.map(c.pos),1,h);if(h||p||!(0,a.Ax)(e.doc,e.mapping.map(c.pos),1,l?[{type:l}]:void 0)||(p=!0,h=l?[{type:l,attrs:u}]:void 0),p&&(e.split(e.mapping.map(c.pos),1,h),l&&!i&&!c.parentOffset&&c.parent.type!==l)){const t=e.mapping.map(c.before()),n=e.doc.resolve(t);c.node(-1).canReplaceWith(n.index(),n.index()+1,l)&&e.setNodeMarkup(e.mapping.map(c.before()),l)}t&&re(n,r.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:i,editor:r})=>{var l;const c=R(t,n.schema),{$from:d,$to:u}=n.selection,h=n.selection.node;if(h&&h.isBlock||d.depth<2||!d.sameParent(u))return!1;const p=d.node(-1);if(p.type!==c)return!1;const f=r.extensionManager.attributes;if(0===d.parent.content.size&&d.node(-1).childCount===d.indexAfter(-1)){if(2===d.depth||d.node(-3).type!==c||d.index(-2)!==d.node(-2).childCount-1)return!1;if(i){let t=s.HY.empty;const n=d.index(-1)?1:d.index(-2)?2:3;for(let e=d.depth-n;e>=d.depth-3;e-=1)t=s.HY.from(d.node(e).copy(t));const i=d.indexAfter(-1){if(h>-1)return!1;t.isTextblock&&0===t.content.size&&(h=e+1)})),h>-1&&e.setSelection(o.Bs.near(e.doc.resolve(h))),e.scrollIntoView()}return!0}const m=u.pos===d.end()?p.contentMatchAt(0).defaultType:null,g=Qt(f,p.type.name,p.attrs),b=Qt(f,d.node().type.name,d.node().attrs);e.delete(d.pos,u.pos);const v=m?[{type:c,attrs:g},{type:m,attrs:b}]:[{type:c,attrs:g}];if(!(0,a.Ax)(e.doc,d.pos,2))return!1;if(i){const{selection:t,storedMarks:o}=n,{splittableMarks:s}=r.extensionManager,a=o||t.$to.parentOffset&&t.$from.marks();if(e.split(d.pos,2,v).scrollIntoView(),!a||!i)return!0;const l=a.filter((t=>s.includes(t.type.name)));e.ensureMarks(l)}return!0},toggleList:(t,e,n,o={})=>({editor:i,tr:r,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:h}=i.extensionManager,p=R(t,s.schema),f=R(e,s.schema),{selection:m,storedMarks:g}=s,{$from:b,$to:v}=m,y=b.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!y)return!1;const k=_t((t=>ee(t.type.name,u)))(m);if(y.depth>=1&&k&&y.depth-k.depth<=1){if(k.node.type===p)return c.liftListItem(f);if(ee(k.node.type.name,u)&&p.validContent(k.node.content)&&a)return l().command((()=>(r.setNodeMarkup(k.pos,p),!0))).command((()=>se(r,p))).command((()=>ae(r,p))).run()}return n&&w&&a?l().command((()=>{const t=d().wrapInList(p,o),e=w.filter((t=>h.includes(t.type.name)));return r.ensureMarks(e),!!t||c.clearNodes()})).wrapInList(p,o).command((()=>se(r,p))).command((()=>ae(r,p))).run():l().command((()=>!!d().wrapInList(p,o)||c.clearNodes())).wrapInList(p,o).command((()=>se(r,p))).command((()=>ae(r,p))).run()},toggleMark:(t,e={},n={})=>({state:o,commands:i})=>{const{extendEmptyMarkRange:r=!1}=n,s=bt(t,o.schema);return Kt(o,s,e)?i.unsetMark(s,{extendEmptyMarkRange:r}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:o,commands:i})=>{const r=R(t,o.schema),s=R(e,o.schema);return At(o,r,n)?i.setNode(s):i.setNode(r,n)},toggleWrap:(t,e={})=>({state:n,commands:o})=>{const i=R(t,n.schema);return At(n,i,e)?o.lift(i):o.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(r.text){const n=e.doc.resolve(r.from).marks();e.replaceWith(r.from,r.to,t.schema.text(r.text,n))}else e.delete(r.from,r.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:i}=n;return o||e&&i.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:o,dispatch:i})=>{var r;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=bt(t,o.schema),{$from:c,empty:d,ranges:u}=a;if(!i)return!0;if(d&&s){let{from:t,to:e}=a;const o=null===(r=c.marks().find((t=>t.type===l)))||void 0===r?void 0:r.attrs,i=gt(c,l,o);i&&(t=i.from,e=i.to),n.removeMark(t,e,l)}else u.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:o,dispatch:i})=>{let r=null,s=null;const a=Ot("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(r=R(t,o.schema)),"mark"===a&&(s=bt(t,o.schema)),i&&n.selection.ranges.forEach((t=>{const i=t.$from.pos,a=t.$to.pos;o.doc.nodesBetween(i,a,((t,o)=>{r&&r===t.type&&n.setNodeMarkup(o,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((r=>{if(s===r.type){const l=Math.max(o,i),c=Math.min(o+t.nodeSize,a);n.addMark(l,c,s.create({...r.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:o})=>function(t,e=null){return function(n,o){let{$from:i,$to:r}=n.selection,s=i.blockRange(r),l=s&&(0,a.nd)(s,t,e);return!!l&&(o&&o(n.tr.wrap(s,l).scrollIntoView()),!0)}}(R(t,n.schema),e)(n,o),wrapInList:(t,e={})=>({state:n,dispatch:o})=>function(t,e=null){return function(n,o){let{$from:i,$to:r}=n.selection,l=i.blockRange(r),c=!1,d=l;if(!l)return!1;if(l.depth>=2&&i.node(l.depth-1).type.compatibleContent(t)&&0==l.startIndex){if(0==i.index(l.depth-1))return!1;let t=n.doc.resolve(l.start-2);d=new s.Ts(t,t,l.depth),l.endIndex=0;t--)r=s.HY.from(n[t].type.create(n[t].attrs,r));t.step(new a.FC(e.start-(o?2:0),e.end,e.start,e.end,new s.p2(r,0,0),n.length,!0));let l=0;for(let t=0;t({...le})}),de=ct.create({name:"editable",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ue=ct.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new o.Sy({key:new o.H$("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const o=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1},blur:(e,n)=>{t.isFocused=!1;const o=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1}}}})]}}),he=ct.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:i}=e,{empty:r,$anchor:s}=n,{pos:a,parent:l}=s,c=s.parent.isTextblock?e.doc.resolve(a-1):s,d=c.parent.type.spec.isolating,u=s.pos-s.parentOffset,h=d&&1===c.parent.childCount?u===s.pos:o.Y1.atStart(i).from===a;return!(!(r&&h&&l.type.isTextblock)||l.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},r={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return kt()||St()?r:i},addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("clearDocument"),appendTransaction:(t,e,n)=>{if(!t.some((t=>t.docChanged))||e.doc.eq(n.doc))return;const{empty:i,from:r,to:s}=e.selection,a=o.Y1.atStart(e.doc).from,l=o.Y1.atEnd(e.doc).to;if(i||r!==a||s!==l)return;if(0!==n.doc.textBetween(0,n.doc.content.size," "," ").length)return;const c=n.tr,d=I({state:n,transaction:c}),{commands:u}=new D({editor:this.editor,state:d});return u.clearNodes(),c.steps.length?c:void 0}})]}}),pe=ct.create({name:"tabindex",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var fe=Object.freeze({__proto__:null,ClipboardTextSerializer:ht,Commands:ce,Editable:de,FocusEvents:ue,Keymap:he,Tabindex:pe});function me(t,e,n){const o=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==o)return o;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class ge extends P{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),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),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}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&&document&&(this.css=me('.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: 1px !important;\n height: 1px !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}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=B(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const e="string"==typeof t?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((t=>!t.key.startsWith(e)))});this.view.updateState(n)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(fe):[],...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new st(t,this)}createCommandManager(){this.commandManager=new D({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=Nt(this.options.content,this.schema,this.options.parseOptions),e=wt(t,this.options.autofocus);this.view=new i.tk(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:o.yy.create({doc:t,selection:e||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass(),this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)})):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return Yt(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,o="string"==typeof t?e:t;return Gt(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Rt(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return Ft(this.state.doc,{blockSeparator:e,textSerializers:{...ut(this.schema),...n}})}get isEmpty(){return ne(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}}function be(t){return new K({find:t.find,handler:({state:e,range:n,match:o})=>{const i=F(t.getAttributes,void 0,o);if(!1===i||null===i)return null;const{tr:r}=e,s=o[o.length-1],a=o[0];if(s){const o=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(Ut(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>l)).length)return null;cn.from&&r.delete(n.from+o,l);const d=n.from+o+s.length;r.addMark(n.from+o,d,t.type.create(i||{})),r.removeStoredMark(t.type)}}})}function ve(t){return new K({find:t.find,handler:({state:e,range:n,match:o})=>{const i=F(t.getAttributes,void 0,o)||{},{tr:r}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(o[1]){let t=s+o[0].lastIndexOf(o[1]);t>a?t=a:a=t+o[1].length;const e=o[0][o[0].length-1];r.insertText(e,s+o[0].length-1),r.replaceWith(t,a,l)}else o[0]&&r.insert(s-1,t.type.create(i)).delete(r.mapping.map(s),r.mapping.map(a));r.scrollIntoView()}})}function ye(t){return new K({find:t.find,handler:({state:e,range:n,match:o})=>{const i=e.doc.resolve(n.from),r=F(t.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,r)}})}function we(t){return new K({find:t.find,handler:({state:e,range:n,match:o})=>{let i=t.replace,r=n.from;const s=n.to;if(o[1]){const t=o[0].lastIndexOf(o[1]);i+=o[0].slice(t+o[1].length),r+=t;const e=r-s;e>0&&(i=o[0].slice(t-e,t)+i,r=s)}e.tr.insertText(i,r,s)}})}function ke(t){return new K({find:t.find,handler:({state:e,range:n,match:o,chain:i})=>{const r=F(t.getAttributes,void 0,o)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&(0,a.nd)(l,t.type,r);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:n,storedMarks:o}=e,{splittableMarks:i}=t.editor.extensionManager,r=o||n.$to.parentOffset&&n.$from.marks();if(r){const t=r.filter((t=>i.includes(t.type.name)));s.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";i().updateAttributes(e,r).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&(0,a.Mn)(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&s.join(n.from-1)}})}class xe{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=F(H(this,"addOptions",{name:this.name}))),this.storage=F(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new xe(t)}configure(t={}){const e=this.extend();return e.options=lt(this.options,t),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new xe(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(H(e,"addOptions",{name:e.name})),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const i=o.marks();if(!i.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const r=i.find((t=>(null==t?void 0:t.type.name)===e.name));return r&&n.removeStoredMark(r),n.insertText(" ",o.pos),t.view.dispatch(n),!0}return!1}}class Ce{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=F(H(this,"addOptions",{name:this.name}))),this.storage=F(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ce(t)}configure(t={}){const e=this.extend();return e.options=lt(this.options,t),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Ce(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(H(e,"addOptions",{name:e.name})),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}}class Me{constructor(t,e,n){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,n,i,r,s,a,l;const{view:c}=this.editor,d=t.target,u=3===d.nodeType?null===(e=d.parentElement)||void 0===e?void 0:e.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(d))||!u)return;let h=0,p=0;if(this.dom!==u){const e=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),o=null!==(i=t.offsetX)&&void 0!==i?i:null===(r=t.nativeEvent)||void 0===r?void 0:r.offsetX,l=null!==(s=t.offsetY)&&void 0!==s?s:null===(a=t.nativeEvent)||void 0===a?void 0:a.offsetY;h=n.x-e.x+o,p=n.y-e.y+l}null===(l=t.dataTransfer)||void 0===l||l.setDragImage(this.dom,h,p);const f=o.qv.create(c.state.doc,this.getPos()),m=c.state.tr.setSelection(f);c.dispatch(m)}stopEvent(t){var e;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:t});const n=t.target;if(!this.dom.contains(n)||(null===(e=this.contentDOM)||void 0===e?void 0:e.contains(n)))return!1;const i=t.type.startsWith("drag"),r="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r&&!i)return!0;const{isEditable:s}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,c=o.qv.isSelectable(this.node),d="copy"===t.type,u="paste"===t.type,h="cut"===t.type,p="mousedown"===t.type;if(!l&&c&&i&&t.preventDefault(),l&&i&&!a)return t.preventDefault(),!1;if(l&&s&&!a&&p){const t=n.closest("[data-drag-handle]");t&&(this.dom===t||this.dom.contains(t))&&(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!(a||r||d||u||h||p&&c)}ignoreMutation(t){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:t}):!(!this.node.isLeaf&&!this.node.isAtom&&("selection"===t.type||this.dom.contains(t.target)&&"childList"===t.type&&(kt()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every((t=>t.isContentEditable))||(this.contentDOM!==t.target||"attributes"!==t.type)&&this.contentDOM.contains(t.target))))}updateAttributes(t){this.editor.commands.command((({tr:e})=>{const n=this.getPos();return e.setNodeMarkup(n,void 0,{...this.node.attrs,...t}),!0}))}deleteNode(){const t=this.getPos(),e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}}function Se(t){return new nt({find:t.find,handler:({state:e,range:n,match:o})=>{const i=F(t.getAttributes,void 0,o);if(!1===i||null===i)return null;const{tr:r}=e,s=o[o.length-1],a=o[0];let l=n.to;if(s){const o=a.search(/\S/),c=n.from+a.indexOf(s),d=c+s.length;if(Ut(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>c)).length)return null;dn.from&&r.delete(n.from+o,c),l=n.from+o+s.length,r.addMark(n.from+o,l,t.type.create(i||{})),r.removeStoredMark(t.type)}}})}function Ae(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function Oe(t){return"string"==typeof t}function Te(t){return new nt({find:t.find,handler({match:e,chain:n,range:o}){const i=F(t.getAttributes,void 0,e);if(!1===i||null===i)return null;e.input&&n().deleteRange(o).insertContentAt(o.from,{type:t.type.name,attrs:i})}})}function Ne(t){return new nt({find:t.find,handler:({state:e,range:n,match:o})=>{let i=t.replace,r=n.from;const s=n.to;if(o[1]){const t=o[0].lastIndexOf(o[1]);i+=o[0].slice(t+o[1].length),r+=t;const e=r-s;e>0&&(i=o[0].slice(t-e,t)+i,r=s)}e.tr.insertText(i,r,s)}})}class Ee{constructor(t){this.transaction=t,this.currentStep=this.transaction.steps.length}map(t){let e=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce(((t,n)=>{const o=n.getMap().mapResult(t);return o.deleted&&(e=!0),o.pos}),t),deleted:e}}}},54424:(t,e,n)=>{n.r(e),n.d(e,{Heading:()=>i,default:()=>i});var o=n(11046);const i=o.Node.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,(0,o.mergeAttributes)(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>(0,o.textblockTypeInputRule)({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}})},44632:(t,e,n)=>{n.r(e),n.d(e,{Image:()=>r,default:()=>r,inputRegex:()=>i});var o=n(11046);const i=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,r=o.Node.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",(0,o.mergeAttributes)(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[(0,o.nodeInputRule)({find:i,type:this.type,getAttributes:t=>{const[,,e,n,o]=t;return{src:n,alt:e,title:o}}})]}})},84402:(t,e,n)=>{n.r(e),n.d(e,{TextStyle:()=>i,default:()=>i});var o=n(11046);const i=o.Mark.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=(0,o.getMarkAttributes)(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}})},31690:(t,e,n)=>{n.d(e,{$:()=>f,h:()=>p});for(var o={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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},r="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)o[48+a]=o[96+a]=String(a);for(a=1;a<=24;a++)o[a+111]="F"+a;for(a=65;a<=90;a++)o[a]=String.fromCharCode(a+32),i[a]=String.fromCharCode(a);for(var l in o)i.hasOwnProperty(l)||(i[l]=o[l]);var c=n(62463);const d="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function u(t){let e,n,o,i,r=t.split(/-(?!$)/),s=r[r.length-1];"Space"==s&&(s=" ");for(let t=0;t127)&&(a=o[n.keyCode])&&a!=l){let o=e[h(a,n)];if(o&&o(t.state,t.dispatch,t))return!0}}return!1}}},27439:(t,e,n)=>{function o(t){this.content=t}n.d(e,{aw:()=>K,PW:()=>at,HY:()=>a,vc:()=>u,ZU:()=>U,NB:()=>I,Ts:()=>N,e4:()=>h,V_:()=>W,p2:()=>p}),o.prototype={constructor:o,find:function(t){for(var e=0;e>1}},o.from=function(t){if(t instanceof o)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new o(e)};const i=o;function r(t,e,n){for(let o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let t=0;i.text[t]==s.text[t];t++)n++;return n}if(i.content.size||s.content.size){let t=r(i.content,s.content,n+1);if(null!=t)return t}n+=i.nodeSize}else n+=i.nodeSize}}function s(t,e,n,o){for(let i=t.childCount,r=e.childCount;;){if(0==i||0==r)return i==r?null:{a:n,b:o};let a=t.child(--i),l=e.child(--r),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:o};if(a.isText&&a.text!=l.text){let t=0,e=Math.min(a.text.length,l.text.length);for(;tt&&!1!==n(a,o+s,i||null,r)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,t-i),Math.min(a.content.size,e-i),n,o+i)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,o){let i="",r=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(t,a)-a,e-a),r=!n):s.isLeaf?(o?i+="function"==typeof o?o(s):o:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),r=!n):!r&&s.isBlock&&(i+=n,r=!0)}),0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(o[o.length-1]=e.withText(e.text+n.text),i=1);it)for(let i=0,r=0;rt&&((re)&&(s=s.isText?s.cut(Math.max(0,t-r),Math.min(s.text.length,e-r)):s.cut(Math.max(0,t-r-1),Math.min(s.content.size,e-r-1))),n.push(s),o+=s.nodeSize),r=a}return new a(n,o)}cutByIndex(t,e){return t==e?a.empty:0==t&&e==this.content.length?this:new a(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let o=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return o[t]=e,new a(o,i)}addToStart(t){return new a([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new a(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=o+this.child(n).nodeSize;if(i>=t)return i==t||e>0?c(n+1,i):c(n,o);o=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return a.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new a(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return a.empty;let e,n=0;for(let o=0;o{class t{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let o=0;othis.type.rank&&(e||(e=t.slice(0,o)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),n}}return t.none=[],t})();class h extends Error{}class p{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=m(this.content,t+this.openStart,e);return n&&new p(n,this.openStart,this.openEnd)}removeBetween(t,e){return new p(f(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return p.empty;let n=e.openStart||0,o=e.openEnd||0;if("number"!=typeof n||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new p(a.fromJSON(t,e.content),n,o)}static maxOpen(t,e=!0){let n=0,o=0;for(let o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)o++;return new p(t,n,o)}}function f(t,e,n){let{index:o,offset:i}=t.findIndex(e),r=t.maybeChild(o),{index:s,offset:a}=t.findIndex(n);if(i==e||r.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(o,r.copy(f(r.content,e-i-1,n-i-1)))}function m(t,e,n,o){let{index:i,offset:r}=t.findIndex(e),s=t.maybeChild(i);if(r==e||s.isText)return o&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=m(s.content,e-r-1,n);return a&&t.replaceChild(i,s.copy(a))}function g(t,e,n){if(n.openStart>t.depth)throw new h("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new h("Inconsistent open depths");return b(t,e,n,0)}function b(t,e,n,o){let i=t.index(o),r=t.node(o);if(i==e.index(o)&&o=0;t--)o=e.node(t).copy(a.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}(n,t);return x(r,C(t,i,s,e,o))}{let o=t.parent,i=o.content;return x(o,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return x(r,M(t,e,o))}function v(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function y(t,e,n){let o=t.node(n);return v(o,e.node(n)),o}function w(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function k(t,e,n,o){let i=(e||t).node(n),r=0,s=e?e.index(n):i.childCount;t&&(r=t.index(n),t.depth>n?r++:t.textOffset&&(w(t.nodeAfter,o),r++));for(let t=r;ti&&y(t,e,i+1),s=o.depth>i&&y(n,o,i+1),l=[];return k(null,t,i,l),r&&s&&e.index(i)==n.index(i)?(v(r,s),w(x(r,C(t,e,n,o,i+1)),l)):(r&&w(x(r,M(t,e,i+1)),l),k(e,n,i,l),s&&w(x(s,M(n,o,i+1)),l)),k(o,null,i,l),new a(l)}function M(t,e,n){let o=[];return k(null,t,n,o),t.depth>n&&w(x(y(t,e,n+1),M(t,e,n+1)),o),k(e,null,n,o),new a(o)}p.empty=new p(a.empty,0,0);class S{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(e);return n?t.child(e).cut(n):o}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],o=0==e?0:this.path[3*e-1]+1;for(let e=0;e0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new N(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],o=0,i=e;for(let e=t;;){let{index:t,offset:r}=e.content.findIndex(i),s=i-r;if(n.push(e,t,o+r),!s)break;if(e=e.child(t),e.isText)break;i=s-1,o+=r+1}return new S(e,n,i)}static resolveCached(t,e){for(let n=0;nt&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(o=!0),!o))),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),P(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=a.empty,o=0,i=n.childCount){let r=this.contentMatchAt(t).matchFragment(n,o,i),s=r&&r.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=o;tt.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let o=a.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,o,n)}}I.prototype.text=void 0;class D extends I{constructor(t,e,n,o){if(super(t,e,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):P(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new D(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new D(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function P(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class H{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new L(t,e);if(null==n.next)return H.empty;let o=_(n);n.next&&n.err("Unexpected trailing text");let i=function(t){let e=Object.create(null);return function n(o){let i=[];o.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let o;for(let t=0;t{o||i.push([e,o=[]]),-1==o.indexOf(t)&&o.push(t)}))}))}));let r=e[o.join(",")]=new H(o.indexOf(t.length-1)>-1);for(let t=0;te.concat(t(n,r))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return o(r,s),i(t(e.expr,s),s),[o(s)]}if("plus"==e.type){let s=n();return i(t(e.expr,r),s),i(t(e.expr,s),s),[o(s)]}if("opt"==e.type)return[o(r)].concat(t(e.expr,r));if("range"==e.type){let s=r;for(let o=0;ot.to=e))}}(o));return function(t,e){for(let n=0,o=[t];nt.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let o=0;o{let o=n+(e.validEnd?"*":" ")+" ";for(let n=0;n"+t.indexOf(e.next[n].next);return o})).join("\n")}}H.empty=new H(!0);class L{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function _(t){let e=[];do{e.push(R(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function R(t){let e=[];do{e.push(z(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function z(t){let e=function(t){if(t.eat("(")){let e=_(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,o=n[e];if(o)return[o];let i=[];for(let t in n){let o=n[t];o.groups.indexOf(e)>-1&&i.push(o)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=B(t,e)}return e}function $(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function B(t,e){let n=$(t),o=n;return t.eat(",")&&(o="}"!=t.next?$(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function F(t,e){return e-t}function J(t,e){let n=[];return function e(o){let i=t[o];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(o);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;en[t]=new q(t,e,o)));let o=e.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class V{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class U{constructor(t,e,n,o){this.name=t,this.rank=e,this.schema=n,this.spec=o,this.attrs=j(o.attrs),this.excluded=null;let i=Z(this.attrs);this.instance=i?new u(this,i):null}create(t=null){return!t&&this.instance?this.instance:new u(this,Y(this.attrs,t))}static compile(t,e){let n=Object.create(null),o=0;return t.forEach(((t,i)=>n[t]=new U(t,o++,e,i))),n}removeFromSet(t){for(var e=0;e-1}}class W{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=i.from(t.nodes),e.marks=i.from(t.marks||{}),this.nodes=q.compile(this.spec.nodes,this),this.marks=U.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],o=e.spec.content||"",i=e.spec.marks;e.contentMatch=n[o]||(n[o]=H.parse(o,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?Q(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:Q(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,o){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof q))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,o)}text(t,e){let n=this.nodes.text;return new D(n,n.defaultAttrs,t,u.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return I.fromJSON(this,t)}markFromJSON(t){return u.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Q(t,e){let n=[];for(let o=0;o-1)&&n.push(s=o)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return n}class K{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new ot(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new ot(this,e,!0);return n.addAll(t,e.from,e.to),p.maxOpen(n.finish())}matchTag(t,e,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(61!=r.charCodeAt(t.length)||r.slice(t.length+1)!=e))){if(o.getAttrs){let t=o.getAttrs(e);if(!1===t)continue;o.attrs=t||void 0}return o}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,o=0;for(;o{n(t=rt(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))}for(let e in t.nodes){let o=t.nodes[e].spec.parseDOM;o&&o.forEach((t=>{n(t=rt(t)),t.node||t.ignore||t.mark||(t.node=e)}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new K(t,K.schemaRules(t)))}}const G={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},X={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tt={ol:!0,ul:!0};function et(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class nt{constructor(t,e,n,o,i,r,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=s,this.content=[],this.activeMarks=u.none,this.stashMarks=[],this.match=r||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(a.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=a.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(a.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;ethis.addAll(t))),e&&this.sync(n),this.needsBlock=r}else this.withStyleRules(t,(()=>{this.addElementByRule(t,i,!1===i.consuming?n:void 0)}))}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=u.none,n=u.none;for(let o=0;o{r.clearMark(t)&&(n=t.addToSet(n))})):e=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(e),!1!==r.consuming)break;i=r}return[e,n]}addElementByRule(t,e,n){let o,i,r;e.node?(i=this.parser.schema.nodes[e.node],i.isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):o=this.enter(i,e.attrs||null,e.preserveWhitespace)):(r=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(r));let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}o&&this.sync(s)&&this.open--,r&&this.removePendingMark(r,s)}addAll(t,e,n){let o=e||0;for(let i=e?t.childNodes[e]:t.firstChild,r=null==n?null:t.childNodes[n];i!=r;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let e,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],r=i.findWrapping(t);if(r&&(!e||e.length>r.length)&&(e=r,n=i,!r.length))break;if(i.solid)break}if(!e)return!1;this.sync(n);for(let t=0;tthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,o=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),r=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(r(t-1,s))return!0;return!1}{let t=s>0||0==s&&o?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return r(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let e=o.popFromStashMark(t);e&&o.type&&o.type.allowsMarkType(e.type)&&(o.activeMarks=e.addToSet(o.activeMarks))}if(o==e)break}}}function it(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function rt(t){let e={};for(let n in t)e[n]=t[n];return e}function st(t,e){let n=e.schema.nodes;for(let o in n){let i=n[o];if(!i.allowsMarkType(t))continue;let r=[],s=t=>{r.push(t);for(let n=0;n{if(i.length||t.marks.length){let n=0,r=0;for(;n=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let o=this.marks[t.type.name];return o&&at.renderSpec(ct(n),o(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let o,i=e[0],r=i.indexOf(" ");r>0&&(n=i.slice(0,r),i=i.slice(r+1));let s=n?t.createElementNS(n,i):t.createElement(i),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let i=l;il)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:i}=at.renderSpec(t,r,n);if(s.appendChild(e),i){if(o)throw new RangeError("Multiple content holes");o=i}}}return{dom:s,contentDOM:o}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new at(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=lt(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return lt(t.marks)}}function lt(t){let e={};for(let n in t){let o=t[n].spec.toDOM;o&&(e[n]=o)}return e}function ct(t){return t.document||window.document}},62463:(t,e,n)=>{n.d(e,{C1:()=>f,yy:()=>C,qv:()=>h,Sy:()=>S,H$:()=>T,Y1:()=>s,xm:()=>a,Bs:()=>d});var o=n(27439),i=n(38480);const r=Object.create(null);class s{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new a(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;o--){let i=e<0?g(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):g(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new f(t.node(0))}static atStart(t){return g(t,t,0,0,1)||new f(t)}static atEnd(t){return g(t,t,t.content.size,t.childCount,-1)||new f(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=r[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in r)throw new RangeError("Duplicate use of selection JSON ID "+t);return r[t]=e,e.prototype.jsonID=t,e}getBookmark(){return d.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(t,e){this.$from=t,this.$to=e}}let l=!1;function c(t){l||t.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class d extends s{constructor(t,e=t){c(t),c(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return s.near(n);let o=t.resolve(e.map(this.anchor));return new d(o.parent.inlineContent?o:n,n)}replace(t,e=o.p2.empty){if(super.replace(t,e),e==o.p2.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof d&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new u(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new d(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let o=t.resolve(e);return new this(o,n==e?o:t.resolve(n))}static between(t,e,n){let o=t.pos-e.pos;if(n&&!o||(n=o>=0?1:-1),!e.parent.inlineContent){let t=s.findFrom(e,n,!0)||s.findFrom(e,-n,!0);if(!t)return s.near(e,n);e=t.$head}return t.parent.inlineContent||(0==o||(t=(s.findFrom(t,-n,!0)||s.findFrom(t,n,!0)).$anchor).posnew f(t)};function g(t,e,n,o,i,r=!1){if(e.inlineContent)return d.create(t,n);for(let s=o-(i>0?0:1);i>0?s=0;s+=i){let o=e.child(s);if(o.isAtom){if(!r&&h.isSelectable(o))return h.create(t,n-(i<0?o.nodeSize:0))}else{let e=g(t,o,n+i,i<0?o.childCount:0,i,r);if(e)return e}n+=o.nodeSize*i}return null}function b(t,e,n){let o=t.steps.length-1;if(o{null==r&&(r=o)})),t.setSelection(s.near(t.doc.resolve(r),n)))}class v extends i.wx{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return o.vc.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||o.vc.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let o=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,o.text(t,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function y(t,e){return e&&t?t.bind(e):t}class w{constructor(t,e,n){this.name=t,this.init=y(e.init,n),this.apply=y(e.apply,n)}}const k=[new w("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new w("selection",{init:(t,e)=>t.selection||s.atStart(e.doc),apply:t=>t.selection}),new w("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,o)=>o.selection.$cursor?t.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class x{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=k.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new w(t.key,t.spec.state,t))}))}}class C{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(o,this[o.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new x(t.schema,t.plugins),r=new C(i);return i.fields.forEach((i=>{if("doc"==i.name)r.doc=o.NB.fromJSON(t.schema,e.doc);else if("selection"==i.name)r.selection=s.fromJSON(r.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(r.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(r[i.name]=a.fromJSON.call(s,t,e[o],r))}r[i.name]=i.init(t,r)}})),r}}function M(t,e,n){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(e):"handleDOMEvents"==o&&(i=M(i,e,{})),n[o]=i}return n}class S{constructor(t){this.spec=t,this.props={},t.props&&M(t.props,this,this.props),this.key=t.key?t.key.key:O("plugin")}getState(t){return t[this.key]}}const A=Object.create(null);function O(t){return t in A?t+"$"+ ++A[t]:(A[t]=0,t+"$")}class T{constructor(t="key"){this.key=O(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},38480:(t,e,n)=>{n.d(e,{vs:()=>l,FC:()=>v,Pu:()=>b,wx:()=>F,Mn:()=>S,Ax:()=>M,nj:()=>T,nd:()=>x,GJ:()=>O,k9:()=>k,dR:()=>N});var o=n(27439);const i=Math.pow(2,16);function r(t){return 65535&t}class s{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class a{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&a.empty)return a.empty}recover(t){let e=0,n=r(t);if(!this.inverted)for(let t=0;tt)break;let d=this.ranges[l+r],u=this.ranges[l+a],h=c+d;if(t<=h){let r=c+o+((d?t==c?-1:t==h?1:e:e)<0?0:u);if(n)return r;let a=t==c?2:t==h?1:4;return(e<0?t!=c:t!=h)&&(a|=8),new s(r,a,t==(e<0?c:h)?null:l/3+(t-c)*i)}o+=u-d}return n?t+o:new s(t+o,0,null)}touches(t,e){let n=0,o=r(e),i=this.inverted?2:1,s=this.inverted?1:2;for(let e=0;et)break;let a=this.ranges[e+i];if(t<=r+a&&e==3*o)return!0;n+=this.ranges[e+s]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;e--){let o=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=o&&o>e?n-o-1:void 0)}}invert(){let t=new l;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;nn&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),i),e.openStart,e.openEnd);return u.fromReplace(t,this.from,this.to,r)}invert(){return new f(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}d.jsonID("addMark",p);class f extends d{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new o.p2(h(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return u.fromReplace(t,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new f(e.pos,n.pos,this.mark)}merge(t){return t instanceof f&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new f(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new f(e.from,e.to,t.markFromJSON(e.mark))}}d.jsonID("removeMark",f);class m extends d{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return u.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return u.fromReplace(t,this.pos,this.pos+1,new o.p2(o.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new v(e.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new v(e.from,e.to,e.gapFrom,e.gapTo,o.p2.fromJSON(t,e.slice),e.insert,!!e.structure)}}function y(t,e,n){let o=t.resolve(e),i=n-e,r=o.depth;for(;i>0&&r>0&&o.indexAfter(r)==o.node(r).childCount;)r--,i--;if(i>0){let t=o.node(r).maybeChild(o.indexAfter(r));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function w(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function k(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let o=t.$from.node(n),i=t.$from.index(n),r=t.$to.indexAfter(n);if(nr;t--,e--){let n=i.node(t),r=i.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(r,n.childCount),a=o&&o[e+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=o&&o[e]||n;if(!n.canReplace(r+1,n.childCount)||!l.type.validContent(s))return!1}let a=i.indexAfter(r),l=o&&o[0];return i.node(r).canReplaceWith(a,a,l?l.type:i.node(r+1).type)}function S(t,e){let n=t.resolve(e),o=n.index();return A(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function A(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function O(t,e,n=-1){let o=t.resolve(e);for(let t=o.depth;;t--){let i,r,s=o.index(t);if(t==o.depth?(i=o.nodeBefore,r=o.nodeAfter):n>0?(i=o.node(t+1),s++,r=o.node(t).maybeChild(s)):(i=o.node(t).maybeChild(s-1),r=o.node(t+1)),i&&!i.isTextblock&&A(i,r)&&o.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?o.before(t):o.after(t)}}function T(t,e,n){let o=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let t=0;t=0;e--){let n=e==o.depth?0:o.pos<=(o.start(e+1)+o.end(e+1))/2?-1:1,r=o.index(e)+(n>0?1:0),s=o.node(e),a=!1;if(1==t)a=s.canReplace(r,r,i);else{let t=s.contentMatchAt(r).findWrapping(i.firstChild.type);a=t&&s.canReplaceWith(r,r,t[0])}if(a)return 0==n?o.pos:n<0?o.before(e+1):o.after(e+1)}return null}function N(t,e,n=e,i=o.p2.empty){if(e==n&&!i.size)return null;let r=t.resolve(e),s=t.resolve(n);return E(r,s,i)?new b(e,n,i):new I(r,s,i).fit()}function E(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}d.jsonID("replaceAround",v);class I{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=o.HY.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=o.HY.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let r=this.placed,s=n.depth,a=i.depth;for(;s&&a&&1==r.childCount;)r=r.firstChild.content,s--,a--;let l=new o.p2(r,s,a);return t>-1?new v(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new b(n.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,i=null;n?(i=H(this.unplaced.content,n-1).firstChild,t=i.content):t=this.unplaced.content;let r=t.firstChild;for(let t=this.depth;t>=0;t--){let s,{type:a,match:l}=this.frontier[t],c=null;if(1==e&&(r?l.matchType(r.type)||(c=l.fillBefore(o.HY.from(r),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:t,parent:i,inject:c};if(2==e&&r&&(s=l.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:t,parent:i,wrap:s};if(i&&l.matchType(i.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=H(t,e);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new o.p2(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),0))}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=H(t,e);if(i.childCount<=1&&e>0){let r=t.size-e<=e+i.size;this.unplaced=new o.p2(D(t,e-1,1),e-1,r?e-1:n)}else this.unplaced=new o.p2(D(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:r}){for(;this.depth>e;)this.closeFrontierNode();if(r)for(let t=0;t1||0==l||t.content.size)&&(u=e,d.push(L(t.mark(h.allowedMarks(t.marks)),1==c?l:0,c==a.childCount?p:-1)))}let f=c==a.childCount;f||(p=-1),this.placed=P(this.placed,e,o.HY.from(d)),this.frontier[e].match=u,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=a;t1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:o}=this.frontier[e],i=e=0;n--){let{match:e,type:o}=this.frontier[n],i=_(t,n,o,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:r,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=P(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),o=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,o)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=P(this.placed,this.depth,o.HY.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(o.HY.empty,!0);t.childCount&&(this.placed=P(this.placed,this.frontier.length,t))}}function D(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(D(t.firstChild.content,e-1,n)))}function P(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(P(t.lastChild.content,e-1,n)))}function H(t,e){for(let n=0;n1&&(i=i.replaceChild(0,L(i.firstChild,e-1,1==i.childCount?n-1:0))),e>0&&(i=t.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(o.HY.empty,!0)))),t.copy(i)}function _(t,e,n,o,i){let r=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==r.childCount&&!n.compatibleContent(r.type))return null;let a=o.fillBefore(r.content,!0,s);return a&&!function(t,e,n){for(let o=n;oi){let e=r.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(o.HY.empty,!0))}return t}function z(t,e){let n=[];for(let o=Math.min(t.depth,e.depth);o>=0;o--){let i=t.start(o);if(ie.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class $ extends d{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return u.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return u.fromReplace(t,this.pos,this.pos+1,new o.p2(o.HY.from(i),0,e.isLeaf?0:1))}getMap(){return a.empty}invert(t){return new $(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new $(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new $(e.pos,e.attr,e.value)}}d.jsonID("attr",$);let B=class extends Error{};B=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(B.prototype=Object.create(Error.prototype)).constructor=B,B.prototype.name="TransformError";class F{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new l}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new B(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=o.p2.empty){let i=N(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new o.p2(o.HY.from(n),0,0))}delete(t,e){return this.replace(t,e,o.p2.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let r=t.doc.resolve(e),s=t.doc.resolve(n);if(E(r,s,i))return t.step(new b(e,n,i));let a=z(r,t.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(r.depth+1);a.unshift(l);for(let t=r.depth,e=r.pos-1;t>0;t--,e--){let n=r.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(t)>-1?l=t:r.before(t)==e&&a.splice(1,0,-t)}let c=a.indexOf(l),d=[],u=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(d.push(n),e==i.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){let e=d[t],n=(h=e.type).spec.defining||h.spec.definingForContent;if(n&&!e.sameMarkup(r.node(Math.abs(l)-1)))u=t;else if(n||!e.type.isTextblock)break}var h;for(let e=i.openStart;e>=0;e--){let l=(e+u+1)%(i.openStart+1),h=d[l];if(h)for(let e=0;e=0&&(t.replace(e,n,i),!(t.steps.length>p));o--){let t=a[o];t<0||(e=r.before(t),n=s.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let o=t.resolve(e);if(o.parent.canReplaceWith(o.index(),o.index(),n))return e;if(0==o.parentOffset)for(let t=o.depth-1;t>=0;t--){let e=o.index(t);if(o.node(t).canReplaceWith(e,e,n))return o.before(t+1);if(e>0)return null}if(o.parentOffset==o.parent.content.size)for(let t=o.depth-1;t>=0;t--){let e=o.indexAfter(t);if(o.node(t).canReplaceWith(e,e,n))return o.after(t+1);if(e0&&(s||o.node(n-1).canReplace(o.index(n-1),i.indexAfter(n-1))))return t.delete(o.before(n),i.after(n))}for(let r=1;r<=o.depth&&r<=i.depth;r++)if(e-o.start(r)==o.depth-r&&n>o.end(r)&&i.end(r)-n!=i.depth-r)return t.delete(o.before(r),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:i,$to:r,depth:s}=e,a=i.before(s+1),l=r.after(s+1),c=a,d=l,u=o.HY.empty,h=0;for(let t=s,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,u=o.HY.from(i.node(t).copy(u)),h++):c--;let p=o.HY.empty,f=0;for(let t=s,e=!1;t>n;t--)e||r.after(t+1)=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=o.HY.from(n[t].type.create(n[t].attrs,i))}let r=e.start,s=e.end;t.step(new v(r,s,r,s,new o.p2(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return function(t,e,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(i,r)&&function(t,e,n){let o=t.resolve(e),i=o.index();return o.parent.canReplaceWith(i,i+1,n)}(t.doc,t.mapping.slice(s).map(n),i)){t.clearIncompatible(t.mapping.slice(s).map(n,1),i);let a=t.mapping.slice(s),l=a.map(n,1),c=a.map(n+e.nodeSize,1);return t.step(new v(l,c,l+1,c-1,new o.p2(o.HY.from(i.create(r,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return function(t,e,n,i,r){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(i,null,r||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new v(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new o.p2(o.HY.from(a),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new $(t,e,n)),this}addNodeMark(t,e){return this.step(new m(t,e)),this}removeNodeMark(t,e){if(!(e instanceof o.vc)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new g(t,e)),this}split(t,e=1,n){return function(t,e,n=1,i){let r=t.doc.resolve(e),s=o.HY.empty,a=o.HY.empty;for(let t=r.depth,e=r.depth-n,l=n-1;t>e;t--,l--){s=o.HY.from(r.node(t).copy(s));let e=i&&i[l];a=o.HY.from(e?e.type.create(e.attrs,a):r.node(t).copy(a))}t.step(new b(e,e,new o.p2(s.append(a),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,o){let i,r,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let d=t.marks;if(!o.isInSet(d)&&c.type.allowsMarkType(o.type)){let c=Math.max(l,e),u=Math.min(l+t.nodeSize,n),h=o.addToSet(d);for(let t=0;tt.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,i){let r=[],s=0;t.doc.nodesBetween(e,n,((t,a)=>{if(!t.isInline)return;s++;let l=null;if(i instanceof o.ZU){let e,n=t.marks;for(;e=i.isInSet(n);)(l||(l=[])).push(e),n=e.removeFromSet(n)}else i?i.isInSet(t.marks)&&(l=[i]):l=t.marks;if(l&&l.length){let o=Math.min(a+t.nodeSize,n);for(let t=0;tt.step(new f(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,i=n.contentMatch){let r=t.doc.nodeAt(e),s=[],a=e+1;for(let e=0;e=0;e--)t.step(s[e])}(this,t,e,n),this}}},43594:(t,e,n)=>{n.d(e,{p:()=>Le,EH:()=>ze,tk:()=>sn});var o=n(62463),i=n(27439),r=n(38480);const s=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},a=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let l=null;const c=function(t,e,n){let o=l||(l=document.createRange());return o.setEnd(t,null==n?t.nodeValue.length:n),o.setStart(t,e||0),o},d=function(t,e,n,o){return n&&(h(t,e,n,o,-1)||h(t,e,n,o,1))},u=/^(img|br|input|textarea|hr)$/i;function h(t,e,n,o,i){for(;;){if(t==n&&e==o)return!0;if(e==(i<0?0:p(t))){let n=t.parentNode;if(!n||1!=n.nodeType||f(t)||u.test(t.nodeName)||"false"==t.contentEditable)return!1;e=s(t)+(i<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?p(t):0}}}function p(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function f(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const m=function(t){return t.focusNode&&d(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function g(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const b="undefined"!=typeof navigator?navigator:null,v="undefined"!=typeof document?document:null,y=b&&b.userAgent||"",w=/Edge\/(\d+)/.exec(y),k=/MSIE \d/.exec(y),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(y),C=!!(k||x||w),M=k?document.documentMode:x?+x[1]:w?+w[1]:0,S=!C&&/gecko\/(\d+)/i.test(y);S&&(/Firefox\/(\d+)/.exec(y)||[0,0])[1];const A=!C&&/Chrome\/(\d+)/.exec(y),O=!!A,T=A?+A[1]:0,N=!C&&!!b&&/Apple Computer/.test(b.vendor),E=N&&(/Mobile\/\w+/.test(y)||!!b&&b.maxTouchPoints>2),I=E||!!b&&/Mac/.test(b.platform),D=!!b&&/Win/.test(b.platform),P=/Android \d/.test(y),H=!!v&&"webkitFontSmoothing"in v.documentElement.style,L=H?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function R(t,e){return"number"==typeof t?t:t[e]}function z(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function $(t,e,n){let o=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,r=t.dom.ownerDocument;for(let s=n||t.dom;s;s=a(s)){if(1!=s.nodeType)continue;let t=s,n=t==r.body,a=n?_(r):z(t),l=0,c=0;if(e.topa.bottom-R(o,"bottom")&&(c=e.bottom-e.top>a.bottom-a.top?e.top+R(i,"top")-a.top:e.bottom-a.bottom+R(i,"bottom")),e.lefta.right-R(o,"right")&&(l=e.right-a.right+R(i,"right")),l||c)if(n)r.defaultView.scrollBy(l,c);else{let n=t.scrollLeft,o=t.scrollTop;c&&(t.scrollTop+=c),l&&(t.scrollLeft+=l);let i=t.scrollLeft-n,r=t.scrollTop-o;e={left:e.left-i,top:e.top-r,right:e.right-i,bottom:e.bottom-r}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function B(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=a(o));return e}function F(t,e){for(let n=0;n=d){l=Math.max(p.bottom,l),d=Math.min(p.top,d);let t=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!i&&p.left<=e.left&&p.right>=e.left&&(i=u,r={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(a=h+1)}}return!n&&i&&(n=i,o=r,s=0),n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,o=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,o):!n||s&&1==n.nodeType?{node:t,offset:a}:Z(n,o)}function Y(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function j(t,e,n){let o=t.childNodes.length;if(o&&n.tope.top&&i++}n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(t,e,n,o){let i=-1;for(let n=e,r=!1;n!=t.dom;){let e=t.docView.nearestDesc(n,!0);if(!e)return null;if(1==e.dom.nodeType&&(e.node.isBlock&&e.parent&&!r||!e.contentDOM)){let t=e.dom.getBoundingClientRect();if(e.node.isBlock&&e.parent&&!r&&(r=!0,t.left>o.left||t.top>o.top?i=e.posBefore:(t.right-1?i:t.docView.posFromDOM(e,n,-1)}(t,n,i,e))}null==s&&(s=function(t,e,n){let{node:o,offset:i}=Z(e,n),r=-1;if(1==o.nodeType&&!o.firstChild){let t=o.getBoundingClientRect();r=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(o,i,r)}(t,l,e));let c=t.docView.nearestDesc(l,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function V(t){return t.top=0&&i==o.nodeValue.length?(t--,r=1):n<0?t--:e++,K(U(c(o,t,e),r),r<0)}{let t=U(c(o,i,i),n);if(S&&i&&/\s/.test(o.nodeValue[i-1])&&i=0)}if(null==r&&i&&(n<0||i==p(o))){let t=o.childNodes[i-1],e=3==t.nodeType?c(t,p(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return K(U(e,1),!1)}if(null==r&&i=0)}function K(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function G(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function X(t,e,n){let o=t.state,i=t.root.activeElement;o!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),i!=t.dom&&i&&i.focus()}}const tt=/[\u0590-\u08ac]/;let et=null,nt=null,ot=!1;class it{constructor(t,e,n,o){this.parent=t,this.children=e,this.dom=n,this.contentDOM=o,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;es(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){o=!1;break}if(e.previousSibling)break}if(null==o&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){o=!0;break}if(e.nextSibling)break}}return(null==o?n>0:o)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,o=t;o;o=o.parentNode){let i,r=this.getDesc(o);if(r&&(!e||r.node)){if(!n||!(i=r.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return r;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let t=e;t;t=t.parent)if(t==this)return e}posFromDOM(t,e,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;et||i instanceof ut){o=t-e;break}e=r}if(o)return this.children[n].domFromPos(o-this.children[n].border,e);for(let t;n&&!(t=this.children[n-1]).size&&t instanceof rt&&t.side>=0;n--);if(e<=0){let t,o=!0;for(;t=n?this.children[n-1]:null,t&&t.dom.parentNode!=this.contentDOM;n--,o=!1);return t&&e&&o&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?s(t.dom)+1:0}}{let t,o=!0;for(;t=n=i&&e<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,i);t=r;for(let e=a;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){o=s(n.dom)+1;break}t-=n.size}-1==o&&(o=0)}if(o>-1&&(l>e||a==this.children.length-1)){e=l;for(let t=a+1;ta&&re){let t=a;a=l,l=t}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,o=0;o=n:tn){let o=n+i.border,s=r-i.border;if(t>=o&&e<=s)return this.dirty=t==n||e==r?2:1,void(t!=o||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-o,e-o):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=r}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:o))),!e.type.spec.raw){if(1!=r.nodeType){let t=document.createElement("span");t.appendChild(r),r=t}r.contentEditable="false",r.classList.add("ProseMirror-widget")}super(t,[],r,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class st extends it{constructor(t,e,n,o){super(t,[],e,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class at extends it{constructor(t,e,n,o){super(t,[],n,o),this.mark=e}static create(t,e,n,o){let r=o.nodeViews[e.type.name],s=r&&r(e,o,n);return s&&s.dom||(s=i.PW.renderSpec(document,e.type.spec.toDOM(e,n))),new at(t,e,s.dom,s.contentDOM||s.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(i=Mt(i,0,t,n));for(let t=0;ta?a.parent?a.parent.posBeforeChild(a):void 0:s),n,o),d=c&&c.dom,u=c&&c.contentDOM;if(e.isText)if(d){if(3!=d.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(e.text);else d||({dom:d,contentDOM:u}=i.PW.renderSpec(document,e.type.spec.toDOM(e)));u||e.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),e.type.spec.draggable&&(d.draggable=!0));let h=d;return d=yt(d,n,e),c?a=new ht(t,e,n,o,d,u||null,h,c,r,s+1):e.isText?new dt(t,e,n,o,d,h,r):new lt(t,e,n,o,d,u||null,h,r,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>i.HY.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&wt(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,o=e,r=t.composing?this.localCompositionInfo(t,e):null,s=r&&r.pos>-1?r:null,a=r&&r.pos<0,l=new xt(this,s&&s.node,t);!function(t,e,n,o){let i=e.locals(t),r=0;if(0==i.length){for(let n=0;nr;)a.push(i[s++]);let f=r+h.nodeSize;if(h.isText){let t=f;s!t.inline)):a.slice(),e.forChild(r,h),p),r=f}}(this.node,this.innerDeco,((e,r,s)=>{e.spec.marks?l.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!s&&l.syncToMarks(r==this.node.childCount?i.vc.none:this.node.child(r).marks,n,t),l.placeWidget(e,t,o)}),((e,i,s,c)=>{let d;l.syncToMarks(e.marks,n,t),l.findNodeMatch(e,i,s,c)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(e,i,s,d,t)||l.updateNextNode(e,i,s,t,c,o)||l.addNode(e,i,s,t,o),o+=e.nodeSize})),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),pt(this.contentDOM,this.children,t),E&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:i}=t.state.selection;if(!(t.state.selection instanceof o.Bs)||ne+this.node.content.size)return null;let r=t.domSelectionRange(),s=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=p(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){let t=a=0&&t+e.length+a>=n)return a+t;if(n==o&&l.length>=o+e.length-a&&l.slice(o-a,o-a+e.length)==e)return o}}return-1}(this.node.content,t,n-e,i-e);return o<0?null:{node:s,pos:o,text:t}}return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:o}){if(this.getDesc(e))return;let i=e;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let r=new st(this,i,e,o);t.input.compositionNodes.push(r),this.children=Mt(this.children,n,n+o.length,t,r)}update(t,e,n,o){return!(3==this.dirty||!t.sameMarkup(this.node)||(this.updateInner(t,e,n,o),0))}updateInner(t,e,n,o){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(wt(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=bt(this.dom,this.nodeDOM,gt(this.outerDeco,this.node,e),gt(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ct(t,e,n,o,i){yt(o,e,t);let r=new lt(void 0,t,e,n,o,o,o,i,0);return r.contentDOM&&r.updateChildren(i,0),r}class dt extends lt{constructor(t,e,n,o,i,r,s){super(t,e,n,o,i,null,r,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,o){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node)||(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=0,0))}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let o=this.node.cut(t,e),i=document.createTextNode(o.text);return new dt(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class ut extends it{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ht extends lt{constructor(t,e,n,o,i,r,s,a,l,c){super(t,e,n,o,i,r,s,l,c),this.spec=a}update(t,e,n,o){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,o),i}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,o){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function pt(t,e,n){let o=t.firstChild,i=!1;for(let r=0;r0;){let a;for(;;)if(o){let t=n.children[o-1];if(!(t instanceof at)){a=t,o--;break}n=t,o=t.children.length}else{if(n==e)break t;o=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,r.set(a,i),s.push(a)}}return{index:i,matched:r,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n>1,r=Math.min(i,t.length);for(;o-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let o=at.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,o),this.top=o,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,o){let i,r=-1;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))r=this.top.children.indexOf(i,this.index);else for(let o=this.index,i=Math.min(this.top.children.length,o+5);o=n||d<=e?r.push(l):(cn&&r.push(l.slice(n-c,l.size,o)))}return r}function St(t,e=null){let n=t.domSelectionRange(),i=t.state.doc;if(!n.focusNode)return null;let r=t.docView.nearestDesc(n.focusNode),a=r&&0==r.size,l=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c,d,u=i.resolve(l);if(m(n)){for(c=u;r&&!r.node;)r=r.parent;let t=r.node;if(r&&t.isAtom&&o.qv.isSelectable(t)&&r.parent&&(!t.isInline||!function(t,e,n){for(let o=0==e,i=e==p(t);o||i;){if(t==n)return!0;let e=s(t);if(!(t=t.parentNode))return!1;o=o&&0==e,i=i&&e==p(t)}}(n.focusNode,n.focusOffset,r.dom))){let t=r.posBefore;d=new o.qv(l==t?u:i.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;c=i.resolve(e)}return d||(d=Ht(t,c,u,"pointer"==e||t.state.selection.head{n.anchorNode==o&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{At(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Tt=N||O&&T<63;function Nt(t,e){let{node:n,offset:o}=t.docView.domFromPos(e,0),i=oo(t,e,n)))||o.Bs.between(e,n,i)}function Lt(t){return!(t.editable&&!t.hasFocus())&&_t(t)}function _t(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Rt(t,e){let{$anchor:n,$head:i}=t.selection,r=e>0?n.max(i):n.min(i),s=r.parent.inlineContent?r.depth?t.doc.resolve(e>0?r.after():r.before()):null:r;return s&&o.Y1.findFrom(s,e)}function zt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function $t(t,e,n){let i=t.state.selection;if(!(i instanceof o.Bs)){if(i instanceof o.qv&&i.node.isInline)return zt(t,new o.Bs(e>0?i.$to:i.$from));{let n=Rt(t.state,e);return!!n&&zt(t,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=Rt(t.state,e);return!!(n&&n instanceof o.qv)&&zt(t,n)}if(!(I&&n.indexOf("m")>-1)){let n,r=i.$head,s=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter;if(!s||s.isText)return!1;let a=e<0?r.pos-s.nodeSize:r.pos;return!!(s.isAtom||(n=t.docView.descAt(a))&&!n.contentDOM)&&(o.qv.isSelectable(s)?zt(t,new o.qv(e<0?t.state.doc.resolve(r.pos-s.nodeSize):r)):!!H&&zt(t,new o.Bs(t.state.doc.resolve(e<0?a:a+s.nodeSize))))}}function Bt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ft(t,e){if("false"==t.contentEditable)return!0;let n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function Jt(t,e){return e<0?function(t){let e=t.domSelectionRange(),n=e.focusNode,o=e.focusOffset;if(!n)return;let i,r,a=!1;for(S&&1==n.nodeType&&o0){if(1!=n.nodeType)break;{let t=n.childNodes[o-1];if(Ft(t,-1))i=n,r=--o;else{if(3!=t.nodeType)break;n=t,o=n.nodeValue.length}}}else{if(Zt(n))break;{let e=n.previousSibling;for(;e&&Ft(e,-1);)i=n.parentNode,r=s(e),e=e.previousSibling;if(e)n=e,o=Bt(n);else{if(n=n.parentNode,n==t.dom)break;o=0}}}a?Yt(t,n,o):i&&Yt(t,i,r)}(t):function(t){let e=t.domSelectionRange(),n=e.focusNode,o=e.focusOffset;if(!n)return;let i,r,a=Bt(n);for(;;)if(o{t.state==i&&Ot(t)}),50)}function jt(t,e){let n=t.state.doc.resolve(e);if(!O&&!D&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),i=(n.top+n.bottom)/2;if(i>o.top&&i1)return n.lefto.top&&i1)return n.left>o.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function qt(t,e,n){let i=t.state.selection;if(i instanceof o.Bs&&!i.empty||n.indexOf("s")>-1)return!1;if(I&&n.indexOf("m")>-1)return!1;let{$from:r,$to:s}=i;if(!r.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Rt(t.state,e);if(n&&n instanceof o.qv)return zt(t,n)}if(!r.parent.inlineContent){let n=e<0?r:s,a=i instanceof o.C1?o.Y1.near(n,e):o.Y1.findFrom(n,e);return!!a&&zt(t,a)}return!1}function Vt(t,e){if(!(t.state.selection instanceof o.Bs))return!0;let{$head:n,$anchor:i,empty:r}=t.state.selection;if(!n.sameParent(i))return!0;if(!r)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function Ut(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Wt(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:o,openStart:r,openEnd:s}=e;for(;r>1&&s>1&&1==o.childCount&&1==o.firstChild.childCount;){r--,s--;let t=o.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),o=t.content}let a=t.someProp("clipboardSerializer")||i.PW.fromSchema(t.state.schema),l=re(),c=l.createElement("div");c.appendChild(a.serializeFragment(o,{document:l}));let d,u=c.firstChild,h=0;for(;u&&1==u.nodeType&&(d=oe[u.nodeName.toLowerCase()]);){for(let t=d.length-1;t>=0;t--){let e=l.createElement(d[t]);for(;c.firstChild;)e.appendChild(c.firstChild);c.appendChild(e),h++}u=c.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${r} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:c,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function Qt(t,e,n,o,r){let s,a,l=r.parent.type.spec.code;if(!n&&!e)return null;let c=e&&(o||l||!n);if(c){if(t.someProp("transformPastedText",(n=>{e=n(e,l||o,t)})),l)return e?new i.p2(i.HY.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):i.p2.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,r,o,t)));if(n)a=n;else{let n=r.marks(),{schema:o}=t.state,a=i.PW.fromSchema(o);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=s.appendChild(document.createElement("p"));t&&e.appendChild(a.serializeNode(o.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),s=function(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,o=re().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);if((n=i&&oe[i[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"")).reverse().join("")),o.innerHTML=t,n)for(let t=0;t0;t--){let t=s.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;s=t}if(!a){let e=t.someProp("clipboardParser")||t.someProp("domParser")||i.aw.fromSchema(t.state.schema);a=e.parseSlice(s,{preserveWhitespace:!(!c&&!u),context:r,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Kt.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)a=function(t,e){if(!t.size)return t;let n,o=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:r,openStart:s,openEnd:a}=t;for(let t=n.length-2;t>=0;t-=2){let e=o.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;r=i.HY.from(e.create(n[t+1],r)),s++,a++}return new i.p2(r,s,a)}(ne(a,+u[1],+u[2]),u[4]);else if(a=i.p2.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o,r=e.node(n).contentMatchAt(e.index(n)),s=[];if(t.forEach((t=>{if(!s)return;let e,n=r.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&o.length&&Xt(n,o,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=te(s[s.length-1],o.length));let e=Gt(t,n);s.push(e),r=r.matchType(e.type),o=n}})),s)return i.HY.from(s)}return t}(a.content,r),!0),a.openStart||a.openEnd){let t=0,e=0;for(let e=a.content.firstChild;t{a=e(a,t)})),a}const Kt=/^(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 Gt(t,e,n=0){for(let o=e.length-1;o>=n;o--)t=e[o].create(null,i.HY.from(t));return t}function Xt(t,e,n,o,r){if(r1&&(s=0),r=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=r).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(i.HY.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function ne(t,e,n){return e{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>he(t,e))}))}function he(t,e){return t.someProp("handleDOMEvents",(n=>{let o=n[e.type];return!!o&&(o(t,e)||e.defaultPrevented)}))}function pe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function fe(t){return{left:t.clientX,top:t.clientY}}function me(t,e,n,o,i){if(-1==o)return!1;let r=t.state.doc.resolve(o);for(let o=r.depth+1;o>0;o--)if(t.someProp(e,(e=>o>r.depth?e(t,n,r.nodeAfter,r.before(o),i,!0):e(t,n,r.node(o),r.before(o),i,!1))))return!0;return!1}function ge(t,e,n){t.focused||t.focus();let o=t.state.tr.setSelection(e);"pointer"==n&&o.setMeta("pointer",!0),t.dispatch(o)}function be(t,e,n,o){return me(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",(n=>n(t,e,o)))}function ve(t,e,n,i){return me(t,"handleTripleClickOn",e,n,i)||t.someProp("handleTripleClick",(n=>n(t,e,i)))||function(t,e,n){if(0!=n.button)return!1;let i=t.state.doc;if(-1==e)return!!i.inlineContent&&(ge(t,o.Bs.create(i,0,i.content.size),"pointer"),!0);let r=i.resolve(e);for(let e=r.depth+1;e>0;e--){let n=e>r.depth?r.nodeAfter:r.node(e),s=r.before(e);if(n.inlineContent)ge(t,o.Bs.create(i,s+1,s+1+n.content.size),"pointer");else{if(!o.qv.isSelectable(n))continue;ge(t,o.qv.create(i,s),"pointer")}return!0}}(t,n,i)}function ye(t){return Ae(t)}ae.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!xe(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!P||!O||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!E||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||function(t,e){let n=e.keyCode,o=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==n||I&&72==n&&"c"==o)return Vt(t,-1)||Jt(t,-1);if(46==n&&!e.shiftKey||I&&68==n&&"c"==o)return Vt(t,1)||Jt(t,1);if(13==n||27==n)return!0;if(37==n||I&&66==n&&"c"==o){let e=37==n?"ltr"==jt(t,t.state.selection.from)?-1:1:-1;return $t(t,e,o)||Jt(t,e)}if(39==n||I&&70==n&&"c"==o){let e=39==n?"ltr"==jt(t,t.state.selection.from)?1:-1:1;return $t(t,e,o)||Jt(t,e)}return 38==n||I&&80==n&&"c"==o?qt(t,-1,o)||Jt(t,-1):40==n||I&&78==n&&"c"==o?function(t){if(!N||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Ut(t,n,"true"),setTimeout((()=>Ut(t,n,"false")),20)}return!1}(t)||qt(t,1,o)||Jt(t,1):o==(I?"m":"c")&&(66==n||73==n||89==n||90==n)}(t,n)?n.preventDefault():de(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,g(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},ae.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},ae.keypress=(t,e)=>{let n=e;if(xe(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||I&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let i=t.state.selection;if(!(i instanceof o.Bs&&i.$from.sameParent(i.$to))){let e=String.fromCharCode(n.charCode);/[\r\n]/.test(e)||t.someProp("handleTextInput",(n=>n(t,i.$from.pos,i.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const we=I?"metaKey":"ctrlKey";se.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let o=ye(t),i=Date.now(),r="singleClick";i-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,o=e.y-t.clientY;return n*n+o*o<100}(n,t.input.lastClick)&&!n[we]&&("singleClick"==t.input.lastClick.type?r="doubleClick":"doubleClick"==t.input.lastClick.type&&(r="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:r};let s=t.posAtCoords(fe(n));s&&("singleClick"==r?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ke(t,s,n,!!o)):("doubleClick"==r?be:ve)(t,s.pos,s.inside,n)?n.preventDefault():de(t,"pointer"))};class ke{constructor(t,e,n,i){let r,s;if(this.view=t,this.pos=e,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[we],this.allowDefault=n.shiftKey,e.inside>-1)r=t.state.doc.nodeAt(e.inside),s=e.inside;else{let n=t.state.doc.resolve(e.pos);r=n.parent,s=n.depth?n.before():0}const a=i?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(0==n.button&&r.type.spec.draggable&&!1!==r.type.spec.selectable||c instanceof o.qv&&c.from<=s&&c.to>s)&&(this.mightDrag={node:r,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!S||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),de(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Ot(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(fe(t))),this.updateAllowDefault(t),this.allowDefault||!e?de(this.view,"pointer"):function(t,e,n,i,r){return me(t,"handleClickOn",e,n,i)||t.someProp("handleClick",(n=>n(t,e,i)))||(r?function(t,e){if(-1==e)return!1;let n,i,r=t.state.selection;r instanceof o.qv&&(n=r.node);let s=t.state.doc.resolve(e);for(let t=s.depth+1;t>0;t--){let e=t>s.depth?s.nodeAfter:s.node(t);if(o.qv.isSelectable(e)){i=n&&r.$from.depth>0&&t>=r.$from.depth&&s.before(r.$from.depth+1)==r.$from.pos?s.before(r.$from.depth):s.before(t);break}}return null!=i&&(ge(t,o.qv.create(t.state.doc,i),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),i=n.nodeAfter;return!!(i&&i.isAtom&&o.qv.isSelectable(i))&&(ge(t,new o.qv(n),"pointer"),!0)}(t,n))}(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||N&&this.mightDrag&&!this.mightDrag.node.isAtom||O&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(ge(this.view,o.Y1.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):de(this.view,"pointer")}move(t){this.updateAllowDefault(t),de(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function xe(t,e){return!!t.composing||!!(N&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}se.touchstart=t=>{t.input.lastTouch=Date.now(),ye(t),de(t,"pointer")},se.touchmove=t=>{t.input.lastTouch=Date.now(),de(t,"pointer")},se.contextmenu=t=>ye(t);const Ce=P?5e3:-1;function Me(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Ae(t)),e))}function Se(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Ae(t,e=!1){if(!(P&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Se(t),e||t.docView&&t.docView.dirty){let e=St(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}ae.compositionstart=ae.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Ae(t,!0),t.markCursor=null;else if(Ae(t),S&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,o=e.focusOffset;n&&1==n.nodeType&&0!=o;){let e=o<0?n.lastChild:n.childNodes[o-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,o=-1}}t.input.composing=!0}Me(t,Ce)},ae.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionPendingChanges&&Promise.resolve().then((()=>t.domObserver.flush())),t.input.compositionID++,Me(t,20))};const Oe=C&&M<15||E&&L<604;function Te(t,e,n,o,r){let s=Qt(t,e,n,o,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,s||i.p2.empty))))return!0;if(!s)return!1;let a=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(s),l=a?t.state.tr.replaceSelectionWith(a,o):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}se.copy=ae.cut=(t,e)=>{let n=e,o=t.state.selection,i="cut"==n.type;if(o.empty)return;let r=Oe?null:n.clipboardData,s=o.content(),{dom:a,text:l}=Wt(t,s);r?(n.preventDefault(),r.clearData(),r.setData("text/html",a.innerHTML),r.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let o=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),o.removeAllRanges(),o.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ae.paste=(t,e)=>{let n=e;if(t.composing&&!P)return;let o=Oe?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;o&&Te(t,o.getData("text/plain"),o.getData("text/html"),i,n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,o=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus();let i=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout((()=>{t.focus(),o.parentNode&&o.parentNode.removeChild(o),n?Te(t,o.value,null,i,e):Te(t,o.textContent,o.innerHTML,i,e)}),50)}(t,n)};class Ne{constructor(t,e){this.slice=t,this.move=e}}const Ee=I?"altKey":"ctrlKey";se.dragstart=(t,e)=>{let n=e,i=t.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=t.state.selection,s=r.empty?null:t.posAtCoords(fe(n));if(s&&s.pos>=r.from&&s.pos<=(r instanceof o.qv?r.to-1:r.to));else if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(o.qv.create(t.state.doc,i.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(o.qv.create(t.state.doc,e.posBefore)))}let a=t.state.selection.content(),{dom:l,text:c}=Wt(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Oe?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Oe||n.dataTransfer.setData("text/plain",c),t.dragging=new Ne(a,!n[Ee])},se.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},ae.dragover=ae.dragenter=(t,e)=>e.preventDefault(),ae.drop=(t,e)=>{let n=e,s=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let a=t.posAtCoords(fe(n));if(!a)return;let l=t.state.doc.resolve(a.pos),c=s&&s.slice;c?t.someProp("transformPasted",(e=>{c=e(c,t)})):c=Qt(t,n.dataTransfer.getData(Oe?"Text":"text/plain"),Oe?null:n.dataTransfer.getData("text/html"),!1,l);let d=!(!s||n[Ee]);if(t.someProp("handleDrop",(e=>e(t,n,c||i.p2.empty,d))))return void n.preventDefault();if(!c)return;n.preventDefault();let u=c?(0,r.nj)(t.state.doc,l.pos,c):l.pos;null==u&&(u=l.pos);let h=t.state.tr;d&&h.deleteSelection();let p=h.mapping.map(u),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,m=h.doc;if(f?h.replaceRangeWith(p,p,c.content.firstChild):h.replaceRange(p,p,c),h.doc.eq(m))return;let g=h.doc.resolve(p);if(f&&o.qv.isSelectable(c.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(c.content.firstChild))h.setSelection(new o.qv(g));else{let e=h.mapping.map(u);h.mapping.maps[h.mapping.maps.length-1].forEach(((t,n,o,i)=>e=i)),h.setSelection(Ht(t,g,h.doc.resolve(e)))}t.focus(),t.dispatch(h.setMeta("uiEvent","drop"))},se.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ot(t)}),20))},se.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},se.beforeinput=(t,e)=>{if(O&&P&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,g(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in ae)se[t]=ae[t];function Ie(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class De{constructor(t,e){this.toDOM=t,this.spec=e||Re,this.side=this.spec.side||0}map(t,e,n,o){let{pos:i,deleted:r}=t.mapResult(e.from+o,this.side<0?-1:1);return r?null:new Le(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof De&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ie(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Pe{constructor(t,e){this.attrs=t,this.spec=e||Re}map(t,e,n,o){let i=t.map(e.from+o,this.spec.inclusiveStart?-1:1)-n,r=t.map(e.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=r?null:new Le(i,r,this)}valid(t,e){return e.from=t&&(!i||i(s.spec))&&n.push(s.copy(s.from+o,s.to+o))}for(let r=0;rt){let s=this.children[r]+1;this.children[r+2].findInner(t-s,e-s,n,o+s,i)}}map(t,e,n){return this==$e||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Re)}mapInner(t,e,n,o,i){let r;for(let s=0;s{let l=s-r-(n-t);for(let s=0;sc+e-o)continue;let d=a[s]+e-o;n>=d?a[s+1]=t<=d?-2:-1:r>=i&&l&&(a[s]+=l,a[s+1]+=l)}o+=l})),e=n.maps[t].map(e,-1)}let l=!1;for(let e=0;e=o.content.size){l=!0;continue}let u=n.map(t[e+1]+r,-1)-i,{index:h,offset:p}=o.content.findIndex(d),f=o.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let o=a[e+2].mapInner(n,f,c+1,t[e]+r+1,s);o!=$e?(a[e]=d,a[e+1]=u,a[e+2]=o):(a[e+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,o,i,r,s){function a(t,e){for(let r=0;r{let s,a=r+n;if(s=Je(e,t,a)){for(o||(o=this.children.slice());ir&&e.to=t){this.children[e]==t&&(n=this.children[e+2]);break}let i=t+1,r=i+e.content.size;for(let t=0;ti&&e.type instanceof Pe){let t=Math.max(i,e.from)-i,n=Math.min(r,e.to)-i;tn.map(t,e,Re)));return Be.from(n)}forChild(t,e){if(e.isLeaf)return ze.empty;let n=[];for(let o=0;ot instanceof ze))?t:t.reduce(((t,e)=>t.concat(e instanceof ze?e:e.members)),[]))}}}function Fe(t,e){if(!e||!t.length)return t;let n=[];for(let o=0;on&&e.to{let a=Je(t,e,s+n);if(a){r=!0;let t=Ye(a,e,n+s+1,o);t!=$e&&i.push(s,s+e.nodeSize,t)}}));let s=Fe(r?Ze(t):t,-n).sort(je);for(let t=0;t0;)e++;t.splice(e,0,n)}function Ue(t){let e=[];return t.someProp("decorations",(n=>{let o=n(t.state);o&&o!=$e&&e.push(o)})),t.cursorWrapper&&e.push(ze.create(t.state.doc,[t.cursorWrapper.deco])),Be.from(e)}const We={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Qe=C&&M<=11;class Ke{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Ge{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ke,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),Qe&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,We)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.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(Lt(this.view)){if(this.suppressingSelectionUpdates)return Ot(this.view);if(C&&M<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&d(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let e=t.focusNode;e;e=a(e))n.add(e);for(let o=t.anchorNode;o;o=a(o))if(n.has(o)){e=o;break}let o=e&&this.view.docView.nearestDesc(e);return o&&o.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Lt(t)&&!this.ignoreSelectionChange(n),r=-1,s=-1,a=!1,l=[];if(t.editable)for(let t=0;t1){let t=l.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}let c=null;r<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||i)&&(r>-1&&(t.docView.markDirty(r,s),function(t){if(!Xe.has(t)&&(Xe.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=S,tn)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."),tn=!0}}(t)),this.handleDOMChange(r,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Ot(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;ne.content.size?null:Ht(t,e.resolve(n.anchor),e.resolve(n.head))}function rn(t,e,n){let o=t.depth,i=e?t.end():t.pos;for(;o>0&&(e||t.indexAfter(o)==t.node(o).childCount);)o--,i++,e=!1;if(n){let e=t.node(o).maybeChild(t.indexAfter(o));for(;e&&!e.isLeaf;)e=e.firstChild,i++}return i}class sn{constructor(t,e){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 ce,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(un),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=cn(this),ln(this),this.nodeViews=dn(this),this.docView=ct(this.state.doc,an(this),Ue(this),this.dom,this),this.domObserver=new Ge(this,((t,e,n,r)=>function(t,e,n,r,s){let a=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=St(t,e);if(n&&!t.state.selection.eq(n)){if(O&&P&&13===t.input.lastKeyCode&&Date.now()-100e(t,g(13,"Enter")))))return;let o=t.state.tr.setSelection(n);"pointer"==e?o.setMeta("pointer",!0):"key"==e&&o.scrollIntoView(),a&&o.setMeta("composition",a),t.dispatch(o)}return}let l=t.state.doc.resolve(e),c=l.sharedDepth(n);e=l.before(c+1),n=t.state.doc.resolve(n).after(c+1);let d,u,h=t.state.selection,p=function(t,e,n){let o,{node:r,fromOffset:s,toOffset:a,from:l,to:c}=t.docView.parseRange(e,n),d=t.domSelectionRange(),u=d.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(o=[{node:u,offset:d.anchorOffset}],m(d)||o.push({node:d.focusNode,offset:d.focusOffset})),O&&8===t.input.lastKeyCode)for(let t=a;t>s;t--){let e=r.childNodes[t-1],n=e.pmViewDesc;if("BR"==e.nodeName&&!n){a=t;break}if(!n||n.size)break}let h=t.state.doc,p=t.someProp("domParser")||i.aw.fromSchema(t.state.schema),f=h.resolve(l),g=null,b=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:o,ruleFromNode:en,context:f});if(o&&null!=o[0].pos){let t=o[0].pos,e=o[1]&&o[1].pos;null==e&&(e=t),g={anchor:t+l,head:e+l}}return{doc:b,sel:g,from:l,to:c}}(t,e,n),f=t.state.doc,b=f.slice(p.from,p.to);8===t.input.lastKeyCode&&Date.now()-100=s?r-o:0,a=r+(a-s),s=r):a=a?r-o:0,s=r+(s-a),a=r),{start:r,endA:s,endB:a}}(b.content,p.doc.content,p.from,d,u);if((E&&t.input.lastIOSEnter>Date.now()-225||P)&&s.some((t=>1==t.nodeType&&!nn.test(t.nodeName)))&&(!v||v.endA>=v.endB)&&t.someProp("handleKeyDown",(e=>e(t,g(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!v){if(!(r&&h instanceof o.Bs&&!h.empty&&h.$head.sameParent(h.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let e=on(t,t.state.doc,p.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);a&&n.setMeta("composition",a),t.dispatch(n)}}return}v={start:h.from,endA:h.to,endB:h.to}}if(O&&t.cursorWrapper&&p.sel&&p.sel.anchor==t.cursorWrapper.deco.from&&p.sel.head==p.sel.anchor){let t=v.endB-v.start;p.sel={anchor:p.sel.anchor+t,head:p.sel.anchor+t}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&v.start<=t.state.selection.from+2&&t.state.selection.from>=p.from?v.start=t.state.selection.from:v.endA=t.state.selection.to-2&&t.state.selection.to<=p.to&&(v.endB+=t.state.selection.to-v.endA,v.endA=t.state.selection.to)),C&&M<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>p.from&&"  "==p.doc.textBetween(v.start-p.from-1,v.start-p.from+1)&&(v.start--,v.endA--,v.endB--);let y,w=p.doc.resolveNoCache(v.start-p.from),k=p.doc.resolveNoCache(v.endB-p.from),x=f.resolve(v.start),S=w.sameParent(k)&&w.parent.inlineContent&&x.end()>=v.endA;if((E&&t.input.lastIOSEnter>Date.now()-225&&(!S||s.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!S&&w.pose(t,g(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>v.start&&function(t,e,n,o,i){if(!o.parent.isTextblock||n-e<=i.pos-o.pos||rn(o,!0,!1)n||rn(s,!0,!1)e(t,g(8,"Backspace")))))return void(P&&O&&t.domObserver.suppressSelectionUpdates());O&&P&&v.endB==v.start&&(t.input.lastAndroidDelete=Date.now()),P&&!S&&w.start()!=k.start()&&0==k.parentOffset&&w.depth==k.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==v.endA&&(v.endB-=2,k=p.doc.resolveNoCache(v.endB-p.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,g(13,"Enter"))}))}),20));let A,T,N,I=v.start,D=v.endA;if(S)if(w.pos==k.pos)C&&M<=11&&0==w.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>Ot(t)),20)),A=t.state.tr.delete(I,D),T=f.resolve(v.start).marksAcross(f.resolve(v.endA));else if(v.endA==v.endB&&(N=function(t,e){let n,o,r,s=t.firstChild.marks,a=e.firstChild.marks,l=s,c=a;for(let t=0;tt.mark(o.addToSet(t.marks));else{if(0!=l.length||1!=c.length)return null;o=c[0],n="remove",r=t=>t.mark(o.removeFromSet(t.marks))}let d=[];for(let t=0;tn(t,I,D,e))))return;A=t.state.tr.insertText(e,I,D)}if(A||(A=t.state.tr.replace(I,D,p.doc.slice(v.start-p.from,v.endB-p.from))),p.sel){let e=on(t,A.doc,p.sel);e&&!(O&&P&&t.composing&&e.empty&&(v.start!=v.endB||t.input.lastAndroidDelete{!pe(t,e)||he(t,e)||!t.editable&&e.type in ae||n(t,e)},le[e]?{passive:!0}:void 0)}N&&t.dom.addEventListener("input",(()=>null)),ue(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ue(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(un),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let t in this._props)e[t]=this._props[t];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(Se(this),i=!0),this.state=t;let r=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(r||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=dn(this);(function(t,e){let n=0,o=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let t in e)o++;return n!=o})(t,this.nodeViews)&&(this.nodeViews=t,o=!0)}(r||e.handleDOMEvents!=this._props.handleDOMEvents)&&ue(this),this.editable=cn(this),ln(this);let s=Ue(this),a=an(this),l=n.plugins==t.plugins||n.doc.eq(t.doc)?t.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=o||!this.docView.matchesNode(t.doc,a,s);!c&&t.selection.eq(n.selection)||(i=!0);let u="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(t){let e,n,o=t.dom.getBoundingClientRect(),i=Math.max(0,o.top);for(let r=(o.left+o.right)/2,s=i+1;s=i-20){e=o,n=a.top;break}}return{refDOM:e,refTop:n,stack:B(t.dom)}}(this);if(i){this.domObserver.stop();let e=c&&(C||O)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(n.selection,t.selection);if(c){let n=O?this.trackWrites=this.domSelectionRange().focusNode:null;!o&&this.docView.update(t.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ct(t.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return d(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?Ot(this,e):(Dt(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():u&&function({refDOM:t,refTop:e,stack:n}){let o=t?t.getBoundingClientRect().top:0;F(n,0==o?0:o-e)}(u)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof o.qv){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&$(this,e.getBoundingClientRect(),t)}else $(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;et.ownerDocument.getSelection()),this._root=t;return t||document}posAtCoords(t){return q(this,t)}coordsAtPos(t,e=1){return Q(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let o=this.docView.posFromDOM(t,e,n);if(null==o)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,e){return function(t,e,n){return et==e&&nt==n?ot:(et=e,nt=n,ot="up"==n||"down"==n?function(t,e,n){let o=e.selection,i="up"==n?o.$from:o.$to;return X(t,e,(()=>{let{node:e}=t.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let o=Q(t,i.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=c(t,0,t.nodeValue.length).getClientRects()}for(let t=0;ti.top+1&&("up"==n?o.top-i.top>2*(i.bottom-o.top):i.bottom-o.bottom>2*(o.bottom-i.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){let{$head:o}=e.selection;if(!o.parent.isTextblock)return!1;let i=o.parentOffset,r=!i,s=i==o.parent.content.size,a=t.domSelection();return tt.test(o.parent.textContent)&&a.modify?X(t,e,(()=>{let{focusNode:e,focusOffset:i,anchorNode:r,anchorOffset:s}=t.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=o.depth?t.docView.domAfterPos(o.before()):t.dom,{focusNode:d,focusOffset:u}=t.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||e==d&&i==u;try{a.collapse(r,s),e&&(e!=r||i!=s)&&a.extend&&a.extend(e,i)}catch(t){}return null!=l&&(a.caretBidiLevel=l),h})):"left"==n||"backward"==n?r:s}(t,e,n))}(this,e||this.state,t)}pasteHTML(t,e){return Te(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Te(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ue(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){he(t,e)||!se[e.type]||!t.editable&&e.type in ae||se[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return N&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){let e;function n(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let o=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return d(a.node,a.offset,r,s)&&([o,i,r,s]=[r,s,o,i]),{anchorNode:o,anchorOffset:i,focusNode:r,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function an(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),e.translate||(e.translate="no"),[Le.node(0,t.state.doc.content.size,e)]}function ln(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Le.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function cn(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function dn(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function un(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}}}]); \ No newline at end of file diff --git a/7080.b3cc0188b4eea7f56942.js b/7080.b3cc0188b4eea7f56942.js new file mode 100644 index 000000000..bbfb6facb --- /dev/null +++ b/7080.b3cc0188b4eea7f56942.js @@ -0,0 +1 @@ +(self.webpackChunktui_editor=self.webpackChunktui_editor||[]).push([[7080],{13449:(t,e,n)=>{n.d(e,{h:()=>A});var o=n(74788),i=n(64642),r=n(1065),s=n(75747),a=n(16331),l=n(28986),c=n(99036),d=n(24751),u=n(65266),h=n(12057),p=n(32188),f=n(87624),m=n(38190),g=n(22545),b=n(91283),v=n(75526),y=n(19042),w=n(4642),x=n(45642);function k(t,e){if(1&t&&(o.TgZ(0,"button",7),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.hij(" ",t," ")}}function C(t,e){if(1&t&&(o.TgZ(0,"tui-data-list",5),o.YNc(1,k,2,2,"button",6),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngForOf",t.modes)}}function M(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tui-primitive-textfield",8),o.NdJ("valueChange",(function(e){return o.CHM(t),o.oxw().onHexChange(e)})),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("maskito",t.hexMask)("tuiTextfieldLabelOutside",!0)("value",t.hex)}}function S(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tui-input-count",9),o.NdJ("ngModelChange",(function(e){o.CHM(t);const n=o.oxw();return n.onRgbChange(e,n.color[1],n.color[2],n.color[3])})),o.qZA(),o.TgZ(1,"tui-input-count",9),o.NdJ("ngModelChange",(function(e){o.CHM(t);const n=o.oxw();return n.onRgbChange(n.color[0],e,n.color[2],n.color[3])})),o.qZA(),o.TgZ(2,"tui-input-count",9),o.NdJ("ngModelChange",(function(e){o.CHM(t);const n=o.oxw();return n.onRgbChange(n.color[0],n.color[1],e,n.color[3])})),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("hideButtons",!0)("max",255)("ngModel",t.color[0])("tuiTextfieldLabelOutside",!0),o.xp6(1),o.Q6J("hideButtons",!0)("max",255)("ngModel",t.color[1])("tuiTextfieldLabelOutside",!0),o.xp6(1),o.Q6J("hideButtons",!0)("max",255)("ngModel",t.color[2])("tuiTextfieldLabelOutside",!0)}}let A=(()=>{class t{constructor(){this.color=[0,0,0,1],this.colorChange=new o.vpe,this.hexMask={mask:new RegExp("^[A-F\\d]{0,6}$","gi")},this.modes=["HEX","RGB"],this.mode=this.modes[0]}get isHex(){return this.mode===this.modes[0]}get hex(){return(0,i.WSX)(this.color[0],this.color[1],this.color[2]).replace("#","")}get opacity(){return Math.round(100*this.color[3])}onHexChange(t){if(6!==t.length)return;const e=(0,i.ROF)(t);this.updateColor([e[0],e[1],e[2],this.color[3]])}onRgbChange(...t){this.updateColor(t)}updateColor(t){this.color=t,this.colorChange.emit(t)}}return t.ɵfac=function(e){return new(e||t)},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-color-edit"]],inputs:{color:"color"},outputs:{colorChange:"colorChange"},decls:6,vars:8,consts:[["tuiDropdownAlign","left","tuiDropdownLimitWidth","min","tuiTextfieldSize","m",1,"t-select","tui-group__auto-width-item",3,"tuiTextfieldLabelOutside","ngModel","ngModelChange"],["size","s",4,"tuiDataList"],["tuiTextfieldSize","m","tuiValueAccessor","",3,"maskito","tuiTextfieldLabelOutside","value","valueChange",4,"ngIf","ngIfElse"],["rgb",""],["tuiTextfieldPostfix","%","tuiTextfieldSize","m",1,"t-opacity","tui-group__auto-width-item",3,"hideButtons","max","ngModel","tuiTextfieldLabelOutside","ngModelChange"],["size","s"],["tuiOption","",3,"value",4,"ngFor","ngForOf"],["tuiOption","",3,"value"],["tuiTextfieldSize","m","tuiValueAccessor","",3,"maskito","tuiTextfieldLabelOutside","value","valueChange"],["tuiTextfieldSize","m",3,"hideButtons","max","ngModel","tuiTextfieldLabelOutside","ngModelChange"]],template:function(t,e){if(1&t&&(o.TgZ(0,"tui-select",0),o.NdJ("ngModelChange",(function(t){return e.mode=t})),o.YNc(1,C,2,1,"tui-data-list",1),o.qZA(),o.YNc(2,M,1,3,"tui-primitive-textfield",2),o.YNc(3,S,3,12,"ng-template",null,3,o.W1O),o.TgZ(5,"tui-input-count",4),o.NdJ("ngModelChange",(function(t){return e.onRgbChange(e.color[0],e.color[1],e.color[2],t/100)})),o.qZA()),2&t){const t=o.MAs(4);o.Q6J("tuiTextfieldLabelOutside",!0)("ngModel",e.mode),o.xp6(2),o.Q6J("ngIf",e.isHex)("ngIfElse",t),o.xp6(3),o.Q6J("hideButtons",!0)("max",100)("ngModel",e.opacity)("tuiTextfieldLabelOutside",!0)}},directives:[r.u,s.O,a.Ek,l.s,c.x,d.JJ,d.On,u.g,h.O5,p.E,f.a,m.T,g.q,h.sg,b.v,v.y,y.B,w.n,x.ro],styles:["[_nghost-%COMP%]{display:flex}.t-select[_ngcontent-%COMP%]{width:4.875rem}.t-opacity[_ngcontent-%COMP%]{width:4.275rem}"],changeDetection:0}),t})()},49294:(t,e,n)=>{n.d(e,{$:()=>c});var o=n(97582),i=n(74788),r=n(91211),s=n(64642),a=n(79012),l=n(74331);class c{constructor(t){this.sanitizer=t,this.colorChange=new i.vpe,this.point=[0,1],this.hue=0,this.opacity=1}set color(t){if(this.currentColor.every(((e,n)=>e===t[n]))&&t[3]===this.opacity)return;const[e,n,o]=(0,s.bDt)(t[0],t[1],t[2]);this.opacity=t[3],this.hue=e/360,this.point=[n,1-o/255]}get currentColor(){return this.getCurrentColor(this.hue,this.point)}get base(){return`rgb(${(0,s.qZG)(360*this.hue,1,255)})`}get gradient(){return this.sanitizer.bypassSecurityTrustStyle(`linear-gradient(to right, rgba(${this.currentColor.join(",")}, 0), rgb(${this.currentColor.join(",")}))`)}onPointChange(t){this.point=t,this.updateColor()}onHueChange(t){this.hue=t,this.updateColor()}onOpacityChange(t){this.opacity=(0,s.FGw)(t,2),this.updateColor()}getCurrentColor(t,e){return(0,s.qZG)(360*t,e[0],255*(1-e[1]))}updateColor(){this.colorChange.emit([...this.currentColor,this.opacity])}}c.ɵfac=function(t){return new(t||c)(i.Y36(r.H7))},c.ɵcmp=i.Xpm({type:c,selectors:[["tui-color-picker"]],inputs:{color:"color"},outputs:{colorChange:"colorChange"},decls:5,vars:7,consts:[[1,"t-flat",3,"value","valueChange"],[1,"t-wrapper","t-wrapper_hue"],[1,"t-hue",3,"value","valueChange"],[1,"t-wrapper","t-wrapper_opacity"],[1,"t-opacity",3,"value","valueChange"]],template:function(t,e){1&t&&(i.TgZ(0,"tui-flat-picker",0),i.NdJ("valueChange",(function(t){return e.onPointChange(t)})),i.qZA(),i.TgZ(1,"div",1),i.TgZ(2,"tui-linear-picker",2),i.NdJ("valueChange",(function(t){return e.onHueChange(t)})),i.qZA(),i.qZA(),i.TgZ(3,"div",3),i.TgZ(4,"tui-linear-picker",4),i.NdJ("valueChange",(function(t){return e.onOpacityChange(t)})),i.qZA(),i.qZA()),2&t&&(i.Udp("background-color",e.base),i.Q6J("value",e.point),i.xp6(2),i.Q6J("value",e.hue),i.xp6(1),i.Udp("background",e.gradient),i.xp6(1),i.Q6J("value",e.opacity))},directives:[a.J,l.P],styles:['[_nghost-%COMP%]{position:relative;z-index:0;display:block}.t-flat[_ngcontent-%COMP%]{height:14rem;background:linear-gradient(rgba(0,0,0,0),#000000),linear-gradient(to right,#ffffff,rgba(255,255,255,0));margin-bottom:.25rem;overflow:hidden}.t-wrapper[_ngcontent-%COMP%]{position:relative;margin:1rem 1.25rem;border-radius:.5rem}.t-wrapper[_ngcontent-%COMP%]:after{position:absolute;top:0;left:0;width:100%;height:100%;content:"";box-shadow:inset 0 0 0 1px #00000014;pointer-events:none;border-radius:inherit}.t-wrapper_hue[_ngcontent-%COMP%]{background:#ff0000}.t-wrapper_opacity[_ngcontent-%COMP%]:before{position:absolute;top:0;left:0;width:100%;height:100%;content:"";z-index:-1;background-image:linear-gradient(45deg,var(--tui-base-03) 25%,transparent 25%,transparent 75%,var(--tui-base-03) 75%,var(--tui-base-03)),linear-gradient(45deg,var(--tui-base-03) 25%,transparent 25%,transparent 75%,var(--tui-base-03) 75%,var(--tui-base-03));background-size:.375rem .375rem;background-position:0 0,.1875rem .1875rem;border-radius:inherit}.t-hue[_ngcontent-%COMP%]{background:linear-gradient(to right,#ff0000,#ffff00,#00ff00,#00ffff,#0000ff,#ff00ff,#ff0000);border-radius:inherit;margin:0 .5rem}.t-opacity[_ngcontent-%COMP%]{border-radius:inherit;margin:0 .5rem}'],changeDetection:0}),(0,o.gn)([s.UMq],c.prototype,"getCurrentColor",null)},26383:(t,e,n)=>{n.d(e,{s:()=>_});var o=n(97582),i=n(74788),r=n(91211),s=n(64642),a=n(71831),l=n(39425),c=n(98778),d=n(18289),u=n(12057),h=n(49294),p=n(77825),f=n(22545),m=n(91283),g=n(7176),b=n(44099),v=n(13938),y=n(10406),w=n(63790),x=n(51928),k=n(13449),C=n(20690),M=n(59113);function S(t,e){if(1&t&&i._UZ(0,"tui-svg",9),2&t){const t=i.oxw(),e=i.MAs(1);i.ekj("t-arrow_rotated",e.open),i.Q6J("src",t.options.icons.colorSelectorDropdownChevron)}}function A(t,e){if(1&t&&i._UZ(0,"tui-svg",14),2&t){const t=i.oxw(3);i.Q6J("src",t.options.icons.colorSelectorDropdownCheck)}}function O(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",12),i.NdJ("click",(function(){const e=i.CHM(t).$implicit,n=i.oxw(2),o=i.MAs(1);return n.onModeSelect(e,o)}))("keydown.enter.prevent",(function(){const e=i.CHM(t).$implicit,n=i.oxw(2),o=i.MAs(1);return n.onModeSelect(e,o)}))("keydown.space.prevent",(function(){const e=i.CHM(t).$implicit,n=i.oxw(2),o=i.MAs(1);return n.onModeSelect(e,o)})),i._uU(1),i.YNc(2,A,1,1,"tui-svg",13),i.qZA()}if(2&t){const t=e.$implicit,n=i.oxw(2);i.uIk("aria-checked",n.isModeActive(t)),i.xp6(1),i.hij(" ",t," "),i.xp6(1),i.Q6J("ngIf",n.isModeActive(t))}}function T(t,e){if(1&t&&(i.TgZ(0,"tui-data-list",10),i.YNc(1,O,3,3,"button",11),i.qZA()),2&t){const t=i.oxw();i.xp6(1),i.Q6J("ngForOf",t.modes)}}function N(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",20),i.NdJ("click",(function(){const e=i.CHM(t).$implicit;return i.oxw(2).onDirectionChange(e)})),i.qZA()}if(2&t){const t=e.$implicit,n=i.oxw(2);i.ekj("t-direction_active",n.isDirectionActive(t)),i.Q6J("icon",n.getIcon(t))("tuiHint",t)}}function E(t,e){if(1&t){const t=i.EpF();i.ynx(0),i._UZ(1,"hr",15),i.TgZ(2,"div",16),i.TgZ(3,"tui-linear-multi-picker",17),i.NdJ("indexChange",(function(e){return i.CHM(t),i.oxw().onIndexChange(e)}))("valueChange",(function(e){return i.CHM(t),i.oxw().onStopsChange(e)})),i.qZA(),i.qZA(),i.TgZ(4,"div",18),i.YNc(5,N,1,4,"button",19),i.qZA(),i.BQk()}if(2&t){const t=i.oxw();i.xp6(2),i.Udp("background",t.gradient),i.xp6(1),i.Q6J("value",t.stopsKeys),i.xp6(2),i.Q6J("ngForOf",t.buttons)}}function I(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-color-edit",21),i.NdJ("colorChange",(function(e){return i.CHM(t),i.oxw().onColorChange(e)})),i.qZA()}if(2&t){const t=i.oxw();i.Q6J("color",t.color)}}function D(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-palette",22),i.NdJ("selectedColor",(function(e){return i.CHM(t),i.oxw().onPalettePick(e)})),i.qZA()}if(2&t){const t=i.oxw();i.Q6J("colors",t.palette)}}const P=[0,0,0,0],H=[[0,[0,0,0,1]],[1,[255,255,255,1]]],L={"to top right":"tuiIconArrowUpRight","to right":"tuiIconArrowRight","to bottom right":"tuiIconArrowDownRight","to bottom":"tuiIconArrowDown","to bottom left":"tuiIconArrowDownLeft","to left":"tuiIconArrowLeft","to top left":"tuiIconArrowUpLeft","to top":"tuiIconArrowUp"};class _{constructor(t,e,n){this.options=t,this.sanitizer=e,this.modes=n,this.stops=new Map(H),this.currentStop=0,this.direction="to bottom",this.colors=new Map,this.colorChange=new i.vpe,this.color=[0,0,0,1],this.currentMode=this.modes[0],this.buttons=["to top right","to right","to bottom right","to bottom","to bottom left","to left","to top left","to top"]}set colorSetter(t){this.parse(t)}get palette(){return this.filterPalette(this.colors,this.isGradient)}get stopsKeys(){return this.getStopsKeys(this.stops)}get currentColor(){return this.isGradient?this.getStop(this.currentStop):this.color}get gradient(){return this.sanitizer.bypassSecurityTrustStyle(this.getGradient("to right"))}get isGradient(){return this.currentMode===this.modes[1]}getIcon(t){return L[t]}isModeActive(t){return this.currentMode===t}isDirectionActive(t){return this.direction===t}onPalettePick(t){this.updateColor(t)}onDirectionChange(t){this.direction=t,this.updateColor(this.getGradient(t))}onModeSelect(t,e){this.currentMode=t,e.open=!1,this.updateColor(t===this.modes[0]?`rgba(${this.color.join(", ")})`:this.getGradient(this.direction))}onIndexChange(t){this.currentStop=this.stopsKeys[t]}onColorChange(t){this.isGradient?(this.stops.set(this.currentStop,t),this.updateColor(this.getGradient(this.direction))):this.updateColor(`rgba(${t.join(", ")})`)}onStopsChange(t){const e=this.stopsKeys.find((e=>!t.includes(e))),n=t.find((t=>!this.stopsKeys.includes(t)));void 0===e&&void 0!==n&&this.addStop(n),void 0!==e&&void 0===n&&this.removeStop(e),void 0!==e&&void 0!==n&&this.replaceStop(e,n),this.updateColor(this.getGradient(this.direction))}getStopsKeys(t){return Array.from(t.keys())}filterPalette(t,e){const n=new Map(t);return n.forEach(((t,o)=>{(t.startsWith("linear-gradient")&&!e||!t.startsWith("linear-gradient")&&e)&&n.delete(o)})),n}updateColor(t){this.colorChange.emit(t)}getGradient(t){return`linear-gradient(${t}, ${[...this.stopsKeys].sort(s.A2j).map((t=>`rgba(${this.getStop(t).join(", ")}) ${100*t}%`)).join(", ")})`}getStop(t){return this.stops.get(t)||P}addStop(t){const e=this.stopsKeys.reduce(((e,n)=>Math.abs(n-t)o===t?[e,n]:[o,this.getStop(o)])))}parse(t){t.startsWith("linear-gradient")?this.parseGradient(t):this.parseColor(t)}parseGradient(t){if(t===this.getGradient(this.direction))return;const e=(0,l._N)((0,l.U5)(t));this.currentMode=this.modes[1],this.direction=e.side,this.currentStop=0,this.stops=new Map(e.stops.length?e.stops.map((({color:t,position:e})=>[parseFloat(e)/100,(0,s.MpC)(t)])):H)}parseColor(t){this.currentMode=this.modes[0],this.currentStop=0,this.color=(0,s.MpC)(t)}}_.ɵfac=function(t){return new(t||_)(i.Y36(a.mJ),i.Y36(r.H7),i.Y36(a.dj))},_.ɵcmp=i.Xpm({type:_,selectors:[["tui-color-selector"]],inputs:{colors:"colors",colorSetter:["color","colorSetter"]},outputs:{colorChange:"colorChange"},decls:12,vars:7,consts:[[1,"t-select",3,"content"],["dropdown",""],["appearance","","size","s","tuiButton","","type","button",3,"iconRight"],["arrow",""],["menu",""],[4,"ngIf"],[3,"color","colorChange"],["tuiGroup","","class","t-edit",3,"color","colorChange",4,"ngIf"],["class","t-palette",3,"colors","selectedColor",4,"ngIf"],[1,"t-arrow",3,"src"],["role","menu","size","s",1,"t-menu"],["role","menuitemradio","tuiOption","",3,"click","keydown.enter.prevent","keydown.space.prevent",4,"ngFor","ngForOf"],["role","menuitemradio","tuiOption","",3,"click","keydown.enter.prevent","keydown.space.prevent"],["class","t-checkmark",3,"src",4,"ngIf"],[1,"t-checkmark",3,"src"],[1,"t-hr"],[1,"t-wrapper"],[1,"t-gradient",3,"value","indexChange","valueChange"],[1,"t-buttons"],["appearance","","size","xs","tuiHintDescribe","","tuiIconButton","","type","button","class","t-direction",3,"t-direction_active","icon","tuiHint","click",4,"ngFor","ngForOf"],["appearance","","size","xs","tuiHintDescribe","","tuiIconButton","","type","button",1,"t-direction",3,"icon","tuiHint","click"],["tuiGroup","",1,"t-edit",3,"color","colorChange"],[1,"t-palette",3,"colors","selectedColor"]],template:function(t,e){if(1&t&&(i.TgZ(0,"tui-hosted-dropdown",0,1),i.TgZ(2,"button",2),i._uU(3),i.qZA(),i.YNc(4,S,1,3,"ng-template",null,3,i.W1O),i.YNc(6,T,2,1,"ng-template",null,4,i.W1O),i.qZA(),i.YNc(8,E,6,4,"ng-container",5),i.TgZ(9,"tui-color-picker",6),i.NdJ("colorChange",(function(t){return e.onColorChange(t)})),i.qZA(),i.YNc(10,I,1,1,"tui-color-edit",7),i.YNc(11,D,1,1,"tui-palette",8)),2&t){const t=i.MAs(5),n=i.MAs(7);i.Q6J("content",n),i.xp6(2),i.Q6J("iconRight",t),i.xp6(1),i.hij(" ",e.currentMode," "),i.xp6(5),i.Q6J("ngIf",e.isGradient),i.xp6(1),i.Q6J("color",e.currentColor),i.xp6(1),i.Q6J("ngIf",!e.isGradient),i.xp6(1),i.Q6J("ngIf",e.palette.size)}},directives:[c.o,d.v,u.O5,h.$,p.P,f.q,u.sg,m.v,g.e,b.$,v.D,y.x,w.t,x.D,k.h,C.g,M.R],styles:['[_nghost-%COMP%]{position:relative;z-index:0;display:block;width:22.6rem}.t-wrapper[_ngcontent-%COMP%]{position:relative;margin:1.25rem;border-radius:.5rem}.t-wrapper[_ngcontent-%COMP%]:after{position:absolute;top:0;left:0;width:100%;height:100%;content:"";box-shadow:inset 0 0 0 1px #00000014;pointer-events:none;border-radius:inherit}.t-wrapper[_ngcontent-%COMP%]:before{position:absolute;top:0;left:0;width:100%;height:100%;content:"";z-index:-1;background-image:linear-gradient(45deg,var(--tui-base-03) 25%,transparent 25%,transparent 75%,var(--tui-base-03) 75%,var(--tui-base-03)),linear-gradient(45deg,var(--tui-base-03) 25%,transparent 25%,transparent 75%,var(--tui-base-03) 75%,var(--tui-base-03));background-size:.375rem .375rem;background-position:0 0,.1875rem .1875rem;border-radius:inherit}.t-hr[_ngcontent-%COMP%]{height:1px;margin:0 0 0 -1px;border:none;background:var(--tui-base-03)}.t-gradient[_ngcontent-%COMP%]{margin:0 .5rem;border-radius:inherit}.t-select[_ngcontent-%COMP%]{margin:.75rem .5rem}.t-arrow[_ngcontent-%COMP%]{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-arrow_rotated[_ngcontent-%COMP%]{transform:rotate(180deg)}.t-menu[_ngcontent-%COMP%]{width:11.25rem}.t-checkmark[_ngcontent-%COMP%]{margin-left:auto;width:1rem;height:1rem}.t-buttons[_ngcontent-%COMP%]{display:flex;padding:0 .75rem 1.25rem}.t-direction[_ngcontent-%COMP%]{color:var(--tui-text-02);margin:0 .375rem}.t-direction[_ngcontent-%COMP%]:hover, .t-direction_active[_ngcontent-%COMP%]{color:var(--tui-text-01);background:var(--tui-secondary-hover)}.t-edit[_ngcontent-%COMP%]{margin:1.25rem}.t-palette[_ngcontent-%COMP%]{box-sizing:border-box;box-shadow:inset 0 1px var(--tui-base-03)}'],changeDetection:0}),(0,o.gn)([s.UMq],_.prototype,"getStopsKeys",null),(0,o.gn)([s.UMq],_.prototype,"filterPalette",null)},79012:(t,e,n)=>{n.d(e,{J:()=>s});var o=n(74788),i=n(64642),r=n(20755);let s=(()=>{class t{constructor(t){this.value=[0,0],this.valueChange=new o.vpe,t.subscribe((t=>{this.value=t,this.valueChange.emit([t[0],t[1]])}))}get left(){return 100*this.value[0]}get top(){return 100*this.value[1]}}return t.ɵfac=function(e){return new(e||t)(o.Y36(r.i))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-flat-picker"]],inputs:{value:"value"},outputs:{valueChange:"valueChange"},features:[o._Bn([i.a31,r.i])],decls:1,vars:4,consts:[[1,"t-circle"]],template:function(t,e){1&t&&o._UZ(0,"div",0),2&t&&o.Udp("left",e.left,"%")("top",e.top,"%")},styles:["[_nghost-%COMP%]{position:relative;display:block}.t-circle[_ngcontent-%COMP%]{position:absolute;width:1rem;height:1rem;border-radius:100%;margin:-.5rem 0 0 -.5rem;box-shadow:inset 0 0 0 1px var(--tui-base-01),0 0 0 1px var(--tui-base-03)}"],changeDetection:0}),t})()},96472:(t,e,n)=>{n.d(e,{H9:()=>h,wl:()=>g,VM:()=>m}),n(13449);var o=n(12057),i=n(24751),r=n(45642),s=n(67274),a=n(78639),l=n(74788);let c=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,i.u5,r.U5,a.SCC,a.Jyo,s.KWI,s.cnw,s.dpK,a.$HZ,s.pcV]]}),t})();n(49294);let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez]]}),t})(),u=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez]]}),t})(),h=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,d,u]]}),t})();n(26383);var p=n(64642);let f=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez]]}),t})(),m=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,s.goS]]}),t})(),g=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,s.fNO,s.jhF,h,f,s.goS,s.EIu,s.pcV,p.Ah6,c,s.n6B,m]]}),t})();n(79012),n(7176),n(74331),n(59113)},7176:(t,e,n)=>{n.d(e,{e:()=>l});var o=n(74788),i=n(64642),r=n(20755),s=n(12057);function a(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",1),o.NdJ("dblclick",(function(){const e=o.CHM(t).index;return o.oxw().onClick(e)}))("mousedown",(function(){const e=o.CHM(t).index;return o.oxw().onMouseDown(e)})),o.qZA()}if(2&t){const t=e.$implicit;o.Udp("left",100*t,"%")}}let l=(()=>{class t{constructor(t){this.value=[0,1],this.valueChange=new o.vpe,this.indexChange=new o.vpe,this.index=NaN,t.subscribe((([t])=>{this.onPicker(t)}))}onMouseUp(){this.index=NaN}onMouseDown(t){this.updateIndex(t)}onClick(t){this.value.length>2&&this.updateValue(this.value.filter(((e,n)=>n!==t)))}onPicker(t){Number.isNaN(this.index)&&(this.updateIndex(this.value.length),this.value=[...this.value,0]),this.value.some(((e,n)=>e===t&&n!==this.index))||this.updateValue(this.value.map(((e,n)=>n===this.index?t:e)))}updateIndex(t){this.index=t,this.indexChange.emit(t)}updateValue(t){this.value=t,this.valueChange.emit(t)}}return t.ɵfac=function(e){return new(e||t)(o.Y36(r.i))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-linear-multi-picker"]],hostBindings:function(t,e){1&t&&o.NdJ("mouseup",(function(){return e.onMouseUp()}),!1,o.evT)},inputs:{value:"value"},outputs:{valueChange:"valueChange",indexChange:"indexChange"},features:[o._Bn([i.a31,r.i])],decls:1,vars:1,consts:[["class","t-circle",3,"left","dblclick","mousedown",4,"ngFor","ngForOf"],[1,"t-circle",3,"dblclick","mousedown"]],template:function(t,e){1&t&&o.YNc(0,a,1,2,"div",0),2&t&&o.Q6J("ngForOf",e.value)},directives:[s.sg],styles:["[_nghost-%COMP%]{position:relative;display:block;height:1rem;box-sizing:border-box}.t-circle[_ngcontent-%COMP%]{position:absolute;width:1rem;height:1rem;border-radius:100%;margin:0 -.5rem;box-shadow:inset 0 0 0 2px var(--tui-base-01),0 0 0 1px var(--tui-base-03)}"],changeDetection:0}),t})()},74331:(t,e,n)=>{n.d(e,{P:()=>s});var o=n(74788),i=n(64642),r=n(20755);let s=(()=>{class t{constructor(t){this.value=0,this.valueChange=new o.vpe,t.subscribe((([t])=>{this.value=t,this.valueChange.emit(t)}))}get left(){return 100*this.value}}return t.ɵfac=function(e){return new(e||t)(o.Y36(r.i))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-linear-picker"]],inputs:{value:"value"},outputs:{valueChange:"valueChange"},features:[o._Bn([i.a31,r.i])],decls:1,vars:2,consts:[[1,"t-circle"]],template:function(t,e){1&t&&o._UZ(0,"div",0),2&t&&o.Udp("left",e.left,"%")},styles:["[_nghost-%COMP%]{position:relative;display:block;height:1rem;box-sizing:border-box}.t-circle[_ngcontent-%COMP%]{position:absolute;width:1rem;height:1rem;border-radius:100%;margin:0 -.5rem;box-shadow:inset 0 0 0 2px var(--tui-base-01),0 0 0 1px var(--tui-base-03)}"],changeDetection:0}),t})()},59113:(t,e,n)=>{n.d(e,{R:()=>u});var o=n(74788),i=n(12057),r=n(13938),s=n(10406),a=n(63790),l=n(51928),c=n(44099);function d(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",1),o.NdJ("click",(function(){const e=o.CHM(t).$implicit;return o.oxw().selectedColor.emit(e.value)})),o.qZA()}if(2&t){const t=e.$implicit;o.Udp("background",t.value),o.Q6J("id",t.key)("tuiHint",t.key)("tuiHintDescribe",t.key)}}let u=(()=>{class t{constructor(){this.colors=new Map,this.selectedColor=new o.vpe,this.originalOrder=(t,e)=>0}}return t.ɵfac=function(e){return new(e||t)},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-palette"]],inputs:{colors:"colors"},outputs:{selectedColor:"selectedColor"},decls:2,vars:4,consts:[["type","button","class","t-button",3,"id","background","tuiHint","tuiHintDescribe","click",4,"ngFor","ngForOf"],["type","button",1,"t-button",3,"id","tuiHint","tuiHintDescribe","click"]],template:function(t,e){1&t&&(o.YNc(0,d,1,5,"button",0),o.ALo(1,"keyvalue")),2&t&&o.Q6J("ngForOf",o.xi3(1,1,e.colors,e.originalOrder))},directives:[i.sg,r.D,s.x,a.t,l.D,c.$],pipes:[i.Nd],styles:["[_nghost-%COMP%]{display:flex;flex-wrap:wrap;padding:.875rem}.t-button[_ngcontent-%COMP%]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;width:1.5625rem;height:1.5625rem;box-sizing:border-box;margin:.375rem;border-radius:var(--tui-radius-m);border:1px solid rgba(0,0,0,.08)}"],changeDetection:0}),t})()},41039:(t,e,n)=>{n.d(e,{l:()=>T});var o=n(12057),i=n(74788),r=n(64642),s=n(18892),a=n(86114),l=n(71831),c=n(68838),d=n(36866),u=n(30528),h=n(24751),p=n(77825),f=n(18289),m=n(73460),g=n(96281),b=n(79550);let v=(()=>{class t{transform(t,e,n){return"#"===e?t.filter((t=>t!==n)):t}}return t.ɵfac=function(e){return new(e||t)},t.ɵpipe=i.Yjl({name:"tuiFilterAnchors",type:t,pure:!0}),t})();function y(t,e){1&t&&(i.ynx(0),i._uU(1,"Edit anchor"),i.BQk())}function w(t,e){1&t&&(i.TgZ(0,"span"),i._uU(1,"Link to anchor"),i.qZA())}function x(t,e){1&t&&(i.TgZ(0,"span"),i._uU(1,"URL"),i.qZA())}function k(t,e){if(1&t&&(i.YNc(0,w,2,0,"span",1),i.YNc(1,x,2,0,"ng-template",null,12,i.W1O)),2&t){const t=i.MAs(2),e=i.oxw(2);i.Q6J("ngIf",e.prefixIsHashMode)("ngIfElse",t)}}function C(t,e){if(1&t&&(i.ynx(0),i._uU(1),i.BQk()),2&t){const t=e.ngIf,n=i.oxw(2);i.xp6(1),i.hij(" ",n.prefixIsHashMode?t.anchorExample:t.urlExample," ")}}function M(t,e){if(1&t){const t=i.EpF();i.ynx(0),i.TgZ(1,"label",4),i.TgZ(2,"div",5),i.YNc(3,y,2,0,"ng-container",1),i.YNc(4,k,3,2,"ng-template",null,6,i.W1O),i.qZA(),i.TgZ(6,"div",7),i.TgZ(7,"div",8),i._uU(8),i.qZA(),i.TgZ(9,"tui-input-inline",9),i.NdJ("ngModelChange",(function(e){return i.CHM(t),i.oxw().url=e}))("input",(function(e){let n;return i.CHM(t),i.oxw().onChange(null==(n=e.target)?null:n.value)}))("keydown.backspace",(function(){return i.CHM(t),i.oxw().onBackspace()}))("keydown.prevent.enter",(function(){return i.CHM(t),i.oxw().onSave()})),i.YNc(10,C,2,1,"ng-container",3),i.ALo(11,"async"),i.qZA(),i.qZA(),i.qZA(),i.TgZ(12,"tui-svg",10),i.NdJ("click",(function(){return i.CHM(t),i.oxw().onClear()})),i.qZA(),i.TgZ(13,"button",11),i.NdJ("click",(function(){return i.CHM(t),i.oxw().onSave()})),i.qZA(),i.BQk()}if(2&t){const t=i.MAs(5),e=i.oxw();i.xp6(3),i.Q6J("ngIf",e.anchorMode)("ngIfElse",t),i.xp6(5),i.Oqu(e.prefix),i.xp6(1),i.ekj("t-input_filled",e.hasUrl),i.Q6J("ngModel",e.url),i.xp6(1),i.Q6J("ngIf",i.lcZ(11,11,e.texts$)),i.xp6(2),i.ekj("t-cleaner_hidden",!e.hasUrl),i.Q6J("src",e.options.icons.popupLinkRemove),i.xp6(1),i.Q6J("icon",e.options.icons.popupLinkSave)}}function S(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"a",13),i._uU(1),i.ALo(2,"tuiShortUrl"),i.qZA(),i.TgZ(3,"button",14),i.NdJ("click",(function(){return i.CHM(t),i.oxw().onEdit()})),i.qZA(),i.TgZ(4,"button",15),i.NdJ("click",(function(){return i.CHM(t),i.oxw().onRemove()})),i.qZA()}if(2&t){const t=i.oxw();i.Q6J("href",t.href,i.LSH)("icon",t.prefixIsHashMode?"tuiIconHash":"tuiIconExternalLink"),i.xp6(1),i.hij(" ",i.lcZ(2,5,t.url)," "),i.xp6(2),i.Q6J("icon",t.options.icons.popupPreviewLinkEdit),i.xp6(1),i.Q6J("icon",t.options.icons.popupPreviewLinkClear)}}function A(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",19),i.NdJ("click",(function(){const e=i.CHM(t).$implicit;return i.oxw(2).setAnchor(e)})),i._uU(1),i.qZA()}if(2&t){const t=e.$implicit;i.xp6(1),i.hij(" #",t," ")}}function O(t,e){if(1&t&&(i.ynx(0),i._UZ(1,"hr",16),i.TgZ(2,"tui-scrollbar"),i.TgZ(3,"div",17),i.YNc(4,A,2,1,"button",18),i.ALo(5,"tuiFilterAnchors"),i.qZA(),i.qZA(),i.BQk()),2&t){const t=i.oxw();i.xp6(4),i.Q6J("ngForOf",i.Dn7(5,1,t.anchorIds,t.prefix,t.url))}}let T=(()=>{class t{constructor(t,e,n,o){this.doc=t,this.texts$=e,this.editor=n,this.options=o,this.isOnlyAnchorMode=this.detectAnchorMode(),this.addLink=new i.vpe,this.removeLink=new i.vpe,this.url=this.getHrefOrAnchorId(),this.edit=!this.url,this.prefix=this.makeDefaultPrefix(),this.anchorIds=this.getAllAnchorsIds()}get defaultProtocol(){var t,e;return null!==(e=null===(t=this.options.linkOptions)||void 0===t?void 0:t.protocol)&&void 0!==e?e:s.Ci}set anchorMode(t){this.isOnlyAnchorMode=t,this.prefix=t?s._s:this.makeDefaultPrefix()}get anchorMode(){return this.isOnlyAnchorMode}get prefixIsHashMode(){return this.prefix===s._s}get hasUrl(){return!!this.url}get href(){return`${this.prefix}${this.url}`}get showAnchorsList(){return!this.anchorMode&&this.edit&&this.anchorIds.length>0}get isViewMode(){return!this.edit}onSelectionChange(){this.isViewMode&&(this.url=this.getHrefOrAnchorId(),this.anchorMode=this.detectAnchorMode())}onMouseDown(t){(0,r.veZ)(t.target)&&!t.target.matches("a, button, input")&&t.preventDefault()}setAnchor(t){this.url=t,this.changePrefix(!0)}changePrefix(t){this.prefix=t?s._s:this.defaultProtocol}onSave(){this.url?this.addLink.emit(this.href):this.removeLink.emit()}onBackspace(){this.url||(this.prefix=this.isOnlyAnchorMode?s._s:this.defaultProtocol)}onEdit(){this.edit=!0}onRemove(){this.removeLink.emit()}onChange(t){this.url=this.removePrefix(t)}onClear(){this.url=""}makeDefaultPrefix(){var t,e;const n=this.getAnchorElement(),o=(0,c.$)(null!==(t=null==n?void 0:n.getAttribute("href"))&&void 0!==t?t:"").prefix||this.defaultProtocol;return n&&(!n.getAttribute("href")&&n.getAttribute("id")||(null===(e=n.getAttribute("href"))||void 0===e?void 0:e.startsWith(s._s)))?s._s:o}detectAnchorMode(){const t=this.getAnchorElement();return!(null==t?void 0:t.href)&&!!(null==t?void 0:t.getAttribute("id"))}getFocusedParentElement(){var t,e;return(null===(e=null===(t=this.doc.getSelection())||void 0===t?void 0:t.focusNode)||void 0===e?void 0:e.parentElement)||null}getAnchorElement(){var t,e,n;const o=this.getFocusedParentElement();return null!==(n=null!==(t=null==o?void 0:o.closest("a"))&&void 0!==t?t:null===(e=null==o?void 0:o.querySelector("img"))||void 0===e?void 0:e.closest("a"))&&void 0!==n?n:null}getHrefOrAnchorId(){const t=this.getAnchorElement();return t?this.removePrefix(t.getAttribute("href")||t.getAttribute("id")||""):this.url}removePrefix(t){var e;const n=t.startsWith(s._s)||this.prefix===s._s?t:`${null!==(e=this.prefix)&&void 0!==e?e:""}${t}`,{prefix:o,path:i}=(0,c.$)(n),r=this.isOnlyAnchorMode||o===s._s||""===o&&this.prefix===s._s;return this.prefix=r?s._s:""===o?this.defaultProtocol:o,i}getAllAnchorsIds(){var t;const e=Array.from(null!==(t=this.editor.getOriginTiptapEditor().view.dom.querySelectorAll('[data-type="jump-anchor"]'))&&void 0!==t?t:[]);return Array.from(e).map((t=>t.getAttribute("id")||"")).filter(Boolean)}}return t.ɵfac=function(e){return new(e||t)(i.Y36(o.K0),i.Y36(l.b$),i.Y36(a.$3),i.Y36(l.mJ))},t.ɵcmp=i.Xpm({type:t,selectors:[["tui-edit-link"]],hostBindings:function(t,e){1&t&&i.NdJ("selectionchange",(function(){return e.onSelectionChange()}),!1,i.evT)("mousedown",(function(t){return e.onMouseDown(t)}))},inputs:{anchorMode:"anchorMode"},outputs:{addLink:"addLink",removeLink:"removeLink"},decls:5,vars:3,consts:[[1,"t-edit-link",3,"mousedown"],[4,"ngIf","ngIfElse"],["view",""],[4,"ngIf"],[1,"t-label"],[1,"t-label-properties"],["fullOptions",""],[1,"t-url"],[1,"t-prefix"],["tuiAutoFocus","",1,"t-input",3,"ngModel","ngModelChange","input","keydown.backspace","keydown.prevent.enter"],[1,"t-cleaner",3,"src","click"],["appearance","icon","shape","rounded","size","s","title","Insert link","tuiIconButton","","type","button",1,"t-button",3,"icon","click"],["urlTitle",""],["iconAlign","left","target","_blank","tuiLink","",1,"t-link",3,"href","icon"],["appearance","icon","shape","rounded","size","s","title","Change link","tuiIconButton","","type","button",1,"t-button","t-edit-button",3,"icon","click"],["appearance","icon","automation-id","toolbar__popup-link-clear-button","shape","rounded","size","s","title","Remove link","tuiIconButton","","type","button",1,"t-button",3,"icon","click"],[1,"t-hr"],[1,"t-anchor-list"],["type","button","class","t-anchor",3,"click",4,"ngFor","ngForOf"],["type","button",1,"t-anchor",3,"click"]],template:function(t,e){if(1&t&&(i.TgZ(0,"div",0),i.NdJ("mousedown",(function(t){return t.stopImmediatePropagation()})),i.YNc(1,M,14,13,"ng-container",1),i.YNc(2,S,5,7,"ng-template",null,2,i.W1O),i.qZA(),i.YNc(4,O,6,5,"ng-container",3)),2&t){const t=i.MAs(3);i.xp6(1),i.Q6J("ngIf",e.edit)("ngIfElse",t),i.xp6(3),i.Q6J("ngIf",e.showAnchorsList)}},directives:[o.O5,d.l,u.k,h.JJ,h.On,p.P,f.v,m.V,g.I,o.sg],pipes:[o.Ov,b.X,v],styles:["[_nghost-%COMP%]{display:block;min-width:18.75rem}.t-edit-link[_ngcontent-%COMP%]{display:flex;min-height:4rem;align-items:center;padding-right:.75rem}.t-label[_ngcontent-%COMP%]{font:var(--tui-font-text-s);height:var(--tui-height-l);box-sizing:border-box;padding:.4375rem 1rem;min-width:12.5rem;max-width:25rem;width:100%}.t-label-properties[_ngcontent-%COMP%]{display:flex;align-items:center;max-width:8.375rem;justify-content:space-between}.t-property_inactive[_ngcontent-%COMP%]{opacity:.5}.t-url[_ngcontent-%COMP%]{display:flex;font:var(--tui-font-text-m);color:var(--tui-text-02)}.t-input[_ngcontent-%COMP%]{flex:1}.t-input_filled[_ngcontent-%COMP%]{color:var(--tui-text-01)}.t-button[_ngcontent-%COMP%]{width:2rem;height:2rem;margin:0 .25rem;transition:background .2s}.t-edit-button[_ngcontent-%COMP%]{margin-left:auto}.t-link[_ngcontent-%COMP%]{margin:0 1rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.t-cleaner[_ngcontent-%COMP%]{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;color:var(--tui-base-06);cursor:pointer;margin-left:auto}.t-cleaner[_ngcontent-%COMP%]:hover{color:var(--tui-base-07)}.t-cleaner_hidden[_ngcontent-%COMP%]{visibility:hidden}.t-anchor-list[_ngcontent-%COMP%]{display:flex;max-height:12.5rem;flex-direction:column}.t-anchor[_ngcontent-%COMP%]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;background:none;font-size:inherit;line-height:inherit;min-height:2.75rem;padding:.375rem .5rem;margin:.125rem .5rem;border-radius:var(--tui-radius-m);text-align:left}.t-anchor[_ngcontent-%COMP%]:hover{background:var(--tui-base-02);cursor:pointer}"],changeDetection:0}),t})()},8674:(t,e,n)=>{n.d(e,{Fu:()=>c}),n(41039);var o=n(12057),i=n(24751),r=n(64642),s=n(67274),a=n(78639),l=n(74788);let c=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=l.oAB({type:t}),t.ɵinj=l.cJS({imports:[[o.ez,i.u5,r.Q7V,s.fNO,s.EIu,s.jzK,a.z$l,a.YMv,s.Jyu]]}),t})();n(79550),n(68838)},79550:(t,e,n)=>{n.d(e,{X:()=>i});var o=n(74788);let i=(()=>{class t{transform(t){return t.length<60?t:`${t.slice(0,Math.max(0,40))}...${t.slice(t.length-10)}`}}return t.ɵfac=function(e){return new(e||t)},t.ɵpipe=o.Yjl({name:"tuiShortUrl",type:t,pure:!0}),t})()},68838:(t,e,n)=>{n.d(e,{$:()=>r});var o=n(64642),i=n(18892);function r(t=""){if(t.startsWith(i._s))return{prefix:i._s,path:t.slice(1)};const[e="",n=""]=t.includes(i.jU)?s(t):a(t);if(n.includes(i.DN)){const[t,e]=a(n);if(t&&e)return{prefix:t,path:e}}return{prefix:e,path:""===e?t:n}}function s(t=""){var e;const n=null!==(e=t.indexOf(i.jU))&&void 0!==e?e:-1,[o,r]=n>-1?[t.slice(0,n+i.jU.length),t.slice(n+i.jU.length,t.length)]:["",t],a=[o,r].filter(Boolean);return(null==r?void 0:r.includes("://"))&&a.length>1?s(r):a}function a(t=""){const[e,n]=t.split(/:/).slice(-2).filter(Boolean);return e&&n&&!(0,o.lj0)(t)?[`${e}:`,n]:[]}},61732:(t,e,n)=>{n.d(e,{V:()=>p});var o=n(74788),i=n(64642),r=n(76995),s=n(51703),a=n(12057);const l=function(){return[0,1]};function c(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.NdJ("tuiSizeChange",(function(e){return o.CHM(t),o.oxw().sizeChange.emit(e)})),o.qZA()}2&t&&o.Q6J("tuiResizer",o.DdM(1,l))}const d=function(t){return[t,0]},u=function(){return[1,0]},h=["*"];let p=(()=>{class t{constructor(){this.autoHeight=!1,this.width=null,this.height=null,this.sizeChange=new o.vpe}get hostWidth(){return(0,i.dtH)(this.width)?(0,i.O9r)(this.width):this.width}get hostHeight(){return this.autoHeight?null:(0,i.dtH)(this.height)?(0,i.O9r)(this.height):this.height}}return t.ɵfac=function(e){return new(e||t)},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-editor-resizable"]],hostVars:4,hostBindings:function(t,e){2&t&&o.Udp("width",e.hostWidth)("height",e.hostHeight)},inputs:{autoHeight:"autoHeight",width:"width",height:"height"},outputs:{sizeChange:"sizeChange"},ngContentSelectors:h,decls:5,vars:8,consts:[["tuiResizeable","",1,"t-resizable"],[1,"t-handle","t-handle-left-side",3,"tuiResizer","tuiSizeChange"],["class","t-handle t-handle-bottom-side",3,"tuiResizer","tuiSizeChange",4,"ngIf"],[1,"t-handle","t-handle-right-side",3,"tuiResizer","tuiSizeChange"],[1,"t-handle","t-handle-bottom-side",3,"tuiResizer","tuiSizeChange"]],template:function(t,e){1&t&&(o.F$t(),o.TgZ(0,"div",0),o.Hsn(1),o.TgZ(2,"div",1),o.NdJ("tuiSizeChange",(function(t){return e.sizeChange.emit(t)})),o.qZA(),o.YNc(3,c,1,2,"div",2),o.TgZ(4,"div",3),o.NdJ("tuiSizeChange",(function(t){return e.sizeChange.emit(t)})),o.qZA(),o.qZA()),2&t&&(o.ekj("t-resizable-auto-height",e.autoHeight),o.xp6(2),o.Q6J("tuiResizer",o.VKq(5,d,-1)),o.xp6(1),o.Q6J("ngIf",!e.autoHeight),o.xp6(1),o.Q6J("tuiResizer",o.DdM(7,u)))},directives:[r.U,s.L,a.O5],styles:['[_nghost-%COMP%]{position:relative;display:inline-block;box-sizing:border-box}[_nghost-%COMP%] .t-resizable[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%] .t-resizable-auto-height[_ngcontent-%COMP%]{height:auto!important}[_nghost-%COMP%] iframe[_ngcontent-%COMP%]{display:inline;pointer-events:none}[_nghost-%COMP%]:hover .t-handle[_ngcontent-%COMP%]:after{opacity:1}.t-handle[_ngcontent-%COMP%]{position:absolute;top:0;display:flex;width:.75rem;cursor:col-resize;justify-content:center;align-items:center;height:100%}.t-handle[_ngcontent-%COMP%]:after{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:"";width:50%;height:33%;box-sizing:border-box;border-radius:var(--tui-radius-m);background:var(--tui-base-08);border:1px solid var(--tui-base-03);opacity:0}.t-handle-left-side[_ngcontent-%COMP%]{left:0}.t-handle-bottom-side[_ngcontent-%COMP%]{top:unset;bottom:.3125rem;height:.95rem;width:100%}.t-handle-right-side[_ngcontent-%COMP%]{right:0}'],changeDetection:0}),t})()},12368:(t,e,n)=>{n.d(e,{_3:()=>l,Sl:()=>d});var o=n(64642),i=n(87187),r=n(66682),s=n(46782),a=n(74788);let l=(()=>{class t extends i.d{constructor(t,e){super(),this.doc=t,this.destroy$=e,this._height=0,this._width=0,(0,r.T)((0,o.mLY)(t,"touchend"),(0,o.mLY)(t,"mouseup")).pipe((0,s.R)(e)).subscribe((()=>this.updateAttributes({width:this.width,height:this.height})))}get attrs(){var t;return(null===(t=this.node)||void 0===t?void 0:t.attrs)||{src:""}}get width(){return this._width||this.attrs.width||null}get height(){return this._height||this.attrs.height||null}}return t.ɵfac=function(e){return new(e||t)(a.Y36(Document),a.Y36(o.a31))},t.ɵdir=a.lG2({type:t,features:[a.qOj]}),t})();n(61732);var c=n(12057);let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=a.oAB({type:t}),t.ɵinj=a.cJS({imports:[[c.ez,o.k54,o.gjW]]}),t})()},96152:(t,e,n)=>{n.d(e,{D:()=>l});var o=n(12057),i=n(74788),r=n(64642),s=n(67274),a=n(79698);let l=(()=>{class t{constructor(t,e,n,o,i,r){this.el=t,this.renderer=e,this.sanitizer=n,this.tuiSanitizer=o,this.document=i,this.editor=r}set content(t){var e;this.renderer.setProperty(this.el.nativeElement,"innerHTML",this.tuiSanitizer?this.tuiSanitizer.sanitize(i.q3G.HTML,null!==(e=null==t?void 0:t.replace(/colwidth/g,"width"))&&void 0!==e?e:""):this.sanitizer.sanitize(i.q3G.HTML,null!=t?t:""))}click(t){var e,n;if(this.editor||!(0,r.veZ)(t.target))return;const o=(null===(n=null===(e=t.target)||void 0===e?void 0:e.closest("a"))||void 0===n?void 0:n.getAttribute("href"))||"";o.startsWith("#")&&(this.document.location.hash=o.replace("#",""),t.preventDefault())}}return t.ɵfac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(i.Qsj),i.Y36(i.Tiy),i.Y36(s.hmb,8),i.Y36(o.K0),i.Y36(a.JU,8))},t.ɵcmp=i.Xpm({type:t,selectors:[["tui-editor-socket"]],hostAttrs:[1,"tui-editor-socket"],hostBindings:function(t,e){1&t&&i.NdJ("click",(function(t){return e.click(t)}))},inputs:{content:"content"},decls:0,vars:0,template:function(t,e){},styles:['.tui-editor-socket{display:block;margin:0;color:var(--tui-text-01);font:var(--tui-font-text-m)}.tui-editor-socket[tuiTiptapEditor]{overflow:hidden}.tui-editor-socket .ProseMirror{min-height:5.375rem;padding:.2rem 1rem;outline:none;white-space:pre-wrap}.tui-editor-socket .resize-cursor{cursor:ew-resize;cursor:col-resize}.tui-editor-socket h1,.tui-editor-socket h2,.tui-editor-socket h3,.tui-editor-socket h4,.tui-editor-socket h5,.tui-editor-socket h6{word-break:break-word;line-height:normal}.tui-editor-socket h1:first-child,.tui-editor-socket h2:first-child,.tui-editor-socket p:last-child{margin-bottom:0}.tui-editor-socket p:last-child,.tui-editor-socket pre:last-child{margin-bottom:0}.tui-editor-socket p:empty:after{content:" ";white-space:pre}.tui-editor-socket p:first-child{margin-top:0}.tui-editor-socket p{margin:1rem 0}.tui-editor-socket p>span{line-height:initial}.tui-editor-socket blockquote{margin:1.25rem 0 1.25rem 1.5rem;padding-left:1.0625rem;border-left:1px solid var(--tui-base-04)}.tui-editor-socket hr{border:none;border-top:1px solid var(--tui-base-03);margin:1rem 0}.tui-editor-socket mark{background:unset;color:inherit}.tui-editor-socket font[face="Courier New"]{display:inline-block;padding:.25rem .5rem;border-radius:.25rem;background-color:#ecf1f7;word-break:break-word}.tui-editor-socket a:not([data-type="jump-anchor"]){color:var(--tui-link);text-decoration:none;outline:none}.tui-editor-socket a:not([data-type="jump-anchor"]):hover{color:var(--tui-link-hover);text-decoration:underline}.tui-editor-socket a:not([data-type="jump-anchor"]):active{color:var(--tui-primary-active)}.tui-editor-socket .ProseMirror a[data-type=jump-anchor]{text-decoration:underline;-webkit-text-decoration-color:var(--tui-link);text-decoration-color:var(--tui-link)}.tui-editor-socket .ProseMirror a[data-type=jump-anchor]:before{content:"#"}.tui-editor-socket .ProseMirror a[data-type=jump-anchor]:hover{color:var(--tui-link)}.tui-editor-socket .ProseMirror a:hover img[contenteditable=false]{cursor:pointer;outline:.25rem solid var(--tui-link)}.tui-editor-socket ul,.tui-editor-socket ol{list-style-type:none;margin:1rem 1rem 1rem 1.5rem;padding:0}.tui-editor-socket li{margin:.75rem 0}.tui-editor-socket li>p{display:inline;margin:0 auto;word-break:break-word}.tui-editor-socket ul li>p{display:block}.tui-editor-socket li:before{unicode-bidi:-webkit-isolate;unicode-bidi:isolate;font-feature-settings:"tnum";font-variant-numeric:tabular-nums;text-transform:none;text-indent:0;text-align:start;text-align-last:start}.tui-editor-socket ul>li:before{content:"";display:inline-block;width:.5rem;height:.5rem;border-radius:100%;margin:.5rem .875rem .0625rem -1.375rem;background-color:var(--tui-primary);vertical-align:top;box-sizing:border-box;float:left}.tui-editor-socket li ul>li:before{background:none;border:.125rem solid var(--tui-primary)}.tui-editor-socket li ul>li>ul>li:before{background:var(--tui-primary);border-radius:0;width:.375rem;height:.375rem}.tui-editor-socket ol{counter-reset:item}.tui-editor-socket ol>li:before{content:counters(item,".") ".";display:block;margin:0 .75rem 0 -1.5rem;counter-increment:item;color:var(--tui-base-05);vertical-align:top;float:left;white-space:nowrap}.tui-editor-socket._preview-image img{cursor:pointer}.tui-editor-socket .ProseMirror video,.tui-editor-socket .ProseMirror audio{pointer-events:none}.tui-editor-socket img.ProseMirror-selectednode{outline:.25rem solid var(--tui-primary-hover)}.tui-editor-socket .t-editor-placeholder:before{content:attr(data-placeholder);float:left;color:var(--tui-base-05);pointer-events:none;height:0}.tui-editor-socket table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;overflow:hidden}.tui-editor-socket table .tableWrapper{overflow-x:auto}.tui-editor-socket .tableWrapper,.tui-editor-socket .tui-table-wrapper{overflow-x:auto}.tui-editor-socket table td{position:relative;min-width:1em;height:2rem;border:2px solid var(--tui-base-03);padding:3px 5px;vertical-align:top;box-sizing:border-box;word-break:break-word}.tui-editor-socket table th{position:relative;min-width:1em;height:2rem;border:2px solid var(--tui-base-03);padding:3px 5px;vertical-align:top;box-sizing:border-box;word-break:break-word;font-weight:bold;text-align:left;background-color:var(--tui-base-02);min-height:2rem}.tui-editor-socket table .column-resize-handle{position:absolute;right:-2px;top:0;bottom:-2px;width:4px;background-color:#adf;pointer-events:none}.tui-editor-socket table td>*{margin-top:0;margin-bottom:0}.tui-editor-socket table th>*{margin-top:0;margin-bottom:0}.tui-editor-socket .selectedCell:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:var(--tui-selection);pointer-events:none}.tui-editor-socket summary{display:flex;align-items:center;min-height:3.5rem;width:100%;padding:0 1.25rem;box-sizing:border-box;border-radius:var(--tui-radius-l);pointer-events:none;outline:none}.tui-editor-socket summary:focus-visible{outline:2px solid var(--tui-link)}.tui-editor-socket summary p{min-width:1px;margin:0}.tui-editor-socket summary::-webkit-details-marker{display:none}.tui-editor-socket details[open] summary{border-radius:var(--tui-radius-l) var(--tui-radius-l) 0 0}.tui-editor-socket .details-arrow,.tui-editor-socket .t-details-arrow{position:absolute;top:1.5rem;right:1.25rem;height:.575rem;width:.575rem;border:1px solid var(--tui-base-06);border-width:0 2px 2px 0;transform:rotate(45deg);transition:var(--tui-duration, .3s);-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;padding:0;background:none;cursor:pointer;outline:none}.tui-editor-socket details{width:100%;border:1px solid var(--tui-base-04);border-radius:var(--tui-radius-l)}.tui-editor-socket div[data-type=details-content]{padding:1.25rem;min-height:3rem;border:1px solid var(--tui-base-04);border-width:1px 0 0}.tui-editor-socket div[data-type=details-content] h1:first-child,.tui-editor-socket div[data-type=details-content] h2:first-child,.tui-editor-socket div[data-type=details-content] pre:first-child,.tui-editor-socket div[data-type=details-content] ul:first-child,.tui-editor-socket div[data-type=details-content] ol:first-child,.tui-editor-socket div[data-type=details-content] ol li:first-child,.tui-editor-socket div[data-type=details-content] ul li:first-child{margin-top:0}.tui-editor-socket .details-wrapper,.tui-editor-socket .t-details-wrapper{margin-bottom:.5rem;position:relative;display:flex}.tui-editor-socket .details-wrapper_rendered .details-arrow,.tui-editor-socket .t-details-wrapper_rendered .details-arrow,.tui-editor-socket .details-wrapper_rendered .t-details-arrow,.tui-editor-socket .t-details-wrapper_rendered .t-details-arrow{pointer-events:none}.tui-editor-socket .details-wrapper_rendered summary,.tui-editor-socket .t-details-wrapper_rendered summary{transition:transform var(--tui-duration, .3s);cursor:pointer;pointer-events:auto}.tui-editor-socket .details-wrapper_rendered summary:hover,.tui-editor-socket .t-details-wrapper_rendered summary:hover{background:var(--tui-base-02)}.tui-editor-socket details[open]+.details-arrow,.tui-editor-socket details[open]+.t-details-arrow{top:1.75rem;transform:rotate(225deg)}.tui-editor-socket pre{white-space:pre-wrap;word-break:break-word;border-radius:.25rem;margin:1rem 0;padding:.75rem 1rem;font-family:Courier,monospace;color:var(--tui-text-02);background:var(--tui-base-02)}.tui-editor-socket .tui-group-node{display:flex;flex-direction:row}.tui-editor-socket .tui-group-node:hover>.tui-group-pointer{pointer-events:auto;opacity:1}.tui-editor-socket .tui-group-pointer{opacity:0;min-height:.8125rem;max-height:.8125rem;min-width:.8125rem;max-width:.8125rem;margin:.3125rem .3125rem 0 0;cursor:grab;background-image:url(\'data:image/svg+xml;charset=UTF-8,\');background-repeat:no-repeat;background-size:contain;background-position:center}.tui-editor-socket [data-mode=onDark] .tui-group-pointer{background-image:url(\'data:image/svg+xml;charset=UTF-8,\')}\n'],encapsulation:2,changeDetection:0}),t})()},19586:(t,e,n)=>{n.d(e,{a:()=>R});var o=n(12057),i=n(74788),r=n(24751),s=n(64642),a=n(67274),l=n(51618),c=n(18892),d=n(86114),u=n(71831),h=n(39425),p=n(87874),f=n(46782),m=n(46015),g=n(42),b=n(55788),v=n(17999),y=n(96281),w=n(66654),x=n(16331),k=n(82335),C=n(80475),M=n(62541),S=n(37365),A=n(96152),O=n(87429),T=n(98230),N=n(41039);function E(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-toolbar",7),i.NdJ("fileAttached",(function(e){return i.CHM(t),i.oxw(2).fileAttached.emit(e)})),i.Hsn(1,1),i.qZA()}if(2&t){const t=i.oxw(2);i.Q6J("disabled",!t.interactive)("tools",t.tools)}}function I(t,e){if(1&t&&(i.TgZ(0,"div",8),i._uU(1),i.qZA()),2&t){const t=i.oxw(2);i.xp6(1),i.hij(" ",t.exampleText," ")}}function D(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-edit-link",13,14),i.NdJ("addLink",(function(e){i.CHM(t);const n=i.MAs(1),o=i.oxw(3);return n.anchorMode?o.addAnchor(e):o.addLink(e)}))("removeLink",(function(){i.CHM(t);const e=i.MAs(1),n=i.oxw(3);return e.anchorMode?n.removeAnchor():n.removeLink()})),i.qZA()}}function P(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-scrollbar",9),i.NdJ("mousedown",(function(e){return i.CHM(t),i.oxw(2).focus(e)})),i.TgZ(1,"div",10),i.TgZ(2,"tui-editor-socket",11),i.NdJ("stateChange",(function(){return 0}))("valueChange",(function(e){return i.CHM(t),i.oxw(2).onModelChange(e)})),i.qZA(),i.qZA(),i.YNc(3,D,2,0,"ng-template",null,12,i.W1O),i._UZ(5,"tui-editor-portal-host"),i.qZA()}if(2&t){const t=i.MAs(4),e=i.oxw(2);i.xp6(1),i.Q6J("tuiDropdown",t)("tuiDropdownSelection",e.dropdownSelectionHandler),i.xp6(1),i.Q6J("editable",e.interactive)("value",e.value)}}function H(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"div",1),i.NdJ("tuiActiveZoneChange",(function(e){return i.CHM(t),i.oxw().onActiveZone(e)})),i.TgZ(1,"div",2),i.YNc(2,E,2,2,"tui-toolbar",3),i.TgZ(3,"div",4),i.Hsn(4),i.qZA(),i.YNc(5,I,2,1,"div",5),i.qZA(),i.YNc(6,P,6,4,"tui-scrollbar",6),i.qZA()}if(2&t){const t=e.ngIf,n=i.oxw();i.Q6J("disabled",n.disabled)("focus",n.computedFocused)("hover",n.pseudoHover)("invalid",n.computedInvalid)("readOnly",n.readOnly),i.xp6(2),i.Q6J("ngIf",t),i.xp6(1),i.ekj("t-placeholder_raised",n.placeholderRaised),i.xp6(2),i.Q6J("ngIf",n.hasExampleText),i.xp6(1),i.Q6J("ngIf",t)}}const L=["*",[["tools"]]],_=["*","tools"];let R=(()=>{class t extends s.M$T{constructor(t,e,n,o,r,s,a,l){super(t,e,a),this.editorLoaded$=n,this.editorService=o,this.contentProcessor=r,this.doc=s,this.options=l,this.exampleText="",this.tools=c.Db,this.fileAttached=new i.vpe,this.focused=!1,this.isSelectionLink=t=>this.currentFocusedNodeIsTextAnchor(t)||this.currentFocusedNodeIsImageAnchor,this.editorLoaded$.pipe((0,p.g)(0),(0,f.R)(this.destroy$)).subscribe((()=>this.patchContentEditableElement()))}get nativeFocusableElement(){var t,e;return this.computedDisabled?null:(null===(e=null===(t=this.el)||void 0===t?void 0:t.nativeElement)||void 0===e?void 0:e.querySelector("[contenteditable].ProseMirror"))||null}get dropdownSelectionHandler(){return this.focused?this.isSelectionLink:s.IyD}get editor(){return this.editorService.getOriginTiptapEditor()?this.editorService:null}get placeholderRaised(){return this.computedFocused&&!this.readOnly||this.hasValue}get hasExampleText(){return!!this.exampleText&&this.computedFocused&&!this.hasValue&&!this.readOnly}writeValue(t){var e;if(t===this.value)return;const n=this.contentProcessor(t||"");super.writeValue(n),n!==t&&(null===(e=this.control)||void 0===e||e.setValue(n,{onlySelf:!1,emitEvent:!1,emitModelToViewChange:!1,emitViewToModelChange:!1}))}onActiveZone(t){var e;this.focused=t,this.updateFocused(t),null===(e=this.control)||void 0===e||e.updateValueAndValidity()}onModelChange(t){this.value=t}addAnchor(t){var e;null===(e=this.editor)||void 0===e||e.setAnchor(t)}removeAnchor(){var t;null===(t=this.editor)||void 0===t||t.removeAnchor()}addLink(t){var e,n;null===(e=this.editor)||void 0===e||e.selectClosest(),null===(n=this.editor)||void 0===n||n.setLink(t)}removeLink(){var t;null===(t=this.editor)||void 0===t||t.unsetLink()}focus(t){var e,n;(null===(e=this.nativeFocusableElement)||void 0===e?void 0:e.contains(t.target))||(t.preventDefault(),null===(n=this.nativeFocusableElement)||void 0===n||n.focus())}ngOnDestroy(){var t;null===(t=this.editor)||void 0===t||t.destroy()}getFallbackValue(){return""}currentFocusedNodeIsTextAnchor(t){var e,n;return!!(null===(n=null===(e=t.startContainer.parentElement)||void 0===e?void 0:e.closest("a"))||void 0===n?void 0:n.contains(this.focusNode))&&(0,h.nC)(t)}get focusNode(){var t,e;return null!==(e=null===(t=this.doc.getSelection())||void 0===t?void 0:t.focusNode)&&void 0!==e?e:null}get hasValue(){return!!this.value}get currentFocusedNodeIsImageAnchor(){var t,e,n;return"A"===(null===(t=this.focusNode)||void 0===t?void 0:t.nodeName)&&["IMG","TUI-IMAGE-EDITOR"].includes(null===(n=null===(e=this.focusNode)||void 0===e?void 0:e.childNodes[0])||void 0===n?void 0:n.nodeName)}patchContentEditableElement(){var t,e;null===(t=this.nativeFocusableElement)||void 0===t||t.setAttribute("translate",this.options.translate),null===(e=this.nativeFocusableElement)||void 0===e||e.setAttribute("spellcheck",String(this.options.spellcheck))}}return t.ɵfac=function(e){return new(e||t)(i.Y36(r.a5,10),i.Y36(i.sBO),i.Y36(u.ZW),i.Y36(d.$3),i.Y36(u.F1),i.Y36(o.K0),i.Y36(u.bK,8),i.Y36(u.mJ))},t.ɵcmp=i.Xpm({type:t,selectors:[["tui-editor"]],viewQuery:function(t,e){if(1&t&&(i.Gf(d.JU,5,i.SBq),i.Gf(l.M6,5)),2&t){let t;i.iGM(t=i.CRH())&&(e.el=t.first),i.iGM(t=i.CRH())&&(e.toolbar=t.first)}},inputs:{exampleText:"exampleText",tools:"tools"},outputs:{fileAttached:"fileAttached"},features:[i._Bn([(0,s.FTc)(t),(0,s.f$T)({delay:a.GcO}),m.m]),i.qOj],ngContentSelectors:_,decls:2,vars:3,consts:[["appearance","textfield","tuiWrapper","","class","t-wrapper",3,"disabled","focus","hover","invalid","readOnly","tuiActiveZoneChange",4,"ngIf"],["appearance","textfield","tuiWrapper","",1,"t-wrapper",3,"disabled","focus","hover","invalid","readOnly","tuiActiveZoneChange"],[1,"t-toolbar-wrapper"],[3,"disabled","tools","fileAttached",4,"ngIf"],[1,"t-placeholder"],["class","t-example-text",4,"ngIf"],["tuiEditorPortal","","class","t-scrollbar",3,"mousedown",4,"ngIf"],[3,"disabled","tools","fileAttached"],[1,"t-example-text"],["tuiEditorPortal","",1,"t-scrollbar",3,"mousedown"],["tuiDropdownLimitWidth","auto","tuiDropdownSelectionPosition","tag",3,"tuiDropdown","tuiDropdownSelection"],["tuiTiptapEditor","",1,"tui-editor-socket",3,"editable","value","stateChange","valueChange"],["dropdown",""],[3,"addLink","removeLink"],["link",""]],template:function(t,e){1&t&&(i.F$t(L),i.YNc(0,H,7,10,"div",0),i.ALo(1,"async")),2&t&&i.Q6J("ngIf",i.lcZ(1,1,e.editorLoaded$))},directives:[o.O5,g.o,b.e,v.M,y.I,w.A,x.Ek,k.t,C.V,M.A,S.y,A.D,O.J,T.d,N.l],pipes:[o.Ov],styles:["[_nghost-%COMP%]{position:relative;z-index:0;display:block;font:var(--tui-font-text-m);border-radius:var(--tui-radius-m);max-height:inherit;min-height:10rem;box-sizing:border-box}.t-wrapper[_ngcontent-%COMP%]{display:flex;max-height:inherit;min-height:inherit;cursor:text;overflow:hidden;flex-direction:column;border-radius:inherit}.t-placeholder[_ngcontent-%COMP%]{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;font:var(--tui-font-text-s);color:var(--tui-text-02);pointer-events:none;will-change:transform;transform:translateY(0);margin:1rem 1rem -1rem;min-height:1.625rem;width:95%;font-size:.9375rem}.t-placeholder_raised[_ngcontent-%COMP%]{transform:translateY(-.625rem)}[data-size=m][_nghost-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{font:var(--tui-font-text-xs);line-height:1.25rem;transform:translateY(-.5rem);letter-spacing:.025rem}._invalid[_nghost-%COMP%]:not(._focused) .t-placeholder_raised[_ngcontent-%COMP%], ._invalid[_nghost-%COMP%]:not(._focused):hover .t-placeholder_raised[_ngcontent-%COMP%]{color:var(--tui-error-fill)}._invalid[_nghost-%COMP%]:not(._focused) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%], ._invalid[_nghost-%COMP%]:not(._focused):hover [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{color:var(--tui-error-fill-night)}._focused[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=m]._focused._label-outside[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused._label-outside[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-03)}[data-size=l][_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%]{font:var(--tui-font-text-m);line-height:1.25rem}[data-size=l][_nghost-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{font-size:.8156rem}[data-size=m]._focused[_nghost-%COMP%]:not(._label-outside) .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused[_nghost-%COMP%]:not(._label-outside) .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-01)}[tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-02-night)}[data-size=m]._focused[_nghost-%COMP%]:not(._label-outside) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused[_nghost-%COMP%]:not(._label-outside) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-01-night)}._focused[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=m]._focused._label-outside[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused._label-outside[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-02-night)}@supports (-webkit-hyphens: none){.t-placeholder[_ngcontent-%COMP%]{will-change:unset;transition-property:transform,color,letter-spacing}}.t-placeholder_raised[_ngcontent-%COMP%]{width:110%}.t-placeholder[_ngcontent-%COMP%]:empty{min-height:.8rem}.t-example-text[_ngcontent-%COMP%]{position:absolute;left:1rem;margin-top:1.6rem;color:var(--tui-base-06);letter-spacing:normal;text-transform:none}.t-example-text_light[_ngcontent-%COMP%]{color:var(--tui-text-03-night)}.t-example-text_dark[_ngcontent-%COMP%]{color:var(--tui-text-03)}.t-scrollbar[_ngcontent-%COMP%]{display:flex;border-bottom:.3125rem solid transparent;padding-bottom:1.3125rem;box-sizing:border-box;flex:1}"],changeDetection:0}),t})()},46015:(t,e,n)=>{n.d(e,{m:()=>h});var o=n(74788),i=n(86114),r=n(71831),s=n(74235),a=n(9112),l=n(15257),c=n(88002),d=n(47349),u=n(22648);const h=[{provide:r.F4,deps:[r.Wf],useFactory:t=>{const e=new s.t(1);return Promise.all(t).then((t=>e.next(t))),e}},{provide:r.Y1,deps:[o.Qsj],useFactory:t=>t.createElement("div")},{provide:r.ZW,deps:[r.Y1,r.F4,r.bG],useFactory:(t,e,n)=>(0,a.aj)([n,e]).pipe((0,l.q)(1),(0,c.U)((([e,n])=>new e({element:t,extensions:n}))),(0,d.d)({bufferSize:1,refCount:!0}))},i.$3,u.Y]},98230:(t,e,n)=>{n.d(e,{d:()=>r});var o=n(64642),i=n(74788);let r=(()=>{class t extends o.ErH{}return t.ɵfac=function(){let e;return function(n){return(e||(e=i.n5z(t)))(n||t)}}(),t.ɵcmp=i.Xpm({type:t,selectors:[["tui-editor-portal-host"]],features:[i._Bn([{provide:o.N9Y,useExisting:o.ae2},{provide:o.ErH,useExisting:t}]),i.qOj],decls:2,vars:0,consts:[["viewContainer",""]],template:function(t,e){1&t&&i.GkF(0,null,0)},styles:["[_nghost-%COMP%]{position:absolute;top:0;left:0;display:block;height:100%;width:100%;pointer-events:none}"],changeDetection:0}),t})()},66654:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(74788),i=n(64642),r=n(67274),s=n(22648);let a=(()=>{class t extends r.O4x{constructor(t){super(),this.el=t,this.type="viewport"}getClientRect(){return this.el.nativeElement.getBoundingClientRect()}}return t.ɵfac=function(e){return new(e||t)(o.Y36(o.SBq))},t.ɵdir=o.lG2({type:t,selectors:[["","tuiEditorPortal",""]],features:[o._Bn([{provide:i.ae2,useExisting:s.Y},(0,r.ckU)(t)]),o.qOj]}),t})()},22648:(t,e,n)=>{n.d(e,{Y:()=>r});var o=n(64642),i=n(74788);let r=(()=>{class t extends o.N9Y{}return t.ɵfac=function(){let e;return function(n){return(e||(e=i.n5z(t)))(n||t)}}(),t.ɵprov=i.Yz7({token:t,factory:t.ɵfac}),t})()},31496:(t,e,n)=>{n.d(e,{j:()=>v});var o=n(97582),i=n(74788),r=n(24751),s=n(91211),a=n(64642),l=n(67274),c=n(39425),d=n(98778),u=n(75526),h=n(19042),p=n(61183),f=n(26383),m=n(55788);function g(t,e){if(1&t&&i._UZ(0,"div",4),2&t){const t=i.oxw();i.Udp("background",t.background)}}function b(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"tui-color-selector",5),i.NdJ("colorChange",(function(e){return i.CHM(t),i.oxw().value=e})),i.qZA()}if(2&t){const t=e.$implicit,n=i.oxw();i.Q6J("colors",n.colors)("tuiActiveZoneParent",t)("color",n.value)}}class v extends a.M$T{constructor(t,e,n){super(t,e),this.domSanitizer=n,this.colors=new Map,this.open=!1}get nativeFocusableElement(){return this.computedDisabled||!this.textfield?null:this.textfield.nativeFocusableElement}get focused(){return!!this.dropdown&&this.dropdown.focused}get background(){return this.sanitize(this.value,this.domSanitizer)}onClick(){this.open=!this.open}onValueChange(t){this.value=t}onFocused(t){this.updateFocused(t)}getFallbackValue(){return"#000000"}sanitize(t,e){return t.startsWith("linear-gradient(")?e.bypassSecurityTrustStyle((0,c.CH)((0,c._N)((0,c.U5)(t)))):t}}v.ɵfac=function(t){return new(t||v)(i.Y36(r.a5,10),i.Y36(i.sBO),i.Y36(s.H7))},v.ɵcmp=i.Xpm({type:v,selectors:[["tui-input-color"]],viewQuery:function(t,e){if(1&t&&(i.Gf(l.ycg,5),i.Gf(l.o1K,5)),2&t){let t;i.iGM(t=i.CRH())&&(e.textfield=t.first),i.iGM(t=i.CRH())&&(e.dropdown=t.first)}},hostBindings:function(t,e){1&t&&i.NdJ("click",(function(){return e.onClick()}))},inputs:{colors:"colors"},features:[i._Bn([],[(0,l.fxH)({maxHeight:600})]),i.qOj],ngContentSelectors:["*"],decls:7,vars:12,consts:[[1,"t-wrapper",3,"content","open","openChange"],[1,"t-textfield",3,"disabled","focusable","invalid","nativeId","pseudoActive","pseudoFocus","pseudoHover","readOnly","tuiTextfieldIconLeft","value","valueChange","focusedChange"],["color",""],["picker",""],[1,"t-color"],[3,"colors","tuiActiveZoneParent","color","colorChange"]],template:function(t,e){if(1&t&&(i.F$t(),i.TgZ(0,"tui-hosted-dropdown",0),i.NdJ("openChange",(function(t){return e.open=t})),i.TgZ(1,"tui-primitive-textfield",1),i.NdJ("valueChange",(function(t){return e.value=t}))("focusedChange",(function(t){return e.onFocused(t)})),i.Hsn(2),i.qZA(),i.qZA(),i.YNc(3,g,1,2,"ng-template",null,2,i.W1O),i.YNc(5,b,1,3,"ng-template",null,3,i.W1O)),2&t){const t=i.MAs(4),n=i.MAs(6);i.Q6J("content",n)("open",e.open),i.xp6(1),i.Q6J("disabled",e.disabled)("focusable",e.focusable)("invalid",e.computedInvalid)("nativeId",e.nativeId)("pseudoActive",e.pseudoActive)("pseudoFocus",e.computedFocused)("pseudoHover",e.pseudoHover)("readOnly",e.readOnly)("tuiTextfieldIconLeft",t)("value",e.value)}},directives:[d.o,u.y,h.B,p.a,f.s,m.e],styles:["[_nghost-%COMP%]{display:block;border-radius:var(--tui-radius-m);text-align:left}.t-wrapper[_ngcontent-%COMP%]{display:flex;border-radius:inherit}.t-textfield[_ngcontent-%COMP%]{border-radius:inherit;text-align:inherit}.t-color[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;box-shadow:inset 0 0 0 1px var(--tui-base-03-dark);border-radius:.125rem;pointer-events:auto!important}"],changeDetection:0}),(0,o.gn)([a.UMq],v.prototype,"sanitize",null)},20719:(t,e,n)=>{n.d(e,{X:()=>w});var o=n(86114),i=n(71831),r=n(9112),s=n(88002),a=n(74788),l=n(12057),c=n(42486),d=n(98778),u=n(18289),h=n(44099),p=n(13938),f=n(10406),m=n(63790),g=n(51928);function b(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"div",6),a.TgZ(1,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.onAlign("left")})),a.qZA(),a.TgZ(2,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.onAlign("center")})),a.qZA(),a.TgZ(3,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.onAlign("right")})),a.qZA(),a.TgZ(4,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.onAlign("justify")})),a.qZA(),a.qZA()}if(2&t){const t=a.oxw().tuiLet,e=a.oxw().ngIf,n=a.oxw();a.xp6(1),a.Q6J("icon",n.options.icons.textAlignLeft)("pseudoActive",!(null==t||!t.left))("tuiHint",e.justifyLeft),a.xp6(1),a.Q6J("icon",n.options.icons.textAlignCenter)("pseudoActive",!(null==t||!t.center))("tuiHint",e.justifyCenter),a.xp6(1),a.Q6J("icon",n.options.icons.textAlignRight)("pseudoActive",!(null==t||!t.right))("tuiHint",e.justifyRight),a.xp6(1),a.Q6J("icon",n.options.icons.textAlignJustify)("pseudoActive",!(null==t||!t.justify))("tuiHint",e.justifyFull)}}function v(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",2,3),a._UZ(2,"button",4),a.YNc(3,b,5,12,"ng-template",null,5,a.W1O),a.qZA()),2&t){const t=a.MAs(1),e=a.MAs(4),n=a.oxw().ngIf,o=a.oxw();a.Q6J("content",e),a.xp6(2),a.Q6J("focusable",t.open)("icon",o.options.icons.textAlignPreview)("pseudoActive",t.open)("tuiHint",n.justify)}}function y(t,e){if(1&t&&(a.ynx(0),a.YNc(1,v,5,5,"tui-hosted-dropdown",1),a.ALo(2,"async"),a.BQk()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("tuiLet",a.lcZ(2,1,t.alignState$))}}let w=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.alignState$=(0,r.aj)([this.editor.isActive$({textAlign:"left"}),this.editor.isActive$({textAlign:"right"}),this.editor.isActive$({textAlign:"center"}),this.editor.isActive$({textAlign:"justify"})]).pipe((0,s.U)((([t,e,n,o])=>({left:t,right:e,center:n,justify:o}))))}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-align-content"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"content",4,"tuiLet"],[3,"content"],["align",""],["appearance","icon","automation-id","toolbar__align-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["alignDropdown",""],[1,"t-dropdown"],["appearance","icon","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"icon","pseudoActive","tuiHint","click"]],template:function(t,e){1&t&&(a.YNc(0,y,3,3,"ng-container",0),a.ALo(1,"async")),2&t&&a.Q6J("ngIf",a.lcZ(1,1,e.texts$))},directives:[l.O5,c.L,d.o,u.v,h.$,p.D,f.x,m.t,g.D],pipes:[l.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},57289:(t,e,n)=>{n.d(e,{T:()=>w});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(98778),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928),m=n(22545),g=n(12057),b=n(91283);function v(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",5),a.NdJ("click",(function(){const e=a.CHM(t).index;return a.oxw(2).onCode(!!e)})),a._uU(1),a.qZA()}if(2&t){const t=e.$implicit;a.xp6(1),a.hij(" ",t," ")}}function y(t,e){if(1&t&&(a.TgZ(0,"tui-data-list"),a.YNc(1,v,2,1,"button",4),a.ALo(2,"async"),a.qZA()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("ngForOf",a.lcZ(2,1,t.codeOptionsTexts$))}}let w=(()=>{class t{constructor(t,e,n,o){this.options=t,this.editor=e,this.texts$=n,this.codeOptionsTexts$=o,this.hintText$=this.texts$.pipe((0,r.U)((t=>t.code))),this.insideCode$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.isActive("code")||this.editor.isActive("codeBlock"))),(0,s.x)())}onCode(t){t?this.editor.toggleCodeBlock():this.editor.toggleCode()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf),a.Y36(i.Mr))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-code"]],decls:7,vars:9,consts:[[3,"content"],["codes",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["codesDropdown",""],["tuiOption","",3,"click",4,"ngFor","ngForOf"],["tuiOption","",3,"click"]],template:function(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",0,1),a._UZ(2,"button",2),a.ALo(3,"async"),a.ALo(4,"async"),a.YNc(5,y,3,3,"ng-template",null,3,a.W1O),a.qZA()),2&t){const t=a.MAs(1),n=a.MAs(6);a.Q6J("content",n),a.xp6(2),a.Q6J("focusable",t.open)("icon",e.options.icons.code)("pseudoActive",t.open||a.lcZ(3,5,e.insideCode$))("tuiHint",a.lcZ(4,7,e.hintText$))}},directives:[l.o,c.v,d.$,u.D,h.x,p.t,f.D,m.q,g.sg,b.v],pipes:[g.Ov],encapsulation:2,changeDetection:0}),t})()},49382:(t,e,n)=>{n.d(e,{U:()=>g});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(12057),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928);function m(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",1),a.NdJ("click",(function(){return a.CHM(t),a.oxw().removeDetails()})),a.ALo(1,"async"),a.qZA()}if(2&t){const t=e.ngIf,n=a.oxw();a.Q6J("disabled",!!a.lcZ(1,4,n.disabled$))("focusable",!1)("icon",n.options.icons.detailsRemove)("tuiHint",t.removeDetails)}}let g=(()=>{class t{constructor(t,e,n){this.editor=t,this.texts$=e,this.options=n,this.disabled$=this.editor.stateChange$.pipe((0,r.U)((()=>!this.editor.isActive("details"))),(0,s.x)())}removeDetails(){this.editor.removeDetails()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(o.$3),a.Y36(i.rf),a.Y36(i.mJ))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-details-remove"]],decls:2,vars:3,consts:[["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click"]],template:function(t,e){1&t&&(a.YNc(0,m,2,6,"button",0),a.ALo(1,"async")),2&t&&a.Q6J("ngIf",a.lcZ(1,1,e.texts$))},directives:[l.O5,c.v,d.$,u.D,h.x,p.t,f.D],pipes:[l.Ov],encapsulation:2,changeDetection:0}),t})()},18885:(t,e,n)=>{n.d(e,{y:()=>f});var o=n(86114),i=n(71831),r=n(74788),s=n(12057),a=n(18289),l=n(44099),c=n(13938),d=n(10406),u=n(63790),h=n(51928);function p(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"button",1),r.NdJ("click",(function(){return r.CHM(t),r.oxw().setDetails()})),r.qZA()}if(2&t){const t=e.ngIf,n=r.oxw();r.Q6J("focusable",!1)("icon",n.options.icons.detailsAdd)("tuiHint",t.setDetails)}}let f=(()=>{class t{constructor(t,e,n){this.editor=t,this.texts$=e,this.options=n}setDetails(){this.editor.setDetails()}}return t.ɵfac=function(e){return new(e||t)(r.Y36(o.$3),r.Y36(i.rf),r.Y36(i.mJ))},t.ɵcmp=r.Xpm({type:t,selectors:[["tui-details"]],decls:2,vars:3,consts:[["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","tuiHint","click"]],template:function(t,e){1&t&&(r.YNc(0,p,1,3,"button",0),r.ALo(1,"async")),2&t&&r.Q6J("ngIf",r.lcZ(1,1,e.texts$))},directives:[s.O5,a.v,l.$,c.D,d.x,u.t,h.D],pipes:[s.Ov],encapsulation:2,changeDetection:0}),t})()},73688:(t,e,n)=>{n.d(e,{m:()=>x});var o=n(64642),i=n(86114),r=n(71831),s=n(88002),a=n(74788),l=n(98778),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928),m=n(22545),g=n(12057),b=n(91283);const v=function(){return{}};function y(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",5),a.NdJ("click",(function(){const e=a.CHM(t).$implicit;return a.oxw(2).setFontOption(e)})),a.ALo(1,"lowercase"),a._uU(2),a.qZA()}if(2&t){const t=e.$implicit;a.Udp("font-family",t.family)("font-size",t.px,"px")("font-weight",t.weight),a.Q6J("ngClass",(null==t?null:t.ngClass)||a.DdM(12,v))("ngStyle",(null==t?null:t.ngStyle)||a.DdM(13,v)),a.uIk("automation-id","tui_font__"+a.lcZ(1,10,t.name||"")),a.xp6(2),a.hij(" ",t.name," ")}}function w(t,e){if(1&t&&(a.TgZ(0,"tui-data-list"),a.YNc(1,y,3,14,"button",4),a.ALo(2,"async"),a.qZA()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("ngForOf",a.lcZ(2,1,t.fontsOptions$))}}let x=(()=>{class t{constructor(t,e,n,o){this.options=t,this.editor=e,this.texts$=n,this.fontOptionsTexts$=o,this.fontsOptions$=this.fontOptionsTexts$.pipe((0,s.U)((t=>this.options.fontOptions(t)))),this.fontText$=this.texts$.pipe((0,s.U)((t=>t.font)))}onClick({headingLevel:t,px:e}){this.setFontOption({headingLevel:t,px:e})}setFontOption({headingLevel:t,px:e}){this.clearPreviousTextStyles(),t?this.editor.setHeading(t):this.editor.setParagraph({fontSize:(0,o.O9r)(e||0)})}clearPreviousTextStyles(){this.editor.removeEmptyTextStyle(),this.editor.toggleMark("textStyle")}}return t.ɵfac=function(e){return new(e||t)(a.Y36(r.mJ),a.Y36(i.$3),a.Y36(r.rf),a.Y36(r.UN))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-font-size"]],decls:6,vars:7,consts:[[3,"content"],["fonts",""],["appearance","icon","automation-id","toolbar__font-size-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["fontsDropdown",""],["tuiOption","",3,"ngClass","ngStyle","fontFamily","fontSize","fontWeight","click",4,"ngFor","ngForOf"],["tuiOption","",3,"ngClass","ngStyle","click"]],template:function(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",0,1),a._UZ(2,"button",2),a.ALo(3,"async"),a.YNc(4,w,3,3,"ng-template",null,3,a.W1O),a.qZA()),2&t){const t=a.MAs(1),n=a.MAs(5);a.Q6J("content",n),a.xp6(2),a.Q6J("focusable",t.open)("icon",e.options.icons.fontSize)("pseudoActive",t.open)("tuiHint",a.lcZ(3,5,e.fontText$))}},directives:[l.o,c.v,d.$,u.D,h.x,p.t,f.D,m.q,g.sg,b.v,g.mk,g.PC],pipes:[g.Ov,g.i8],encapsulation:2,changeDetection:0}),t})()},81618:(t,e,n)=>{n.d(e,{h:()=>S});var o=n(18892),i=n(86114),r=n(95161),s=n(71831),a=n(9112),l=n(88002),c=n(74788),d=n(12057),u=n(98778),h=n(18289),p=n(44099),f=n(13938),m=n(10406),g=n(63790),b=n(51928);function v(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",8),c.NdJ("click",(function(){return c.CHM(t),c.oxw(4).editor.toggleBold()})),c.qZA()}if(2&t){const t=c.oxw(2).ngIf,e=c.oxw().ngIf,n=c.oxw();c.Q6J("icon",n.options.icons.fontStyleBold)("pseudoActive",t.bold)("tuiHint",e.bold)}}function y(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",8),c.NdJ("click",(function(){return c.CHM(t),c.oxw(4).editor.toggleItalic()})),c.qZA()}if(2&t){const t=c.oxw(2).ngIf,e=c.oxw().ngIf,n=c.oxw();c.Q6J("icon",n.options.icons.fontStyleItalic)("pseudoActive",t.italic)("tuiHint",e.italic)}}function w(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",8),c.NdJ("click",(function(){return c.CHM(t),c.oxw(4).editor.toggleUnderline()})),c.qZA()}if(2&t){const t=c.oxw(2).ngIf,e=c.oxw().ngIf,n=c.oxw();c.Q6J("icon",n.options.icons.fontStyleUnderline)("pseudoActive",t.underline)("tuiHint",e.underline)}}function x(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",8),c.NdJ("click",(function(){return c.CHM(t),c.oxw(4).editor.toggleStrike()})),c.qZA()}if(2&t){const t=c.oxw(2).ngIf,e=c.oxw().ngIf,n=c.oxw();c.Q6J("icon",n.options.icons.fontStyleStrike)("pseudoActive",t.strike)("tuiHint",e.strikeThrough)}}function k(t,e){if(1&t&&(c.TgZ(0,"div",6),c.YNc(1,v,1,3,"button",7),c.YNc(2,y,1,3,"button",7),c.YNc(3,w,1,3,"button",7),c.YNc(4,x,1,3,"button",7),c.qZA()),2&t){const t=c.oxw(3);c.xp6(1),c.Q6J("ngIf",t.isEnabled(t.TuiEditorTool.Bold)),c.xp6(1),c.Q6J("ngIf",t.isEnabled(t.TuiEditorTool.Italic)),c.xp6(1),c.Q6J("ngIf",t.isEnabled(t.TuiEditorTool.Underline)),c.xp6(1),c.Q6J("ngIf",t.isEnabled(t.TuiEditorTool.Strikethrough))}}function C(t,e){if(1&t&&(c.TgZ(0,"tui-hosted-dropdown",2,3),c._UZ(2,"button",4),c.YNc(3,k,5,4,"ng-template",null,5,c.W1O),c.qZA()),2&t){const t=e.ngIf,n=c.MAs(1),o=c.MAs(4),i=c.oxw().ngIf,r=c.oxw();c.Q6J("content",o),c.xp6(2),c.Q6J("focusable",n.open)("icon",r.options.icons.fontStylePreview)("pseudoActive",n.open||t.bold||t.italic||t.underline||t.strike)("tuiHint",i.fontStyle)}}function M(t,e){if(1&t&&(c.ynx(0),c.YNc(1,C,5,5,"tui-hosted-dropdown",1),c.ALo(2,"async"),c.BQk()),2&t){const t=c.oxw();c.xp6(1),c.Q6J("ngIf",c.lcZ(2,1,t.fontStyleState$))}}let S=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.toolsSet=new Set(o.Db),this.TuiEditorTool=r._,this.fontStyleState$=(0,a.aj)([this.editor.isActive$("bold"),this.editor.isActive$("italic"),this.editor.isActive$("underline"),this.editor.isActive$("strike")]).pipe((0,l.U)((([t,e,n,o])=>({bold:t,italic:e,underline:n,strike:o}))))}set enabledTools(t){this.toolsSet=new Set(t)}isEnabled(t){return this.toolsSet.has(t)}}return t.ɵfac=function(e){return new(e||t)(c.Y36(s.mJ),c.Y36(i.$3),c.Y36(s.rf))},t.ɵcmp=c.Xpm({type:t,selectors:[["tui-font-style"]],inputs:{enabledTools:"enabledTools"},decls:2,vars:3,consts:[[4,"ngIf"],[3,"content",4,"ngIf"],[3,"content"],["format",""],["appearance","icon","automation-id","toolbar__font-style-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["formatDropdown",""],[1,"t-dropdown"],["appearance","icon","size","s","tuiIconButton","","type","button","class","t-option t-option_margin",3,"icon","pseudoActive","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"icon","pseudoActive","tuiHint","click"]],template:function(t,e){1&t&&(c.YNc(0,M,3,3,"ng-container",0),c.ALo(1,"async")),2&t&&c.Q6J("ngIf",c.lcZ(1,1,e.texts$))},directives:[d.O5,u.o,h.v,p.$,f.D,m.x,g.t,b.D],pipes:[d.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},52187:(t,e,n)=>{n.d(e,{d:()=>m});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(18289),c=n(44099),d=n(13938),u=n(10406),h=n(63790),p=n(51928),f=n(12057);let m=(()=>{class t{constructor(t,e,n){this.editor=t,this.texts$=e,this.options=n,this.insertGroupText$=this.texts$.pipe((0,r.U)((t=>t.insertGroup))),this.removeGroupText$=this.texts$.pipe((0,r.U)((t=>t.removeGroup))),this.disabled$=this.editor.stateChange$.pipe((0,r.U)((()=>!this.editor.isActive("group"))),(0,s.x)())}addGroup(){this.editor.setGroup()}removeGroup(){this.editor.removeGroup()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(o.$3),a.Y36(i.rf),a.Y36(i.mJ))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-editor-group-tool"]],decls:5,vars:13,consts:[["appearance","icon","automation-id","toolbar__group-add-button","size","s","tuiHintDescribe","","tuiIconButton","","type","button",3,"focusable","icon","tuiHint","click"],["appearance","icon","automation-id","toolbar__group-remove-button","size","s","tuiHintDescribe","","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click"]],template:function(t,e){1&t&&(a.TgZ(0,"button",0),a.NdJ("click",(function(){return e.addGroup()})),a.ALo(1,"async"),a.qZA(),a.TgZ(2,"button",1),a.NdJ("click",(function(){return e.removeGroup()})),a.ALo(3,"async"),a.ALo(4,"async"),a.qZA()),2&t&&(a.Q6J("focusable",!1)("icon",e.options.icons.groupAdd)("tuiHint",a.lcZ(1,7,e.insertGroupText$)),a.xp6(2),a.Q6J("disabled",!!a.lcZ(3,9,e.disabled$))("focusable",!1)("icon",e.options.icons.groupRemove)("tuiHint",a.lcZ(4,11,e.removeGroupText$)))},directives:[l.v,c.$,d.D,u.x,h.t,p.D],pipes:[f.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},73545:(t,e,n)=>{n.d(e,{U:()=>C});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(42486),c=n(98778),d=n(16331),u=n(18289),h=n(44099),p=n(13938),f=n(10406),m=n(63790),g=n(51928),b=n(12057),v=n(59113),y=n(55788);function w(t,e){if(1&t&&a._UZ(0,"div",6),2&t){const t=a.oxw().tuiLet;a.Udp("background",t)}}function x(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"tui-palette",7),a.NdJ("selectedColor",(function(e){return a.CHM(t),a.oxw(2).editor.setBackgroundColor(e)})),a.qZA()}if(2&t){const t=e.$implicit,n=a.oxw(2);a.Q6J("colors",n.colors)("tuiActiveZoneParent",t)}}function k(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",1,2),a._UZ(2,"button",3),a.ALo(3,"async"),a.YNc(4,w,1,2,"div",4),a.YNc(5,x,1,2,"ng-template",null,5,a.W1O),a.qZA()),2&t){const t=e.tuiLet,n=a.MAs(1),o=a.MAs(6),i=a.oxw();a.Q6J("content",o)("tuiDropdownMaxHeight",999),a.xp6(2),a.Q6J("focusable",n.open)("icon",i.options.icons.textHilite)("pseudoActive",n.open)("tuiHint",a.lcZ(3,7,i.backColorText$)),a.xp6(2),a.Q6J("ngIf",!i.isBlankColor(t||""))}}let C=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.colors=this.options.colors,this.backgroundColor$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.getBackgroundColor()||this.options.blankColor)),(0,s.x)()),this.backColorText$=this.texts$.pipe((0,r.U)((t=>t.backColor)))}isBlankColor(t){return t===this.options.blankColor}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-highlight-color"]],inputs:{colors:"colors"},decls:2,vars:3,consts:[[3,"content","tuiDropdownMaxHeight",4,"tuiLet"],[3,"content","tuiDropdownMaxHeight"],["hilite",""],["appearance","icon","automation-id","toolbar__hilite-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",1,"t-tool",3,"focusable","icon","pseudoActive","tuiHint"],["class","t-plate",3,"background",4,"ngIf"],["hiliteDropdown",""],[1,"t-plate"],[1,"t-color-picker",3,"colors","tuiActiveZoneParent","selectedColor"]],template:function(t,e){1&t&&(a.YNc(0,k,7,9,"tui-hosted-dropdown",0),a.ALo(1,"async")),2&t&&a.Q6J("tuiLet",a.lcZ(1,1,e.backgroundColor$))},directives:[l.L,c.o,d.Ek,u.v,h.$,p.D,f.x,m.t,g.D,b.O5,v.R,y.e],pipes:[b.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},78790:(t,e,n)=>{n.d(e,{pu:()=>a,P_:()=>l,y9:()=>c,jP:()=>h,p7:()=>d,Zv:()=>u,XC:()=>f,Ur:()=>m,mp:()=>g,iA:()=>v,er:()=>y,__:()=>w,_t:()=>x}),n(20719);var o=n(12057),i=n(64642),r=n(67274),s=n(74788);let a=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS,i.WDk]]}),t})();n(57289);let l=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS,r.pcV]]}),t})();n(18885);let c=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.fNO,r.goS]]}),t})();n(49382),n(73688);let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS,r.pcV]]}),t})();n(81618);let u=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS]]}),t})();n(52187);let h=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.fNO,r.goS]]}),t})();n(73545);var p=n(96472);let f=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,p.VM,r.goS,r.dpK,i.Ah6,i.WDk]]}),t})();n(30928);let m=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.fNO,r.goS,i.WDk]]}),t})();n(61899);let g=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,p.VM,r.fNO,r.goS,i.Ah6,r.dpK,i.WDk]]}),t})();n(31433),n(87048);let b=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,i.IhY]]}),t})(),v=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.dpK,r.fNO,r.goS,b]]}),t})();n(41218);let y=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.fNO,r.goS,i.WDk]]}),t})();n(34773);let w=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.jhF,r.goS,r.fNO,r.pcV,i.WDk]]}),t})();n(57891);let x=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=s.oAB({type:t}),t.ɵinj=s.cJS({imports:[[o.ez,r.fNO,r.jhF,r.dpK,r.goS,p.VM,i.Ah6,i.WDk]]}),t})()},30928:(t,e,n)=>{n.d(e,{w:()=>w});var o=n(86114),i=n(71831),r=n(9112),s=n(88002),a=n(74788),l=n(12057),c=n(42486),d=n(98778),u=n(18289),h=n(44099),p=n(13938),f=n(10406),m=n(63790),g=n(51928);function b(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"div",6),a.TgZ(1,"button",7),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.toggleUnorderedList()})),a.qZA(),a.TgZ(2,"button",8),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).editor.toggleOrderedList()})),a.qZA(),a.TgZ(3,"button",9),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).sinkListItem()})),a.qZA(),a.TgZ(4,"button",10),a.NdJ("click",(function(){return a.CHM(t),a.oxw(3).liftListItem()})),a.qZA(),a.qZA()}if(2&t){const t=a.oxw().tuiLet,e=a.oxw().ngIf,n=a.oxw();a.xp6(1),a.Q6J("icon",n.options.icons.listUnOrdered)("pseudoActive",!(null==t||!t.unordered))("tuiHint",e.unorderedList),a.xp6(1),a.Q6J("icon",n.options.icons.listOrdered)("pseudoActive",!(null==t||!t.ordered))("tuiHint",e.orderedList),a.xp6(1),a.Q6J("disabled",!(null!=t&&t.ordered||null!=t&&t.unordered))("icon",n.options.icons.indent)("tuiHint",e.indent),a.xp6(1),a.Q6J("disabled",!(null!=t&&t.ordered||null!=t&&t.unordered))("icon",n.options.icons.outdent)("tuiHint",e.outdent)}}function v(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",2,3),a._UZ(2,"button",4),a.YNc(3,b,5,12,"ng-template",null,5,a.W1O),a.qZA()),2&t){const t=e.tuiLet,n=a.MAs(1),o=a.MAs(4),i=a.oxw().ngIf,r=a.oxw();a.Q6J("content",o),a.xp6(2),a.Q6J("focusable",n.open)("icon",r.options.icons.listPreview)("pseudoActive",(null==n?null:n.open)||(null==t?null:t.unordered)||(null==t?null:t.ordered)||!1)("tuiHint",i.list)}}function y(t,e){if(1&t&&(a.ynx(0),a.YNc(1,v,5,5,"tui-hosted-dropdown",1),a.ALo(2,"async"),a.BQk()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("tuiLet",a.lcZ(2,1,t.listState$))}}let w=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.listState$=(0,r.aj)([this.editor.isActive$("orderedList"),this.editor.isActive$("bulletList")]).pipe((0,s.U)((([t,e])=>({ordered:t,unordered:e}))))}sinkListItem(){this.editor.sinkListItem()}liftListItem(){this.editor.liftListItem()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-list-configs"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"content",4,"tuiLet"],[3,"content"],["list",""],["appearance","icon","automation-id","toolbar__ordering-list-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["listDropdown",""],[1,"t-dropdown"],["appearance","icon","automation-id","toolbar__un-ordered-list-button","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"icon","pseudoActive","tuiHint","click"],["appearance","icon","automation-id","toolbar__ordered-list-button","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"icon","pseudoActive","tuiHint","click"],["appearance","icon","automation-id","toolbar_indent-button","size","s","tuiIconButton","","type","button",1,"t-option","t-option_margin",3,"disabled","icon","tuiHint","click"],["appearance","icon","automation-id","toolbar_outdent-button","size","s","tuiIconButton","","type","button",1,"t-option",3,"disabled","icon","tuiHint","click"]],template:function(t,e){1&t&&(a.YNc(0,y,3,3,"ng-container",0),a.ALo(1,"async")),2&t&&a.Q6J("ngIf",a.lcZ(1,1,e.texts$))},directives:[l.O5,c.L,d.o,u.v,h.$,p.D,f.x,m.t,g.D],pipes:[l.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},61899:(t,e,n)=>{n.d(e,{p:()=>S});var o=n(86114),i=n(71831),r=n(9112),s=n(88002),a=n(87519),l=n(74788),c=n(42486),d=n(98778),u=n(16331),h=n(18289),p=n(44099),f=n(13938),m=n(10406),g=n(63790),b=n(51928),v=n(12057),y=n(59113),w=n(55788);function x(t,e){if(1&t&&l._UZ(0,"div",7),2&t){const t=l.oxw(2).tuiLet;l.Udp("background",t)}}function k(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tui-palette",8),l.NdJ("selectedColor",(function(e){l.CHM(t),l.oxw();const n=l.MAs(1);return l.oxw(2).setCellColor(e),n.close()})),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw(3);l.Q6J("colors",n.colors)("tuiActiveZoneParent",t)}}function C(t,e){if(1&t&&(l.TgZ(0,"tui-hosted-dropdown",2,3),l._UZ(2,"button",4),l.ALo(3,"async"),l.YNc(4,x,1,2,"div",5),l.YNc(5,k,1,2,"ng-template",null,6,l.W1O),l.qZA()),2&t){const t=e.tuiLet,n=l.MAs(1),o=l.MAs(6),i=l.oxw().tuiLet,r=l.oxw();l.Q6J("canOpen",!!t)("content",o)("tuiDropdownMaxHeight",999),l.xp6(2),l.Q6J("disabled",!t)("focusable",n.open)("icon",r.options.icons.paint)("pseudoActive",n.open)("tuiHint",l.lcZ(3,9,r.colorText$)),l.xp6(2),l.Q6J("ngIf",!r.isBlankColor(i||""))}}function M(t,e){if(1&t&&(l.ynx(0),l.YNc(1,C,7,11,"tui-hosted-dropdown",1),l.ALo(2,"async"),l.BQk()),2&t){const t=l.oxw();l.xp6(1),l.Q6J("tuiLet",l.lcZ(2,1,t.isActive$))}}let S=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.colors=this.options.colors,this.colorText$=this.texts$.pipe((0,s.U)((t=>this.editor.isActive("group")&&t.hiliteGroup||this.editor.isActive("table")&&t.cellColor||""))),this.isActive$=(0,r.aj)([this.editor.isActive$("table"),this.editor.isActive$("group")]).pipe((0,s.U)((([t,e])=>t||e))),this.color$=this.editor.stateChange$.pipe((0,s.U)((()=>this.editor.getCellColor()||this.editor.getGroupColor()||this.options.blankColor)),(0,a.x)())}isBlankColor(t){return t===this.options.blankColor}setCellColor(t){this.editor.isActive("group")?this.editor.setGroupHilite(t):this.editor.isActive("table")&&this.editor.setCellColor(t)}}return t.ɵfac=function(e){return new(e||t)(l.Y36(i.mJ),l.Y36(o.$3),l.Y36(i.rf))},t.ɵcmp=l.Xpm({type:t,selectors:[["tui-table-cell-color"]],inputs:{colors:"colors"},decls:2,vars:3,consts:[[4,"tuiLet"],[3,"canOpen","content","tuiDropdownMaxHeight",4,"tuiLet"],[3,"canOpen","content","tuiDropdownMaxHeight"],["colorSelect",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","pseudoActive","tuiHint"],["class","t-plate t-plate_paint",3,"background",4,"ngIf"],["cellColorDropdown",""],[1,"t-plate","t-plate_paint"],[1,"t-color-picker",3,"colors","tuiActiveZoneParent","selectedColor"]],template:function(t,e){1&t&&(l.YNc(0,M,3,3,"ng-container",0),l.ALo(1,"async")),2&t&&l.Q6J("tuiLet",l.lcZ(1,1,e.color$))},directives:[c.L,d.o,u.Ek,h.v,p.$,f.D,m.x,g.t,b.D,v.O5,y.R,w.e],pipes:[v.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},31433:(t,e,n)=>{n.d(e,{l:()=>v});var o=n(86114),i=n(71831),r=n(88002),s=n(74788),a=n(98778),l=n(16331),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928),m=n(87048),g=n(12057);function b(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"tui-table-size-selector",4),s.NdJ("selectSize",(function(e){return s.CHM(t),s.oxw().addTable(e)})),s.qZA()}}let v=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.insertTableText$=this.texts$.pipe((0,r.U)((t=>t.insertTable)))}addTable({rows:t,cols:e}){this.editor.enter();const n=this.editor.state.selection.anchor;this.editor.enter(),this.editor.enter(),this.editor.setTextSelection(n),this.editor.insertTable(t,e)}}return t.ɵfac=function(e){return new(e||t)(s.Y36(i.mJ),s.Y36(o.$3),s.Y36(i.rf))},t.ɵcmp=s.Xpm({type:t,selectors:[["tui-table-create"]],decls:6,vars:6,consts:[["tuiDropdownAlign","left","tuiDropdownDirection","bottom",3,"content"],["table",""],["appearance","icon","automation-id","toolbar__insert-table-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","tuiHint"],["tableDropdown",""],[3,"selectSize"]],template:function(t,e){if(1&t&&(s.TgZ(0,"tui-hosted-dropdown",0,1),s._UZ(2,"button",2),s.ALo(3,"async"),s.qZA(),s.YNc(4,b,1,0,"ng-template",null,3,s.W1O)),2&t){const t=s.MAs(1),n=s.MAs(5);s.Q6J("content",n),s.xp6(2),s.Q6J("focusable",t.open)("icon",e.options.icons.insertTable)("tuiHint",s.lcZ(3,4,e.insertTableText$))}},directives:[a.o,l.Ek,c.v,d.$,u.D,h.x,p.t,f.D,m.M],pipes:[g.Ov],encapsulation:2,changeDetection:0}),t})()},41218:(t,e,n)=>{n.d(e,{Y:()=>y});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(42486),c=n(12057),d=n(18289),u=n(44099),h=n(13938),p=n(10406),f=n(63790),m=n(51928);function g(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",2),a.NdJ("click",(function(){a.CHM(t);const e=a.oxw().tuiLet,n=a.oxw();return e.mergeCells?n.mergeCells():n.splitCell()})),a.qZA()}if(2&t){const t=e.ngIf,n=a.oxw().tuiLet;a.Q6J("disabled",!n.mergeCells&&!n.splitCells)("focusable",!1)("icon",n.mergeCells?"tuiIconTableMergeLarge":"tuiIconTableSplitLarge")("tuiHint",n.mergeCells?t.mergeCells:t.splitCells)}}function b(t,e){if(1&t&&(a.ynx(0),a.YNc(1,g,1,4,"button",1),a.ALo(2,"async"),a.BQk()),2&t){const t=a.oxw();a.xp6(1),a.Q6J("ngIf",a.lcZ(2,1,t.texts$))}}const v=function(t,e){return{mergeCells:t,splitCells:e}};let y=(()=>{class t{constructor(t,e){this.editor=t,this.texts$=e,this.canMergeCells$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.canMergeCells())),(0,s.x)()),this.canSplitCells$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.canSplitCells())),(0,s.x)())}mergeCells(){this.editor.mergeCells()}splitCell(){this.editor.splitCell()}}return t.ɵfac=function(e){return new(e||t)(a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-table-merge-cells"]],decls:3,vars:8,consts:[[4,"tuiLet"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint","click"]],template:function(t,e){1&t&&(a.YNc(0,b,3,3,"ng-container",0),a.ALo(1,"async"),a.ALo(2,"async")),2&t&&a.Q6J("tuiLet",a.WLB(5,v,a.lcZ(1,1,e.canMergeCells$),a.lcZ(2,3,e.canSplitCells$)))},directives:[l.L,c.O5,d.v,u.$,h.D,p.x,f.t,m.D],pipes:[c.Ov],encapsulation:2,changeDetection:0}),t})()},34773:(t,e,n)=>{n.d(e,{_:()=>M});var o=n(86114),i=n(71831),r=n(88002),s=n(74788),a=n(42486),l=n(98778),c=n(18289),d=n(44099),u=n(13938),h=n(10406),p=n(63790),f=n(51928),m=n(22545),g=n(12057),b=n(94052),v=n(91283);function y(t,e){if(1&t&&(s.TgZ(0,"tui-hosted-dropdown",2,3),s._UZ(2,"button",4),s.ALo(3,"async"),s.qZA()),2&t){const t=e.tuiLet,n=s.MAs(1),o=s.oxw(),i=s.MAs(3);s.Q6J("canOpen",!!t)("content",i),s.xp6(2),s.Q6J("disabled",!t)("focusable",n.open)("icon",o.options.icons.addRowTable)("tuiHint",s.lcZ(3,6,o.rowsColumnsManagingText$))}}function w(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"button",7),s.NdJ("click",(function(){const e=s.CHM(t).index,n=s.oxw().index;return s.oxw(2).onTableOption(2*n+e)})),s._uU(1),s.qZA()}if(2&t){const t=e.$implicit;s.xp6(1),s.hij(" ",t," ")}}function x(t,e){if(1&t&&(s.TgZ(0,"tui-opt-group"),s.YNc(1,w,2,1,"button",6),s.qZA()),2&t){const t=e.$implicit;s.xp6(1),s.Q6J("ngForOf",t)}}function k(t,e){if(1&t&&(s.TgZ(0,"tui-data-list"),s.YNc(1,x,2,1,"tui-opt-group",5),s.ALo(2,"async"),s.qZA()),2&t){const t=s.oxw();s.xp6(1),s.Q6J("ngForOf",s.lcZ(2,1,t.tableCommandTexts$))}}var C=(()=>(function(t){t[t.InsertColumnBefore=0]="InsertColumnBefore",t[t.InsertColumnAfter=1]="InsertColumnAfter",t[t.InsertRowBefore=2]="InsertRowBefore",t[t.InsertRowAfter=3]="InsertRowAfter",t[t.DeleteColumn=4]="DeleteColumn",t[t.DeleteRow=5]="DeleteRow"}(C||(C={})),C))();let M=(()=>{class t{constructor(t,e,n,o){this.options=t,this.editor=e,this.texts$=n,this.tableCommandTexts$=o,this.commandsRegistry={[C.InsertColumnAfter]:()=>this.editor.addColumnAfter(),[C.InsertColumnBefore]:()=>this.editor.addColumnBefore(),[C.InsertRowAfter]:()=>this.editor.addRowAfter(),[C.InsertRowBefore]:()=>this.editor.addRowBefore(),[C.DeleteColumn]:()=>this.editor.deleteColumn(),[C.DeleteRow]:()=>this.editor.deleteRow()},this.isActive$=this.editor.isActive$("table"),this.rowsColumnsManagingText$=this.texts$.pipe((0,r.U)((t=>t.rowsColumnsManaging)))}onTableOption(t){this.commandsRegistry[t]()}}return t.ɵfac=function(e){return new(e||t)(s.Y36(i.mJ),s.Y36(o.$3),s.Y36(i.rf),s.Y36(i.$i))},t.ɵcmp=s.Xpm({type:t,selectors:[["tui-table-row-column-manager"]],decls:4,vars:3,consts:[[3,"canOpen","content",4,"tuiLet"],["tableOptionsDropdown",""],[3,"canOpen","content"],["tableCommand",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"disabled","focusable","icon","tuiHint"],[4,"ngFor","ngForOf"],["tuiOption","",3,"click",4,"ngFor","ngForOf"],["tuiOption","",3,"click"]],template:function(t,e){1&t&&(s.YNc(0,y,4,8,"tui-hosted-dropdown",0),s.ALo(1,"async"),s.YNc(2,k,3,3,"ng-template",null,1,s.W1O)),2&t&&s.Q6J("tuiLet",s.lcZ(1,1,e.isActive$))},directives:[a.L,l.o,c.v,d.$,u.D,h.x,p.t,f.D,m.q,g.sg,b.R,v.v],pipes:[g.Ov],encapsulation:2,changeDetection:0}),t})()},87048:(t,e,n)=>{n.d(e,{M:()=>c});var o=n(74788),i=n(62579),r=n(67274),s=n(46648);function a(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.NdJ("click",(function(){return o.CHM(t),o.oxw(2).select()}))("mouseenter",(function(e){const n=o.CHM(t).$implicit,i=o.oxw().$implicit;return o.oxw().updateCurrentSize(n+1,i+1,e)})),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw().$implicit,i=o.oxw();o.ekj("t-cell_hovered",i.tableSelectHovered(t,n))}}function l(t,e){if(1&t&&(o.TgZ(0,"div",2),o.YNc(1,a,1,2,"div",3),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("tuiRepeatTimesOf",t.rowsNumber)}}let c=(()=>{class t{constructor(t){this.win=t,this.selectSize=new o.vpe,this.onSelectSize=this.selectSize,this.tableSize={rows:1,cols:1}}get columnsNumber(){return Math.min(Math.max(3,this.tableSize.cols+1),15)}get rowsNumber(){return Math.min(Math.max(3,this.tableSize.rows+1),15)}tableSelectHovered(t,e){return t70&&(this.tableSize={rows:t,cols:e})}onClick(){this.select()}select(){this.selectSize.emit(this.tableSize)}}return t.ɵfac=function(e){return new(e||t)(o.Y36(i.m9))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-table-size-selector"]],outputs:{selectSize:"selectSize",onSelectSize:"onSelectSize"},decls:3,vars:3,consts:[["class","t-column",4,"tuiRepeatTimes","tuiRepeatTimesOf"],[1,"t-description"],[1,"t-column"],["class","t-cell",3,"t-cell_hovered","click","mouseenter",4,"tuiRepeatTimes","tuiRepeatTimesOf"],[1,"t-cell",3,"click","mouseenter"]],template:function(t,e){1&t&&(o.YNc(0,l,2,1,"div",0),o.TgZ(1,"div",1),o._uU(2),o.qZA()),2&t&&(o.Q6J("tuiRepeatTimesOf",e.columnsNumber),o.xp6(2),o.AsE("",e.tableSize.cols,"×",e.tableSize.rows,""))},directives:[s.X],styles:["[_nghost-%COMP%]{display:block;padding:.75rem}.t-cell[_ngcontent-%COMP%]{display:inline-block;background-color:var(--tui-base-01);width:1.25rem;height:1.25rem;border-radius:.25rem;margin:.125rem;border:1px solid var(--tui-base-04);cursor:pointer}.t-cell_hovered[_ngcontent-%COMP%]{background-color:var(--tui-base-02)}.t-column[_ngcontent-%COMP%]{white-space:nowrap}.t-description[_ngcontent-%COMP%]{text-align:center}"],changeDetection:0}),t})()},57891:(t,e,n)=>{n.d(e,{G:()=>k});var o=n(86114),i=n(71831),r=n(88002),s=n(87519),a=n(74788),l=n(42486),c=n(98778),d=n(16331),u=n(18289),h=n(44099),p=n(13938),f=n(10406),m=n(63790),g=n(51928),b=n(59113),v=n(55788),y=n(12057);function w(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"tui-palette",6),a.NdJ("selectedColor",(function(e){return a.CHM(t),a.oxw(2).editor.setFontColor(e)})),a.qZA()}if(2&t){const t=e.$implicit,n=a.oxw(2);a.Q6J("colors",n.colors)("tuiActiveZoneParent",t)}}function x(t,e){if(1&t&&(a.TgZ(0,"tui-hosted-dropdown",1,2),a._UZ(2,"button",3),a.ALo(3,"async"),a._UZ(4,"div",4),a.YNc(5,w,1,2,"ng-template",null,5,a.W1O),a.qZA()),2&t){const t=e.tuiLet,n=a.MAs(1),o=a.MAs(6),i=a.oxw();a.Q6J("content",o)("tuiDropdownMaxHeight",999),a.xp6(2),a.Q6J("focusable",n.open)("icon",i.options.icons.textColor)("pseudoActive",n.open)("tuiHint",a.lcZ(3,8,i.foreColorText$)),a.xp6(2),a.Udp("background",t)}}let k=(()=>{class t{constructor(t,e,n){this.options=t,this.editor=e,this.texts$=n,this.colors=this.options.colors,this.fontColor$=this.editor.stateChange$.pipe((0,r.U)((()=>this.editor.getFontColor()||this.options.blankColor)),(0,s.x)()),this.foreColorText$=this.texts$.pipe((0,r.U)((t=>t.foreColor)))}}return t.ɵfac=function(e){return new(e||t)(a.Y36(i.mJ),a.Y36(o.$3),a.Y36(i.rf))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-text-color"]],inputs:{colors:"colors"},decls:2,vars:3,consts:[[3,"content","tuiDropdownMaxHeight",4,"tuiLet"],[3,"content","tuiDropdownMaxHeight"],["color",""],["appearance","icon","automation-id","toolbar__color-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],[1,"t-plate"],["colorDropdown",""],[1,"t-color-picker",3,"colors","tuiActiveZoneParent","selectedColor"]],template:function(t,e){1&t&&(a.YNc(0,x,7,10,"tui-hosted-dropdown",0),a.ALo(1,"async")),2&t&&a.Q6J("tuiLet",a.lcZ(1,1,e.fontColor$))},directives:[l.L,c.o,d.Ek,u.v,h.$,p.D,f.x,m.t,g.D,b.R,v.e],pipes:[y.Ov],styles:[".t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-option[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-option[_ngcontent-%COMP%]:hover{background:var(--tui-secondary-hover)}.t-option_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-color-picker[_ngcontent-%COMP%]{box-sizing:border-box;max-width:22.6rem}"],changeDetection:0}),t})()},51618:(t,e,n)=>{n.d(e,{M6:()=>o.M,yB:()=>d});var o=n(17999),i=n(12057),r=n(64642),s=n(67274),a=n(8674),l=n(78790),c=n(74788);let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=c.oAB({type:t}),t.ɵinj=c.cJS({imports:[[i.ez,s.goS,r.udY,s.fNO,s.jhF,a.Fu,l.er,l.mp,l.__,l.iA,l.p7,l.Zv,l.pu,l.Ur,l._t,l.XC,l.P_,l.y9,r.HOV,l.jP]]}),t})();n(96827)},96827:(t,e,n)=>{n.d(e,{B:()=>r});var o=n(74788),i=n(64642);let r=(()=>{class t{constructor(t){this.el=t}get toolsContainers(){return Array.from(this.el.nativeElement.querySelectorAll("[tuiItem]"))}onHorizontalNavigation(t){const{toolsContainers:e}=this,n=e.findIndex(i.zb4),o=e[(0,i.Kiv)(n+(t?-1:1),0,e.length-1)],r=t?this.findPreviousTool(o):this.findNextTool(o);r&&r.focus()}findFirstFocusableTool(t=!1){const e=t?this.toolsContainers.slice().reverse():this.toolsContainers;for(const t of e){const e=(0,i._hh)(t)?t:(0,i.BWF)({initial:t,root:t,keyboard:!1});if(e)return e}return null}findPreviousTool(t){return(0,i._hh)(t)?t:(0,i.BWF)({initial:t,root:t,keyboard:!1})||(0,i.BWF)({initial:t,root:this.el.nativeElement,previous:!0,keyboard:!1})}findNextTool(t){return(0,i._hh)(t)?t:(0,i.BWF)({initial:t,root:this.el.nativeElement,keyboard:!1})}}return t.ɵfac=function(e){return new(e||t)(o.Y36(o.SBq))},t.ɵdir=o.lG2({type:t,selectors:[["","tuiToolbarNavigationManager",""]],hostBindings:function(t,e){1&t&&o.NdJ("keydown.arrowRight.prevent",(function(){return e.onHorizontalNavigation(!1)}))("keydown.arrowLeft.prevent",(function(){return e.onHorizontalNavigation(!0)}))}}),t})()},17999:(t,e,n)=>{n.d(e,{M:()=>mt});var o=n(74788),i=n(64642),r=n(18892),s=n(86114),a=n(95161),l=n(71831),c=n(15257),d=n(46782),u=n(96827),h=n(12057),p=n(63973),f=n(18289),m=n(44099),g=n(32489),b=n(13938),v=n(10406),y=n(63790),w=n(51928),x=n(73688),k=n(81618),C=n(20719),M=n(30928),S=n(98778),A=n(41039),O=n(57891),T=n(73545),N=n(57289),E=n(18885),I=n(49382),D=n(52187),P=n(61899),H=n(31433),L=n(34773),_=n(41218);const R=["dropdown"];function z(t,e){1&t&&o.GkF(0)}function $(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",6),o.TgZ(1,"button",7),o.NdJ("click",(function(){return o.CHM(t),o.oxw(2).undo()})),o.qZA(),o.TgZ(2,"button",8),o.NdJ("click",(function(){return o.CHM(t),o.oxw(2).redo()})),o.qZA(),o.qZA()}if(2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(1),o.Q6J("disabled",e.undoDisabled)("focusable",!1)("icon",e.options.icons.undo)("tuiHint",t.undo),o.xp6(1),o.Q6J("disabled",e.redoDisabled)("focusable",!1)("icon",e.options.icons.redo)("tuiHint",t.redo)}}function B(t,e){1&t&&(o.TgZ(0,"div",6),o._UZ(1,"tui-font-size",9),o.qZA())}function F(t,e){if(1&t&&o._UZ(0,"tui-font-style",15),2&t){const t=o.oxw(3);o.Q6J("enabledTools",t.toolsSet)}}function J(t,e){1&t&&o._UZ(0,"tui-align-content",9)}function Z(t,e){1&t&&o._UZ(0,"tui-list-configs",9)}function Y(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",16,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).toggleQuote()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("disabled",e.unorderedList||e.orderedList)("focusable",!1)("icon",e.options.icons.quote)("pseudoActive",e.blockquote)("tuiHint",t.quote)}}function j(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tui-edit-link",22,23),o.NdJ("addLink",(function(e){o.CHM(t),o.oxw();const n=o.MAs(1);return o.oxw(3).onLink(n,e)}))("removeLink",(function(){o.CHM(t),o.oxw();const e=o.MAs(1);return o.oxw(3).onLink(e)})),o.qZA()}}function q(t,e){if(1&t&&(o.TgZ(0,"tui-hosted-dropdown",18,19),o._UZ(2,"button",20,17),o.YNc(4,j,2,0,"ng-template",null,21,o.W1O),o.qZA()),2&t){const t=o.MAs(1),e=o.MAs(5),n=o.oxw(2).ngIf,i=o.oxw();o.Q6J("canOpen",i.canOpenAnchor)("content",e),o.xp6(2),o.Q6J("focusable",t.open)("icon",i.options.icons.link)("pseudoActive",t.open||i.a)("tuiHint",n.link)}}function V(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tui-edit-link",28),o.NdJ("addLink",(function(e){o.CHM(t),o.oxw();const n=o.MAs(1);return o.oxw(3).setAnchor(n,e)}))("removeLink",(function(){return o.CHM(t),o.oxw(4).removeAnchor()})),o.qZA()}2&t&&o.Q6J("anchorMode",!0)}function U(t,e){if(1&t&&(o.TgZ(0,"tui-hosted-dropdown",24,25),o._UZ(2,"button",26),o.YNc(3,V,1,1,"ng-template",null,27,o.W1O),o.qZA()),2&t){const t=o.MAs(1),e=o.MAs(4),n=o.oxw(2).ngIf,i=o.oxw();o.Q6J("canOpen",i.canOpenAnchor)("content",e),o.xp6(2),o.Q6J("focusable",!1)("icon",i.options.icons.anchor)("pseudoActive",t.open||i.jumpAnchor)("tuiHint",n.insertAnchor)}}function W(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"button",29,17),o.NdJ("click",(function(){return o.CHM(t),o.MAs(4).click()})),o.qZA(),o.TgZ(3,"input",30,31),o.NdJ("change",(function(){o.CHM(t);const e=o.MAs(4);return o.oxw(3).onAttach(e)})),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.xp6(1),o.Q6J("focusable",!1)("icon",e.options.icons.attach)("tuiHint",t.attach),o.xp6(2),o.Q6J("accept",e.attachOptions.accept)("multiple",e.attachOptions.multiple)("tuiFocusable",!1)}}function Q(t,e){if(1&t&&(o.TgZ(0,"div",6),o.YNc(1,F,1,1,"tui-font-style",10),o.YNc(2,J,1,0,"tui-align-content",11),o.YNc(3,Z,1,0,"tui-list-configs",11),o.YNc(4,Y,2,5,"button",12),o.YNc(5,q,6,6,"tui-hosted-dropdown",13),o.YNc(6,U,5,6,"tui-hosted-dropdown",14),o.YNc(7,W,5,6,"ng-container",1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.formatEnabled),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Align)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.List)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Quote)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Link)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Anchor)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Attach))}}function K(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",33,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).toggleSubscript()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("focusable",!1)("icon",e.options.icons.sub)("pseudoActive",e.subscript)("tuiHint",t.subscript)}}function G(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",33,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).toggleSuperscript()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("focusable",!1)("icon",e.options.icons.sup)("pseudoActive",e.superscript)("tuiHint",t.superscript)}}function X(t,e){if(1&t&&(o.TgZ(0,"div",6),o.YNc(1,K,2,4,"button",32),o.YNc(2,G,2,4,"button",32),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Sub)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Sup))}}function tt(t,e){if(1&t&&o._UZ(0,"tui-text-color",35),2&t){const t=o.oxw(3);o.Q6J("colors",t.colors)}}function et(t,e){if(1&t&&o._UZ(0,"tui-highlight-color",35),2&t){const t=o.oxw(3);o.Q6J("colors",t.colors)}}function nt(t,e){if(1&t&&(o.TgZ(0,"div",6),o.YNc(1,tt,1,1,"tui-text-color",34),o.YNc(2,et,1,1,"tui-highlight-color",34),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Color)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Hilite))}}function ot(t,e){1&t&&o._UZ(0,"tui-code",9)}function it(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",39,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).onTeX()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("focusable",!1)("icon",e.options.icons.tex)("tuiHint",t.tex)}}function rt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",40),o.TgZ(1,"button",41,17),o.NdJ("click",(function(){return o.CHM(t),o.MAs(4).click()})),o.qZA(),o.TgZ(3,"input",42,43),o.NdJ("change",(function(){o.CHM(t);const e=o.MAs(4);return o.oxw(3).onImage(e)})),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.xp6(1),o.Q6J("focusable",!1)("icon",e.options.icons.image)("tuiHint",t.image),o.xp6(2),o.Q6J("tuiFocusable",!1)}}function st(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",29,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(3).insertHorizontalRule()})),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.Q6J("focusable",!1)("icon",e.options.icons.hr)("tuiHint",t.insertHorizontalRule)}}function at(t,e){if(1&t&&(o.TgZ(0,"div",6),o.YNc(1,ot,1,0,"tui-code",11),o.YNc(2,it,2,3,"button",36),o.YNc(3,rt,5,4,"div",37),o.YNc(4,st,2,3,"button",38),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Code)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Tex)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Img)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.HR))}}function lt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",6),o.TgZ(1,"button",29,17),o.NdJ("click",(function(){return o.CHM(t),o.oxw(2).removeFormat()})),o.qZA(),o.qZA()}if(2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(1),o.Q6J("focusable",!1)("icon",e.options.icons.clear)("tuiHint",t.clear)}}function ct(t,e){1&t&&(o.TgZ(0,"div",6),o._UZ(1,"tui-details",44),o._UZ(2,"tui-details-remove",44),o.qZA())}function dt(t,e){if(1&t&&o._UZ(0,"tui-table-cell-color",35),2&t){const t=o.oxw(3);o.Q6J("colors",t.colors)}}function ut(t,e){if(1&t&&(o.TgZ(0,"div",6),o._UZ(1,"tui-editor-group-tool",44),o.YNc(2,dt,1,1,"tui-table-cell-color",34),o.qZA()),2&t){const t=o.oxw(2);o.xp6(2),o.Q6J("ngIf",!t.enabled(t.TuiEditorTool.Table))}}function ht(t,e){if(1&t&&(o.TgZ(0,"div",6),o._UZ(1,"tui-table-create",44),o._UZ(2,"tui-table-row-column-manager",44),o._UZ(3,"tui-table-merge-cells",44),o._UZ(4,"tui-table-cell-color",35),o.qZA()),2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("colors",t.colors)}}function pt(t,e){if(1&t&&(o.TgZ(0,"section",4),o.YNc(1,$,3,8,"div",5),o.YNc(2,B,2,0,"div",5),o.YNc(3,Q,8,7,"div",5),o.YNc(4,X,3,2,"div",5),o.YNc(5,nt,3,2,"div",5),o.YNc(6,at,5,4,"div",5),o.YNc(7,lt,3,3,"div",5),o.YNc(8,ct,3,0,"div",5),o.YNc(9,ut,3,1,"div",5),o.YNc(10,ht,5,1,"div",5),o.TgZ(11,"div",6),o.Hsn(12),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Undo)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Size)),o.xp6(1),o.Q6J("ngIf",t.firstBigBlockEnabled),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Sub)||t.enabled(t.TuiEditorTool.Sup)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Color)||t.enabled(t.TuiEditorTool.Hilite)),o.xp6(1),o.Q6J("ngIf",t.secondBigBlockEnabled),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Clear)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Details)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Group)),o.xp6(1),o.Q6J("ngIf",t.enabled(t.TuiEditorTool.Table))}}const ft=["*"];let mt=(()=>{class t{constructor(t,e,n,s,l,c,d,u){this.el=t,this.editor=e,this.imageLoader=n,this.attachOptions=s,this.filesLoader=l,this.texts$=c,this.options=d,this.destroy$=u,this.dropdowns=i.Mmc,this.colors=this.options.colors,this.disabled=!1,this.linkAdded=new o.vpe,this.texClicked=new o.vpe,this.fileAttached=new o.vpe,this.TuiEditorTool=a._,this.toolsSet=new Set(r.Db)}set tools(t){this.toolsSet=new Set(t)}get focused(){return(0,i.zb4)(this.el.nativeElement)||!!this.dropdowns.find((({nativeElement:t})=>(0,i.zb4)(t)))}get focusable(){return!this.focused&&!this.disabled}get unorderedList(){return this.editor.isActive("bulletList")}get orderedList(){return this.editor.isActive("orderedList")}get blockquote(){return this.editor.isActive("blockquote")}get a(){return this.editor.isActive("link")}get jumpAnchor(){return this.editor.isActive("jumpAnchor")}get canOpenAnchor(){return!this.a&&!this.jumpAnchor}get undoDisabled(){return this.editor.undoDisabled()}get redoDisabled(){return this.editor.redoDisabled()}get subscript(){return this.editor.isActive("subscript")}get superscript(){return this.editor.isActive("superscript")}get formatEnabled(){return this.enabled(a._.Bold)||this.enabled(a._.Italic)||this.enabled(a._.Underline)||this.enabled(a._.Strikethrough)}get firstBigBlockEnabled(){return this.formatEnabled||this.enabled(a._.Align)||this.enabled(a._.List)||this.enabled(a._.Quote)||this.enabled(a._.Link)||this.enabled(a._.Anchor)||this.enabled(a._.Attach)}get secondBigBlockEnabled(){return this.enabled(a._.Code)||this.enabled(a._.Tex)||this.enabled(a._.Img)||this.enabled(a._.HR)}onMouseDown(t,e){e.closest("button")||(t.preventDefault(),this.editor.focus())}onBottomFocus(){this.focusLast()}onTopFocus(){this.focusFirst()}onImage(t){var e;const n=null===(e=t.files)||void 0===e?void 0:e[0];t.value="",n&&this.imageLoader(n).pipe((0,c.q)(1),(0,d.R)(this.destroy$)).subscribe((t=>this.addImage(t)))}onAttach(t){var e;const n=Array.from(t.files||[]);t.value="",n&&(null===(e=this.filesLoader)||void 0===e||e.call(this,n).pipe((0,c.q)(1),(0,d.R)(this.destroy$)).subscribe((t=>this.fileAttached.emit(t))))}onTeX(){this.texClicked.emit()}onLink(t,e){t.open=!1,e&&this.editor.toggleLink(e)}setAnchor(t,e){t.open=!1,e&&(this.editor.setAnchor(e),this.editor.selectClosest())}removeAnchor(){this.editor.removeAnchor()}enabled(t){return this.toolsSet.has(t)}undo(){this.editor.undo()}redo(){this.editor.redo()}insertHorizontalRule(){this.editor.setHorizontalRule()}removeFormat(){this.editor.removeFormat()}toggleOrderedList(){this.editor.toggleOrderedList()}toggleQuote(){this.editor.toggleBlockquote()}toggleSubscript(){this.editor.toggleSubscript()}toggleSuperscript(){this.editor.toggleSuperscript()}addImage(t){this.editor.setImage(t)}focusFirst(){var t;const e=null===(t=this.navigationManager)||void 0===t?void 0:t.findFirstFocusableTool();e&&e.focus()}focusLast(){var t;const e=null===(t=this.navigationManager)||void 0===t?void 0:t.findFirstFocusableTool(!0);e&&e.focus()}}return t.ɵfac=function(e){return new(e||t)(o.Y36(o.SBq,8),o.Y36(s.$3),o.Y36(l.p7),o.Y36(l.dR),o.Y36(l.zc,8),o.Y36(l.rf),o.Y36(l.mJ),o.Y36(i.a31,2))},t.ɵcmp=o.Xpm({type:t,selectors:[["tui-toolbar"]],viewQuery:function(t,e){if(1&t&&(o.Gf(u.B,5),o.Gf(R,5,o.SBq)),2&t){let t;o.iGM(t=o.CRH())&&(e.navigationManager=t.first),o.iGM(t=o.CRH())&&(e.dropdowns=t)}},hostAttrs:["role","toolbar"],hostVars:2,hostBindings:function(t,e){1&t&&o.NdJ("mousedown",(function(t){return e.onMouseDown(t,t.target)})),2&t&&o.ekj("_disabled",e.disabled)},inputs:{colors:"colors",disabled:"disabled",tools:"tools"},outputs:{linkAdded:"linkAdded",texClicked:"texClicked",fileAttached:"fileAttached"},features:[o._Bn([i.a31])],ngContentSelectors:ft,decls:7,vars:8,consts:[["type","button",1,"t-prevent-parent-label-behavior"],[4,"ngIf"],[3,"tuiFocusable","focus"],["tuiToolbarNavigationManager","","class","t-tools-wrapper",4,"ngIf"],["tuiToolbarNavigationManager","",1,"t-tools-wrapper"],["class","t-block",4,"ngIf"],[1,"t-block"],["appearance","icon","automation-id","toolbar__undo-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"disabled","focusable","icon","tuiHint","click"],["appearance","icon","automation-id","toolbar__redo-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"disabled","focusable","icon","tuiHint","click"],["tuiItem","",1,"t-tool","t-wrapper"],["tuiItem","","class","t-tool t-wrapper",3,"enabledTools",4,"ngIf"],["tuiItem","","class","t-tool t-wrapper",4,"ngIf"],["appearance","icon","automation-id","toolbar__quote-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button","class","t-tool t-tool_margin",3,"disabled","focusable","icon","pseudoActive","tuiHint","click",4,"ngIf"],["tuiItem","","class","t-wrapper",3,"canOpen","content",4,"ngIf"],["class","t-wrapper",3,"canOpen","content",4,"ngIf"],["tuiItem","",1,"t-tool","t-wrapper",3,"enabledTools"],["appearance","icon","automation-id","toolbar__quote-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"disabled","focusable","icon","pseudoActive","tuiHint","click"],["button",""],["tuiItem","",1,"t-wrapper",3,"canOpen","content"],["link",""],["appearance","icon","automation-id","toolbar__link-button","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",1,"t-tool",3,"focusable","icon","pseudoActive","tuiHint"],["linkDropdown",""],[3,"addLink","removeLink"],["dropdown",""],[1,"t-wrapper",3,"canOpen","content"],["anchor",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",3,"focusable","icon","pseudoActive","tuiHint"],["anchorDropdown",""],[3,"anchorMode","addLink","removeLink"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"focusable","icon","tuiHint","click"],["type","file",1,"t-file-upload",3,"accept","multiple","tuiFocusable","change"],["fileUpload",""],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button","class","t-tool t-tool_margin",3,"focusable","icon","pseudoActive","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool","t-tool_margin",3,"focusable","icon","pseudoActive","tuiHint","click"],["tuiItem","","class","t-tool t-wrapper",3,"colors",4,"ngIf"],["tuiItem","",1,"t-tool","t-wrapper",3,"colors"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button","class","t-tool",3,"focusable","icon","tuiHint","click",4,"ngIf"],["tuiItem","","class","t-wrapper",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button","class","t-tool t-tool_margin",3,"focusable","icon","tuiHint","click",4,"ngIf"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","tuiItem","","type","button",1,"t-tool",3,"focusable","icon","tuiHint","click"],["tuiItem","",1,"t-wrapper"],["appearance","icon","size","s","tuiHintDescribe","","tuiHintDirection","top-left","tuiIconButton","","type","button",1,"t-tool",3,"focusable","icon","tuiHint","click"],["accept","image/*","type","file",1,"t-image",3,"tuiFocusable","change"],["image",""],["tuiItem","",1,"t-tool","t-tool_margin"]],template:function(t,e){1&t&&(o.F$t(),o._UZ(0,"button",0),o.YNc(1,z,1,0,"ng-container",1),o.ALo(2,"async"),o.TgZ(3,"div",2),o.NdJ("focus",(function(){return e.onTopFocus()})),o.qZA(),o.TgZ(4,"div",2),o.NdJ("focus",(function(){return e.onBottomFocus()})),o.qZA(),o.YNc(5,pt,13,10,"section",3),o.ALo(6,"async")),2&t&&(o.xp6(1),o.Q6J("ngIf",o.lcZ(2,4,e.editor.stateChange$)),o.xp6(2),o.Q6J("tuiFocusable",e.focusable),o.xp6(1),o.Q6J("tuiFocusable",e.focusable),o.xp6(1),o.Q6J("ngIf",o.lcZ(6,6,e.texts$)))},directives:[h.O5,p.t,u.B,f.v,m.$,g.w,b.D,v.x,y.t,w.D,x.m,k.h,C.X,M.w,S.o,A.l,O.G,T.U,N.T,E.y,I.U,D.d,P.p,H.l,L._,_.Y],pipes:[h.Ov],styles:['.t-tools-wrapper[_ngcontent-%COMP%]{scrollbar-width:none;-ms-overflow-style:none;display:flex;padding:.25rem .75rem;overflow:auto;flex-wrap:wrap;box-shadow:0 .125rem .1875rem #0000001a}.t-tools-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar, .t-tools-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:transparent;width:0;height:0}.t-tools-wrapper._disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:var(--tui-disabled-opacity)}.t-block[_ngcontent-%COMP%]{display:flex;padding:.25rem 0}.t-block[_ngcontent-%COMP%]:not(:last-child):after{content:"";display:block;margin:0 .25rem;width:1px;background:var(--tui-secondary-active)}.t-tool[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}button.t-tool[_ngcontent-%COMP%]:hover, .t-tool[_ngcontent-%COMP%] button:hover{background:var(--tui-secondary-hover)}.t-tool_margin[_ngcontent-%COMP%]{margin:0 .25rem}.t-dropdown[_ngcontent-%COMP%]{padding:.75rem}.t-wrapper[_ngcontent-%COMP%]{position:relative;margin:0 .25rem}.t-plate[_ngcontent-%COMP%]{position:absolute;top:1.375rem;left:.25rem;width:1.5rem;height:.25rem;pointer-events:none}.t-plate_paint[_ngcontent-%COMP%]{left:.375rem;width:1.25rem}.t-font[_ngcontent-%COMP%]{padding:.3em 0;outline:none;width:100%;pointer-events:none}.t-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;font-size:0;opacity:0;cursor:pointer}.t-image[_ngcontent-%COMP%]::-webkit-file-upload-button{display:none}.t-file-upload[_ngcontent-%COMP%]{display:none}.t-color-picker[_ngcontent-%COMP%] tui-hosted-dropdown, .t-color-picker[_ngcontent-%COMP%] tui-color-picker, .t-color-picker[_ngcontent-%COMP%] tui-color-edit{display:none}.t-prevent-parent-label-behavior[_ngcontent-%COMP%]{display:none}'],changeDetection:0}),t})()},18892:(t,e,n)=>{n.d(e,{hK:()=>i,pH:()=>l,pL:()=>p,_s:()=>c,Ci:()=>d,jU:()=>h,DN:()=>u,sw:()=>o,Db:()=>s,RR:()=>a});const o=new Map([["color-black-100","#909090"],["color-black-200","#666666"],["color-black-300","#333333"],["color-blue-100","#1771e6"],["color-blue-200","#1464cc"],["color-blue-300","#0953b3"],["color-gray-100","#f5f5f6"],["color-gray-200","#e7e8ea"],["color-gray-300","#cbcfd3"],["color-gray-400","#959ba4"],["color-gray-500","#79818c"],["color-gray-600","#616871"],["color-green-100","#39b54a"],["color-green-200","#2ca53a"],["color-green-300","#168a21"],["color-light-blue-100","#ecf1f7"],["color-light-blue-200","#e4ebf3"],["color-light-blue-300","#dde4ed"],["color-red-100","#e01f19"],["color-red-200","#d3120e"],["color-red-300","#c40b08"],["color-yellow-100","#FFDD2C"],["color-yellow-200","#FCC521"],["color-yellow-300","#FAB618"],["transparent","transparent"]]),i="rgb(51, 51, 51)";var r=n(95161);const s=[r._.Undo,r._.Size,r._.Bold,r._.Italic,r._.Underline,r._.Align,r._.List,r._.Quote,r._.Link,r._.Anchor,r._.Color,r._.Hilite,r._.Clear,r._.Strikethrough,r._.Code,r._.Img,r._.HR,r._.Sup,r._.Sub,r._.Table,r._.Details];function a(t){return[{px:13,name:t.small},{px:15,name:t.normal},{px:17,name:t.large},{px:24,family:"var(--tui-font-heading)",name:t.subtitle,headingLevel:2,weight:"bold"},{px:30,family:"var(--tui-font-heading)",name:t.title,headingLevel:1,weight:"bold"}]}const l=["id","class","src","style","controls","loop","muted","preload","autoplay","width","height","controlsList"],c="#",d="https://",u=":",h="://",p={protocol:d}},86114:(t,e,n)=>{n.d(e,{BN:()=>i,JU:()=>r.JU,mJ:()=>r.mJ,$3:()=>r.$3});var o=n(74788);let i=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=o.oAB({type:t}),t.ɵinj=o.cJS({}),t})();var r=n(79698)},79698:(t,e,n)=>{n.d(e,{JU:()=>o.J,mJ:()=>r,$3:()=>s.$});var o=n(87429),i=n(74788);let r=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=i.oAB({type:t}),t.ɵinj=i.cJS({}),t})();var s=n(26710)},87429:(t,e,n)=>{n.d(e,{J:()=>l});var o=n(74788),i=n(64642),r=n(71831),s=n(46782),a=n(26710);let l=(()=>{class t{constructor(t,e,n,o,i,r){this.el=t,this.renderer=e,this.editor=n,this.editorContainer=o,this.editorLoaded$=i,this.valueChange=this.editor.valueChange$,this.stateChange=this.editor.stateChange$,this.editorLoaded$.pipe((0,s.R)(r)).subscribe((()=>{this.renderer.appendChild(this.el.nativeElement,this.editorContainer)}))}set value(t){this.editor.setValue(t)}set editable(t){this.editor.editable=t}}return t.ɵfac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(o.Qsj),o.Y36(a.$),o.Y36(r.Y1),o.Y36(r.ZW),o.Y36(i.a31,2))},t.ɵdir=o.lG2({type:t,selectors:[["","tuiTiptapEditor",""]],inputs:{value:"value",editable:"editable"},outputs:{valueChange:"valueChange",stateChange:"stateChange"},features:[o._Bn([i.a31])]}),t})()},26710:(t,e,n)=>{n.d(e,{$:()=>f});var o=n(64642),i=n(79765),r=n(74788);let s=(()=>{class t{constructor(){this.stateChange$=new i.xQ,this.valueChange$=new i.xQ}}return t.ɵfac=function(e){return new(e||t)},t.ɵdir=r.lG2({type:t}),t})();var a=n(18892),l=n(71831),c=n(39425),d=n(62463),u=n(39761),h=n(88002),p=n(87519);let f=(()=>{class t extends s{constructor(t){super(),this.editorRef=t,this.editorRef.subscribe((t=>{this.editor=t,t.on("transaction",(()=>{this.stateChange$.next()})),t.on("update",(()=>{const e=t.getHTML(),n=(o=t.getJSON().content,Array.isArray(o)&&1===o.length&&"paragraph"===o[0].type&&!o[0].hasOwnProperty("content")?"":e);var o;this.valueChange$.next(n)}))}))}get isFocused(){return this.editor.isFocused}get html(){return this.editor.getHTML()}get editable(){return this.editor.isEditable}set editable(t){this.editor.setEditable(t,!1)}get state(){return this.editor.state}getOriginTiptapEditor(){return this.editor}undoDisabled(){return!this.editor.can().undo()}redoDisabled(){return!this.editor.can().redo()}getFontColor(){return this.editor.getAttributes("textStyle").fontColor||a.hK}getFontSize(){return parseInt(this.editor.getAttributes("textStyle").fontSize,10)}setFontSize(t){this.editor.chain().setMark("textStyle",{fontSize:(0,o.O9r)(t)}).run()}getBackgroundColor(){var t;return(null===(t=this.editor)||void 0===t?void 0:t.getAttributes("textStyle").backgroundColor)||"transparent"}getCellColor(){return this.editor.getAttributes("tableCell").background||this.editor.getAttributes("tableHeader").background}getGroupColor(){var t,e,n,o;if(this.editor.isActive("group")){const i=null!==(e=null===(t=this.editor.getAttributes("group"))||void 0===t?void 0:t.style)&&void 0!==e?e:"",r=(0,c.jx)(i);return null!==(o=null!==(n=r["background-color"])&&void 0!==n?n:r.background)&&void 0!==o?o:""}return""}onAlign(t){this.editor.chain().focus().setTextAlign(t).run()}setImage(t){this.editor.chain().focus().command((({commands:e,state:n})=>{var o;const i=null!==(o=e.setEditableImage)&&void 0!==o?o:e.setImage;if(i){const o=n.selection.anchor;return i({src:t}),e.setTextSelection(o),!0}return!1})).run()}undo(){this.editor.chain().undo().run()}redo(){this.editor.chain().redo().run()}setHorizontalRule(){this.editor.chain().focus().setHorizontalRule().run()}removeFormat(){this.editor.commands.unsetAllMarks(),this.editor.commands.clearNodes()}setFontColor(t){this.editor.chain().focus().setFontColor(t).run()}setBackgroundColor(t){this.editor.chain().focus().setBackgroundColor(t).run()}toggleUnderline(){this.editor.chain().focus().toggleUnderline().run()}toggleStrike(){this.editor.chain().focus().toggleStrike().run()}toggleOrderedList(){this.editor.chain().focus().toggleOrderedList().run()}toggleUnorderedList(){this.editor.chain().focus().toggleBulletList().run()}togglePre(){this.editor.chain().focus().toggleCodeBlock().run()}sinkListItem(){this.editor.chain().focus().sinkListItem("listItem").run()}liftListItem(){this.editor.chain().focus().liftListItem("listItem").run()}isActive(t){return this.editor.isActive(t)}isActive$(t){return this.stateChange$.pipe((0,u.O)(null),(0,h.U)((()=>this.isActive(t))),(0,p.x)())}toggleBold(){this.editor.chain().focus().toggleBold().run()}toggleCode(){this.editor.chain().focus().toggleCode().run()}toggleItalic(){this.editor.chain().focus().toggleItalic().run()}toggleBlockquote(){this.editor.chain().focus().toggleBlockquote().run()}toggleSubscript(){this.editor.chain().focus().toggleSubscript().run()}toggleSuperscript(){this.editor.chain().focus().toggleSuperscript().run()}toggleCodeBlock(){this.editor.chain().focus().toggleCodeBlock().run()}insertTable(t,e){this.editor.chain().focus().insertTable({cols:t,rows:e}).run()}addColumnAfter(){this.editor.chain().focus().addColumnAfter().run()}addColumnBefore(){this.editor.chain().focus().addColumnBefore().run()}addRowAfter(){this.editor.chain().focus().addRowAfter().run()}addRowBefore(){this.editor.chain().focus().addRowBefore().run()}deleteColumn(){this.editor.chain().focus().deleteColumn().run()}deleteRow(){this.editor.chain().focus().deleteRow().run()}mergeCells(){this.editor.chain().focus().mergeCells().run()}splitCell(){this.editor.chain().focus().splitCell().run()}canMergeCells(){return this.editor.can().mergeCells()}canSplitCells(){return this.editor.can().splitCell()}setHeading(t){this.editor.chain().focus().setHeading({level:t}).run()}setParagraph(t){this.editor.chain().focus().setParagraph().run(),t&&this.editor.chain().setMark("textStyle",t).run()}setHardBreak(){this.editor.chain().setHardBreak().run()}setTextSelection(t){this.editor.commands.setTextSelection(t)}toggleLink(t){this.editor.chain().focus().toggleLink({href:t}).run()}setLink(t){this.editor.chain().focus().setLink({href:t}).run()}unsetLink(){this.editor.chain().focus().unsetLink().run()}focus(){this.editor.chain().focus().run()}setValue(t){t===this.html||""===t&&"

"===this.html||(this.editor.commands.setContent(t),this.editor.view.updateState(d.yy.create({schema:this.editor.state.schema,doc:this.editor.state.doc,selection:this.editor.state.selection,storedMarks:this.editor.state.storedMarks,plugins:this.editor.state.plugins})))}destroy(){this.editor.destroy()}setCellColor(t){this.editor.chain().focus().setCellBackground(t).run()}selectClosest(){const t=this.editor.state.selection.anchor,{schema:e,doc:n}=this.editor.state,o=(0,c.Yz)(n.resolve(t),e.marks.link);o&&this.editor.chain().setTextSelection(o).run()}enter(){this.editor.commands.enter()}setDetails(){this.editor.commands.setDetails()}removeDetails(){this.editor.commands.removeDetails()}setGroup(){this.editor.commands.setGroup()}removeGroup(){this.editor.commands.removeGroup()}setGroupHilite(t){this.editor.commands.setGroupHilite(t)}setAnchor(t){this.editor.commands.setAnchor(t.replace("#",""))}removeAnchor(){this.editor.commands.removeAnchor()}setFileLink(t){this.editor.commands.setFileLink(t)}setYoutubeVideo(t){this.editor.commands.setYoutubeVideo(t)}setIframe(t){this.editor.commands.setIframe(t)}removeEmptyTextStyle(){this.editor.commands.removeEmptyTextStyle()}toggleMark(t,e,n){this.editor.commands.toggleMark(t,e,n)}}return t.ɵfac=function(e){return new(e||t)(r.LFG(l.ZW))},t.ɵprov=r.Yz7({token:t,factory:t.ɵfac}),t})()},95161:(t,e,n)=>{n.d(e,{_:()=>o});var o=(()=>(function(t){t.Align="justify",t.Anchor="anchor",t.Attach="attach",t.Bold="bold",t.Clear="clear",t.Code="code",t.Color="foreColor",t.Details="details",t.Group="group",t.HR="insertHorizontalRule",t.Hilite="hiliteColor",t.Img="image",t.Italic="italic",t.Link="link",t.List="list",t.MergeCells="mergeCells",t.Quote="quote",t.RowsColumnsManaging="rowsColumnsManaging",t.Size="fontSize",t.SplitCells="splitCells",t.Strikethrough="strikeThrough",t.Sub="subscript",t.Sup="superscript",t.Table="insertTable",t.Tex="tex",t.Underline="underline",t.Undo="undo"}(o||(o={})),o))()},13511:(t,e,n)=>{n.r(e),n.d(e,{BackgroundColor:()=>o}),n(84402);const o=n(11046).Extension.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,renderHTML:({backgroundColor:t})=>t?{style:`background-color: ${t}`}:{},parseHTML:({style:t})=>t.backgroundColor.replace(/['"]+/g,""),keepOnSplit:!1}}}]},addCommands:()=>({setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).run()})})},41131:(t,e,n)=>{n.r(e),n.d(e,{TuiFileLink:()=>o});const o=n(11046).Extension.create({name:"fileLink",addCommands:()=>({setFileLink:t=>({state:e,chain:n})=>{const{selection:o}=e,i=' ';return(Math.abs(o.to-o.from)>0?n().toggleMark("link",{href:t.link},{extendEmptyMarkRange:!0}).setTextSelection(o.to).insertContent(i):n().insertContent(`${t.name}${i}`)).setTextSelection(o.to).run()}})})},47841:(t,e,n)=>{n.r(e),n.d(e,{FontColor:()=>o}),n(84402);const o=n(11046).Extension.create({name:"fontColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontColor:{default:null,renderHTML:({fontColor:t})=>t?{style:`color: ${t}`}:{},parseHTML:({style:t})=>t.color.replace(/['"]+/g,""),keepOnSplit:!1}}}]},addCommands:()=>({setFontColor:t=>({chain:e})=>e().setMark("textStyle",{fontColor:t}).run(),unsetFontColor:()=>({chain:t})=>t().setMark("textStyle",{fontColor:null}).run()})})},83120:(t,e,n)=>{n.r(e),n.d(e,{TuiFontSize:()=>o}),n(84402);const o=n(11046).Extension.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:({style:t})=>t.fontSize,renderHTML:({fontSize:t})=>t?{style:`font-size: ${t}`}:{}}}}]},addCommands:()=>({setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})})},38981:(t,e,n)=>{n.r(e),n.d(e,{TUI_EDITOR_GROUP_DEFAULT_OPTIONS:()=>r,createGroupExtension:()=>s});var o=n(39425),i=n(11046);const r={groupNodeClass:"tui-group-node",groupPointerNodeClass:"tui-group-pointer",nested:!0,draggable:!0,createOnEnter:!1},s=(t={})=>{const{draggable:e,nested:n,groupNodeClass:s,groupPointerNodeClass:a,createOnEnter:l}=Object.assign(Object.assign({},r),t);return i.Node.create({name:"group",draggable:e,group:"block",content:n?"block+":"block",addAttributes:()=>({style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>t.style?{style:t.style}:{}}}),parseHTML:()=>[{tag:'div[data-type="group"]'}],renderHTML:({HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{"data-type":"group"}),0],addNodeView:()=>({HTMLAttributes:t,node:n})=>{const o=document.createElement("div"),i=document.createElement("div");if(o.classList.add(s),i.setAttribute("data-type","group"),t.style&&(n.attrs.style=t.style,i.setAttribute("style",t.style)),e){const t=document.createElement("div");t.classList.add(a),t.innerHTML="",t.contentEditable="false",o.append(t,i)}else o.append(i);return{dom:o,contentDOM:i}},addCommands(){return{setGroup:()=>({commands:t,state:e})=>{this.editor.chain().focus().run();const n=(0,o.Ap)(e,""),i=`
${n.trim().startsWith("

")?n:`

${n}

`}
`;return t.insertContent(i)},setGroupHilite:t=>({editor:e})=>{for(let n=e.state.selection.$anchor,o=n.depth;o>0;o--){const i=n.node(o);if(i.type.name===this.name){setTimeout((()=>e.commands.updateAttributes(i.type,{style:`background: ${t}`})));break}}return!0},removeGroup:()=>({state:t,dispatch:e})=>(0,o.yU)(t,e,this.name)}},addKeyboardShortcuts(){return l?{Enter:()=>this.editor.commands.setGroup()}:{}}})}},91876:(t,e,n)=>{n.r(e),n.d(e,{TUI_IFRAME_EDITOR_OPTIONS:()=>l,TuiIframeEditorComponent:()=>d,TuiIframeEditorModule:()=>f,createIframeEditorExtension:()=>p});var o=n(12057),i=n(91211),r=n(64642),s=n(12368),a=n(74788);const l=new a.OlP("[TUI_IFRAME_EDITOR_OPTIONS]",{factory:()=>({minWidth:100,maxWidth:1/0,minHeight:100,maxHeight:1/0})});var c=n(61732);let d=(()=>{class t extends s._3{constructor(t,e,n,o){super(e,o),this.options=t,this.sanitizer=n}get src(){var t;return this.sanitizer.bypassSecurityTrustResourceUrl(null!==(t=this.attrs.src)&&void 0!==t?t:"")}updateSize([t,e]){this._width=Math.max(this.options.minWidth,Math.min(this.options.maxWidth,t)),this._height=Math.max(this.options.minHeight,Math.min(this.options.maxHeight,e))}}return t.ɵfac=function(e){return new(e||t)(a.Y36(l),a.Y36(o.K0),a.Y36(i.H7),a.Y36(r.a31,2))},t.ɵcmp=a.Xpm({type:t,selectors:[["tui-iframe-editor"]],features:[a._Bn([r.a31]),a.qOj],decls:2,vars:13,consts:[[3,"height","width","sizeChange"],[3,"height","src","width"]],template:function(t,e){1&t&&(a.TgZ(0,"tui-editor-resizable",0),a.NdJ("sizeChange",(function(t){return e.updateSize(t)})),a._UZ(1,"iframe",1),a.qZA()),2&t&&(a.Q6J("height",e.height)("width",e.width),a.xp6(1),a.Udp("max-height",e.options.maxHeight)("max-width",e.options.maxWidth)("min-height",e.options.minHeight)("min-width",e.options.minWidth),a.Q6J("height",e.height)("src",e.src,a.uOi)("width",e.width))},directives:[c.V],styles:["iframe[_ngcontent-%COMP%]{display:inline;pointer-events:none}"],changeDetection:0}),t})();var u=n(87187),h=n(11046);const p=t=>h.Node.create({name:"iframe",group:"block",atom:!0,draggable:!1,parseHTML:()=>[{tag:'iframe[data-type="iframe-editor"]'}],addAttributes(){return{src:{default:null,keepOnSplit:!1,parseHTML:t=>t.getAttribute("src")},frameborder:{default:0,keepOnSplit:!1,parseHTML:t=>t.getAttribute("frameborder")},width:{default:"100%",keepOnSplit:!1,parseHTML:t=>t.getAttribute("width")},height:{default:null,keepOnSplit:!1,parseHTML:t=>t.getAttribute("height")},allowfullscreen:{keepOnSplit:!1,default:this.options.allowFullscreen,parseHTML:t=>t.getAttribute("allowfullscreen")}}},renderHTML:({HTMLAttributes:t})=>["iframe",(0,h.mergeAttributes)(t,{"data-type":"iframe-editor"})],addNodeView:()=>e=>new u.y(d,e,Object.assign({injector:t},e)),addCommands(){return{setIframe:t=>({commands:e,state:n})=>{const o=n.selection.anchor;return e.enter(),e.setTextSelection(o),e.insertContent({type:this.name,attrs:t}),e.setTextSelection(n.selection.anchor),!0}}}});let f=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=a.oAB({type:t}),t.ɵinj=a.cJS({imports:[[s.Sl]]}),t})()},45267:(t,e,n)=>{n.r(e),n.d(e,{TUI_EDITOR_MAX_IMAGE_WIDTH:()=>d,TUI_EDITOR_MIN_IMAGE_WIDTH:()=>c,TUI_IMAGE_EDITOR_OPTIONS:()=>u,TuiImageEditorComponent:()=>p,TuiImageEditorModule:()=>C,createImageEditorExtension:()=>w,tuiCreateImageEditorExtension:()=>k});var o=n(12057),i=n(74788),r=n(91211),s=n(62579),a=n(64642),l=n(12368);const c=new i.OlP("[TUI_EDITOR_MIN_IMAGE_WIDTH]",{factory:()=>null}),d=new i.OlP("[TUI_EDITOR_MAX_IMAGE_WIDTH]",{factory:()=>null}),u=new i.OlP("[TUI_IMAGE_EDITOR_OPTIONS]",{factory:()=>({minWidth:100,maxWidth:1/0})});var h=n(61732);let p=(()=>{class t extends l._3{constructor(t,e,n,o,i,r,s,a){super(o,r),this.minWidth=t,this.maxWidth=e,this.options=n,this.sanitizer=i,this.el=s,this.win=a,this.contenteditable=!0,this.focused=!1}get dragHandle(){var t;return null!==(t=this.attrs.draggable)&&void 0!==t?t:null}get height(){return null}get alt(){return this.attrs.alt||""}get title(){return this.attrs.title||""}get src(){return this.sanitizer.bypassSecurityTrustResourceUrl(this.attrs.src)}currentTargetIsFocused(t){this.focused=this.el.nativeElement.contains(t),this.focused&&this.selectFakeText()}updateSize([t]){var e,n;const o=null!==(e=this.minWidth)&&void 0!==e?e:this.options.minWidth,i=null!==(n=this.maxWidth)&&void 0!==n?n:this.options.maxWidth;this._width=Math.max(o,Math.min(i,t))}selectFakeText(){var t,e,n;const o=this.doc.createRange();null===(t=this.el.nativeElement.querySelector("p"))||void 0===t||t.focus(),o.selectNode(this.el.nativeElement),null===(e=this.win.getSelection())||void 0===e||e.removeAllRanges(),null===(n=this.win.getSelection())||void 0===n||n.addRange(o)}}return t.ɵfac=function(e){return new(e||t)(i.Y36(c),i.Y36(d),i.Y36(u),i.Y36(o.K0),i.Y36(r.H7),i.Y36(a.a31,2),i.Y36(i.SBq),i.Y36(s.m9))},t.ɵcmp=i.Xpm({type:t,selectors:[["tui-image-editor"]],hostVars:2,hostBindings:function(t,e){1&t&&i.NdJ("click.silent",(function(t){return e.currentTargetIsFocused(t.target)}),!1,i.evT),2&t&&i.uIk("contenteditable",e.contenteditable)("data-drag-handle",e.dragHandle)},features:[i._Bn([a.a31]),i.qOj],decls:4,vars:12,consts:[["contenteditable","false",1,"t-emulate-inline-node"],[3,"autoHeight","width","sizeChange"],["contenteditable","false",3,"alt","src","title","width"]],template:function(t,e){1&t&&(i._UZ(0,"p",0),i.TgZ(1,"tui-editor-resizable",1),i.NdJ("sizeChange",(function(t){return e.updateSize(t)})),i._UZ(2,"img",2),i.qZA(),i._UZ(3,"p",0)),2&t&&(i.xp6(1),i.Q6J("autoHeight",!0)("width",e.width),i.xp6(1),i.Udp("max-width",e.options.maxWidth,"px")("min-width",e.options.minWidth,"px"),i.ekj("ProseMirror-selectednode",e.focused),i.Q6J("alt",e.alt)("src",e.src,i.LSH)("title",e.title)("width",e.width))},directives:[h.V],styles:["[data-drag-handle][_nghost-%COMP%]{cursor:move}img[_ngcontent-%COMP%]{pointer-events:none}.t-emulate-inline-node[_ngcontent-%COMP%]{display:inline-block;margin:0;height:0}"],changeDetection:0}),t})();var f=n(87187),m=n(11046),g=n(44632),b=n(62463);const v=[{tag:'img[data-type="image-editor"]'}],y={src:{default:"",keepOnSplit:!1},width:{default:300,keepOnSplit:!1},alt:{default:"",keepOnSplit:!1},title:{default:"",keepOnSplit:!1}};function w(t,{draggable:e}={}){const n=!(0,a.PcC)(e)||e;return g.Image.extend({name:"imageEditor",group:"inline",inline:!0,atom:!0,priority:0,selectable:!0,draggable:n,parseHTML:()=>v,addAttributes:()=>Object.assign(Object.assign({},y),{draggable:{default:n?"":null,keepOnSplit:!1}}),renderHTML:({HTMLAttributes:t})=>["img",(0,m.mergeAttributes)(t,{"data-type":"image-editor"})],addNodeView:()=>e=>new f.y(p,e,Object.assign({injector:t},e)),addCommands(){return{setEditableImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addProseMirrorPlugins:()=>[new b.Sy({props:{handleDOMEvents:{paste:x,drop:x}}})]})}function x(t,e){var n;const o=e instanceof DragEvent?e.dataTransfer:e.clipboardData,i=Array.from(null!==(n=null==o?void 0:o.files)&&void 0!==n?n:[]).filter((t=>/image/i.test(t.type)));i.length&&e.preventDefault();for(const e of i){const n=new FileReader;n.onload=e=>{var n;const o=t.state.schema.nodes.imageEditor.create({src:null===(n=e.target)||void 0===n?void 0:n.result}),i=t.state.tr.replaceSelectionWith(o);setTimeout((()=>t.dispatch(i)))},n.readAsDataURL(e)}}function k({injector:t,draggable:e}){return w(t,{draggable:e})}let C=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=i.oAB({type:t}),t.ɵinj=i.cJS({imports:[[o.ez,l.Sl]]}),t})()},73757:(t,e,n)=>{function o(t){return t.isActive("bulletList")||t.isActive("orderedList")}n.r(e),n.d(e,{TuiTabExtension:()=>i,tuiIsOrderedOrBulletList:()=>o});const i=n(11046).Extension.create({name:"indent",addKeyboardShortcuts(){return{Tab:()=>o(this.editor)?null:this.editor.commands.insertContent("\t")}}})},50822:(t,e,n)=>{n.r(e),n.d(e,{TuiLink:()=>jt});var o=n(39425),i=n(11046);const r="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",s="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو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",a=(t,e)=>{for(const n in e)t[n]=e[n];return t},l="numeric",c="ascii",d="alpha",u="asciinumeric",h="alphanumeric",p="domain",f="emoji",m="scheme",g="slashscheme",b="whitespace";function v(t,e){return t in e||(e[t]=[]),e[t]}function y(t,e,n){e[l]&&(e[u]=!0,e[h]=!0),e[c]&&(e[u]=!0,e[d]=!0),e[u]&&(e[h]=!0),e[d]&&(e[h]=!0),e[h]&&(e[p]=!0),e[f]&&(e[p]=!0);for(const o in e){const e=v(o,n);e.indexOf(t)<0&&e.push(t)}}function w(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}w.groups={},w.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n=0&&(n[o]=!0);return n}(s.t,o),n);y(r,t,o)}else n&&y(r,n,o);s.t=r}return i.j[t]=s,s}};const x=(t,e,n,o,i)=>t.ta(e,n,o,i),k=(t,e,n,o,i)=>t.tr(e,n,o,i),C=(t,e,n,o,i)=>t.ts(e,n,o,i),M=(t,e,n,o,i)=>t.tt(e,n,o,i),S="WORD",A="UWORD",O="LOCALHOST",T="TLD",N="UTLD",E="SCHEME",I="SLASH_SCHEME",D="NUM",P="WS",H="NL",L="OPENBRACE",_="OPENBRACKET",R="OPENANGLEBRACKET",z="OPENPAREN",$="CLOSEBRACE",B="CLOSEBRACKET",F="CLOSEANGLEBRACKET",J="CLOSEPAREN",Z="AMPERSAND",Y="APOSTROPHE",j="ASTERISK",q="AT",V="BACKSLASH",U="BACKTICK",W="CARET",Q="COLON",K="COMMA",G="DOLLAR",X="DOT",tt="EQUALS",et="EXCLAMATION",nt="HYPHEN",ot="PERCENT",it="PIPE",rt="PLUS",st="POUND",at="QUERY",lt="QUOTE",ct="SEMI",dt="SLASH",ut="TILDE",ht="UNDERSCORE",pt="EMOJI",ft="SYM";var mt=Object.freeze({__proto__:null,WORD:S,UWORD:A,LOCALHOST:O,TLD:T,UTLD:N,SCHEME:E,SLASH_SCHEME:I,NUM:D,WS:P,NL:H,OPENBRACE:L,OPENBRACKET:_,OPENANGLEBRACKET:R,OPENPAREN:z,CLOSEBRACE:$,CLOSEBRACKET:B,CLOSEANGLEBRACKET:F,CLOSEPAREN:J,AMPERSAND:Z,APOSTROPHE:Y,ASTERISK:j,AT:q,BACKSLASH:V,BACKTICK:U,CARET:W,COLON:Q,COMMA:K,DOLLAR:G,DOT:X,EQUALS:tt,EXCLAMATION:et,HYPHEN:nt,PERCENT:ot,PIPE:it,PLUS:rt,POUND:st,QUERY:at,QUOTE:lt,SEMI:ct,SLASH:dt,TILDE:ut,UNDERSCORE:ht,EMOJI:pt,SYM:ft});const gt=/[a-z]/,bt=/\p{L}/u,vt=/\p{Emoji}/u,yt=/\d/,wt=/\s/,xt="\n",kt="️",Ct="‍";let Mt=null,St=null;function At(t,e,n,o,i){let r;const s=e.length;for(let n=0;n=0;)i++;if(i>0){e.push(n.join(""));for(let e=parseInt(t.substring(o,o+i),10);e>0;e--)n.pop();o+=i}else n.push(t[o]),o++}return e}const Tt={defaultProtocol:"http",events:null,format:Et,formatHref:Et,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Nt(t,e){void 0===e&&(e=null);let n=a({},Tt);t&&(n=a(n,t instanceof Nt?t.o:t));const o=n.ignoreTags,i=[];for(let t=0;tt,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const o=null!=e;let i=this.o[t];return i?("object"==typeof i?(i=n.t in i?i[n.t]:Tt[t],"function"==typeof i&&o&&(i=i(e,n))):"function"==typeof i&&o&&(i=i(e,n.t,n)),i):i},getObj(t,e,n){let o=this.o[t];return"function"==typeof o&&null!=e&&(o=o(e,n.t,n)),o},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},It.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),o=t.get("format",e,this);return n&&o.length>n?o.substring(0,n)+"…":o},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=Tt.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),o=t.get("formatHref",n,this),i=t.get("tagName",n,e),r=this.toFormattedString(t),s={},l=t.get("className",n,e),c=t.get("target",n,e),d=t.get("rel",n,e),u=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=o,l&&(s.class=l),c&&(s.target=c),d&&(s.rel=d),u&&a(s,u),{tagName:i,attributes:s,content:r,eventListeners:h}}};const Pt=Dt("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ht=Dt("text"),Lt=Dt("nl"),_t=Dt("url",{isLink:!0,toHref(t){return void 0===t&&(t=Tt.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==O&&t[1].t===Q}}),Rt=t=>new w(t);function zt(t,e,n){const o=n[0].s,i=n[n.length-1].e;return new t(e.slice(o,i),n)}const $t="undefined"!=typeof console&&console&&console.warn||(()=>{}),Bt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ft(t,e){if(void 0===e&&(e=!1),Bt.initialized&&$t(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n 1. Must only contain digits, lowercase ASCII letters or "-"\n 2. Cannot start or end with "-"\n 3. "-" cannot repeat');Bt.customSchemes.push([t,e])}function Jt(t,e,n){if(void 0===e&&(e=null),void 0===n&&(n=null),e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const o=new Nt(n),i=function(t){return Bt.initialized||function(){Bt.scanner=function(t){void 0===t&&(t=[]);const e={};w.groups=e;const n=new w;null==Mt&&(Mt=Ot(r)),null==St&&(St=Ot(s)),M(n,"'",Y),M(n,"{",L),M(n,"[",_),M(n,"<",R),M(n,"(",z),M(n,"}",$),M(n,"]",B),M(n,">",F),M(n,")",J),M(n,"&",Z),M(n,"*",j),M(n,"@",q),M(n,"`",U),M(n,"^",W),M(n,":",Q),M(n,",",K),M(n,"$",G),M(n,".",X),M(n,"=",tt),M(n,"!",et),M(n,"-",nt),M(n,"%",ot),M(n,"|",it),M(n,"+",rt),M(n,"#",st),M(n,"?",at),M(n,'"',lt),M(n,"/",dt),M(n,";",ct),M(n,"~",ut),M(n,"_",ht),M(n,"\\",V);const o=k(n,yt,D,{[l]:!0});k(o,yt,o);const i=k(n,gt,S,{[c]:!0});k(i,gt,i);const h=k(n,bt,A,{[d]:!0});k(h,gt),k(h,bt,h);const v=k(n,wt,P,{[b]:!0});M(n,xt,H,{[b]:!0}),M(v,xt),k(v,wt,v);const x=k(n,vt,pt,{[f]:!0});k(x,vt,x),M(x,kt,x);const Tt=M(x,Ct);k(Tt,vt,x);const Nt=[[gt,i]],Et=[[gt,null],[bt,h]];for(let t=0;tt[0]>e[0]?1:-1));for(let e=0;e=0?i[p]=!0:gt.test(o)?yt.test(o)?i[u]=!0:i[c]=!0:i[l]=!0,C(n,o,o,i)}return C(n,"localhost",O,{ascii:!0}),n.jd=new w(ft),{start:n,tokens:a({groups:e},mt)}}(Bt.customSchemes);for(let t=0;t=0&&h++,i++,d++;if(h<0)i-=d,i0&&(r.push(zt(Ht,e,s)),s=[]),i-=h,d-=h;const t=u.t,o=n.slice(i-d,i);r.push(zt(t,e,o))}}return s.length>0&&r.push(zt(Ht,e,s)),r}(Bt.parser.start,t,function(t,e){const n=function(t){const e=[],n=t.length;let o=0;for(;o56319||o+1===n||(i=t.charCodeAt(o+1))<56320||i>57343?t[o]:t.slice(o,o+2);e.push(s),o+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),o=n.length,i=[];let r=0,s=0;for(;s=0&&(u+=n[s].length,h++),c+=n[s].length,r+=n[s].length,s++;r-=u,s-=h,c-=u,i.push({t:d.t,v:e.slice(r-c,r),s:r-c,e:r})}return i}(Bt.scanner.start,t))}(t),h=[];for(let t=0;t{"string"!=typeof t?Ft(t.scheme,t.optionalSlashes):Ft(t)}))},onDestroy(){w.groups={},Bt.scanner=null,Bt.parser=null,Bt.tokenQueue=[],Bt.pluginQueue=[],Bt.customSchemes=[],Bt.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",(0,i.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,i.markPasteRule)({find:t=>Jt(t).filter((t=>!this.options.validate||this.options.validate(t.value))).filter((t=>t.isLink)).map((t=>({text:t.value,index:t.start,data:t}))),type:this.type,getAttributes:(t,e)=>{var n,o;const i=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html"),r=null==i?void 0:i.match(/href="([^"]*)"/);return r?{href:r[1]}:{href:null===(o=t.data)||void 0===o?void 0:o.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push((e={type:this.type,validate:this.options.validate},new Zt.Sy({key:new Zt.H$("autolink"),appendTransaction:(t,n,o)=>{const r=t.some((t=>t.docChanged))&&!n.doc.eq(o.doc),s=t.some((t=>t.getMeta("preventAutolink")));if(!r||s)return;const{tr:a}=o,l=(0,i.combineTransactionSteps)(n.doc,[...t]);return(0,i.getChangedRanges)(l).forEach((({newRange:t})=>{const n=(0,i.findChildrenInRange)(o.doc,t,(t=>t.isTextblock));let r,s;if(n.length>1?(r=n[0],s=o.doc.textBetween(r.pos,r.pos+r.node.nodeSize,void 0," ")):n.length&&o.doc.textBetween(t.from,t.to," "," ").endsWith(" ")&&(r=n[0],s=o.doc.textBetween(r.pos,t.to,void 0," ")),r&&s){const t=s.split(" ").filter((t=>""!==t));if(t.length<=0)return!1;const n=t[t.length-1],l=r.pos+s.lastIndexOf(n);if(!n)return!1;Jt(n).filter((t=>t.isLink)).map((t=>({...t,from:l+t.start+1,to:l+t.end+1}))).filter((t=>!o.schema.marks.code||!o.doc.rangeHasMark(t.from,t.to,o.schema.marks.code))).filter((t=>!e.validate||e.validate(t.value))).forEach((t=>{(0,i.getMarksBetween)(t.from,t.to,o.doc).some((t=>t.mark.type===e.type))||a.addMark(t.from,t.to,e.type.create({href:t.href}))}))}})),a.steps.length?a:void 0}}))),this.options.openOnClick&&t.push(function(t){return new Zt.Sy({key:new Zt.H$("handleClickLink"),props:{handleClick:(e,n,o)=>{var r,s;if(0!==o.button)return!1;if("A"!==o.target.nodeName)return!1;const a=(0,i.getAttributes)(e.state,t.type.name),l=o.target,c=null!==(r=null==l?void 0:l.href)&&void 0!==r?r:a.href,d=null!==(s=null==l?void 0:l.target)&&void 0!==s?s:a.target;return!(!l||!c||(e.editable&&window.open(c,d),0))}}})}({type:this.type})),t;var e}}),jt=Yt.extend({addAttributes(){var t;return Object.assign(Object.assign({},null===(t=this.parent)||void 0===t?void 0:t.call(this)),(0,o.x6)(["download"]))},addCommands(){var t;return Object.assign(Object.assign({},null===(t=this.parent)||void 0===t?void 0:t.call(this)),{toggleLink:t=>({chain:e,state:n})=>{{const{selection:o,doc:r}=n,s=r.cut(o.to,o.to+1),a=" "===(0,i.getHTMLFromFragment)(s.content,n.schema).replace(/<\/?[^>]+(>|$)/g,""),l=e().toggleMark(this.name,t,{extendEmptyMarkRange:!0});return(a?l.setTextSelection(o.to+1):l.setTextSelection(o.to).insertContent(' ')).run()}}})}}).configure({openOnClick:!1})},12585:(t,e,n)=>{n.r(e),n.d(e,{TuiAudio:()=>s,TuiSource:()=>a,TuiVideo:()=>l});var o=n(18892),i=n(39425),r=n(11046);const s=r.Node.create({name:"audio",group:"block",content:"source+",addAttributes:()=>(0,i.x6)(o.pH),parseHTML:()=>[{tag:"audio"}],renderHTML:({node:t,HTMLAttributes:e})=>["audio",e,...(0,i.YX)(t)]}),a=r.Node.create({name:"source",addAttributes:()=>(0,i.x6)(["src","type","width","height","media","sizes","srcset"]),parseHTML:()=>[{tag:"source"}],renderHTML:({HTMLAttributes:t})=>["source",(0,r.mergeAttributes)(t)]}),l=r.Node.create({name:"video",group:"block",content:"source+",addAttributes:()=>(0,i.x6)(o.pH),parseHTML:()=>[{tag:"video"}],renderHTML:({node:t,HTMLAttributes:e})=>["video",e,...(0,i.YX)(t)]})},66826:(t,e,n)=>{n.r(e),n.d(e,{StarterKit:()=>Ct});var o=n(11046);const i=/^\s*>\s$/,r=o.Node.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,o.wrappingInputRule)({find:i,type:this.type})]}}),s=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,a=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,l=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,c=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,d=o.Mark.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,o.markInputRule)({find:s,type:this.type}),(0,o.markInputRule)({find:l,type:this.type})]},addPasteRules(){return[(0,o.markPasteRule)({find:a,type:this.type}),(0,o.markPasteRule)({find:c,type:this.type})]}}),u=o.Node.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),h=o.Mark.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=(0,o.getMarkAttributes)(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),p=/^\s*([-+*])\s$/,f=o.Node.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(u.name,this.editor.getAttributes(h.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=(0,o.wrappingInputRule)({find:p,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,o.wrappingInputRule)({find:p,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(h.name),editor:this.editor})),[t]}}),m=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,g=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,b=o.Mark.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,o.markInputRule)({find:m,type:this.type})]},addPasteRules(){return[(0,o.markPasteRule)({find:g,type:this.type})]}});var v=n(62463);const y=/^```([a-z]+)?[\s\n]$/,w=/^~~~([a-z]+)?[\s\n]$/,x=o.Node.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return[...(null===(e=t.firstElementChild)||void 0===e?void 0:e.classList)||[]].filter((t=>t.startsWith(n))).map((t=>t.replace(n,"")))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",(0,o.mergeAttributes)(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!(!t||e.parent.type.name!==this.name)&&!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;const r=o.parentOffset===o.parent.nodeSize-2,s=o.parent.textContent.endsWith("\n\n");return!(!r||!s)&&t.chain().command((({tr:t})=>(t.delete(o.pos-2,o.pos),!0))).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:o}=e,{$from:i,empty:r}=n;if(!r||i.parent.type!==this.type)return!1;if(i.parentOffset!==i.parent.nodeSize-2)return!1;const s=i.after();return void 0!==s&&!o.nodeAt(s)&&t.commands.exitCode()}}},addInputRules(){return[(0,o.textblockTypeInputRule)({find:y,type:this.type,getAttributes:t=>({language:t[1]})}),(0,o.textblockTypeInputRule)({find:w,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new v.Sy({key:new v.H$("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),o=e.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,r=null==i?void 0:i.mode;if(!n||!r)return!1;const{tr:s}=t.state;return s.replaceSelectionWith(this.type.create({language:r})),s.setSelection(v.Bs.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),k=o.Node.create({name:"doc",topNode:!0,content:"block+"});var C=n(38480);function M(t={}){return new v.Sy({view:e=>new S(e,t)})}class S{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map((e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}destroy(){this.handlers.forEach((({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e)))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent;if(n){let n=e.nodeBefore,o=e.nodeAfter;if(n||o){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let i=e.getBoundingClientRect(),r=n?i.bottom:i.top;n&&o&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:i.left,right:i.right,top:r-this.width/2,bottom:r+this.width/2}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos);t={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let o,i,r=this.editorView.dom.offsetParent;if(this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!r||r==document.body&&"static"==getComputedStyle(r).position)o=-pageXOffset,i=-pageYOffset;else{let t=r.getBoundingClientRect();o=t.left-r.scrollLeft,i=t.top-r.scrollTop}this.element.style.left=t.left-o+"px",this.element.style.top=t.top-i+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),o=n&&n.type.spec.disableDropCursor,i="function"==typeof o?o(this.editorView,e,t):o;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,C.nj)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const A=o.Extension.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[M(this.options)]}});var O=n(31690),T=n(27439),N=n(43594);class E extends v.Y1{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return E.valid(n)?new E(n):v.Y1.near(n)}content(){return T.p2.empty}eq(t){return t instanceof E&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new E(t.resolve(e.pos))}getBookmark(){return new I(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),o=t.node(e);if(0!=n)for(let t=o.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(o.type.spec.isolating)return!0}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),o=t.node(e);if(n!=o.childCount)for(let t=o.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(o.type.spec.isolating)return!0}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let o=e.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&E.valid(t))return t;let o=t.pos,i=null;for(let n=t.depth;;n--){let r=t.node(n);if(e>0?t.indexAfter(n)0){i=r.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;o+=e;let s=t.doc.resolve(o);if(E.valid(s))return s}for(;;){let r=e>0?i.firstChild:i.lastChild;if(!r){if(i.isAtom&&!i.isText&&!v.qv.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*e),n=!1;continue t}break}i=r,o+=e;let s=t.doc.resolve(o);if(E.valid(s))return s}return null}}}E.prototype.visible=!1,E.findFrom=E.findGapCursorFrom,v.Y1.jsonID("gapcursor",E);class I{constructor(t){this.pos=t}map(t){return new I(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return E.valid(e)?new E(e):v.Y1.near(e)}}const D=(0,O.$)({ArrowLeft:P("horiz",-1),ArrowRight:P("horiz",1),ArrowUp:P("vert",-1),ArrowDown:P("vert",1)});function P(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,o,i){let r=t.selection,s=e>0?r.$to:r.$from,a=r.empty;if(r instanceof v.Bs){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}let l=E.findGapCursorFrom(s,e,a);return!!l&&(o&&o(t.tr.setSelection(new E(l))),!0)}}function H(t,e,n){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!E.valid(o))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&v.qv.isSelectable(t.state.doc.nodeAt(i.inside))||(t.dispatch(t.state.tr.setSelection(new E(o))),0))}function L(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof E))return!1;let{$from:n}=t.state.selection,o=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let i=T.HY.empty;for(let t=o.length-1;t>=0;t--)i=T.HY.from(o[t].createAndFill(null,i));let r=t.state.tr.replace(n.pos,n.pos,new T.p2(i,0,0));return r.setSelection(v.Bs.near(r.doc.resolve(n.pos+1))),t.dispatch(r),!1}function _(t){if(!(t.selection instanceof E))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",N.EH.create(t.doc,[N.p.widget(t.selection.head,e,{key:"gapcursor"})])}const R=o.Extension.create({name:"gapCursor",addProseMirrorPlugins:()=>[new v.Sy({props:{decorations:_,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&E.valid(n)?new E(n):null,handleClick:H,handleKeyDown:D,handleDOMEvents:{beforeinput:L}}})],extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!==(e=(0,o.callOrReturn)((0,o.getExtensionField)(t,"allowGapCursor",n)))&&void 0!==e?e:null}}}),z=o.Node.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",(0,o.mergeAttributes)(this.options.HTMLAttributes,t)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:o})=>t.first([()=>t.exitCode(),()=>t.command((()=>{const{selection:t,storedMarks:i}=n;if(t.$from.parent.type.spec.isolating)return!1;const{keepMarks:r}=this.options,{splittableMarks:s}=o.extensionManager,a=i||t.$to.parentOffset&&t.$from.marks();return e().insertContent({type:this.name}).command((({tr:t,dispatch:e})=>{if(e&&a&&r){const e=a.filter((t=>s.includes(t.type.name)));t.ensureMarks(e)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var $=n(54424),B=200,F=function(){};F.prototype.append=function(t){return t.length?(t=F.from(t),!this.length&&t||t.length=e?F.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},F.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},F.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},F.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var o=[];return this.forEach((function(e,n){return o.push(t(e,n))}),e,n),o},F.from=function(t){return t instanceof F?t:t&&t.length?new J(t):F.empty};var J=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,o){for(var i=e;i=n;i--)if(!1===t(this.values[i],o+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=B)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=B)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(F);F.empty=new J([]);var Z=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return ti&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,o+i))&&void 0},e.prototype.forEachInvertedInner=function(t,e,n,o){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,o+i))&&!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(F);const Y=F;class j{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,o,i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}e&&(n=this.remapping(i,this.items.length),o=n.maps.length);let r,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(i,e+1),o=n.maps.length),o--,void c.push(t);if(n){c.push(new q(t.map));let e,i=t.step.map(n.slice(o));i&&a.maybeStep(i).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new q(e,void 0,void 0,l.length+c.length))),o--,e&&n.appendMap(e,o)}else a.maybeStep(t.step);return t.selection?(r=n?t.selection.map(n.slice(o)):t.selection,s=new j(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:r}}addTransform(t,e,n,o){let i=[],r=this.eventCount,s=this.items,a=!o&&s.length?s.get(s.length-1):null;for(let n=0;nU&&(s=function(t,e){let n;return t.forEach(((t,o)=>{if(t.selection&&0==e--)return n=o,!1})),t.slice(n)}(s,l),r-=l),new j(s.append(i),r)}remapping(t,e){let n=new C.vs;return this.items.forEach(((e,o)=>{let i=null!=e.mirrorOffset&&o-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new j(this.items.append(t.map((t=>new q(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-e),i=t.mapping,r=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),o);let a=e;this.items.forEach((e=>{let o=i.getMirror(--a);if(null==o)return;r=Math.min(r,o);let l=i.maps[o];if(e.step){let r=t.steps[o].invert(t.docs[o]),c=e.selection&&e.selection.map(i.slice(a+1,o));c&&s++,n.push(new q(l,r,c))}else n.push(new q(l))}),o);let l=[];for(let t=e;t500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,o=[],i=0;return this.items.forEach(((r,s)=>{if(s>=t)o.push(r),r.selection&&i++;else if(r.step){let t=r.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=r.selection&&r.selection.map(e.slice(n));a&&i++;let l,c=new q(s.invert(),t,a),d=o.length-1;(l=o.length&&o[d].merge(c))?o[d]=l:o.push(c)}}else r.map&&n--}),this.items.length,0),new j(Y.from(o.reverse()),i)}}j.empty=new j(Y.empty,0);class q{constructor(t,e,n,o){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new q(e.getMap().invert(),e,this.selection)}}}class V{constructor(t,e,n,o,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const U=20;function W(t){let e=[];return t.forEach(((t,n,o,i)=>e.push(o,i))),e}function Q(t,e){if(!t)return null;let n=[];for(let o=0;onew V(j.empty,j.empty,null,0,-1),apply:(e,n,o)=>function(t,e,n,o){let i,r=n.getMeta(et);if(r)return r.historyState;n.getMeta(nt)&&(t=new V(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(et))return s.getMeta(et).redo?new V(t.done.addTransform(n,void 0,o,tt(e)),t.undone,W(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new V(t.done,t.undone.addTransform(n,void 0,o,tt(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new V(t.done.rebased(n,i),t.undone.rebased(n,i),Q(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new V(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Q(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),r=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-o.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,o)=>{for(let i=0;i=e[i]&&(n=!0)})),n}(n,t.prevRanges)),a=s?Q(t.prevRanges,n.mapping):W(n.mapping.maps[n.steps.length-1]);return new V(t.done.addTransform(n,r?e.selection.getBookmark():void 0,o,tt(e)),j.empty,a,n.time,null==i?t.prevComposition:i)}}(n,o,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,o="historyUndo"==n?it:"historyRedo"==n?rt:null;return!!o&&(e.preventDefault(),o(t.state,t.dispatch))}}}})}const it=(t,e)=>{let n=et.getState(t);return!(!n||0==n.done.eventCount||(e&&K(n,t,e,!1),0))},rt=(t,e)=>{let n=et.getState(t);return!(!n||0==n.undone.eventCount||(e&&K(n,t,e,!0),0))},st=o.Extension.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>it(t,e),redo:()=>({state:t,dispatch:e})=>rt(t,e)}),addProseMirrorPlugins(){return[ot(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),at=o.Node.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",(0,o.mergeAttributes)(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,o=t();return 0===n.parentOffset?o.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):o.insertContent({type:this.name}),o.command((({tr:t,dispatch:e})=>{var n;if(e){const{$to:e}=t.selection,o=e.end();if(e.nodeAfter)e.nodeAfter.isTextblock?t.setSelection(v.Bs.create(t.doc,e.pos+1)):e.nodeAfter.isBlock?t.setSelection(v.qv.create(t.doc,e.pos)):t.setSelection(v.Bs.create(t.doc,e.pos));else{const i=null===(n=e.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(t.insert(o,i),t.setSelection(v.Bs.create(t.doc,o+1)))}t.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(0,o.nodeInputRule)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lt=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ct=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,dt=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,ut=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,ht=o.Mark.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,o.markInputRule)({find:lt,type:this.type}),(0,o.markInputRule)({find:dt,type:this.type})]},addPasteRules(){return[(0,o.markPasteRule)({find:ct,type:this.type}),(0,o.markPasteRule)({find:ut,type:this.type})]}}),pt=o.Node.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),ft=o.Node.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),mt=o.Mark.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=(0,o.getMarkAttributes)(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),gt=/^(\d+)\.\s$/,bt=o.Node.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return 1===e?["ol",(0,o.mergeAttributes)(this.options.HTMLAttributes,n),0]:["ol",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ft.name,this.editor.getAttributes(mt.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=(0,o.wrappingInputRule)({find:gt,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,o.wrappingInputRule)({find:gt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(mt.name)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),vt=o.Node.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),yt=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,wt=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,xt=o.Mark.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){const t={};return(0,o.isMacOS)()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[(0,o.markInputRule)({find:yt,type:this.type})]},addPasteRules(){return[(0,o.markPasteRule)({find:wt,type:this.type})]}}),kt=o.Node.create({name:"text",group:"inline"}),Ct=o.Extension.create({name:"starterKit",addExtensions(){const t=[],e=this.options;return!1!==(null==e?void 0:e.blockquote)&&t.push(r.configure(null==e?void 0:e.blockquote)),!1!==(null==e?void 0:e.bold)&&t.push(d.configure(null==e?void 0:e.bold)),!1!==(null==e?void 0:e.bulletList)&&t.push(f.configure(null==e?void 0:e.bulletList)),!1!==(null==e?void 0:e.code)&&t.push(b.configure(null==e?void 0:e.code)),!1!==(null==e?void 0:e.codeBlock)&&t.push(x.configure(null==e?void 0:e.codeBlock)),!1!==(null==e?void 0:e.document)&&t.push(k.configure(null==e?void 0:e.document)),!1!==(null==e?void 0:e.dropcursor)&&t.push(A.configure(null==e?void 0:e.dropcursor)),!1!==(null==e?void 0:e.gapcursor)&&t.push(R.configure(null==e?void 0:e.gapcursor)),!1!==(null==e?void 0:e.hardBreak)&&t.push(z.configure(null==e?void 0:e.hardBreak)),!1!==(null==e?void 0:e.heading)&&t.push($.Heading.configure(null==e?void 0:e.heading)),!1!==(null==e?void 0:e.history)&&t.push(st.configure(Object.assign({depth:10,newGroupDelay:100},null==e?void 0:e.history))),!1!==(null==e?void 0:e.horizontalRule)&&t.push(at.configure(null==e?void 0:e.horizontalRule)),!1!==(null==e?void 0:e.italic)&&t.push(ht.configure(null==e?void 0:e.italic)),!1!==(null==e?void 0:e.listItem)&&t.push(pt.configure(null==e?void 0:e.listItem)),!1!==(null==e?void 0:e.orderedList)&&t.push(bt.configure(null==e?void 0:e.orderedList)),!1!==(null==e?void 0:e.paragraph)&&t.push(vt.configure(null==e?void 0:e.paragraph)),!1!==(null==e?void 0:e.strike)&&t.push(xt.configure(null==e?void 0:e.strike)),!1!==(null==e?void 0:e.text)&&t.push(kt.configure(null==e?void 0:e.text)),t}})},58676:(t,e,n)=>{n.r(e),n.d(e,{TableCellBackground:()=>o});const o=n(11046).Extension.create({addGlobalAttributes:()=>[{types:["tableCell","tableHeader"],attributes:{background:{default:null,renderHTML:({background:t})=>t?{style:`background: ${t}`}:null,parseHTML:({style:t})=>t.background,keepOnSplit:!1}}}],addCommands:()=>({setCellBackground:t=>({chain:e})=>e().updateAttributes("tableCell",{background:t}).updateAttributes("tableHeader",{background:t}).run(),unsetCellBackground:()=>({chain:t})=>t().updateAttributes("tableCell",{background:null}).updateAttributes("tableHeader",{background:null}).run()})})},47745:(t,e,n)=>{n.r(e),n.d(e,{TuiTable:()=>mt});var o,i,r=n(11046),s=n(62463),a=n(27439),l=n(43594),c=n(31690),d=n(38480);if("undefined"!=typeof WeakMap){let t=new WeakMap;o=e=>t.get(e),i=(e,n)=>(t.set(e,n),n)}else{const t=[],e=10;let n=0;o=e=>{for(let n=0;n(n==e&&(n=0),t[n++]=o,t[n++]=i)}var u=class{constructor(t,e,n,o){this.width=t,this.height=e,this.map=n,this.problems=o}findCell(t){for(let e=0;eo&&(r+=i.attrs.colspan)}}for(let t=0;t1&&(n=!0)}-1==e?e=r:e!=r&&(e=Math.max(e,r))}return e}(t),n=t.childCount,o=[];let i=0,r=null;const s=[];for(let t=0,i=e*n;t=n){(r||(r=[])).push({type:"overlong_rowspan",pos:l,n:h-t});break}const c=i+t*e;for(let t=0;t0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function g(t){const e=t.selection.$head;for(let t=e.depth;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return!0;return!1}function b(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&"cell"==e.node.type.spec.tableRole)return e.$anchor;const n=m(e.$head)||function(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const o=e.type.spec.tableRole;if("cell"==o||"header_cell"==o)return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const o=e.type.spec.tableRole;if("cell"==o||"header_cell"==o)return t.doc.resolve(n-e.nodeSize)}}(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function v(t){return"row"==t.parent.type.spec.tableRole&&!!t.nodeAfter}function y(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function w(t,e,n){const o=t.node(-1),i=u.get(o),r=t.start(-1),s=i.nextCell(t.pos-r,e,n);return null==s?null:t.node(0).resolve(r+s)}function x(t,e,n=1){const o={...t,colspan:t.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(e,n),o.colwidth.some((t=>t>0))||(o.colwidth=null)),o}function k(t,e,n=1){const o={...t,colspan:t.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let t=0;tt!=e.pos-i));l.unshift(e.pos-i);const c=l.map((t=>{const e=n.nodeAt(t);if(!e)throw RangeError(`No cell with offset ${t} found`);const o=i+t+1;return new s.xm(a.resolve(o),a.resolve(o+e.content.size))}));super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=e}map(t,e){const n=t.resolve(e.map(this.$anchorCell.pos)),o=t.resolve(e.map(this.$headCell.pos));if(v(n)&&v(o)&&y(n,o)){const t=this.$anchorCell.node(-1)!=n.node(-1);return t&&this.isRowSelection()?C.rowSelection(n,o):t&&this.isColSelection()?C.colSelection(n,o):new C(n,o)}return s.Bs.between(n,o)}content(){const t=this.$anchorCell.node(-1),e=u.get(t),n=this.$anchorCell.start(-1),o=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},r=[];for(let n=o.top;n0||d>0){let t=l.attrs;if(c>0&&(t=x(t,0,c)),d>0&&(t=x(t,t.colspan-d,d)),a.lefto.bottom){const t={...l.attrs,rowspan:Math.min(a.bottom,o.bottom)-Math.max(a.top,o.top)};l=a.top0)return!1;const n=t+this.$anchorCell.nodeAfter.attrs.rowspan,o=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,o)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){const n=t.node(-1),o=u.get(n),i=t.start(-1),r=o.findCell(t.pos-i),s=o.findCell(e.pos-i),a=t.node(0);return r.top<=s.top?(r.top>0&&(t=a.resolve(i+o.map[r.left])),s.bottom0&&(e=a.resolve(i+o.map[s.left])),r.bottom0)return!1;const r=o+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(r,s)==e.width}eq(t){return t instanceof C&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){const n=t.node(-1),o=u.get(n),i=t.start(-1),r=o.findCell(t.pos-i),s=o.findCell(e.pos-i),a=t.node(0);return r.left<=s.left?(r.left>0&&(t=a.resolve(i+o.map[r.top*o.width])),s.right0&&(e=a.resolve(i+o.map[s.top*o.width])),r.right{e.push(l.p.node(n,n+t.nodeSize,{class:"selectedCell"}))})),l.EH.create(t.doc,e)}var A=new s.H$("fix-tables");function O(t,e,n,o){const i=t.childCount,r=e.childCount;t:for(let s=0,a=0;s{"table"==e.type.spec.tableRole&&(n=function(t,e,n,o){const i=u.get(e);if(!i.problems)return o;o||(o=t.tr);const r=[];for(let t=0;t0){let e="cell";n.firstChild&&(e=n.firstChild.type.spec.tableRole);const r=[];for(let n=0;ne.width)for(let r=0,a=0;re.height){const u=[];for(let t=0,o=(e.height-1)*e.width;t=e.width)&&n.nodeAt(e.map[o+t]).type==l.header_cell;u.push(i?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const h=l.row.create(null,a.HY.from(u)),p=[];for(let t=e.height;t{if(!i)return!1;const r=n.selection;if(r instanceof C)return H(n,o,s.Y1.near(r.$headCell,e));if("horiz"!=t&&!r.empty)return!1;const a=F(i,t,e);if(null==a)return!1;if("horiz"==t)return H(n,o,s.Y1.near(n.doc.resolve(r.head+e),e));{const i=n.doc.resolve(a),r=w(i,t,e);let l;return l=r?s.Y1.near(r,1):e<0?s.Y1.near(n.doc.resolve(i.before(-1)),-1):s.Y1.near(n.doc.resolve(i.after(-1)),1),H(n,o,l)}}}function _(t,e){return(n,o,i)=>{if(!i)return!1;const r=n.selection;let s;if(r instanceof C)s=r;else{const o=F(i,t,e);if(null==o)return!1;s=new C(n.doc.resolve(o))}const a=w(s.$headCell,t,e);return!!a&&H(n,o,new C(s.$anchorCell,a))}}function R(t,e){const n=t.selection;if(!(n instanceof C))return!1;if(e){const o=t.tr,i=p(t.schema).cell.createAndFill().content;n.forEachCell(((t,e)=>{t.content.eq(i)||o.replace(o.mapping.map(e+1),o.mapping.map(e+t.nodeSize-1),new a.p2(i,0,0))})),o.docChanged&&e(o)}return!0}function z(t,e){const n=m(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new C(n))),!0)}function $(t,e,n){if(!g(t.state))return!1;let o=function(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:o}=t;for(;1==e.childCount&&(n>0&&o>0||"table"==e.child(0).type.spec.tableRole);)n--,o--,e=e.child(0).content;const i=e.child(0),r=i.type.spec.tableRole,s=i.type.schema,l=[];if("row"==r)for(let t=0;t=0;e--){const{rowspan:i,colspan:r}=o.child(e).attrs;for(let e=t;e=e.length&&e.push(a.HY.empty),n[i]o&&(a=a.type.createChecked(x(a.attrs,a.attrs.colspan,n+a.attrs.colspan-o),a.content)),s.push(a),n+=a.attrs.colspan;for(let n=1;ni&&(e=e.type.create({...e.attrs,rowspan:Math.max(1,i-e.attrs.rowspan)},e.content)),s.push(e)}t.push(a.HY.from(s))}n=t,e=i}return{width:t,height:e,rows:n}}(o,s.right-s.left,s.bottom-s.top),D(t.state,t.dispatch,r,s,o),!0}if(o){const e=b(t.state),n=e.start(-1);return D(t.state,t.dispatch,n,u.get(e.node(-1)).findCell(e.pos-n),o),!0}return!1}function B(t,e){var n;if(e.ctrlKey||e.metaKey)return;const o=J(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof C)r(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&o&&null!=(i=m(t.state.selection.$anchor))&&(null==(n=Z(t,e))?void 0:n.pos)!=i.pos)r(i,e),e.preventDefault();else if(!o)return;function r(e,n){let o=Z(t,n);const i=null==f.getState(t.state);if(!o||!y(e,o)){if(!i)return;o=e}const r=new C(e,o);if(i||!t.state.selection.eq(r)){const n=t.state.tr.setSelection(r);i&&n.setMeta(f,e.pos),t.dispatch(n)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),null!=f.getState(t.state)&&t.dispatch(t.state.tr.setMeta(f,-1))}function a(n){const i=n,a=f.getState(t.state);let l;if(null!=a)l=t.state.doc.resolve(a);else if(J(t,i.target)!=o&&(l=Z(t,e),!l))return s();l&&r(l,i)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function F(t,e,n){if(!(t.state.selection instanceof s.Bs))return null;const{$head:o}=t.state.selection;for(let i=o.depth-1;i>=0;i--){const r=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:r.childCount))return null;if("cell"==r.type.spec.tableRole||"header_cell"==r.type.spec.tableRole){const r=o.before(i),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?r:null}}return null}function J(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e;return null}function Z(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?m(t.state.doc.resolve(n.pos)):null}var Y=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),j(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type==this.node.type&&(this.node=t,j(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))}};function j(t,e,n,o,i,r){var s;let a=0,l=!0,c=e.firstChild;const d=t.firstChild;if(d){for(let t=0,n=0;t(i.spec.props.nodeViews[p(o.schema).table.name]=(t,o)=>new n(t,e,o),new U(-1,!1)),apply:(t,e)=>e.apply(t)},props:{attributes:t=>{const e=q.getState(t);return e&&e.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(e,n)=>{!function(t,e,n,o,i){const r=q.getState(t.state);if(r&&!r.dragging){const o=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target);let s=-1;if(o){const{left:i,right:r}=o.getBoundingClientRect();e.clientX-i<=n?s=W(t,e,"left",n):r-e.clientX<=n&&(s=W(t,e,"right",n))}if(s!=r.activeHandle){if(!i&&-1!==s){const e=t.state.doc.resolve(s),n=e.node(-1),o=u.get(n),i=e.start(-1);if(o.colCount(e.pos-i)+e.nodeAfter.attrs.colspan-1==o.width-1)return}K(t,s)}}}(e,n,t,0,o)},mouseleave:t=>{!function(t){const e=q.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&K(t,-1)}(t)},mousedown:(t,n)=>{!function(t,e,n){const o=q.getState(t.state);if(!o||-1==o.activeHandle||o.dragging)return!1;const i=t.state.doc.nodeAt(o.activeHandle),r=function(t,e,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const r=t.domAtPos(e);let s=r.node.childNodes[r.offset].offsetWidth,a=n;if(o)for(let t=0;t{const e=q.getState(t);if(e&&e.activeHandle>-1)return function(t,e){const n=[],o=t.doc.resolve(e),i=o.node(-1);if(!i)return l.EH.empty;const r=u.get(i),s=o.start(-1),a=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan;for(let t=0;t-1&&t.docChanged){let n=t.mapping.map(e.activeHandle,-1);return v(t.doc.resolve(n))||(n=-1),new U(n,e.dragging)}return e}};function W(t,e,n,o){const i="right"==n?-o:o,r=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!r)return-1;const{pos:s}=r,a=m(t.state.doc.resolve(s));if(!a)return-1;if("right"==n)return a.pos;const l=u.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function Q(t,e,n){const o=e.clientX-t.startX;return Math.max(n,t.startWidth+o)}function K(t,e){t.dispatch(t.state.tr.setMeta(q,{setHandle:e}))}function G(t){const e=t.selection,n=b(t),o=n.node(-1),i=n.start(-1),r=u.get(o);return{...e instanceof C?r.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):r.findCell(n.pos-i),tableStart:i,map:r,table:o}}function X(t,{map:e,tableStart:n,table:o},i){let r=i>0?-1:0;(function(t,e,n){const o=p(e.type.schema).header_cell;for(let i=0;i0&&i0&&e.map[a-1]==l||i0?-1:0;(function(t,e,n){var o;const i=p(e.type.schema).header_cell;for(let r=0;r0&&i0&&l==e.map[s-e.width]){const e=n.nodeAt(l).attrs;t.setNodeMarkup(t.mapping.slice(a).map(l+o),null,{...e,rowspan:e.rowspan-1}),r+=e.colspan-1}else if(i0&&n[r]==n[r-1]||o.right0&&n[i]==n[i-t]||o.bottomn[t.type.spec.tableRole],(t,e)=>{var n;const i=t.selection;let r,s;if(i instanceof C){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(r=function(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(i.$from),!r)return!1;s=null==(n=m(i.$from))?void 0:n.pos}if(null==r||null==s)return!1;if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(e){let n=r.attrs;const a=[],l=n.colwidth;n.rowspan>1&&(n={...n,rowspan:1}),n.colspan>1&&(n={...n,colspan:1});const c=G(t),d=t.tr;for(let t=0;ti.table.nodeAt(t)));for(let t=0;t{const e=t+i.tableStart,n=r.doc.nodeAt(e);n&&r.setNodeMarkup(e,d,n.attrs)})),n(r)}return!0}}at("row",{useDeprecatedLogic:!0}),at("column",{useDeprecatedLogic:!0});var lt=at("cell",{useDeprecatedLogic:!0});function ct(t){return function(e,n){if(!g(e))return!1;const o=function(t,e){if(e<0){const e=t.nodeBefore;if(e)return t.pos-e.nodeSize;for(let e=t.index(-1)-1,n=t.before();e>=0;e--){const o=t.node(-1).child(e),i=o.lastChild;if(i)return n-1-i.nodeSize;n-=o.nodeSize}}else{if(t.index()null,apply(t,e){const n=t.getMeta(f);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;const{deleted:o,pos:i}=t.mapping.mapResult(e);return o?null:i}},props:{decorations:S,handleDOMEvents:{mousedown:B},createSelectionBetween:t=>null!=f.getState(t.state)?t.state.selection:null,handleTripleClick:z,handleKeyDown:P,handlePaste:$},appendTransaction:(e,n,o)=>function(t,e,n){const o=(e||t).selection,i=(e||t).doc;let r,a;if(o instanceof s.qv&&(a=o.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)r=C.create(i,o.from);else if("row"==a){const t=i.resolve(o.from+1);r=C.rowSelection(t,t)}else if(!n){const t=u.get(o.node),e=o.from+1,n=e+t.map[t.width*t.height-1];r=C.create(i,e+1,n)}}else o instanceof s.Bs&&function({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(t+1)>e.start(t));t--,o--);return n==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(o)?r=s.Bs.create(i,o.from):o instanceof s.Bs&&function({$from:t,$to:e}){let n,o;for(let e=t.depth;e>0;e--){const o=t.node(e);if("cell"===o.type.spec.tableRole||"header_cell"===o.type.spec.tableRole){n=o;break}}for(let t=e.depth;t>0;t--){const n=e.node(t);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){o=n;break}}return n!==o&&0===e.parentOffset}(o)&&(r=s.Bs.create(i,o.$from.start(),o.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}(o,T(o,n),t)})}function ut(t,e,n,o,i,r){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let t=0,n=0;t{const{selection:e}=t.state;if(!(e instanceof C))return!1;let n=0;const o=(0,r.findParentNodeClosestToPos)(e.ranges[0].$from,(t=>"table"===t.type.name));return null==o||o.node.descendants((t=>{if("table"===t.type.name)return!1;["tableCell","tableHeader"].includes(t.type.name)&&(n+=1)})),n===e.ranges.length&&(t.commands.deleteTable(),!0)},mt=r.Node.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:ht,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({HTMLAttributes:t}){return["table",(0,r.mergeAttributes)(this.options.HTMLAttributes,t),["tbody",0]]},addCommands:()=>({insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:o,dispatch:i,editor:r})=>{const a=function(t,e,n,o,i){const r=function(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach((n=>{const o=t.nodes[n];o.spec.tableRole&&(e[o.spec.tableRole]=o)})),t.cached.tableNodeTypes=e,e}(t),s=[],a=[];for(let t=0;t({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t);e(X(t.tr,n,n.left))}return!0}(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t);e(X(t.tr,n,n.right))}return!0}(t,e),deleteColumn:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t),o=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let t=n.right-1;tt(o,n,t),t!=n.left;t--){const t=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!t)throw RangeError("No table found");n.table=t,n.map=u.get(t)}e(o)}return!0}(t,e),addRowBefore:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t);e(et(t.tr,n,n.top))}return!0}(t,e),addRowAfter:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t);e(et(t.tr,n,n.bottom))}return!0}(t,e),deleteRow:()=>({state:t,dispatch:e})=>function(t,e){if(!g(t))return!1;if(e){const n=G(t),o=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let t=n.bottom-1;nt(o,n,t),t!=n.top;t--){const t=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!t)throw RangeError("No table found");n.table=t,n.map=u.get(n.table)}e(o)}return!0}(t,e),deleteTable:()=>({state:t,dispatch:e})=>function(t,e){const n=t.selection.$anchor;for(let o=n.depth;o>0;o--)if("table"==n.node(o).type.spec.tableRole)return e&&e(t.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}(t,e),mergeCells:()=>({state:t,dispatch:e})=>it(t,e),splitCell:()=>({state:t,dispatch:e})=>rt(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>at("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>at("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>lt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>!!it(t,e)||rt(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:o})=>function(t,e){return function(n,o){if(!g(n))return!1;const i=b(n);if(i.nodeAfter.attrs[t]===e)return!1;if(o){const r=n.tr;n.selection instanceof C?n.selection.forEachCell(((n,o)=>{n.attrs[t]!==e&&r.setNodeMarkup(o,null,{...n.attrs,[t]:e})})):r.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),o(r)}return!0}}(t,e)(n,o),goToNextCell:()=>({state:t,dispatch:e})=>ct(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>ct(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&T(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const n=C.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:ft,"Mod-Backspace":ft,Delete:ft,"Mod-Delete":ft}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[V({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],dt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:(0,r.callOrReturn)((0,r.getExtensionField)(t,"tableRole",e))}}}).extend({renderHTML({node:t,HTMLAttributes:e}){var n,o;let i=0,s=!0;try{const e=(null===(n=t.content)||void 0===n?void 0:n.content)[0];null===(o=null==e?void 0:e.content)||void 0===o||o.content.forEach((t=>{if(t.attrs.colwidth)t.attrs.colwidth.forEach((t=>{t?i+=t:(s=!1,i+=this.options.cellMinWidth)}));else{s=!1;const e=t.attrs.colspan||1;i+=this.options.cellMinWidth*e}}))}catch(t){s=!1}return e.style=s&&i>0?`width: ${i}px;`:i&&i>0?`min-width: ${i}px`:null,["div",{class:"tui-table-wrapper"},["table",(0,r.mergeAttributes)(this.options.HTMLAttributes,e),["tbody",0]]]}})},87187:(t,e,n)=>{n.d(e,{y:()=>l,d:()=>a});var o=n(12057),i=n(11046),r=n(74788);class s{constructor(t,e,n){const o=e.get(r.z2F),i=e.get(r._Vd).resolveComponentFactory(t);this.componentRef=i.create(e,[]),this.updateProps(n),o.attachView(this.componentRef.hostView)}get instance(){return this.componentRef.instance}get el(){return this.componentRef.injector.get(r.SBq)}get dom(){return this.el.nativeElement}updateProps(t){Object.entries(t).forEach((([t,e])=>{this.instance[t]=e}))}detectChanges(){this.componentRef.changeDetectorRef.detectChanges()}destroy(){this.componentRef.destroy()}}class a{}class l extends i.NodeView{constructor(t,e,n){super(t,e,n),this.contentDOMElement=null}mount(){const t=this.options.injector,e=t.get(o.K0),n={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(t={})=>this.updateAttributes(t),deleteNode:()=>this.deleteNode()};this.renderer=new s(this.component,t,n),this.extension.config.draggable&&(this.renderer.el.nativeElement.ondragstart=t=>{this.onDragStart(t)}),this.contentDOMElement=this.node.isLeaf?null:e.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit",this.renderer.detectChanges())}get dom(){return this.renderer.dom}get contentDOM(){return this.node.isLeaf?null:(this.maybeMoveContentDOM(),this.contentDOMElement)}update(t,e){return this.options.update?this.options.update(t,e):t.type===this.node.type&&(t===this.node&&this.decorations===e||(this.node=t,this.decorations=e,this.renderer.updateProps({node:t,decorations:e}),this.maybeMoveContentDOM()),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy()}maybeMoveContentDOM(){const t=this.dom.querySelector("[data-node-view-content]");this.contentDOMElement&&t&&!t.contains(this.contentDOMElement)&&t.appendChild(this.contentDOMElement)}}},57080:(t,e,n)=>{n.d(e,{zc:()=>y.zc,dR:()=>y.dR,F1:()=>y.F1,Wf:()=>y.Wf,VE:()=>v.TUI_EDITOR_MAX_IMAGE_WIDTH,kB:()=>v.TUI_EDITOR_MIN_IMAGE_WIDTH,mJ:()=>y.mJ,bK:()=>y.bK,p7:()=>y.p7,H9:()=>o.H9,wl:()=>o.wl,aI:()=>r.a,BN:()=>h.BN,T_:()=>p,GK:()=>d,_2:()=>g._,Sz:()=>f,VM:()=>o.VM,$3:()=>h.$3,sw:()=>m.sw,PD:()=>b,aU:()=>m.Db,Uv:()=>y.Uv,Er:()=>w.Er});var o=n(96472),i=n(8674),r=n(19586),s=n(12057),a=n(64642),l=n(67274),c=(n(96152),n(74788));let d=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=c.oAB({type:t}),t.ɵinj=c.cJS({}),t})();var u=n(51618),h=n(86114);let p=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=c.oAB({type:t}),t.ɵinj=c.cJS({imports:[[a.HOV,s.ez,u.yB,l.WUl,l.Jyu,i.Fu,a.Ah6,l.dpK,h.mJ,d]]}),t})();n(46015),n(66654),n(22648),n(98230),n(12368),n(31496);let f=(()=>{class t{}return t.ɵfac=function(e){return new(e||t)},t.ɵmod=c.oAB({type:t}),t.ɵinj=c.cJS({imports:[[s.ez,l.KWI,l.cnw,l.jhF,o.wl,a.Ah6]]}),t})();n(78790);var m=n(18892),g=n(95161);n(13511);const b=[Promise.resolve().then(n.bind(n,66826)).then((({StarterKit:t})=>t)).then((t=>t.configure({heading:{levels:[1,2,3,4,5,6]}}))),n.e(3336).then(n.bind(n,73336)).then((({default:t})=>t.configure({types:["heading","paragraph"]}))),Promise.resolve().then(n.bind(n,84402)).then((({default:t})=>t)),n.e(7991).then(n.bind(n,17991)).then((({default:t})=>t)),n.e(7147).then(n.bind(n,77147)).then((({default:t})=>t)),n.e(5034).then(n.bind(n,25034)).then((({default:t})=>t)),Promise.resolve().then(n.bind(n,47841)).then((({FontColor:t})=>t)),Promise.resolve().then(n.bind(n,44632)).then((({default:t})=>t.configure({inline:!0,allowBase64:!0}))),Promise.resolve().then(n.bind(n,50822)).then((({TuiLink:t})=>t)),n.e(8629).then(n.bind(n,88629)).then((({TuiJumpAnchor:t})=>t)),Promise.resolve().then(n.bind(n,41131)).then((({TuiFileLink:t})=>t)),Promise.resolve().then(n.bind(n,13511)).then((({BackgroundColor:t})=>t)),Promise.resolve().then(n.bind(n,47745)).then((({TuiTable:t})=>t.configure({resizable:!0}))),n.e(5213).then(n.bind(n,45213)).then((({default:t})=>t)),n.e(1397).then(n.bind(n,71397)).then((({default:t})=>t)),n.e(8840).then(n.bind(n,38840)).then((({TableHeader:t})=>t)),Promise.resolve().then(n.bind(n,73757)).then((({TuiTabExtension:t})=>t)),Promise.resolve().then(n.bind(n,58676)).then((({TableCellBackground:t})=>t)),n.e(7095).then(n.bind(n,77095)).then((({TuiDetailsContent:t})=>t)),n.e(7095).then(n.bind(n,77095)).then((({TuiDetails:t})=>t)),n.e(7095).then(n.bind(n,77095)).then((({TuiSummary:t})=>t)),Promise.resolve().then(n.bind(n,83120)).then((({TuiFontSize:t})=>t))];n(41131),n(47841),n(83120),n(38981),n(91876);var v=n(45267),y=(n(73757),n(50822),n(12585),n(66826),n(47745),n(58676),n(71831)),w=n(39425)},20755:(t,e,n)=>{n.d(e,{i:()=>h});var o=n(12057),i=n(74788),r=n(64642),s=n(39425),a=n(29856),l=n(43190),c=n(88002),d=n(46782),u=n(39761);let h=(()=>{class t extends a.y{constructor(t,{nativeElement:e},n){const o=(0,r.mLY)(e,"mousedown").pipe((0,r.mp3)(),(0,l.w)((t=>{const o=(0,r.mLY)(n,"mousemove").pipe((0,c.U)((({clientX:t,clientY:n})=>(0,s.Ws)(t,n,e))),(0,d.R)((0,r.mLY)(n,"mouseup")));return t.target===e?o.pipe((0,u.O)((0,s.Ws)(t.clientX,t.clientY,e))):o})),(0,d.R)(t));super((t=>o.subscribe(t)))}}return t.ɵfac=function(e){return new(e||t)(i.LFG(r.a31,2),i.LFG(i.SBq),i.LFG(o.K0))},t.ɵprov=i.Yz7({token:t,factory:t.ɵfac}),t})()},71831:(t,e,n)=>{n.d(e,{Y1:()=>T,F4:()=>r,bG:()=>O,ZW:()=>A,zc:()=>m,dR:()=>f,Mr:()=>x,dj:()=>b,F1:()=>h,Wf:()=>i,UN:()=>k,b$:()=>w,mJ:()=>c,$i:()=>y,rf:()=>v,bK:()=>p,p7:()=>M,Uv:()=>d});var o=n(74788);const i=new o.OlP("[TUI_EDITOR_EXTENSIONS]"),r=new o.OlP("[LAZY_EDITOR_EXTENSIONS]");var s=n(64642),a=n(18892);const l={translate:"no",spellcheck:!1,colors:a.sw,blankColor:a.hK,linkOptions:a.pL,fontOptions:a.RR,icons:{undo:"tuiIconUndoLarge",redo:"tuiIconRedoLarge",quote:"tuiIconQuoteLarge",link:"tuiIconLinkLarge",anchor:"tuiIconAnchorLarge",attach:"tuiIconPaperclipLarge",sub:"tuiIconSubscriptLarge",sup:"tuiIconSuperscriptLarge",tex:"tuiIconTeXLarge",image:"tuiIconImageLarge",hr:"tuiIconHrLarge",clear:"tuiIconClearFormatLarge",groupAdd:"tuiIconPlusLarge",groupRemove:"tuiIconCloseLarge",detailsAdd:"tuiIconSpoilerLarge",detailsRemove:"tuiIconSpoilerDeleteLarge",popupLinkSave:"tuiIconCheckCircleLarge",popupLinkRemove:"tuiIconCloseLarge",popupPreviewLinkEdit:"tuiIconEdit2Large",popupPreviewLinkClear:"tuiIconUnlinkLarge",paint:"tuiIconPaintLarge",textAlignPreview:"tuiIconAlignLeftLarge",textAlignLeft:"tuiIconAlignLeftLarge",textAlignCenter:"tuiIconAlignCenterLarge",textAlignRight:"tuiIconAlignRightLarge",textAlignJustify:"tuiIconAlignJustifyLarge",textColor:"tuiIconColorLarge",textHilite:"tuiIconHiliteLarge",listPreview:"tuiIconListLarge",listUnOrdered:"tuiIconListLarge",listOrdered:"tuiIconOLLarge",indent:"tuiIconIndentLarge",outdent:"tuiIconOutdentLarge",fontSize:"tuiIconFontLarge",insertTable:"tuiIconTableLarge",addRowTable:"tuiIconAddRowLarge",code:"tuiIconCodeLarge",fontStylePreview:"tuiIconFormatLarge",fontStyleBold:"tuiIconBoldLarge",fontStyleItalic:"tuiIconItalicLarge",fontStyleUnderline:"tuiIconUnderlineLarge",fontStyleStrike:"tuiIconStrikeThroughLarge",colorSelectorDropdownChevron:"tuiIconChevronDown",colorSelectorDropdownCheck:"tuiIconCheck"}},c=(0,s.jHx)(l);function d(t){return(0,s.vKU)(c,t,l)}var u=n(54487);const h=new o.OlP("[TUI_EDITOR_CONTENT_PROCESSOR]",{factory:()=>u.y}),p=new o.OlP("[TUI_EDITOR_VALUE_TRANSFORMER]"),f=new o.OlP("[TUI_ATTACH_FILES_OPTIONS]",{factory:()=>({accept:"*/*",multiple:!0})}),m=new o.OlP("[TUI_ATTACH_FILES_LOADER]");var g=n(75606);const b=new o.OlP("[TUI_EDITOR_COLOR_SELECTOR_MODE_NAMES]",{factory:()=>["Solid color","Gradient"]}),v=new o.OlP("[TUI_EDITOR_TOOLBAR_TEXTS]",{factory:(0,g.vv)("toolbarTools")}),y=new o.OlP("[TUI_EDITOR_TABLE_COMMANDS]",{factory:(0,g.vv)("editorTableCommands")}),w=new o.OlP("[TUI_EDITOR_LINK_TEXTS]",{factory:(0,g.vv)("editorEditLink")}),x=new o.OlP("[TUI_EDITOR_CODE_OPTIONS]",{factory:(0,g.vv)("editorCodeOptions")}),k=new o.OlP("[TUI_EDITOR_FONT_OPTIONS]",{factory:(0,g.vv)("editorFontOptions")});var C=n(88002);const M=new o.OlP("[TUI_IMAGE_LOADER]",{factory:()=>t=>{const e=new FileReader;return e.readAsDataURL(t),(0,s.mLY)(e,"load").pipe((0,C.U)((()=>String(e.result))))}});var S=n(74235);const A=new o.OlP("[TIPTAP_EDITOR]"),O=new o.OlP("[LAZY_TIPTAP_EDITOR]",{factory:()=>{const t=new S.t(1);return Promise.resolve().then(n.bind(n,11046)).then((e=>t.next(e.Editor))),t}}),T=new o.OlP("[INITIALIZATION_TIPTAP_CONTAINER]")},39425:(t,e,n)=>{function o(t,e,n){const o=t.selection.$anchor;for(let i=o.depth;i>0;i--)if(o.node(i).type.name===n)return e&&e(t.tr.delete(o.before(i),o.after(i)).scrollIntoView()),!0;return!1}n.d(e,{yU:()=>o,Ws:()=>r,U5:()=>s,Yz:()=>l,YX:()=>d,Ap:()=>h,nC:()=>C,Er:()=>p,_N:()=>y,x6:()=>x,jx:()=>k,CH:()=>M});var i=n(64642);function r(t,e,n){const{left:o,top:r,width:s,height:a}=n.getBoundingClientRect();return[(0,i.Kiv)(t-o,0,s)/s,(0,i.Kiv)(e-r,0,a)/a]}function s(t){return t.slice(0,Math.max(0,t.length-1)).replace("linear-gradient(","")}function a(t,e,n={}){return t.find((({attrs:t,type:o})=>o===e&&function(t,e){const n=Object.keys(e);return!n.length||!!n.filter((n=>e[n]===t[n])).length}(t,n)))||null}function l(t,e,n={}){if(!t||!e)return null;const{node:o,offset:i}=t.parent.childAfter(t.parentOffset);if(!o)return null;const r=a(o.marks,e,n);if(!r)return null;let s=t.index(),l=t.start()+i,c=s+1,d=l+o.nodeSize;for(a(o.marks,e,n);s>0&&r.isInSet(t.parent.child(s-1).marks);)s-=1,l-=t.parent.child(s).nodeSize;for(;c{t instanceof c.NB&&e.push([t.type.name,t.attrs])})),e}var u=n(11046);function h(t,e){const n=null!=e?e:t.selection.$head.parent.textContent,o=t.doc.cut(t.selection.from,t.selection.to);return o.content.size?(0,u.getHTMLFromFragment)(o.content,t.schema):n}function p(t){const e=(new DOMParser).parseFromString(t,"text/html");return f(e.body),e.body.innerHTML}function f(t){for(const e of Array.from(t.children))if(e.children.length&&f(e),"FONT"===e.tagName)if(e.hasAttribute("size"))switch(e.getAttribute("size")){case"6":m("h1",e);break;case"5":m("h2",e);break;case"4":g("17px",e);break;case"3":g("15px",e);break;case"2":g("13px",e)}else e.hasAttribute("color")&&b(e)}function m(t,e){var n,o,i,r,s,a,l,c,d;const u=document.createElement(t);if(u.innerHTML=e.innerHTML,"P"===(null===(n=e.parentElement)||void 0===n?void 0:n.tagName)){const t=null===(i=null===(o=e.parentElement)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.insertBefore(u,e.parentElement);null===(r=e.parentElement)||void 0===r||r.removeChild(e),(null==t?void 0:t.nextSibling)&&!(null===(a=null===(s=null==t?void 0:t.nextSibling)||void 0===s?void 0:s.textContent)||void 0===a?void 0:a.trim())&&(null===(c=null===(l=t.nextSibling)||void 0===l?void 0:l.parentElement)||void 0===c||c.removeChild(t.nextSibling))}else null===(d=e.parentElement)||void 0===d||d.replaceChild(u,e)}function g(t,e){var n;const o=document.createElement("p"),i=document.createElement("span");i.setAttribute("style",`font-size: ${t}`),i.innerHTML=e.innerHTML,o.append(i),null===(n=e.parentElement)||void 0===n||n.replaceChild("P"===e.parentElement.tagName?i:o,e)}function b(t){var e;const n=document.createElement("span");n.setAttribute("style",`color: ${t.getAttribute("color")}`),n.innerHTML=t.innerHTML,null===(e=t.parentElement)||void 0===e||e.replaceChild(n,t)}const v=["\\s*(","(?:","#(?:[a-f0-9]{6}|[a-f0-9]{3})","|","(?:rgb|hsl)","\\(\\s*(?:\\d{1,3}\\s*,\\s*){2}\\d{1,3}\\s*\\)","|","(?:rgba|hsla)","\\(\\s*(?:\\d{1,3}\\s*,\\s*){2}\\d{1,3}\\s*,\\s*\\d*\\.?\\d+\\)","|","[_a-z-][_a-z0-9-]*",")",")","(?:\\s+","(","(?:[+-]?\\d*\\.?\\d+)(?:%|[a-z]+)?","))?","(?:","\\s*,\\s*","\\s*)?"];function y(t){const e=new RegExp(v.join(""),"gi"),n=t.startsWith("to")||t.match(/^\d/)?t.slice(Math.max(0,t.indexOf(",")+1)).trim():t,o=t.startsWith("to")?t.split(",")[0]:"to bottom";let i=[],r=e.exec(n);for(;null!==r;)i=i.concat({color:r[1],position:w(r[2],i.length)}),r=e.exec(n);return i=i.filter((({color:t})=>t.startsWith("#")||t.startsWith("rgb"))),{stops:i,side:o}}function w(t,e){const n=1===e?"100%":`${e}%`;return(null==t?void 0:t.includes("%"))?t:n}function x(t){return t.reduce(((t,e)=>(t[e]={parseHTML:t=>null==t?void 0:t.getAttribute(`${e}`)},t)),{})}function k(t){return t.split(";").reduce(((t,e)=>{var n;const[o,i]=null!==(n=e.split(":"))&&void 0!==n?n:[];return o&&i&&(t[o.trim()]=i.trim()),t}),{})}function C(t){var e;const n=(null===(e=t.endContainer.nodeValue)||void 0===e?void 0:e.length)||0;return t.endOffset-t.startOffset>0||t.endOffset-t.startOffset==0&&1===n||0!==t.startOffset&&n>1&&t.endOffset!==n}function M({stops:t,side:e}){return`linear-gradient(${e}, ${t.map((({color:t,position:e})=>`rgba(${(0,i.MpC)(t).join(", ")}) ${e}`)).join(", ")})`}},11046:(t,e,n)=>{n.r(e),n.d(e,{CommandManager:()=>D,Editor:()=>ge,Extension:()=>ct,InputRule:()=>K,Mark:()=>ke,Node:()=>Ce,NodeView:()=>Me,PasteRule:()=>nt,Tracker:()=>Ee,callOrReturn:()=>F,combineTransactionSteps:()=>It,createChainableState:()=>I,createDocument:()=>Nt,createNodeFromContent:()=>Ct,createStyleTag:()=>me,defaultBlockAt:()=>Dt,deleteProps:()=>Tt,elementFromString:()=>kt,escapeForRegEx:()=>Ae,extensions:()=>fe,findChildren:()=>Pt,findChildrenInRange:()=>Ht,findDuplicates:()=>rt,findParentNode:()=>_t,findParentNodeClosestToPos:()=>Lt,fromString:()=>Z,generateHTML:()=>$t,generateJSON:()=>Bt,generateText:()=>Jt,getAttributes:()=>Yt,getAttributesFromExtensions:()=>_,getChangedRanges:()=>qt,getDebugJSON:()=>Vt,getExtensionField:()=>H,getHTMLFromFragment:()=>Rt,getMarkAttributes:()=>Et,getMarkRange:()=>gt,getMarkType:()=>bt,getMarksBetween:()=>Ut,getNodeAtPosition:()=>Wt,getNodeAttributes:()=>Zt,getNodeType:()=>R,getRenderedAttributes:()=>$,getSchema:()=>zt,getSchemaByResolvedExtensions:()=>q,getSchemaTypeByName:()=>V,getSchemaTypeNameByName:()=>Ot,getSplittedAttributes:()=>Qt,getText:()=>Ft,getTextBetween:()=>dt,getTextContentFromNodes:()=>W,getTextSerializersFromSchema:()=>ut,injectExtensionAttributesToParseRule:()=>Y,inputRulesPlugin:()=>tt,isActive:()=>Gt,isAtEndOfNode:()=>Xt,isAtStartOfNode:()=>te,isEmptyObject:()=>J,isExtensionRulesEnabled:()=>U,isFunction:()=>B,isList:()=>ee,isMacOS:()=>St,isMarkActive:()=>Kt,isNodeActive:()=>At,isNodeEmpty:()=>ne,isNodeSelection:()=>oe,isNumber:()=>et,isPlainObject:()=>at,isRegExp:()=>Q,isString:()=>Oe,isTextSelection:()=>vt,isiOS:()=>xt,markInputRule:()=>be,markPasteRule:()=>Se,mergeAttributes:()=>z,mergeDeep:()=>lt,minMax:()=>yt,nodeInputRule:()=>ve,nodePasteRule:()=>Te,objectIncludes:()=>pt,pasteRulesPlugin:()=>it,posToDOMRect:()=>ie,removeDuplicates:()=>jt,resolveFocusPosition:()=>wt,selectionToInsertionEnd:()=>Mt,splitExtensions:()=>L,textInputRule:()=>we,textPasteRule:()=>Ne,textblockTypeInputRule:()=>ye,wrappingInputRule:()=>xe});var o=n(62463),i=n(43594),r=n(31690),s=n(27439),a=n(38480);const l=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),c=(t,e,n)=>{let i=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!i)return!1;let r=h(i);if(!r){let n=i.blockRange(),o=n&&(0,a.k9)(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let l=r.nodeBefore;if(!l.type.spec.isolating&&x(t,r,e))return!0;if(0==i.parent.content.size&&(d(l,"end")||o.qv.isSelectable(l))){let n=(0,a.dR)(t.doc,i.before(),i.after(),s.p2.empty);if(n&&n.slice.size{let{$head:i,empty:r}=t.selection,s=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):i.parentOffset>0)return!1;s=h(i)}let a=s&&s.nodeBefore;return!(!a||!o.qv.isSelectable(a)||(e&&e(t.tr.setSelection(o.qv.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),0))};function h(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}const p=(t,e,n)=>{let i=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let{$head:i,empty:r}=t.selection,s=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):i.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let{$head:n,$anchor:o}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(o)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))};function b(t){for(let e=0;e{let{$head:n,$anchor:i}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),s=n.indexAfter(-1),a=b(r.contentMatchAt(s));if(!a||!r.canReplaceWith(s,s,a))return!1;if(e){let i=n.after(),r=t.tr.replaceWith(i,i,a.createAndFill());r.setSelection(o.Y1.near(r.doc.resolve(i),1)),e(r.scrollIntoView())}return!0},y=(t,e)=>{let n=t.selection,{$from:i,$to:r}=n;if(n instanceof o.C1||i.parent.inlineContent||r.parent.inlineContent)return!1;let s=b(r.parent.contentMatchAt(r.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let n=(!i.parentOffset&&r.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if((0,a.Ax)(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let o=n.blockRange(),i=o&&(0,a.k9)(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)};function x(t,e,n){let i,r,l=e.nodeBefore,c=e.nodeAfter;if(l.type.spec.isolating||c.type.spec.isolating)return!1;if(function(t,e,n){let o=e.nodeBefore,i=e.nodeAfter,r=e.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&e.parent.canReplace(r-1,r)?(n&&n(t.tr.delete(e.pos-o.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(r,r+1)||!i.isTextblock&&!(0,a.Mn)(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,o.type,o.contentMatchAt(o.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(r=l.contentMatchAt(l.childCount)).findWrapping(c.type))&&r.matchType(i[0]||c.type).validEnd){if(n){let o=e.pos+c.nodeSize,r=s.HY.empty;for(let t=i.length-1;t>=0;t--)r=s.HY.from(i[t].create(null,r));r=s.HY.from(l.copy(r));let d=t.tr.step(new a.FC(e.pos-1,o,e.pos,o,new s.p2(r,1,0),i.length,!0)),u=o+2*i.length;(0,a.Mn)(d.doc,u)&&d.join(u),n(d.scrollIntoView())}return!0}let h=o.Y1.findFrom(e,1),p=h&&h.$from.blockRange(h.$to),f=p&&(0,a.k9)(p);if(null!=f&&f>=e.depth)return n&&n(t.tr.lift(p,f).scrollIntoView()),!0;if(u&&d(c,"start",!0)&&d(l,"end")){let o=l,i=[];for(;i.push(o),!o.isTextblock;)o=o.lastChild;let r=c,d=1;for(;!r.isTextblock;r=r.firstChild)d++;if(o.canReplace(o.childCount,o.childCount,r.content)){if(n){let o=s.HY.empty;for(let t=i.length-1;t>=0;t--)o=s.HY.from(i[t].copy(o));n(t.tr.step(new a.FC(e.pos-i.length,e.pos+c.nodeSize,e.pos+d,e.pos+c.nodeSize-d,new s.p2(o,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function k(t){return function(e,n){let i=e.selection,r=t<0?i.$from:i.$to,s=r.depth;for(;r.node(s).isInline;){if(!s)return!1;s--}return!!r.node(s).isTextblock&&(n&&n(e.tr.setSelection(o.Bs.create(e.doc,t<0?r.start(s):r.end(s)))),!0)}}const C=k(-1),M=k(1);function S(t,e=null){return function(n,o){let i=!1;for(let o=0;o{if(i)return!1;if(o.isTextblock&&!o.hasMarkup(t,e))if(o.type==t)i=!0;else{let e=n.doc.resolve(r),o=e.index();i=e.parent.canReplaceWith(o,o+1,t)}}))}if(!i)return!1;if(o){let i=n.tr;for(let o=0;o{let{$from:n,$to:i}=t.selection;if(t.selection instanceof o.qv&&t.selection.node.isBlock)return!(!n.parentOffset||!(0,a.Ax)(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(e){let r=i.parentOffset==i.parent.content.size,s=t.tr;(t.selection instanceof o.Bs||t.selection instanceof o.C1)&&s.deleteSelection();let l=0==n.depth?null:b(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=r&&l?[{type:l}]:void 0,d=(0,a.Ax)(s.doc,s.mapping.map(n.pos),1,c);if(c||d||!(0,a.Ax)(s.doc,s.mapping.map(n.pos),1,l?[{type:l}]:void 0)||(l&&(c=[{type:l}]),d=!0),d&&(s.split(s.mapping.map(n.pos),1,c),!r&&!n.parentOffset&&n.parent.type!=l)){let t=s.mapping.map(n.before()),e=s.doc.resolve(t);l&&n.node(-1).canReplaceWith(e.index(),e.index()+1,l)&&s.setNodeMarkup(s.mapping.map(n.before()),l)}e(s.scrollIntoView())}return!0})),"Mod-Enter":v,Backspace:O,"Mod-Backspace":O,"Shift-Backspace":O,Delete:T,"Mod-Delete":T,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new o.C1(t.doc))),!0)},E={"Ctrl-h":N.Backspace,"Alt-Backspace":N["Mod-Backspace"],"Ctrl-d":N.Delete,"Ctrl-Alt-Backspace":N["Mod-Delete"],"Alt-Delete":N["Mod-Delete"],"Alt-d":N["Mod-Delete"],"Ctrl-a":C,"Ctrl-e":M};for(let t in N)E[t]=N[t];function I(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:i}=n,{storedMarks:r}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return r},get selection(){return o},get doc(){return i},get tr(){return o=n.selection,i=n.doc,r=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class D{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:i}=n,r=this.buildProps(i);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(r);return i.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:r}=o,s=[],a=!!t,l=t||i.tr,c={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const o=this.buildProps(l,e),i=n(...t)(o);return s.push(i),c}]))),run:()=>(a||!e||l.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(l),s.every((t=>!0===t)))};return c}createCan(t){const{rawCommands:e,state:n}=this,o=t||n.tr,i=this.buildProps(o,!1);return{...Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...i,dispatch:void 0})]))),chain:()=>this.createChain(o,!1)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:r}=o,s={tr:t,editor:o,view:r,state:I({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}class P{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function H(t,e,n){return void 0===t.config[e]&&t.parent?H(t.parent,e,n):"function"==typeof t.config[e]?t.config[e].bind({...n,parent:t.parent?H(t.parent,e,n):null}):t.config[e]}function L(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function _(t){const e=[],{nodeExtensions:n,markExtensions:o}=L(t),i=[...n,...o],r={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=H(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});n&&n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,o])=>{e.push({type:n,name:t,attribute:{...r,...o}})}))}))}))})),i.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},o=H(t,"addAttributes",n);if(!o)return;const i=o();Object.entries(i).forEach((([n,o])=>{const i={...r,...o};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete i.default,e.push({type:t.name,name:n,attribute:i})}))})),e}function R(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function z(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{if(n[t])if("class"===t){const o=e?e.split(" "):[],i=n[t]?n[t].split(" "):[],r=o.filter((t=>!i.includes(t)));n[t]=[...i,...r].join(" ")}else n[t]="style"===t?[n[t],e].join("; "):e;else n[t]=e})),n}),{})}function $(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>z(t,e)),{})}function B(t){return"function"==typeof t}function F(t,e=void 0,...n){return B(t)?e?t.bind(e)(...n):t(...n):t}function J(t={}){return 0===Object.keys(t).length&&t.constructor===Object}function Z(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}function Y(t,e){return t.style?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===o)return!1;const i=e.reduce(((t,e)=>{const o=e.attribute.parseHTML?e.attribute.parseHTML(n):Z(n.getAttribute(e.name));return null==o?t:{...t,[e.name]:o}}),{});return{...o,...i}}}}function j(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!J(e))&&null!=e)))}function q(t,e){var n;const o=_(t),{nodeExtensions:i,markExtensions:r}=L(t),a=null===(n=i.find((t=>H(t,"topNode"))))||void 0===n?void 0:n.name,l=Object.fromEntries(i.map((n=>{const i=o.filter((t=>t.type===n.name)),r={name:n.name,options:n.options,storage:n.storage,editor:e},s=j({...t.reduce(((t,e)=>{const o=H(e,"extendNodeSchema",r);return{...t,...o?o(n):{}}}),{}),content:F(H(n,"content",r)),marks:F(H(n,"marks",r)),group:F(H(n,"group",r)),inline:F(H(n,"inline",r)),atom:F(H(n,"atom",r)),selectable:F(H(n,"selectable",r)),draggable:F(H(n,"draggable",r)),code:F(H(n,"code",r)),defining:F(H(n,"defining",r)),isolating:F(H(n,"isolating",r)),attrs:Object.fromEntries(i.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=F(H(n,"parseHTML",r));a&&(s.parseDOM=a.map((t=>Y(t,i))));const l=H(n,"renderHTML",r);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:$(t,i)}));const c=H(n,"renderText",r);return c&&(s.toText=c),[n.name,s]}))),c=Object.fromEntries(r.map((n=>{const i=o.filter((t=>t.type===n.name)),r={name:n.name,options:n.options,storage:n.storage,editor:e},s=j({...t.reduce(((t,e)=>{const o=H(e,"extendMarkSchema",r);return{...t,...o?o(n):{}}}),{}),inclusive:F(H(n,"inclusive",r)),excludes:F(H(n,"excludes",r)),group:F(H(n,"group",r)),spanning:F(H(n,"spanning",r)),code:F(H(n,"code",r)),attrs:Object.fromEntries(i.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=F(H(n,"parseHTML",r));a&&(s.parseDOM=a.map((t=>Y(t,i))));const l=H(n,"renderHTML",r);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:$(t,i)})),[n.name,s]})));return new s.V_({topNode:a,nodes:l,marks:c})}function V(t,e){return e.nodes[t]||e.marks[t]||null}function U(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}const W=(t,e=500)=>{let n="";const o=t.parentOffset;return t.parent.nodesBetween(Math.max(0,o-e),o,((t,e,i,r)=>{var s,a;const l=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:e,parent:i,index:r}))||t.textContent||"%leaf%";n+=l.slice(0,Math.max(0,o-e))})),n};function Q(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class K{constructor(t){this.find=t.find,this.handler=t.handler}}const G=(t,e)=>{if(Q(e))return e.exec(t);const n=e(t);if(!n)return null;const o=[n.text];return o.index=n.index,o.input=t,o.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(n.replaceWith)),o};function X(t){var e;const{editor:n,from:o,to:i,text:r,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(o);if(c.parent.type.spec.code||(null===(e=c.nodeBefore||c.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let d=!1;const u=W(c)+r;return s.forEach((t=>{if(d)return;const e=G(u,t.find);if(!e)return;const s=l.state.tr,c=I({state:l.state,transaction:s}),h={from:o-(e[0].length-r.length),to:i},{commands:p,chain:f,can:m}=new D({editor:n,state:c});null!==t.handler({state:c,range:h,match:e,commands:p,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:o,to:i,text:r}),l.dispatch(s),d=!0)})),d}function tt(t){const{editor:e,rules:n}=t,i=new o.Sy({state:{init:()=>null,apply:(t,e)=>t.getMeta(i)||(t.selectionSet||t.docChanged?null:e)},props:{handleTextInput:(t,o,r,s)=>X({editor:e,from:o,to:r,text:s,rules:n,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&X({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:i})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:r}=t.state.selection;return!!r&&X({editor:e,from:r.pos,to:r.pos,text:"\n",rules:n,plugin:i})}},isInputRules:!0});return i}function et(t){return"number"==typeof t}class nt{constructor(t){this.find=t.find,this.handler=t.handler}}const ot=(t,e)=>{if(Q(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]};function it(t){const{editor:e,rules:n}=t;let i=null,r=!1,s=!1,a=new ClipboardEvent("paste"),l=new DragEvent("drop");const c=n.map((t=>new o.Sy({view(t){const e=e=>{var n;i=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:(t,e)=>(s=i===t.dom.parentElement,l=e,!1),paste:(t,e)=>{var n;const o=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return a=e,r=!!(null==o?void 0:o.includes("data-pm-slice")),!1}}},appendTransaction:(n,o,i)=>{const c=n[0],d="paste"===c.getMeta("uiEvent")&&!r,u="drop"===c.getMeta("uiEvent")&&!s;if(!d&&!u)return;const h=o.doc.content.findDiffStart(i.doc.content),p=o.doc.content.findDiffEnd(i.doc.content);if(!et(h)||!p||h===p.b)return;const f=i.tr,m=I({state:i,transaction:f}),g=function(t){const{editor:e,state:n,from:o,to:i,rule:r,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:d}=new D({editor:e,state:n}),u=[];return n.doc.nodesBetween(o,i,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const h=Math.max(o,e),p=Math.min(i,e+t.content.size),f=t.textBetween(h-e,p-e,void 0,"");ot(f,r.find).forEach((t=>{if(void 0===t.index)return;const e=h+t.index+1,o=e+t[0].length,i={from:n.tr.mapping.map(e),to:n.tr.mapping.map(o)},p=r.handler({state:n,range:i,match:t,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(p)}))})),u.every((t=>null!==t))}({editor:e,state:m,from:Math.max(h-1,0),to:p.b-1,rule:t,pasteEvent:a,dropEvent:l});return g&&f.steps.length?(l=new DragEvent("drop"),a=new ClipboardEvent("paste"),f):void 0}})));return c}function rt(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}class st{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=st.resolve(t),this.schema=q(this.extensions,e),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:V(t.name,this.schema)};"mark"===t.type&&(null===(e=F(H(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name);const o=H(t,"onBeforeCreate",n);o&&this.editor.on("beforeCreate",o);const i=H(t,"onCreate",n);i&&this.editor.on("create",i);const r=H(t,"onUpdate",n);r&&this.editor.on("update",r);const s=H(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=H(t,"onTransaction",n);a&&this.editor.on("transaction",a);const l=H(t,"onFocus",n);l&&this.editor.on("focus",l);const c=H(t,"onBlur",n);c&&this.editor.on("blur",c);const d=H(t,"onDestroy",n);d&&this.editor.on("destroy",d)}))}static resolve(t){const e=st.sort(st.flatten(t)),n=rt(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=H(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=H(t,"priority")||100,o=H(e,"priority")||100;return n>o?-1:n{const n=H(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:V(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=st.sort([...this.extensions].reverse()),n=[],o=[],i=e.map((e=>{const i={name:e.name,options:e.options,storage:e.storage,editor:t,type:V(e.name,this.schema)},s=[],a=H(e,"addKeyboardShortcuts",i);let l={};if("mark"===e.type&&e.config.exitable&&(l.ArrowRight=()=>ke.handleExit({editor:t,mark:e})),a){const e=Object.fromEntries(Object.entries(a()).map((([e,n])=>[e,()=>n({editor:t})])));l={...l,...e}}const c=(0,r.h)(l);s.push(c);const d=H(e,"addInputRules",i);U(e,t.options.enableInputRules)&&d&&n.push(...d());const u=H(e,"addPasteRules",i);U(e,t.options.enablePasteRules)&&u&&o.push(...u());const h=H(e,"addProseMirrorPlugins",i);if(h){const t=h();s.push(...t)}return s})).flat();return[tt({editor:t,rules:n}),...it({editor:t,rules:o}),...i]}get attributes(){return _(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=L(this.extensions);return Object.fromEntries(e.filter((t=>!!H(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage,editor:t,type:R(e.name,this.schema)},i=H(e,"addNodeView",o);return i?[e.name,(o,r,s,a)=>{const l=$(o,n);return i()({editor:t,node:o,getPos:s,decorations:a,HTMLAttributes:l,extension:e})}]:[]})))}}function at(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function lt(t,e){const n={...t};return at(t)&&at(e)&&Object.keys(e).forEach((o=>{at(e[o])?o in t?n[o]=lt(t[o],e[o]):Object.assign(n,{[o]:e[o]}):Object.assign(n,{[o]:e[o]})})),n}class ct{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=F(H(this,"addOptions",{name:this.name}))),this.storage=F(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ct(t)}configure(t={}){const e=this.extend();return e.options=lt(this.options,t),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new ct(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(H(e,"addOptions",{name:e.name})),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}}function dt(t,e,n){const{from:o,to:i}=e,{blockSeparator:r="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(o,i,((t,n,c,d)=>{var u;const h=null==s?void 0:s[t.type.name];h?(t.isBlock&&!l&&(a+=r,l=!0),c&&(a+=h({node:t,pos:n,parent:c,index:d,range:e}))):t.isText?(a+=null===(u=null==t?void 0:t.text)||void 0===u?void 0:u.slice(Math.max(o,n)-n,i-n),l=!1):t.isBlock&&!l&&(a+=r,l=!0)})),a}function ut(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}const ht=ct.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:i}=e,{ranges:r}=i;return dt(o,{from:Math.min(...r.map((t=>t.$from.pos))),to:Math.max(...r.map((t=>t.$to.pos)))},{textSerializers:ut(n)})}}})]}});function pt(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every((o=>n.strict?e[o]===t[o]:Q(e[o])?e[o].test(t[o]):e[o]===t[o]))}function ft(t,e,n={}){return t.find((t=>t.type===e&&pt(t.attrs,n)))}function mt(t,e,n={}){return!!ft(t,e,n)}function gt(t,e,n={}){if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if(t.parentOffset===o.offset&&0!==o.offset&&(o=t.parent.childBefore(t.parentOffset)),!o.node)return;const i=ft([...o.node.marks],e,n);if(!i)return;let r=o.index,s=t.start()+o.offset,a=r+1,l=s+o.node.nodeSize;for(ft([...o.node.marks],e,n);r>0&&i.isInSet(t.parent.child(r-1).marks);)r-=1,s-=t.parent.child(r).nodeSize;for(;a${t}`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Ct(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?s.HY.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Ct("",e,n)}if("string"==typeof t){const o=s.aw.fromSchema(e);return n.slice?o.parseSlice(kt(t),n.parseOptions).content:o.parse(kt(t),n.parseOptions)}return Ct("",e,n)}function Mt(t,e,n){const i=t.steps.length-1;if(i{0===l&&(l=o)})),t.setSelection(o.Y1.near(t.doc.resolve(l),n))}function St(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function At(t,e,n={}){const{from:o,to:i,empty:r}=t.selection,s=e?R(e,t.schema):null,a=[];t.doc.nodesBetween(o,i,((t,e)=>{if(t.isText)return;const n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);a.push({node:t,from:n,to:r})}));const l=i-o,c=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>pt(t.node.attrs,n,{strict:!1})));return r?!!c.length:c.reduce(((t,e)=>t+e.to-e.from),0)>=l}function Ot(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Tt(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,o)=>(n.includes(o)||(e[o]=t[o]),e)),{})}function Nt(t,e,n={}){return Ct(t,e,{slice:!1,parseOptions:n})}function Et(t,e){const n=bt(e,t.schema),{from:o,to:i,empty:r}=t.selection,s=[];r?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,i,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function It(t,e){const n=new a.wx(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}function Dt(t){for(let e=0;e{e(t)&&n.push({node:t,pos:o})})),n}function Ht(t,e,n){const o=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&o.push({node:t,pos:e})})),o}function Lt(t,e){for(let n=t.depth;n>0;n-=1){const o=t.node(n);if(e(o))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:o}}}function _t(t){return e=>Lt(e.$from,t)}function Rt(t,e){const n=s.PW.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function zt(t,e){return q(st.resolve(t),e)}function $t(t,e){const n=zt(e);return Rt(s.NB.fromJSON(n,t).content,n)}function Bt(t,e){const n=zt(e),o=kt(t);return s.aw.fromSchema(n).parse(o).toJSON()}function Ft(t,e){return dt(t,{from:0,to:t.content.size},e)}function Jt(t,e,n){const{blockSeparator:o="\n\n",textSerializers:i={}}=n||{},r=zt(e);return Ft(s.NB.fromJSON(r,t),{blockSeparator:o,textSerializers:{...ut(r),...i}})}function Zt(t,e){const n=R(e,t.schema),{from:o,to:i}=t.selection,r=[];t.doc.nodesBetween(o,i,(t=>{r.push(t)}));const s=r.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}function Yt(t,e){const n=Ot("string"==typeof e?e:e.name,t.schema);return"node"===n?Zt(t,e):"mark"===n?Et(t,e):{}}function jt(t,e=JSON.stringify){const n={};return t.filter((t=>{const o=e(t);return!Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=!0)}))}function qt(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach(((t,i)=>{const r=[];if(t.ranges.length)t.forEach(((t,e)=>{r.push({from:t,to:e})}));else{const{from:t,to:e}=n[i];if(void 0===t||void 0===e)return;r.push({from:t,to:e})}r.forEach((({from:t,to:n})=>{const r=e.slice(i).map(t,-1),s=e.slice(i).map(n),a=e.invert().map(r,-1),l=e.invert().map(s);o.push({oldRange:{from:a,to:l},newRange:{from:r,to:s}})}))})),function(t){const e=jt(t);return 1===e.length?e:e.filter(((t,n)=>!e.filter(((t,e)=>e!==n)).some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))))}(o)}function Vt(t,e=0){const n=t.type===t.type.schema.topNodeType?0:1,o=e,i=o+t.nodeSize,r=t.marks.map((t=>{const e={type:t.type.name};return Object.keys(t.attrs).length&&(e.attrs={...t.attrs}),e})),s={...t.attrs},a={type:t.type.name,from:o,to:i};return Object.keys(s).length&&(a.attrs=s),r.length&&(a.marks=r),t.content.childCount&&(a.content=[],t.forEach(((t,o)=>{var i;null===(i=a.content)||void 0===i||i.push(Vt(t,e+o+n))}))),t.text&&(a.text=t.text),a}function Ut(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach((e=>{const i=gt(n.resolve(t-1),e.type);i&&o.push({mark:e,...i})})):n.nodesBetween(t,e,((t,e)=>{o.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),o}const Wt=(t,e,n,o=20)=>{const i=t.doc.resolve(n);let r=o,s=null;for(;r>0&&null===s;){const t=i.node(r);(null==t?void 0:t.type.name)===e?s=t:r-=1}return[s,r]};function Qt(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const o=t.find((t=>t.type===e&&t.name===n));return!!o&&o.attribute.keepOnSplit})))}function Kt(t,e,n={}){const{empty:o,ranges:i}=t.selection,r=e?bt(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!r||r.name===t.type.name)).find((t=>pt(t.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:e,$to:n})=>{const o=e.pos,i=n.pos;t.doc.nodesBetween(o,i,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);s+=r-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:r}))))}))})),0===s)return!1;const l=a.filter((t=>!r||r.name===t.mark.type.name)).filter((t=>pt(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),c=a.filter((t=>!r||t.mark.type!==r&&t.mark.type.excludes(r))).reduce(((t,e)=>t+e.to-e.from),0);return(l>0?l+c:l)>=s}function Gt(t,e,n={}){if(!e)return At(t,null,n)||Kt(t,null,n);const o=Ot(e,t.schema);return"node"===o?At(t,e,n):"mark"===o&&Kt(t,e,n)}const Xt=(t,e)=>{const{$from:n,$to:o,$anchor:i}=t.selection;if(e){const n=_t((t=>t.type.name===e))(t.selection);if(!n)return!1;const o=t.doc.resolve(n.pos+1);return i.pos+1===o.end()}return!(o.parentOffset{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function ee(t,e){const{nodeExtensions:n}=L(e),o=n.find((e=>e.name===t));if(!o)return!1;const i=F(H(o,"group",{name:o.name,options:o.options,storage:o.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function ne(t){var e;const n=null===(e=t.type.createAndFill())||void 0===e?void 0:e.toJSON(),o=t.toJSON();return JSON.stringify(n)===JSON.stringify(o)}function oe(t){return t instanceof o.qv}function ie(t,e,n){const o=t.state.doc.content.size,i=yt(e,0,o),r=yt(n,0,o),s=t.coordsAtPos(i),a=t.coordsAtPos(r,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),d=Math.min(s.left,a.left),u=Math.max(s.right,a.right),h={top:l,bottom:c,left:d,right:u,width:u-d,height:c-l,x:d,y:l};return{...h,toJSON:()=>h}}function re(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(o)}}const se=(t,e)=>{const n=_t((t=>t.type===e))(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(null==i?void 0:i.type)||!(0,a.Mn)(t.doc,n.pos)||(t.join(n.pos),!0)},ae=(t,e)=>{const n=_t((t=>t.type===e))(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(null==i?void 0:i.type)||!(0,a.Mn)(t.doc,o)||(t.join(o),!0)};var le=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:i}=o;return!n||(i.forEach((({$from:n,$to:o})=>{t.doc.nodesBetween(n.pos,o.pos,((t,n)=>{if(t.type.isText)return;const{doc:o,mapping:i}=e,r=o.resolve(i.map(n)),s=o.resolve(i.map(n+t.nodeSize)),l=r.blockRange(s);if(!l)return;const c=(0,a.k9)(l);if(t.type.isTextblock){const{defaultType:t}=r.parent.contentMatchAt(r.index());e.setNodeMarkup(l.start,t)}(c||0===c)&&e.lift(l,c)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>y(t,e),cut:(t,e)=>({editor:n,tr:i})=>{const{state:r}=n,s=r.doc.slice(t.from,t.to);i.deleteRange(t.from,t.to);const a=i.mapping.map(e);return i.insert(a,s.content),i.setSelection(new o.Bs(i.doc.resolve(a-1))),!0},deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const i=t.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===o.type){if(e){const e=i.before(n),o=i.after(n);t.delete(e,o).scrollIntoView()}return!0}return!1},deleteNode:t=>({tr:e,state:n,dispatch:o})=>{const i=R(t,n.schema),r=e.selection.$anchor;for(let t=r.depth;t>0;t-=1)if(r.node(t).type===i){if(o){const n=r.before(t),o=r.after(t);e.delete(n,o).scrollIntoView()}return!0}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:o,to:i}=t;return n&&e.delete(o,i),!0},deleteSelection:()=>({state:t,dispatch:e})=>l(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>v(t,e),extendMarkRange:(t,e={})=>({tr:n,state:i,dispatch:r})=>{const s=bt(t,i.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(r){const t=gt(c,s,e);if(t&&t.from<=d&&t.to>=u){const e=o.Bs.create(a,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t({editor:n,view:o,tr:i,dispatch:r})=>{e={scrollIntoView:!0,...e};const s=()=>{xt()&&o.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(o.hasFocus()&&null===t||!1===t)return!0;if(r&&null===t&&!vt(n.state.selection))return s(),!0;const a=wt(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return r&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,o)=>e(t,{...n,index:o}))),insertContent:(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:o,dispatch:i,editor:r})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=Ct(e,r.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},l=!0,c=!0;if((i.toString().startsWith("<")?i:[i]).forEach((t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,c=!!c&&t.isBlock})),s===a&&c){const{parent:t}=o.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}l?Array.isArray(e)?o.insertText(e.map((t=>t.text||"")).join(""),s,a):"object"==typeof e&&e&&e.text?o.insertText(e.text,s,a):o.insertText(e,s,a):o.replaceWith(s,a,i),n.updateSelection&&Mt(o,o.steps.length-1,-1)}return!0},joinUp:()=>({state:t,dispatch:e})=>((t,e)=>{let n,i=t.selection,r=i instanceof o.qv;if(r){if(i.node.isTextblock||!(0,a.Mn)(t.doc,i.from))return!1;n=i.from}else if(n=(0,a.GJ)(t.doc,i.from,-1),null==n)return!1;if(e){let i=t.tr.join(n);r&&i.setSelection(o.qv.create(i.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0})(t,e),joinDown:()=>({state:t,dispatch:e})=>((t,e)=>{let n,i=t.selection;if(i instanceof o.qv){if(i.node.isTextblock||!(0,a.Mn)(t.doc,i.to))return!1;n=i.to}else if(n=(0,a.GJ)(t.doc,i.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(t,e),joinBackward:()=>({state:t,dispatch:e})=>c(t,e),joinForward:()=>({state:t,dispatch:e})=>p(t,e),joinItemBackward:()=>({tr:t,state:e,dispatch:n})=>{try{const o=(0,a.GJ)(e.doc,e.selection.$from.pos,-1);return null!=o&&(t.join(o,2),n&&n(t),!0)}catch{return!1}},joinItemForward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=(0,a.GJ)(t.doc,t.selection.$from.pos,1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch(t){return!1}},keyboardShortcut:t=>({editor:e,view:n,tr:o,dispatch:i})=>{const r=function(t){const e=t.split(/-(?!$)/);let n,o,i,r,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==l||l.steps.forEach((t=>{const e=t.map(o.mapping);e&&i&&o.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:o})=>!!At(n,R(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:o}=t.selection,i=n.blockRange(o),r=i&&(0,a.k9)(i);return null!=r&&(e&&e(t.tr.lift(i,r).scrollIntoView()),!0)})(n,o),liftEmptyBlock:()=>({state:t,dispatch:e})=>w(t,e),liftListItem:t=>({state:e,dispatch:n})=>{return(o=R(t,e.schema),function(t,e){let{$from:n,$to:i}=t.selection,r=n.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==o));return!!r&&(!e||(n.node(r.depth-1).type==o?function(t,e,n,o){let i=t.tr,r=o.end,l=o.$to.end(o.depth);rr;e--)t-=i.child(e).nodeSize,o.delete(t-1,t+1);let r=o.doc.resolve(n.start),l=r.nodeAfter;if(o.mapping.map(n.end)!=n.start+r.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,d=n.endIndex==i.childCount,u=r.node(-1),h=r.index(-1);if(!u.canReplace(h+(c?0:1),h+1,l.content.append(d?s.HY.empty:s.HY.from(i))))return!1;let p=r.pos,f=p+l.nodeSize;return o.step(new a.FC(p-(c?1:0),f+(d?1:0),p+1,f-1,new s.p2((c?s.HY.empty:s.HY.from(i.copy(s.HY.empty))).append(d?s.HY.empty:s.HY.from(i.copy(s.HY.empty))),c?0:1,d?0:1),c?0:1)),e(o.scrollIntoView()),!0}(t,e,r)))})(e,n);var o},newlineInCode:()=>({state:t,dispatch:e})=>g(t,e),resetAttributes:(t,e)=>({tr:n,state:o,dispatch:i})=>{let r=null,s=null;const a=Ot("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(r=R(t,o.schema)),"mark"===a&&(s=bt(t,o.schema)),i&&n.selection.ranges.forEach((t=>{o.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,o)=>{r&&r===t.type&&n.setNodeMarkup(o,void 0,Tt(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((i=>{s===i.type&&n.addMark(o,o+t.nodeSize,s.create(Tt(i.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>u(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>f(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:i,to:r}=t.selection,s=i.sharedDepth(r);return 0!=s&&(n=i.before(s),e&&e(t.tr.setSelection(o.qv.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>M(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>C(t,e),setContent:(t,e=!1,n={})=>({tr:o,editor:i,dispatch:r})=>{const{doc:s}=o,a=Nt(t,i.schema,n);return r&&o.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:o,dispatch:i})=>{const{selection:r}=n,{empty:s,ranges:a}=r,l=bt(t,o.schema);if(i)if(s){const t=Et(o,l);n.addStoredMark(l.create({...t,...e}))}else a.forEach((t=>{const i=t.$from.pos,r=t.$to.pos;o.doc.nodesBetween(i,r,((t,o)=>{const s=Math.max(o,i),a=Math.min(o+t.nodeSize,r);t.marks.find((t=>t.type===l))?t.marks.forEach((t=>{l===t.type&&n.addMark(s,a,l.create({...t.attrs,...e}))})):n.addMark(s,a,l.create(e))}))}));return function(t,e,n){var o;const{selection:i}=e;let r=null;if(vt(i)&&(r=i.$cursor),r){const e=null!==(o=t.storedMarks)&&void 0!==o?o:r.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:s}=i;return s.some((({$from:e,$to:o})=>{let i=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,o.pos,((t,e,o)=>{if(i)return!1;if(t.isInline){const e=!o||o.type.allowsMarkType(n),r=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));i=e&&r}return!i})),i}))}(o,n,l)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:o,chain:i})=>{const r=R(t,n.schema);return r.isTextblock?i().command((({commands:t})=>!!S(r,e)(n)||t.clearNodes())).command((({state:t})=>S(r,e)(t,o))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,i=yt(t,0,n.content.size),r=o.qv.create(n,i);e.setSelection(r)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:i,to:r}="number"==typeof t?{from:t,to:t}:t,s=o.Bs.atStart(n).from,a=o.Bs.atEnd(n).to,l=yt(i,s,a),c=yt(r,s,a),d=o.Bs.create(n,l,c);e.setSelection(d)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const o=R(t,e.schema);return(i=o,function(t,e){let{$from:n,$to:o}=t.selection,r=n.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==i));if(!r)return!1;let l=r.startIndex;if(0==l)return!1;let c=r.parent,d=c.child(l-1);if(d.type!=i)return!1;if(e){let n=d.lastChild&&d.lastChild.type==c.type,o=s.HY.from(n?i.create():null),l=new s.p2(s.HY.from(i.create(null,s.HY.from(c.type.create(null,o)))),n?3:1,0),u=r.start,h=r.end;e(t.tr.step(new a.FC(u-(n?3:1),h,u,h,l,1,!0)).scrollIntoView())}return!0})(e,n);var i},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:i,editor:r})=>{const{selection:s,doc:l}=e,{$from:c,$to:d}=s,u=Qt(r.extensionManager.attributes,c.node().type.name,c.node().attrs);if(s instanceof o.qv&&s.node.isBlock)return!(!c.parentOffset||!(0,a.Ax)(l,c.pos)||(i&&(t&&re(n,r.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),0));if(!c.parent.isBlock)return!1;if(i){const i=d.parentOffset===d.parent.content.size;s instanceof o.Bs&&e.deleteSelection();const l=0===c.depth?void 0:Dt(c.node(-1).contentMatchAt(c.indexAfter(-1)));let h=i&&l?[{type:l,attrs:u}]:void 0,p=(0,a.Ax)(e.doc,e.mapping.map(c.pos),1,h);if(h||p||!(0,a.Ax)(e.doc,e.mapping.map(c.pos),1,l?[{type:l}]:void 0)||(p=!0,h=l?[{type:l,attrs:u}]:void 0),p&&(e.split(e.mapping.map(c.pos),1,h),l&&!i&&!c.parentOffset&&c.parent.type!==l)){const t=e.mapping.map(c.before()),n=e.doc.resolve(t);c.node(-1).canReplaceWith(n.index(),n.index()+1,l)&&e.setNodeMarkup(e.mapping.map(c.before()),l)}t&&re(n,r.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:i,editor:r})=>{var l;const c=R(t,n.schema),{$from:d,$to:u}=n.selection,h=n.selection.node;if(h&&h.isBlock||d.depth<2||!d.sameParent(u))return!1;const p=d.node(-1);if(p.type!==c)return!1;const f=r.extensionManager.attributes;if(0===d.parent.content.size&&d.node(-1).childCount===d.indexAfter(-1)){if(2===d.depth||d.node(-3).type!==c||d.index(-2)!==d.node(-2).childCount-1)return!1;if(i){let t=s.HY.empty;const n=d.index(-1)?1:d.index(-2)?2:3;for(let e=d.depth-n;e>=d.depth-3;e-=1)t=s.HY.from(d.node(e).copy(t));const i=d.indexAfter(-1){if(h>-1)return!1;t.isTextblock&&0===t.content.size&&(h=e+1)})),h>-1&&e.setSelection(o.Bs.near(e.doc.resolve(h))),e.scrollIntoView()}return!0}const m=u.pos===d.end()?p.contentMatchAt(0).defaultType:null,g=Qt(f,p.type.name,p.attrs),b=Qt(f,d.node().type.name,d.node().attrs);e.delete(d.pos,u.pos);const v=m?[{type:c,attrs:g},{type:m,attrs:b}]:[{type:c,attrs:g}];if(!(0,a.Ax)(e.doc,d.pos,2))return!1;if(i){const{selection:t,storedMarks:o}=n,{splittableMarks:s}=r.extensionManager,a=o||t.$to.parentOffset&&t.$from.marks();if(e.split(d.pos,2,v).scrollIntoView(),!a||!i)return!0;const l=a.filter((t=>s.includes(t.type.name)));e.ensureMarks(l)}return!0},toggleList:(t,e,n,o={})=>({editor:i,tr:r,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:h}=i.extensionManager,p=R(t,s.schema),f=R(e,s.schema),{selection:m,storedMarks:g}=s,{$from:b,$to:v}=m,y=b.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!y)return!1;const x=_t((t=>ee(t.type.name,u)))(m);if(y.depth>=1&&x&&y.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(ee(x.node.type.name,u)&&p.validContent(x.node.content)&&a)return l().command((()=>(r.setNodeMarkup(x.pos,p),!0))).command((()=>se(r,p))).command((()=>ae(r,p))).run()}return n&&w&&a?l().command((()=>{const t=d().wrapInList(p,o),e=w.filter((t=>h.includes(t.type.name)));return r.ensureMarks(e),!!t||c.clearNodes()})).wrapInList(p,o).command((()=>se(r,p))).command((()=>ae(r,p))).run():l().command((()=>!!d().wrapInList(p,o)||c.clearNodes())).wrapInList(p,o).command((()=>se(r,p))).command((()=>ae(r,p))).run()},toggleMark:(t,e={},n={})=>({state:o,commands:i})=>{const{extendEmptyMarkRange:r=!1}=n,s=bt(t,o.schema);return Kt(o,s,e)?i.unsetMark(s,{extendEmptyMarkRange:r}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:o,commands:i})=>{const r=R(t,o.schema),s=R(e,o.schema);return At(o,r,n)?i.setNode(s):i.setNode(r,n)},toggleWrap:(t,e={})=>({state:n,commands:o})=>{const i=R(t,n.schema);return At(n,i,e)?o.lift(i):o.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(r.text){const n=e.doc.resolve(r.from).marks();e.replaceWith(r.from,r.to,t.schema.text(r.text,n))}else e.delete(r.from,r.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:i}=n;return o||e&&i.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:o,dispatch:i})=>{var r;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=bt(t,o.schema),{$from:c,empty:d,ranges:u}=a;if(!i)return!0;if(d&&s){let{from:t,to:e}=a;const o=null===(r=c.marks().find((t=>t.type===l)))||void 0===r?void 0:r.attrs,i=gt(c,l,o);i&&(t=i.from,e=i.to),n.removeMark(t,e,l)}else u.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:o,dispatch:i})=>{let r=null,s=null;const a=Ot("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(r=R(t,o.schema)),"mark"===a&&(s=bt(t,o.schema)),i&&n.selection.ranges.forEach((t=>{const i=t.$from.pos,a=t.$to.pos;o.doc.nodesBetween(i,a,((t,o)=>{r&&r===t.type&&n.setNodeMarkup(o,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((r=>{if(s===r.type){const l=Math.max(o,i),c=Math.min(o+t.nodeSize,a);n.addMark(l,c,s.create({...r.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:o})=>function(t,e=null){return function(n,o){let{$from:i,$to:r}=n.selection,s=i.blockRange(r),l=s&&(0,a.nd)(s,t,e);return!!l&&(o&&o(n.tr.wrap(s,l).scrollIntoView()),!0)}}(R(t,n.schema),e)(n,o),wrapInList:(t,e={})=>({state:n,dispatch:o})=>function(t,e=null){return function(n,o){let{$from:i,$to:r}=n.selection,l=i.blockRange(r),c=!1,d=l;if(!l)return!1;if(l.depth>=2&&i.node(l.depth-1).type.compatibleContent(t)&&0==l.startIndex){if(0==i.index(l.depth-1))return!1;let t=n.doc.resolve(l.start-2);d=new s.Ts(t,t,l.depth),l.endIndex=0;t--)r=s.HY.from(n[t].type.create(n[t].attrs,r));t.step(new a.FC(e.start-(o?2:0),e.end,e.start,e.end,new s.p2(r,0,0),n.length,!0));let l=0;for(let t=0;t({...le})}),de=ct.create({name:"editable",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ue=ct.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new o.Sy({key:new o.H$("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const o=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1},blur:(e,n)=>{t.isFocused=!1;const o=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1}}}})]}}),he=ct.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:i}=e,{empty:r,$anchor:s}=n,{pos:a,parent:l}=s,c=s.parent.isTextblock?e.doc.resolve(a-1):s,d=c.parent.type.spec.isolating,u=s.pos-s.parentOffset,h=d&&1===c.parent.childCount?u===s.pos:o.Y1.atStart(i).from===a;return!(!(r&&h&&l.type.isTextblock)||l.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},r={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return xt()||St()?r:i},addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("clearDocument"),appendTransaction:(t,e,n)=>{if(!t.some((t=>t.docChanged))||e.doc.eq(n.doc))return;const{empty:i,from:r,to:s}=e.selection,a=o.Y1.atStart(e.doc).from,l=o.Y1.atEnd(e.doc).to;if(i||r!==a||s!==l)return;if(0!==n.doc.textBetween(0,n.doc.content.size," "," ").length)return;const c=n.tr,d=I({state:n,transaction:c}),{commands:u}=new D({editor:this.editor,state:d});return u.clearNodes(),c.steps.length?c:void 0}})]}}),pe=ct.create({name:"tabindex",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var fe=Object.freeze({__proto__:null,ClipboardTextSerializer:ht,Commands:ce,Editable:de,FocusEvents:ue,Keymap:he,Tabindex:pe});function me(t,e,n){const o=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==o)return o;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class ge extends P{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),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),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}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&&document&&(this.css=me('.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: 1px !important;\n height: 1px !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}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=B(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const e="string"==typeof t?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((t=>!t.key.startsWith(e)))});this.view.updateState(n)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(fe):[],...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new st(t,this)}createCommandManager(){this.commandManager=new D({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=Nt(this.options.content,this.schema,this.options.parseOptions),e=wt(t,this.options.autofocus);this.view=new i.tk(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:o.yy.create({doc:t,selection:e||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass(),this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)})):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return Yt(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,o="string"==typeof t?e:t;return Gt(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Rt(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return Ft(this.state.doc,{blockSeparator:e,textSerializers:{...ut(this.schema),...n}})}get isEmpty(){return ne(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}}function be(t){return new K({find:t.find,handler:({state:e,range:n,match:o})=>{const i=F(t.getAttributes,void 0,o);if(!1===i||null===i)return null;const{tr:r}=e,s=o[o.length-1],a=o[0];if(s){const o=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(Ut(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>l)).length)return null;cn.from&&r.delete(n.from+o,l);const d=n.from+o+s.length;r.addMark(n.from+o,d,t.type.create(i||{})),r.removeStoredMark(t.type)}}})}function ve(t){return new K({find:t.find,handler:({state:e,range:n,match:o})=>{const i=F(t.getAttributes,void 0,o)||{},{tr:r}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(o[1]){let t=s+o[0].lastIndexOf(o[1]);t>a?t=a:a=t+o[1].length;const e=o[0][o[0].length-1];r.insertText(e,s+o[0].length-1),r.replaceWith(t,a,l)}else o[0]&&r.insert(s-1,t.type.create(i)).delete(r.mapping.map(s),r.mapping.map(a));r.scrollIntoView()}})}function ye(t){return new K({find:t.find,handler:({state:e,range:n,match:o})=>{const i=e.doc.resolve(n.from),r=F(t.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,r)}})}function we(t){return new K({find:t.find,handler:({state:e,range:n,match:o})=>{let i=t.replace,r=n.from;const s=n.to;if(o[1]){const t=o[0].lastIndexOf(o[1]);i+=o[0].slice(t+o[1].length),r+=t;const e=r-s;e>0&&(i=o[0].slice(t-e,t)+i,r=s)}e.tr.insertText(i,r,s)}})}function xe(t){return new K({find:t.find,handler:({state:e,range:n,match:o,chain:i})=>{const r=F(t.getAttributes,void 0,o)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&(0,a.nd)(l,t.type,r);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:n,storedMarks:o}=e,{splittableMarks:i}=t.editor.extensionManager,r=o||n.$to.parentOffset&&n.$from.marks();if(r){const t=r.filter((t=>i.includes(t.type.name)));s.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";i().updateAttributes(e,r).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&(0,a.Mn)(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&s.join(n.from-1)}})}class ke{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=F(H(this,"addOptions",{name:this.name}))),this.storage=F(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ke(t)}configure(t={}){const e=this.extend();return e.options=lt(this.options,t),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new ke(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(H(e,"addOptions",{name:e.name})),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const i=o.marks();if(!i.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const r=i.find((t=>(null==t?void 0:t.type.name)===e.name));return r&&n.removeStoredMark(r),n.insertText(" ",o.pos),t.view.dispatch(n),!0}return!1}}class Ce{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=F(H(this,"addOptions",{name:this.name}))),this.storage=F(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ce(t)}configure(t={}){const e=this.extend();return e.options=lt(this.options,t),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Ce(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(H(e,"addOptions",{name:e.name})),e.storage=F(H(e,"addStorage",{name:e.name,options:e.options})),e}}class Me{constructor(t,e,n){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,n,i,r,s,a,l;const{view:c}=this.editor,d=t.target,u=3===d.nodeType?null===(e=d.parentElement)||void 0===e?void 0:e.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(d))||!u)return;let h=0,p=0;if(this.dom!==u){const e=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),o=null!==(i=t.offsetX)&&void 0!==i?i:null===(r=t.nativeEvent)||void 0===r?void 0:r.offsetX,l=null!==(s=t.offsetY)&&void 0!==s?s:null===(a=t.nativeEvent)||void 0===a?void 0:a.offsetY;h=n.x-e.x+o,p=n.y-e.y+l}null===(l=t.dataTransfer)||void 0===l||l.setDragImage(this.dom,h,p);const f=o.qv.create(c.state.doc,this.getPos()),m=c.state.tr.setSelection(f);c.dispatch(m)}stopEvent(t){var e;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:t});const n=t.target;if(!this.dom.contains(n)||(null===(e=this.contentDOM)||void 0===e?void 0:e.contains(n)))return!1;const i=t.type.startsWith("drag"),r="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r&&!i)return!0;const{isEditable:s}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,c=o.qv.isSelectable(this.node),d="copy"===t.type,u="paste"===t.type,h="cut"===t.type,p="mousedown"===t.type;if(!l&&c&&i&&t.preventDefault(),l&&i&&!a)return t.preventDefault(),!1;if(l&&s&&!a&&p){const t=n.closest("[data-drag-handle]");t&&(this.dom===t||this.dom.contains(t))&&(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!(a||r||d||u||h||p&&c)}ignoreMutation(t){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:t}):!(!this.node.isLeaf&&!this.node.isAtom&&("selection"===t.type||this.dom.contains(t.target)&&"childList"===t.type&&(xt()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every((t=>t.isContentEditable))||(this.contentDOM!==t.target||"attributes"!==t.type)&&this.contentDOM.contains(t.target))))}updateAttributes(t){this.editor.commands.command((({tr:e})=>{const n=this.getPos();return e.setNodeMarkup(n,void 0,{...this.node.attrs,...t}),!0}))}deleteNode(){const t=this.getPos(),e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}}function Se(t){return new nt({find:t.find,handler:({state:e,range:n,match:o,pasteEvent:i})=>{const r=F(t.getAttributes,void 0,o,i);if(!1===r||null===r)return null;const{tr:s}=e,a=o[o.length-1],l=o[0];let c=n.to;if(a){const o=l.search(/\S/),i=n.from+l.indexOf(a),d=i+a.length;if(Ut(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>i)).length)return null;dn.from&&s.delete(n.from+o,i),c=n.from+o+a.length,s.addMark(n.from+o,c,t.type.create(r||{})),s.removeStoredMark(t.type)}}})}function Ae(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function Oe(t){return"string"==typeof t}function Te(t){return new nt({find:t.find,handler({match:e,chain:n,range:o,pasteEvent:i}){const r=F(t.getAttributes,void 0,e,i);if(!1===r||null===r)return null;e.input&&n().deleteRange(o).insertContentAt(o.from,{type:t.type.name,attrs:r})}})}function Ne(t){return new nt({find:t.find,handler:({state:e,range:n,match:o})=>{let i=t.replace,r=n.from;const s=n.to;if(o[1]){const t=o[0].lastIndexOf(o[1]);i+=o[0].slice(t+o[1].length),r+=t;const e=r-s;e>0&&(i=o[0].slice(t-e,t)+i,r=s)}e.tr.insertText(i,r,s)}})}class Ee{constructor(t){this.transaction=t,this.currentStep=this.transaction.steps.length}map(t){let e=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce(((t,n)=>{const o=n.getMap().mapResult(t);return o.deleted&&(e=!0),o.pos}),t),deleted:e}}}},54424:(t,e,n)=>{n.r(e),n.d(e,{Heading:()=>i,default:()=>i});var o=n(11046);const i=o.Node.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,(0,o.mergeAttributes)(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>(0,o.textblockTypeInputRule)({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}})},44632:(t,e,n)=>{n.r(e),n.d(e,{Image:()=>r,default:()=>r,inputRegex:()=>i});var o=n(11046);const i=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,r=o.Node.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",(0,o.mergeAttributes)(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[(0,o.nodeInputRule)({find:i,type:this.type,getAttributes:t=>{const[,,e,n,o]=t;return{src:n,alt:e,title:o}}})]}})},84402:(t,e,n)=>{n.r(e),n.d(e,{TextStyle:()=>i,default:()=>i});var o=n(11046);const i=o.Mark.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",(0,o.mergeAttributes)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=(0,o.getMarkAttributes)(t,this.type);return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}})},31690:(t,e,n)=>{n.d(e,{$:()=>f,h:()=>p});for(var o={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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},r="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)o[48+a]=o[96+a]=String(a);for(a=1;a<=24;a++)o[a+111]="F"+a;for(a=65;a<=90;a++)o[a]=String.fromCharCode(a+32),i[a]=String.fromCharCode(a);for(var l in o)i.hasOwnProperty(l)||(i[l]=o[l]);var c=n(62463);const d="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function u(t){let e,n,o,i,r=t.split(/-(?!$)/),s=r[r.length-1];"Space"==s&&(s=" ");for(let t=0;t127)&&(a=o[n.keyCode])&&a!=l){let o=e[h(a,n)];if(o&&o(t.state,t.dispatch,t))return!0}}return!1}}},27439:(t,e,n)=>{function o(t){this.content=t}n.d(e,{aw:()=>K,PW:()=>at,HY:()=>a,vc:()=>u,ZU:()=>U,NB:()=>I,Ts:()=>N,e4:()=>h,V_:()=>W,p2:()=>p}),o.prototype={constructor:o,find:function(t){for(var e=0;e>1}},o.from=function(t){if(t instanceof o)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new o(e)};const i=o;function r(t,e,n){for(let o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let t=0;i.text[t]==s.text[t];t++)n++;return n}if(i.content.size||s.content.size){let t=r(i.content,s.content,n+1);if(null!=t)return t}n+=i.nodeSize}else n+=i.nodeSize}}function s(t,e,n,o){for(let i=t.childCount,r=e.childCount;;){if(0==i||0==r)return i==r?null:{a:n,b:o};let a=t.child(--i),l=e.child(--r),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:o};if(a.isText&&a.text!=l.text){let t=0,e=Math.min(a.text.length,l.text.length);for(;tt&&!1!==n(a,o+s,i||null,r)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,t-i),Math.min(a.content.size,e-i),n,o+i)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,o){let i="",r=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(t,a)-a,e-a),r=!n):s.isLeaf?(o?i+="function"==typeof o?o(s):o:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),r=!n):!r&&s.isBlock&&(i+=n,r=!0)}),0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(o[o.length-1]=e.withText(e.text+n.text),i=1);it)for(let i=0,r=0;rt&&((re)&&(s=s.isText?s.cut(Math.max(0,t-r),Math.min(s.text.length,e-r)):s.cut(Math.max(0,t-r-1),Math.min(s.content.size,e-r-1))),n.push(s),o+=s.nodeSize),r=a}return new a(n,o)}cutByIndex(t,e){return t==e?a.empty:0==t&&e==this.content.length?this:new a(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let o=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return o[t]=e,new a(o,i)}addToStart(t){return new a([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new a(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=o+this.child(n).nodeSize;if(i>=t)return i==t||e>0?c(n+1,i):c(n,o);o=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return a.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new a(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return a.empty;let e,n=0;for(let o=0;o{class t{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let o=0;othis.type.rank&&(e||(e=t.slice(0,o)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),n}}return t.none=[],t})();class h extends Error{}class p{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=m(this.content,t+this.openStart,e);return n&&new p(n,this.openStart,this.openEnd)}removeBetween(t,e){return new p(f(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return p.empty;let n=e.openStart||0,o=e.openEnd||0;if("number"!=typeof n||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new p(a.fromJSON(t,e.content),n,o)}static maxOpen(t,e=!0){let n=0,o=0;for(let o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)o++;return new p(t,n,o)}}function f(t,e,n){let{index:o,offset:i}=t.findIndex(e),r=t.maybeChild(o),{index:s,offset:a}=t.findIndex(n);if(i==e||r.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(o,r.copy(f(r.content,e-i-1,n-i-1)))}function m(t,e,n,o){let{index:i,offset:r}=t.findIndex(e),s=t.maybeChild(i);if(r==e||s.isText)return o&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=m(s.content,e-r-1,n);return a&&t.replaceChild(i,s.copy(a))}function g(t,e,n){if(n.openStart>t.depth)throw new h("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new h("Inconsistent open depths");return b(t,e,n,0)}function b(t,e,n,o){let i=t.index(o),r=t.node(o);if(i==e.index(o)&&o=0;t--)o=e.node(t).copy(a.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}(n,t);return k(r,C(t,i,s,e,o))}{let o=t.parent,i=o.content;return k(o,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return k(r,M(t,e,o))}function v(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function y(t,e,n){let o=t.node(n);return v(o,e.node(n)),o}function w(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function x(t,e,n,o){let i=(e||t).node(n),r=0,s=e?e.index(n):i.childCount;t&&(r=t.index(n),t.depth>n?r++:t.textOffset&&(w(t.nodeAfter,o),r++));for(let t=r;ti&&y(t,e,i+1),s=o.depth>i&&y(n,o,i+1),l=[];return x(null,t,i,l),r&&s&&e.index(i)==n.index(i)?(v(r,s),w(k(r,C(t,e,n,o,i+1)),l)):(r&&w(k(r,M(t,e,i+1)),l),x(e,n,i,l),s&&w(k(s,M(n,o,i+1)),l)),x(o,null,i,l),new a(l)}function M(t,e,n){let o=[];return x(null,t,n,o),t.depth>n&&w(k(y(t,e,n+1),M(t,e,n+1)),o),x(e,null,n,o),new a(o)}p.empty=new p(a.empty,0,0);class S{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(e);return n?t.child(e).cut(n):o}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],o=0==e?0:this.path[3*e-1]+1;for(let e=0;e0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new N(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],o=0,i=e;for(let e=t;;){let{index:t,offset:r}=e.content.findIndex(i),s=i-r;if(n.push(e,t,o+r),!s)break;if(e=e.child(t),e.isText)break;i=s-1,o+=r+1}return new S(e,n,i)}static resolveCached(t,e){for(let n=0;nt&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(o=!0),!o))),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),P(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=a.empty,o=0,i=n.childCount){let r=this.contentMatchAt(t).matchFragment(n,o,i),s=r&&r.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=o;tt.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let o=a.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,o,n)}}I.prototype.text=void 0;class D extends I{constructor(t,e,n,o){if(super(t,e,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):P(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new D(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new D(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function P(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class H{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new L(t,e);if(null==n.next)return H.empty;let o=_(n);n.next&&n.err("Unexpected trailing text");let i=function(t){let e=Object.create(null);return function n(o){let i=[];o.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let o;for(let t=0;t{o||i.push([e,o=[]]),-1==o.indexOf(t)&&o.push(t)}))}))}));let r=e[o.join(",")]=new H(o.indexOf(t.length-1)>-1);for(let t=0;te.concat(t(n,r))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return o(r,s),i(t(e.expr,s),s),[o(s)]}if("plus"==e.type){let s=n();return i(t(e.expr,r),s),i(t(e.expr,s),s),[o(s)]}if("opt"==e.type)return[o(r)].concat(t(e.expr,r));if("range"==e.type){let s=r;for(let o=0;ot.to=e))}}(o));return function(t,e){for(let n=0,o=[t];nt.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let o=0;o{let o=n+(e.validEnd?"*":" ")+" ";for(let n=0;n"+t.indexOf(e.next[n].next);return o})).join("\n")}}H.empty=new H(!0);class L{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function _(t){let e=[];do{e.push(R(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function R(t){let e=[];do{e.push(z(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function z(t){let e=function(t){if(t.eat("(")){let e=_(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,o=n[e];if(o)return[o];let i=[];for(let t in n){let o=n[t];o.groups.indexOf(e)>-1&&i.push(o)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=B(t,e)}return e}function $(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function B(t,e){let n=$(t),o=n;return t.eat(",")&&(o="}"!=t.next?$(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function F(t,e){return e-t}function J(t,e){let n=[];return function e(o){let i=t[o];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(o);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;en[t]=new q(t,e,o)));let o=e.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class V{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class U{constructor(t,e,n,o){this.name=t,this.rank=e,this.schema=n,this.spec=o,this.attrs=j(o.attrs),this.excluded=null;let i=Z(this.attrs);this.instance=i?new u(this,i):null}create(t=null){return!t&&this.instance?this.instance:new u(this,Y(this.attrs,t))}static compile(t,e){let n=Object.create(null),o=0;return t.forEach(((t,i)=>n[t]=new U(t,o++,e,i))),n}removeFromSet(t){for(var e=0;e-1}}class W{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=i.from(t.nodes),e.marks=i.from(t.marks||{}),this.nodes=q.compile(this.spec.nodes,this),this.marks=U.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],o=e.spec.content||"",i=e.spec.marks;e.contentMatch=n[o]||(n[o]=H.parse(o,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?Q(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:Q(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,o){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof q))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,o)}text(t,e){let n=this.nodes.text;return new D(n,n.defaultAttrs,t,u.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return I.fromJSON(this,t)}markFromJSON(t){return u.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Q(t,e){let n=[];for(let o=0;o-1)&&n.push(s=o)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return n}class K{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new ot(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new ot(this,e,!0);return n.addAll(t,e.from,e.to),p.maxOpen(n.finish())}matchTag(t,e,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(61!=r.charCodeAt(t.length)||r.slice(t.length+1)!=e))){if(o.getAttrs){let t=o.getAttrs(e);if(!1===t)continue;o.attrs=t||void 0}return o}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,o=0;for(;o{n(t=rt(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))}for(let e in t.nodes){let o=t.nodes[e].spec.parseDOM;o&&o.forEach((t=>{n(t=rt(t)),t.node||t.ignore||t.mark||(t.node=e)}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new K(t,K.schemaRules(t)))}}const G={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},X={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tt={ol:!0,ul:!0};function et(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class nt{constructor(t,e,n,o,i,r,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=s,this.content=[],this.activeMarks=u.none,this.stashMarks=[],this.match=r||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(a.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=a.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(a.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;ethis.addAll(t))),e&&this.sync(n),this.needsBlock=r}else this.withStyleRules(t,(()=>{this.addElementByRule(t,i,!1===i.consuming?n:void 0)}))}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=u.none,n=u.none;for(let o=0;o{r.clearMark(t)&&(n=t.addToSet(n))})):e=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(e),!1!==r.consuming)break;i=r}return[e,n]}addElementByRule(t,e,n){let o,i,r;e.node?(i=this.parser.schema.nodes[e.node],i.isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):o=this.enter(i,e.attrs||null,e.preserveWhitespace)):(r=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(r));let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}o&&this.sync(s)&&this.open--,r&&this.removePendingMark(r,s)}addAll(t,e,n){let o=e||0;for(let i=e?t.childNodes[e]:t.firstChild,r=null==n?null:t.childNodes[n];i!=r;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let e,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],r=i.findWrapping(t);if(r&&(!e||e.length>r.length)&&(e=r,n=i,!r.length))break;if(i.solid)break}if(!e)return!1;this.sync(n);for(let t=0;tthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,o=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),r=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(r(t-1,s))return!0;return!1}{let t=s>0||0==s&&o?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return r(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let e=o.popFromStashMark(t);e&&o.type&&o.type.allowsMarkType(e.type)&&(o.activeMarks=e.addToSet(o.activeMarks))}if(o==e)break}}}function it(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function rt(t){let e={};for(let n in t)e[n]=t[n];return e}function st(t,e){let n=e.schema.nodes;for(let o in n){let i=n[o];if(!i.allowsMarkType(t))continue;let r=[],s=t=>{r.push(t);for(let n=0;n{if(i.length||t.marks.length){let n=0,r=0;for(;n=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let o=this.marks[t.type.name];return o&&at.renderSpec(ct(n),o(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let o,i=e[0],r=i.indexOf(" ");r>0&&(n=i.slice(0,r),i=i.slice(r+1));let s=n?t.createElementNS(n,i):t.createElement(i),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let i=l;il)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:i}=at.renderSpec(t,r,n);if(s.appendChild(e),i){if(o)throw new RangeError("Multiple content holes");o=i}}}return{dom:s,contentDOM:o}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new at(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=lt(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return lt(t.marks)}}function lt(t){let e={};for(let n in t){let o=t[n].spec.toDOM;o&&(e[n]=o)}return e}function ct(t){return t.document||window.document}},62463:(t,e,n)=>{n.d(e,{C1:()=>f,yy:()=>C,qv:()=>h,Sy:()=>S,H$:()=>T,Y1:()=>s,xm:()=>a,Bs:()=>d});var o=n(27439),i=n(38480);const r=Object.create(null);class s{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new a(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;o--){let i=e<0?g(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):g(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new f(t.node(0))}static atStart(t){return g(t,t,0,0,1)||new f(t)}static atEnd(t){return g(t,t,t.content.size,t.childCount,-1)||new f(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=r[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in r)throw new RangeError("Duplicate use of selection JSON ID "+t);return r[t]=e,e.prototype.jsonID=t,e}getBookmark(){return d.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(t,e){this.$from=t,this.$to=e}}let l=!1;function c(t){l||t.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class d extends s{constructor(t,e=t){c(t),c(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return s.near(n);let o=t.resolve(e.map(this.anchor));return new d(o.parent.inlineContent?o:n,n)}replace(t,e=o.p2.empty){if(super.replace(t,e),e==o.p2.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof d&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new u(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new d(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let o=t.resolve(e);return new this(o,n==e?o:t.resolve(n))}static between(t,e,n){let o=t.pos-e.pos;if(n&&!o||(n=o>=0?1:-1),!e.parent.inlineContent){let t=s.findFrom(e,n,!0)||s.findFrom(e,-n,!0);if(!t)return s.near(e,n);e=t.$head}return t.parent.inlineContent||(0==o||(t=(s.findFrom(t,-n,!0)||s.findFrom(t,n,!0)).$anchor).posnew f(t)};function g(t,e,n,o,i,r=!1){if(e.inlineContent)return d.create(t,n);for(let s=o-(i>0?0:1);i>0?s=0;s+=i){let o=e.child(s);if(o.isAtom){if(!r&&h.isSelectable(o))return h.create(t,n-(i<0?o.nodeSize:0))}else{let e=g(t,o,n+i,i<0?o.childCount:0,i,r);if(e)return e}n+=o.nodeSize*i}return null}function b(t,e,n){let o=t.steps.length-1;if(o{null==r&&(r=o)})),t.setSelection(s.near(t.doc.resolve(r),n)))}class v extends i.wx{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return o.vc.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||o.vc.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let o=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,o.text(t,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function y(t,e){return e&&t?t.bind(e):t}class w{constructor(t,e,n){this.name=t,this.init=y(e.init,n),this.apply=y(e.apply,n)}}const x=[new w("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new w("selection",{init:(t,e)=>t.selection||s.atStart(e.doc),apply:t=>t.selection}),new w("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,o)=>o.selection.$cursor?t.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class k{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=x.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new w(t.key,t.spec.state,t))}))}}class C{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(o,this[o.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new k(t.schema,t.plugins),r=new C(i);return i.fields.forEach((i=>{if("doc"==i.name)r.doc=o.NB.fromJSON(t.schema,e.doc);else if("selection"==i.name)r.selection=s.fromJSON(r.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(r.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(r[i.name]=a.fromJSON.call(s,t,e[o],r))}r[i.name]=i.init(t,r)}})),r}}function M(t,e,n){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(e):"handleDOMEvents"==o&&(i=M(i,e,{})),n[o]=i}return n}class S{constructor(t){this.spec=t,this.props={},t.props&&M(t.props,this,this.props),this.key=t.key?t.key.key:O("plugin")}getState(t){return t[this.key]}}const A=Object.create(null);function O(t){return t in A?t+"$"+ ++A[t]:(A[t]=0,t+"$")}class T{constructor(t="key"){this.key=O(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},38480:(t,e,n)=>{n.d(e,{vs:()=>l,FC:()=>v,Pu:()=>b,wx:()=>F,Mn:()=>S,Ax:()=>M,nj:()=>T,nd:()=>k,GJ:()=>O,k9:()=>x,dR:()=>N});var o=n(27439);const i=Math.pow(2,16);function r(t){return 65535&t}class s{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class a{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&a.empty)return a.empty}recover(t){let e=0,n=r(t);if(!this.inverted)for(let t=0;tt)break;let d=this.ranges[l+r],u=this.ranges[l+a],h=c+d;if(t<=h){let r=c+o+((d?t==c?-1:t==h?1:e:e)<0?0:u);if(n)return r;let a=t==c?2:t==h?1:4;return(e<0?t!=c:t!=h)&&(a|=8),new s(r,a,t==(e<0?c:h)?null:l/3+(t-c)*i)}o+=u-d}return n?t+o:new s(t+o,0,null)}touches(t,e){let n=0,o=r(e),i=this.inverted?2:1,s=this.inverted?1:2;for(let e=0;et)break;let a=this.ranges[e+i];if(t<=r+a&&e==3*o)return!0;n+=this.ranges[e+s]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;e--){let o=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=o&&o>e?n-o-1:void 0)}}invert(){let t=new l;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;nn&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),i),e.openStart,e.openEnd);return u.fromReplace(t,this.from,this.to,r)}invert(){return new f(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}d.jsonID("addMark",p);class f extends d{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new o.p2(h(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return u.fromReplace(t,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new f(e.pos,n.pos,this.mark)}merge(t){return t instanceof f&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new f(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new f(e.from,e.to,t.markFromJSON(e.mark))}}d.jsonID("removeMark",f);class m extends d{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return u.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return u.fromReplace(t,this.pos,this.pos+1,new o.p2(o.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new v(e.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new v(e.from,e.to,e.gapFrom,e.gapTo,o.p2.fromJSON(t,e.slice),e.insert,!!e.structure)}}function y(t,e,n){let o=t.resolve(e),i=n-e,r=o.depth;for(;i>0&&r>0&&o.indexAfter(r)==o.node(r).childCount;)r--,i--;if(i>0){let t=o.node(r).maybeChild(o.indexAfter(r));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function w(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function x(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let o=t.$from.node(n),i=t.$from.index(n),r=t.$to.indexAfter(n);if(nr;t--,e--){let n=i.node(t),r=i.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(r,n.childCount),a=o&&o[e+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=o&&o[e]||n;if(!n.canReplace(r+1,n.childCount)||!l.type.validContent(s))return!1}let a=i.indexAfter(r),l=o&&o[0];return i.node(r).canReplaceWith(a,a,l?l.type:i.node(r+1).type)}function S(t,e){let n=t.resolve(e),o=n.index();return A(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function A(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function O(t,e,n=-1){let o=t.resolve(e);for(let t=o.depth;;t--){let i,r,s=o.index(t);if(t==o.depth?(i=o.nodeBefore,r=o.nodeAfter):n>0?(i=o.node(t+1),s++,r=o.node(t).maybeChild(s)):(i=o.node(t).maybeChild(s-1),r=o.node(t+1)),i&&!i.isTextblock&&A(i,r)&&o.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?o.before(t):o.after(t)}}function T(t,e,n){let o=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let t=0;t=0;e--){let n=e==o.depth?0:o.pos<=(o.start(e+1)+o.end(e+1))/2?-1:1,r=o.index(e)+(n>0?1:0),s=o.node(e),a=!1;if(1==t)a=s.canReplace(r,r,i);else{let t=s.contentMatchAt(r).findWrapping(i.firstChild.type);a=t&&s.canReplaceWith(r,r,t[0])}if(a)return 0==n?o.pos:n<0?o.before(e+1):o.after(e+1)}return null}function N(t,e,n=e,i=o.p2.empty){if(e==n&&!i.size)return null;let r=t.resolve(e),s=t.resolve(n);return E(r,s,i)?new b(e,n,i):new I(r,s,i).fit()}function E(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}d.jsonID("replaceAround",v);class I{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=o.HY.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=o.HY.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let r=this.placed,s=n.depth,a=i.depth;for(;s&&a&&1==r.childCount;)r=r.firstChild.content,s--,a--;let l=new o.p2(r,s,a);return t>-1?new v(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new b(n.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,i=null;n?(i=H(this.unplaced.content,n-1).firstChild,t=i.content):t=this.unplaced.content;let r=t.firstChild;for(let t=this.depth;t>=0;t--){let s,{type:a,match:l}=this.frontier[t],c=null;if(1==e&&(r?l.matchType(r.type)||(c=l.fillBefore(o.HY.from(r),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:t,parent:i,inject:c};if(2==e&&r&&(s=l.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:t,parent:i,wrap:s};if(i&&l.matchType(i.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=H(t,e);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new o.p2(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),0))}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=H(t,e);if(i.childCount<=1&&e>0){let r=t.size-e<=e+i.size;this.unplaced=new o.p2(D(t,e-1,1),e-1,r?e-1:n)}else this.unplaced=new o.p2(D(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:r}){for(;this.depth>e;)this.closeFrontierNode();if(r)for(let t=0;t1||0==l||t.content.size)&&(u=e,d.push(L(t.mark(h.allowedMarks(t.marks)),1==c?l:0,c==a.childCount?p:-1)))}let f=c==a.childCount;f||(p=-1),this.placed=P(this.placed,e,o.HY.from(d)),this.frontier[e].match=u,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=a;t1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:o}=this.frontier[e],i=e=0;n--){let{match:e,type:o}=this.frontier[n],i=_(t,n,o,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:r,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=P(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),o=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,o)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=P(this.placed,this.depth,o.HY.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(o.HY.empty,!0);t.childCount&&(this.placed=P(this.placed,this.frontier.length,t))}}function D(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(D(t.firstChild.content,e-1,n)))}function P(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(P(t.lastChild.content,e-1,n)))}function H(t,e){for(let n=0;n1&&(i=i.replaceChild(0,L(i.firstChild,e-1,1==i.childCount?n-1:0))),e>0&&(i=t.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(o.HY.empty,!0)))),t.copy(i)}function _(t,e,n,o,i){let r=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==r.childCount&&!n.compatibleContent(r.type))return null;let a=o.fillBefore(r.content,!0,s);return a&&!function(t,e,n){for(let o=n;oi){let e=r.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(o.HY.empty,!0))}return t}function z(t,e){let n=[];for(let o=Math.min(t.depth,e.depth);o>=0;o--){let i=t.start(o);if(ie.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class $ extends d{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return u.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return u.fromReplace(t,this.pos,this.pos+1,new o.p2(o.HY.from(i),0,e.isLeaf?0:1))}getMap(){return a.empty}invert(t){return new $(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new $(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new $(e.pos,e.attr,e.value)}}d.jsonID("attr",$);let B=class extends Error{};B=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(B.prototype=Object.create(Error.prototype)).constructor=B,B.prototype.name="TransformError";class F{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new l}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new B(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=o.p2.empty){let i=N(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new o.p2(o.HY.from(n),0,0))}delete(t,e){return this.replace(t,e,o.p2.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let r=t.doc.resolve(e),s=t.doc.resolve(n);if(E(r,s,i))return t.step(new b(e,n,i));let a=z(r,t.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(r.depth+1);a.unshift(l);for(let t=r.depth,e=r.pos-1;t>0;t--,e--){let n=r.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(t)>-1?l=t:r.before(t)==e&&a.splice(1,0,-t)}let c=a.indexOf(l),d=[],u=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(d.push(n),e==i.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){let e=d[t],n=(h=e.type).spec.defining||h.spec.definingForContent;if(n&&!e.sameMarkup(r.node(Math.abs(l)-1)))u=t;else if(n||!e.type.isTextblock)break}var h;for(let e=i.openStart;e>=0;e--){let l=(e+u+1)%(i.openStart+1),h=d[l];if(h)for(let e=0;e=0&&(t.replace(e,n,i),!(t.steps.length>p));o--){let t=a[o];t<0||(e=r.before(t),n=s.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let o=t.resolve(e);if(o.parent.canReplaceWith(o.index(),o.index(),n))return e;if(0==o.parentOffset)for(let t=o.depth-1;t>=0;t--){let e=o.index(t);if(o.node(t).canReplaceWith(e,e,n))return o.before(t+1);if(e>0)return null}if(o.parentOffset==o.parent.content.size)for(let t=o.depth-1;t>=0;t--){let e=o.indexAfter(t);if(o.node(t).canReplaceWith(e,e,n))return o.after(t+1);if(e0&&(s||o.node(n-1).canReplace(o.index(n-1),i.indexAfter(n-1))))return t.delete(o.before(n),i.after(n))}for(let r=1;r<=o.depth&&r<=i.depth;r++)if(e-o.start(r)==o.depth-r&&n>o.end(r)&&i.end(r)-n!=i.depth-r)return t.delete(o.before(r),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:i,$to:r,depth:s}=e,a=i.before(s+1),l=r.after(s+1),c=a,d=l,u=o.HY.empty,h=0;for(let t=s,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,u=o.HY.from(i.node(t).copy(u)),h++):c--;let p=o.HY.empty,f=0;for(let t=s,e=!1;t>n;t--)e||r.after(t+1)=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=o.HY.from(n[t].type.create(n[t].attrs,i))}let r=e.start,s=e.end;t.step(new v(r,s,r,s,new o.p2(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return function(t,e,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(i,r)&&function(t,e,n){let o=t.resolve(e),i=o.index();return o.parent.canReplaceWith(i,i+1,n)}(t.doc,t.mapping.slice(s).map(n),i)){t.clearIncompatible(t.mapping.slice(s).map(n,1),i);let a=t.mapping.slice(s),l=a.map(n,1),c=a.map(n+e.nodeSize,1);return t.step(new v(l,c,l+1,c-1,new o.p2(o.HY.from(i.create(r,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return function(t,e,n,i,r){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(i,null,r||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new v(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new o.p2(o.HY.from(a),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new $(t,e,n)),this}addNodeMark(t,e){return this.step(new m(t,e)),this}removeNodeMark(t,e){if(!(e instanceof o.vc)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new g(t,e)),this}split(t,e=1,n){return function(t,e,n=1,i){let r=t.doc.resolve(e),s=o.HY.empty,a=o.HY.empty;for(let t=r.depth,e=r.depth-n,l=n-1;t>e;t--,l--){s=o.HY.from(r.node(t).copy(s));let e=i&&i[l];a=o.HY.from(e?e.type.create(e.attrs,a):r.node(t).copy(a))}t.step(new b(e,e,new o.p2(s.append(a),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,o){let i,r,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let d=t.marks;if(!o.isInSet(d)&&c.type.allowsMarkType(o.type)){let c=Math.max(l,e),u=Math.min(l+t.nodeSize,n),h=o.addToSet(d);for(let t=0;tt.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,i){let r=[],s=0;t.doc.nodesBetween(e,n,((t,a)=>{if(!t.isInline)return;s++;let l=null;if(i instanceof o.ZU){let e,n=t.marks;for(;e=i.isInSet(n);)(l||(l=[])).push(e),n=e.removeFromSet(n)}else i?i.isInSet(t.marks)&&(l=[i]):l=t.marks;if(l&&l.length){let o=Math.min(a+t.nodeSize,n);for(let t=0;tt.step(new f(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,i=n.contentMatch){let r=t.doc.nodeAt(e),s=[],a=e+1;for(let e=0;e=0;e--)t.step(s[e])}(this,t,e,n),this}}},43594:(t,e,n)=>{n.d(e,{p:()=>Le,EH:()=>ze,tk:()=>sn});var o=n(62463),i=n(27439),r=n(38480);const s=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},a=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let l=null;const c=function(t,e,n){let o=l||(l=document.createRange());return o.setEnd(t,null==n?t.nodeValue.length:n),o.setStart(t,e||0),o},d=function(t,e,n,o){return n&&(h(t,e,n,o,-1)||h(t,e,n,o,1))},u=/^(img|br|input|textarea|hr)$/i;function h(t,e,n,o,i){for(;;){if(t==n&&e==o)return!0;if(e==(i<0?0:p(t))){let n=t.parentNode;if(!n||1!=n.nodeType||f(t)||u.test(t.nodeName)||"false"==t.contentEditable)return!1;e=s(t)+(i<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?p(t):0}}}function p(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function f(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const m=function(t){return t.focusNode&&d(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function g(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const b="undefined"!=typeof navigator?navigator:null,v="undefined"!=typeof document?document:null,y=b&&b.userAgent||"",w=/Edge\/(\d+)/.exec(y),x=/MSIE \d/.exec(y),k=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(y),C=!!(x||k||w),M=x?document.documentMode:k?+k[1]:w?+w[1]:0,S=!C&&/gecko\/(\d+)/i.test(y);S&&(/Firefox\/(\d+)/.exec(y)||[0,0])[1];const A=!C&&/Chrome\/(\d+)/.exec(y),O=!!A,T=A?+A[1]:0,N=!C&&!!b&&/Apple Computer/.test(b.vendor),E=N&&(/Mobile\/\w+/.test(y)||!!b&&b.maxTouchPoints>2),I=E||!!b&&/Mac/.test(b.platform),D=!!b&&/Win/.test(b.platform),P=/Android \d/.test(y),H=!!v&&"webkitFontSmoothing"in v.documentElement.style,L=H?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function R(t,e){return"number"==typeof t?t:t[e]}function z(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function $(t,e,n){let o=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,r=t.dom.ownerDocument;for(let s=n||t.dom;s;s=a(s)){if(1!=s.nodeType)continue;let t=s,n=t==r.body,a=n?_(r):z(t),l=0,c=0;if(e.topa.bottom-R(o,"bottom")&&(c=e.bottom-e.top>a.bottom-a.top?e.top+R(i,"top")-a.top:e.bottom-a.bottom+R(i,"bottom")),e.lefta.right-R(o,"right")&&(l=e.right-a.right+R(i,"right")),l||c)if(n)r.defaultView.scrollBy(l,c);else{let n=t.scrollLeft,o=t.scrollTop;c&&(t.scrollTop+=c),l&&(t.scrollLeft+=l);let i=t.scrollLeft-n,r=t.scrollTop-o;e={left:e.left-i,top:e.top-r,right:e.right-i,bottom:e.bottom-r}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function B(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=a(o));return e}function F(t,e){for(let n=0;n=d){l=Math.max(p.bottom,l),d=Math.min(p.top,d);let t=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!i&&p.left<=e.left&&p.right>=e.left&&(i=u,r={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(a=h+1)}}return!n&&i&&(n=i,o=r,s=0),n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,o=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,o):!n||s&&1==n.nodeType?{node:t,offset:a}:Z(n,o)}function Y(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function j(t,e,n){let o=t.childNodes.length;if(o&&n.tope.top&&i++}n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(t,e,n,o){let i=-1;for(let n=e,r=!1;n!=t.dom;){let e=t.docView.nearestDesc(n,!0);if(!e)return null;if(1==e.dom.nodeType&&(e.node.isBlock&&e.parent&&!r||!e.contentDOM)){let t=e.dom.getBoundingClientRect();if(e.node.isBlock&&e.parent&&!r&&(r=!0,t.left>o.left||t.top>o.top?i=e.posBefore:(t.right-1?i:t.docView.posFromDOM(e,n,-1)}(t,n,i,e))}null==s&&(s=function(t,e,n){let{node:o,offset:i}=Z(e,n),r=-1;if(1==o.nodeType&&!o.firstChild){let t=o.getBoundingClientRect();r=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(o,i,r)}(t,l,e));let c=t.docView.nearestDesc(l,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function V(t){return t.top=0&&i==o.nodeValue.length?(t--,r=1):n<0?t--:e++,K(U(c(o,t,e),r),r<0)}{let t=U(c(o,i,i),n);if(S&&i&&/\s/.test(o.nodeValue[i-1])&&i=0)}if(null==r&&i&&(n<0||i==p(o))){let t=o.childNodes[i-1],e=3==t.nodeType?c(t,p(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return K(U(e,1),!1)}if(null==r&&i=0)}function K(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function G(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function X(t,e,n){let o=t.state,i=t.root.activeElement;o!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),i!=t.dom&&i&&i.focus()}}const tt=/[\u0590-\u08ac]/;let et=null,nt=null,ot=!1;class it{constructor(t,e,n,o){this.parent=t,this.children=e,this.dom=n,this.contentDOM=o,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;es(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){o=!1;break}if(e.previousSibling)break}if(null==o&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){o=!0;break}if(e.nextSibling)break}}return(null==o?n>0:o)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,o=t;o;o=o.parentNode){let i,r=this.getDesc(o);if(r&&(!e||r.node)){if(!n||!(i=r.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return r;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let t=e;t;t=t.parent)if(t==this)return e}posFromDOM(t,e,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;et||i instanceof ut){o=t-e;break}e=r}if(o)return this.children[n].domFromPos(o-this.children[n].border,e);for(let t;n&&!(t=this.children[n-1]).size&&t instanceof rt&&t.side>=0;n--);if(e<=0){let t,o=!0;for(;t=n?this.children[n-1]:null,t&&t.dom.parentNode!=this.contentDOM;n--,o=!1);return t&&e&&o&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?s(t.dom)+1:0}}{let t,o=!0;for(;t=n=i&&e<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,i);t=r;for(let e=a;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){o=s(n.dom)+1;break}t-=n.size}-1==o&&(o=0)}if(o>-1&&(l>e||a==this.children.length-1)){e=l;for(let t=a+1;ta&&re){let t=a;a=l,l=t}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,o=0;o=n:tn){let o=n+i.border,s=r-i.border;if(t>=o&&e<=s)return this.dirty=t==n||e==r?2:1,void(t!=o||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-o,e-o):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=r}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:o))),!e.type.spec.raw){if(1!=r.nodeType){let t=document.createElement("span");t.appendChild(r),r=t}r.contentEditable="false",r.classList.add("ProseMirror-widget")}super(t,[],r,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class st extends it{constructor(t,e,n,o){super(t,[],e,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class at extends it{constructor(t,e,n,o){super(t,[],n,o),this.mark=e}static create(t,e,n,o){let r=o.nodeViews[e.type.name],s=r&&r(e,o,n);return s&&s.dom||(s=i.PW.renderSpec(document,e.type.spec.toDOM(e,n))),new at(t,e,s.dom,s.contentDOM||s.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(i=Mt(i,0,t,n));for(let t=0;ta?a.parent?a.parent.posBeforeChild(a):void 0:s),n,o),d=c&&c.dom,u=c&&c.contentDOM;if(e.isText)if(d){if(3!=d.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(e.text);else d||({dom:d,contentDOM:u}=i.PW.renderSpec(document,e.type.spec.toDOM(e)));u||e.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),e.type.spec.draggable&&(d.draggable=!0));let h=d;return d=yt(d,n,e),c?a=new ht(t,e,n,o,d,u||null,h,c,r,s+1):e.isText?new dt(t,e,n,o,d,h,r):new lt(t,e,n,o,d,u||null,h,r,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>i.HY.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&wt(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,o=e,r=t.composing?this.localCompositionInfo(t,e):null,s=r&&r.pos>-1?r:null,a=r&&r.pos<0,l=new kt(this,s&&s.node,t);!function(t,e,n,o){let i=e.locals(t),r=0;if(0==i.length){for(let n=0;nr;)a.push(i[s++]);let f=r+h.nodeSize;if(h.isText){let t=f;s!t.inline)):a.slice(),e.forChild(r,h),p),r=f}}(this.node,this.innerDeco,((e,r,s)=>{e.spec.marks?l.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!s&&l.syncToMarks(r==this.node.childCount?i.vc.none:this.node.child(r).marks,n,t),l.placeWidget(e,t,o)}),((e,i,s,c)=>{let d;l.syncToMarks(e.marks,n,t),l.findNodeMatch(e,i,s,c)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(e,i,s,d,t)||l.updateNextNode(e,i,s,t,c,o)||l.addNode(e,i,s,t,o),o+=e.nodeSize})),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),pt(this.contentDOM,this.children,t),E&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:i}=t.state.selection;if(!(t.state.selection instanceof o.Bs)||ne+this.node.content.size)return null;let r=t.domSelectionRange(),s=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=p(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){let t=a=0&&t+e.length+a>=n)return a+t;if(n==o&&l.length>=o+e.length-a&&l.slice(o-a,o-a+e.length)==e)return o}}return-1}(this.node.content,t,n-e,i-e);return o<0?null:{node:s,pos:o,text:t}}return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:o}){if(this.getDesc(e))return;let i=e;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let r=new st(this,i,e,o);t.input.compositionNodes.push(r),this.children=Mt(this.children,n,n+o.length,t,r)}update(t,e,n,o){return!(3==this.dirty||!t.sameMarkup(this.node)||(this.updateInner(t,e,n,o),0))}updateInner(t,e,n,o){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(wt(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=bt(this.dom,this.nodeDOM,gt(this.outerDeco,this.node,e),gt(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ct(t,e,n,o,i){yt(o,e,t);let r=new lt(void 0,t,e,n,o,o,o,i,0);return r.contentDOM&&r.updateChildren(i,0),r}class dt extends lt{constructor(t,e,n,o,i,r,s){super(t,e,n,o,i,null,r,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,o){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node)||(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=0,0))}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let o=this.node.cut(t,e),i=document.createTextNode(o.text);return new dt(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class ut extends it{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ht extends lt{constructor(t,e,n,o,i,r,s,a,l,c){super(t,e,n,o,i,r,s,l,c),this.spec=a}update(t,e,n,o){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,o),i}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,o){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function pt(t,e,n){let o=t.firstChild,i=!1;for(let r=0;r0;){let a;for(;;)if(o){let t=n.children[o-1];if(!(t instanceof at)){a=t,o--;break}n=t,o=t.children.length}else{if(n==e)break t;o=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,r.set(a,i),s.push(a)}}return{index:i,matched:r,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n>1,r=Math.min(i,t.length);for(;o-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let o=at.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,o),this.top=o,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,o){let i,r=-1;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))r=this.top.children.indexOf(i,this.index);else for(let o=this.index,i=Math.min(this.top.children.length,o+5);o=n||d<=e?r.push(l):(cn&&r.push(l.slice(n-c,l.size,o)))}return r}function St(t,e=null){let n=t.domSelectionRange(),i=t.state.doc;if(!n.focusNode)return null;let r=t.docView.nearestDesc(n.focusNode),a=r&&0==r.size,l=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c,d,u=i.resolve(l);if(m(n)){for(c=u;r&&!r.node;)r=r.parent;let t=r.node;if(r&&t.isAtom&&o.qv.isSelectable(t)&&r.parent&&(!t.isInline||!function(t,e,n){for(let o=0==e,i=e==p(t);o||i;){if(t==n)return!0;let e=s(t);if(!(t=t.parentNode))return!1;o=o&&0==e,i=i&&e==p(t)}}(n.focusNode,n.focusOffset,r.dom))){let t=r.posBefore;d=new o.qv(l==t?u:i.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;c=i.resolve(e)}return d||(d=Ht(t,c,u,"pointer"==e||t.state.selection.head{n.anchorNode==o&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{At(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Tt=N||O&&T<63;function Nt(t,e){let{node:n,offset:o}=t.docView.domFromPos(e,0),i=oo(t,e,n)))||o.Bs.between(e,n,i)}function Lt(t){return!(t.editable&&!t.hasFocus())&&_t(t)}function _t(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Rt(t,e){let{$anchor:n,$head:i}=t.selection,r=e>0?n.max(i):n.min(i),s=r.parent.inlineContent?r.depth?t.doc.resolve(e>0?r.after():r.before()):null:r;return s&&o.Y1.findFrom(s,e)}function zt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function $t(t,e,n){let i=t.state.selection;if(!(i instanceof o.Bs)){if(i instanceof o.qv&&i.node.isInline)return zt(t,new o.Bs(e>0?i.$to:i.$from));{let n=Rt(t.state,e);return!!n&&zt(t,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=Rt(t.state,e);return!!(n&&n instanceof o.qv)&&zt(t,n)}if(!(I&&n.indexOf("m")>-1)){let n,r=i.$head,s=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter;if(!s||s.isText)return!1;let a=e<0?r.pos-s.nodeSize:r.pos;return!!(s.isAtom||(n=t.docView.descAt(a))&&!n.contentDOM)&&(o.qv.isSelectable(s)?zt(t,new o.qv(e<0?t.state.doc.resolve(r.pos-s.nodeSize):r)):!!H&&zt(t,new o.Bs(t.state.doc.resolve(e<0?a:a+s.nodeSize))))}}function Bt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ft(t,e){if("false"==t.contentEditable)return!0;let n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function Jt(t,e){return e<0?function(t){let e=t.domSelectionRange(),n=e.focusNode,o=e.focusOffset;if(!n)return;let i,r,a=!1;for(S&&1==n.nodeType&&o0){if(1!=n.nodeType)break;{let t=n.childNodes[o-1];if(Ft(t,-1))i=n,r=--o;else{if(3!=t.nodeType)break;n=t,o=n.nodeValue.length}}}else{if(Zt(n))break;{let e=n.previousSibling;for(;e&&Ft(e,-1);)i=n.parentNode,r=s(e),e=e.previousSibling;if(e)n=e,o=Bt(n);else{if(n=n.parentNode,n==t.dom)break;o=0}}}a?Yt(t,n,o):i&&Yt(t,i,r)}(t):function(t){let e=t.domSelectionRange(),n=e.focusNode,o=e.focusOffset;if(!n)return;let i,r,a=Bt(n);for(;;)if(o{t.state==i&&Ot(t)}),50)}function jt(t,e){let n=t.state.doc.resolve(e);if(!O&&!D&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),i=(n.top+n.bottom)/2;if(i>o.top&&i1)return n.lefto.top&&i1)return n.left>o.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function qt(t,e,n){let i=t.state.selection;if(i instanceof o.Bs&&!i.empty||n.indexOf("s")>-1)return!1;if(I&&n.indexOf("m")>-1)return!1;let{$from:r,$to:s}=i;if(!r.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Rt(t.state,e);if(n&&n instanceof o.qv)return zt(t,n)}if(!r.parent.inlineContent){let n=e<0?r:s,a=i instanceof o.C1?o.Y1.near(n,e):o.Y1.findFrom(n,e);return!!a&&zt(t,a)}return!1}function Vt(t,e){if(!(t.state.selection instanceof o.Bs))return!0;let{$head:n,$anchor:i,empty:r}=t.state.selection;if(!n.sameParent(i))return!0;if(!r)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function Ut(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Wt(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:o,openStart:r,openEnd:s}=e;for(;r>1&&s>1&&1==o.childCount&&1==o.firstChild.childCount;){r--,s--;let t=o.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),o=t.content}let a=t.someProp("clipboardSerializer")||i.PW.fromSchema(t.state.schema),l=re(),c=l.createElement("div");c.appendChild(a.serializeFragment(o,{document:l}));let d,u=c.firstChild,h=0;for(;u&&1==u.nodeType&&(d=oe[u.nodeName.toLowerCase()]);){for(let t=d.length-1;t>=0;t--){let e=l.createElement(d[t]);for(;c.firstChild;)e.appendChild(c.firstChild);c.appendChild(e),h++}u=c.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${r} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:c,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function Qt(t,e,n,o,r){let s,a,l=r.parent.type.spec.code;if(!n&&!e)return null;let c=e&&(o||l||!n);if(c){if(t.someProp("transformPastedText",(n=>{e=n(e,l||o,t)})),l)return e?new i.p2(i.HY.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):i.p2.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,r,o,t)));if(n)a=n;else{let n=r.marks(),{schema:o}=t.state,a=i.PW.fromSchema(o);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=s.appendChild(document.createElement("p"));t&&e.appendChild(a.serializeNode(o.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),s=function(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,o=re().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);if((n=i&&oe[i[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"")).reverse().join("")),o.innerHTML=t,n)for(let t=0;t0;t--){let t=s.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;s=t}if(!a){let e=t.someProp("clipboardParser")||t.someProp("domParser")||i.aw.fromSchema(t.state.schema);a=e.parseSlice(s,{preserveWhitespace:!(!c&&!u),context:r,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Kt.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)a=function(t,e){if(!t.size)return t;let n,o=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:r,openStart:s,openEnd:a}=t;for(let t=n.length-2;t>=0;t-=2){let e=o.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;r=i.HY.from(e.create(n[t+1],r)),s++,a++}return new i.p2(r,s,a)}(ne(a,+u[1],+u[2]),u[4]);else if(a=i.p2.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o,r=e.node(n).contentMatchAt(e.index(n)),s=[];if(t.forEach((t=>{if(!s)return;let e,n=r.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&o.length&&Xt(n,o,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=te(s[s.length-1],o.length));let e=Gt(t,n);s.push(e),r=r.matchType(e.type),o=n}})),s)return i.HY.from(s)}return t}(a.content,r),!0),a.openStart||a.openEnd){let t=0,e=0;for(let e=a.content.firstChild;t{a=e(a,t)})),a}const Kt=/^(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 Gt(t,e,n=0){for(let o=e.length-1;o>=n;o--)t=e[o].create(null,i.HY.from(t));return t}function Xt(t,e,n,o,r){if(r1&&(s=0),r=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=r).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(i.HY.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function ne(t,e,n){return e{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>he(t,e))}))}function he(t,e){return t.someProp("handleDOMEvents",(n=>{let o=n[e.type];return!!o&&(o(t,e)||e.defaultPrevented)}))}function pe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function fe(t){return{left:t.clientX,top:t.clientY}}function me(t,e,n,o,i){if(-1==o)return!1;let r=t.state.doc.resolve(o);for(let o=r.depth+1;o>0;o--)if(t.someProp(e,(e=>o>r.depth?e(t,n,r.nodeAfter,r.before(o),i,!0):e(t,n,r.node(o),r.before(o),i,!1))))return!0;return!1}function ge(t,e,n){t.focused||t.focus();let o=t.state.tr.setSelection(e);"pointer"==n&&o.setMeta("pointer",!0),t.dispatch(o)}function be(t,e,n,o){return me(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",(n=>n(t,e,o)))}function ve(t,e,n,i){return me(t,"handleTripleClickOn",e,n,i)||t.someProp("handleTripleClick",(n=>n(t,e,i)))||function(t,e,n){if(0!=n.button)return!1;let i=t.state.doc;if(-1==e)return!!i.inlineContent&&(ge(t,o.Bs.create(i,0,i.content.size),"pointer"),!0);let r=i.resolve(e);for(let e=r.depth+1;e>0;e--){let n=e>r.depth?r.nodeAfter:r.node(e),s=r.before(e);if(n.inlineContent)ge(t,o.Bs.create(i,s+1,s+1+n.content.size),"pointer");else{if(!o.qv.isSelectable(n))continue;ge(t,o.qv.create(i,s),"pointer")}return!0}}(t,n,i)}function ye(t){return Ae(t)}ae.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!ke(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!P||!O||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!E||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||function(t,e){let n=e.keyCode,o=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==n||I&&72==n&&"c"==o)return Vt(t,-1)||Jt(t,-1);if(46==n&&!e.shiftKey||I&&68==n&&"c"==o)return Vt(t,1)||Jt(t,1);if(13==n||27==n)return!0;if(37==n||I&&66==n&&"c"==o){let e=37==n?"ltr"==jt(t,t.state.selection.from)?-1:1:-1;return $t(t,e,o)||Jt(t,e)}if(39==n||I&&70==n&&"c"==o){let e=39==n?"ltr"==jt(t,t.state.selection.from)?1:-1:1;return $t(t,e,o)||Jt(t,e)}return 38==n||I&&80==n&&"c"==o?qt(t,-1,o)||Jt(t,-1):40==n||I&&78==n&&"c"==o?function(t){if(!N||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Ut(t,n,"true"),setTimeout((()=>Ut(t,n,"false")),20)}return!1}(t)||qt(t,1,o)||Jt(t,1):o==(I?"m":"c")&&(66==n||73==n||89==n||90==n)}(t,n)?n.preventDefault():de(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,g(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},ae.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},ae.keypress=(t,e)=>{let n=e;if(ke(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||I&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let i=t.state.selection;if(!(i instanceof o.Bs&&i.$from.sameParent(i.$to))){let e=String.fromCharCode(n.charCode);/[\r\n]/.test(e)||t.someProp("handleTextInput",(n=>n(t,i.$from.pos,i.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const we=I?"metaKey":"ctrlKey";se.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let o=ye(t),i=Date.now(),r="singleClick";i-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,o=e.y-t.clientY;return n*n+o*o<100}(n,t.input.lastClick)&&!n[we]&&("singleClick"==t.input.lastClick.type?r="doubleClick":"doubleClick"==t.input.lastClick.type&&(r="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:r};let s=t.posAtCoords(fe(n));s&&("singleClick"==r?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new xe(t,s,n,!!o)):("doubleClick"==r?be:ve)(t,s.pos,s.inside,n)?n.preventDefault():de(t,"pointer"))};class xe{constructor(t,e,n,i){let r,s;if(this.view=t,this.pos=e,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[we],this.allowDefault=n.shiftKey,e.inside>-1)r=t.state.doc.nodeAt(e.inside),s=e.inside;else{let n=t.state.doc.resolve(e.pos);r=n.parent,s=n.depth?n.before():0}const a=i?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(0==n.button&&r.type.spec.draggable&&!1!==r.type.spec.selectable||c instanceof o.qv&&c.from<=s&&c.to>s)&&(this.mightDrag={node:r,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!S||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),de(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Ot(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(fe(t))),this.updateAllowDefault(t),this.allowDefault||!e?de(this.view,"pointer"):function(t,e,n,i,r){return me(t,"handleClickOn",e,n,i)||t.someProp("handleClick",(n=>n(t,e,i)))||(r?function(t,e){if(-1==e)return!1;let n,i,r=t.state.selection;r instanceof o.qv&&(n=r.node);let s=t.state.doc.resolve(e);for(let t=s.depth+1;t>0;t--){let e=t>s.depth?s.nodeAfter:s.node(t);if(o.qv.isSelectable(e)){i=n&&r.$from.depth>0&&t>=r.$from.depth&&s.before(r.$from.depth+1)==r.$from.pos?s.before(r.$from.depth):s.before(t);break}}return null!=i&&(ge(t,o.qv.create(t.state.doc,i),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),i=n.nodeAfter;return!!(i&&i.isAtom&&o.qv.isSelectable(i))&&(ge(t,new o.qv(n),"pointer"),!0)}(t,n))}(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||N&&this.mightDrag&&!this.mightDrag.node.isAtom||O&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(ge(this.view,o.Y1.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):de(this.view,"pointer")}move(t){this.updateAllowDefault(t),de(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function ke(t,e){return!!t.composing||!!(N&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}se.touchstart=t=>{t.input.lastTouch=Date.now(),ye(t),de(t,"pointer")},se.touchmove=t=>{t.input.lastTouch=Date.now(),de(t,"pointer")},se.contextmenu=t=>ye(t);const Ce=P?5e3:-1;function Me(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Ae(t)),e))}function Se(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Ae(t,e=!1){if(!(P&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Se(t),e||t.docView&&t.docView.dirty){let e=St(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}ae.compositionstart=ae.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Ae(t,!0),t.markCursor=null;else if(Ae(t),S&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,o=e.focusOffset;n&&1==n.nodeType&&0!=o;){let e=o<0?n.lastChild:n.childNodes[o-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,o=-1}}t.input.composing=!0}Me(t,Ce)},ae.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionPendingChanges&&Promise.resolve().then((()=>t.domObserver.flush())),t.input.compositionID++,Me(t,20))};const Oe=C&&M<15||E&&L<604;function Te(t,e,n,o,r){let s=Qt(t,e,n,o,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,s||i.p2.empty))))return!0;if(!s)return!1;let a=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(s),l=a?t.state.tr.replaceSelectionWith(a,o):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}se.copy=ae.cut=(t,e)=>{let n=e,o=t.state.selection,i="cut"==n.type;if(o.empty)return;let r=Oe?null:n.clipboardData,s=o.content(),{dom:a,text:l}=Wt(t,s);r?(n.preventDefault(),r.clearData(),r.setData("text/html",a.innerHTML),r.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let o=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),o.removeAllRanges(),o.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ae.paste=(t,e)=>{let n=e;if(t.composing&&!P)return;let o=Oe?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;o&&Te(t,o.getData("text/plain"),o.getData("text/html"),i,n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,o=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus();let i=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout((()=>{t.focus(),o.parentNode&&o.parentNode.removeChild(o),n?Te(t,o.value,null,i,e):Te(t,o.textContent,o.innerHTML,i,e)}),50)}(t,n)};class Ne{constructor(t,e){this.slice=t,this.move=e}}const Ee=I?"altKey":"ctrlKey";se.dragstart=(t,e)=>{let n=e,i=t.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=t.state.selection,s=r.empty?null:t.posAtCoords(fe(n));if(s&&s.pos>=r.from&&s.pos<=(r instanceof o.qv?r.to-1:r.to));else if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(o.qv.create(t.state.doc,i.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(o.qv.create(t.state.doc,e.posBefore)))}let a=t.state.selection.content(),{dom:l,text:c}=Wt(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Oe?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Oe||n.dataTransfer.setData("text/plain",c),t.dragging=new Ne(a,!n[Ee])},se.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},ae.dragover=ae.dragenter=(t,e)=>e.preventDefault(),ae.drop=(t,e)=>{let n=e,s=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let a=t.posAtCoords(fe(n));if(!a)return;let l=t.state.doc.resolve(a.pos),c=s&&s.slice;c?t.someProp("transformPasted",(e=>{c=e(c,t)})):c=Qt(t,n.dataTransfer.getData(Oe?"Text":"text/plain"),Oe?null:n.dataTransfer.getData("text/html"),!1,l);let d=!(!s||n[Ee]);if(t.someProp("handleDrop",(e=>e(t,n,c||i.p2.empty,d))))return void n.preventDefault();if(!c)return;n.preventDefault();let u=c?(0,r.nj)(t.state.doc,l.pos,c):l.pos;null==u&&(u=l.pos);let h=t.state.tr;d&&h.deleteSelection();let p=h.mapping.map(u),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,m=h.doc;if(f?h.replaceRangeWith(p,p,c.content.firstChild):h.replaceRange(p,p,c),h.doc.eq(m))return;let g=h.doc.resolve(p);if(f&&o.qv.isSelectable(c.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(c.content.firstChild))h.setSelection(new o.qv(g));else{let e=h.mapping.map(u);h.mapping.maps[h.mapping.maps.length-1].forEach(((t,n,o,i)=>e=i)),h.setSelection(Ht(t,g,h.doc.resolve(e)))}t.focus(),t.dispatch(h.setMeta("uiEvent","drop"))},se.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ot(t)}),20))},se.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},se.beforeinput=(t,e)=>{if(O&&P&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,g(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in ae)se[t]=ae[t];function Ie(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class De{constructor(t,e){this.toDOM=t,this.spec=e||Re,this.side=this.spec.side||0}map(t,e,n,o){let{pos:i,deleted:r}=t.mapResult(e.from+o,this.side<0?-1:1);return r?null:new Le(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof De&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ie(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Pe{constructor(t,e){this.attrs=t,this.spec=e||Re}map(t,e,n,o){let i=t.map(e.from+o,this.spec.inclusiveStart?-1:1)-n,r=t.map(e.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=r?null:new Le(i,r,this)}valid(t,e){return e.from=t&&(!i||i(s.spec))&&n.push(s.copy(s.from+o,s.to+o))}for(let r=0;rt){let s=this.children[r]+1;this.children[r+2].findInner(t-s,e-s,n,o+s,i)}}map(t,e,n){return this==$e||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Re)}mapInner(t,e,n,o,i){let r;for(let s=0;s{let l=s-r-(n-t);for(let s=0;sc+e-o)continue;let d=a[s]+e-o;n>=d?a[s+1]=t<=d?-2:-1:r>=i&&l&&(a[s]+=l,a[s+1]+=l)}o+=l})),e=n.maps[t].map(e,-1)}let l=!1;for(let e=0;e=o.content.size){l=!0;continue}let u=n.map(t[e+1]+r,-1)-i,{index:h,offset:p}=o.content.findIndex(d),f=o.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let o=a[e+2].mapInner(n,f,c+1,t[e]+r+1,s);o!=$e?(a[e]=d,a[e+1]=u,a[e+2]=o):(a[e+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,o,i,r,s){function a(t,e){for(let r=0;r{let s,a=r+n;if(s=Je(e,t,a)){for(o||(o=this.children.slice());ir&&e.to=t){this.children[e]==t&&(n=this.children[e+2]);break}let i=t+1,r=i+e.content.size;for(let t=0;ti&&e.type instanceof Pe){let t=Math.max(i,e.from)-i,n=Math.min(r,e.to)-i;tn.map(t,e,Re)));return Be.from(n)}forChild(t,e){if(e.isLeaf)return ze.empty;let n=[];for(let o=0;ot instanceof ze))?t:t.reduce(((t,e)=>t.concat(e instanceof ze?e:e.members)),[]))}}}function Fe(t,e){if(!e||!t.length)return t;let n=[];for(let o=0;on&&e.to{let a=Je(t,e,s+n);if(a){r=!0;let t=Ye(a,e,n+s+1,o);t!=$e&&i.push(s,s+e.nodeSize,t)}}));let s=Fe(r?Ze(t):t,-n).sort(je);for(let t=0;t0;)e++;t.splice(e,0,n)}function Ue(t){let e=[];return t.someProp("decorations",(n=>{let o=n(t.state);o&&o!=$e&&e.push(o)})),t.cursorWrapper&&e.push(ze.create(t.state.doc,[t.cursorWrapper.deco])),Be.from(e)}const We={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Qe=C&&M<=11;class Ke{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Ge{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ke,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),Qe&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,We)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.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(Lt(this.view)){if(this.suppressingSelectionUpdates)return Ot(this.view);if(C&&M<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&d(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let e=t.focusNode;e;e=a(e))n.add(e);for(let o=t.anchorNode;o;o=a(o))if(n.has(o)){e=o;break}let o=e&&this.view.docView.nearestDesc(e);return o&&o.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Lt(t)&&!this.ignoreSelectionChange(n),r=-1,s=-1,a=!1,l=[];if(t.editable)for(let t=0;t1){let t=l.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}let c=null;r<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||i)&&(r>-1&&(t.docView.markDirty(r,s),function(t){if(!Xe.has(t)&&(Xe.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=S,tn)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."),tn=!0}}(t)),this.handleDOMChange(r,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Ot(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;ne.content.size?null:Ht(t,e.resolve(n.anchor),e.resolve(n.head))}function rn(t,e,n){let o=t.depth,i=e?t.end():t.pos;for(;o>0&&(e||t.indexAfter(o)==t.node(o).childCount);)o--,i++,e=!1;if(n){let e=t.node(o).maybeChild(t.indexAfter(o));for(;e&&!e.isLeaf;)e=e.firstChild,i++}return i}class sn{constructor(t,e){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 ce,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(un),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=cn(this),ln(this),this.nodeViews=dn(this),this.docView=ct(this.state.doc,an(this),Ue(this),this.dom,this),this.domObserver=new Ge(this,((t,e,n,r)=>function(t,e,n,r,s){let a=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=St(t,e);if(n&&!t.state.selection.eq(n)){if(O&&P&&13===t.input.lastKeyCode&&Date.now()-100e(t,g(13,"Enter")))))return;let o=t.state.tr.setSelection(n);"pointer"==e?o.setMeta("pointer",!0):"key"==e&&o.scrollIntoView(),a&&o.setMeta("composition",a),t.dispatch(o)}return}let l=t.state.doc.resolve(e),c=l.sharedDepth(n);e=l.before(c+1),n=t.state.doc.resolve(n).after(c+1);let d,u,h=t.state.selection,p=function(t,e,n){let o,{node:r,fromOffset:s,toOffset:a,from:l,to:c}=t.docView.parseRange(e,n),d=t.domSelectionRange(),u=d.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(o=[{node:u,offset:d.anchorOffset}],m(d)||o.push({node:d.focusNode,offset:d.focusOffset})),O&&8===t.input.lastKeyCode)for(let t=a;t>s;t--){let e=r.childNodes[t-1],n=e.pmViewDesc;if("BR"==e.nodeName&&!n){a=t;break}if(!n||n.size)break}let h=t.state.doc,p=t.someProp("domParser")||i.aw.fromSchema(t.state.schema),f=h.resolve(l),g=null,b=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:o,ruleFromNode:en,context:f});if(o&&null!=o[0].pos){let t=o[0].pos,e=o[1]&&o[1].pos;null==e&&(e=t),g={anchor:t+l,head:e+l}}return{doc:b,sel:g,from:l,to:c}}(t,e,n),f=t.state.doc,b=f.slice(p.from,p.to);8===t.input.lastKeyCode&&Date.now()-100=s?r-o:0,a=r+(a-s),s=r):a=a?r-o:0,s=r+(s-a),a=r),{start:r,endA:s,endB:a}}(b.content,p.doc.content,p.from,d,u);if((E&&t.input.lastIOSEnter>Date.now()-225||P)&&s.some((t=>1==t.nodeType&&!nn.test(t.nodeName)))&&(!v||v.endA>=v.endB)&&t.someProp("handleKeyDown",(e=>e(t,g(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!v){if(!(r&&h instanceof o.Bs&&!h.empty&&h.$head.sameParent(h.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let e=on(t,t.state.doc,p.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);a&&n.setMeta("composition",a),t.dispatch(n)}}return}v={start:h.from,endA:h.to,endB:h.to}}if(O&&t.cursorWrapper&&p.sel&&p.sel.anchor==t.cursorWrapper.deco.from&&p.sel.head==p.sel.anchor){let t=v.endB-v.start;p.sel={anchor:p.sel.anchor+t,head:p.sel.anchor+t}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&v.start<=t.state.selection.from+2&&t.state.selection.from>=p.from?v.start=t.state.selection.from:v.endA=t.state.selection.to-2&&t.state.selection.to<=p.to&&(v.endB+=t.state.selection.to-v.endA,v.endA=t.state.selection.to)),C&&M<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>p.from&&"  "==p.doc.textBetween(v.start-p.from-1,v.start-p.from+1)&&(v.start--,v.endA--,v.endB--);let y,w=p.doc.resolveNoCache(v.start-p.from),x=p.doc.resolveNoCache(v.endB-p.from),k=f.resolve(v.start),S=w.sameParent(x)&&w.parent.inlineContent&&k.end()>=v.endA;if((E&&t.input.lastIOSEnter>Date.now()-225&&(!S||s.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!S&&w.pose(t,g(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>v.start&&function(t,e,n,o,i){if(!o.parent.isTextblock||n-e<=i.pos-o.pos||rn(o,!0,!1)n||rn(s,!0,!1)e(t,g(8,"Backspace")))))return void(P&&O&&t.domObserver.suppressSelectionUpdates());O&&P&&v.endB==v.start&&(t.input.lastAndroidDelete=Date.now()),P&&!S&&w.start()!=x.start()&&0==x.parentOffset&&w.depth==x.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==v.endA&&(v.endB-=2,x=p.doc.resolveNoCache(v.endB-p.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,g(13,"Enter"))}))}),20));let A,T,N,I=v.start,D=v.endA;if(S)if(w.pos==x.pos)C&&M<=11&&0==w.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>Ot(t)),20)),A=t.state.tr.delete(I,D),T=f.resolve(v.start).marksAcross(f.resolve(v.endA));else if(v.endA==v.endB&&(N=function(t,e){let n,o,r,s=t.firstChild.marks,a=e.firstChild.marks,l=s,c=a;for(let t=0;tt.mark(o.addToSet(t.marks));else{if(0!=l.length||1!=c.length)return null;o=c[0],n="remove",r=t=>t.mark(o.removeFromSet(t.marks))}let d=[];for(let t=0;tn(t,I,D,e))))return;A=t.state.tr.insertText(e,I,D)}if(A||(A=t.state.tr.replace(I,D,p.doc.slice(v.start-p.from,v.endB-p.from))),p.sel){let e=on(t,A.doc,p.sel);e&&!(O&&P&&t.composing&&e.empty&&(v.start!=v.endB||t.input.lastAndroidDelete{!pe(t,e)||he(t,e)||!t.editable&&e.type in ae||n(t,e)},le[e]?{passive:!0}:void 0)}N&&t.dom.addEventListener("input",(()=>null)),ue(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ue(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(un),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let t in this._props)e[t]=this._props[t];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(Se(this),i=!0),this.state=t;let r=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(r||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=dn(this);(function(t,e){let n=0,o=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let t in e)o++;return n!=o})(t,this.nodeViews)&&(this.nodeViews=t,o=!0)}(r||e.handleDOMEvents!=this._props.handleDOMEvents)&&ue(this),this.editable=cn(this),ln(this);let s=Ue(this),a=an(this),l=n.plugins==t.plugins||n.doc.eq(t.doc)?t.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=o||!this.docView.matchesNode(t.doc,a,s);!c&&t.selection.eq(n.selection)||(i=!0);let u="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(t){let e,n,o=t.dom.getBoundingClientRect(),i=Math.max(0,o.top);for(let r=(o.left+o.right)/2,s=i+1;s=i-20){e=o,n=a.top;break}}return{refDOM:e,refTop:n,stack:B(t.dom)}}(this);if(i){this.domObserver.stop();let e=c&&(C||O)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(n.selection,t.selection);if(c){let n=O?this.trackWrites=this.domSelectionRange().focusNode:null;!o&&this.docView.update(t.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ct(t.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return d(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?Ot(this,e):(Dt(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():u&&function({refDOM:t,refTop:e,stack:n}){let o=t?t.getBoundingClientRect().top:0;F(n,0==o?0:o-e)}(u)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof o.qv){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&$(this,e.getBoundingClientRect(),t)}else $(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;et.ownerDocument.getSelection()),this._root=t;return t||document}posAtCoords(t){return q(this,t)}coordsAtPos(t,e=1){return Q(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let o=this.docView.posFromDOM(t,e,n);if(null==o)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,e){return function(t,e,n){return et==e&&nt==n?ot:(et=e,nt=n,ot="up"==n||"down"==n?function(t,e,n){let o=e.selection,i="up"==n?o.$from:o.$to;return X(t,e,(()=>{let{node:e}=t.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let o=Q(t,i.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=c(t,0,t.nodeValue.length).getClientRects()}for(let t=0;ti.top+1&&("up"==n?o.top-i.top>2*(i.bottom-o.top):i.bottom-o.bottom>2*(o.bottom-i.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){let{$head:o}=e.selection;if(!o.parent.isTextblock)return!1;let i=o.parentOffset,r=!i,s=i==o.parent.content.size,a=t.domSelection();return tt.test(o.parent.textContent)&&a.modify?X(t,e,(()=>{let{focusNode:e,focusOffset:i,anchorNode:r,anchorOffset:s}=t.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=o.depth?t.docView.domAfterPos(o.before()):t.dom,{focusNode:d,focusOffset:u}=t.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||e==d&&i==u;try{a.collapse(r,s),e&&(e!=r||i!=s)&&a.extend&&a.extend(e,i)}catch(t){}return null!=l&&(a.caretBidiLevel=l),h})):"left"==n||"backward"==n?r:s}(t,e,n))}(this,e||this.state,t)}pasteHTML(t,e){return Te(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Te(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ue(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){he(t,e)||!se[e.type]||!t.editable&&e.type in ae||se[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return N&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){let e;function n(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let o=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return d(a.node,a.offset,r,s)&&([o,i,r,s]=[r,s,o,i]),{anchorNode:o,anchorOffset:i,focusNode:r,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function an(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),e.translate||(e.translate="no"),[Le.node(0,t.state.doc.content.size,e)]}function ln(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Le.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function cn(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function dn(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function un(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}}}]); \ No newline at end of file diff --git a/index.html b/index.html index fd33a4bb8..98e98d50b 100644 --- a/index.html +++ b/index.html @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/main.eb475ca1cd25c32a414d.js b/main.ba11674f3b3b320534b0.js similarity index 100% rename from main.eb475ca1cd25c32a414d.js rename to main.ba11674f3b3b320534b0.js diff --git a/runtime.6b0290cd14c71e9d8adb.js b/runtime.03991e47a4a33f623901.js similarity index 99% rename from runtime.6b0290cd14c71e9d8adb.js rename to runtime.03991e47a4a33f623901.js index 5c6f6c59c..9b30980a2 100644 --- a/runtime.6b0290cd14c71e9d8adb.js +++ b/runtime.03991e47a4a33f623901.js @@ -1 +1 @@ -(()=>{var e,a,c,f,b,d,t={},r={};function o(e){var a=r[e];if(void 0!==a)return a.exports;var c=r[e]={exports:{}};return t[e].call(c.exports,c,c.exports,o),c.exports}o.m=t,e=[],o.O=(a,c,f,b)=>{if(!c){var d=1/0;for(i=0;i=b)&&Object.keys(o.O).every((e=>o.O[e](c[r])))?c.splice(r--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[c,f,b]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var b=Object.create(null);o.r(b);var d={};a=a||[null,c({}),c([]),c(c)];for(var t=2&f&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,o.d(b,d),b},o.d=(e,a)=>{for(var c in a)o.o(a,c)&&!o.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,c)=>(o.f[c](e,a),a)),[])),o.u=e=>(8592===e?"common":e)+"."+{32:"0c15a0a094430faf5a5b",154:"34c9fc30d6a42f4155cc",212:"1478c8480d79feb10bb3",236:"17b0203e2f942d40aa02",295:"11f7f3a0378f9a414c0c",298:"97cd9f62a5cc8f347cf6",372:"a081290675ac51ad8a82",424:"1d25f63c0aed979fadc7",458:"b3f76d347f247463b49d",650:"33e0267d7c72c855cf76",710:"f83042233e38ca36edb6",777:"eac4ca0af09ef23d1bff",824:"77539f524a39cb097e18",861:"05c1b777f56299919ed2",870:"c55ee5457ec9d958f64a",896:"6bb2748ba8d27d2f2009",991:"cbfbb13b0b1017db3085",1015:"b106b3900d1c836db6a9",1096:"4fed4dc3ba890895c4f8",1114:"dce1cc3da333a636db2c",1142:"3b7fb71a83993cbf2261",1313:"4078f9826d687fbf9873",1360:"0f56116f020286a55bd7",1389:"0c8d7435c9f0af9a98b4",1392:"bda45d92ca3e3cc64fe4",1397:"056eea74e85c9b23fede",1727:"1d68bc204ddd5cc217d6",1961:"e12a2e6a7ff250da93b0",2060:"b0dfa8504dbdcf92fafb",2108:"62423c222ea9429f4c1b",2237:"f838bf8c2d7c662ae9ec",2286:"3ca7080f298f13c478c1",2361:"2c30580cbb261245486e",2376:"4a14149e5ea90f7055db",2442:"aa225ad36abbfc84d989",2580:"5264b72f7779fc743757",2609:"6659e366e357f9ea41e5",2648:"c9ff116fc8d4306cb249",2679:"91ad06070c8af2970ba3",2683:"a871b6aea3bbdbac9668",2704:"7525d459efb27e6a6d24",2748:"de8a69e2ee7633a8aabd",2766:"b8c47d31b0b88a0d13b2",2812:"cd2a821313c56bd01ea6",2825:"efe4b4475e80fbae76de",2852:"398d57eb6b8b5e5f624e",2859:"147095faafa209083a2f",2927:"fa6f185456c5b9a1bb31",2983:"7faa8999029edb47c816",2991:"f34c0c0f1b4c0e989f29",3021:"d8e83903bb132fac0920",3336:"8b51a7fad7c03185d078",3378:"c2f7bf2ae261e6a41c7d",3408:"d066045c334b31572c93",3442:"c7bc7d8f14984e67ef39",3451:"9b38b37409413a379e1f",3566:"97bc63bbf5b72cc67979",3575:"c37b68cfd4f951f7eb9d",3725:"d378c6204ed31edf07d3",3734:"0593ee5c7101bdf2fa59",3821:"09c9266760247cc41c50",3878:"5248fc18e38722e9ea27",3881:"563ea7f1ca660a13c32b",3922:"8b357c7b37e3a6ffb0fd",3963:"252dac0c082f6001a6c9",4008:"a7138c3f8e31fa03d4b8",4052:"619ea89cc23a845bcba5",4057:"5c6a77ad4e1e8493a248",4058:"4c3a81b6ad39b0903070",4078:"420a66a9aca1deb58b60",4116:"9b6df7cfbad749c591f7",4205:"344283df43c718f8c12f",4304:"d0911f230aa4795be50a",4306:"9b50653835bf97a221bb",4343:"1a69dcc5d36504b237e4",4361:"8e25545b6ef4e26964c7",4416:"685566ff9bde20093f59",4424:"04562bcdccf2614a7cbb",4576:"b9942098813fce7cb5b9",4579:"97ea810ccef227f9f0b3",4648:"d572cec53e18b0f2a072",4661:"b2e3d439d76977acfe4e",4671:"4d00ab74a7ab9e514da3",4711:"d0ab9d4504f20b12f51d",4745:"6ca1bb027e4da5d8d210",4805:"f12ef9476395755d9668",4886:"9958ebc489d1018961ad",4900:"74b00e676f2b11c1509f",4949:"c2d44052986ca226f4fd",5033:"a7de8cbad928636f698a",5034:"3528d687d8e3ba0a1cda",5134:"8e38d50c29812a48b841",5159:"5ea8aa1f79b39164999a",5213:"d84827a4955c461ac89a",5265:"bfbb97eb4f6a64f3ec96",5291:"0f27714d22f0d86c8f46",5380:"88ebc5eacd253d282357",5381:"e5ff4d9b8d12ef3e72b2",5427:"0b64d25af93a6cc7b9ea",5496:"4877959ade9a9238b0d6",5518:"b9313728597c4540260b",5529:"39e6e640b3ee3d501c98",5543:"4621b2d47063e8329c05",5597:"7d79cc1a0cdc1469a6c3",5699:"b6a9407e951efe7e70cf",5745:"5bff1b8330182824cd35",5821:"12bc67bbfe5d96df02cf",5853:"1862cc08e0d27319c1b4",5867:"8b8f4037b6926e17a56c",6118:"936ebbe9d611c8e451ae",6227:"dd1a18bdf7107907519b",6445:"4c557211ac38804e335b",6553:"1f7fd431730a436c3d02",6640:"2fc4963497b67373d428",6655:"371d3ae80e0776d4dc15",6731:"ab788916b82d067e7ac5",6784:"7b964068f4c646a0b83e",6879:"11ad993432164adafbbe",6989:"d7cc9722e5c5222ae6b4",7080:"2f11dcbd55521c369d3b",7095:"aaf211e243525f09373d",7147:"fa147dc368aea29a5880",7169:"1787b7235ca016a8c154",7219:"708da7fbc87ff506f61a",7375:"f08f8295d8ac55aff80f",7383:"07046ab75bda5e2d2cef",7416:"c4f70c67310f92103263",7714:"8121b0ec5fef186c09b4",7718:"adf382508eba84416754",7788:"8dee54b96b953b25964a",7801:"337c17cbe0df56110845",7809:"423c409facf21ae654c6",7843:"90fcf4fcad0070ef9189",7856:"26bb6372a483fd84454d",7991:"232e9ddb9eb66934e6f3",8097:"59f79187522da48e8292",8155:"eee2d1b5f222bac79ec3",8234:"0aed6cbe407133774ca0",8296:"b9402656fd99852b795c",8378:"a6b337a71930569a0a26",8536:"b21680b9e0928b724063",8557:"c81337e8fe7a114115cf",8575:"426ce3947bc8171c39ac",8592:"5e827e2e873044b102d2",8629:"25484feb1b28787c908d",8640:"9c88b5898fc22fb6bce4",8680:"ea7ef0c240892583f76f",8773:"a943384bb29d8ee24829",8818:"b8859c2ec5963589c332",8840:"a3a266b5c0a5277c34b8",8873:"bcc8916937f863d5d49f",9173:"c48c070d313e06c1ee27",9180:"e337f598c9eb1c52aeec",9269:"33e52c1c229f6dd6038e",9289:"e76a4ee6199ac969b6b3",9297:"c2133383aeb5e41c7a0a",9572:"e9a3459667608abdfac4",9603:"b5502fbc156e9a97a8e1",9619:"c25d619ab011e1a989fe",9661:"5742229c7c3d889888f0",9742:"7bf215509680f95449c5",9826:"bfc264056895a20a6877",9899:"ce5f5d1b533767dcc133"}[e]+".js",o.miniCssF=e=>"styles.0e7ec57d2f387d52eddc.css",o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},b="tui-editor:",o.l=(e,a,c,d)=>{if(f[e])f[e].push(a);else{var t,r;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(c))),a)return a(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),r&&document.head.appendChild(t)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.tu=e=>(void 0===d&&(d={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(d=trustedTypes.createPolicy("angular#bundler",d))),d.createScriptURL(e)),o.p="",(()=>{var e={3666:0};o.f.j=(a,c)=>{var f=o.o(e,a)?e[a]:void 0;if(0!==f)if(f)c.push(f[2]);else if(3666!=a){var b=new Promise(((c,b)=>f=e[a]=[c,b]));c.push(f[2]=b);var d=o.p+o.u(a),t=new Error;o.l(d,(c=>{if(o.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var b=c&&("load"===c.type?"missing":c.type),d=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+b+": "+d+")",t.name="ChunkLoadError",t.type=b,t.request=d,f[1](t)}}),"chunk-"+a,a)}else e[a]=0},o.O.j=a=>0===e[a];var a=(a,c)=>{var f,b,[d,t,r]=c,n=0;for(f in t)o.o(t,f)&&(o.m[f]=t[f]);if(r)var i=r(o);for(a&&a(c);n{var e,a,c,f,b,d,t={},r={};function o(e){var a=r[e];if(void 0!==a)return a.exports;var c=r[e]={exports:{}};return t[e].call(c.exports,c,c.exports,o),c.exports}o.m=t,e=[],o.O=(a,c,f,b)=>{if(!c){var d=1/0;for(i=0;i=b)&&Object.keys(o.O).every((e=>o.O[e](c[r])))?c.splice(r--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[c,f,b]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var b=Object.create(null);o.r(b);var d={};a=a||[null,c({}),c([]),c(c)];for(var t=2&f&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,o.d(b,d),b},o.d=(e,a)=>{for(var c in a)o.o(a,c)&&!o.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,c)=>(o.f[c](e,a),a)),[])),o.u=e=>(8592===e?"common":e)+"."+{32:"0c15a0a094430faf5a5b",154:"34c9fc30d6a42f4155cc",212:"1478c8480d79feb10bb3",236:"17b0203e2f942d40aa02",295:"11f7f3a0378f9a414c0c",298:"97cd9f62a5cc8f347cf6",372:"a081290675ac51ad8a82",424:"1d25f63c0aed979fadc7",458:"b3f76d347f247463b49d",650:"33e0267d7c72c855cf76",710:"f83042233e38ca36edb6",777:"eac4ca0af09ef23d1bff",824:"77539f524a39cb097e18",861:"05c1b777f56299919ed2",870:"c55ee5457ec9d958f64a",896:"6bb2748ba8d27d2f2009",991:"cbfbb13b0b1017db3085",1015:"b106b3900d1c836db6a9",1096:"4fed4dc3ba890895c4f8",1114:"dce1cc3da333a636db2c",1142:"3b7fb71a83993cbf2261",1313:"4078f9826d687fbf9873",1360:"0f56116f020286a55bd7",1389:"0c8d7435c9f0af9a98b4",1392:"bda45d92ca3e3cc64fe4",1397:"056eea74e85c9b23fede",1727:"1d68bc204ddd5cc217d6",1961:"e12a2e6a7ff250da93b0",2060:"b0dfa8504dbdcf92fafb",2108:"62423c222ea9429f4c1b",2237:"f838bf8c2d7c662ae9ec",2286:"3ca7080f298f13c478c1",2361:"2c30580cbb261245486e",2376:"4a14149e5ea90f7055db",2442:"aa225ad36abbfc84d989",2580:"5264b72f7779fc743757",2609:"6659e366e357f9ea41e5",2648:"c9ff116fc8d4306cb249",2679:"91ad06070c8af2970ba3",2683:"a871b6aea3bbdbac9668",2704:"7525d459efb27e6a6d24",2748:"de8a69e2ee7633a8aabd",2766:"b8c47d31b0b88a0d13b2",2812:"cd2a821313c56bd01ea6",2825:"efe4b4475e80fbae76de",2852:"398d57eb6b8b5e5f624e",2859:"147095faafa209083a2f",2927:"fa6f185456c5b9a1bb31",2983:"7faa8999029edb47c816",2991:"f34c0c0f1b4c0e989f29",3021:"d8e83903bb132fac0920",3336:"8b51a7fad7c03185d078",3378:"c2f7bf2ae261e6a41c7d",3408:"d066045c334b31572c93",3442:"c7bc7d8f14984e67ef39",3451:"9b38b37409413a379e1f",3566:"97bc63bbf5b72cc67979",3575:"c37b68cfd4f951f7eb9d",3725:"d378c6204ed31edf07d3",3734:"0593ee5c7101bdf2fa59",3821:"09c9266760247cc41c50",3878:"5248fc18e38722e9ea27",3881:"563ea7f1ca660a13c32b",3922:"8b357c7b37e3a6ffb0fd",3963:"252dac0c082f6001a6c9",4008:"a7138c3f8e31fa03d4b8",4052:"619ea89cc23a845bcba5",4057:"5c6a77ad4e1e8493a248",4058:"4c3a81b6ad39b0903070",4078:"420a66a9aca1deb58b60",4116:"9b6df7cfbad749c591f7",4205:"344283df43c718f8c12f",4304:"d0911f230aa4795be50a",4306:"9b50653835bf97a221bb",4343:"1a69dcc5d36504b237e4",4361:"8e25545b6ef4e26964c7",4416:"685566ff9bde20093f59",4424:"04562bcdccf2614a7cbb",4576:"b9942098813fce7cb5b9",4579:"97ea810ccef227f9f0b3",4648:"d572cec53e18b0f2a072",4661:"b2e3d439d76977acfe4e",4671:"4d00ab74a7ab9e514da3",4711:"d0ab9d4504f20b12f51d",4745:"6ca1bb027e4da5d8d210",4805:"f12ef9476395755d9668",4886:"9958ebc489d1018961ad",4900:"74b00e676f2b11c1509f",4949:"c2d44052986ca226f4fd",5033:"a7de8cbad928636f698a",5034:"3528d687d8e3ba0a1cda",5134:"8e38d50c29812a48b841",5159:"5ea8aa1f79b39164999a",5213:"d84827a4955c461ac89a",5265:"bfbb97eb4f6a64f3ec96",5291:"0f27714d22f0d86c8f46",5380:"88ebc5eacd253d282357",5381:"e5ff4d9b8d12ef3e72b2",5427:"0b64d25af93a6cc7b9ea",5496:"4877959ade9a9238b0d6",5518:"b9313728597c4540260b",5529:"39e6e640b3ee3d501c98",5543:"4621b2d47063e8329c05",5597:"7d79cc1a0cdc1469a6c3",5699:"b6a9407e951efe7e70cf",5745:"5bff1b8330182824cd35",5821:"12bc67bbfe5d96df02cf",5853:"1862cc08e0d27319c1b4",5867:"8b8f4037b6926e17a56c",6118:"936ebbe9d611c8e451ae",6227:"dd1a18bdf7107907519b",6445:"4c557211ac38804e335b",6553:"1f7fd431730a436c3d02",6640:"2fc4963497b67373d428",6655:"371d3ae80e0776d4dc15",6731:"ab788916b82d067e7ac5",6784:"7b964068f4c646a0b83e",6879:"11ad993432164adafbbe",6989:"d7cc9722e5c5222ae6b4",7080:"b3cc0188b4eea7f56942",7095:"aaf211e243525f09373d",7147:"fa147dc368aea29a5880",7169:"1787b7235ca016a8c154",7219:"708da7fbc87ff506f61a",7375:"f08f8295d8ac55aff80f",7383:"07046ab75bda5e2d2cef",7416:"c4f70c67310f92103263",7714:"8121b0ec5fef186c09b4",7718:"adf382508eba84416754",7788:"8dee54b96b953b25964a",7801:"337c17cbe0df56110845",7809:"423c409facf21ae654c6",7843:"90fcf4fcad0070ef9189",7856:"26bb6372a483fd84454d",7991:"232e9ddb9eb66934e6f3",8097:"59f79187522da48e8292",8155:"eee2d1b5f222bac79ec3",8234:"0aed6cbe407133774ca0",8296:"b9402656fd99852b795c",8378:"a6b337a71930569a0a26",8536:"b21680b9e0928b724063",8557:"c81337e8fe7a114115cf",8575:"426ce3947bc8171c39ac",8592:"5e827e2e873044b102d2",8629:"25484feb1b28787c908d",8640:"9c88b5898fc22fb6bce4",8680:"ea7ef0c240892583f76f",8773:"a943384bb29d8ee24829",8818:"b8859c2ec5963589c332",8840:"a3a266b5c0a5277c34b8",8873:"bcc8916937f863d5d49f",9173:"c48c070d313e06c1ee27",9180:"e337f598c9eb1c52aeec",9269:"33e52c1c229f6dd6038e",9289:"e76a4ee6199ac969b6b3",9297:"c2133383aeb5e41c7a0a",9572:"e9a3459667608abdfac4",9603:"b5502fbc156e9a97a8e1",9619:"c25d619ab011e1a989fe",9661:"5742229c7c3d889888f0",9742:"7bf215509680f95449c5",9826:"bfc264056895a20a6877",9899:"ce5f5d1b533767dcc133"}[e]+".js",o.miniCssF=e=>"styles.0e7ec57d2f387d52eddc.css",o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},b="tui-editor:",o.l=(e,a,c,d)=>{if(f[e])f[e].push(a);else{var t,r;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(c))),a)return a(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),r&&document.head.appendChild(t)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.tu=e=>(void 0===d&&(d={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(d=trustedTypes.createPolicy("angular#bundler",d))),d.createScriptURL(e)),o.p="",(()=>{var e={3666:0};o.f.j=(a,c)=>{var f=o.o(e,a)?e[a]:void 0;if(0!==f)if(f)c.push(f[2]);else if(3666!=a){var b=new Promise(((c,b)=>f=e[a]=[c,b]));c.push(f[2]=b);var d=o.p+o.u(a),t=new Error;o.l(d,(c=>{if(o.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var b=c&&("load"===c.type?"missing":c.type),d=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+b+": "+d+")",t.name="ChunkLoadError",t.type=b,t.request=d,f[1](t)}}),"chunk-"+a,a)}else e[a]=0},o.O.j=a=>0===e[a];var a=(a,c)=>{var f,b,[d,t,r]=c,n=0;for(f in t)o.o(t,f)&&(o.m[f]=t[f]);if(r)var i=r(o);for(a&&a(c);n