diff --git a/js/editor.js b/js/editor.js index b111a8f336a..4b58c9a8204 100644 --- a/js/editor.js +++ b/js/editor.js @@ -1,3 +1,3 @@ /*! For license information please see editor.js.LICENSE.txt */ -(self.webpackChunk_nextcloud_text=self.webpackChunk_nextcloud_text||[]).push([["editor"],{31728:(e,t,n)=>{"use strict";n.d(t,{$r:()=>y,BG:()=>A,C6:()=>p,Cy:()=>E,FQ:()=>o,HB:()=>r,IT:()=>d,OV:()=>m,QT:()=>h,Uw:()=>i,Zf:()=>v,a_:()=>f,cY:()=>l,eP:()=>T,fB:()=>b,q$:()=>s,rz:()=>S,sw:()=>u,vo:()=>c,wU:()=>_,ww:()=>C,zZ:()=>g});var a=n(52029);const i=Symbol("tiptap:editor"),r=Symbol("editor:file"),o=Symbol("attachment:resolver"),s=Symbol("editor:is-mobile"),l=Symbol("editor:is-public"),c=Symbol("editor:is-rich-editor"),d=Symbol("editor:is-rich-woskapace"),_=Symbol("sync:service"),p=Symbol("editor:upload"),m=Symbol("hook:link-click"),u=Symbol("hook:mention-search"),g=Symbol("hook:mention-insert"),E={inject:{$editor:{from:i,default:null}}},A={inject:{$syncService:{from:_,default:null}}},b={inject:{$isPublic:{from:l,default:!1}}},S={inject:{$isRichWorkspace:{from:d,default:!1}}},h={inject:{$isRichEditor:{from:c,default:!1}}},C={inject:{$isMobile:{from:s,default:!1}}},f={inject:{$file:{from:r,default:()=>({fileId:0,relativePath:null,document:null})}}},v={inject:{$attachmentResolver:{from:o,default:{resolve:e=>(a.k.warn("No attachment resolver provided. Some attachment sources cannot be resolved."),[e])}}}},T={inject:{$editorUpload:{from:p,default:!0}}},y={inject:{$linkHookClick:{from:m,default:null}}}},33528:(e,t,n)=>{"use strict";n.d(t,{TI:()=>s,eS:()=>r,gn:()=>i,kZ:()=>o,qj:()=>l,uT:()=>a});const a=Symbol("state:uploading-state"),i=Symbol("editor:action:attachment-prompt"),r=Symbol("editor:action:upload-attachment"),o={inject:{$uploadingState:{from:a,default:{isUploadingAttachments:!1}}}},s={inject:{$callAttachmentPrompt:{from:i,default:()=>{}}}},l={inject:{$callChooseLocalAttachment:{from:r,default:()=>{}}}}},28612:(e,t,n)=>{"use strict";n.d(t,{Ad:()=>o,Dr:()=>a,aM:()=>i,vV:()=>r});const a=Symbol("wrapper:outline-state"),i=Symbol("wrapper:outline-actions"),r={inject:{$outlineState:{from:a,default:{visible:!1,enable:!1}}}},o={inject:{$outlineActions:{from:i,default:{toggle:()=>{}}}}}},85724:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a=n(68418),i=n(68794);const r={name:"ActionEntry",functional:!0,render(e,t){const{actionEntry:n}=t.props,{data:r,props:o,listeners:s}=t,{key:l}=r,c={data:r,key:l,props:o,on:s};return n.component?e(n.component,c):n.children?e(i.Z,c):e(a.Z,c)}}},76115:(e,t,n)=>{"use strict";n.d(t,{b:()=>T});var a=n(15961),i=n(20296),r=n.n(i),o=n(31728),s=n(28612),l=n(72076),c=n(13815),d=n(93379),_=n.n(d),p=n(7795),m=n.n(p),u=n(90569),g=n.n(u),E=n(3565),A=n.n(E),b=n(19216),S=n.n(b),h=n(44589),C=n.n(h),f=n(97646),v={};v.styleTagTransform=C(),v.setAttributes=A(),v.insert=g().bind(null,"head"),v.domAPI=m(),v.insertStyleElement=S();_()(f.Z,v);f.Z&&f.Z.locals&&f.Z.locals;const T={directives:{Tooltip:a.u},mixins:[o.Cy,o.ww,c.Z,s.Ad,s.vV],props:{actionEntry:{type:Object,required:!0}},data(){return{state:(0,l.wr)(this.actionEntry,this.$editor)}},computed:{label(){const{label:e}=this.actionEntry;return"function"==typeof e?e(this):e},icon(){return this.actionEntry.icon},keyshortcuts(){return(0,l.FZ)(this.actionEntry)},tooltip(){return[this.label,(0,l.RR)(this.$isMobile,this.actionEntry)].join(" ")}},mounted(){this.$_updateState=r()(this.updateState.bind(this),50),this.$editor.on("update",this.$_updateState),this.$editor.on("selectionUpdate",this.$_updateState)},beforeDestroy(){this.$editor.off("update",this.$_updateState),this.$editor.off("selectionUpdate",this.$_updateState)},methods:{updateState(){this.state=(0,l.wr)(this.actionEntry,this.$editor)}}}},60948:(e,t,n)=>{"use strict";n.d(t,{V:()=>a,q:()=>i});const a=Symbol("menu::id"),i={inject:{$menuID:{from:a,default:null}},computed:{menuIDSelector(){return"#".concat(this.$menuID)}}}},43465:(e,n,a)=>{"use strict";a.d(n,{E:()=>P,Z:()=>B});var i=a(32318),r=a(76115),o=a(15961),s=a(60948);const l={name:"EmojiPickerAction",components:{NcEmojiPicker:o.Xo,NcButton:o.P2},extends:r.b,mixins:[s.q],methods:{addEmoji(e){let{id:t,native:n}=e;this.actionEntry.action(this.$editor.chain(),{id:t,native:n}).focus().run()}}};var c=a(51900);const d=(0,c.Z)(l,(function(){var e=this,t=e._self._c;return t("NcEmojiPicker",{staticClass:"entry-action entry-action__emoji",attrs:{"data-text-action-entry":e.actionEntry.key,container:e.menuIDSelector},on:{"select-data":e.addEmoji}},[t("NcButton",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.actionEntry.label,expression:"actionEntry.label"}],staticClass:"entry-action__button",attrs:{role:"menu",title:e.actionEntry.label,"aria-label":e.actionEntry.label,"aria-haspopup":!0},scopedSlots:e._u([{key:"icon",fn:function(){return[t(e.icon,{tag:"component"})]},proxy:!0}])})],1)}),[],!1,null,null,null).exports;var _=a(31728),p=a(33528);const m={name:"ActionAttachmentUpload",components:{NcActions:o.O3,NcActionButton:o.Js,Loading:i.gb,Folder:i.gt,Upload:i.gq},extends:r.b,mixins:[_.fB,_.eP,p.TI,p.kZ,p.qj,s.q],computed:{icon(){return this.isUploadingAttachments?i.gb:this.actionEntry.icon},isUploadingAttachments(){return this.$uploadingState.isUploadingAttachments}}};const u=(0,c.Z)(m,(function(){var e=this,t=e._self._c;return t("NcActions",{staticClass:"entry-action entry-action__image-upload",attrs:{"data-text-action-entry":e.actionEntry.key,title:e.actionEntry.label,"aria-label":e.actionEntry.label,container:e.menuIDSelector,role:"menu","aria-haspopup":""},scopedSlots:e._u([{key:"icon",fn:function(){return[t(e.icon,{tag:"component",attrs:{title:e.actionEntry.label,"aria-label":e.actionEntry.label,"aria-haspopup":""}})]},proxy:!0}])},[e._v(" "),e.$editorUpload?t("NcActionButton",{attrs:{"close-after-click":"",disabled:e.isUploadingAttachments,"data-text-action-entry":"".concat(e.actionEntry.key,"-upload")},on:{click:e.$callChooseLocalAttachment},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Upload")]},proxy:!0}],null,!1,933298848)},[e._v("\n\t\t"+e._s(e.t("text","Upload from computer"))+"\n\t")]):e._e(),e._v(" "),e.$isPublic?e._e():t("NcActionButton",{attrs:{"close-after-click":"",disabled:e.isUploadingAttachments,"data-text-action-entry":"".concat(e.actionEntry.key,"-insert")},on:{click:e.$callAttachmentPrompt},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Folder")]},proxy:!0}],null,!1,2750733237)},[e._v("\n\t\t"+e._s(e.t("text","Insert from Files"))+"\n\t")])],1)}),[],!1,null,null,null).exports;var g=a(86680),E=a(64024),A=a(73845),b=a(16991);const S={name:"ActionInsertLink",components:{NcActions:o.O3,NcActionButton:o.Js,NcActionInput:o.Iw,Document:i.BB,Loading:i.gb,LinkOff:i.pR,Web:i.ph,Shape:i.bn},extends:r.b,mixins:[_.a_,s.q],data:()=>({href:null,isInputMode:!1,startPath:null}),computed:{activeClass(){return this.state.active?"is-active":""},relativePath(){var e,t;return null!==(e=null===(t=this.$file)||void 0===t?void 0:t.relativePath)&&void 0!==e?e:"/"}},methods:{linkFile(){null===this.startPath&&(this.startPath=this.relativePath.split("/").slice(0,-1).join("/"));new E.GB(t("text","Select file or folder to link to"),!1,[],!0,E.K9.Choose,!0,this.startPath).pick().then((e=>{OC.Files.getClient().getFileInfo(e).then(((e,t)=>{const n=(0,b.Lz)(this.relativePath,"".concat(t.path,"/").concat(t.name)).split("/").map(encodeURIComponent).join("/")+("dir"===t.type?"/":""),a="".concat(n,"?fileId=").concat(t.id);this.setLink(a,t.name),this.startPath=t.path+("dir"===t.type?"/".concat(t.name,"/"):"")}))}))},linkWebsite(e){if("submit"===(null==e?void 0:e.type)){const t=[...e.target.elements].filter((e=>"text"===(null==e?void 0:e.type)))[0].value;return this.$refs.menu.closeMenu(),this.isInputMode=!1,this.href=null,this.setLink(t,t)}if((0,A.zh)(this.$editor.state,"link")){const e=(0,A.Jo)(this.$editor.state,"link");this.href=e.href}this.isInputMode=!0},setLink(e,t){var n;e&&![/^[a-zA-Z]+:/,/^\//,/\?fileId=/,/^\.\.?\//,/^[^.]*[/$]/,/^#/].find((t=>e.match(t)))&&(e="https://"+e);const a=e.replaceAll(" ","%20"),i=this.$editor.chain();null!==(n=this.$editor.view.state)&&void 0!==n&&n.selection.empty?i.insertContent({type:"paragraph",content:[{type:"text",marks:[{type:"link",attrs:{href:a}}],text:t}]}):i.setLink({href:a}),i.focus().run()},removeLink(){this.$editor.chain().unsetLink().focus().run()},linkPicker(){(0,g.getLinkWithPicker)(null,!0).then((e=>{this.$editor.chain().focus().insertContent(e+" ").run()})).catch((e=>{console.error("Smart picker promise rejected",e)}))}}};var h=a(93379),C=a.n(h),f=a(7795),v=a.n(f),T=a(90569),y=a.n(T),R=a(3565),N=a.n(R),O=a(19216),I=a.n(O),x=a(44589),D=a.n(x),w=a(37254),M={};M.styleTagTransform=D(),M.setAttributes=N(),M.insert=y().bind(null,"head"),M.domAPI=v(),M.insertStyleElement=I();C()(w.Z,M);w.Z&&w.Z.locals&&w.Z.locals;const k=(0,c.Z)(S,(function(){var e=this,t=e._self._c;return t("NcActions",{ref:"menu",staticClass:"entry-action entry-action__insert-link",class:e.activeClass,attrs:{"aria-haspopup":"","aria-label":e.actionEntry.label,container:e.menuIDSelector,"data-text-action-entry":e.actionEntry.key,title:e.actionEntry.label},scopedSlots:e._u([{key:"icon",fn:function(){return[t(e.icon,{tag:"component",attrs:{title:e.actionEntry.label,"aria-label":e.actionEntry.label,"aria-haspopup":""}})]},proxy:!0}])},[e._v(" "),e.state.active?t("NcActionButton",{attrs:{"close-after-click":"","data-text-action-entry":"".concat(e.actionEntry.key,"-remove")},on:{click:e.removeLink},scopedSlots:e._u([{key:"icon",fn:function(){return[t("LinkOff")]},proxy:!0}],null,!1,3589828876)},[e._v("\n\t\t"+e._s(e.t("text","Remove link"))+"\n\t")]):e._e(),e._v(" "),t("NcActionButton",{attrs:{"close-after-click":"","data-text-action-entry":"".concat(e.actionEntry.key,"-file")},on:{click:e.linkFile},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Document")]},proxy:!0}])},[e._v("\n\t\t"+e._s(e.t("text","Link to file or folder"))+"\n\t")]),e._v(" "),e.isInputMode?t("NcActionInput",{attrs:{type:"text",value:e.href,"data-text-action-entry":"".concat(e.actionEntry.key,"-input")},on:{submit:e.linkWebsite},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Web")]},proxy:!0}],null,!1,1844845715)},[e._v("\n\t\t"+e._s(e.t("text","Link to website"))+"\n\t")]):t("NcActionButton",{attrs:{"data-text-action-entry":"".concat(e.actionEntry.key,"-website")},on:{click:e.linkWebsite},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Web")]},proxy:!0}])},[e._v("\n\t\t"+e._s(e.state.active?e.t("text","Update link"):e.t("text","Link to website"))+"\n\t")]),e._v(" "),t("NcActionButton",{attrs:{"data-text-action-entry":"".concat(e.actionEntry.key,"-picker")},on:{click:e.linkPicker},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Shape")]},proxy:!0}])},[e._v("\n\t\t"+e._s(e.t("text","Open the Smart Picker"))+"\n\t")])],1)}),[],!1,null,"5e172682",null).exports;var L=a(59400);const P=[{key:"outline",forceLabel:!0,icon:i.Cj,click:e=>{let{$outlineActions:t}=e;return t.toggle()},label:e=>{let{$outlineState:n}=e;return n.visible?t("text","Hide outline"):t("text","Show outline")}}],B=[{key:"undo",label:t("text","Undo"),keyChar:"z",keyModifiers:[L.v.Mod],icon:i.WP,action:e=>e.undo(),priority:6},{key:"redo",label:t("text","Redo"),keyChar:"y",keyModifiers:[L.v.Mod],icon:i.Jw,action:e=>e.redo(),priority:12},{key:"bold",label:t("text","Bold"),keyChar:"b",keyModifiers:[L.v.Mod],icon:i.VK,isActive:"strong",action:e=>e.toggleBold(),priority:7},{key:"italic",label:t("text","Italic"),keyChar:"i",keyModifiers:[L.v.Mod],icon:i.mV,isActive:"em",action:e=>e.toggleItalic(),priority:8},{key:"underline",label:t("text","Underline"),keyChar:"u",keyModifiers:[L.v.Mod],icon:i.Bz,isActive:"underline",action:e=>e.toggleUnderline(),priority:15},{key:"strikethrough",label:t("text","Strikethrough"),keyChar:"x",keyModifiers:[L.v.Mod,L.v.Shift],icon:i.Lo,isActive:"strike",action:e=>e.toggleStrike(),priority:16},{key:"headings",label:t("text","Headings"),keyChar:"1…6",keyModifiers:[L.v.Mod,L.v.Shift],icon:i.Lz,isActive:"heading",children:[{key:"headings-h1",label:t("text","Heading 1"),icon:i.Lz,isActive:["heading",{level:1}],action:e=>e.toggleHeading({level:1})},{key:"headings-h2",label:t("text","Heading 2"),icon:i.DB,isActive:["heading",{level:2}],action:e=>e.toggleHeading({level:2})},{key:"headings-h3",label:t("text","Heading 3"),icon:i.XD,isActive:["heading",{level:3}],action:e=>e.toggleHeading({level:3})},{key:"headings-h4",label:t("text","Heading 4"),isActive:["heading",{level:4}],icon:i.fy,action:e=>e.toggleHeading({level:4})},{key:"headings-h5",label:t("text","Heading 5"),isActive:["heading",{level:5}],icon:i.Ze,action:e=>e.toggleHeading({level:5})},{key:"headings-h6",label:t("text","Heading 6"),isActive:["heading",{level:6}],icon:i.J4,action:e=>e.toggleHeading({level:6})},{key:"outline",icon:i.Cj,click:e=>{let{$outlineActions:t}=e;return t.toggle()},visible:e=>{let{$outlineState:t}=e;return t.enable},label:e=>{let{$outlineState:n}=e;return n.visible?t("text","Hide outline"):t("text","Show outline")}}],priority:1},{key:"unordered-list",label:t("text","Unordered list"),keyChar:"8",keyModifiers:[L.v.Mod,L.v.Shift],isActive:"bulletList",icon:i.Cj,action:e=>e.toggleBulletList(),priority:9},{key:"ordered-list",label:t("text","Ordered list"),keyChar:"7",keyModifiers:[L.v.Mod,L.v.Shift],isActive:"orderedList",icon:i.mH,action:e=>e.toggleOrderedList(),priority:10},{key:"task-list",label:t("text","To-Do list"),keyChar:"9",keyModifiers:[L.v.Mod,L.v.Shift],isActive:"taskList",icon:i.Fv,action:e=>e.toggleTaskList(),priority:11},{key:"insert-link",label:t("text","Insert link"),isActive:"link",icon:i.xP,component:k,priority:2},{key:"blockquote",label:t("text","Blockquote"),keyChar:"b",keyModifiers:[L.v.Mod,L.v.Shift],isActive:"blockquote",icon:i.UX,action:e=>e.toggleBlockquote(),priority:13},{key:"callouts",label:t("text","Callouts"),visible:!1,icon:i.kI,isActive:"callout",children:[{key:"callout-info",label:t("text","Info"),isActive:["callout",{type:"info"}],icon:i.kI,action:e=>e.toggleCallout({type:"info"})},{key:"callout-success",label:t("text","Success"),isActive:["callout",{type:"success"}],icon:i.Ho,action:e=>e.toggleCallout({type:"success"})},{key:"callout-warn",label:t("text","Warning"),isActive:["callout",{type:"warn"}],icon:i.uU,action:e=>e.toggleCallout({type:"warn"})},{key:"callout-error",label:t("text","Danger"),isActive:["callout",{type:"error"}],icon:i.b0,action:e=>e.toggleCallout({type:"error"})}],priority:3},{key:"code-block",label:t("text","Code block"),keyChar:"c",keyModifiers:[L.v.Mod,L.v.Alt],isActive:"codeBlock",icon:i.Nk,action:e=>e.toggleCodeBlock(),priority:14},{key:"table",label:t("text","Table"),isActive:"table",icon:i.iA,action:e=>e.insertTable(),priority:17},{key:"emoji-picker",label:t("text","Insert emoji"),icon:i.tk,component:d,action:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.emoji(t)},priority:5},{key:"insert-attachment",label:t("text","Insert attachment"),icon:i.rU,component:u,priority:4}]},59400:(e,n,a)=>{"use strict";a.d(n,{K:()=>o,v:()=>r});const i=navigator.userAgent.includes("Mac"),r={Mod:i?"Meta":"Control",Alt:"Alt",Control:"Control",Shift:"Shift"},o={[r.Mod]:i?t("text","Command"):t("text","Control"),[r.Control]:t("text","Ctrl"),[r.Alt]:t("text",i?"Option":"Alt"),[r.Shift]:t("text","Shift")}},72076:(e,t,n)=>{"use strict";n.d(t,{FZ:()=>r,RR:()=>o,vK:()=>l,wr:()=>c});var a=n(59400);const i=(e,t)=>({"is-active":t,["action-menu-".concat(e.key)]:!0}),r=e=>{let{keyChar:t,keyModifiers:n=[]}=e;return n.map((e=>a.v[e])).concat(t).join("+")},o=(e,t)=>{let{keyChar:n,keyModifiers:i}=t;return!e&&n?"(".concat(function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map((e=>a.K[e])).concat(e.toUpperCase()).join("+")}(n,i),")"):""},s=(e,t)=>e.action&&!e.action(t.can()),l=(e,t)=>{let{isActive:n}=e;if(!n)return!1;const a=Array.isArray(n)?n:[n];return t.isActive(...a)},c=(e,t)=>{const n=l(e,t);return{disabled:s(e,t),class:i(e,n),active:n}}},28374:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a=n(13861),i=n(79835);const r=e=>{let{listComponent:t,items:n=(()=>{}),command:r=(e=>{let{editor:t,range:n,props:a}=e})}=e;return{items:n,command:r,render:()=>{let e,n;return{onStart:r=>{e=new i.aA(t,{parent:void 0,propsData:r}),r.clientRect&&(n=(0,a.ZP)("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}),e.ref.$on("select",(()=>{n.length>0&&n[0].hide()})))},onUpdate(t){e.updateProps(t),t.clientRect&&n&&n[0].setProps({getReferenceClientRect:t.clientRect})},onKeyDown(t){var a,i;if(n)return"Escape"===t.event.key?(n[0].hide(),n[0].destroy(),e.destroy(),n=null,!0):null===(a=e.ref)||void 0===a||null===(i=a.onKeyDown)||void 0===i?void 0:i.call(a,t)},onExit(){n&&(n[0].destroy(),e.destroy())}}}}}},32318:(e,t,n)=>{"use strict";n.d(t,{Ah:()=>Fe,BB:()=>_e,BF:()=>pe,Bz:()=>Oe,Cj:()=>ve,DB:()=>Ae,Ee:()=>xe,F5:()=>je,Fq:()=>Ve,Fv:()=>Te,HG:()=>de,Ho:()=>Le,IY:()=>Ge,J4:()=>Ce,Jw:()=>Pe,L9:()=>re,Lo:()=>Ne,Lz:()=>Ee,Nk:()=>le,Pn:()=>ae,QK:()=>ie,UX:()=>Re,VK:()=>ge,WP:()=>ze,WW:()=>Ie,XD:()=>be,Ze:()=>he,_2:()=>He,b0:()=>ce,bn:()=>Be,fy:()=>Se,gb:()=>ne,gq:()=>qe,gr:()=>oe,gt:()=>ue,iA:()=>Ue,kI:()=>we,mH:()=>ye,mV:()=>fe,pR:()=>ke,ph:()=>We,pn:()=>Ye,rU:()=>De,tk:()=>me,uU:()=>$e,x8:()=>se,xP:()=>Me});var a=n(96963),i=n(82675),r=n(80419),o=n(75441),s=n(45795),l=n(75816),c=n(57612),d=n(13881),_=n(89115),p=n(37319),m=n(34829),u=n(88723),g=n(10864),E=n(39027),A=n(4738),b=n(57637),S=n(13237),h=n(52986),C=n(17238),f=n(11465),v=n(94669),T=n(34415),y=n(9829),R=n(65875),N=n(35357),O=n(92801),I=n(42413),x=n(88505),D=n(39227),w=n(5039),M=n(93603),k=n(37838),L=n(19695),P=n(72468),B=n(64836),U=n(65745),F=n(79542),G=n(91265),j=n(96104),Y=n(21666),H=n(61562),V=n(52880),z=n(49759),q=n(39850),$=n(9571),W=n(69699),Q=n(33581),K=n(4650),Z=n(75762),X=n(8421),J=n(97859),ee=n(54503);const te=e=>({functional:!0,render(t,n){let{data:a,props:i}=n;return t(e,{data:a,key:a.key,staticClass:a.staticClass,props:{size:20,...i}})}}),ne={functional:!0,render(e,t){let{data:n,props:a}=t;return e(U.Z,{data:n,staticClass:"animation-rotate",props:{size:20,...a}})}},ae=te(a.Z),ie=te(g.Z),re=te(E.Z),oe=te(A.Z),se=te(i.default),le=(te(r.default),te(s.Z)),ce=(te(o.Z),te(l.default)),de=te(c.Z),_e=te(d.Z),pe=te(_.default),me=te(p.Z),ue=te(m.default),ge=te(u.Z),Ee=te(b.Z),Ae=te(S.Z),be=te(h.Z),Se=te(C.Z),he=te(f.Z),Ce=te(v.Z),fe=te(T.Z),ve=te(y.Z),Te=te(R.Z),ye=te(N.Z),Re=te(O.Z),Ne=te(I.Z),Oe=te(x.Z),Ie=te(D.default),xe=te(w.Z),De=te(M.Z),we=te(k.Z),Me=te(L.Z),ke=te(P.Z),Le=(te(B.Z),te(F.Z),te(G.default)),Pe=te(j.Z),Be=te(Y.Z),Ue=te(H.Z),Fe=te(V.Z),Ge=te(z.Z),je=te(q.Z),Ye=te($.Z),He=te(W.Z),Ve=(te(Q.Z),te(ee.Z)),ze=te(K.Z),qe=te(Z.Z),$e=te(X.default),We=te(J.default)},73073:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p,g:()=>c});var a=n(73845),i=n(2376),r=n(55963),o=n(40187),s=n(87823);const l=a.hj.create({name:"markdown",extendMarkSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{toMarkdown:(0,a.Nl)(e,"toMarkdown",t)}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{toMarkdown:(0,a.Nl)(e,"toMarkdown",t)}},addProseMirrorPlugins(){let e=!1;return[new i.Sy({key:new i.H$("pasteEventHandler"),props:{handleDOMEvents:{mouseup:(t,n)=>(e=n.shiftKey,!1)},handleKeyDown:(t,n)=>(e=n.shiftKey,!1),clipboardTextParser(t,n,a,i){const r=s.aw.fromSchema(i.state.schema),l=document.cloneNode(!1).createElement("div");return l.innerHTML=e?"
"+t.replaceAll("\n","
").replaceAll("
","
")+"
":o.Z.render(t),r.parseSlice(l,{preserveWhitespace:!0,context:n})}}})]}}),c=e=>{let{nodes:t,marks:n}=e;const a=_(r.Dm.nodes),i=_(r.Dm.marks);return{serializer:new r.nZ({...a,...d(t)},{...i,...d(n)}),serialize(e,t){return this.serializer.serialize(e,{...t,tightLists:!0})}}},d=e=>Object.entries(e).map((e=>{let[t,n]=e;return[t,n.spec.toMarkdown]})).filter((e=>{let[,t]=e;return t})).reduce(((e,t)=>{let[n,a]=t;return{...e,[n]:a}}),{}),_=e=>{const t=e=>e.replace(/_(\w)/g,((e,t)=>t.toUpperCase()));return Object.fromEntries(Object.entries(e).map((e=>{let[n,a]=e;return[t(n),a]})))},p=l},60655:(e,n,a)=>{"use strict";a.d(n,{N8:()=>c,pf:()=>nt,f3:()=>A,Ho:()=>sn});var i=a(73845),r=a(2376),o=a(16722);const s=new r.H$("emoji"),l=i.NB.create({name:"emoji",addOptions:()=>({HTMLAttributes:{},suggestion:{char:":",allowedPrefixes:[" "],pluginKey:s}}),content:"text*",addCommands:()=>({emoji:e=>t=>{let{commands:n}=t;return n.insertContent(e.native+" ")}}),addProseMirrorPlugins(){return[(0,o.ZP)({editor:this.editor,...this.options.suggestion})]}}),c=i.hj.create({name:"customkeymap",addKeyboardShortcuts(){return this.options},addProseMirrorPlugins:()=>[new r.Sy({props:{handleKeyDown(e,t){const n=t.key||t.keyCode;return!t.ctrlKey&&!t.metaKey||t.shiftKey||"f"!==n&&70!==n?"Delete"===t.key&&!0===t.ctrlKey?(t.stopPropagation(),window.dispatchEvent(t),!0):void 0:(t.stopPropagation(),window.dispatchEvent(t),!0)}}})]});var d=a(84348);class _{constructor(e,t,n){this.from=e,this.to=t,this.author=n}}function p(e,t,n,a){if(t>=n)return;let i,r=0;for(;r'.concat((0,S.escapeHtml)(e[t].meta),"
"),h.renderer.rules.bullet_list_open=(e,t,n)=>(e[t].attrs=[...e[t].attrs||[],["data-bullet",e[t].markup]],h.renderer.renderToken(e,t,n));const C=h},13815:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var a=n(25030);const i={data:()=>({$store:a.Z}),beforeMount(){void 0===this.$store?this.$store=a.Z:this.$store.hasModule("text")||this.$store.registerModule("text",a.D)}}},86536:(e,t,n)=>{"use strict";n.d(t,{r2:()=>$,jA:()=>q,QS:()=>W,TY:()=>z,_U:()=>Q});var a=n(59391),i=n(20296),r=n.n(i),o=n(52029),s=n(26937),l=n(79753);function c(e,t){_(e,t),t.add(e)}function d(e,t,n){_(e,t),t.set(e,n)}function _(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function p(e,t){return function(e,t){if(t.get)return t.get.call(e);return t.value}(e,g(e,t,"get"))}function m(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function u(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,g(e,t,"set"),n),n}function g(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var E=new WeakMap,A=new WeakSet;function b(e){return D(e,!!p(this,E).shareToken)}var S=new WeakMap,h=new WeakMap,C=new WeakMap,f=new WeakMap,v=new WeakMap,T=new WeakMap,y=new WeakMap,R=new WeakMap,N=new WeakSet;class O{constructor(e,t){c(this,N),d(this,R,{get:I,set:void 0}),d(this,S,{writable:!0,value:void 0}),d(this,h,{writable:!0,value:void 0}),d(this,C,{writable:!0,value:void 0}),d(this,f,{writable:!0,value:void 0}),d(this,v,{writable:!0,value:void 0}),d(this,T,{writable:!0,value:void 0}),d(this,y,{writable:!0,value:void 0});const{document:n,session:a,lock:i,readOnly:r,content:o,documentState:s}=e.data;u(this,C,n),u(this,f,a),u(this,v,i),u(this,T,r),u(this,S,o),u(this,h,s),u(this,y,t)}get session(){return p(this,f)}get document(){return p(this,C)}get docStateVersion(){return p(this,h)?p(this,C).lastSavedVersion:0}get state(){return{document:{...p(this,C),readOnly:p(this,T)},session:p(this,f),documentSource:p(this,S)||"",documentState:p(this,h)}}sync(e){let{version:t,autosaveContent:n,documentState:a,force:i,manualSave:r}=e;return s.Z.post(m(this,N,x).call(this,"session/sync"),{...p(this,R),filePath:p(this,y).filePath,version:t,autosaveContent:n,documentState:a,force:i,manualSave:r})}push(e){let{steps:t,version:n,awareness:a}=e;return s.Z.post(m(this,N,x).call(this,"session/push"),{...p(this,R),filePath:p(this,y).filePath,steps:t,version:n,awareness:a})}update(e){return s.Z.post(m(this,N,x).call(this,"session"),{...p(this,R),guestName:e}).then((e=>{let{data:t}=e;u(this,f,t)}))}uploadAttachment(e){const t=new FormData;t.append("file",e);const n=D("attachment/upload")+"?documentId="+encodeURIComponent(p(this,C).id)+"&sessionId="+encodeURIComponent(p(this,f).id)+"&sessionToken="+encodeURIComponent(p(this,f).token)+"&shareToken="+encodeURIComponent(p(this,y).shareToken||"");return s.Z.post(n,t,{headers:{"Content-Type":"multipart/form-data"}})}insertAttachmentFile(e){return s.Z.post(D("attachment/filepath"),{documentId:p(this,C).id,sessionId:p(this,f).id,sessionToken:p(this,f).token,filePath:e})}close(){return s.Z.post(m(this,N,x).call(this,"session/close"),p(this,R))}}function I(){return{documentId:p(this,C).id,sessionId:p(this,f).id,sessionToken:p(this,f).token,token:p(this,y).shareToken}}function x(e){return D(e,!!p(this,R).token)}function D(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=(0,l.generateUrl)("/apps/text");return t?"".concat(n,"/public/").concat(e):"".concat(n,"/").concat(e)}const w=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c(this,A),d(this,E,{writable:!0,value:void 0}),u(this,E,e)}open(e){let{fileId:t}=e;return s.Z.put(m(this,A,b).call(this,"session/create"),{fileId:t,filePath:p(this,E).filePath,token:p(this,E).shareToken,guestName:p(this,E).guestName,forceRecreate:p(this,E).forceRecreate}).then((e=>new O(e,p(this,E))))}};function M(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function k(e,t){return function(e,t){if(t.get)return t.get.call(e);return t.value}(e,P(e,t,"get"))}function L(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,P(e,t,"set"),n),n}function P(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var B=new WeakMap,U=new WeakMap,F=new WeakMap,G=new WeakMap,j=new WeakMap,Y=new WeakMap,H=new WeakMap;const V=class{constructor(e,t){M(this,B,{writable:!0,value:void 0}),M(this,U,{writable:!0,value:void 0}),M(this,F,{writable:!0,value:void 0}),M(this,G,{writable:!0,value:void 0}),M(this,j,{writable:!0,value:void 0}),M(this,Y,{writable:!0,value:void 0}),M(this,H,{writable:!0,value:void 0}),L(this,B,e),L(this,U,t),L(this,G,300),L(this,j,0),L(this,F,0)}connect(){this.fetcher>0?console.error("Trying to connect, but already connected"):(L(this,H,!1),this.fetcher=setInterval(this._fetchSteps.bind(this),50),document.addEventListener("visibilitychange",this.visibilitychange.bind(this)))}async _fetchSteps(){if(k(this,Y))return;const e=Date.now();k(this,F)>e-k(this,G)||(this.fetcher?(L(this,Y,!0),o.k.debug("[PollingBackend] Fetching steps",k(this,B).version),await k(this,U).sync({version:k(this,B).version,force:!1,manualSave:!1}).then(this._handleResponse.bind(this),this._handleError.bind(this)),L(this,F,Date.now()),L(this,Y,!1)):console.error("No inverval but triggered"))}_handleResponse(e){let{data:t}=e;const{document:n,sessions:a}=t;if(L(this,j,0),k(this,B).emit("change",{document:n,sessions:a}),k(this,B)._receiveSteps(t),0===t.steps.length){if(k(this,H)||L(this,H,!0),k(this,B).checkIdle())return;const e=Date.now()-9e4;return a.filter((t=>1e3*t.lastContact>e)).length<2?this.maximumRefetchTimer():this.increaseRefetchTimer(),void k(this,B).emit("stateChange",{initialLoading:!0})}k(this,H)&&this.resetRefetchTimer()}_handleError(e){var t,n;e.response&&"ECONNABORTED"!==e.code?409===e.response.status?(this._handleResponse(e.response),o.k.error("Conflict during file save, please resolve"),k(this,B).emit("error",{type:W.SAVE_COLLISSION,data:{outsideChange:e.response.data.outsideChange}})):403===e.response.status||404===e.response.status?(k(this,B).emit("error",{type:W.SOURCE_NOT_FOUND,data:{}}),this.disconnect()):503===e.response.status?(this.increaseRefetchTimer(),k(this,B).emit("error",{type:W.CONNECTION_FAILED,data:{retry:!1}}),o.k.error("Failed to fetch steps due to unavailable service",{error:e})):(this.disconnect(),k(this,B).emit("error",{type:W.CONNECTION_FAILED,data:{retry:!1}}),o.k.error("Failed to fetch steps due to other reason",{error:e})):(L(this,j,(t=k(this,j),n=t++,t)),n>=5?(o.k.error("[PollingBackend:fetchSteps] Network error when fetching steps, emitting CONNECTION_FAILED"),k(this,B).emit("error",{type:W.CONNECTION_FAILED,data:{retry:!1}})):o.k.error("[PollingBackend:fetchSteps] Network error when fetching steps, retry ".concat(k(this,j))))}disconnect(){clearInterval(this.fetcher),this.fetcher=0,document.removeEventListener("visibilitychange",this.visibilitychange.bind(this))}resetRefetchTimer(){L(this,G,300)}increaseRefetchTimer(){L(this,G,Math.min(2*k(this,G),5e3))}maximumRefetchTimer(){L(this,G,5e3)}visibilitychange(){"hidden"===document.visibilityState?L(this,G,6e4):this.resetRefetchTimer()}},z=1440,q=60,$=90,W={SAVE_COLLISSION:0,PUSH_FAILURE:1,LOAD_ERROR:2,CONNECTION_FAILED:3,SOURCE_NOT_FOUND:4};class Q{constructor(e){let{serialize:t,getDocumentState:n,...i}=e;return this._bus=(0,a.Z)(),this.serialize=t,this.getDocumentState=n,this._api=new w(i),this.connection=null,this.sessions=[],this.steps=[],this.stepClientIDs=[],this.lastStepPush=Date.now(),this.version=null,this.sending=!1,this.autosave=r()(this._autosave.bind(this),3e4),this}async open(e){let{fileId:t,initialSession:n}=e;const a=e=>{let{sessions:t}=e;this.sessions=t};this.on("change",a);const i=n?Promise.resolve(new O({data:n},{})):this._api.open({fileId:t}).catch((e=>this._emitError(e)));this.connection=await i,this.connection?(this.backend=new V(this,this.connection),this.version=this.connection.docStateVersion,this.emit("opened",{...this.connection.state,version:this.version}),this.emit("loaded",{...this.connection.state,version:this.version})):this.off("change",a)}startSync(){this.backend.connect()}syncUp(){this.backend.resetRefetchTimer()}_emitError(e){e.response&&"ECONNABORTED"!==e.code?this.emit("error",{type:W.LOAD_ERROR,data:e.response}):this.emit("error",{type:W.CONNECTION_FAILED,data:{}})}updateSession(e){if(this.connection.isPublic)return this.connection.update(e).catch((e=>(o.k.error("Failed to update the session",{error:e}),Promise.reject(e))))}sendSteps(e){if(!this.connection||this.sending)return void setTimeout((()=>{this.sendSteps(e)}),200);this.sending=!0;const t=e();return t.steps.length>0&&this.emit("stateChange",{dirty:!0}),this.connection.push(t).then((e=>{this.sending=!1,this.emit("sync",{steps:[],document:this.connection.document,version:this.version})})).catch((e=>{let{response:t,code:n}=e;if(o.k.error("failed to apply steps due to collission, retrying"),this.sending=!1,!t||"ECONNABORTED"===n)return void this.emit("error",{type:W.CONNECTION_FAILED,data:{}});const{status:a,data:i}=t;var r;403===a&&(i.document||o.k.error("failed to write to document - not allowed"),(null===(r=i.document)||void 0===r?void 0:r.currentVersion)===this.version&&(this.emit("error",{type:W.PUSH_FAILURE,data:{}}),OC.Notification.showTemporary("Changes could not be sent yet")))}))}_receiveSteps(e){let{steps:t,document:n,sessions:a}=e;const i=a.filter((e=>e.lastContact>Math.floor(Date.now()/1e3)-$)).filter((e=>e.lastAwarenessMessage)).map((e=>({step:e.lastAwarenessMessage,clientId:e.clientId}))),r=i;this.steps=[...this.steps,...i.map((e=>e.step))];for(let e=0;e' + str.replaceAll('\\n', '
').replaceAll('
', '
') + '
'\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdom.innerHTML = markdownit.render(str)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn parser.parseSlice(dom, { preserveWhitespace: true, context: $context })\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t},\n})\n\nconst createMarkdownSerializer = ({ nodes, marks }) => {\n\tconst defaultNodes = convertNames(defaultMarkdownSerializer.nodes)\n\tconst defaultMarks = convertNames(defaultMarkdownSerializer.marks)\n\treturn {\n\t\tserializer: new MarkdownSerializer(\n\t\t\t{ ...defaultNodes, ...extractToMarkdown(nodes) },\n\t\t\t{ ...defaultMarks, ...extractToMarkdown(marks) }\n\t\t),\n\t\tserialize(content, options) {\n\t\t\treturn this.serializer.serialize(content, { ...options, tightLists: true })\n\t\t},\n\t}\n}\n\nconst extractToMarkdown = (nodesOrMarks) => {\n\treturn Object\n\t\t.entries(nodesOrMarks)\n\t\t.map(([name, nodeOrMark]) => [name, nodeOrMark.spec.toMarkdown])\n\t\t.filter(([, toMarkdown]) => toMarkdown)\n\t\t.reduce((items, [name, toMarkdown]) => ({\n\t\t\t...items,\n\t\t\t[name]: toMarkdown,\n\t\t}), {})\n}\n\nconst convertNames = (object) => {\n\tconst convert = (name) => {\n\t\treturn name.replace(/_(\\w)/g, (_m, letter) => letter.toUpperCase())\n\t}\n\treturn Object.fromEntries(\n\t\tObject.entries(object)\n\t\t\t.map(([name, value]) => [convert(name), value])\n\t)\n}\n\nexport { createMarkdownSerializer }\nexport default Markdown\n","/*\n * @copyright Copyright (c) 2021 Jonas${escapeHtml(tokens[idx].meta)}
`\n\n// Render lists with bullet attribute\nmarkdownit.renderer.rules.bullet_list_open = (tokens, idx, options) => {\n\ttokens[idx].attrs = [\n\t\t...(tokens[idx].attrs || []),\n\t\t['data-bullet', tokens[idx].markup],\n\t]\n\treturn markdownit.renderer.renderToken(tokens, idx, options)\n}\n\nexport default markdownit\n","/*\n * @copyright Copyright (c) 2022 Max