1import{g as e,e as t,N as n}from"./index-ce180f9e.js";import{a as r,r as i,a7 as o,o as s,b as a,e as l,z as c,n as d,F as u,q as h,p,m as f,t as m,y as g,v,D as y,J as b,K as w,c as x,E as k,x as _,ay as S,P as C,R as T,u as O,w as M,A as E,W as A,L as N,l as I,aj as D,V as R,a$ as L,ah as P,Z as z,N as B,S as j,an as F,g as $,aH as V,ap as H,B as U,d as W,G as q,f as K,I as J}from"./index-fb75ef5d.js";import{l as G,S as Z}from"./el-message-9a27f01a.js";/* empty css */import{u as X}from"./drama-7c963e02.js";import{_ as Y}from"./index-78d2aeb9.js";import{E as Q,a as ee,b as te,c as ne,d as re}from"./index-9797d27a.js";import{_ as ie}from"./_plugin-vue_export-helper-1b428a4d.js";/* empty css *//* empty css */import{g as oe,a as se,E as ae}from"./index-073e35d0.js";import{E as le,a as ce,b as de,c as ue,v as he}from"./directive-ef3a6b1d.js";import{C as pe,x as fe}from"./cropper-6ae62df4.js";import"./event-emitter-adef9f5d.js";/* empty css *//* empty css */import{m as me}from"./index-7201a979.js";import{E as ge}from"./index-f3d37563.js";import{E as ve,a as ye}from"./index-d24fe50e.js";import{E as be,a as we}from"./index-03c64743.js";import{c as xe,Q as ke,J as _e,M as Se,X as Ce,Y as Te,A as Oe,t as Me,n as Ee,Z as Ae,w as Ne}from"./index-1949860e.js";import{d as Ie,j as De}from"./index-69c933ab.js";/* empty css */import{E as Re}from"./index-dc01c787.js";import{e as Le,F as Pe,R as ze}from"./index-562fd877.js";/* empty css */import{E as Be}from"./index-8a7f87cd.js";import{E as je}from"./index-937e9bac.js";import{P as Fe}from"./index-76d40cb6.js";import{a as $e,c as Ve}from"./_commonjsHelpers-52245d71.js";import"./index-6285d8ee.js";import"./index-7508acff.js";import"./projectHistory-5cc3f90e.js";import"./animation-manager-33f5716f.js";import"./user-3d4a091c.js";import"./index-5dd6fbc5.js";import"./constants-70498b7e.js";import"./index-5e5aa4d2.js";import"./index-c4990563.js";import"./index-ed990d19.js";import"./vnode-8fd3ebe4.js";const He={class:"choose-item"},Ue={class:"role-list"},We={class:"left"},qe=["src"],Ke={class:"draft-title"},Je={class:"right-icon"},Ge={class:"foot"},Ze={class:"foot-right"},Xe={class:"left-tip"},Ye={class:"right-tip"},Qe=ie(r({__name:"index",setup(e){const t=X(),n=i("unfold");let r=i();const y=i(!1);o((()=>{"unfold"===n.value?r.value=t.formRoles.slice(0,6):r.value=t.formRoles}));const b=()=>{"unfold"===n.value?(n.value="fold",r.value=t.formRoles):(n.value="unfold",r.value=t.formRoles.slice(0,6))},w=i(),x=i(-1),k=e=>{const t=document.querySelector(".tip"),n=e.target.value;t.innerText=`${n.length}/8`},_=e=>{(e=>{let n={...w.value};e&&(n.material_name=e),y.value=!1,t.updateRoles(n,x.value);const r=document.querySelectorAll(".draft-title")[x.value],i=r.childNodes[0].childNodes[1];null==i||i.removeEventListener("input",k),null==i||i.removeEventListener("blur",_),r.innerHTML=n.material_name})(e.target.value)},S=()=>{t.changeIsRole(!0)};return(e,i)=>{const o=Q,C=ee;return s(),a(u,null,[l("div",He,[c(C,{gutter:8},{default:d((()=>[(s(!0),a(u,null,h(p(r),((e,n)=>(s(),f(o,{span:8,key:n},{default:d((()=>[l("div",Ue,[l("div",We,[l("img",{src:e.thumbnail,alt:""},null,8,qe),l("div",Ke,m(e.material_name),1)]),l("div",Je,[c(Y,{name:"basis_name",onClick:t=>((e,t)=>{if(y.value)return;w.value=e,x.value=t;const n=document.querySelectorAll(".draft-title")[t],r=`<div class="draft-wrap">\n <input class="title-input" maxlength="8" value="${e.material_name}" />\n <span class="tip" style="margin-left: 8px">${e.material_name.length}/8</span>\n </div>`;n.innerHTML=r;const i=document.querySelector(".title-input");i.focus(),i.setSelectionRange(e.material_name.length,e.material_name.length),y.value=!0,i.addEventListener("input",k),i.addEventListener("blur",_)})(e,n)},null,8,["onClick"]),c(Y,{name:"basis_delete",onClick:e=>(e=>{t.deleteRole(e)})(n)},null,8,["onClick"])])])])),_:2},1024)))),128))])),_:1})]),l("div",Ge,[l("div",{class:"zy-button",onClick:S},[c(Y,{name:"button_addrole"}),g("æ°å¢è§è² ")]),l("div",Ze,[l("span",Xe,"å·²å建"+m(p(t).formRoles.length)+"个è§è²",1),p(t).formRoles.length>6?(s(),a("div",{key:0,onClick:b},[c(Y,{name:`basis_${p(n)}`},null,8,["name"]),l("span",Ye,m("unfold"===p(n)?"å±å¼":"æ¶èµ·"),1)])):v("",!0)])])],64)}}}),[["__scopeId","data-v-65d0d71c"]]),et=e=>(b("data-v-3937fe7b"),e=e(),w(),e),tt={key:0,class:"title"},nt=et((()=>l("div",{class:"dot"},null,-1))),rt=et((()=>l("span",null,"+",-1))),it=ie(r({__name:"index",props:{title:{type:String,default:""},isEnter:{type:Boolean,default:!0},label:{type:String,default:""},index:{type:Number,default:0}},setup(e){const t=X(),n=e,r=i({"è§è²":101,"åºæ¯":100,"å¸å±":103}),o=()=>{const e=n.title||n.label,i=r.value[e];n.index;switch(t.setSenceIndex(n.index),i){case 101:t.changeIsRole(!0);break;case 100:t.chooseSence(!0);break;case 103:t.chooseLayout(!0)}};return(t,n)=>(s(),a("div",null,[e.title?(s(),a("div",tt,[nt,g(" "+m(e.title),
11)])):v("",!0),e.isEnter?(s(),a("div",{key:1,class:"entry-box",onClick:o},[rt,g(" "+m(`éæ©${e.title||e.label}`),1)])):v("",!0),y(t.$slots,"tip",{},void 0,!0),y(t.$slots,"choosed",{},void 0,!0)]))}}),[["__scopeId","data-v-3937fe7b"]]),ot={key:0,class:"choose-item"},st={class:"sence-list"},at=["src"],lt=ie(r({__name:"index",props:{index:{type:Number,default:0}},setup(e){const t=e,n=X(),r=x((()=>{const e=n.dramaForm.drama;return oe(e,`scene_list[${t.index-1}]`)})),i=()=>{n.setSenceIndex(t.index),n.chooseSence(!0)};return(e,t)=>{const o=le,u=se;return r.value.bg_url?(s(),a("div",ot,[l("div",st,[l("div",{class:k(`sence-${p(n).screenType}`)},[l("img",{class:"sence-bg-img",src:r.value.bg_url,alt:"ä¼å½±"},null,8,at)],2),c(o,{class:"box-item",effect:"dark",content:r.value.bg_name||"",placement:"bottom-start"},{default:d((()=>[l("div",null,m(r.value.bg_name||""),1)])),_:1},8,["content"]),c(u,{class:"delete-btn",onClick:i},{default:d((()=>[c(Y,{name:"basis_replace"})])),_:1})])])):v("",!0)}}}),[["__scopeId","data-v-610ba41c"]]),ct={key:0,class:"choose-item"},dt={class:"sence-list"},ut=["src"],ht=ie(r({__name:"index",props:{senceForm:{type:Object,default:()=>{}},index:{type:Number,default:0}},setup(e){const t=e,n=X(),r=()=>{n.setSenceIndex(t.index),n.chooseLayout(!0)};return(t,n)=>{const i=se;return e.senceForm?(s(),a("div",ct,[l("div",dt,[l("img",{src:e.senceForm.url,alt:""},null,8,ut),l("div",null,m(e.senceForm.second_type),1),c(i,{class:"delete-btn",onClick:r},{default:d((()=>[c(Y,{name:"basis_replace"})])),_:1})])])):v("",!0)}}}),[["__scopeId","data-v-54cceeda"]]),pt=e=>(b("data-v-244bda72"),e=e(),w(),e),ft={class:"circumstances-wrap"},mt={class:"title"},gt={class:"circumstances-title"},vt={class:"form"},yt=pt((()=>l("div",{class:"label"},"ç»é¢æè¿°",-1))),bt=pt((()=>l("div",{class:"label"},"è§è²å¯¹è¯",-1))),wt=["src"],xt=["src"],kt=pt((()=>l("div",{class:"add"},"+",-1))),_t=pt((()=>l("div",null,"æ°å¢è§è²",-1))),St=pt((()=>l("span",null,"+",-1))),Ct=r({__name:"index",props:{subIndex:{type:Object,default:()=>{}}},setup(e){const t=X(),n=e,r=x((()=>t.formRoles)),i=x((()=>{const{index:e,num:r}=n.subIndex;return t.dramaForm.drama.scene_list[e-1].plot_list[r-1]})),o=()=>{t.changeIsRole(!0)},v=(e,o)=>{const s=r.value.find((t=>t.material_name===e.name)),a=i.value.shot_list.filter((e=>e.name)),l=[...new Set(a.map((e=>e.role_id)))];l.length>4&&s&&!l.includes(null==s?void 0:s.id)?te.alert("ä¸ä¸ªåºæ¯ä¸æå¤æ·»å 4个è§è²","æç¤º",{confirmButtonText:"ç¥éäº",type:"warning"}).then((()=>{e.name=""})).catch((()=>{e.name=""})):(e.thumbnail=null==s?void 0:s.thumbnail,e.role_id=null==s?void 0:s.id),t.updateRoleTalk(n.subIndex,o,e)},y=()=>{const{index:e,num:r}=n.subIndex;1!==r?me({text:"ç¡®å®å é¤åï¼è¿ä¸ä¸ªæ
èä¸çææå¯¹è¯é½ä¼è¢«å é¤",type:"delete"}).then((()=>{t.deleteScrence(r-1,e-1)})):ae.error("è³å°ä¿çä¸ä¸ªæ
è")},b=()=>{t.updateDesc(n.subIndex,i.value.desc)};return(w,x)=>{const k=_("Delete"),C=se,T=ge,O=ve,M=ye;return s(),a("div",ft,[l("div",mt,[l("div",gt,"æ
è"+m(e.subIndex.num),1),c(C,{class:"delete-icon",onClick:y},{default:d((()=>[c(k)])),_:1})]),l("div",vt,[yt,c(T,{placeholder:"请è¾å
¥ç»é¢å
容",modelValue:p(i).desc,"onUpdate:modelValue":x[0]||(x[0]=e=>p(i).desc=e),modelModifiers:{trim:!0},type:"textarea",onBlur:b},null,8,["modelValue"]),bt,(s(!0),a(u,null,h(p(i).shot_list,((e,g)=>(s(),a("div",{class:"talk-list",key:g},[c(M,{modelValue:e.name,"onUpdate:modelValue":t=>e.name=t,"popper-class":"optionsContent",teleported:!1,placeholder:"è¯·éæ©è§è²","value-key":"id","suffix-icon":"CaretBottom",onChange:t=>((e,t)=>{let n;e.role_id?(n=r.value.find((t=>t.id===e.role_id)),e.name?v(e,t):e.name=null==n?void 0:n.material_name):v(e,t)})(e,g)},S({default:d((()=>[(s(!0),a(u,null,h(p(r),((e,t)=>(s(),f(O,{key:t,value:e.material_name},{default:d((()=>[l("img",{src:e.thumbnail},null,8,xt),l("div",null,m(e.material_name),1)])),_:2},1032,["value"])))),128)),(s(),f(O,{key:void 0,value:"",onClick:o},{default:d((()=>[kt,_t])),_:1}))])),_:2},[e.thumbnail?{name:"prefix",fn:d((()=>[l("img",{class:"select-role",src:e.thumbnail,alt:""},null,8,wt)])),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","onChange"]),c(T,{modelValue:e.dialogue,"onUpdate:modelValue":t=>e.dialogue=t,placeholder:"请è¾å
¥å¯¹è¯å
容",onBlur:t=>(e=>{var t;e.dialogue=(null==(t=e.dialogue)?void 0:t.replace(/^\s+|\s+$/g,""))||""})(e)},{suffix:d((()=>[c(Y,{name:"basis_delete",class:"basis_delete",onClick:e=>(e=>{const{index:r,num:o}=n.subIndex,s=i.value.shot_list;0===e&&1===s.length&&t.resetForm(r-1,o-1),s.length>1&&t.deleteTalk(r-1,o-1,e)})(g)},null,8,["onClick"])])),_:2},1032,["modelValue","onUpdate:modelValue","onBlur"])])))),128)),l("div",{class:"new-button",onClick:x[1]||(x[1]=e=>(()=>{const{index:e,num:r}=n.subIndex;t.addTalk(e-1,r-1)})())},[St,g(" æ°å¢å¯¹è¯ ")])])])}}}),Tt=ie(Ct,[["__scopeId","data-v-244bda72"]]),Ot=e=>(b("data-v-b5b228d1"),e=e(),w(),e),Mt={class:"series-scene"},Et=Ot((()=>l("div",{class:"title"},"éæ©åºæ¯å¾",-1))),At=["src"],Nt=["onClick"],It=[Ot((()=>l("div",null,"åºç¨",-1)))],Dt=r({__name:"SeriesScene",props:{index:{}},setup(e){const{index:t}=e,n=X(),r=x((()=>n.seriesSence)),i=()=>{n.dramaForm.drama.scene_list[t-1].isSeries=!1};return(e,o)=>{const d=Y;return s(),a("div",Mt,[Et,c(d,{name:"popup_close",onClick:i}),(s(!0),a(u,null,h(p(r),((e,r)=>(s(),a("div",{class:"item",key:r},[l("img",{src:e,alt:"ä¼å½±"},null,8,At),l("div",{class:"aply-box",onClick:r=>{return i=e,void n.setSenceUrl({url:i,index:t});var i}},It,8,Nt)])))),128))])}}}),Rt=ie(Dt,[["__scopeId","data-v-b5b228d1"]]),Lt={class:"foot-button"},Pt=ie(r({__name:"footButton",props:{index:{}},setup(e){const t=X();return(e,n)=>{const r=Y;return s(),a("div",Lt,[l("div",{class:"zy-button",onClick:n[0]||(n[0]=n=>{return r=e.index,void t.addScrence(r-1);var r})},[c(r,{name:"button_add11"}),g(" æ°å¢æ
è ")]),l("div",{class:"zy-button",onClick:n[1]||(n[1]=n=>{return r=e.index,void t.addChapter(r);var r})},[c(r,{name:"button_add2"}),g(" æ°å¢ä¸åº ")])])}}}),[["__scopeId","data-v-9b7134b0"]]),zt={class:"chapter-title"},Bt=ie(r({__name:"sceneTitle",props:{index:{}},setup(t){const n=X();return(t,r)=>{const i=_("MoreFilled"),o=se,l=Y,u=ce,h=de,f=ue;return s(),a("div",zt,[g(" 第"+m(p(e)(t.index))+"åº ",1),c(f,{placement:"bottom-end",teleported:!1},{dropdown:d((()=>[c(h,null,{default:d((()=>[c(u,{onClick:r[0]||(r[0]=e=>{return r=t.index,void n.addChapter(r);var r})},{default:d((()=>[c(l,{name:"button_add2"}),g(" å¨ä¸æ¹æ°å¢ä¸åº ")])),_:1}),c(u,{onClick:r[1]||(r[1]=e=>{return r=t.index,void(1!==n.dramaForm.drama.scene_list.length?me({text:"ç¡®å®å é¤åï¼è¿ä¸åºæ¬¡ä¸å
¨é¨å
容ä¹ä¼è¢«å é¤",type:"delete"}).then((()=>{n.deleteChapter(r)})):ae.error("è³å°ä¿çä¸åº"));var r})},{default:d((()=>[c(l,{name:"basis_dustbin"}),g(" å é¤è¿ä¸åº ")])),_:1})])),_:1})])),default:d((()=>[c(o,null,{default:d((()=>[c(i)])),_:1})])),_:1})])}}}),[["__scopeId","data-v-f8a751c5"]]),jt=ie(r({__name:"index",props:{index:{}},setup(e){const t=X(),{index:n}=e,r=x((()=>t.dramaForm.drama.scene_list[n-1])),i=x((()=>t.dramaForm.drama.scene_list[n-1].bg_url)),o=x((()=>
1t.dramaForm.drama.scene_list[n-1].layout)),l=x((()=>{const e=t.dramaForm.drama.scene_list[n-1];return t.seriesSence.length&&e.isSeries})),m=()=>{t.supdateData(r.value.outline,n)};return(e,t)=>{const n=ge,g=be,y=Q,b=ee,w=we;return s(),a("div",null,[c(Bt,{index:e.index},null,8,["index"]),c(w,{model:p(r),"label-position":"top"},{default:d((()=>[c(g,{label:"大纲ææ"},{default:d((()=>[c(n,{type:"textarea",placeholder:"请è¾å
¥æ¨ç大纲å
容",modelValue:p(r).outline,"onUpdate:modelValue":t[0]||(t[0]=e=>p(r).outline=e),modelModifiers:{trim:!0},onInput:m},null,8,["modelValue"])])),_:1}),c(b,{gutter:8},{default:d((()=>[c(y,{span:12},{default:d((()=>[c(g,{class:"extral-item"},{default:d((()=>[c(it,{index:e.index,title:"åºæ¯",isEnter:!p(i)},{choosed:d((()=>[c(lt,{index:e.index},null,8,["index"])])),_:1},8,["index","isEnter"])])),_:1})])),_:1}),c(y,{span:12},{default:d((()=>[c(g,{label:"å¸å±"},{default:d((()=>[c(it,{label:"å¸å±",type:103,index:e.index,isEnter:!p(o)},{choosed:d((()=>[c(ht,{index:e.index,senceForm:p(o)},null,8,["index","senceForm"])])),_:1},8,["index","isEnter"])])),_:1})])),_:1}),p(l)?(s(),f(y,{key:0,span:24,class:"series-scene"},{default:d((()=>[c(Rt,{index:e.index},null,8,["index"])])),_:1})):v("",!0)])),_:1})])),_:1},8,["model"]),(s(!0),a(u,null,h(p(r).plot_list,((t,n)=>(s(),f(Tt,{key:n,subIndex:{index:e.index,num:n+1}},null,8,["subIndex"])))),128)),c(Pt,{index:e.index},null,8,["index"])])}}}),[["__scopeId","data-v-47d2c61c"]]),Ft=X(),$t=()=>{const t=G.get(Ft.dramaForm.drama,"scene_list",[]),{role_list:n}=Ft.dramaForm.drama;if(0!==n.length)for(let r=0;r<t.length;r++){const i=G.get(t[r],"plot_list",[]);let o=0;const s=e(r+1);if(""===t[r].bg_url)return void ae.error(`æ£æµå°ä½ 第${s}åºæªéæ©åºæ¯ï¼è¯·å
éæ©åºæ¯`);for(let a=0;a<i.length;a++){const l=G.get(i[a],"shot_list",[]).filter((e=>e.role_id)),c=e(a+1);if(0===l.length)return void ae.error(`æ£æµå°ä½ 第${s}åºæ
è${c}æªå¡«å对è¯ï¼è¯·å
è¾å
¥å¯¹è¯`);if(!Vt(l,n))return void ae.error(`æ£æµå°ä½ 第${s}åºæ
è${c}ä¸å¯¹è¯æªéæ©è§è²ï¼è¯·å
éæ©è§è²`);{const e=[...new Set(l.map((e=>e.role_id)))].length;o<e&&(o=e)}if(a===i.length-1){if(!t[r].layout_id){return void Ht(`æ£æµå°ä½ 第${s}åºæªéæ©å¸å±`,o,r)}if(o>parseInt(t[r].layout.type)){return void Ht(`æ£æµå°ä½ 第${s}åºå¯¹è¯ä¸çè§è²æ°éåæéå¸å±ä¸å¹é
`,o,r)}}}r===t.length-1&&Ut(1)}else ae.error("è¯·éæ©å§æ¬è§è²")};function Vt(e,t){const n=t.map((e=>Number(e.role_id)));return e.every((e=>n.includes(Number(e.role_id))))}const Ht=(e,t,n)=>{const r=G.get(Ft,"layList",[]);me({text:e,type:"submit",cancel:"ç»§ç»ä¿®æ¹",okText:"使ç¨é»è®¤"}).then((()=>{const e=r.find((e=>t===parseInt(e.type)));Ft.updateLayOut(e.layout_list[0],n)}))},Ut=async e=>{var t,n,r,i;const o=`æªå½å${fe().format("YYYYMMDDHHmmss")}`,s=G.cloneDeep(Ft.dramaForm),a=Ft.screenType,{drama_name:l}=Ft.dramaForm.drama;""===l?(s.task_name=o,s.drama.drama_name=o):s.task_name=l;const c=await xe({...s,screen_type:a});if(c.code===Z.SUCCESS){const o=null==(n=null==(t=c.data)?void 0:t.task)?void 0:n.id,l=(null==(i=null==(r=c.data)?void 0:r.task)?void 0:i.project_id)||0;if(o&&(Ft.setTaskId(o),Ft.setProjectId(l)),1===e){const e=o||s.task_id;Wt(e,l,{...s,screen_type:a})}else{const e=C.currentRoute.value,t=e.params.taskId,n=e.params.projectId,r=Ft.dramaForm.task_id;r&&r!==t&&C.replace({name:T.DRAMA_MODIFY,params:{projectId:n,taskId:r}})}}},Wt=(e,t,n)=>{const{screenType:r}=Ft,{scene_list:i}=n.drama,o=r?1080:1920,s=document.querySelector(`.sence-${r}`),a=s.offsetHeight/s.offsetWidth;Promise.all(i.map(((t,n)=>{const{bg_url:r}=t,i=document.createElement("img");return i.src=r,i.style.width=`${o}px`,i.style.height="auto",i.style.position="absolute",i.style.top="-10000",document.body.appendChild(i),new Promise((t=>{i.onload=async()=>{const r=await qt(i,1/a,e,n);document.body.removeChild(i),t(r)}}))}))).then((async r=>{const i=n.drama.scene_list,o={...n,drama:{...n.drama,scene_list:i.map(((e,t)=>({...e,bg_url:r[t]}))),task_id:e}};await xe(o),await ke(e),C.push({name:"editor",params:{id:e,projectId:t}})}))},qt=(e,t,n,r)=>new Promise((i=>{const o=new pe(e,{aspectRatio:t,autoCropArea:1,viewMode:0,ready:async function(){const e=o.getCanvasData(),{width:s,height:a}=e;s/t<a?o.setCropBoxData({width:s,height:s/t}):o.setCropBoxData({width:a*t,height:a});const l=await Kt(n,r,o);o.destroy(),i(l)}})})),Kt=async(e,t,n)=>{const r=null==n?void 0:n.getCroppedCanvas({imageSmoothingQuality:"high"});return new Promise((async n=>{null==r||r.toBlob((async function(r){const i=new window.File([r],`scene-${t+1}.png`,{type:"image/png"}),o=await _e({file:i,task_id:e,file_name:`scene-${t+1}.png`}),s=G.get(o,"data.url","");n(s)}))}))},Jt=e=>(b("data-v-b6810df2"),e=e(),w(),e),Gt={id:"form-wrap"},Zt={class:"title"},Xt=Jt((()=>l("div",null,"å§æ¬æ é¢",-1))),Yt=Jt((()=>l("div",{class:"sub-title"},"æ é¢",-1))),Qt={key:0,class:"tip-content"},en=r({__name:"index",emits:{"update:inputTitle":e=>null!==e},setup(e,{emit:n}){const r=n;i();const o=O(),m=X(),y=i(!1);let b=i(),w=1,k=i();const _=x((()=>o.meta.isDramaModify)),C=x((()=>m.dramaForm.drama.scene_list)),T=x((()=>!m.formRoles.length)),I=x({get:()=>m.dramaForm.drama.drama_name,set(e){m.updateTitle(e),r("update:inputTitle",e)}}),D=Ie((()=>{m.getDrama(m.screenType,"")}),500);M(m.dramaForm,((e,t)=>
1{e&&t&&1===w&&(w++,b.value=setInterval((()=>{L(-1)}),5e3))}),{deep:!0,immediate:!0});const R=Ie((e=>{clearInterval(b.value),b.value=null,L(e)}),500),L=async e=>{if(!m.isDramaDataSameAsVersion())if(-1===e){const t=JSON.stringify(m.dramaForm.drama);if(t===k.value)return;k.value=t,m.setAutoSave(fe().format("HH:mm")),await Ut(e)}else y.value=!0,$t()};return E((()=>{t.on(Se.TRANSFER_DRAMA,R)})),A((()=>{clearInterval(b.value),b.value=null,t.remove(Se.TRANSFER_DRAMA,R)})),(e,t)=>{const n=ge;return s(),a("div",Gt,[l("div",Zt,[Xt,p(_)?v("",!0):(s(),a("div",{key:0,class:"intelli-tip",onClick:t[0]||(t[0]=e=>p(D)(null))},[c(Y,{name:"a-button_fillin"}),g(" æºè½å¡«å
¥æ¡ä¾ ")]))]),Yt,c(n,{placeholder:"请è¾å
¥å§æ¬æ é¢",modelValue:p(I),"onUpdate:modelValue":t[1]||(t[1]=e=>N(I)?I.value=e:null),modelModifiers:{trim:!0},maxlength:"20",size:"large",class:"case-title"},null,8,["modelValue"]),c(it,{title:"è§è²",isEnter:p(T)},S({tip:d((()=>[p(T)&&p(y)?(s(),a("div",Qt,"è¯·éæ©è§è²")):v("",!0)])),_:2},[p(T)?void 0:{name:"choosed",fn:d((()=>[c(Qe)])),key:"0"}]),1032,["isEnter"]),(s(!0),a(u,null,h(p(C),((e,t)=>(s(),f(jt,{key:t,formData:e,index:t+1},null,8,["formData","index"])))),128))])}}}),tn=ie(en,[["__scopeId","data-v-b6810df2"]]),nn=(e=>(b("data-v-aa02fb85"),e=e(),w(),e))((()=>l("div",{class:"title"},"请åçä¸é¢çé®é¢",-1))),rn={class:"foot-btn"},on=r({__name:"index",emits:["goBack"],setup(e,{emit:t}){const n=X(),r=I({name1:[{required:!0,message:"请è¾å
¥",trigger:"blur"}],name2:[{required:!0,message:"请è¾å
¥",trigger:"blur"}],name3:[{required:!0,message:"请è¾å
¥",trigger:"blur"}],name4:[{required:!0,message:"请è¾å
¥",trigger:"blur"}],name5:[{required:!0,message:"请è¾å
¥",trigger:"blur"}],name6:[{required:!0,message:"请è¾å
¥",trigger:"blur"}]}),o=i(),f=[{field:"name1",label:"æä»¬çä¸»è§æ¯è°ï¼ä»éå°äºä»ä¹é®é¢ï¼"},{field:"name2",label:"主è§çç®çæ¯ä»ä¹ï¼"},{field:"name3",label:"主è§éå°äºå°é¾ï¼è¿ä¸ªå°é¾çæ¥æºåç®çæ¯ä»ä¹ï¼"},{field:"name4",label:"为äºè§£å³è¿äºå°é¾ï¼ä¸»è§åäºä»ä¹åªåï¼"},{field:"name5",label:"妿è¿äºåªåé½ä¸è½è§£å³é®é¢ï¼ä»è¿æä»ä¹æ¹æ³"},{field:"name6",label:"è§£å³å®è¿ä¸ªé®é¢åï¼æä»¬ç主è§å¾å°äºä»ä¹æé¿"}],m=i({name1:"",name2:"",name3:"",name4:"",name5:"",name6:""}),g=()=>{const{name1:e,name2:t,name3:r,name4:i,name5:o,name6:s}=m.value;n.createOutline([`${e}${t}`,`${r}${i}`,o,s]),v("goBack")},v=t;return A((()=>{o.value.resetFields()})),(e,t)=>{const i=ge,y=be,b=we;return s(),a(u,null,[nn,c(b,{ref_key:"ruleFormRef",ref:o,model:p(m),rules:p(r),"label-position":"top"},{default:d((()=>[(s(),a(u,null,h(f,((e,t)=>c(y,{label:e.label,key:t,prop:e.field},{default:d((()=>[c(i,{autosize:{minRows:3,maxRows:8},type:"textarea",maxlength:"200",modelValue:p(m)[e.field],"onUpdate:modelValue":t=>p(m)[e.field]=t},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"]))),64)),l("div",rn,[l("div",{onClick:t[0]||(t[0]=e=>{var t;(t=p(o))&&(t.resetFields(),v("goBack"))})},"è¿å"),l("div",{onClick:t[1]||(t[1]=e=>(async e=>{e&&await e.validate((e=>{if(e){const e=G.get(n.dramaForm.drama,"scene_list",[]);for(let t=0;t<e.length;t++){if(e[t].outline)return void me({text:"å§æ¬ç¼è¾é¡µå·²å¡«åå
å®¹ï¼æ¤æä½ä¼è¦çå·²æå
å®¹ï¼æ¯å¦è¦ç",type:"submit",cancel:"ä¸è¦ç",okText:"确认è¦ç"}).then((()=>{g()}));t===e.length-1&&g()}}}))})(p(o)))},"ä¸ä¸æ¥")])])),_:1},8,["model","rules"])],64)}}}),sn=ie(on,[["__scopeId","data-v-aa02fb85"]]),an=e=>(b("data-v-d5e92b75"),e=e(),w(),e),ln={class:"newCase-container"},cn={class:"wrap"},dn={class:"illustration"},un={class:"title"},hn={key:1,class:"title"},pn=[an((()=>l("div",null,"åçé®é¢",-1))),an((()=>l("div",null,"AIå©åæºè½çæå¤§çº²",-1)))],fn={key:2,class:"img",src:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/17ea258e05e84df2846a0e1b876ae122.png",alt:"ä¼å½±"},mn={key:3,class:"img_answer",src:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/037fb362d24f440f90a0822efbe7ae94.png",alt:"ä¼å½±"},gn={key:4,class:"foot-tip"},vn={key:0,class:"illustration-tip"},yn=an((()=>l("img",{src:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/9e39db5ed27a413cb5c31c138f63ed7c.png",alt:"ä¼å½±"},null,-1))),bn=an((()=>l("div",{style:{"font-size":"14px"}},"åçé®é¢ï¼èªå¨çæå¤§çº²",-1))),wn={class:"case-form"},xn=ie(r({__name:"index",setup(e){const n=O();let r=D(tn);const d=x((()=>u.value?{title:"æºè½å¨ç»è§é¢",tip:"æ¯æå¤è§è²å¤åºæ¯å建",cla:"img",url:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/17ea258e05e84df2846a0e1b876ae122.png"}:{title:"åçé®é¢",tip:"AIå©åæºè½çæå¤§çº²",cla:"img_answer",url:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/037fb362d24f440f90a0822efbe7ae94.png"})),u=i(!0),h=x((()=>n.meta.isDramaModify)),y=()=>{r.value=P(sn),u.value=!1};o((()=>{t.emit(Se.TRANSFER_SHOW,u.value)}));const b=()=>{r.value=P(tn),u.value=!0};return(e,t)=>(s(),a("div",ln,[l("div",cn,[l("div",dn,[p(u)?v("",!0):(s(),a("div",{key:0,class:"back",onClick:b},[c(Y,{name:"button_return"}),g("è¿å ")])),l("div",un,[l("div",null,m(p(d).title),1),l("div",null,m(p(d).tip),1)]),p(u)?v("",!0):(s(),a("div",hn,pn)),p(u)?(s(),a("img",fn)):v("",!0),p(u)?v("",!0):(s(),a("img",mn)),p(h)?v("",!0):(s(),a("div",gn,[p(u)?(s(),a("div",vn,[yn,bn,l("div",{onClick:y},[c(Y,{name:"button_answer"}),g("ç«å³è¿å
¥ ")])])):v("",!0)]))]),l("div",wn,[(s(),f(L,{include:"FormCreate"},[(s(),f(R(p(r)),{onGoBack:b},null,32))],1024))])])]))}}),[["__scopeId","data-v-d5e92b75"]]);function kn(e){this.content=e}
vendor: 10,183 bytes, line 1
1function _n(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=_n(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function Sn(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=Sn(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}kn.prototype={constructor:kn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new kn(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new kn(n)},addToStart:function(e,t){return new kn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new kn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new kn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=kn.from(e)).size?new kn(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=kn.from(e)).size?new kn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=kn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},kn.from=function(e){if(e instanceof kn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new kn(t)};class Cn{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=l}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new Cn(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new Cn(n,r)}cutByIndex(e,t){return e==t?Cn.empty:0==e&&t==this.content.length?this:new Cn(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new Cn(r,i)}addToStart(e){return new Cn([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Cn(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return _n(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Sn(this,e,t,n)}findIndex(e,t=-1){if(0==e)return On(0,e);if(e==this.size)return On(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?On(n+1,i):On(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return Cn.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Cn(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Cn.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new Cn(t||e,n)}static from(e){if(!e)return Cn.empty;if(e instanceof Cn)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Cn([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Cn.empty=new Cn([],0);const Tn={index:0,offset:0};function On(e,t){return Tn.index=e,Tn.offset=t,Tn}function Mn(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Mn(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Mn(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}let En=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Mn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort(((e,t)=>e.type.rank-t.type.rank)),n}};En.none=[];class An extends Error{}class Nn{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Dn(this.content,e+this.openStart,t);return n&&new Nn(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Nn(In(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Nn.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Nn(Cn.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new Nn(e,n,r)}}function In(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(In(o.content,t-i-1,n-i-1)))}function Dn(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=Dn(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function Rn(e,t,n){if(n.openStart>e.depth)throw new An("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new An("Inconsistent open depths");return Ln(e,t,n,0)}function Ln(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=Ln(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(Cn.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Fn(o,$n(e,i,s,t,r))}{let r=e.parent,i=r.content;return Fn(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return Fn(o,Vn(e,t,r))}function Pn(e,t){if(!t.type.compatibleContent(e.type))throw new An("Cannot join "+t.type.name+" onto "+e.type.n
vendor: 4,989 bytes, line 1
1ame)}function zn(e,t,n){let r=e.node(n);return Pn(r,t.node(n)),r}function Bn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function jn(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Bn(e.nodeAfter,r),o++));for(let a=o;a<s;a++)Bn(i.child(a),r);t&&t.depth==n&&t.textOffset&&Bn(t.nodeBefore,r)}function Fn(e,t){return e.type.checkContent(t),e.copy(t)}function $n(e,t,n,r,i){let o=e.depth>i&&zn(e,t,i+1),s=r.depth>i&&zn(n,r,i+1),a=[];return jn(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(Pn(o,s),Bn(Fn(o,$n(e,t,n,r,i+1)),a)):(o&&Bn(Fn(o,Vn(e,t,i+1)),a),jn(t,n,i,a),s&&Bn(Fn(s,Vn(n,r,i+1)),a)),jn(r,null,i,a),new Cn(a)}function Vn(e,t,n){let r=[];if(jn(null,e,n,r),e.depth>n){Bn(Fn(zn(e,t,n+1),Vn(e,t,n+1)),r)}return jn(t,null,n,r),new Cn(r)}Nn.empty=new Nn(Cn.empty,0,0);class Hn{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i<e;i++)r+=n.child(i).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return En.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Kn(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let o=e;;){let{index:e,offset:t}=o.content.findIndex(i),s=i-t;if(n.push(o,e,r+t),!s)break;if(o=o.child(e),o.isText)break;i=s-1,r+=t+1}return new Hn(t,n,i)}static resolveCached(e,t){let n=qn.get(e);if(n)for(let i=0;i<n.elts.length;i++){let e=n.elts[i];if(e.pos==t)return e}else qn.set(e,n=new Un);let r=n.elts[n.i]=Hn.resolve(e,t);return n.i=(n.i+1)%Wn,r}}class Un{constructor(){this.elts=[],this.i=0}}const Wn=12,qn=new WeakMap;class Kn{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Jn=Object.create(null);let Gn=class e{constructor(e,t,n,r=En.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Cn.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}
vendor: 22,378 bytes, line 1
1textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Mn(this.attrs,t||e.defaultAttrs||Jn)&&En.sameSet(this.marks,n||En.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Nn.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new Nn(a,r.depth-o,i.depth-o)}replace(e,t,n){return Rn(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Hn.resolveCached(this,e)}resolveNoCache(e){return Hn.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Xn(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Cn.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=En.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!En.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Cn.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Gn.prototype.text=void 0;class Zn extends Gn{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Xn(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Zn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Xn(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Yn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Qn(e,t);if(null==n.next)return Yn.empty;let r=er(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(sr(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);sr(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Yn(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(or);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return Cn.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r})).join("\n")}}Yn.empty=new Yn(!0);class Qn{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function er(e){let t=[];do{t.push(tr(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function tr(e){let t=[];do{t.push(nr(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function nr(e){let t=function(e){if(e.eat("(")){let t=er(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let e=n[o];e.groups.indexOf(t)>-1&&i.push(e)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=ir(e,t)}return t}function rr(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function ir(e,t){let n=rr(e),r=n;return e.eat(",")&&(r="}"!=e.next?rr(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function or(e,t){return t-e}function sr(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(or)}function ar(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function lr(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function cr(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let n=e[i];n.validate&&n.validate(t[i])}}function dr(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new hr(e,r,t[r]);return n}let ur=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=dr(e,n.attrs),this.defaultAttrs=ar(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Yn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:lr(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Gn(this,this.computeAttrs(e),Cn.from(t),En.setFrom(n))}createChecked(e=null,t,n){return t=Cn.from(t),this.checkContent(t),new Gn(this,this.computeAttrs(e),t,En.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Cn.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(Cn.empty,!0);return i?new Gn(this,e,t.append(i),En.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){cr(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:En.none:e}static compile(t,n){let r=Object.create(null);t.forEach(((t,i)=>r[t]=new e(t,n,i)));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class hr{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class pr{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=dr(e,r.attrs),this.excluded=null;let i=ar(this.attrs);this.instance=i?new En(this,i):null}create(e=null){return!e&&this.instance?this.instance:new En(this,lr(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new pr(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){cr(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class fr{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=kn.from(e.nodes),t.marks=kn.from(e.marks||{}),this.nodes=ur.compile(this.spec.nodes,this),this.marks=pr.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=n[t]||(n[t]=Yn.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?mr(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:mr(this,t.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(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof ur))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Zn(n,n.defaultAttrs,e,En.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Gn.fromJSON(this,e)}markFromJSON(e){return En.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function mr(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class gr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach((e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new kr(this,t,!1);return n.addAll(e,En.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new kr(this,t,!0);return n.addAll(e,En.none,t.from,t.to),Nn.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(_r(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach((e=>{n(e=Sr(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=Sr(e)),e.node||e.ignore||e.mark||(e.node=r)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new gr(e,gr.schemaRules(e)))}}const vr={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},yr={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},br={ol:!0,ul:!0};function wr(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class xr{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=En.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Cn.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Cn.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Cn.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!vr.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class kr{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=wr(null,t.preserveWhitespace,0)|(n?4:0);r=i?new xr(i.type,i.attrs,En.none,!0,t.topMatch||i.type.contentMatch,o):new xr(n?null:e.schema.topNodeType,null,En.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top;if(2&r.options||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r,i=e.nodeName.toLowerCase();br.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&br.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,n));if(o?o.ignore:yr.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let n,r=this.top,s=this.needsBlock;if(vr.hasOwnProperty(i))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e,t);let a=o&&o.skip?t:this.readStyles(e,t);a&&this.addAll(e,a),n&&this.sync(r),this.needsBlock=s}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,o,n,!1===o.consuming?r:void 0)}}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let e=this.parser.matchedStyles[r],i=n.getPropertyValue(e);if(i)for(let n;;){let r=this.parser.matchStyle(e,i,this,n);if(!r)break;
1if(r.ignore)return null;if(t=r.clearMark?t.filter((e=>!r.clearMark(e))):t.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return t}addElementByRule(e,t,n,r){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e,n)));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t){let n,r;for(let i=this.open;i>=0;i--){let t=this.nodes[i],o=t.findWrapping(e);if(o&&(!n||n.length>o.length)&&(n=o,r=t,!o.length))break;if(t.solid)break}if(!n)return null;this.sync(r);for(let i=0;i<n.length;i++)t=this.enterInner(n[i],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let n=this.findPlace(e,t);if(n){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let r=En.none;for(let i of n.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Cr(i.type,e.type))&&(r=i.addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=wr(e,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=En.none;return n=n.filter((t=>!(o.type?o.type.allowsMarkType(t.type):Cr(t.type,e))||(a=t.addToSet(a),!1))),this.nodes.push(new xr(e,t,a,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;
vendor: 3,198 bytes, line 1
1if(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}}}function _r(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Sr(e){let t={};for(let n in e)t[n]=e[n];return t}function Cr(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class Tr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Mr(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Nr(Mr(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Nr(Mr(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Nr(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Tr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Or(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Or(e.marks)}}function Or(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Mr(e){return e.document||window.document}const Er=new WeakMap;function Ar(e){let t=Er.get(e);return void 0===t&&Er.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}(e)),t}function Nr(e,t,n,r){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let i,o=t[0];if("string"!=typeof o)throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Ar(r))&&i.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,a=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let l=n?e.createElementNS(n,o):e.createElement(o),c=t[1],d=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){d=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?l.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):l.setAttribute(e,c[e])}}for(let u=d;u<t.length;u++){let i=t[u];
vendor: 11,173 bytes, line 1
1if(0===i){if(u<t.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}{let{dom:t,contentDOM:o}=Nr(e,i,n,r);if(l.appendChild(t),o){if(s)throw new RangeError("Multiple content holes");s=o}}}return{dom:l,contentDOM:s}}const Ir=Math.pow(2,16);function Dr(e){return 65535&e}class Rr{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Lr{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Lr.empty)return Lr.empty}recover(e){let t=0,n=Dr(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Ir}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],c=this.ranges[s+o],d=a+l;if(e<=d){let i=a+r+((l?e==a?-1:e==d?1:t:t)<0?0:c);if(n)return i;let o=e==(t<0?a:d)?null:s/3+(e-a)*Ir,u=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(u|=8),new Rr(i,u,o)}r+=c-l}return n?e+r:new Rr(e+r,0,null)}touches(e,t){let n=0,r=Dr(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l}}invert(){return new Lr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Lr.empty:new Lr(e<0?[0,-e,0]:[0,0,e])}}Lr.empty=new Lr([]);class Pr{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new Pr(this.maps,this.mirror,e,t)}copy(){return new Pr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new Pr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new Rr(e,r,null)}}const zr=Object.create(null);class Br{getMap(){return Lr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=zr[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in zr)throw new RangeError("Duplicate use of step JSON ID "+e);return zr[e]=t,t.prototype.jsonID=e,t}}class jr{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new jr(e,null)}static fail(e){return new jr(null,e)}static fromReplace(e,t,n,r){try{return jr.ok(e.replace(t,n,r))}catch(i){if(i instanceof An)return jr.fail(i.message);throw i}}}function Fr(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Fr(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return Cn.fromArray(r)}class $r extends Br{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new Nn(Fr(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return jr.fromReplace(e,this.from,this.to,i)}invert(){return new Vr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new $r(t.pos,n.pos,this.mark)}merge(e){return e instanceof $r&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new $r(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new $r(t.from,t.to,e.markFromJSON(t.mark))}}Br.jsonID("addMark",$r);class Vr extends Br{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Nn(Fr(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return jr.fromReplace(e,this.from,this.to,n)}invert(){return new $r(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Vr(t.pos,n.pos,this.mark)}merge(e){return e instanceof Vr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vr(t.from,t.to,e.markFromJSON(t.mark))}}Br.jsonID("removeMark",Vr);class Hr extends Br{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return jr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return jr.fromReplace(e,this.pos,this.pos+1,new Nn(Cn.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new Hr(this.pos,t.marks[n]);return new Hr(this.pos,this.mark)}}return new Ur(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Hr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Hr(t.pos,e.markFromJSON(t.mark))}}Br.jsonID("addNodeMark",Hr);class Ur extends Br{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return jr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return jr.fromReplace(e,this.pos,this.pos+1,new Nn(Cn.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Hr(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ur(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ur(t.pos,e.markFromJSON(t.mark))}}Br.jsonID("removeNodeMark",Ur);class Wr extends Br{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Kr(e,this.from,this.to)?jr.fail("Structure replace would overwrite content"):jr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Lr([this.from,this.to-this.from,this.slice.size])}invert(e){return new Wr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Wr(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Wr)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?Nn.empty:new Nn(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Wr(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?Nn.empty:new Nn(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Wr(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Wr(t.from,t.to,Nn.fromJSON(e,t.slice),!!t.structure)}}Br.jsonID("replace",Wr);class qr extends Br{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Kr(e,this.from,this.gapFrom)||Kr(e,this.gapTo,this.to)))return jr.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return jr.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?jr.fromReplace(e,this.from,this.to,n):jr.fail("Content does not fit in gap")}getMap(){return new Lr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new qr(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new qr(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new qr(t.from,t.to,t.gapFrom,t.gapTo,Nn.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Kr(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>
vendor: 10,951 bytes, line 1
10&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Jr(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l<o.childCount;l++){let t=o.child(l),c=a+t.nodeSize,d=r.matchType(t.type);if(d){r=d;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new Vr(a,c,t.marks[r]));if(i&&t.isText&&"pre"!=n.whitespace){let e,r,i=/\r?\n|\r/g;for(;e=i.exec(t.text);)r||(r=new Nn(Cn.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),s.push(new Wr(a+e.index,a+e.index+e[0].length,r))}}else s.push(new Wr(a,c,Nn.empty));a=c}if(!r.validEnd){let t=r.fillBefore(Cn.empty,!0);e.replace(a,a,new Nn(t,0,0))}for(let l=s.length-1;l>=0;l--)e.step(s[l])}function Gr(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Zr(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!Gr(r,i,o))break}return null}function Xr(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(Yr).concat({type:t,attrs:n}).concat(o.map(Yr)):null}function Yr(e){return{type:e,attrs:null}}function Qr(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=n-2;c>o;c--,d--){let e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[d+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let s=r&&r[d]||e;if(!e.canReplace(t+1,e.childCount)||!s.type.validContent(n))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function ei(e,t){let n=e.resolve(t),r=n.index();return ti(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ti(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function ni(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let e,o,s=r.index(i);if(i==r.depth?(e=r.nodeBefore,o=r.nodeAfter):n>0?(e=r.node(i+1),s++,o=r.node(i).maybeChild(s)):(e=r.node(i).maybeChild(s-1),o=r.node(i+1)),e&&!e.isTextblock&&ti(e,o)&&r.node(i).canReplace(s,s+1))return t;if(0==i)break;t=n<0?r.before(i):r.after(i)}}function ri(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(0==n.openStart&&n.size?2:1);o++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),a=!1;if(1==o)a=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(n,n,e[0])}if(a)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}function ii(e,t,n=t,r=Nn.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return oi(i,o,r)?new Wr(t,n,r):new si(i,o,r).fit()}function oi(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Br.jsonID("replaceAround",qr);class si{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Cn.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=Cn.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new Nn(i,o,s);return e>-1?new qr(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Wr(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=ci(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let o=this.depth;o>=0;o--){let e,{type:s,match:a}=this.frontier[o],l=null;if(1==t&&(i?a.matchType(i.type)||(l=a.fillBefore(Cn.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:l};if(2==t&&i&&(e=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:e};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ci(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Nn(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ci(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new Nn(ai(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new Nn(ai(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,c=[],{match:d,type:u}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let h=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=d.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(d=t,c.push(di(e.mark(u.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=li(this.placed,t,Cn.from(c)),this.frontier[t].match=d,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=p?0==e?Nn.empty:new Nn(ai(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new Nn(ai(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!ui(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=ui(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ui(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=li(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=li(this.placed,this.depth,Cn.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Cn.empty,!0);e.childCount&&(this.placed=li(this.placed,this.frontier.length,e))}}function ai(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ai(e.firstChild.content,t-1,n)))}function li(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(li(e.lastChild.content,t-1,n)))}function ci(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function di(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,di(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Cn.empty,!0)))),e.copy(r)}function ui(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function hi(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(hi(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Cn.empty,!0))}return e}function pi(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}class fi extends Br{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return jr.fail("No node at attribute step's position");let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return jr.fromReplace(e,this.pos,this.pos+1,new Nn(Cn.from(r),0,t.isLeaf?0:1))}getMap(){return Lr.empty}invert(e){return new fi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new fi(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new fi(t.pos,t.attr,t.value)}}Br.jsonID("attr",fi);class mi extends Br{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return jr.ok(n)}getMap(){return Lr.empty}invert(e){return new mi(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new mi(t.attr,t.value)}}Br.jsonID("docAttr",mi);
vendor: 19,596 bytes, line 1
1let gi=class extends Error{};gi=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(gi.prototype=Object.create(Error.prototype)).constructor=gi,gi.prototype.name="TransformError";class vi{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Pr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gi(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Nn.empty){let r=ii(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Nn(Cn.from(n),0,0))}delete(e,t){return this.replace(e,t,Nn.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(oi(i,o,r))return e.step(new Wr(t,n,r));let s=pi(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let p=i.depth,f=i.pos-1;p>0;p--,f--){let e=i.node(p).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(p)>-1?a=p:i.before(p)==f&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],d=r.openStart;for(let p=r.content,f=0;;f++){let e=p.firstChild;if(c.push(e),f==r.openStart)break;p=e.content}for(let p=d-1;p>=0;p--){let e=c[p],t=(u=e.type).spec.defining||u.spec.definingForContent;if(t&&!e.sameMarkup(i.node(Math.abs(a)-1)))d=p;else if(t||!e.type.isTextblock)break}var u;for(let p=r.openStart;p>=0;p--){let t=(p+d+1)%(r.openStart+1),a=c[t];if(a)for(let c=0;c<s.length;c++){let d=s[(c+l)%s.length],u=!0;d<0&&(u=!1,d=-d);let h=i.node(d-1),p=i.index(d-1);if(h.canReplaceWith(p,p,a.type,a.marks))return e.replace(i.before(d),u?o.after(d):n,new Nn(hi(r.content,0,r.openStart,t),t,r.openEnd))}}let h=e.steps.length;for(let p=s.length-1;p>=0&&(e.replace(t,n,r),!(e.steps.length>h));p--){let e=s[p];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e<r.node(i).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new Nn(Cn.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=pi(r,i);for(let s=0;s<o.length;s++){let t=o[s],n=s==o.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),i.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,d=Cn.empty,u=0;for(let f=o,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,d=Cn.from(r.node(f).copy(d)),u++):l--;let h=Cn.empty,p=0;for(let f=o,m=!1;f>n;f--)m||i.after(f+1)<i.end(f)?(m=!0,h=Cn.from(i.node(f).copy(h)),p++):c++;e.step(new qr(l,c,s,a,new Nn(d.append(h),u,p),d.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Wr(t-n,t+n,Nn.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Cn.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let e=n[s].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Cn.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new qr(i,o,i,o,new Nn(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{let s="function"==typeof i?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,s)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}!1===i&&function(e,t,n,r){t.forEach(((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}}))}(e,t,n,o),Jr(e,e.mapping.slice(o).map(n,1),r,void 0,null===i);let a=e.mapping.slice(o),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new qr(l,c,l+1,c-1,new Nn(Cn.from(r.create(s,null,t.marks)),0,0),1,!0)),!0===i&&function(e,t,n,r){t.forEach(((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}}))}(e,t,n,o),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new qr(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Nn(Cn.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new fi(e,t,n)),this}setDocAttribute(e,t){return this.step(new mi(e,t)),this}addNodeMark(e,t){return this.step(new Hr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof En)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Ur(e,t)),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=Cn.empty,s=Cn.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=Cn.from(i.node(a).copy(o));let e=r&&r[c];s=Cn.from(e?e.type.create(e.attrs,s):i.node(a).copy(s))}e.step(new Wr(t,t,new Nn(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let d=e.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),h=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(h)||(i&&i.to==c&&i.mark.eq(d[e])?i.to=u:s.push(i=new Vr(c,u,d[e])));o&&o.to==c?o.to=u:a.push(o=new $r(c,u,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof pr){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new Vr(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return Jr(this,e,t,n),this}}const yi=Object.create(null);class bi{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new wi(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Nn.empty){let n=t.content.lastChild,r=null;for(let s=0;s<t.openEnd;s++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),s?Nn.empty:t),0==s&&Ai(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),Ai(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new _i(e):Ei(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let i=e.depth-1;i>=0;i--){let r=t<0?Ei(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Ei(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Oi(e.node(0))}static atStart(e){return Ei(e,e,0,0,1)||new Oi(e)}static atEnd(e){return Ei(e,e,e.content.size,e.childCount,-1)||new Oi(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=yi[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in yi)throw new RangeError("Duplicate use of selection JSON ID "+e);return yi[e]=t,t.prototype.jsonID=e,t}getBookmark(){return _i.between(this.$anchor,this.$head).getBookmark()}}bi.prototype.visible=!0;class wi{constructor(e,t){this.$from=e,this.$to=t}}let xi=!1;function ki(e){xi||e.parent.inlineContent||(xi=!0)}class _i extends bi{constructor(e,t=e){ki(e),ki(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return bi.near(n);let r=e.resolve(t.map(this.anchor));return new _i(r.parent.inlineContent?r:n,n)}replace(e,t=Nn.empty){if(super.replace(e,t),t==Nn.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof _i&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Si(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new _i(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=bi.findFrom(t,n,!0)||bi.findFrom(t,-n,!0);if(!e)return bi.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(bi.findFrom(e,-n,!0)||bi.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new _i(e,t)}}bi.jsonID("text",_i);class Si{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Si(e.map(this.anchor),e.map(this.head))}resolve(e){return _i.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ci extends bi{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?bi.near(i):new Ci(i)}content(){return new Nn(Cn.from(this.node),0,0)}eq(e){return e instanceof Ci&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ti(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ci(e.resolve(t.anchor))}static create(e,t){return new Ci(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Ci.prototype.visible=!1,bi.jsonID("node",Ci);class Ti{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Si(n,n):new Ti(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ci.isSelectable(n)?new Ci(t):bi.near(t)}}class Oi extends bi{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Nn.empty){if(t==Nn.empty){e.delete(0,e.doc.content.size);let t=bi.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Oi(e)}map(e){return new Oi(e)}eq(e){return e instanceof Oi}getBookmark(){return Mi}}bi.jsonID("all",Oi);const Mi={map(){return this},resolve:e=>new Oi(e)};function Ei(e,t,n,r,i,o=!1){if(t.inlineContent)return _i.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&Ci.isSelectable(r))return Ci.create(e,n-(i<0?r.nodeSize:0))}else{let t=Ei(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function Ai(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Wr||o instanceof qr)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(bi.near(e.doc.resolve(i),n)))}class Ni extends vi{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return En.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||En.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(bi.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Ii(e,t){return t&&e?e.bind(t):e}class Di{constructor(e,t,n){this.name=e,this.init=Ii(t.init,n),this.apply=Ii(t.apply,n)}}const Ri=[new Di("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Di("selection",{init:(e,t)=>e.selection||bi.atStart(t.doc),apply:e=>e.selection}),new Di("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Di("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Li{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ri.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Di(e.key,e.spec.state,e))}))}}class Pi{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Pi(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new Ni(this)}static create(e){let t=new Li(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Pi(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new Li(this.schema,e.plugins),n=t.fields,r=new Pi(t);for(let i=0;i<n.length;i++){let t=n[i].name;r[t]=this.hasOwnProperty(t)?this[t]:n[i].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new Li(e.schema,e.plugins),i=new Pi(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=Gn.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=bi.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function zi(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=zi(i,t,{})),n[r]=i}return n}class Bi{constructor(e){this.spec=e,this.props={},e.props&&zi(e.props,this,this.props),this.key=e.key?e.key.key:Fi("plugin")}getState(e){return e[this.key]}}const ji=Object.create(null);function Fi(e){return e in ji?e+"$"+ ++ji[e]:(ji[e]=0,e+"$")}class $i{constructor(e="key"){this.key=Fi(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Vi=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Hi=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Ui=null;const Wi=function(e,t,n){let r=Ui||(Ui=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},qi=function(e,t,n,r){return n&&(Ji(e,t,n,r,-1)||Ji(e,t,n,r,1))},Ki=/^(img|br|input|textarea|hr)$/i;function Ji(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;
vendor: 4,121 bytes, line 1
1if(t==(i<0?0:Gi(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Zi(e)||Ki.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Vi(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Gi(e):0}}}function Gi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Zi(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Xi=function(e){return e.focusNode&&qi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Yi(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Qi="undefined"!=typeof navigator?navigator:null,eo="undefined"!=typeof document?document:null,to=Qi&&Qi.userAgent||"",no=/Edge\/(\d+)/.exec(to),ro=/MSIE \d/.exec(to),io=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(to),oo=!!(ro||io||no),so=ro?document.documentMode:io?+io[1]:no?+no[1]:0,ao=!oo&&/gecko\/(\d+)/i.test(to);ao&&(/Firefox\/(\d+)/.exec(to)||[0,0])[1];const lo=!oo&&/Chrome\/(\d+)/.exec(to),co=!!lo,uo=lo?+lo[1]:0,ho=!oo&&!!Qi&&/Apple Computer/.test(Qi.vendor),po=ho&&(/Mobile\/\w+/.test(to)||!!Qi&&Qi.maxTouchPoints>2),fo=po||!!Qi&&/Mac/.test(Qi.platform),mo=!!Qi&&/Win/.test(Qi.platform),go=/Android \d/.test(to),vo=!!eo&&"webkitFontSmoothing"in eo.documentElement.style,yo=vo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function bo(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function wo(e,t){return"number"==typeof e?e:e[t]}function xo(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function ko(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Hi(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?bo(o):xo(e),l=0,c=0;if(t.top<a.top+wo(r,"top")?c=-(a.top-t.top+wo(i,"top")):t.bottom>a.bottom-wo(r,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+wo(i,"top")-a.top:t.bottom-a.bottom+wo(i,"bottom")),t.left<a.left+wo(r,"left")?l=-(a.left-t.left+wo(i,"left")):t.right>a.right-wo(r,"right")&&(l=t.right-a.right+wo(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function _o(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Hi(r));return t}function So(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Co=null;function To(e,t){let n,r,i,o,s=2e8,a=0,l=t.top,c=t.top;for(let d=e.firstChild,u=0;d;d=d.nextSibling,u++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=Wi(d).getClientRects()}for(let h=0;h<e.length;h++){let p=e[h];if(p.top<=l&&p.bottom>=c){l=Math.max(p.bottom,l),c=Math.min(p.top,c);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=d,s=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==d.nodeType&&e&&(a=u+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!i&&p.left<=t.left&&p.right>=t.left&&(i=d,o={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=u+1)}}return!n&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=No(r,1);if(n.top!=n.bottom&&Oo(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:To(n,r)}function Oo(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>
vendor: 5,081 bytes, line 1
1=t.top-1&&e.top<=t.bottom+1}function Mo(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Oo(t,i))return Mo(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function Eo(e,t){let n,r=e.dom.ownerDocument,i=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(r){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}(r,t.left,t.top);o&&({node:n,offset:i}=o);let s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!Oo(t,n))return null;if(a=Mo(e.dom,t,n),!a)return null}if(ho)for(let c=a;n&&c;c=Hi(c))c.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(ao&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}let r;vo&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&(!s&&e.left>r.left||e.top>r.top?i=t.posBefore:(!s&&e.right<r.left||e.bottom<r.top)&&(i=t.posAfter),s=!0),!t.contentDOM&&i<0&&!t.node.isText)return(t.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?t.posBefore:t.posAfter}o=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==s&&(s=function(e,t,n){let{node:r,offset:i}=To(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function Ao(e){return e.top<e.bottom||e.left<e.right}function No(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Ao(e))return e}return Array.prototype.find.call(n,Ao)||e.getBoundingClientRect()}const Io=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Do(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=vo||ao;if(3==r.nodeType){if(!s||!Io.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,Ro(No(Wi(r,e,t),o),o<0)}{let e=No(Wi(r,i,i),n);if(ao&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=No(Wi(r,i-1,i-1),-1);if(t.top==e.top){let n=No(Wi(r,i,i+1),-1);if(n.top!=e.top)return Ro(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==Gi(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return Lo(e.getBoundingClientRect(),!1)}if(null==o&&i<Gi(r)){let e=r.childNodes[i];if(1==e.nodeType)return Lo(e.getBoundingClientRect(),!0)}return Lo(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==Gi(r))){let e=r.childNodes[i-1],t=3==e.nodeType?Wi(e,Gi(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Ro(No(t,1),!1)}if(null==o&&i<Gi(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Wi(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Ro(No(t,-1),!0)}return Ro(No(3==r.nodeType?Wi(r):r,-n),n>=0)}function Ro(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Lo(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Po(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const zo=/[\u0590-\u08ac]/;let Bo=null,jo=null,Fo=!1;function $o(e,t,n){return Bo==t&&jo==n?Fo:(Bo=t,jo=n,Fo="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return Po(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Do(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Wi(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}
vendor: 27,589 bytes, line 1
1(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return a?zo.test(r.parent.textContent)&&a.modify?Po(e,t,(()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:u}=e.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&i==u;try{a.collapse(o,s),t&&(t!=o||i!=s)&&a.extend&&a.extend(t,i)}catch(p){}return null!=l&&(a.caretBidiLevel=l),h})):"left"==n||"backward"==n?o:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}class Vo{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Vi(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let i=0;n<this.children.length;n++){let t=this.children[n],o=i+t.size;if(o>e||t instanceof Go){r=e-i;break}i=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof Ho&&i.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Vi(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Vi(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Vi(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Vi(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let s=this.children[h],a=p+s.size;if(i>p&&o<a)return s.setSelection(e-p-s.border,t-p-s.border,n,r);p=a}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((ao||ho)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(s=a={node:n.parentNode,offset:Vi(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(ao&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&ho)&&qi(s.node,s.offset,l.anchorNode,l.anchorOffset)&&qi(a.node,a.offset,l.focusNode,l.focusOffset))return;let d=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),d=!0}catch(u){}}if(!d){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Ho extends Vo{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Uo extends Vo{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Wo extends Vo{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=Tr.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Wo(e,t,o.dom,o.contentDOM||o.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(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=Wo.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=cs(i,t,o,n)),e>0&&(i=cs(i,0,e,n));for(let s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r}}class qo extends Vo{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=l&&l.dom,d=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=Tr.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:d}=e)}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=rs(c,n,t),l?s=new Zo(e,t,n,r,c,d||null,u,l,i,o+1):t.isText?new Jo(e,t,n,r,c,u,i):new qo(e,t,n,r,c,d||null,u,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Cn.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&is(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new as(this,o&&o.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,u,h,p;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(d?(u||(u=[d])).push(e):d=e)}if(d)if(u){u.sort(ls);for(let e=0;e<u.length;e++)n(u[e],c,!!l)}else n(d,c,!!l);if(l)p=-1,h=l,l=null;else{if(!(c<e.childCount))break;p=c,h=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let f=o+h.nodeSize;if(h.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=h.cut(e-o),h=h.cut(0,e-o),f=e,p=-1)}else for(;s<i.length&&i[s].to<f;)s++;r(h,h.isInline&&!h.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(o,h),p),o=f}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?En.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,c)=>{let d;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,d,e)||a.updateNextNode(t,o,l,e,c,r)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),Xo(this.contentDOM,this.children,e),po&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof _i)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,o=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){if(o>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return o<0?null:{node:i,pos:o,text:e}}return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;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 o=new Uo(this,i,t,r);e.input.compositionNodes.push(o),this.children=cs(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(is(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ts(this.dom,this.nodeDOM,es(this.outerDeco,this.node,t),es(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.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 Ko(e,t,n,r,i){rs(r,t,e);let o=new qo(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Jo extends qo{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Jo(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Go extends Vo{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Zo extends qo{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Xo(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=ss(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof Wo){let t=r?r.previousSibling:e.lastChild;Xo(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=ss(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Yo=function(e){e&&(this.nodeName=e)};Yo.prototype=Object.create(null);const Qo=[new Yo];function es(e,t,n){if(0==e.length)return Qo;let r=n?Qo[0]:new Yo,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Yo(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Yo(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function ts(e,t,n,r){if(n==Qo&&r==Qo)return t;let i=t;for(let o=0;o<r.length;o++){let t=r[o],s=n[o];if(o){let n;s&&s.nodeName==t.nodeName&&i!=e&&(n=i.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(i),s=Qo[0]),i=n}ns(i,s||Qo[0],t)}return i}function ns(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function rs(e,t,n){return ts(e,e,Qo,es(t,n,1!=e.nodeType))}function is(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ss(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class as{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Wo)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Wo.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let r=this.top.children[s];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=s;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof qo){let l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;let c,d=a.dom,u=this.isLocked(d)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&is(t,a.outerDeco));if(!u&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(a,e,t,n,r,o)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=qo.create(this.top,t,n,r,i,o);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,i){let o=qo.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Ho(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Wo;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Jo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ho||co)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Go(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function ls(e,t){return e.type.side-t.type.side}function cs(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,d=a+=l.size;c>=n||d<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),d>n&&o.push(l.slice(n-c,l.size,r)))}return o}function ds(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Xi(n)){for(a=c;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&Ci.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Gi(e);r||i;){if(e==n)return!0;let t=Vi(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Gi(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Ci(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=bs(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function us(e){return e.editable?e.hasFocus():xs(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function hs(e,t=!1){let n=e.state.selection;if(vs(e,n),us(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&co){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&qi(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange();if(!t)return;let r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setStart(r.parentNode,Vi(r)+1):n.setStart(r,0);n.collapse(!0),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&oo&&so<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!ps||n instanceof _i||(n.$from.parent.inlineContent||(r=fs(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=fs(e,n.to))),e.docView.setSelection(o,s,e.root,t),ps&&(r&&gs(r),i&&gs(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{us(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const ps=ho||co&&uo<63;function fs(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(ho&&i&&"false"==i.contentEditable)return ms(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return ms(i);if(o)return ms(o)}}function ms(e){return e.contentEditable="true",ho&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function gs(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function vs(e,t){if(t instanceof Ci){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ys(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ys(e)}function ys(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function bs(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||_i.between(t,n,r)}function ws(e){return!(e.editable&&!e.hasFocus())&&xs(e)}function xs(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function ks(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&bi.findFrom(o,t)}function _s(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ss(e,t,n){let r=e.state.selection;if(!(r instanceof _i)){if(r instanceof Ci&&r.node.isInline)return _s(e,new _i(t>0?r.$to:r.$from));{let n=ks(e.state,t);
vendor: 4,224 bytes, line 1
1return!!n&&_s(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return _s(e,new _i(r.$anchor,o))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=ks(e.state,t);return!!(n&&n instanceof Ci)&&_s(e,n)}if(!(fo&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Ci.isSelectable(o)?_s(e,new Ci(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!vo&&_s(e,new _i(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Cs(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ts(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Os(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;ao&&1==n.nodeType&&r<Cs(n)&&Ts(n.childNodes[r],-1)&&(s=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Ts(e,-1))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Ms(n))break;{let t=n.previousSibling;for(;t&&Ts(t,-1);)i=n.parentNode,o=Vi(t),t=t.previousSibling;if(t)n=t,r=Cs(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Es(e,n,r):i&&Es(e,i,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=Cs(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Ts(n.childNodes[r],1))break;i=n,o=++r}else{if(Ms(n))break;{let t=n.nextSibling;for(;t&&Ts(t,1);)i=t.parentNode,o=Vi(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=Cs(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&Es(e,i,o)}(e)}function Ms(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Es(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Zi(e);)t=Vi(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Zi(e);)t=Vi(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Xi(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&hs(e)}),50)}function As(e,t){let n=e.state.doc.resolve(t);if(!co&&!mo&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Ns(e,t,n){let r=e.state.selection;if(r instanceof _i&&!r.empty||n.indexOf("s")>-1)return!1;if(fo&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ks(e.state,t);if(n&&n instanceof Ci)return _s(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof Oi?bi.near(n,t):bi.findFrom(n,t);return!!s&&_s(e,s)}return!1}function Is(e,t){if(!(e.state.selection instanceof _i))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function Ds(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Rs(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||fo&&72==n&&"c"==r)return Is(e,-1)||Os(e,-1);if(46==n&&!t.shiftKey||fo&&68==n&&"c"==r)return Is(e,1)||Os(e,1);if(13==n||27==n)return!0;
vendor: 46,729 bytes, line 1
1if(37==n||fo&&66==n&&"c"==r){let t=37==n?"ltr"==As(e,e.state.selection.from)?-1:1:-1;return Ss(e,t,r)||Os(e,t)}if(39==n||fo&&70==n&&"c"==r){let t=39==n?"ltr"==As(e,e.state.selection.from)?1:-1:1;return Ss(e,t,r)||Os(e,t)}return 38==n||fo&&80==n&&"c"==r?Ns(e,-1,r)||Os(e,-1):40==n||fo&&78==n&&"c"==r?function(e){if(!ho||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Ds(e,n,"true"),setTimeout((()=>Ds(e,n,"false")),20)}return!1}(e)||Ns(e,1,r)||Os(e,1):r==(fo?"m":"c")&&(66==n||73==n||89==n||90==n)}function Ls(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Tr.fromSchema(e.state.schema),a=Ws(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,d=l.firstChild,u=0;for(;d&&1==d.nodeType&&(c=Hs[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),u++}d=l.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${i} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function Ps(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(n=>{t=n(t,a||r,e)})),a)return t?new Nn(Cn.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):Nn.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,i,r,e)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=Tr.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Ws().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Hs[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),vo&&function(e){let t=e.querySelectorAll(co?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&"Â "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||gr.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!d),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||zs.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(a){return e}let{content:i,openStart:o,openEnd:s}=e;for(let l=n.length-2;l>=0;l-=2){let e=r.nodes[n[l]];if(!e||e.hasRequiredAttrs())break;i=Cn.from(e.create(n[l+1],i)),o++,s++}return new Nn(i,o,s)}(Vs(s,+d[1],+d[2]),d[4]);else if(s=Nn.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&js(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Fs(o[o.length-1],r.length));let t=Bs(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return Cn.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e<s.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=s.content.lastChild;t<s.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);s=Vs(s,e,t)}return e.someProp("transformPasted",(t=>{s=t(s,e)})),s}const zs=/^(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 Bs(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Cn.from(e));return e}function js(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=js(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(Cn.from(Bs(n,e,i+1))))}}function Fs(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Fs(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Cn.empty,!0);return e.copy(n.append(r))}function $s(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=$s(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Cn.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Vs(e,t,n){return t<e.openStart&&(e=new Nn($s(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Nn($s(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Hs={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Us=null;function Ws(){return Us||(Us=document.implementation.createHTMLDocument("title"))}const qs={},Ks={},Js={touchstart:!0,touchmove:!0};class Gs{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Zs(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Xs(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Ys(e,t))}))}function Ys(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Qs(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function ea(e){return{left:e.clientX,top:e.clientY}}function ta(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,(t=>s>o.depth?t(e,n,o.nodeAfter,o.before(s),i,!0):t(e,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function na(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function ra(e,t,n,r,i){return ta(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof Ci&&(n=i.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let e=s>o.depth?o.nodeAfter:o.node(s);if(Ci.isSelectable(e)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(na(e,Ci.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Ci.isSelectable(r))&&(na(e,new Ci(n),"pointer"),!0)}(e,n))}function ia(e,t,n,r){return ta(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function oa(e,t,n,r){return ta(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(na(e,_i.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let t=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(t.inlineContent)na(e,_i.create(r,n+1,n+1+t.content.size),"pointer");else{if(!Ci.isSelectable(t))continue;na(e,Ci.create(r,n),"pointer")}return!0}}(e,n,r)}function sa(e){return fa(e)}Ks.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!ca(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!go||!co||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!po||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Rs(e,n)?n.preventDefault():Zs(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,Yi(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Ks.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Ks.keypress=(e,t)=>{let n=t;if(ca(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||fo&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof _i&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const aa=fo?"metaKey":"ctrlKey";qs.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=sa(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[aa]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(ea(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new la(e,s,n,!!r)):("doubleClick"==o?ia:oa)(e,s.pos,s.inside,n)?n.preventDefault():Zs(e,"pointer"))};class la{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[aa],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.dom.nodeType?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof Ci&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!ao||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Zs(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>hs(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ea(e))),this.updateAllowDefault(e),this.allowDefault||!t?Zs(this.view,"pointer"):ra(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||ho&&this.mightDrag&&!this.mightDrag.node.isAtom||co&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(na(this.view,bi.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Zs(this.view,"pointer")}move(e){this.updateAllowDefault(e),Zs(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function ca(e,t){return!!e.composing||!!(ho&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}qs.touchstart=e=>{e.input.lastTouch=Date.now(),sa(e),Zs(e,"pointer")},qs.touchmove=e=>{e.input.lastTouch=Date.now(),Zs(e,"pointer")},qs.contextmenu=e=>sa(e);const da=go?5e3:-1;function ua(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>fa(e)),t))}function ha(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function pa(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=Gi(e=e.childNodes[t-1])}else{if(!e.parentNode||Zi(e))return null;t=Vi(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||Zi(e))return null;t=Vi(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function fa(e,t=!1){if(!(go&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ha(e),t||e.docView&&e.docView.dirty){let n=ds(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||e.state.selection.empty?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}Ks.compositionstart=Ks.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof _i&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),fa(e,!0),e.markCursor=null;else if(fa(e,!t.selection.empty),ao&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}ua(e,da)},Ks.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,ua(e,20))};const ma=oo&&so<15||po&&yo<604;function ga(e,t,n,r,i){let o=Ps(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,o||Nn.empty))))return!0;if(!o)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function va(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}qs.copy=Ks.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=ma?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ls(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Ks.paste=(e,t)=>{let n=t;if(e.composing&&!go)return;let r=ma?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&ga(e,va(r),r.getData("text/html"),i,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ga(e,r.value,null,i,t):ga(e,r.textContent,r.innerHTML,i,t)}),50)}(e,n)};class ya{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const ba=fo?"altKey":"ctrlKey";qs.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,o=e.state.selection,s=o.empty?null:e.posAtCoords(ea(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof Ci?o.to-1:o.to));else if(r&&r.mightDrag)i=Ci.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(i=Ci.create(e.state.doc,t.posBefore))}let a=(i||e.state.selection).content(),{dom:l,text:c,slice:d}=Ls(e,a);(!n.dataTransfer.files.length||!co||uo>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ma?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ma||n.dataTransfer.setData("text/plain",c),e.dragging=new ya(d,!n[ba],i)},qs.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Ks.dragover=Ks.dragenter=(e,t)=>t.preventDefault(),Ks.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(ea(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",(t=>{s=t(s,e)})):s=Ps(e,va(n.dataTransfer),ma?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[ba]);if(e.someProp("handleDrop",(t=>t(e,n,s||Nn.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?ri(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=e.state.tr;if(a){let{node:e}=r;e?e.replace(c):c.deleteSelection()}let d=c.mapping.map(l),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,h=c.doc;if(u?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(h))return;let p=c.doc.resolve(d);if(u&&Ci.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ci(p));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(bs(e,p,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},qs.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&hs(e)}),20))},qs.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},qs.beforeinput=(e,t)=>{if(co&&go&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,Yi(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in Ks)qs[os]=Ks[os];function wa(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class xa{constructor(e,t){this.toDOM=e,this.spec=t||Ta,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new Sa(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof xa&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&wa(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ka{constructor(e,t){this.attrs=e,this.spec=t||Ta}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Sa(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof ka&&wa(this.attrs,e.attrs)&&wa(this.spec,e.spec)}static is(e){return e.type instanceof ka}destroy(){}}class _a{constructor(e,t){this.attrs=e,this.spec=t||Ta}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new Sa(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof _a&&wa(this.attrs,e.attrs)&&wa(this.spec,e.spec)}destroy(){}}class Sa{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Sa(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Sa(e,e,new xa(t,n))}static inline(e,t,n,r){return new Sa(e,t,new ka(n,r))}static node(e,t,n,r){return new Sa(e,t,new _a(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof ka}get widget(){return this.type instanceof xa}}const Ca=[],Ta={};class Oa{constructor(e,t){this.local=e.length?e:Ca,this.children=t.length?t:Ca}static create(e,t){return t.length?Da(t,e,0,Ta):Ma}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==Ma||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Ta)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let c=0,d=o;c<n.maps.length;c++){let e=0;n.maps[c].forEach(((t,n,r,i)=>{let o=i-r-(n-t);for(let s=0;s<a.length;s+=3){let r=a[s+1];if(r<0||t>r+d-e)continue;let i=a[s]+d-e;n>=i?a[s+1]=t<=i?-2:-1:t>=d&&o&&(a[s]+=o,a[s+1]+=o)}e+=o})),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(-2==a[c+1]){l=!0,a[c+1]=-1;continue}let t=n.map(e[c]+o),d=t-i;if(d<0||d>=r.content.size){l=!0;continue}let u=n.map(e[c+1]+o,-1)-i,{index:h,offset:p}=r.content.findIndex(d),f=r.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let r=a[c+2].mapInner(n,f,t+1,e[c]+o+1,s);r!=Ma?(a[c]=d,a[c+1]=u,a[c+2]=r):(a[c+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let l=0;l<e.length;l+=3)-1==e[l+1]&&a(e[l+2],t[l]+o+1);return n}(a,e,t,n,i,o,s),c=Da(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Oa(t.sort(Ra),a)}(this.children,o||[],e,t,n,r,i):o?new Oa(o.sort(Ra),Ca):Ma}add(e,t){return t.length?this==Ma?Oa.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=Na(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,Da(s,e,a+1,Ta)),i+=3}}));let o=Aa(i?Ia(t):t,-n);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||o.splice(s--,1);return new Oa(o.length?this.local.concat(o).sort(Ra):this.local,r||this.children)}remove(e){return 0==e.length||this==Ma?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(r,o+1);a!=Ma?n[i+2]=a:(n.splice(i,3),i-=3)}if(r.length)for(let i,o=0;o<e.length;o++)if(i=e[o])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Oa(r,n):Ma}forChild(e,t){if(this==Ma)return this;if(t.isLeaf)return Oa.empty;let n,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(n=this.children[s+2]);break}let i=e+1,o=i+t.content.size;for(let s=0;s<this.local.length;s++){let e=this.local[s];if(e.from<o&&e.to>i&&e.type instanceof ka){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let e=new Oa(r.sort(Ra),Ca);return n?new Ea([e,n]):e}return n||Ma}eq(e){if(this==e)return!0;if(!(e instanceof Oa)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return La(this.localsInner(e))}localsInner(e){if(this==Ma)return Ca;if(e.inlineContent||!this.local.some(ka.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof ka||t.push(this.local[n]);return t}}Oa.empty=new Oa([],[]),Oa.removeOverlap=La;const Ma=Oa.empty;class Ea{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Ta)));return Ea.from(n)}forChild(e,t){if(t.isLeaf)return Oa.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=Ma&&(i instanceof Ea?n=n.concat(i.members):n.push(i))}return Ea.from(n)}eq(e){if(!(e instanceof Ea)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?La(n?t:t.sort(Ra)):Ca}static from(e){switch(e.length){case 0:return Ma;case 1:return e[0];default:return new Ea(e.every((e=>e instanceof Oa))?e:e.reduce(((e,t)=>e.concat(t instanceof Oa?t:t.members)),[]))}}}function Aa(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Sa(i.from+t,i.to+t,i.type))}return n}function Na(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o,s=0;s<e.length;s++)(o=e[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[s]=null);return i}function Ia(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Da(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=Na(e,t,s+n);if(a){o=!0;let e=Da(a,t,n+s+1,r);e!=Ma&&i.push(s,s+t.nodeSize,e)}}));let s=Aa(o?Ia(e):e,-n).sort(Ra);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Oa(s,i):Ma}function Ra(e,t){return e.from-t.from||e.to-t.to}function La(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Pa(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),Pa(t,i+1,o.copy(r.to,o.to)))}}return t}function Pa(e,t,n){for(;t<e.length&&Ra(n,e[t])>0;)t++;e.splice(t,0,n)}function za(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=Ma&&t.push(r)})),e.cursorWrapper&&t.push(Oa.create(e.state.doc,[e.cursorWrapper.deco])),Ea.from(t)}const Ba={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ja=oo&&so<=11;class Fa{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class $a{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Fa,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);oo&&so<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),ja&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Ba)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(ws(this.view)){if(this.suppressingSelectionUpdates)return hs(this.view);if(oo&&so<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&qi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let i=e.focusNode;i;i=Hi(i))n.add(i);for(let i=e.anchorNode;i;i=Hi(i))if(n.has(i)){t=i;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ws(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,a=[];if(e.editable)for(let c=0;c<t.length;c++){let e=this.registerMutation(t[c],a);e&&(i=i<0?e.from:Math.min(e.from,i),o=o<0?e.to:Math.max(e.to,o),e.typeOver&&(s=!0))}if(ao&&a.length){let t=a.filter((e=>"BR"==e.nodeName));if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&Wa(e,n)==t||r.remove()}}}let l=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Xi(n)&&(l=ds(e))&&l.eq(bi.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,hs(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(Va.has(e))return;if(Va.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=ao,Ha)return;Ha=!0}}(e)),this.handleDOMChange(i,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||hs(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(oo&&so<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?Vi(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?Vi(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Va=new WeakMap,Ha=!1;function Ua(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return qi(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Wa(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function qa(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(ho&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||ho&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Ka=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ja(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ds(e,t);if(n&&!e.state.selection.eq(n)){if(co&&go&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,Yi(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),o&&r.setMeta("composition",o),e.dispatch(r)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l,c,d=e.state.selection,u=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],Xi(c)||r.push({node:c.focusNode,offset:c.focusOffset})),co&&8===e.input.lastKeyCode)for(let g=s;g>o;g--){let e=i.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=g;break}if(!t||t.size)break}let u=e.state.doc,h=e.someProp("domParser")||gr.fromSchema(e.state.schema),p=u.resolve(a),f=null,m=h.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:qa,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),h=e.state.doc,p=h.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,c="end"):(l=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){let e=r<=o&&r>=s?o-r:0;o-=e,o&&o<t.size&&Xa(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}else if(a<o){let t=r<=o&&r>=a?o-r:0;o-=t,o&&o<e.size&&Xa(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,u.doc.content,u.from,l,c);if((po&&e.input.lastIOSEnter>Date.now()-225||go)&&i.some((e=>1==e.nodeType&&!Ka.test(e.nodeName)))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,Yi(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&d instanceof _i&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=Ga(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);o&&n.setMeta("composition",o),e.dispatch(n)}}return}f={start:d.from,endA:d.to,endB:d.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof _i&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),oo&&so<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>u.from&&" Â "==u.doc.textBetween(f.start-u.from-1,f.start-u.from+1)&&(f.start--,f.endA--,f.endB--);let m,g=u.doc.resolveNoCache(f.start-u.from),v=u.doc.resolveNoCache(f.endB-u.from),y=h.resolve(f.start),b=g.sameParent(v)&&g.parent.inlineContent&&y.end()>=f.endA;if((po&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&g.pos<u.doc.content.size&&!g.sameParent(v)&&(m=bi.findFrom(u.doc.resolve(g.pos+1),1,!0))&&m.head==v.pos)&&e.someProp("handleKeyDown",(t=>t(e,Yi(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||Za(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(Za(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Za(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,f.start,f.endA,g,v)&&e.someProp("handleKeyDown",(t=>t(e,Yi(8,"Backspace")))))return void(go&&co&&e.domObserver.suppressSelectionUpdates());co&&go&&f.endB==f.start&&(e.input.lastAndroidDelete=Date.now()),go&&!b&&g.start()!=v.start()&&0==v.parentOffset&&g.depth==v.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==f.endA&&(f.endB-=2,v=u.doc.resolveNoCache(f.endB-u.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Yi(13,"Enter"))}))}),20));let w,x,k,_=f.start,S=f.endA;if(b)if(g.pos==v.pos)oo&&so<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>hs(e)),20)),w=e.state.tr.delete(_,S),x=h.resolve(f.start).marksAcross(h.resolve(f.endA));else if(f.endA==f.endB&&(k=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let d=0;d<s.length;d++)a=s[d].removeFromSet(a);for(let d=0;d<o.length;d++)l=o[d].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let d=0;d<t.childCount;d++)c.push(i(t.child(d)));if(Cn.from(c).eq(e))return{mark:r,type:n}}(g.parent.content.cut(g.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start()))))w=e.state.tr,"add"==k.type?w.addMark(_,S,k.mark):w.removeMark(_,S,k.mark);else if(g.parent.child(g.index()).isText&&g.index()==v.index()-(v.textOffset?0:1)){let t=g.parent.textBetween(g.parentOffset,v.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,_,S,t))))return;w=e.state.tr.insertText(t,_,S)}if(w||(w=e.state.tr.replace(_,S,u.doc.slice(f.start-u.from,f.endB-u.from))),u.sel){let t=Ga(e,w.doc,u.sel);t&&!(co&&go&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==_||t.head==w.mapping.map(S)-1)||oo&&t.empty&&t.head==_)&&w.setSelection(t)}x&&w.ensureMarks(x),o&&w.setMeta("composition",o),e.dispatch(w.scrollIntoView())}function Ga(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:bs(e,t.resolve(n.anchor),t.resolve(n.head))}function Za(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Xa(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Ya{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Gs,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(rl),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=tl(this),el(this),this.nodeViews=nl(this),this.docView=Ko(this.state.doc,Qa(this),za(this),this.dom,this),this.domObserver=new $a(this,((e,t,n,r)=>Ja(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in qs){let n=qs[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Qs(e,t)||Ys(e,t)||!e.editable&&t.type in Ks||n(e,t)},Js[t]?{passive:!0}:void 0)}ho&&e.dom.addEventListener("input",(()=>null)),Xs(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Xs(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(rl),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(ha(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=nl(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Xs(this),this.editable=tl(this),el(this);let a=za(this),l=Qa(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=i||!this.docView.matchesNode(e.doc,l,a);!d&&e.selection.eq(r.selection)||(o=!0);let u="preserve"==c&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:_o(e.dom)}}(this);if(o){this.domObserver.stop();let t=d&&(oo||co)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(d){let n=co?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=pa(this)),!i&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=Ko(e.doc,l,a,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return qi(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?hs(this,t):(vs(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;So(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof Ci){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&ko(this,t.getBoundingClientRect(),e)}else ko(this,this.coordsAtPos(this.state.selection.head,1),e)}
vendor: 9,519 bytes, line 1
1destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new ya(e.slice,e.move,r<0?void 0:Ci.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let o=0;o<this.directPlugins.length;o++){let r=this.directPlugins[o].props[e];if(null!=r&&(n=t?t(r):r))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let r=i[o].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){if(oo){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(Co)return e.focus(Co);let t=_o(e);e.focus(null==Co?{get preventScroll(){return Co={preventScroll:!0},!0}}:void 0),Co||(Co=!1,So(t,0))}(this.dom),hs(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return Eo(this,e)}coordsAtPos(e,t=1){return Do(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return $o(this,t||this.state,e)}pasteHTML(e,t){return ga(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ga(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],za(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Ui=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Ys(e,t)||!qs[t.type]||!e.editable&&t.type in Ks||qs[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?ho&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ua(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Ua(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Qa(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[Sa.node(0,e.state.doc.content.size,t)]}function el(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Sa.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function tl(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function nl(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function rl(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var il={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:"'"},ol={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sl="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),al="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ll=0;ll<10;ll++)il[48+ll]=il[96+ll]=String(ll);for(ll=1;ll<=24;ll++)il[ll+111]="F"+ll;for(ll=65;ll<=90;ll++)il[ll]=String.fromCharCode(ll+32),ol[ll]=String.fromCharCode(ll);for(var cl in il)ol.hasOwnProperty(cl)||(ol[cl]=il[cl]);const dl="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function ul(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let a=0;a<o.length-1;a++){let e=o[a];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);dl?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function hl(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function pl(e){let t=function(e){let t=Object.create(null);for(let n in e)t[ul(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(sl&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||al&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?ol:il)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=t[hl(i,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[hl(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=il[n.keyCode])&&r!=i){let i=t[hl(r,n)];if(i&&i(e.state,e.dispatch,e))return!0}}return!1}}function fl(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}function ml(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let o=t.nodeAfter,s=t.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let a=ii(e.doc,i,s,Nn.empty);if(!a||a.from!=i||a instanceof Wr&&a.slice.size>=s-i)return!1;if(n){let t=e.tr.step(a);t.setSelection(_i.create(t.doc,i)),n(t.scrollIntoView())}return!0}function gl(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function vl(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function yl(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}function bl(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function wl(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function xl(e,t,n,r){let i,o,s=t.nodeBefore,a=t.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!ei(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}
vendor: 5,958 bytes, line 1
1(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(i=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(i[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,o=Cn.empty;for(let e=i.length-1;e>=0;e--)o=Cn.from(i[e].create(null,o));o=Cn.from(s.copy(o));let l=e.tr.step(new qr(t.pos-1,r,t.pos,r,new Nn(o,1,0),i.length,!0)),c=r+2*i.length;ei(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let d=a.type.spec.isolating||r>0&&l?null:bi.findFrom(t,1),u=d&&d.$from.blockRange(d.$to),h=u&&Zr(u);if(null!=h&&h>=t.depth)return n&&n(e.tr.lift(u,h).scrollIntoView()),!0;if(c&&gl(a,"start",!0)&&gl(s,"end")){let r=s,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=a,l=1;for(;!o.isTextblock;o=o.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=Cn.empty;for(let e=i.length-1;e>=0;e--)r=Cn.from(i[e].copy(r));n(e.tr.step(new qr(t.pos-i.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new Nn(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function kl(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(_i.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const _l=kl(-1),Sl=kl(1);function Cl(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:r},$to:{pos:s}}=n.selection.ranges[o];n.doc.nodesBetween(r,s,((r,o)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function Tl(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new Kn(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new Kn(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let c=Xr(l,e,t,s);return!!c&&(r&&r(function(e,t,n,r,i){let o=Cn.empty;for(let d=n.length-1;d>=0;d--)o=Cn.from(n[d].type.create(n[d].attrs,o));e.step(new qr(t.start-(r?2:0),t.end,t.start,t.end,new Nn(o,0,0),n.length,!0));let s=0;for(let d=0;d<n.length;d++)n[d].type==i&&(s=d+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let d=t.startIndex,u=t.endIndex,h=!0;d<u;d++,h=!1)!h&&Qr(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function Ol(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new qr(o-1,s,o,s,new Nn(Cn.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Kn(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Zr(r);if(null==a)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;ei(i.doc,l)&&i.join(l);return t(i.scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let p=n.end,f=n.endIndex-1,m=n.startIndex;f>m;f--)p-=i.child(f).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?Cn.empty:Cn.from(i))))return!1;let u=o.pos,h=u+s.nodeSize;return r.step(new qr(u-(a?1:0),h+(l?1:0),u+1,h-1,new Nn((a?Cn.empty:Cn.from(i.copy(Cn.empty))).append(l?Cn.empty:Cn.from(i.copy(Cn.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function Ml(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class El{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})]))),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:Ml({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}class Al{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];
1return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Nl(e,t,n){if(void 0===e.config[t]&&e.parent)return Nl(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?Nl(e.parent,t,n):null})}return e.config[t]}function Il(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function Dl(e){const t=[],{nodeExtensions:n,markExtensions:r}=Il(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=Nl(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Nl(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...o,...r};"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,t.push({type:e.name,name:n,attribute:i})}))})),t}function Rl(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Ll(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?t.split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter((e=>!i.includes(e)));n[e]=[...i,...o].join(" ")}else n[e]="style"===e?[n[e],t].join("; "):t;else n[e]=t})),n}),{})}function Pl(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>Ll(e,t)),{})}function zl(e){return"function"==typeof e}function Bl(e,t=void 0,...n){return zl(e)?t?e.bind(t)(...n):e(...n):e}function jl(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function Fl(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function $l(e,t){return t.nodes[e]||t.marks[e]||null}function Vl(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}const Hl=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,o)=>{var s,a;const l=(null===(a=(s=e.type.spec).toText)||void 0===a?void 0:a.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n};function Ul(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class Wl{constructor(e){this.find=e.find,this.handler=e.handler}}const ql=(e,t)=>{if(Ul(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith),r.push(n.replaceWith)),r};function Kl(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const u=Hl(c)+o;return s.forEach((e=>{if(d)return;const t=ql(u,e.find);if(!t)return;const s=l.state.tr,c=Ml({state:l.state,transaction:s}),h={from:r-(t[0].length-o.length),to:i}
1,{commands:p,chain:f,can:m}=new El({editor:n,state:c});null!==e.handler({state:c,range:h,match:t,commands:p,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),d=!0)})),d}function Jl(e){const{editor:t,rules:n}=e,r=new Bi({state:{init:()=>null,apply(e,i){const o=e.getMeta(r);if(o)return o;const s=e.getMeta("applyInputRules");return!!s&&setTimeout((()=>{const{from:e,text:i}=s,o=e+i.length;Kl({editor:t,from:e,to:o,text:i,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,s)=>Kl({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&Kl({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:o}=e.state.selection;return!!o&&Kl({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Gl{constructor(e){this.find=e.find,this.handler=e.handler}}const Zl=(e,t,n)=>{if(Ul(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith),n.push(t.replaceWith)),n})):[]};function Xl(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a="undefined"!=typeof DragEvent?new DragEvent("drop"):null;const l=({state:e,from:n,to:r,rule:i,pasteEvt:o})=>{const l=e.tr,c=Ml({state:e,transaction:l}),d=function(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:c,can:d}=new El({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,i,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const h=Math.max(r,t),p=Math.min(i,t+e.content.size),f=e.textBetween(h-t,p-t,void 0,"");Zl(f,o.find,s).forEach((e=>{if(void 0===e.index)return;const t=h+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=o.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(p)}))})),u.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:o,dropEvent:a});if(d&&l.steps.length)return a="undefined"!=typeof DragEvent?new DragEvent("drop"):null,s="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l};return n.map((e=>new Bi({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:(e,t)=>(o=r===e.dom.parentElement,a=t,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return s=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const a=t[0],c="paste"===a.getMeta("uiEvent")&&!i,d="drop"===a.getMeta("uiEvent")&&!o,u=a.getMeta("applyPasteRules"),h=!!u;if(!c&&!d&&!h)return;if(h){const{from:t,text:n}=u,i=t+n.length,o=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(t=n.clipboardData)||void 0===t||t.setData("text/html",e),n})(n);return l({rule:e,state:r,from:t,to:{b:i},pasteEvt:o})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:s}):void 0}})))}class Yl{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Yl.resolve(e),this.schema=function(e,t){var n;const r=Dl(e),{nodeExtensions:i,markExtensions:o}=Il(e),s=null===(n=i.find((e=>Nl(e,"topNode"))))||void 0===n?void 0:n.name,a=Object.fromEntries(i.map((n=>{const i=r.filter((e=>e.type===n.name)),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=Fl({...e.reduce(((e,t)=>{const r=Nl(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}}),{}),content:Bl(Nl(n,"content",o)),marks:Bl(Nl(n,"marks",o)),group:Bl(Nl(n,"group",o)),inline:Bl(Nl(n,"inline",o)),atom:Bl(Nl(n,"atom",o)),selectable:Bl(Nl(n,"selectable",o)),draggable:Bl(Nl(n,"draggable",o)),code:Bl(Nl(n,"code",o)),whitespace:Bl(Nl(n,"whitespace",o)),defining:Bl(Nl(n,"defining",o)),isolating:Bl(Nl(n,"isolating",o)),attrs:Object.fromEntries(i.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=Bl(Nl(n,"parseHTML",o));a&&(s.parseDOM=a.map((e=>jl(e,i))));const l=Nl(n,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:Pl(e,i)}));const c=Nl(n,"renderText",o);return c&&(s.toText=c),[n.name,s]}))),l=Object.fromEntries(o.map((n=>{const i=r.filter((e=>e.type===n.name)),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=Fl({...e.reduce(((e,t)=>{const r=Nl(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}
1}),{}),inclusive:Bl(Nl(n,"inclusive",o)),excludes:Bl(Nl(n,"excludes",o)),group:Bl(Nl(n,"group",o)),spanning:Bl(Nl(n,"spanning",o)),code:Bl(Nl(n,"code",o)),attrs:Object.fromEntries(i.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=Bl(Nl(n,"parseHTML",o));a&&(s.parseDOM=a.map((e=>jl(e,i))));const l=Nl(n,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:Pl(e,i)})),[n.name,s]})));return new fr({topNode:s,nodes:a,marks:l})}(this.extensions,t),this.setupExtensions()}static resolve(e){const t=Yl.sort(Yl.flatten(e));return function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(t.map((e=>e.name))).length,t}static flatten(e){return e.map((e=>{const t=Nl(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){return e.sort(((e,t)=>{const n=Nl(e,"priority")||100,r=Nl(t,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=Nl(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:$l(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Yl.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:$l(t.name,this.schema)},o=[],s=Nl(t,"addKeyboardShortcuts",i);let a={};if("mark"===t.type&&Nl(t,"exitable",i)&&(a.ArrowRight=()=>Wc.handleExit({editor:e,mark:t})),s){const t=Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})])));a={...a,...t}}const l=new Bi({props:{handleKeyDown:pl(a)}});o.push(l);const c=Nl(t,"addInputRules",i);Vl(t,e.options.enableInputRules)&&c&&n.push(...c());const d=Nl(t,"addPasteRules",i);Vl(t,e.options.enablePasteRules)&&d&&r.push(...d());const u=Nl(t,"addProseMirrorPlugins",i);if(u){const e=u();o.push(...e)}return o})).flat();return[Jl({editor:e,rules:n}),...Xl({editor:e,rules:r}),...i]}get attributes(){return Dl(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Il(this.extensions);return Object.fromEntries(t.filter((e=>!!Nl(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:Rl(t.name,this.schema)},i=Nl(t,"addNodeView",r);if(!i)return[];return[t.name,(r,o,s,a)=>{const l=Pl(r,n);return i()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}setupExtensions(){this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:$l(e.name,this.schema)};if("mark"===e.type){(null===(t=Bl(Nl(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=Nl(e,"onBeforeCreate",n),i=Nl(e,"onCreate",n),o=Nl(e,"onUpdate",n),s=Nl(e,"onSelectionUpdate",n),a=Nl(e,"onTransaction",n),l=Nl(e,"onFocus",n),c=Nl(e,"onBlur",n),d=Nl(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}}function Ql(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function ec(e,t){const n={...e};return Ql(e)&&Ql(t)&&Object.keys(t).forEach((r=>{Ql(t[r])&&Ql(e[r])?n[r]=ec(e[r],t[r]):n[r]=t[r]})),n}class tc{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length,this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Bl(Nl(this,"addOptions",{name:this.name}))),this.storage=Bl(Nl(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new tc(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>ec(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new tc({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length,t.options=Bl(Nl(t,"addOptions",{name:t.name})),t.storage=Bl(Nl(t,"addStorage",{name:t.name,options:t.options})),t}}function nc(e,t,n){const{from:r,to:i}
1=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,i,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=o);const u=null==s?void 0:s[e.type.name];if(u)return l&&(a+=u({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n))})),a}function rc(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const ic=tc.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Bi({key:new $i("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map((e=>e.$from.pos))),a=Math.max(...o.map((e=>e.$to.pos))),l=rc(n);return nc(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});function oc(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Ul(t[r])?t[r].test(e[r]):t[r]===e[r]))}function sc(e,t,n={}){return e.find((e=>e.type===t&&oc(e.attrs,n)))}function ac(e,t,n={}){return!!sc(e,t,n)}function lc(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=sc([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(sc([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&ac([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function cc(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function dc(e){return e instanceof _i}function uc(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function hc(e,t=null){if(!t)return null;const n=bi.atStart(e),r=bi.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,o=r.to;return"all"===t?_i.create(e,uc(0,i,o),uc(e.content.size,i,o)):_i.create(e,uc(t,i,o),uc(t,i,o))}function pc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const fc=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&fc(r)}return e};function mc(e){const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return fc(n)}function gc(e,t,n){n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{return Array.isArray(e)&&e.length>0?Cn.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return gc("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,i="";const o=new fr({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?gr.fromSchema(o).parseSlice(mc(e),n.parseOptions):gr.fromSchema(o).parse(mc(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=gr.fromSchema(t);return n.slice?r.parseSlice(mc(e),n.parseOptions).content:r.parse(mc(e),n.parseOptions)}return gc("",t,n)}function vc(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function yc(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?Rl(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})}));const l=i-r,c=a.filter((e=>
1!s||s.name===e.node.type.name)).filter((e=>oc(e.node.attrs,n,{strict:!1})));if(o)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function bc(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function wc(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function xc(e,t,n={},r={}){return gc(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function kc(e,t){const n=cc(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function _c(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Sc(e,t){const n=bc("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=Rl(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,(e=>{o.push(e)}));const s=o.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?kc(e,t):{}}function Cc(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=lc(n.resolve(e),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function Tc(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function Oc(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?cc(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!o||o.name===e.type.name)).find((e=>oc(e.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:o}))))}))})),0===s)return!1;const l=a.filter((e=>!o||o.name===e.mark.type.name)).filter((e=>oc(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!o||e.mark.type!==o&&e.mark.type.excludes(o))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}function Mc(e,t){const{nodeExtensions:n}=Il(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=Bl(Nl(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function Ec(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!==(r=e.text)&&void 0!==r?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(Ec(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}function Ac(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}const Nc=(e,t)=>{const n=_c((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!ei(e.doc,n.pos)||(e.join(n.pos),!0)},Ic=(e,t)=>{const n=_c((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!ei(e.doc,r)||(e.join(r),!0)};var Dc=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return!n||(i.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;const l=Zr(a);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Oi||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=wl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(_i.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),cut:(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new _i(r.doc.resolve(s-1))),!0},deleteCurrentNode:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1){if(i.node(o).type===r.type){if(t){const t=i.before(o),n=i.after(o);e.delete(t,n).scrollIntoView()}return!0}}return!1},deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const i=Rl(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===i){if(r){const n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=wl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(bi.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=cc(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const e=lc(l,o,t);if(e&&e.from<=c&&e.to>=d){const t=_i.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{pc()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;
1if(o&&null===e&&!dc(n.state.selection))return s(),!0;const a=hc(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){let i;n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};try{i=gc(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:null!==(s=n.errorOnInvalidContent)&&void 0!==s?s:o.options.enableContentCheck})}catch(a){return o.emit("contentError",{editor:o,error:a,disableCollaboration:()=>{}}),!1}let{from:l,to:c}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},d=!0,u=!0;if(("type"in i?[i]:i).forEach((e=>{e.check(),d=!!d&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),l===c&&u){const{parent:e}=r.doc.resolve(l);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(l-=1,c+=1)}let h;d?(h=Array.isArray(t)?t.map((e=>e.text||"")).join(""):"object"==typeof t&&t&&t.text?t.text:t,r.insertText(h,l,c)):(h=i,r.replaceWith(l,c,h)),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Wr||i instanceof qr))return;const o=e.mapping.maps[r];let s=0;o.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(bi.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=fl(e,n);if(!r)return!1;let i=vl(r);if(!i){let n=r.blockRange(),i=n&&Zr(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(xl(e,i,t,-1))return!0;if(0==r.parent.content.size&&(gl(o,"end")||Ci.isSelectable(o)))for(let s=r.depth;;s--){let n=ii(e.doc,r.before(s),r.after(s),Nn.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(gl(o,"end")?bi.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):Ci.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}if(1==s||r.node(s-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))})(e,t),joinDown:()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof Ci){if(r.node.isTextblock||!ei(e.doc,r.to))return!1;n=r.to}else if(n=ni(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=yl(e,n);if(!r)return!1;let i=bl(r);if(!i)return!1;let o=i.nodeAfter;if(xl(e,i,t,1))return!0;if(0==r.parent.content.size&&(gl(o,"start")||Ci.isSelectable(o))){let n=ii(e.doc,r.before(),r.after(),Nn.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(gl(o,"start")?bi.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Ci.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))})(e,t),joinItemBackward:()=>({state:e,dispatch:t,tr:n})=>{try{const r=ni(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch(r){return!1}},joinItemForward:()=>({state:e,dispatch:t,tr:n})=>{try{const r=ni(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch(r){return!1}},joinTextblockBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=fl(e,n);if(!r)return!1;let i=vl(r);return!!i&&ml(e,i,t)})(e,t),joinTextblockForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=yl(e,n);if(!r)return!1;let i=bl(r);return!!i&&ml(e,i,t)})(e,t),joinUp:()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,i=r instanceof Ci;if(i){if(r.node.isTextblock||!ei(e.doc,r.from))return!1;n=r.from}else if(n=ni(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);i&&r.setSelection(Ci.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=function(e){const t=e.split(/-(?!$)/);let n,r,i,o,s=t[t.length-1];"Space"===s&&(s=" ");for(let a=0;a<t.length-1;a+=1){const e=t[a];if(/^(cmd|meta|m)$/i.test(e))o=!0;else if(/^a(lt)?$/i.test(e))n=!0;else if(/^(c|ctrl|control)$/i.test(e))r=!0;else if(/^s(hift)?$/i.test(e))i=!0;else{if(!/^mod$/i.test(e))throw new Error(`Unrecognized modifier name: ${e}`);pc()||vc()?o=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),i&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=o.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"
1===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!yc(n,Rl(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Zr(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Qr(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Zr(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>Ol(Rl(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=bc("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=Rl(e,r.schema)),"mark"===a&&(s=cc(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,wc(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(wc(i.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=vl(r)}let s=o&&o.nodeBefore;return!(!s||!Ci.isSelectable(s)||(t&&t(e.tr.setSelection(Ci.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=bl(r)}let s=o&&o.nodeAfter;return!(!s||!Ci.isSelectable(s)||(t&&t(e.tr.setSelection(Ci.create(e.doc,o.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:i}=e.selection,o=r.sharedDepth(i);return 0!=o&&(n=r.before(o),t&&t(e.tr.setSelection(Ci.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>Sl(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>_l(e,t),setContent:(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,c;const{doc:d}=o;if("full"!==n.preserveWhitespace){const a=xc(e,i.schema,n,{errorOnInvalidContent:null!==(l=r.errorOnInvalidContent)&&void 0!==l?l:i.options.enableContentCheck});return s&&o.replaceWith(0,d.content.size,a).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:d.content.size},e,{parseOptions:n,errorOnInvalidContent:null!==(c=r.errorOnInvalidContent)&&void 0!==c?c:i.options.enableContentCheck})},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=cc(e,r.schema);if(i)if(s){const e=kc(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,((e,r)=>{const s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let o=null;
1if(dc(i)&&(o=i.$cursor),o){const t=null!==(r=e.storedMarks)&&void 0!==r?r:o.marks();return!!n.isInSet(t)||!t.some((e=>e.type.excludes(n)))}const{ranges:s}=i;return s.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&o}return!i})),i}))}(r,n,l)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Rl(e,n.schema);return!!o.isTextblock&&i().command((({commands:e})=>!!Cl(o,t)(n)||e.clearNodes())).command((({state:e})=>Cl(o,t)(e,r))).run()},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=uc(e,0,n.content.size),i=Ci.create(n,r);t.setSelection(i)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=_i.atStart(n).from,s=_i.atEnd(n).to,a=uc(r,o,s),l=uc(i,o,s),c=_i.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=Rl(e,t.schema);return(i=r,function(e,t){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==i));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=Cn.from(n?i.create():null),s=new Nn(Cn.from(i.create(null,Cn.from(a.type.create(null,r)))),n?3:1,0),c=o.start,d=o.end;t(e.tr.step(new qr(c-(n?3:1),d,c,d,s,1,!0)).scrollIntoView())}return!0})(t,n);var i},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,c=Tc(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof Ci&&o.node.isBlock)return!(!a.parentOffset||!Qr(s,a.pos))&&(r&&(e&&Ac(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,u=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=d&&u?[{type:u,attrs:c}]:void 0,p=Qr(t.doc,t.mapping.map(a.pos),1,h);if(h||p||!Qr(t.doc,t.mapping.map(a.pos),1,u?[{type:u}]:void 0)||(p=!0,h=u?[{type:u,attrs:c}]:void 0),r){if(p&&(o instanceof _i&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,h),u&&!d&&!a.parentOffset&&a.parent.type!==u)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&t.setNodeMarkup(t.mapping.map(a.before()),u)}e&&Ac(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},splitListItem:(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=Rl(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;const h=o.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=Cn.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=Cn.from(l.node(t).copy(e));const i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,o={...Tc(h,l.node().type.name,l.node().attrs),...t},c=(null===(s=a.contentMatch.defaultType)||void 0===s?void 0:s.createAndFill(o))||void 0;e=e.append(Cn.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new Nn(e,4-r,0));let u=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>
1{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&n.setSelection(_i.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,f={...Tc(h,u.type.name,u.attrs),...t},m={...Tc(h,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!Qr(n.doc,l.pos,2))return!1;if(i){const{selection:e,storedMarks:t}=r,{splittableMarks:s}=o.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;const c=a.filter((e=>s.includes(e.type.name)));n.ensureMarks(c)}return!0},toggleList:(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:h}=i.extensionManager,p=Rl(e,s.schema),f=Rl(t,s.schema),{selection:m,storedMarks:g}=s,{$from:v,$to:y}=m,b=v.blockRange(y),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const x=_c((e=>Mc(e.type.name,u)))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(Mc(x.node.type.name,u)&&p.validContent(x.node.content)&&a)return l().command((()=>(o.setNodeMarkup(x.pos,p),!0))).command((()=>Nc(o,p))).command((()=>Ic(o,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>h.includes(e.type.name)));return o.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>Nc(o,p))).command((()=>Ic(o,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>Nc(o,p))).command((()=>Ic(o,p))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=cc(e,r.schema);return Oc(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=Rl(e,r.schema),s=Rl(t,r.schema);return yc(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=Rl(e,n.schema);return yc(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){const n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=cc(e,r.schema),{$from:c,empty:d,ranges:u}=a;if(!i)return!0;if(d&&s){let{from:e,to:t}=a;const r=null===(o=c.marks().find((e=>e.type===l)))||void 0===o?void 0:o.attrs,i=lc(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else u.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=bc("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=Rl(e,r.schema)),"mark"===a&&(s=cc(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((o=>{if(s===o.type){const l=Math.max(r,i),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,s.create({...o.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Xr(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Rl(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>Tl(Rl(e,n.schema),t)(n,r)});const Rc=tc.create({name:"commands",addCommands:()=>({...Dc})}),Lc=tc.create({name:"editable",addProseMirrorPlugins(){return[new Bi({key:new $i("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Pc=tc.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Bi({key:new $i("focusEvents"),props:{handleDOMEvents:{focu
1s:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),zc=tc.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,c=l.parent.type.spec.isolating,d=o.pos-o.parentOffset,u=c&&1===l.parent.childCount?d===o.pos:bi.atStart(r).from===s;return!(!i||!a.type.isTextblock||a.textContent.length||!u||u&&"paragraph"===o.parent.type.name)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return pc()||vc()?i:r},addProseMirrorPlugins(){return[new Bi({key:new $i("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:i,to:o}=t.selection,s=bi.atStart(t.doc).from,a=bi.atEnd(t.doc).to;if(r||!(i===s&&o===a))return;if(!(0===n.doc.textBetween(0,n.doc.content.size," "," ").length))return;const l=n.tr,c=Ml({state:n,transaction:l}),{commands:d}=new El({editor:this.editor,state:c});return d.clearNodes(),l.steps.length?l:void 0}})]}}),Bc=tc.create({name:"tabindex",addProseMirrorPlugins(){return[new Bi({key:new $i("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class jc{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!==(e=this.actualDepth)&&void 0!==e?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return;t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new jc(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new jc(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new jc(e,this.editor)}get children(){const e=[];return this.node.content.forEach(((t,n)=>{const r=t.isBlock&&!t.isTextblock,i=this.pos+n+1,o=this.resolvedPos.doc.resolve(i);if(!r&&o.depth<=this.depth)return;const s=new jc(o,this.editor,r,r?t:null);r&&(s.actualDepth=this.depth+1),e.push(new jc(o,this.editor,r,r?t:null))})),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;
1){if(r.node.type.name===e)if(Object.keys(t).length>0){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;const i=Object.keys(t);return this.children.forEach((o=>{if(!(n&&r.length>0)){if(o.node.type.name===e){i.every((e=>t[e]===o.node.attrs[e]))&&r.push(o)}n&&r.length>0||(r=r.concat(o.querySelectorAll(e,t,n)))}})),r}setAttribute(e){const t=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(t.from).run()}}let Fc=class extends Al{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e}},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),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}),this.isInitialized=!0)}),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=function(e,t,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==r)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}
1\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(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=zl(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[Lc,ic.configure({blockSeparator:null===(t=null===(e=this.options.coreExtensionOptions)||void 0===e?void 0:e.clipboardTextSerializer)||void 0===t?void 0:t.blockSeparator}),Rc,Pc,zc,Bc]:[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new Yl(n,this)}createCommandManager(){this.commandManager=new El({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=xc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(r){if(!(r instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(r.message)))throw r;this.emit("contentError",{editor:this,error:r,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter((e=>"collaboration"!==e.name)),this.createExtensionManager()}}),e=xc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const t=hc(e,this.options.autofocus);this.view=new Ya(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Pi.create({doc:e,selection:t||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.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Sc(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return yc(e,null,n)||Oc(e,null,n);const r=bc(t,e.schema);
1return"node"===r?yc(e,t,n):"mark"===r&&Oc(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=Tr.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return nc(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...rc(this.schema),...n}})}get isEmpty(){return Ec(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}$node(e,t){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new jc(t,this)}get $doc(){return this.$pos(0)}};function $c(e){return new Wl({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Bl(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];if(s){const r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(Cc(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>l)).length)return null;c<n.to&&o.delete(c,n.to),l>n.from&&o.delete(n.from+r,l);const d=n.from+r+s.length;o.addMark(n.from+r,d,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Vc(e){return new Wl({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Bl(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;const l=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function Hc(e){return new Wl({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Bl(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function Uc(e){return new Wl({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Bl(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&Xr(a,e.type,o);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){const{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){const e=o.filter((e=>i.includes(e.type.name)));s.ensureMarks(e)}}if(e.keepAttributes){const t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&ei(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)}})}class Wc{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length,this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Bl(Nl(this,"addOptions",{name:this.name}))),this.storage=Bl(Nl(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Wc(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>ec(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Wc(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length,t.options=Bl(Nl(t,"addOptions",{name:t.name})),t.storage=Bl(Nl(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find((e=>
1(null==e?void 0:e.type.name)===t.name)))return!1;const o=i.find((e=>(null==e?void 0:e.type.name)===t.name));return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}class qc{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length,this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Bl(Nl(this,"addOptions",{name:this.name}))),this.storage=Bl(Nl(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qc(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>ec(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new qc(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length,t.options=Bl(Nl(t,"addOptions",{name:t.name})),t.storage=Bl(Nl(t,"addStorage",{name:t.name,options:t.options})),t}}class Kc{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,c=e.target,d=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!d)return;let u=0,h=0;if(this.dom!==d){const t=this.dom.getBoundingClientRect(),n=d.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,l=null!==(o=e.offsetY)&&void 0!==o?o:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;u=n.x-t.x+a,h=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,u,h);const p=Ci.create(l.state.doc,this.getPos()),f=l.state.tr.setSelection(p);l.dispatch(f)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r=e.type.startsWith("drag"),i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i&&!r)return!0;const{isEditable:o}=this.editor,{isDragging:s}=this,a=!!this.node.type.spec.draggable,l=Ci.isSelectable(this.node),c="copy"===e.type,d="paste"===e.type,u="cut"===e.type,h="mousedown"===e.type;if(!a&&l&&r&&e.preventDefault(),a&&r&&!s)return e.preventDefault(),!1;if(a&&o&&!s&&h){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(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!(s||i||c||d||u||h&&l)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&(pc()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}function Jc(e){return new Gl({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=Bl(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;const{tr:s}=t,a=r[r.length-1],l=r[0];let c=n.to;if(a){const r=l.search(/\S/),i=n.from+l.indexOf(a),d=i+a.length;if(Cc(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>i)).length)return null;
1d<n.to&&s.delete(d,n.to),i>n.from&&s.delete(n.from+r,i),c=n.from+r+a.length,s.addMark(n.from+r,c,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}const Gc=tc.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter((e=>""!==e)).length}},addProseMirrorPlugins(){return[new Bi({key:new $i("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n)return!0;if(r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r)return!1;if(!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,s=o-(i-n),a=o;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}}),Zc=tc.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Bi({key:new $i("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&Ec(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];o&&r.push(this.options.emptyEditorClass);const s=Sa.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});i.push(s)}return this.options.includeChildren})),Oa.create(e,i)}}})]}}),Xc=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Yc=qc.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:e}){return["img",Ll(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}
1,addInputRules(){return[Vc({find:Xc,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Qc=/^\s*>\s$/,ed=qc.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Uc({find:Qc,type:this.type})]}}),td=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,nd=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,rd=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,id=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,od=Wc.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
1,addInputRules(){return[$c({find:td,type:this.type}),$c({find:rd,type:this.type})]},addPasteRules(){return[Jc({find:nd,type:this.type}),Jc({find:id,type:this.type})]}}),sd=qc.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Ll(this.options.HTMLAttributes,e),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)}}}),ad=Wc.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=kc(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),ld=/^\s*([-+*])\s$/,cd=qc.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(sd.name,this.editor.getAttributes(ad.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}}
1,addInputRules(){let e=Uc({find:ld,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Uc({find:ld,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ad.name),editor:this.editor})),[e]}}),dd=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,ud=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,hd=Wc.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[$c({find:dd,type:this.type})]},addPasteRules(){return[Jc({find:ud,type:this.type})]}}),pd=/^```([a-z]+)?[\s\n]$/,fd=/^~~~([a-z]+)?[\s\n]$/,md=qc.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",Ll(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();if(void 0===s)return!1;return r.nodeAt(s)?e.commands.command((({tr:e})=>(e.setSelection(bi.near(r.resolve(s))),!0))):e.commands.exitCode()}}}
1,addInputRules(){return[Hc({find:pd,type:this.type,getAttributes:e=>({language:e[1]})}),Hc({find:fd,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Bi({key:new $i("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(_i.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),gd=qc.create({name:"doc",topNode:!0,content:"block+"});function vd(e={}){return new Bi({view:t=>new yd(t,e)})}class yd{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let i=t.getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:i.left,right:i.right,top:o-this.width/2,bottom:o+this.width/2}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let r,i,o=this.editorView.dom.offsetParent;if(this.element||(this.element=o.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),!o||o==document.body&&"static"==getComputedStyle(o).position)r=-pageXOffset,i=-pageYOffset;else{let e=o.getBoundingClientRect();r=e.left-o.scrollLeft,i=e.top-o.scrollTop}this.element.style.left=e.left-r+"px",this.element.style.top=e.top-i+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=ri(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const bd=tc.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[vd(this.options)]}});class wd extends bi{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return wd.valid(n)?new wd(n):bi.near(n)}content(){return Nn.empty}eq(e){return e instanceof wd&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new wd(e.resolve(t.pos))}getBookmark(){return new xd(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;
vendor: 2,851 bytes, line 1
1if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&wd.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(wd.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!Ci.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue e}break}i=o,r+=t;let s=e.doc.resolve(r);if(wd.valid(s))return s}return null}}}wd.prototype.visible=!1,wd.findFrom=wd.findGapCursorFrom,bi.jsonID("gapcursor",wd);class xd{constructor(e){this.pos=e}map(e){return new xd(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return wd.valid(t)?new wd(t):bi.near(t)}}const kd=pl({ArrowLeft:_d("horiz",-1),ArrowRight:_d("horiz",1),ArrowUp:_d("vert",-1),ArrowDown:_d("vert",1)});function _d(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof _i){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=wd.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new wd(l))),!0)}}function Sd(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!wd.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&Ci.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new wd(r))),!0)}function Cd(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof wd))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Cn.empty;for(let s=r.length-1;s>=0;s--)i=Cn.from(r[s].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new Nn(i,0,0));return o.setSelection(_i.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function Td(e){if(!(e.selection instanceof wd))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Oa.create(e.doc,[Sa.widget(e.selection.head,t,{key:"gapcursor"})])}const Od=tc.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Bi({props:{decorations:Td,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&wd.valid(n)?new wd(n):null,handleClick:Sd,handleKeyDown:kd,handleDOMEvents:{beforeinput
1:Cd}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=Bl(Nl(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),Md=qc.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Ll(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&o){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ed=qc.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((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ll(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>Hc({find:new RegExp(`^(#{1,${e}}
1)\\s$`),type:this.type,getAttributes:{level:e}})))}});var Ad=200,Nd=function(){};Nd.prototype.append=function(e){return e.length?(e=Nd.from(e),!this.length&&e||e.length<Ad&&this.leafAppend(e)||this.length<Ad&&e.leafPrepend(this)||this.appendInner(e)):this},Nd.prototype.prepend=function(e){return e.length?Nd.from(e).append(this):this},Nd.prototype.appendInner=function(e){return new Dd(this,e)},Nd.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Nd.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Nd.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Nd.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Nd.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Nd.from=function(e){return e instanceof Nd?e:e&&e.length?new Id(e):Nd.empty};var Id=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Ad)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Ad)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Nd);Nd.empty=new Id([]);var Dd=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Nd);class Rd{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Ld(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Ld(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new Rd(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:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;c<e.steps.length;c++){let n,l=e.steps[c].invert(e.docs[c]),d=new Ld(e.mapping.maps[c],l,t);(n=a&&a.merge(d))&&(d=n,c?i.pop():s=s.slice(0,s.length-1)),i.push(d),t&&(o++,t=void 0),r||(a=d)}let l=o-n.depth;return l>zd&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new Rd(s.append(i),o)}remapping(e,t){let n=new Pr;
1return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Rd(this.items.append(e.map((e=>new Ld(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new Ld(l,o,c))}else n.push(new Ld(l))}),r);let l=[];for(let u=t;u<o;u++)l.push(new Ld(i.maps[u]));let c=this.items.slice(0,r).append(l).append(n),d=new Rd(c,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,c=new Ld(s.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new Rd(Nd.from(r.reverse()),i)}}Rd.empty=new Rd(Nd.empty,0);class Ld{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Ld(t.getMap().invert(),t,this.selection)}}}class Pd{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const zd=20;function Bd(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,i)=>t.push(r,i)));return t}function jd(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let Fd=!1,$d=null;function Vd(e){let t=e.plugins;if($d!=t){Fd=!1,$d=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Fd=!0;break}}return Fd}const Hd=new $i("history"),Ud=new $i("closeHistory");function Wd(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Bi({key:Hd,state:{init:()=>new Pd(Rd.empty,Rd.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(Hd);if(o)return o.historyState;n.getMeta(Ud)&&(e=new Pd(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Hd))return s.getMeta(Hd).redo?new Pd(e.done.addTransform(n,void 0,r,Vd(t)),e.undone,Bd(n.mapping.maps),e.prevTime,e.prevComposition):new Pd(e.done,e.undone.addTransform(n,void 0,r,Vd(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Pd(e.done.rebased(n,i),e.undone.rebased(n,i),jd(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Pd(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),jd(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),a=s?jd(e.prevRanges,n.mapping):Bd(n.mapping.maps);return new Pd(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,Vd(t)),Rd.empty,a,n.time,null==i?e.prevComposition:i)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Kd:"historyRedo"==n?Jd:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function qd(e,t){return(n,r)=>{let i=Hd.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=Vd(t),i=Hd.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new Pd(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Hd,{redo:n,historyState:l})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const Kd=qd(!1,!0),Jd=qd(!0,!0),Gd=tc.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Kd(e,t),redo:()=>({state:e,dispatch:t})=>Jd(e,t)}),addProseMirrorPlugins(){return[Wd(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),Zd=qc.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Ll(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:i}=n,o=e();return 0===r.parentOffset?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):n instanceof Ci?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();
vendor: 1,215 bytes, line 1
1if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(_i.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(Ci.create(e.doc,t.pos)):e.setSelection(_i.create(e.doc,t.pos));else{const i=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(_i.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[Vc({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.type})]}}),Xd=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Yd=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Qd=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,eu=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,tu=Wc.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
1,addInputRules(){return[$c({find:Xd,type:this.type}),$c({find:Qd,type:this.type})]},addPasteRules(){return[Jc({find:Yd,type:this.type}),Jc({find:eu,type:this.type})]}}),nu=qc.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Ll(this.options.HTMLAttributes,e),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)}}}),ru=qc.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Ll(this.options.HTMLAttributes,e),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)}}}),iu=Wc.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=kc(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),ou=/^(\d+)\.\s$/,su=qc.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Ll(this.options.HTMLAttributes,n),0]:["ol",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ru.name,this.editor.getAttributes(iu.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Uc({find:ou,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Uc({find:ou,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(iu.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),au=qc.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),lu=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,cu=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,du=Wc.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[$c({find:lu,type:this.type})]}
1,addPasteRules(){return[Jc({find:cu,type:this.type})]}}),uu=qc.create({name:"text",group:"inline"}),hu=tc.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,s,a,l,c,d,u,h,p,f,m,g,v;const y=[];return!1!==this.options.bold&&y.push(od.configure(null===(e=this.options)||void 0===e?void 0:e.bold)),!1!==this.options.blockquote&&y.push(ed.configure(null===(t=this.options)||void 0===t?void 0:t.blockquote)),!1!==this.options.bulletList&&y.push(cd.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&y.push(hd.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&y.push(md.configure(null===(i=this.options)||void 0===i?void 0:i.codeBlock)),!1!==this.options.document&&y.push(gd.configure(null===(o=this.options)||void 0===o?void 0:o.document)),!1!==this.options.dropcursor&&y.push(bd.configure(null===(s=this.options)||void 0===s?void 0:s.dropcursor)),!1!==this.options.gapcursor&&y.push(Od.configure(null===(a=this.options)||void 0===a?void 0:a.gapcursor)),!1!==this.options.hardBreak&&y.push(Md.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&y.push(Ed.configure(null===(c=this.options)||void 0===c?void 0:c.heading)),!1!==this.options.history&&y.push(Gd.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&y.push(Zd.configure(null===(u=this.options)||void 0===u?void 0:u.horizontalRule)),!1!==this.options.italic&&y.push(tu.configure(null===(h=this.options)||void 0===h?void 0:h.italic)),!1!==this.options.listItem&&y.push(nu.configure(null===(p=this.options)||void 0===p?void 0:p.listItem)),!1!==this.options.orderedList&&y.push(su.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&y.push(au.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&y.push(du.configure(null===(g=this.options)||void 0===g?void 0:g.strike)),!1!==this.options.text&&y.push(uu.configure(null===(v=this.options)||void 0===v?void 0:v.text)),y}});var pu="top",fu="bottom",mu="right",gu="left",vu="auto",yu=[pu,fu,mu,gu],bu="start",wu="end",xu="clippingParents",ku="viewport",_u="popper",Su="reference",Cu=yu.reduce((function(e,t){return e.concat([t+"-"+bu,t+"-"+wu])}),[]),Tu=[].concat(yu,[vu]).reduce((function(e,t){return e.concat([t,t+"-"+bu,t+"-"+wu])}),[]),Ou=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Mu(e){return e?(e.nodeName||"").toLowerCase():null}function Eu(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Au(e){return e instanceof Eu(e).Element||e instanceof Element}function Nu(e){return e instanceof Eu(e).HTMLElement||e instanceof HTMLElement}function Iu(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Eu(e).ShadowRoot||e instanceof ShadowRoot)}const Du={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Nu(i)&&Mu(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});
vendor: 4,470 bytes, line 1
1Nu(r)&&Mu(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ru(e){return e.split("-")[0]}var Lu=Math.max,Pu=Math.min,zu=Math.round;function Bu(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function ju(){return!/^((?!chrome|android).)*safari/i.test(Bu())}function Fu(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Nu(e)&&(i=e.offsetWidth>0&&zu(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&zu(r.height)/e.offsetHeight||1);var s=(Au(e)?Eu(e):window).visualViewport,a=!ju()&&n,l=(r.left+(a&&s?s.offsetLeft:0))/i,c=(r.top+(a&&s?s.offsetTop:0))/o,d=r.width/i,u=r.height/o;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function $u(e){var t=Fu(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Vu(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Iu(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Hu(e){return Eu(e).getComputedStyle(e)}function Uu(e){return["table","td","th"].indexOf(Mu(e))>=0}function Wu(e){return((Au(e)?e.ownerDocument:e.document)||window.document).documentElement}function qu(e){return"html"===Mu(e)?e:e.assignedSlot||e.parentNode||(Iu(e)?e.host:null)||Wu(e)}function Ku(e){return Nu(e)&&"fixed"!==Hu(e).position?e.offsetParent:null}function Ju(e){for(var t=Eu(e),n=Ku(e);n&&Uu(n)&&"static"===Hu(n).position;)n=Ku(n);return n&&("html"===Mu(n)||"body"===Mu(n)&&"static"===Hu(n).position)?t:n||function(e){var t=/firefox/i.test(Bu());if(/Trident/i.test(Bu())&&Nu(e)&&"fixed"===Hu(e).position)return null;var n=qu(e);for(Iu(n)&&(n=n.host);Nu(n)&&["html","body"].indexOf(Mu(n))<0;){var r=Hu(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Gu(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Zu(e,t,n){return Lu(e,Pu(t,n))}function Xu(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Yu(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Qu(e){return e.split("-")[1]}var eh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function th(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,h=s.x,p=void 0===h?0:h,f=s.y,m=void 0===f?0:f,g="function"==typeof d?d({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=gu,w=pu,x=window;if(c){var k=Ju(n),_="clientHeight",S="clientWidth";if(k===Eu(n)&&"static"!==Hu(k=Wu(n)).position&&"absolute"===a&&(_="scrollHeight",S="scrollWidth"),i===pu||(i===gu||i===mu)&&o===wu)w=fu,m-=(u&&k===x&&x.visualViewport?x.visualViewport.height:k[_])-r.height,m*=l?1:-1;if(i===gu||(i===pu||i===fu)&&o===wu)b=mu,p-=(u&&k===x&&x.visualViewport?x.visualViewport.width:k[S])-r.width,p*=l?1:-1}var C,T=Object.assign({position:a},c&&eh),O=!0===d?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:zu(n*i)/i||0,y:zu(r*i)/i||0}}({x:p,y:m},Eu(n)):{x:p,y:m};return p=O.x,m=O.y,l?Object.assign({},T,((C={})[w]=y?"0":"",C[b]=v?"0":"",C.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",C)):Object.assign({},T,((t={})[w]=y?m+"px":"",t[b]=v?p+"px":"",t.transform="",t))}var nh={passive:!0};var rh={left:"right",right:"left",bottom:"top",top:"bottom"};function ih(e){return e.replace(/left|right|bottom|top/g,(function(e){return rh[e]}))}var oh={start:"end",end:"start"};function sh(e){return e.replace(/start|end/g,(function(e){return oh[e]}))}function ah(e){var t=Eu(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function lh(e){return Fu(Wu(e)).left+ah(e).scrollLeft}function ch(e){var t=Hu(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function dh(e){return["html","body","#document"].indexOf(Mu(e))>=0?e.ownerDocument.body:Nu(e)&&ch(e)?e:dh(qu(e))}function uh(e,t){var n;void 0===t&&(t=[]);var r=dh(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Eu(r),s=i?[o].concat(o.visualVie
vendor: 4,702 bytes, line 1
1wport||[],ch(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(uh(qu(s)))}function hh(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ph(e,t,n){return t===ku?hh(function(e,t){var n=Eu(e),r=Wu(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=ju();(c||!c&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+lh(e),y:l}}(e,n)):Au(t)?function(e,t){var n=Fu(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):hh(function(e){var t,n=Wu(e),r=ah(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Lu(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Lu(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+lh(e),l=-r.scrollTop;return"rtl"===Hu(i||n).direction&&(a+=Lu(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Wu(e)))}function fh(e,t,n,r){var i="clippingParents"===t?function(e){var t=uh(qu(e)),n=["absolute","fixed"].indexOf(Hu(e).position)>=0&&Nu(e)?Ju(e):e;return Au(n)?t.filter((function(e){return Au(e)&&Vu(e,n)&&"body"!==Mu(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce((function(t,n){var i=ph(e,n,r);return t.top=Lu(i.top,t.top),t.right=Pu(i.right,t.right),t.bottom=Pu(i.bottom,t.bottom),t.left=Lu(i.left,t.left),t}),ph(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function mh(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ru(i):null,s=i?Qu(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case pu:t={x:a,y:n.y-r.height};break;case fu:t={x:a,y:n.y+n.height};break;case mu:t={x:n.x+n.width,y:l};break;case gu:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?Gu(o):null;if(null!=c){var d="y"===c?"height":"width";switch(s){case bu:t[c]=t[c]-(n[d]/2-r[d]/2);break;case wu:t[c]=t[c]+(n[d]/2-r[d]/2)}}return t}function gh(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,s=void 0===o?e.strategy:o,a=n.boundary,l=void 0===a?xu:a,c=n.rootBoundary,d=void 0===c?ku:c,u=n.elementContext,h=void 0===u?_u:u,p=n.altBoundary,f=void 0!==p&&p,m=n.padding,g=void 0===m?0:m,v=Xu("number"!=typeof g?g:Yu(g,yu)),y=h===_u?Su:_u,b=e.rects.popper,w=e.elements[f?y:h],x=fh(Au(w)?w:w.contextElement||Wu(e.elements.popper),l,d,s),k=Fu(e.elements.reference),_=mh({reference:k,element:b,strategy:"absolute",placement:i}),S=hh(Object.assign({},b,_)),C=h===_u?S:k,T={top:x.top-C.top+v.top,bottom:C.bottom-x.bottom+v.bottom,left:x.left-C.left+v.left,right:C.right-x.right+v.right},O=e.modifiersData.offset;if(h===_u&&O){var M=O[i];Object.keys(T).forEach((function(e){var t=[mu,fu].indexOf(e)>=0?1:-1,n=[pu,fu].indexOf(e)>=0?"y":"x";T[e]+=M[n]*t}))}return T}const vh={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=void 0===p||p,m=n.allowedAutoPlacements,g=t.options.placement,v=Ru(g),y=l||(v===g||!f?[ih(g)]:function(e){if(Ru(e)===vu)return[];var t=ih(e);return[sh(e),t,sh(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(Ru(n)===vu?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Tu:l,d=Qu(r),u=d?a?Cu:Cu.filter((function(e){return Qu(e)===d})):yu,h=u.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=u);var p=h.reduce((function(t,n){return t[n]=gh(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[Ru(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,x=t.rects.popper,k=new Map,_=!0,S=b[0],C=0;C<b.length;C++){var T=b[C],O=Ru(T),M=Qu(T)===bu,E=[pu,fu].indexOf(O)>=0,A=E?"width":"height",N=gh(t,{placement:T,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),I=E?M?mu:gu:M?fu:pu;w[A]>x[A]&&(I=ih(I));var D=ih(I),R=[];if(o&&R.push(N[O]<=0),a&&R.push(N[I]<=0,N[D]<=0),R.every((function(e){return e}))){S=T,_=!1;break}k.set(T,R)}if(_)for(var L=function(e){var t=b.find((function(t){var n=k.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},P=f?3:1;P>0;P--){if("break"===L(P))break}t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};
vendor: 6,896 bytes, line 1
1function yh(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bh(e){return[pu,mu,fu,gu].some((function(t){return e[t]>=0}))}function wh(e,t,n){void 0===n&&(n=!1);var r,i,o=Nu(t),s=Nu(t)&&function(e){var t=e.getBoundingClientRect(),n=zu(t.width)/e.offsetWidth||1,r=zu(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=Wu(t),l=Fu(e,s,n),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(o||!o&&!n)&&(("body"!==Mu(t)||ch(a))&&(c=(r=t)!==Eu(r)&&Nu(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:ah(r)),Nu(t)?((d=Fu(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):a&&(d.x=lh(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function xh(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var kh={placement:"bottom",modifiers:[],strategy:"absolute"};function _h(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Sh(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?kh:i;return function(e,t,n){void 0===n&&(n=o);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},kh,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,d={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;u(),a.options=Object.assign({},o,a.options,i),a.scrollParents={reference:Au(e)?uh(e):e.contextElement?uh(e.contextElement):[],popper:uh(t)};var s,c,h=function(e){var t=xh(e);return Ou.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(r,a.options.modifiers),c=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(c).map((function(e){return c[e]}))));return a.orderedModifiers=h.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:a,name:t,instance:d,options:r}),s=function(){};l.push(o||s)}})),d.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(_h(t,n)){a.rects={reference:wh(t,Ju(n),"fixed"===a.options.strategy),popper:$u(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options,l=void 0===s?{}:s,u=i.name;"function"==typeof o&&(a=o({state:a,options:l,name:u,instance:d})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){d.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){u(),c=!0}};if(!_h(e,t))return d;function u(){l.forEach((function(e){return e()})),l=[]}return d.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),d}}var Ch=Sh({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=Eu(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,nh)})),a&&l.addEventListener("resize",n.update,nh),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,nh)})),a&&l.removeEventListener("resize",n.update,nh)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=mh({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:Ru(t.placement),variation:Qu(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,th(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,th(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Du,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=Tu.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ru(e),i=[gu,pu].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[gu,mu].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}},vh,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,h=n.tether,p=void 0===h||h,f=n.tetherOffset,m=void 0===f?0:f,g=gh(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),v=Ru(t.placement),y=Qu(t.placement),b=!y,w=Gu(v),x="x"===w?"y":"x",k=t.modifiersData.popperOffsets,_=t.rects.reference,S=t.rects.popper,C="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,T="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(k){if(o){var E,A="y"===w?pu:gu,N="y"===w?fu:mu,I="y"===w?"height":"width",D=k[w],R=D+g[A],L=D-g[N],P=p?-S[I]/2:0,z=y===bu?_[I]:S[I],B=y===bu?-S[I]:-_[I],j=t.elements.arrow,F=p&&j?$u(j):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=$[A],H=$[N],U=Zu(0,_[I],F[I]),W=b?_[I]/2-P-U-V-T.mainAxis:z-U-V-T.mainAxis,q=b?-_[I]/2+P+U+H+T.mainAxis:B+U+H+T.mainAxis,K=t.elements.arrow&&Ju(t.elements.arrow),J=K?"y"===w?K.clientTop||0:K.clientLeft||0:0,G=null!=(E=null==O?void 0:O[w])?E:0,Z=D+q-G,X=Zu(p?Pu(
vendor: 4,704 bytes, line 1
1R,D+W-G-J):R,D,p?Lu(L,Z):L);k[w]=X,M[w]=X-D}if(a){var Y,Q="x"===w?pu:gu,ee="x"===w?fu:mu,te=k[x],ne="y"===x?"height":"width",re=te+g[Q],ie=te-g[ee],oe=-1!==[pu,gu].indexOf(v),se=null!=(Y=null==O?void 0:O[x])?Y:0,ae=oe?re:te-_[ne]-S[ne]-se+T.altAxis,le=oe?te+_[ne]+S[ne]-se-T.altAxis:ie,ce=p&&oe?(ue=Zu(ae,te,de=le))>de?de:ue:Zu(p?ae:re,te,p?le:ie);k[x]=ce,M[x]=ce-te}var de,ue;t.modifiersData[r]=M}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ru(n.placement),l=Gu(a),c=[gu,mu].indexOf(a)>=0?"height":"width";if(o&&s){var d=function(e,t){return Xu("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Yu(e,yu))}(i.padding,n),u=$u(o),h="y"===l?pu:gu,p="y"===l?fu:mu,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=Ju(o),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=f/2-m/2,b=d[h],w=v-u[c]-d[p],x=v/2-u[c]/2+y,k=Zu(b,x,w),_=l;n.modifiersData[r]=((t={})[_]=k,t.centerOffset=k-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Vu(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=gh(t,{elementContext:"reference"}),a=gh(t,{altBoundary:!0}),l=yh(s,r),c=yh(a,i,o),d=bh(l),u=bh(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]}),Th="tippy-content",Oh="tippy-backdrop",Mh="tippy-arrow",Eh="tippy-svg-arrow",Ah={passive:!0,capture:!0},Nh=function(){return document.body};function Ih(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Dh(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Rh(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Lh(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ph(e){return[].concat(e)}function zh(e,t){-1===e.indexOf(t)&&e.push(t)}function Bh(e){return[].slice.call(e)}function jh(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Fh(){return document.createElement("div")}function $h(e){return["Element","Fragment"].some((function(t){return Dh(e,t)}))}function Vh(e){return $h(e)?[e]:function(e){return Dh(e,"NodeList")}(e)?Bh(e):Array.isArray(e)?e:Bh(document.querySelectorAll(e))}function Hh(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Uh(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Wh(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function qh(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Kh={isTouch:!1},Jh=0;function Gh(){Kh.isTouch||(Kh.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zh))}function Zh(){var e=performance.now();e-Jh<20&&(Kh.isTouch=!1,document.removeEventListener("mousemove",Zh)),Jh=e}function Xh(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var Yh=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,Qh=Object.assign({appendTo:Nh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),ep=Object.keys(Qh);function tp(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;
vendor: 9,279 bytes, line 1
1i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=Qh[i])?r:o);return t}),{});return Object.assign({},e,t)}function np(e,t){var n=Object.assign({},t,{content:Rh(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(tp(Object.assign({},Qh,{plugins:t}))):ep).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(i){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Qh.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var rp=function(){return"innerHTML"};function ip(e,t){e[rp()]=t}function op(e){var t=Fh();return!0===e?t.className=Mh:(t.className=Eh,$h(e)?t.appendChild(e):ip(t,e)),t}function sp(e,t){$h(t.content)?(ip(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ip(e,t.content):e.textContent=t.content)}function ap(e){var t=e.firstElementChild,n=Bh(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Th)})),arrow:n.find((function(e){return e.classList.contains(Mh)||e.classList.contains(Eh)})),backdrop:n.find((function(e){return e.classList.contains(Oh)}))}}function lp(e){var t=Fh(),n=Fh();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Fh();function i(n,r){var i=ap(t),o=i.box,s=i.content,a=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||sp(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(o.removeChild(a),o.appendChild(op(r.arrow))):o.appendChild(op(r.arrow)):a&&o.removeChild(a)}return r.className=Th,r.setAttribute("data-state","hidden"),sp(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lp.$$tippy=!0;var cp=1,dp=[],up=[];function hp(e,t){var n,r,i,o,s,a,l,c,d=np(e,Object.assign({},Qh,tp(jh(t)))),u=!1,h=!1,p=!1,f=!1,m=[],g=Lh(K,d.interactiveDebounce),v=cp++,y=(c=d.plugins).filter((function(e,t){return c.indexOf(e)===t})),b={id:v,reference:e,popper:Fh(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(b.state.isDestroyed)return;D("onBeforeUpdate",[b,t]),W();var n=b.props,r=np(e,Object.assign({},n,jh(t),{ignoreAttributes:!0}));b.props=r,U(),n.interactiveDebounce!==r.interactiveDebounce&&(P(),g=Lh(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ph(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");L(),I(),k&&k(n,r);b.popperInstance&&(X(),Q().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));D("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Kh.isTouch&&!b.props.touch,i=Ih(b.props.duration,0,Qh.duration);if(e||t||n||r)return;if(M().hasAttribute("disabled"))return;if(D("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,O()&&(x.style.visibility="visible");I(),F(),b.state.isMounted||(x.style.transition="none");if(O()){var o=A();Hh([o.box,o.content],0)}a=function(){var e;if(b.state.isVisible&&!f){if(f=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,O()&&b.props.animation){var t=A(),n=t.box,r=t.content;Hh([n,r],i),Uh([n,r],"visible")}R(),L(),zh(up,b),null==(e=b.popperInstance)||e.forceUpdate(),D("onMount",[b]),b.props.animation&&O()&&function(e,t){V(e,t)}(i,(function(){b.state.isShown=!0,D("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=M();e=b.props.interactive&&t===Nh||"parent"===t?n.parentNode:Rh(t,[n]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,X()}()},hide:function(){var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Ih(b.props.duration,1,Qh.duration);if(e||t||n)return;if(D("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,f=!1,u=!1,O()&&(x.style.visibility="hidden");if(P(),$(),I(!0),O()){var i=A(),o=i.box,s=i.content;b.props.animation&&(Hh([o,s],r),Uh([o,s],"hidden"))}R(),L(),b.props.animation?O()&&function(e,t){V(e,(function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){E().addEventListener("mousemove",g),zh(dp,g),g(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){b.state.isVisible&&b.hide();if(!b.state.isMounted)return;Y(),Q().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);up=up.filter((function(e){return e!==b})),b.state.isMounted=!1,D("onHidden",[b])},destroy:function(){if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),W(),delete e._tippy,b.state.isDestroyed=!0,D("onDestroy",[b])}};if(!d.render)return b;var w=d.render(b),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var _=y.map((function(e){return e.fn(b)})),S=e.hasAttribute("aria-expanded");return U(),L(),I(),D("onCreate",[b]),d.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&E().addEventListener("mousemove",g)})),b;function C(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function T(){return"hold"===C()[0]}function O(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function M(){return l||e}function E(){var e,t,n=M().parentNode;return n?null!=(t=Ph(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function A(){return ap(x)}function N(e){return b.state.isMounted&&!b.state.isVisible||Kh.isTouch||o&&"focus"===o.type?0:Ih(b.props.delay,e?0:1,Qh.delay)}function I(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function D(e,t,n){var r;(void 0===n&&(n=!0),_.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function R(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ph(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function L(){!S&&b.props.aria.expanded&&Ph(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===M()?"true":"false"):e.removeAttribute("aria-expanded")}))}function P(){E().removeEventListener("mousemove",g),dp=dp.filter((function(e){return e!==g}))}function z(t){if(!Kh.isTouch||!p&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!qh(x,n)){if(Ph(b.props.triggerTarget||e).some((function(e){return qh(e,n)}))){if(Kh.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),h=!0,setTimeout((function(){h=!1})),b.state.isMounted||$())}}}function B(){p=!0}function j(){p=!1}function F(){var e=E();e.addEventListener("mousedown",z,!0),e.addEventListener("touchend",z,Ah),e.addEventListener("touchstart",j,Ah),e.addEventListener("touchmove",B,Ah)}function $(){var e=E();e.removeEventListener("mousedown",z,!0),e.removeEventListener("touchend",z,Ah),e.removeEventListener("touchstart",j,Ah),e.removeEventListener("touchmove",B,Ah)}function V(e,t){var n=A().box;function r(e){e.target===n&&(Wh(n,"remove",r),t())}if(0===e)return t();Wh(n,"remove",s),Wh(n,"add",r),s=r}function H(t,n,r){void 0===r&&(r=!1),Ph(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function U(){var e;T()&&(H("touchstart",q,{passive:!0}),H("touchend",J,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",J);break;case"focus":H(Yh?"focusout":"blur",G);break;case"focusin":H("focusout",G)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function q(e){var t,n=!1;if(b.state.isEnabled&&!Z(e)&&!h){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,L(),!b.state.isVisible&&Dh(e,"MouseEvent")&&dp.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||u)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(u=!n),n&&!r&&te(e)}}function K(e){var t=e.target,n=M().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;
1return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,s=i.placement.split("-")[0],a=i.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,d="right"===s?a.left.x:0,u="left"===s?a.right.x:0,h=t.top-r+l>o,p=r-t.bottom-c>o,f=t.left-n+d>o,m=n-t.right-u>o;return h||p||f||m}))}(Q().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(P(),te(e))}function J(e){Z(e)||b.props.trigger.indexOf("click")>=0&&u||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function G(e){b.props.trigger.indexOf("focusin")<0&&e.target!==M()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function Z(e){return!!Kh.isTouch&&T()!==e.type.indexOf("touch")>=0}function X(){Y();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,l=O()?ap(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||M()}:e,d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(O()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];O()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),b.popperInstance=Ch(c,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function Y(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return Bh(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&D("onTrigger",[b,e]),F();var t=N(!0),r=C(),i=r[0],o=r[1];Kh.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),D("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&u)){var t=N(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else $()}}function pp(e,t){void 0===t&&(t={});var n=Qh.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Gh,Ah),window.addEventListener("blur",Xh);var r=Object.assign({},t,{plugins:n}),i=Vh(e).reduce((function(e,t){var n=t&&hp(t,r);return n&&e.push(n),e}),[]);return $h(e)?i[0]:i}function fp(e){return V(((t,n)=>({get:()=>(t(),e),set(t){e=t,requestAnimationFrame((()=>{requestAnimationFrame((()=>{n()}))}))}})))}pp.defaultProps=Qh,pp.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Qh[t]=e[t]}))},pp.currentInput=Kh,Object.assign({},Du,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),pp.setDefaultProps({render:lp});class mp extends Fc{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=fp(this.view.state),this.reactiveExtensionStorage=fp(this.extensionStorage),this.on("beforeTransaction",(({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage})),P(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const gp=r({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=i(),n=$();return o((()=>{const r=e.editor;r&&r.options.element&&t.value&&B((()=>
1{if(!t.value||!r.options.element.firstChild)return;const e=p(t.value);t.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:e}),r.createNodeViews()}))})),A((()=>{const t=e.editor;if(!t)return;if(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,t.appContext=null,!t.options.element.firstChild)return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})})),{rootEl:t}},render(){return j("div",{ref:e=>{this.rootEl=e}})}}),vp=r({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return j(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))}});class yp{constructor(e,{props:t={},editor:n}){this.editor=n,this.component=P(e),this.el=document.createElement("div"),this.props=I(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t,n,r;return(null===(t=null===(e=this.renderedComponent.vNode)||void 0===e?void 0:e.component)||void 0===t?void 0:t.exposed)?this.renderedComponent.vNode.component.exposed:null===(r=null===(n=this.renderedComponent.vNode)||void 0===n?void 0:n.component)||void 0===r?void 0:r.proxy}renderComponent(){let e=j(this.component,this.props);this.editor.appContext&&(e.appContext=this.editor.appContext),"undefined"!=typeof document&&this.el&&F(e,this.el);return{vNode:e,destroy:()=>{this.el&&F(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach((([e,t])=>{this.props[e]=t})),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}class bp extends Kc{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()},t=this.onDragStart.bind(this);this.decorationClasses=i(this.getDecorationClasses());const n=r({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:e=>{var n,r;return z("onDragStart",t),z("decorationClasses",this.decorationClasses),null===(r=(n=this.component).setup)||void 0===r?void 0:r.call(n,e,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.renderer=new yp(n,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}update(e,t){const n=e=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(e)};if("function"==typeof this.options.update){const r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e.type===this.node.type&&(e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map((e=>e.type.attrs.class)).flat().join(" ")}destroy(){this.renderer.destroy()}}function wp(e,t){return n=>{if(!n.editor.contentComponent)return{};const r="function"==typeof e&&"__vccOpts"in e?e.__vccOpts:e;return new bp(r,n,t)}}const xp={class:"sence-bg"},kp=["src"],_p={class:"mask"},Sp=["onClick"],Cp=r({__name:"SenceBg",emits:["chooseSence"],setup(e,{emit:t}){const n=X(),r=x((()=>n.seriesSence)),i=t;return(e,t)=>(s(),a("div",xp,[(s(!0),a(u,null,h(p(r),((e,t)=>(s(),a("div",{class:"item",key:t},[l("img",{src:e,alt:"ä¼å½±"},null,8,kp),l("div",_p,[l("div",{onClick:t=>(e=>{i("chooseSence",e)})(e)},"åºç¨",8,Sp)])])))),128))]))}}),Tp=ie(Cp,[["__scopeId","data-v-2d2de7ba"]]),Op=e=>(b("data-v-9a99ced9"),e=e(),w(),e),Mp={class:"scene-title"},Ep={class:"title"},Ap={class:"right-box"},Np={class:"enter"},Ip=["src"],Dp=Op((()=>l("span",null,"éæ©åºæ¯",-1))),Rp={class:"enter"},Lp=["src"],Pp=Op((()=>l("span",null,"éæ©å¸å±",-1))),zp=ie(r({__name:"title",props:{node:{type:Object,required:!0}},setup(t){const n=i("第ä¸åº"),r=t,o=X(),u=i(Number(r.node.attrs.index)),h=i(),g=x((()=>{const t=b(),r=o.dramaForm.drama,i=oe(r,`scene_list.${t}.bg_url`,""),s=oe(r,`scene_list.${t}.layout`,{});n.value=`第${e(t+1)}åº`;return{sence:i||null,layout:(null==s?void 0:s.url)||null}})),y=e=>{o.setSenceUrl({url:e,index:h.value+1})},b=()=>{let e=h.value||u.value;const t=r.node.attrs.index,n=o.newSenceIndex;return"string"==typeof t&&Number(t)+1===n?e=Number(t)+1:e+1>n&&e++,h.value=H(e),e},w=e=>e?"enter-img":"enter-add",_=()=>{o.setSenceIndex(h.value+1),o.chooseSence(!0)},C=()=>{o.chooseLayout(!0),o.setSenceIndex(u.value+1)};return A((()=>{h.value=void 0})),(e,t)=>{const r=Y,i=ue;return s(),f(p(vp),{class:"vue-component"},{default:d((()=>[l("div",Mp,[l("div",Ep,m(p(n)),1),l("div",Ap,[c(i,null,S({default:d((()=>[l("div",Np,[l("div",{class:k(w(g.value.sence)),onClick:_}
1,[g.value.sence?(s(),a("img",{key:0,src:g.value.sence,alt:"ä¼å½±"},null,8,Ip)):v("",!0),g.value.sence?v("",!0):(s(),f(r,{key:1,name:"basis_add"})),g.value.sence?(s(),f(r,{key:2,class:"replace",name:"basis_replace"})):v("",!0)],2),Dp])])),_:2},[p(o).seriesSence.length?{name:"dropdown",fn:d((()=>[c(Tp,{onChooseSence:y})])),key:"0"}:void 0]),1024),l("div",Rp,[l("div",{class:k(w(g.value.layout)),onClick:C},[g.value.layout?(s(),a("img",{key:0,src:g.value.layout,alt:"ä¼å½±"},null,8,Lp)):v("",!0),g.value.layout?v("",!0):(s(),f(r,{key:1,name:"basis_add"})),g.value.layout?(s(),f(r,{key:2,class:"replace",name:"basis_replace"})):v("",!0)],2),Pp])])])])),_:1})}}}),[["__scopeId","data-v-9a99ced9"]]),Bp={DRAMA_TITLE:"dramaTitle",SCENE:"scene",SCENE_DESCRIPTION:"sceneDescription",DIALOG:"dialog",SHOT:"shot",ROLE_ITEM:"RoleItem",ROLE_AVATAR:"RoleAvatar",ROLE_NAME:"RoleName",UNSELECTABLE_TEXT:"unselectableText",CUSTOM_DOC:"customDoc",CUSTOM_BLOCK:"customBlock",CUSTOM_TEXT:"customText",SCENE_TITLE:"sceneTitle",PARAGRAPH:"paragraph",TEXT:"text",HEADING:"heading",IMAGE:"image"},jp={SCENE:"scene",OUTLINE:"outline",SHOT:"shot",SHOT_DESCRIPTION:"shotDescription",DIALOG:"dialog",DIALOG_CONTENT:"dialogContent",SCENE_TITLE:"sceneTitle"};function Fp(e){return{parseHTML:t=>t.getAttribute(e),renderHTML:t=>({[e]:t[e]})}}function $p(){return{index:{default:0,...Fp("index")},style:{default:"",...Fp("style")},"node-type":{default:"",...Fp("node-type")},class:{default:"",...Fp("class")},src:{default:"",...Fp("src")},alt:{default:"",...Fp("alt")},"role-id":{default:"",...Fp("role-id")},name:{default:"",...Fp("name")},thumbnail:{default:"",...Fp("thumbnail")}}}const Vp=au.extend({addAttributes:$p}),Hp=qc.create({name:Bp.CUSTOM_BLOCK,priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"block*",addAttributes:$p,parseHTML:()=>[{tag:"div.custom-block"}],renderHTML({HTMLAttributes:e}){return["div",Ll(this.options.HTMLAttributes,e,{class:"custom-block"}),0]}}),Up=qc.create({name:Bp.DRAMA_TITLE,group:"block",content:"inline*",parseHTML:()=>[{tag:"h1.title"}],renderHTML:({HTMLAttributes:e})=>["h1",{...e,class:"title"},0]}),Wp=qc.create({name:Bp.SCENE,group:"block",content:"block* paragraph*",addAttributes:()=>({index:{default:0,parseHTML:e=>e.getAttribute("index"),renderHTML:e=>({index:e.index})}}),parseHTML:()=>[{tag:"p.scene"}],renderHTML:({HTMLAttributes:e})=>["p",{...e,class:"scene"},0]}),qp=qc.create({name:Bp.SCENE_DESCRIPTION,group:"block",content:"block*",parseHTML:()=>[{tag:"p.scene-description"}],renderHTML:({HTMLAttributes:e})=>["p",{...e,class:"scene-description"},0]}),Kp=qc.create({name:Bp.DIALOG,group:"block",content:"block*",parseHTML:()=>[{tag:"p.dialog"}],renderHTML:({HTMLAttributes:e})=>["p",{...e,class:"dialog"},0]}),Jp=qc.create({name:Bp.ROLE_AVATAR,addOptions:()=>({HTMLAttributes:{}}),selectable:!1,addAttributes:$p,group:"inline",inline:!0,parseHTML:()=>[{tag:"img.role-avatar"}],renderHTML:({HTMLAttributes:e})=>["img",{...e,class:"role-avatar"},0]}),Gp=qc.create({name:Bp.ROLE_NAME,selectable:!1,group:"inline",priority:1e3,atom:!0,inline:!0,addAttributes:$p,parseHTML:()=>[{tag:"strong.role-name-unselectable"}],renderHTML:({HTMLAttributes:e})=>["strong",{...e,class:"role-name-unselectable"},0]}),Zp=qc.create({name:Bp.UNSELECTABLE_TEXT,selectable:!0,group:"inline",content:"inline*",inline:!0,addAttributes:$p,parseHTML:()=>[{tag:"text.text-unselectable"}],renderHTML:({HTMLAttributes:e})=>["text",{...e,class:"text-unselectable"},0]}),Xp=qc.create({name:Bp.CUSTOM_TEXT,group:"inline",inline:!0,content:"inline*",addAttributes:$p,parseHTML:()=>[{tag:"span.custom-text"}],renderHTML:({HTMLAttributes:e})=>["span",{...e,class:"custom-text"},0]}),Yp=qc.create({name:Bp.SCENE_TITLE,group:"block",atom:!0,addAttributes:()=>({index:{default:0,parseHTML:e=>e.getAttribute("index"),renderHTML:e=>({index:e.index})}}),parseHTML:()=>[{tag:"scene-title"}],renderHTML:({HTMLAttributes:e})=>["scene-title",Ll(e)],addNodeView:()=>wp(zp)}),Qp=(e=>(b("data-v-ef9cfb11"),e=e(),w(),e))((()=>l("div",{class:"operate"},null,-1))),ef=ie(r({__name:"index",setup:e=>(e,t)=>
1(s(),f(p(vp),null,{default:d((()=>[Qp])),_:1}))}),[["__scopeId","data-v-ef9cfb11"]]),tf=qc.create({name:"OperateButton",group:"block",atom:!0,addAttributes:()=>({}),parseHTML:()=>[{tag:"operate-button"}],renderHTML:({HTMLAttributes:e})=>["operate-button",Ll(e)],addNodeView:()=>wp(ef)});function nf(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=e,a=n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");const l=new RegExp(`\\s${a}$`),c=o?"^":"",d=r?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),u=(null===(t=s.nodeBefore)||void 0===t?void 0:t.isText)&&s.nodeBefore.text;if(!u)return null;const h=s.pos-u.length,p=Array.from(u.matchAll(d)).pop();if(!p||void 0===p.input||void 0===p.index)return null;const f=p.input.slice(Math.max(0,p.index-1),p.index),m=new RegExp(`^[${null==i?void 0:i.join("")}\0]?$`).test(f);if(null!==i&&!m)return null;const g=h+p.index;let v=g+p[0].length;return r&&l.test(u.slice(v-1,v+1))&&(p[0]+=" ",v+=1),g<s.pos&&v>=s.pos?{range:{from:g,to:v},query:p[0].slice(n.length),text:p[0]}:null}const rf=new $i("suggestion");function of({pluginKey:e=rf,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=()=>null,items:c=()=>[],render:d=()=>({}),allow:u=()=>!0,findSuggestionMatch:h=nf}){let p;const f=null==d?void 0:d(),m=new Bi({key:e,view(){return{update:async(e,n)=>{var r,i,o,s,a,d,u;const h=null===(r=this.key)||void 0===r?void 0:r.getState(n),m=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),g=h.active&&m.active&&h.range.from!==m.range.from,v=!h.active&&m.active,y=h.active&&!m.active,b=v,w=!v&&!y&&h.query!==m.query||g,x=y;if(!b&&!w&&!x)return;const k=x&&!b?h:m,_=e.dom.querySelector(`[data-decoration-id="${k.decorationId}"]`);p={editor:t,range:k.range,query:k.query,text:k.text,items:[],command:e=>l({editor:t,range:k.range,props:e}),decorationNode:_,clientRect:_?()=>{var n;const{decorationId:r}=null===(n=this.key)||void 0===n?void 0:n.getState(t.state),i=e.dom.querySelector(`[data-decoration-id="${r}"]`);return(null==i?void 0:i.getBoundingClientRect())||null}:null},b&&(null===(o=null==f?void 0:f.onBeforeStart)||void 0===o||o.call(f,p)),w&&(null===(s=null==f?void 0:f.onBeforeUpdate)||void 0===s||s.call(f,p)),(w||b)&&(p.items=await c({editor:t,query:k.query})),x&&(null===(a=null==f?void 0:f.onExit)||void 0===a||a.call(f,p)),w&&(null===(d=null==f?void 0:f.onUpdate)||void 0===d||d.call(f,p)),b&&(null===(u=null==f?void 0:f.onStart)||void 0===u||u.call(f,p))},destroy:()=>{var e;p&&(null===(e=null==f?void 0:f.onExit)||void 0===e||e.call(f,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,s,a,l){const{isEditable:c}=t,{composing:d}=t.view,{selection:p}=e,{empty:f,from:m}=p,g={...s};if(g.composing=d,c&&(f||t.view.composing)){!(m<s.range.from||m>s.range.to)||d||s.composing||(g.active=!1);const e=h({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:p.$from}),a=`id_${Math.floor(4294967295*Math.random())}`;e&&u({editor:t,state:l,range:e.range,isActive:s.active})?(g.active=!0,g.decorationId=s.decorationId?s.decorationId:a,g.range=e.range,g.query=e.query,g.text=e.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=m.getState(e.state);return r&&(null===(n=null==f?void 0:f.onKeyDown)||void 0===n?void 0:n.call(f,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=m.getState(e);return t?Oa.create(e.doc,[Sa.inline(n.from,n.to,{nodeName:s,class:a,"data-decoration-id":r})]):null}}});return m}const sf=tc.create({name:"commands1",addOptions:()=>({suggestion:{char:"/",command:({editor:e,range:t,props:n})=>{n.command({editor:e,range:t})}}}),addProseMirrorPlugins(){const{suggestion:e}=this.options;return[of({editor:this.editor,pluginKey:new $i(`suggestion$${e.char}`),...e})]}}),af=[{value:1,label:"æ·»å 大纲",icon:"button_add_outline"},{value:2,label:"æ·»å æè¿°",icon:"button_add_description"},{value:3,label:"@è§è²æµç§°",icon:"button_add_dialogue"},{value:4,label:"æ·»å åºæ¬¡",icon:"button_add_session"}],lf=X();function cf(e,t,n="",...r){return{type:n||Bp.PARAGRAPH,content:[...r,{type:Bp.TEXT,text:e||" "}],attrs:{"node-type":t}}}function df(e){return{type:Bp.SCENE_TITLE,attrs:{index:e}}}function uf(e){const{scene_list:t}
1=e,{json:n,titleNode:r,scenesNode:i}=function(){const e={type:Bp.HEADING,attrs:{level:1},content:[]},t={type:Bp.CUSTOM_BLOCK,content:[]};return{json:{type:"doc",content:[t]},titleNode:e,scenesNode:t}}();return e.drama_name&&r.content.push({type:Bp.TEXT,text:e.drama_name}),t.forEach(((e,t)=>{const{plot_list:n,outline:r}=e;i.content.push(df(t)),i.content.push(cf(r||"",jp.OUTLINE,"",cf("大纲ï¼",jp.OUTLINE,Bp.UNSELECTABLE_TEXT))),(null==n?void 0:n.length)>0&&n.forEach(((e,t)=>{const{shot_list:n,desc:r}=e,o=cf(r,jp.SHOT_DESCRIPTION,"",cf(`æè¿°${t+1}ï¼`,jp.SHOT_DESCRIPTION,Bp.UNSELECTABLE_TEXT));i.content.push(o),n.forEach(((e,t)=>{const{name:n,dialogue:r,thumbnail:o,role_id:s}=e;n&&i.content.push(function(e,t,n,r){return{type:Bp.PARAGRAPH,content:[{type:Bp.UNSELECTABLE_TEXT,content:[{type:Bp.TEXT,text:`${t}: `}],attrs:{"node-type":jp.DIALOG}},{type:Bp.TEXT,text:n||" "}],attrs:{"node-type":jp.DIALOG,"role-id":r,name:t,thumbnail:e}}}(o,n,r,s))}))}))})),n}function hf(e,t={}){const{type:n,content:r=[],attrs:i={},text:o}=e,{noWrapper:s}=t,a=Object.keys(i).reduce(((e,t)=>`${e} ${t}="${i[t]}"`),"");let l="";return n===Bp.PARAGRAPH&&(l+=s?"":`<p ${a}>`,r.forEach((e=>{l+=hf(e,t)})),l+=s?"":"</p>"),n===Bp.TEXT&&o&&(l+=o),n===Bp.ROLE_AVATAR&&(l+=`<img contenteditable="false" class="role-avatar" ${a} />`),n===Bp.ROLE_NAME&&(l+='<strong node-type="role-name" contenteditable="false" class="role-name-unselectable">',r.forEach((e=>{l+=e.text+": "})),l+="</strong>"),n===Bp.UNSELECTABLE_TEXT&&(l+=`<text node-type="${i["node-type"]}" contenteditable="false" class="text-unselectable">`,r.forEach((e=>{l+=e.text+": "})),l+="</text>"),n===Bp.SCENE_TITLE&&(l+=`<scene-title ${a} index="${i.index||0}" node-type="scene-title" contenteditable="false" class="scene-title-unselectable"></scene-title><p></p>`),l}function pf(e,t,n,r=2){e.chain().insertContentAt({from:n-r,to:n},t,{updateSelection:!0}
1).focus().run()}function ff(e){const t=[];function n(e){const{type:r,content:i=[]}=e;[Bp.PARAGRAPH,Bp.SCENE_TITLE].includes(r)&&t.push(e),r===Bp.CUSTOM_BLOCK&&i.forEach((e=>{n(e)}))}return e.forEach((e=>{n(e)})),t}function mf(e){if(!e)return null;const t=e.getJSON(),{content:n=[]}=t,r={scene_list:[]};let i,o,s;return ff(n).forEach((e=>{const{type:t,content:n=[],attrs:a={}}=e;if(t===Bp.SCENE_TITLE){const{index:e}=a,t=lf.dramaForm.drama.scene_list[e];i={...t,plot_list:[]},o={shot_list:[],desc:""},r.scene_list.push(i),i.plot_list.push(o)}if(t===Bp.PARAGRAPH&&i&&o){const{isDialog:t,isOutline:r,isShotDesc:l}=function(e){const{attrs:t={},content:n=[]}=e,{"node-type":r}=t,i=G.get(n,"0.attrs.node-type"),o=i===jp.SHOT_DESCRIPTION,s=i===jp.DIALOG,a=r===jp.OUTLINE;return{isShotDesc:o,isDialog:s,isOutline:a}}(e);if(l&&(o={shot_list:[],desc:""},i.plot_list.push(o),o.desc=G.get(n,"1.text","")),r){const e=G.get(n,"1.text","");i.outline&&!e||(i.outline=G.get(n,"1.text",""))}if(t){const{"role-id":e,name:t,thumbnail:r}=a,i=G.get(n,"1.text","");i&&(s=function(e,t,n,r){return{role_id:Number(e),dialogue:t,name:n,thumbnail:r}}(Number(e),i,t,r),o.shot_list.push(s))}}})),r.scene_list=r.scene_list.filter((e=>e)),r.scene_list.forEach((e=>{e.plot_list=e.plot_list.filter((e=>e.desc||e.shot_list.length>0))})),{drama:r}}function gf(e){const t=G.get(e,"state.selection",{}),{$cursor:n}=t;return n?e.view.domAtPos(n.pos).node:void 0}function vf(e){e.chain().command((({tr:e})=>{const{$anchor:t,$head:n}=e.selection;return e.delete(t.before(),n.after()),e})).run()}const yf=X(),bf={props:{query:{type:String,required:!0},editor:{type:Object,required:!0},isOutline:{type:Boolean,default:!0}},data:()=>({selectedIndex:0,items:af,errorTip:!1,errorTipText:"æªè½æ¾å°ç»æ",subErrorTip:"æçä½ æ³"}),watch:{query(){this.handleItems(this.query)}},mounted(){this.handleItems(this.query)},methods:{handleItems(e){if(this.errorTipText="æªè½æ¾å°ç»æ",this.subErrorTip="æçä½ æ³",e){const t=af.filter((t=>t.label.includes(e)));t.length>0?af[0].label.includes(e)&&this.isOutline?(this.errorTip=!0,this.errorTipText="å½åä½ç½®ä¸å
许添å 大纲æä»¤",this.subErrorTip="ä½ å¯ä»¥",this.items=af.filter((e=>1!==e.value))):(this.items=t,this.errorTip=!1):(this.errorTip=!0,this.items=af),this.selectedIndex=0}else this.errorTip=!1,this.items=af,this.selectedIndex=this.isOutline?1:0},onKeyDown({event:e}){return"ArrowUp"===e.key?(this.upHandler(),!0):"ArrowDown"===e.key?(this.downHandler(),!0):"Enter"===e.key&&(this.enterHandler(),!0)},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length,1===this.items[this.selectedIndex].value&&this.isOutline&&this.upHandler()},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length,1===this.items[this.selectedIndex].value&&this.isOutline&&this.downHandler()},enterHandler(){this.selectItem(this.selectedIndex)},async selectItem(e){var t;const n=this.items[e],{value:r}=n,i=gf(this.editor),o=null==i?void 0:i.childNodes;let s=" ",a=!1;3===(null==(t=o[1])?void 0:t.nodeType)&&(s=o[1].textContent,a=!0);const l=G.get(this.editor,"state.selection.$to",{}),{path:c=[],pos:d}=l;let u;switch(r){case 1:u=this.handleHtml(1,s),pf(this.editor,u,d,this.query.length+2),a&&vf(this.editor);break;case 2:u=this.handleHtml(2,s),pf(this.editor,u,d,this.query.length+2),this.handleDescIndex(),a&&vf(this.editor);break;case 3:u=hf({type:Bp.PARAGRAPH,content:[{type:Bp.TEXT,text:"@"}]},{noWrapper:!1}),pf(this.editor,u,d);break;case 4:const e=yf.streamSenceIndex;u=hf(df(e-1)),pf(this.editor,u,d,this.query.length+2),yf.addChapter(yf.streamSenceIndex),yf.setnewSenceIndex(e)}},handleDescIndex(){const e=function(){const e=lf.streamSenceIndex,t=document.querySelector(".custom-block"),n=null==t?void 0:t.childNodes;let r=0;if(null==n?void 0:n.length)return Array.from(n).filter((t=>{const n=t.childNodes[0];if("scene-title"===n.getAttribute("class")&&r++,"shotDescription"===n.getAttribute("node-type")&&r===e)return t}));return[]}();e.length&&e.forEach(((e,t)=>{const n=e.childNodes[0];n&&(n.innerHTML=`æè¿°${t+1}ï¼`)}))},handleHtml:(e,t)=>
1hf({type:Bp.PARAGRAPH,content:[{type:Bp.UNSELECTABLE_TEXT,content:[{type:Bp.TEXT,text:1===e?"大纲":"æè¿°"}],attrs:{"node-type":1===e?jp.OUTLINE:jp.SHOT_DESCRIPTION}},{type:Bp.TEXT,text:t}],attrs:{"node-type":1===e?jp.OUTLINE:jp.SHOT_DESCRIPTION}},{noWrapper:!1})}},wf={class:"items"},xf={key:0,class:"tip"},kf=["onClick"];const _f=ie(bf,[["render",function(e,t,n,r,i,o){const d=Y;return s(),a("div",wf,[i.errorTip?(s(),a("div",xf,[l("div",{class:k(["error-tip",{"extra-tip":n.isOutline}])},m(i.errorTipText),3),l("div",null,m(i.subErrorTip),1)])):v("",!0),(s(!0),a(u,null,h(i.items,((e,t)=>(s(),a("div",{class:k(["operate-item",{"is-selected":t===i.selectedIndex,"is-disabled":1===e.value&&n.isOutline}]),key:t,onClick:e=>o.selectItem(t)},[c(d,{name:e.icon},null,8,["name"]),l("span",null,m(e.label),1)],10,kf)))),128))])}],["__scopeId","data-v-116858af"]]);const Sf={render:()=>{let e,t;return{onStart:n=>{const r=G.get(n.editor,"state.selection.$to.path",[]),{index:i}=function(e,t){const n=e.find((e=>G.get(e,"attrs['node-type']")===t));return n?{node:n,nodeType:G.get(n,"attrs['node-type']"),index:G.get(n,"attrs.index")}:{}}(r,jp.SCENE),o=function(e){const t=lf.streamSenceIndex,{$cursor:n}=null==e?void 0:e.state.selection;let r=0;if(n){const e=document.querySelector(".custom-block"),n=(null==e?void 0:e.childNodes)||[];return Array.from(n).filter((e=>{const n=e.childNodes[0],i=3===n.nodeType?n.parentNode:n;if(i){"scene-title"===i.getAttribute("class")&&r++;const n=e.getAttribute("node-type"),o=i.getAttribute("node-type");if(t===r&&"outline"===n&&"outline"===o)return e}})).length>0}}(n.editor);e=new yp(_f,{props:{query:"",editor:n.editor,activeSceneIndex:i,isOutline:o},editor:n.editor}),n.clientRect&&(t=pp("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",theme:"light"}))},onUpdate(n){e.updateProps(n),n.clientRect&&t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r,i;return"Escape"===n.event.key?(t[0].hide(),!0):G.isFunction(null==(r=e.ref)?void 0:r.onKeyDown)&&(null==(i=e.ref)?void 0:i.onKeyDown(n))},onExit(){t[0].destroy(),e.destroy()}}}},Cf=tc.create({name:"commands2",addOptions:()=>({suggestion:{char:"@",command:({editor:e,range:t,props:n})=>{n.command({editor:e,range:t})}}}),addProseMirrorPlugins(){const{suggestion:e}=this.options;return[of({editor:this.editor,pluginKey:new $i(`suggestion$${e.char}`),...e})]}}),Tf=X(),Of=x((()=>Tf.formRoles)),Mf={props:{query:{type:String,required:!0},editor:{type:Object,required:!0}},data:()=>({selectedIndex:0,items:Of.value,errorTip:!1}),watch:{query(){this.handleItems(this.query)}},methods:{handleItems(e){if(e){const t=Of.value.filter((t=>t.material_name.includes(e)));t.length>0?(this.items=t,this.errorTip=!1):(this.errorTip=!0,this.items=Of.value)}else this.errorTip=!1,this.items=Of.value},onKeyDown({event:e}){return"ArrowUp"===e.key?(this.upHandler(),!0):"ArrowDown"===e.key?(this.downHandler(),!0):"Enter"===e.key&&(this.enterHandler(),!0)},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length},enterHandler(){this.selectItem(this.selectedIndex)},async selectItem(e){var t;const n=this.items[e],r=gf(this.editor),i=null==r?void 0:r.childNodes;let o=" ",s=!1;if(3===(null==(t=i[1])?void 0:t.nodeType)&&(o=i[1].textContent,s=!0),n){const{value:e,thumbnail:t,material_name:r,id:i}=n,a=G.get(this.editor,"state.selection.$to",{}),{path:l=[],pos:c}=a,d=hf({type:Bp.PARAGRAPH,content:[{type:Bp.UNSELECTABLE_TEXT,content:[{type:Bp.TEXT,text:r}],attrs:{"node-type":jp.DIALOG}},{type:Bp.TEXT,text:o}],attrs:{"node-type":jp.DIALOG,"role-id":i,name:r,thumbnail:t}},{noWrapper:!1});pf(this.editor,d,c,this.query.length+2),s&&vf(this.editor)}}}},Ef={class:"items"},Af={class:"tip"},Nf={key:0,class:"error-tip"},If=(e=>(b("data-v-9dfec675"),e=e(),w(),e))((()=>l("div",null,"ä½ å¯è½@çè§è²",-1))),Df=["onClick"],Rf=["src"];const Lf=ie(Mf,[["render",function(e,t,n,r,i,o){return s(),a("div",Ef,[l("div",Af,[i.errorTip?(s(),a("div",Nf,"æªè½æ¾å°ç»æ")):v("",!0),If]),(s(!0),a(u,null,h(i.items,((e,t)=>(s(),a("div",{class:k(["operate-item",{"is-selected":t===i.selectedIndex}]),key:t,onClick:e=>o.selectItem(t)},[l("img",{src:e.thumbnail,alt:"ä¼å½±"},null,8,Rf),l("span",null,m(e.material_name),1)],10,Df)))),128))])}],["__scopeId","data-v-9dfec675"]]),Pf={render:()=>{let e,t;return{onStart:n=>{e=new yp(Lf,{props:{query:"",editor:n.editor},editor:n.editor}),n.clientRect&&(t=pp("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",theme:"light"}))},onUpdate(n){e.updateProps(n),n.clientRect&&t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r,i;return"Escape"===n.event.key?(t[0].hide(),!0):G.isFunction(null==(r=e.ref)?void 0:r.onKeyDown)&&(null==(i=e.ref)?void 0:i.onKeyDown(n))},onExit(){t[0].destroy(),e.destroy()}}}},zf=Wc.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Ll(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Bf={class:"m-button-2"},jf=ie(r({__name:"index",props:{icon:{},label:{}},setup:e=>(e,t)=>
1{const n=Y;return s(),a("div",Bf,[c(n,{name:e.icon},null,8,["name"]),l("span",null,m(e.label),1)])}}),[["__scopeId","data-v-97647fdc"]]),Ff=ie(r({__name:"role",setup:e=>(e,t)=>(s(),f(jf,{icon:"button_addrole",label:"æ·»å è§è²"}))}),[["__scopeId","data-v-413b178a"]]),$f={class:"role-wrap"},Vf={class:"right-list"},Hf={class:"image-slot"},Uf={class:"draft-title"},Wf={class:"edit-box"},qf=ie(r({__name:"RoleItemComp",setup(e){const t=i(),n=i(0),r=X(),o=x((()=>r.formRoles)),f=()=>{r.changeIsRole(!0)},g=e=>{const t=document.querySelector(".tip"),n=e.target.value;t.innerText=`${n.length}/8`},v=e=>{const i=e.target.value;let o={...t.value};i&&(o.material_name=i);const s=document.querySelectorAll(".role-item")[n.value].childNodes[1],a=s.childNodes[0].childNodes[1];null==a||a.removeEventListener("input",g),null==a||a.removeEventListener("blur",v),s.innerHTML=o.material_name,r.updateRoles(o,n.value)};return(e,i)=>{const y=_("Picture"),b=se,w=Re,x=Y;return s(),a("div",$f,[c(Ff,{onClick:f}),l("div",Vf,[(s(!0),a(u,null,h(p(o),((e,i)=>(s(),a("div",{class:"role-item",key:i},[c(w,{class:"video-box",src:e.thumbnail},{error:d((()=>[l("div",Hf,[c(b,null,{default:d((()=>[c(y)])),_:1})])])),_:2},1032,["src"]),l("div",Uf,m(e.material_name),1),l("div",Wf,[c(x,{onClick:r=>((e,r)=>{t.value=e,n.value=r;const i=document.querySelectorAll(".role-item")[r].childNodes[1],o=`<div class="draft-wrap">\n <input class="title-input" maxlength="8" value="${e.material_name}" />\n <span class="tip" style="margin-left: 8px">${e.material_name.length}/8</span>\n </div>`;i.innerHTML=o;const s=document.querySelector(".title-input");s.focus(),s.addEventListener("input",g),s.addEventListener("blur",v)})(e,i),name:"basis_rename"},null,8,["onClick"]),c(x,{onClick:e=>(e=>{r.deleteRole(e)})(i),name:"basis_dustbin"},null,8,["onClick"])])])))),128))])])}}}),[["__scopeId","data-v-23bbab3a"]]),Kf={key:0,class:"stream-drama"},Jf=r({__name:"index",setup(n,{expose:r}){const o=X(),d=i();let u=1;M((()=>o.dramaForm.drama.scene_list),(()=>{1===u&&B((()=>{var e;const t=uf(o.dramaForm.drama);null==(e=f.value)||e.commands.setContent(t),u++}))}),{immediate:!0,deep:!0});const h=x({get:()=>o.dramaForm.drama.drama_name,set(e){o.dramaForm.drama.drama_name=e}}),f=((e={})=>{const t=D();return E((()=>{t.value=new mp(e)})),A((()=>{var e;null===(e=t.value)||void 0===e||e.destroy()})),t})({extensions:[Hp,Wp,qp,Kp,Up,Jp,Gp,Zp,Yc,Vp,Xp,zf.configure({HTMLAttributes:{class:"underlined"}}),hu.configure({paragraph:!1}),Gc.configure({limit:9999999}),Zc.configure({placeholder:({node:e})=>"heading"===e.type.name?"请è¾å
¥å§æ¬æ é¢":"è¾å
¥â/âå¿«éæ·»å "}),sf.configure({suggestion:Sf}),Cf.configure({suggestion:Pf}),Yp,tf],content:d.value}),g=x((()=>{var e;if(f.value){const t=null==(e=f.value)?void 0:e.getJSON();return G.get(t,"content[0].content",[]).filter((e=>"sceneTitle"===e.type)).length}}));function y(e){var t;if("Enter"===e.key)return e.preventDefault(),void(null==(t=f.value)||t.commands.focus())}function b(){var e,t;const n=null==(e=f.value)?void 0:e.state.selection,{$to:r,$cursor:i}=n;if(i){return null==(t=f.value)?void 0:t.view.domAtPos(i.pos).node}}function w(e){const t=b();if("Backspace"===e.key&&function(e,t){var n,r,i;const{empty:o,$cursor:s,$head:a,$anchor:l}=null==(n=f.value)?void 0:n.state.selection,c=null==t?void 0:t.nodeName.toLowerCase();o&&s&&"text"===c&&(e.preventDefault(),S.value?(null==(r=f.value)||r.chain().command((({tr:e})=>(e.delete(l.before(),a.after()),e))).run(),S.value=!1):(null==(i=f.value)||i.chain().command((({tr:e})=>(e.setNodeMarkup(s.before(),null,{style:"background: rgba(255,0,0,0.06)"}),e))).run(),S.value=!0))}(e,t),t){let e=3===t.nodeType?t.parentNode:t;const{top:n}=e.getBoundingClientRect(),r=document.querySelectorAll(".vue-component"),i=Array.from(r).map((e=>{const{top:t}=e.getBoundingClientRect();return t}));for(let t=0;t<i.length;t++)n>i[t]&&(n<i[t+1]||!i[t+1])&&o.setStreamingIndex(t+1)}}function _(){var e;const t=b();t&&(1!==t.childNodes.length||t.getAttribute("class")||null==(e=f.value)||e.chain().command((({tr:e})=>
1{const{$cursor:t}=e.selection;return e.setNodeMarkup(t.before(),null,{style:"text-decoration: underline red wavy;"}),e})).run())}M(g,((t,n)=>{n&&t!==n&&document.querySelectorAll(".vue-component").forEach(((t,n)=>{const r=t.querySelector(".scene-title");if(r){const i=r.childNodes[0];t.setAttribute("index",n.toString()),i.innerText=`第${e(n+1)}åº`}}))}),{immediate:!0});const S=i(!1);function C(e){h.value=e.target.innerText}function T(){O(),$t()}function O(){const e=mf(f.value);e&&(o.dramaForm.drama.scene_list=e.drama.scene_list)}return r({mergeDrama:O}),E((()=>{t.on(Se.TRANSFER_DRAMA,T)})),U((()=>{var e;O(),o.setnewSenceIndex(void 0),t.remove(Se.TRANSFER_DRAMA,T),null==(e=f.value)||e.destroy()})),(e,t)=>p(f)?(s(),a("div",Kf,[l("h1",{class:k(["drama-title",{"is-empty":!p(h)}]),contenteditable:"true","data-placeholder":"请è¾å
¥å§æ¬æ é¢",onKeydown:y,onInput:C},m(p(h)),35),c(qf),c(p(gp),{editor:p(f),onKeydown:w,onKeyup:_},null,8,["editor"])])):v("",!0)}}),Gf=ie(Jf,[["__scopeId","data-v-81ba047c"]]),Zf=W("AisenceStore",(()=>{const e=i("");return{inputValue:e,setIputValue:t=>{e.value=t}}})),Xf={class:"input-box"},Yf={class:"input-footer"},Qf=["onClick"],em={class:"type-box"},tm=(e=>(b("data-v-55c304a7"),e=e(),w(),e))((()=>l("div",{class:"type-title"},"é¿å®½æ¯",-1))),nm={class:"type-list"},rm=r({__name:"default",setup(e){const t=X(),n=Zf(),r=i(""),o=i([{name:"横å±",icon:"AI_scale_landscape"},{name:"ç«å±",icon:"AI_scale_portrait"}]),v=e=>t.screenType===e?"active":"",y=()=>{n.setIputValue(r.value)};let b=i(["",""]);const w=()=>{for(let e=0;e<2;e++)b.value[e]=x()},x=()=>{let e=Math.floor(Math.random()*Le.length),t=Le[e];return b.value.includes(t)&&x(),t};return E((()=>{w()})),(e,t)=>{const i=ge,x=le,_=Y;return s(),a(u,null,[l("div",Xf,[c(i,{modelValue:p(r),"onUpdate:modelValue":t[0]||(t[0]=e=>N(r)?r.value=e:null),maxlength:"200",placeholder:"è¾å
¥æ¶é´ãå°ç¹ãç»èï¼æéæ©ä¸æ¹æè¿°å¿«é","show-word-limit":"",type:"textarea",onInput:y},null,8,["modelValue"]),l("div",Yf,[(s(!0),a(u,null,h(p(b),((e,t)=>(s(),f(x,{effect:"dark",content:e,placement:"top-end",key:t},{default:d((()=>[l("div",{class:"example",onClick:t=>{return i=e,r.value=i,void n.setIputValue(r.value);var i}},m(e),9,Qf)])),_:2},1032,["content"])))),128)),c(x,{effect:"dark",content:"å·æ°",placement:"top-end"},{default:d((()=>[l("div",{class:"icon-box",onClick:w},[c(_,{name:"basis_replace"})])])),_:1})])]),l("div",em,[tm,l("div",nm,[(s(!0),a(u,null,h(p(o),((e,t)=>(s(),a("div",{key:t,class:k(v(t))},[c(_,{name:e.icon},null,8,["name"]),g(" "+m(e.name)+" ",1),c(_,{name:"popup_select1"})],2)))),128))])])],64)}}}),im=ie(rm,[["__scopeId","data-v-55c304a7"]]),om={class:"result-wrap"},sm=["src"],am={key:0,class:"apply-icon"},lm=["onClick"],cm={key:1,class:"progress"},dm={class:"tip"},um=ie(r({__name:"result",emits:["handleChangeBtn"],setup(e,{expose:t,emit:n}){const r=Zf(),o=X(),d=i(""),y=i(),b=i([]),w=i(0),_=i(!0),S=x((()=>({height:0===o.screenType?"348px":"265px"}))),C=x((()=>0===o.screenType?"result-h":"result-s")),T=x((()=>{const{screenType:e}=o;return 0===e?"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/55ffc640f4484e90915ba20d3bb082ac.png":"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/dbc77c583be14932b756e736ca069c68.png"})),O=e=>{Te(e).then((e=>{0===e.code&&(w.value=e.data.progress);const t=G.get(e,"data.picture_list",[]);t.length>0&&(b.value=t,M("handleChangeBtn"),_.value=!1,clearInterval(y.value),y.value=null)}))},M=n;t({handleTransfer:()=>{_.value=!0,w.value=0;const{screenType:e}=o,t={screen_type:e,text:r.inputValue};d.value=r.inputValue,y.value=null;const n=T.value;b.value=[n,n,n,n],Ce(t).then((e=>{0===e.code&&(y.value=setInterval((()=>{O(e.data.request_id)}),1e3))}))},handleCancel:()=>{clearInterval(y.value),_.value=!1,w.value=0,y.value=null,b.value=[]}});const E=()=>{r.setIputValue(d.value)};return A((()=>{clearInterval(y.value),y.value=null})),(e,t)=>{const n=ge,r=Y,i=De;return s(),a("div",om,[l("div",{class:"result",style:q(p(S))},[(s(!0),a(u,null,h(p(b),((e,t)=>(s(),a("div",{key:t,class:k(p(C))},[l("img",{src:e,alt:"ä¼å½±"},null,8,sm),p(_)?v("",!0):(s(),a("div",am,[l("div",{onClick:t=>{return n=e,o.setSencelist({img:n}),void o.chooseSence(!1);var n}}
1,"ç¹å»åºç¨",8,lm)]))],2)))),128))],4),p(_)?v("",!0):(s(),f(n,{key:0,modelValue:p(d),"onUpdate:modelValue":t[0]||(t[0]=e=>N(d)?d.value=e:null),maxlength:"200",placeholder:"è¾å
¥æ¶é´ãå°ç¹ãç»èï¼æéæ©ä¸æ¹æè¿°å¿«é","show-word-limit":"",type:"textarea",onInput:E},null,8,["modelValue"])),p(_)?(s(),a("div",cm,[l("div",dm,[c(r,{name:"AI_icon_text"}),g(m(p(d)),1)]),c(i,{percentage:p(w),color:"#00B849","show-text":!1},null,8,["percentage"])])):v("",!0)])}}}),[["__scopeId","data-v-5eac7b48"]]),hm={class:"footer-button"},pm=ie(r({__name:"defaultBtn",emits:["handleClick"],setup(e,{emit:t}){const n=Zf(),r=()=>{""!==n.inputValue?i("handleClick",1):ae.error("请è¾å
¥ç»é¢æè¿°")},i=t;return(e,t)=>(s(),a("div",hm,[l("div",{class:"m-button",onClick:r},"çæèæ¯")]))}}),[["__scopeId","data-v-ed130e75"]]),fm={class:"footer-button"},mm=ie(r({__name:"processBtn",emits:["handleClick"],setup(e,{emit:t}){const n=()=>{r("handleClick",0)},r=t;return(e,t)=>(s(),a("div",fm,[l("div",{class:"m-button",onClick:n},"忢çæ")]))}}),[["__scopeId","data-v-6d917434"]]),gm={class:"footer-button"},vm={class:"right"},ym=ie(r({__name:"resultBtn",emits:["handleClick"],setup(e,{emit:t}){const n=X(),r=e=>{o("handleClick",e)},i=()=>{n.changeSenceTab(0)},o=t;return(e,t)=>(s(),a("div",gm,[l("div",{class:"left",onClick:t[0]||(t[0]=e=>r(0))},"è¿å"),l("div",vm,[l("div",{class:"m-button",onClick:i},"å¨ç´ æåºæ"),l("div",{class:"m-button",onClick:t[1]||(t[1]=e=>r(1))},"忬¡çæ")])]))}}),[["__scopeId","data-v-129024d2"]]),bm={class:"text-map"},wm={class:"title"},xm={class:"left"},km=(e=>(b("data-v-70895539"),e=e(),w(),e))((()=>l("img",{src:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/c6c3b54424604c9f9cac9924aa2d4bcf.png",alt:"ä¼å½±"},null,-1))),_m=ie(r({__name:"index",setup(e){const t=X(),n=Zf(),r=i(0),o=i(null),d=x((()=>0===r.value?"æè¿°ä½ æ³è±¡çèæ¯å¾ï¼AIä¼å¸®ä½ çæå®":1===r.value?"AIçæä¸â¦":"èæ¯å¾å®æäºï¼")),h=x((()=>0===r.value?P(im):(r.value,P(um)))),y=x((()=>0===r.value?P(pm):1===r.value?P(mm):P(ym))),b=e=>{r.value=e,B((()=>{1===e&&o.value.handleTransfer(),0===e&&(o.value.handleCancel(),n.setIputValue(""))}))},w=()=>{r.value=2},k=()=>{t.changesencePageIndex(2)};return(e,t)=>{const n=Y;return s(),a(u,null,[l("div",bm,[l("div",wm,[l("div",xm,[km,g(" "+m(p(d)),1)]),0===p(r)?(s(),a("div",{key:0,class:"right",onClick:k},[c(n,{name:"basis_history"}),g("åå²è®°å½ ")])):v("",!0)]),(s(),f(R(p(h)),{ref_key:"chidCom",ref:o,onHandleChangeBtn:w},null,544))]),(s(),f(R(p(y)),{onHandleClick:b},null,32))],64)}}}),[["__scopeId","data-v-70895539"]]),Sm={class:"tabs"},Cm={class:"tab-header"},Tm={class:"header-content"},Om=["onClick"],Mm={class:"tab-content"},Em=ie(r({__name:"tabs",props:{material:{}},emits:["tabChange"],setup(e,{emit:t}){const n=e,r=t,o=i(0);return M(n,(e=>{var t;const{material:n}=e;o.value=null==(t=null==n?void 0:n[0])?void 0:t.id})),(e,t)=>(s(),a("div",Sm,[l("div",Cm,[l("div",Tm,[(s(!0),a(u,null,h(e.material,((e,t)=>(s(),a("div",{key:t,class:k({"is-active":p(o)===e.id}),onClick:t=>{return n=e.id,o.value=n,void r("tabChange",n);var n}},m(e.name),11,Om)))),128))])]),l("div",Mm,[y(e.$slots,"content",{},void 0,!0)])]))}}),[["__scopeId","data-v-8f1d2b37"]]),Am={class:"image-slot"},Nm=ie(r({__name:"senceItem",props:{sence:{}},setup(e){const t=X(),{sence:n}=e,r=x((()=>{var e;return(null==(e=n.files)?void 0:e[0])||n.thumbnail})),i=x((()=>t.screenType?"sence sence-v":"sence sence-h")),o=async()=>{const{material_name:e,id:i}=n,o={img:r.value,material_name:e,material_id:i};t.setSencelist(o),t.chooseSence(!1)};return(e,t)=>{const n=_("Picture"),u=se,h=Re;return s(),a("div",{class:k(p(i))},[c(h,{class:"video-box",id:String(e.sence.id),src:p(r)},{error:d((()=>[l("div",Am,[c(u,null,{default:d((()=>[c(n)])),_:1})])])),_:1},8,["id","src"]),l("div",{class:"item-title"},[l("div",{onClick:o},"ç¹å»åºç¨")])],2)}}}),[["__scopeId","data-v-6983aaf1"]]),Im={},Dm=l("img",{src:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/936689f9acc74004a628b11918052859.png",alt:"ä¼å½±"},null,-1);const Rm=ie(Im,[["render",function(e,t){const n=Be;return s(),f(n,{description:"ææ æ°æ®"},{image:d((()=>[Dm])),_:1})}]]),Lm={class:"empty"},Pm=(e=>(b("data-v-9fbf7274"),e=e(),w(),e))((()=>l("div",null,"ä¸ä¼ ç´ æï¼éæ¶éå°å¯ç¨",-1))),zm=ie(r({__name:"empty",props:{title:{}},setup(e){const t=K(),n=()=>{const e=t.resolve({name:"personalMaterial",query:{type:2}});window.open(e.href,"_blank")};return(e,t)=>
1(s(),a("div",Lm,[l("div",null,"æ¨å°æªä¸ä¼ "+m(e.title),1),Pm,l("div",{class:"m-button",onClick:n},"å»ä¸ä¼ ")]))}}),[["__scopeId","data-v-9fbf7274"]]),Bm={key:0,class:"top-operate"},jm={id:"wrap"},Fm={key:1,class:"tip"},$m=ie(r({__name:"publicMaterial",setup(e,{expose:t}){const n=K();let r=i({type_id:0,page_num:0,page_size:20,screen_type:0,private:0});const o=X(),y=i(!1),b=i([]),w=i(0),k=i(),_=x((()=>{const{page_num:e,page_size:t}=r.value;return e*t>=w.value})),S=x((()=>r.value.private?zm:Rm)),C=()=>{const e=n.resolve({name:"personalMaterial",query:{type:2}});window.open(e.href,"_blank")},T=async()=>{y.value=!0;const e=await Me(r.value),t=G.get(e,"data.materials",[])||[];b.value=[...b.value,...t],w.value=G.get(e.data,"total",0),y.value=!1},O=G.debounce((e=>{if(e.length+w.value>100)return void ae.warning("æçèæ¯æå¤å¯ä¸ä¼ 100æ¡æ°æ®");const t={type_name_list:["èæ¯"]};e.forEach((async e=>{const n=await Oe(e.name,e.raw,t);G.get(n.data,"id")?r.value.private&&(b.value=[],T(),ae.success("èæ¯ä¸ä¼ æå")):ae.error("èæ¯ä¸ä¼ 失败")}))}),50),M=()=>{if(!k.value)return;const{scrollTop:e,scrollHeight:t,clientHeight:n}=k.value;if(e+n>=t-6&&!y.value){if(r.value.page_num++,_.value)return;T()}};return t({initPage:e=>{r.value.type_id=e||100,r.value.private=e?0:1,r.value.page_num=0,r.value.page_size=e?20:100,r.value.screen_type=e?o.screenType:2,r.value.type_class=1===r.value.private?1:0,b.value=[],T()}}),E((()=>{k.value=document.querySelector("#wrap"),k.value.addEventListener("scroll",M)})),A((()=>{k.value.removeEventListener("scroll",M)})),(e,t)=>{const n=Y,i=Nm,o=he;return s(),a(u,null,[p(r).private?(s(),a("div",Bm,[l("div",null,[c(Pe,{isFileList:!1,onUploadFiles:p(O)},{default:d((()=>[l("div",null,[c(n,{name:"tool_upload"}),g("ä¸ä¼ èæ¯")])])),_:1},8,["onUploadFiles"])]),l("div",{onClick:C},[c(n,{name:"button_cdr"}),g("å»ç®¡çç´ æ")])])):v("",!0),J((s(),a("div",{class:"list-wrap",style:q({height:p(r).private?"calc(100% - 36px)":"100%"}),"element-loading-background":"rgba(122, 122, 122, 0.8)"},[l("div",jm,[(s(!0),a(u,null,h(p(b),((e,t)=>(s(),f(i,{key:t,sence:e},null,8,["sence"])))),128)),p(b).length?v("",!0):(s(),f(R(p(S)),{key:0,title:"èæ¯"})),p(w)>0&&p(w)>p(r).page_size?(s(),a("div",Fm,m(p(_)?"æ²¡ææ´å¤å
容äº~":"æ»å¨å è½½æ´å¤æ°æ®"),1)):v("",!0)])],4)),[[o,p(y)]])],64)}}}),[["__scopeId","data-v-eb3b4259"]]),Vm=r({__name:"tabsList",setup(e){const t=i([]),n=i(),r=i(0),o=async e=>{r.value=e,B((()=>{n.value.initPage(e)}))};return E((()=>{t.value=[{id:0,name:"æçèæ¯"}],(async()=>{const e=await Ee({parent_id:100});t.value=[...t.value,...G.get(e,"data",[])],o(0)})()})),(e,r)=>(s(),f(Em,{material:p(t),onTabChange:o},{content:d((()=>[c($m,{ref_key:"materialList",ref:n},null,512)])),_:1},8,["material"]))}}),Hm={class:"search-list","element-loading-background":"rgba(122, 122, 122, 0.8)"},Um=["src"],Wm=["onClick"],qm=[(e=>(b("data-v-4f79af80"),e=e(),w(),e))((()=>l("div",null,"ç¹å»åºç¨",-1)))],Km=ie(r({__name:"searchList",props:{inputVal:{}},setup(e){const t=X(),n=e;M(n,(e=>{const{inputVal:t}=e;t&&f(t)}));const r=x((()=>{const{screenType:e}=t;return 0===e?"enter-h":"enter-s"})),o=i([]),d=i(!1),f=G.debounce((async e=>{const n={text:e,screen_type:t.screenType};o.value=[],d.value=!0;const r=await Ae(n);o.value=G.get(r,"data.picture_list",[]),d.value=!1}),500),m=()=>{t.changeSenceTab(1),t.changesencePageIndex(1)};return E((()=>{n.inputVal&&f(n.inputVal)})),(e,n)=>{const i=Y,f=he;return J((s(),a("div",Hm,[(s(!0),a(u,null,h(p(o),((e,n)=>(s(),a("div",{class:k([p(r),"sence"]),key:n},[l("img",{class:"sence-img",src:e,alt:"ä¼å½±"},null,8,Um),l("div",{class:"apply-icon",onClick:n=>{return r=e,t.setSencelist({img:r}),void t.chooseSence(!1);var r}},qm,8,Wm)],2)))),128)),p(o).length>0?(s(),a("div",{key:0,class:k([p(r),"text-enter"]),onClick:m},[c(i,{name:"AI_icon_text"}),g("è¯è¯æåæå¾ ")],2)):v("",!0)])),[[f,p(d)]])}}}),[["__scopeId","data-v-4f79af80"]]),Jm={class:"search-box"},Gm=(e=>(b("data-v-e71fddf3"),e=e(),w(),e))((()=>l("img",{class:"prefix-img",src:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/c6c3b54424604c9f9cac9924aa2d4bcf.png",alt:"ä¼å½±"},null,-1))),Zm={class:"basis_magic"},Xm={class:"magic"},Ym={class:"search-recom"},Qm={class:"list"},eg=["onClick"],tg={key:1,class:"close-box"},ng=r({__name:"index",setup(e){const t=i(""),n=i(null);let r=i(["","","",""]);const o=x((()=>""===t.value?Vm:Km)),g=()=>{for(let e=0;e<4;e++)r.value[e]=y()},y=()=>{let e=Math.floor(Math.random()*Le.length),t=Le[e];return r.value.includes(t)&&y(),t},b=()=>{t.value=""};return(e,i)=>{const y=Y,w=le,x=je,k=_("CircleCloseFilled"),S=se,C=ge;return s(),a(u,null,[l("div",Jm,[c(C,{modelValue:p(t),"onUpdate:modelValue":i[0]||(i[0]=e=>N(t)?t.value=e:null)},{prefix:d((()=>[Gm])),suffix:d((()=>[""===p(t)?(s(),f(x,{key:0,placement:"bottom-end",teleported:!1,trigger:"click",onShow:g},{reference:d((()=>[l("div",Zm,[l("div",Xm,[c(y,{name:"basis_magic"})])])])),default:d((()=>[l("div",Ym,[l("div",Qm,[(s(!0),a(u,null,h(p(r),((e,n)=>(s(),f(w,{effect:"dark",content:e,placement:"top-end",key:n},{default:d((()=>[l("div",{class:"example",onClick:n=>{return r=e,void(t.value=r);var r}},m(e),9,eg)])),_:2},1032,["content"])))),128))]),c(w,{effect:"dark",content:"æ¢ä¸ç»",placement:"top-end"},{default:d((()=>[l("div",{class:"reflesh-icon",onClick:g},[c(y,{name:"basis_replace"})])])),_:1})])])),_:1})):v("",!0),""!==p(t)?(s(),a("div",tg,[c(S,{onClick:b,class:"close-icon"},{default:d((()=>[c(k)])),_:1})])):v("",!0)])),_:1},8,["modelValue"])]),(s(),f(R(p(o)),{ref_key:"childs",ref:n,inputVal:p(t)},null,8,["inputVal"]))],64)}}}),rg=ie(ng,[["__scopeId","data-v-e71fddf3"]]),ig={class:"title"},og={class:"top-tab"},sg=["onClick"],ag=r({__name:"index",setup(e){const t=X(),n=x((()=>t.senceTab)),r=i(["ç´ æåºçµæ","AIæåæå¾"]),o=x((()=>0===n.value?P(rg):P(_m))),d=e=>n.value===e?"is-active":"",g=()=>{t.chooseSence(!1)};return(e,n)=>{const i=Y;return s(),a(u,null,[l("div",ig,[l("div",og,[(s(!0),a(u,null,h(p(r),((e,n)=>(s(),a("div",{key:n,class:k(d(n)),onClick:e=>(e=>{t.changeSenceTab(e)})(n)},m(e),11,sg)))),128))]),c(i,{name:"popup_close",onClick:g})]),(s(),f(R(o.value)))],64)}}}),lg=ie(ag,[["__scopeId","data-v-6171d45d"]]),cg=e=>(b("data-v-087fb5eb"),e=e(),w(),e),dg={class:"title"},ug={class:"list"},hg=cg((()=>l("div",{class:"list-title"},[l("div",null,"åå²è®°å½"),l("div",null,"ä»
è®°å½åºç¨è¿çèæ¯å¾")],-1))),pg={class:"list-wrap"},fg=["src"],mg=["onClick"],gg=[cg((()=>l("div",null,"ç¹å»åºç¨",-1)))],vg=cg((()=>l("img",{src:"https://tensorbaytest.oss-cn-beijing.aliyuncs.com/web/936689f9acc74004a628b11918052859.png",alt:"ä¼å½±"},null,-1))),yg=r({__name:"index",setup(e){const t=X(),n=i({screen_type:t.screenType,page_num:0,page_size:20}),r=i([]),o=e=>{t.changesencePageIndex(e)};return E((()=>{(async()=>{const e=await Ne(n.value);r.value=G.get(e,"data.picture_list",[])})()})),(e,n)=>{const i=Y,m=Be;return s(),a(u,null,[l("div",dg,[l("div",{onClick:n[0]||(n[0]=e=>o(1))},[c(i,{name:"button_return"}),g("è¿å")]),c(i,{class:"close-icon",name:"popup_close",onClick:n[1]||(n[1]=e=>(t.changesencePageIndex(1),void t.chooseSence(!1)))})]),l("div",ug,[hg,l("div",pg,[(s(!0),a(u,null,h(p(r),((e,n)=>(s(),a("div",{class:"list-item",key:n},[l("img",{src:e,alt:"ä¼å½±"},null,8,fg),l("div",{class:"apply-icon",onClick:n=>{return r=e,t.setSencelist({img:r}),void o(0);var r}},gg,8,mg)])))),128)),0===p(r).length?(s(),f(m,{key:0,description:"ææ æ°æ®"},{image:d((()=>[vg])),_:1})):v("",!0)])])],64)}}}),bg=ie(yg,[["__scopeId","data-v-087fb5eb"]]),wg={key:0,class:"mask"},xg={class:"dialog-box"},kg=ie(r({__name:"index",setup(e){const t=X(),n=x((()=>t.isSence)),r=x((()=>{const e=t.sencePageIndex;return P(1===e?lg:bg)}));return(e,t)=>p(n)?(s(),a("div",wg,[l("div",xg,[(s(),f(R(p(r))))])])):v("",!0)}}),[["__scopeId","data-v-bcf4b847"]]),_g={class:"content"},Sg=["onClick"],Cg={class:"image-slot"},Tg={class:"item-title"},Og={class:"dialog-footer"},Mg=ie(r({__name:"layoutTab",emits:["close"],setup(e,{emit:t}){const n=X(),r=i(0),o=i([]),g=i(),y=i(),b=x((()=>n.layList||[]));M((()=>b.value),(()=>{w();const e=G.get(n,"layList",[]);e.length>0&&(r.value=e[0].role_num,o.value=e[0].layout_list)}));const w=()=>{const e=G.get(n,"senceIndex",0);
1if(0!==e){const t=G.get(n.dramaForm.drama,"scene_list",[])[e-1];g.value=t.layout_id}},S=e=>g.value===e.id,C=e=>0===n.screenType?g.value===e.id?"layout active":"layout":g.value===e.id?"layout-s active":"layout-s",T=e=>{const t=b.value.find((t=>t.role_num===e));o.value=t.layout_list},O=Ie((()=>{g.value?(n.setSenceLayout(g.value,y.value),g.value=void 0,y.value=void 0,E("close")):ae.warning("è¯·éæ©å¸å±")})),E=t;return(e,t)=>{const n=ne,i=Y,w=_("Picture"),x=se,M=Re,E=re;return s(),f(E,{"tab-position":"left",modelValue:p(r),"onUpdate:modelValue":t[1]||(t[1]=e=>N(r)?r.value=e:null),onTabChange:T},{default:d((()=>[(s(!0),a(u,null,h(p(b),(e=>(s(),f(n,{key:e.role_num,label:e.type,name:e.role_num},null,8,["label","name"])))),128)),l("div",_g,[(s(!0),a(u,null,h(p(o),(e=>(s(),a("div",{class:k(["item",C(e)]),key:e.id,onClick:t=>(e=>{g.value=e.id,y.value=e})(e)},[S(e)?(s(),f(i,{key:0,name:"popup_select1",class:"checked"})):v("",!0),c(M,{class:"video-box",src:e.url},{error:d((()=>[l("div",Cg,[c(x,null,{default:d((()=>[c(w)])),_:1})])])),_:2},1032,["src"]),l("div",Tg,m(e.second_type),1)],10,Sg)))),128)),l("div",Og,[l("div",{class:"submit-btn m-button",onClick:t[0]||(t[0]=e=>p(O)())},"ç¡®å®")])])])),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-9193bc82"]]),Eg=r({__name:"index",setup(e){const t=X(),n=x((()=>t.isLayout)),r=()=>{t.chooseLayout(!1)};return(e,t)=>(s(),f(Fe,{visible:p(n),title:"è¯·éæ©å¸å±",width:"848",height:"596",onOnClose:r},{content:d((()=>[c(Mg,{onClose:r})])),_:1},8,["visible"]))}});var Ag={},Ng=function(e,t){return(Ng=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var Ig=function(){return Ig=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ig.apply(this,arguments)};function Dg(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rg(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function Lg(e){return this instanceof Lg?(this.v=e,this):new Lg(e)}const Pg=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Ig},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Lg(e[r](t)),done:"return"===r}:i?i(t):t}:i}},__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof Lg?Promise.resolve(n.value.v).then(l,c):d(o[0][2],n)}catch(r){d(o[0][3],r)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Dg(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}},__await:Lg,__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(t){o(t)}}function a(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n},__createBinding:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},__decorate:function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},__exportStar:function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])},__extends:function(e,t){function n(){this.constructor=e}Ng(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},__generator:function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;
1function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}
1,__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__param:function(e,t){return function(n,r){t(n,r,e)}},__read:Rg,__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Rg(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r},__values:Dg},Symbol.toStringTag,{value:"Module"})),zg=$e(Pg);var Bg,jg={},Fg={},$g={},Vg={};var Hg,Ug={};var Wg,qg={};!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=zg;t.__exportStar((Bg||(Bg=1,Object.defineProperty(Vg,"__esModule",{value:!0}),Vg.documentTemplate=Vg.defaultMargins=void 0,Vg.defaultMargins={top:1440,right:1440,bottom:1440,left:1440,header:720,footer:720,gutter:0},Vg.documentTemplate=function(e,t,n,r){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<w:document\n xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"\n xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"\n xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"\n xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"\n xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"\n xmlns:ns6="http://schemas.openxmlformats.org/schemaLibrary/2006/main"\n xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"\n xmlns:ns8="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing"\n xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram"\n xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"\n xmlns:ns11="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"\n xmlns:dsp="http://schemas.microsoft.com/office/drawing/2008/diagram"\n xmlns:ns13="urn:schemas-microsoft-com:office:excel"\n xmlns:o="urn:schemas-microsoft-com:office:office"\n xmlns:v="urn:schemas-microsoft-com:vml"\n xmlns:w10="urn:schemas-microsoft-com:office:word"\n xmlns:ns17="urn:schemas-microsoft-com:office:powerpoint"\n xmlns:odx="http://opendope.org/xpaths"\n xmlns:odc="http://opendope.org/conditions"\n xmlns:odq="http://opendope.org/questions"\n xmlns:odi="http://opendope.org/components"\n xmlns:odgm="http://opendope.org/SmartArt/DataHierarchy"\n xmlns:ns24="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"\n xmlns:ns25="http://schemas.openxmlformats.org/drawingml/2006/compatibility"\n xmlns:ns26="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas">\n <w:body>\n <w:altChunk r:id="htmlChunk" />\n <w:sectPr>\n <w:pgSz w:w="'+e+'" w:h="'+t+'" w:orient="'+n+'" />\n <w:pgMar w:top="'+r.top+'"\n w:right="'+r.right+'"\n w:bottom="'+r.bottom+'"\n w:left="'+r.left+'"\n w:header="'+r.header+'"\n w:footer="'+r.footer+'"\n w:gutter="'+r.gutter+'"/>\n </w:sectPr>\n </w:body>\n</w:document>\n'}),Vg),e),t.__exportStar((Hg||(Hg=1,Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.mhtDocumentTemplate=void 0,Ug.mhtDocumentTemplate=function(e,t){return'MIME-Version: 1.0\nContent-Type: multipart/related;\n type="text/html";\n boundary="----=mhtDocumentPart"\n\n\n------=mhtDocumentPart\nContent-Type: text/html;\n charset="utf-8"\nContent-Transfer-Encoding: quoted-printable\nContent-Location: file:///C:/fake/document.html\n\n'+e+"\n\n"+t+"\n\n------=mhtDocumentPart--\n"}),Ug),e),t.__exportStar((Wg||(Wg=1,Object.defineProperty(qg,"__esModule",{value:!0}),qg.mhtPartTemplate=void 0,qg.mhtPartTemplate=function(e,t,n,r){return"------=mhtDocumentPart\nContent-Type: "+e+"\nContent-Transfer-Encoding: "+t+"\nContent-Location: "+n+"\n\n"+r+"\n"}),qg),e)}
1($g),Object.defineProperty(Fg,"__esModule",{value:!0}),Fg.getMHTdocument=void 0;var Kg=$g;Fg.getMHTdocument=function(e){var t=function(e){var t=[],n=/"data:(\w+\/\w+);(\w+),(\S+)"/g,r=function(e,n,r,i){var o="file:///C:/fake/image"+t.length+"."+n.split("/")[1];return t.push(Kg.mhtPartTemplate(n,r,o,i)),'"'+o+'"'};if(!/<img/g.test(e))return{htmlSource:e,imageContentParts:t};return e=e.replace(n,r),{htmlSource:e,imageContentParts:t}}(e),n=t.imageContentParts.join("\n");return e=t.htmlSource.replace(/\=/g,"=3D"),Kg.mhtDocumentTemplate(e,n)};var Jg,Gg={},Zg={};var Xg,Yg={};var Qg,ev={};!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=zg;t.__exportStar((Jg||(Jg=1,Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.contentTypesXml=void 0,Zg.contentTypesXml='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">\n <Default Extension="rels" ContentType=\n "application/vnd.openxmlformats-package.relationships+xml" />\n <Override PartName="/word/document.xml" ContentType=\n "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>\n <Override PartName="/word/afchunk.mht" ContentType="message/rfc822"/>\n</Types>\n'),Zg),e),t.__exportStar((Xg||(Xg=1,Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.documentXmlRels=void 0,Yg.documentXmlRels='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"\n Target="/word/afchunk.mht" Id="htmlChunk" />\n</Relationships>\n'),Yg),e),t.__exportStar((Qg||(Qg=1,Object.defineProperty(ev,"__esMo
1dule",{value:!0}),ev.relsXml=void 0,ev.relsXml='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n <Relationship\n Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"\n Target="/word/document.xml" Id="R09c83fafc067488e" />\n</Relationships>\n'),ev),e)}(Gg);var tv={};Object.defineProperty(tv,"__esModule",{value:!0});var nv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rv="undefined"!=typeof window&&void 0!==window.document,iv="object"===("undefined"==typeof self?"undefined":nv(self))&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name,ov="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node;tv.isBrowser=rv,tv.isWebWorker=iv,tv.isNode=ov,tv.isJsDom=function(){return"undefined"!=typeof window&&"nodejs"===window.name||navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")},Object.defineProperty(jg,"__esModule",{value:!0}),jg.addFiles=jg.generateDocument=void 0;var sv=zg,av=Fg,lv=Gg,cv=$g,dv=tv,uv={orientation:"portrait",margins:{}};function hv(e,t){return sv.__assign(sv.__assign({},e),t)}function pv(e){return dv.isBrowser?new Blob([e]):new Buffer(e,"utf-8")}function fv(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}jg.generateDocument=function(e){return sv.__awaiter(this,void 0,void 0,(function(){var t;return sv.__generator(this,(function(n){switch(n.label){case 0:return[4,e.generateAsync({type:"arraybuffer"})];case 1:return t=n.sent(),dv.isBrowser?[2,new Blob([t],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})]:[2,new Buffer(new Uint8Array(t))]}}))}))},jg.addFiles=function(e,t,n){var r=hv(uv,n);return e.file("[Content_Types].xml",pv(lv.contentTypesXml),{createFolders:!1}),e.folder("_rels").file(".rels",pv(lv.relsXml),{createFolders:!1}),e.folder("word").file("document.xml",function(e){var t=e.orientation,n=e.margins,r=hv(cv.defaultMargins,n),i=0,o=0;return"landscape"===t?(o=12240,i=15840):(i=12240,o=15840),cv.documentTemplate(i,o,t,r)}(r),{createFolders:!1}).file("afchunk.mht",av.getMHTdocument(t),{createFolders:!1}).folder("_rels").file("document.xml.rels",pv(lv.documentXmlRels),{createFolders:!1})};var mv={exports:{}};mv.exports=function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){if(!a&&fv)return fv(s);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,r)}return n[s].exports}for(var o=fv,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){var r=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(e){for(var t,n,i,s,a,l,c,d=[],u=0,h=e.length,p=h,f="string"!==r.getTypeOf(e);u<e.length;)p=h-u,i=f?(t=e[u++],n=u<h?e[u++]:0,u<h?e[u++]:0):(t=e.charCodeAt(u++),n=u<h?e.charCodeAt(u++):0,u<h?e.charCodeAt(u++):0),s=t>>2,a=(3&t)<<4|n>>4,l=1<p?(15&n)<<2|i>>6:64,c=2<p?63&i:64,d.push(o.charAt(s)+o.charAt(a)+o.charAt(l)+o.charAt(c));return d.join("")},n.decode=function(e){var t,n,r,s,a,l,c=0,d=0,u="data:";if(e.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var h,p=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&p--,e.charAt(e.length-2)===o.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=i.uint8array?new Uint8Array(0|p):new Array(0|p);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(s=o.indexOf(e.charAt(c++)))>>4,n=(15&s)<<4|(a=o.indexOf(e.charAt(c++)))>>2,r=(3&a)<<6|(l=o.indexOf(e.charAt(c++))),h[d++]=t,64!==a&&(h[d++]=n),64!==l&&(h[d++]=r);return h}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),s=e("./stream/DataLengthProbe");function a(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}a.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new s("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e("./utils"),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,n,r){var o=i,s=r+n;e^=-1;for(var a=r;a<s;a++)e=e>>>8^o[255&(e^t[a])];return~e}(0|t,e,e.length,0):function(e,t,n,r){var o=i,s=r+n;e^=-1;for(var a=r;a<s;a++)e=e>>>8^o[255&(e^t.charCodeAt(a))];return~e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),s=e("./stream/GenericWorker"),a=r?"uint8array":"array";function l(e,t){s.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",o.inherits(l,s),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,e.data),!1)},l.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)}
vendor: 6,750 bytes, line 1
1,l.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r="";for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function i(e,t,n,i,s,d){var u,h,p=e.file,f=e.compression,m=d!==a.utf8encode,g=o.transformTo("string",d(p.name)),v=o.transformTo("string",a.utf8encode(p.name)),y=p.comment,b=o.transformTo("string",d(y)),w=o.transformTo("string",a.utf8encode(y)),x=v.length!==p.name.length,k=w.length!==y.length,_="",S="",C="",T=p.dir,O=p.date,M={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(M.crc32=e.crc32,M.compressedSize=e.compressedSize,M.uncompressedSize=e.uncompressedSize);var E=0;t&&(E|=8),m||!x&&!k||(E|=2048);var A,N,I,D=0,R=0;T&&(D|=16),"UNIX"===s?(R=798,D|=(A=p.unixPermissions,N=T,I=A,A||(I=N?16893:33204),(65535&I)<<16)):(R=20,D|=function(e){return 63&(e||0)}(p.dosPermissions)),u=O.getUTCHours(),u<<=6,u|=O.getUTCMinutes(),u<<=5,u|=O.getUTCSeconds()/2,h=O.getUTCFullYear()-1980,h<<=4,h|=O.getUTCMonth()+1,h<<=5,h|=O.getUTCDate(),x&&(S=r(1,1)+r(l(g),4)+v,_+="up"+r(S.length,2)+S),k&&(C=r(1,1)+r(l(b),4)+w,_+="uc"+r(C.length,2)+C);var L="";return L+="\n\0",L+=r(E,2),L+=f.magic,L+=r(u,2),L+=r(h,2),L+=r(M.crc32,4),L+=r(M.compressedSize,4),L+=r(M.uncompressedSize,4),L+=r(g.length,2),L+=r(_.length,2),{fileRecord:c.LOCAL_FILE_HEADER+L+g+_,dirRecord:c.CENTRAL_FILE_HEADER+r(R,2)+L+r(b.length,2)+"\0\0\0\0"+r(D,4)+r(i,4)+g+_+b}}var o=e("../utils"),s=e("../stream/GenericWorker"),a=e("../utf8"),l=e("../crc32"),c=e("../signature");function d(e,t,n,r){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(d,s),d.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},d.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(e){this.accumulate=!1;var t,n=this.streamFiles&&!e.file.dir,o=i(e,n,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(o.dirRecord),n)this.push({data:(t=e,c.DATA_DESCRIPTOR+r(t.crc32,4)+r(t.compressedSize,4)+r(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:o.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n,i,s,a,l,d,u=this.bytesWritten-e,h=(n=this.dirRecords.length,i=u,s=e,a=this.zipComment,l=this.encodeFileName,d=o.transformTo("string",l(a)),c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(n,2)+r(n,2)+r(i,4)+r(s,4)+r(d.length,2)+d);this.push({data:h,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},d.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},d.prototype.error=function(e){var t=this._sources;if(!s.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(r){}return!0},d.prototype.lock=function(){s.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){var r=e("../compressions"),i=e("./ZipFileWorker");n.generateWorker=function(e,t,n){var o=new i(t.streamFiles,n,t.platform,t.encodeFileName),s=0;try{e.forEach((function(e,n){s++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw new Error(n+" is not a valid compression method !");return i}(n.options.compression,t.compression),a=n.options.compressionOptions||t.compressionOptions||{},l=n.dir,c=n.date;n._compressWorker(i,a).withStreamInfo("file",{name:e,dir:l,date:c,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)})),o.entriesCount=s}catch(a){o.error(a)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new r;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(r.prototype=e("./object")).loadAsync=e("./load"),r.support=e("./support"),r.defaults=e("./defaults"),r.version="3.10.1",r.loadAsync=function(e,t){return(new r).loadAsync(e,t)},r.external=e("./external"),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){var r=e("./utils"),i=e("./external"),o=e("./utf8"),s=e("./zipEntries"),a=e("./stream/Crc32Probe"),l=e("./nodejsUtils");function c(e){return new i.Promise((function(t,n){var r=e.decompressed.getContentWorker().pipe(new a);r.on("error",(function(e){n(e)})).on("end",(function(){r.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),l.isNode&&l.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip f
1ile",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new s(t);return n.load(e),n})).then((function(e){var n=[i.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var o=0;o<r.length;o++)n.push(c(r[o]));return i.Promise.all(n)})).then((function(e){for(var i=e.shift(),o=i.files,s=0;s<o.length;s++){var a=o[s],l=a.fileNameStr,c=r.resolve(a.fileNameStr);n.file(c,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders}),a.dir||(n.file(c).unsafeOriginalName=l)}return i.zipComment.length&&(n.comment=i.zipComment),n}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){var r=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){var r=e("readable-stream").Readable;function i(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),n&&n(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}e("../utils").inherits(i,r),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,n){function r(e,t,n){var r,i=o.getTypeOf(t),a=o.extend(n||{},l);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(e=m(e)),a.createFolders&&(r=f(e))&&g.call(this,r,!0);var u="string"===i&&!1===a.binary&&!1===a.base64;n&&void 0!==n.binary||(a.binary=!u),(t instanceof c&&0===t.uncompressedSize||a.dir||!t||0===t.length)&&(a.base64=!1,a.binary=!0,t="",a.compression="STORE",i="string");var v=null;v=t instanceof c||t instanceof s?t:h.isNode&&h.isStream(t)?new p(e,t):o.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var y=new d(e,v,a);this.files[e]=y}var i=e("./utf8"),o=e("./utils"),s=e("./stream/GenericWorker"),a=e("./stream/StreamHelper"),l=e("./defaults"),c=e("./compressedObject"),d=e("./zipObject"),u=e("./generate"),h=e("./nodejsUtils"),p=e("./nodejs/NodejsStreamInputAdapter"),f=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:l.createFolders,e=m(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function v(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r)},filter:function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(r)})),t},file:function(e,t,n){if(1!==arguments.length)return e=this.root+e,r.call(this,e,t,n),this;if(v(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(v(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=g.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")}
vendor: 5,661 bytes, line 1
1,generateInternalStream:function(e){var t,n={};try{if((n=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");o.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var r=n.comment||this.comment||"";t=u.generateWorker(this,n,r)}catch(l){(t=new s("error")).error(l)}return new a(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=y},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,n){var r=e("./DataReader");function i(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===n&&this.data[o+2]===r&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&n===o[1]&&r===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){var r=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e("./Uint8ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e("./DataReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e("./ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e("../utils"),i=e("../support"),o=e("./ArrayReader"),s=e("./StringReader"),a=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new a(e):i.uint8array?new l(r.transformTo("uint8array",e)):new o(r.transformTo("array",e)):new s(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER="PK��",n.CENTRAL_FILE_HEADER="PK��",n.CENTRAL_DIRECTORY_END="PK��",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK��",n.ZIP64_CENTRAL_DIRECTORY_END="PK��",n.DATA_DESCRIPTOR="PK�\b"},{}],24:[function(e,t,n){var r=e("./GenericWorker"),i=e("../utils");function o(e){r.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,r),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e("./GenericWorker"),i=e("../crc32");function o(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,r),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}
vendor: 7,611 bytes, line 1
1r.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}r.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),s=e("../base64"),a=e("../support"),l=e("../external"),c=null;if(a.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(h){}function d(e,t){return new l.Promise((function(n,i){var o=[],a=e._internalType,l=e._outputType,c=e._mimeType;e.on("data",(function(e,n){o.push(e),t&&t(n)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return s.encode(t);default:return r.transformTo(e,t)}}(l,function(e,t){var n,r=0,i=null,o=0;for(n=0;n<t.length;n++)o+=t[n].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(o),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(a,o),c);n(e)}catch(t){i(t)}o=[]})).resume()}))}function u(e,t,n){var s=t;switch(t){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=t,this._mimeType=n,r.checkSupport(s),this._worker=e.pipe(new i(s)),e.lock()}catch(a){this._worker=new o("error"),this._worker.error(a)}}u.prototype={accumulate:function(e){return d(this,e)},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,(function(e){t.call(n,e.data,e.meta)})):this._worker.on(e,(function(){r.delay(t,arguments,n)})),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(r.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer="undefined"!=typeof Buffer,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=0===new Blob([r],{type:"application/zip"}).size}catch(o){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=0===i.getBlob("application/zip").size}catch(s){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(o){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),s=e("./stream/GenericWorker"),a=new Array(256),l=0;l<256;l++)a[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(){s.call(this,"utf-8 decode"),this.leftOver=null}function d(){s.call(this,"utf-8 encode")}a[254]=a[254]=1,n.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,n,r,o,s,a=e.length,l=0;for(o=0;o<a;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(l):new Array(l),o=s=0;s<l;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?t[s++]=n:(n<2048?t[s++]=192|n>>>6:(n<65536?t[s++]=224|n>>>12:(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63),t[s++]=128|n>>>6&63),t[s++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,o,s=e.length,l=new Array(2*s);for(t=n=0;t<s;)if((i=e[t++])<128)l[n++]=i;else if(4<(o=a[i]))l[n++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<s;)i=i<<6|63&e[t++],o--;
vendor: 4,651 bytes, line 1
11<o?l[n++]=65533:i<65536?l[n++]=i:(i-=65536,l[n++]=55296|i>>10&1023,l[n++]=56320|1023&i)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),r.applyFromCharCode(l)}(e=r.transformTo(i.uint8array?"uint8array":"array",e))},r.inherits(c,s),c.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var s=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}(t),l=t;s!==t.length&&(i.uint8array?(l=t.subarray(0,s),this.leftOver=t.subarray(s,t.length)):(l=t.slice(0,s),this.leftOver=t.slice(s,t.length))),this.push({data:n.utf8decode(l),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=c,r.inherits(d,s),d.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),s=e("./external");function a(e){return e}function l(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e("setimmediate"),n.newBlob=function(e,t){n.checkSupport("blob");try{return new Blob([e],{type:t})}catch(i){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch(o){throw new Error("Bug : can't construct the Blob.")}}};var c={stringifyByChunk:function(e,t,n){var r=[],i=0,o=e.length;if(o<=n)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,o)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,o)))),i+=n;return r.join("")},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function d(e){var t=65536,r=n.getTypeOf(e),i=!0;if("uint8array"===r?i=c.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=c.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return c.stringifyByChunk(e,r,t)}catch(o){t=Math.floor(t/2)}return c.stringifyByChar(e)}function u(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=d;var h={};h.string={string:a,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return h.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,o.allocBuffer(e.length))}},h.array={string:d,array:a,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},h.arraybuffer={string:function(e){return d(new Uint8Array(e))},array:function(e){return u(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:a,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},h.uint8array={string:d,array:function(e){return u(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:a,nodebuffer:function(e){return o.newBufferFrom(e)}},h.nodebuffer={string:d,array:function(e){return u(e,new Array(e.length))},arraybuffer:function(e){return h.nodebuffer.uint8array(e).buffer},uint8array:function(e){return u(e,new Uint8Array(e.length))},nodebuffer:a},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return h[r][e](t)},n.resolve=function(e){for(var t=e.split("/"),n=[],r=0;r<t.length;r++){var i=t[r];"."===i||""===i&&0!==r&&r!==t.length-1||(".."===i?n.pop():n.push(i))}return n.join("/")},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":r.nodebuffer&&o.isBuffer(e)?"nodebuffer":r.uint8array&&e instanceof Uint8Array?"uint8array":r.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r="";for(n=0;n<(e||"").length;
vendor: 4,172 bytes, line 1
1n++)r+="\\x"+((t=e.charCodeAt(n))<16?"0":"")+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){setImmediate((function(){e.apply(n||null,t||[])}))},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,o,a,c){return s.Promise.resolve(t).then((function(e){return r.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise((function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)})):e})).then((function(t){var d,u=n.getTypeOf(t);return u?("arraybuffer"===u?t=n.transformTo("uint8array",t):"string"===u&&(c?t=i.decode(t):o&&!0!==a&&(t=l(d=t,r.uint8array?new Uint8Array(d.length):new Array(d.length)))),t):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){var r=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),s=e("./zipEntry"),a=e("./support");function l(e){this.files=[],this.loadOptions=e}l.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=a.uint8array?"uint8array":"array",n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip f
1ile ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){var r=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),s=e("./crc32"),a=e("./utf8"),l=e("./compressions"),c=e("./support");function d(e,t){this.options=e,this.loadOptions=t}d.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(Object.prototype.hasOwnProperty.call(l,t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&
vendor: 8,675 bytes, line 1
1(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return 1!==t.readInt(1)||s(this.fileName)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return 1!==t.readInt(1)||s(this.fileComment)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null}},t.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),s=e("./utf8"),a=e("./compressedObject"),l=e("./stream/GenericWorker");r.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!r&&(t=t.pipe(new s.Utf8EncodeWorker)),!o&&r&&(t=t.pipe(new s.Utf8DecodeWorker))}catch(a){(t=new l("error")).error(a)}return new i(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof a&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new s.Utf8EncodeWorker)),a.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof l?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<c.length;u++)r.prototype[c[u]]=d;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,s=new i(d),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){d(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(d,0)};else{var l=new e.MessageChannel;l.port1.onmessage=d,n=function(){l.port2.postMessage(0)}}var c=[];function d(){var e,t;r=!0;for(var n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}r=!1}t.exports=function(e){1!==c.push(e)||r||n()}}).call(this,void 0!==Ve?Ve:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,n){var r=e("immediate");function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function d(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function u(e,t,n){r((function(){var r;try{r=t(n)}catch(i){return o.reject(e,i)}r===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,r)}))}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,o.reject(e,t))}function i(t){n||(n=!0,o.resolve(e,t))}var s=f((function(){t(i,r)}));"error"===s.status&&r(s.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(r){n.status="error",n.value=r}return n}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))}))},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var n=new this.constructor(i);return this.state!==l?u(n,this.state===a?e:t,this.outcome):this.queue.push(new d(n,e,t)),n},d.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},d.prototype.otherCallFulfilled=function(e){u(this.promise,this.onFulfilled,e)},d.prototype.callRejected=function(e){o.reject(this.promise,e)},d.prototype.otherCallRejected=function(e){u(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=f(h,t);if("error"===n.status)return o.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var s=new Array(n),a=0,l=-1,c=new this(i);++l<n;)d(e[l],l);return c;function d(e,i){t.resolve(e).then((function(e){s[i]=e,++a!==n||r||(r=!0,o.resolve(c,s))}),(function(e){r||(r=!0,o.reject(c,e))}))}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var s,a=-1,l=new this(i);++a<n;)s=e[a],t.resolve(s).then((function(e){r||(r=!0,o.resolve(l,e))}),(function(e){r||(r=!0,o.reject(l,e))}));return l}},{immediate:36}],38:[function(e,t,n){var r={};(0,e("./lib/utils/common").assign)(r,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){var r=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),s=e("./zlib/messages"),a=e("./zlib/zstream"),l=Object.prototype.toString,c=0,d=-1,u=0,h=8;function p(e){if(!(this instanceof p))return new p(e);this.options=i.assign({level:d,method:h,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==c)throw new Error(s[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var f;if(f="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,f))!==c)throw new Error(s[n]);this._dict_set=!0}}function f(e,t){var n=new p(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}p.prototype.push=function(e,t){var n,s,a=this.strm,d=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=o.string2buf(e):"[object ArrayBuffer]"===l.call(e)?a.input=new
vendor: 4,998 bytes, line 1
1Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new i.Buf8(d),a.next_out=0,a.avail_out=d),1!==(n=r.deflate(a,s))&&n!==c)return this.onEnd(n),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(a.output,a.next_out))):this.onData(i.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==n);return 4===s?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c):2!==s||(this.onEnd(c),!(a.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=p,n.deflate=f,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,f(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){var r=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),s=e("./zlib/constants"),a=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),d=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==s.Z_OK)throw new Error(a[n]);this.header=new c,r.inflateGetHeader(this.strm,this.header)}function h(e,t){var n=new u(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}u.prototype.push=function(e,t){var n,a,l,c,u,h,p=this.strm,f=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?p.input=o.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new i.Buf8(f),p.next_out=0,p.avail_out=f),(n=r.inflate(p,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&m&&(h="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===d.call(m)?new Uint8Array(m):m,n=r.inflateSetDictionary(this.strm,h)),n===s.Z_BUF_ERROR&&!0===g&&(n=s.Z_OK,g=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&n!==s.Z_STREAM_END&&(0!==p.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(p.output,p.next_out),c=p.next_out-l,u=o.buf2string(p.output,l),p.next_out=c,p.avail_out=f-c,c&&i.arraySet(p.output,p.output,l,c,0),this.onData(u)):this.onData(i.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(g=!0)}while((0<p.avail_in||0===p.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(p.avail_out=0))},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=u,n.inflate=h,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},n.ungzip=h},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,s;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(s=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)o=e[t],s.set(o,i),i+=o.length;return s}},o={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],42:[function(e,t,n){var r=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(c){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(c){o=!1}
vendor: 4,301 bytes, line 1
1for(var s=new r.Buf8(256),a=0;a<256;a++)s[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function l(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",s=0;s<t;s++)n+=String.fromCharCode(e[s]);return n}s[254]=s[254]=1,n.string2buf=function(e){var t,n,i,o,s,a=e.length,l=0;for(o=0;o<a;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(l),o=s=0;s<l;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[s++]=n:(n<2048?t[s++]=192|n>>>6:(n<65536?t[s++]=224|n>>>12:(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63),t[s++]=128|n>>>6&63),t[s++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,o,a=t||e.length,c=new Array(2*a);for(n=r=0;n<a;)if((i=e[n++])<128)c[r++]=i;else if(4<(o=s[i]))c[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&n<a;)i=i<<6|63&e[n++],o--;1<o?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e,o=e>>>16&65535,s=0;0!==n;){for(n-=s=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--s;);i%=65521,o%=65521}return i|o<<16}},{}],44:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var o=r,s=i+n;e^=-1;for(var a=i;a<s;a++)e=e>>>8^o[255&(e^t[a])];return~e}},{}],46:[function(e,t,n){var r,i=e("../utils/common"),o=e("./trees"),s=e("./adler32"),a=e("./crc32"),l=e("./messages"),c=0,d=4,u=0,h=-2,p=-1,f=4,m=2,g=8,v=9,y=286,b=30,w=19,x=2*y+1,k=15,_=3,S=258,C=S+_+1,T=42,O=113,M=1,E=2,A=3,N=4;function I(e,t){return e.msg=l[t],t}function D(e){return(e<<1)-(4<e?9:0)}function R(e){for(var t=e.length;0<=--t;)e[t]=0}function L(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function P(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,L(e.strm)}function z(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function j(e,t){var n,r,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-C?e.strstart-(e.w_size-C):0,c=e.window,d=e.w_mask,u=e.prev,h=e.strstart+S,p=c[o+s-1],f=c[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(n=t)+s]===f&&c[n+s-1]===p&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<h);if(r=S-(h-o),o=h-S,s<r){if(e.match_start=t,a<=(s=r))break;p=c[o+s-1],f=c[o+s]}}}while((t=u[t&d])>l&&0!=--i);return s<=e.lookahead?s:e.lookahead}function F(e){var t,n,r,o,l,c,d,u,h,p,f=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-C)){for(i.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=n=e.hash_size;r=e.head[--t],e.head[t]=f<=r?r-f:0,--n;);for(t=n=f;r=e.prev[--t],e.prev[t]=f<=r?r-f:0,--n;);o+=f}if(0===e.strm.avail_in)break;if(c=e.strm,d=e.window,u=e.strstart+e.lookahead,p=void 0,(h=o)<(p=c.avail_in)&&(p=h),n=0===p?0:(c.avail_in-=p,i.arraySet(d,c.input,c.next_in,p,u),
vendor: 4,897 bytes, line 1
11===c.state.wrap?c.adler=s(c.adler,d,p,u):2===c.state.wrap&&(c.adler=a(c.adler,d,p,u)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=_)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+_-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<_)););}while(e.lookahead<C&&0!==e.strm.avail_in)}function $(e,t){for(var n,r;;){if(e.lookahead<C){if(F(e),e.lookahead<C&&t===c)return M;if(0===e.lookahead)break}if(n=0,e.lookahead>=_&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+_-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-C&&(e.match_length=j(e,n)),e.match_length>=_)if(r=o._tr_tally(e,e.strstart-e.match_start,e.match_length-_),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=_){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+_-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(P(e,!1),0===e.strm.avail_out))return M}return e.insert=e.strstart<_-1?e.strstart:_-1,t===d?(P(e,!0),0===e.strm.avail_out?A:N):e.last_lit&&(P(e,!1),0===e.strm.avail_out)?M:E}function V(e,t){for(var n,r,i;;){if(e.lookahead<C){if(F(e),e.lookahead<C&&t===c)return M;if(0===e.lookahead)break}if(n=0,e.lookahead>=_&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+_-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=_-1,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-C&&(e.match_length=j(e,n),e.match_length<=5&&(1===e.strategy||e.match_length===_&&4096<e.strstart-e.match_start)&&(e.match_length=_-1)),e.prev_length>=_&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-_,r=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-_),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+_-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=_-1,e.strstart++,r&&(P(e,!1),0===e.strm.avail_out))return M}else if(e.match_available){if((r=o._tr_tally(e,0,e.window[e.strstart-1]))&&P(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return M}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<_-1?e.strstart:_-1,t===d?(P(e,!0),0===e.strm.avail_out?A:N):e.last_lit&&(P(e,!1),0===e.strm.avail_out)?M:E}function H(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function U(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*x),this.dyn_dtree=new i.Buf16(2*(2*b+1)),this.bl_tree=new i.Buf16(2*(2*w+1)),R(this.dyn_ltree),R(this.dyn_dtree),R(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(k+1),this.heap=new i.Buf16(2*y+1),R(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*y+1),R(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function W(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=m,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?T:O,e.adler=2===t.wrap?0:1,t.last_flush=c,o._tr_init(t),u):I(e,h)}function q(e){var t,n=W(e);return n===u&&((t=e.state).window_size=2*t.w_size,R(t.head),t.max_lazy_match=r[t.level].max_lazy,t.good_match=r[t.level].good_length,t.nice_match=r[t.level].nice_length,t.max_chain_length=r[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=_-1,t.match_available=0,t.ins_h=0),n}function K(e,t,n,r,o,s){if(!e)return h;var a=1;
vendor: 4,531 bytes, line 1
1if(t===p&&(t=6),r<0?(a=0,r=-r):15<r&&(a=2,r-=16),o<1||v<o||n!==g||r<8||15<r||t<0||9<t||s<0||f<s)return I(e,h);8===r&&(r=9);var l=new U;return(e.state=l).strm=e,l.wrap=a,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+_-1)/_),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=s,l.method=n,q(e)}r=[new H(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(F(e),0===e.lookahead&&t===c)return M;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,P(e,!1),0===e.strm.avail_out))return M;if(e.strstart-e.block_start>=e.w_size-C&&(P(e,!1),0===e.strm.avail_out))return M}return e.insert=0,t===d?(P(e,!0),0===e.strm.avail_out?A:N):(e.strstart>e.block_start&&(P(e,!1),e.strm.avail_out),M)})),new H(4,4,8,4,$),new H(4,5,16,8,$),new H(4,6,32,32,$),new H(4,4,16,16,V),new H(8,16,32,32,V),new H(8,16,128,128,V),new H(8,32,128,256,V),new H(32,128,258,1024,V),new H(32,258,258,4096,V)],n.deflateInit=function(e,t){return K(e,t,g,15,8,0)},n.deflateInit2=K,n.deflateReset=q,n.deflateResetKeep=W,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?h:(e.state.gzhead=t,u):h},n.deflate=function(e,t){var n,i,s,l;if(!e||!e.state||5<t||t<0)return e?I(e,h):h;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==d)return I(e,0===e.avail_out?-5:h);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===T)if(2===i.wrap)e.adler=0,z(i,31),z(i,139),z(i,8),i.gzhead?(z(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),z(i,255&i.gzhead.time),z(i,i.gzhead.time>>8&255),z(i,i.gzhead.time>>16&255),z(i,i.gzhead.time>>24&255),z(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),z(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(z(i,255&i.gzhead.extra.length),z(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(z(i,0),z(i,0),z(i,0),z(i,0),z(i,0),z(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),z(i,3),i.status=O);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(p|=32),p+=31-p%31,i.status=O,B(i,p),0!==i.strstart&&(B(i,e.adler>>>16),B(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),L(e),s=i.pending,i.pending!==i.pending_buf_size));)z(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),L(e),s=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,z(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),L(e),s=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,z(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&L(e),i.pending+2<=i.pending_buf_size&&(z(i,255&e.adler),z(i,e.adler>>8&255),e.adler=0,i.status=O)):i.status=O),0!==i.pending){if(L(e),0===e.avail_out)return i.last_flush=-1,u}else if(0===e.avail_in&&D(t)<=D(n)&&t!==d)return I(e,-5);if(666===i.status&&0!==e.avail_in)return I(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&666!==i.status){var f=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(F(e),0===e.lookahead)){if(t===c)return M;break}
vendor: 2,231 bytes, line 1
1if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(P(e,!1),0===e.strm.avail_out))return M}return e.insert=0,t===d?(P(e,!0),0===e.strm.avail_out?A:N):e.last_lit&&(P(e,!1),0===e.strm.avail_out)?M:E}(i,t):3===i.strategy?function(e,t){for(var n,r,i,s,a=e.window;;){if(e.lookahead<=S){if(F(e),e.lookahead<=S&&t===c)return M;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=_&&0<e.strstart&&(r=a[i=e.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){s=e.strstart+S;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<s);e.match_length=S-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=_?(n=o._tr_tally(e,1,e.match_length-_),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(P(e,!1),0===e.strm.avail_out))return M}return e.insert=0,t===d?(P(e,!0),0===e.strm.avail_out?A:N):e.last_lit&&(P(e,!1),0===e.strm.avail_out)?M:E}(i,t):r[i.level].func(i,t);if(f!==A&&f!==N||(i.status=666),f===M||f===A)return 0===e.avail_out&&(i.last_flush=-1),u;if(f===E&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(R(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),L(e),0===e.avail_out))return i.last_flush=-1,u}return t!==d?u:i.wrap<=0?1:(2===i.wrap?(z(i,255&e.adler),z(i,e.adler>>8&255),z(i,e.adler>>16&255),z(i,e.adler>>24&255),z(i,255&e.total_in),z(i,e.total_in>>8&255),z(i,e.total_in>>16&255),z(i,e.total_in>>24&255)):(B(i,e.adler>>>16),B(i,65535&e.adler)),L(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?u:1)},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==T&&69!==t&&73!==t&&91!==t&&103!==t&&t!==O&&666!==t?I(e,h):(e.state=null,t===O?I(e,-3):u):h},n.deflateSetDictionary=function(e,t){var n,r,o,a,l,c,d,p,f=t.length;if(!e||!e.state)return h;if(2===(a=(n=e.state).wrap)||1===a&&n.status!==T||n.lookahead)return h;for(1===a&&(e.adler=s(e.adler,t,f,0)),n.wrap=0,f>=n.w_size&&(0===a&&(R(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,f-n.w_size,n.w_size,0),t=p,f=n.w_size),l=e.avail_in,c=e.next_in,d=e.input,e.avail_in=f,e.
vendor: 4,215 bytes, line 1
1next_in=0,e.input=t,F(n);n.lookahead>=_;){for(r=n.strstart,o=n.lookahead-(_-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+_-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--o;);n.strstart=r,n.lookahead=_-1,F(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=_-1,n.match_available=0,e.next_in=c,e.input=d,e.avail_in=l,n.wrap=a,u},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){t.exports=function(e,t){var n,r,i,o,s,a,l,c,d,u,h,p,f,m,g,v,y,b,w,x,k,_,S,C,T;n=e.state,r=e.next_in,C=e.input,i=r+(e.avail_in-5),o=e.next_out,T=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),l=n.dmax,c=n.wsize,d=n.whave,u=n.wnext,h=n.window,p=n.hold,f=n.bits,m=n.lencode,g=n.distcode,v=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;e:do{f<15&&(p+=C[r++]<<f,f+=8,p+=C[r++]<<f,f+=8),b=m[p&v];t:for(;;){if(p>>>=w=b>>>24,f-=w,0==(w=b>>>16&255))T[o++]=65535&b;else{if(!(16&w)){if(!(64&w)){b=m[(65535&b)+(p&(1<<w)-1)];continue t}if(32&w){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}x=65535&b,(w&=15)&&(f<w&&(p+=C[r++]<<f,f+=8),x+=p&(1<<w)-1,p>>>=w,f-=w),f<15&&(p+=C[r++]<<f,f+=8,p+=C[r++]<<f,f+=8),b=g[p&y];n:for(;;){if(p>>>=w=b>>>24,f-=w,!(16&(w=b>>>16&255))){if(!(64&w)){b=g[(65535&b)+(p&(1<<w)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(k=65535&b,f<(w&=15)&&(p+=C[r++]<<f,(f+=8)<w&&(p+=C[r++]<<f,f+=8)),l<(k+=p&(1<<w)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=w,f-=w,(w=o-s)<k){if(d<(w=k-w)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(S=h,(_=0)===u){if(_+=c-w,w<x){for(x-=w;T[o++]=h[_++],--w;);_=o-k,S=T}}else if(u<w){if(_+=c+u-w,(w-=u)<x){for(x-=w;T[o++]=h[_++],--w;);if(_=0,u<x){for(x-=w=u;T[o++]=h[_++],--w;);_=o-k,S=T}}}else if(_+=u-w,w<x){for(x-=w;T[o++]=h[_++],--w;);_=o-k,S=T}for(;2<x;)T[o++]=S[_++],T[o++]=S[_++],T[o++]=S[_++],x-=3;x&&(T[o++]=S[_++],1<x&&(T[o++]=S[_++]))}else{for(_=o-k;T[o++]=T[_++],T[o++]=T[_++],T[o++]=T[_++],2<(x-=3););x&&(T[o++]=T[_++],1<x&&(T[o++]=T[_++]))}break}}break}}while(r<i&&o<a);r-=x=f>>3,p&=(1<<(f-=x<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<a?a-o+257:257-(o-a),n.hold=p,n.bits=f}},{}],49:[function(e,t,n){var r=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),s=e("./inffast"),a=e("./inftrees"),l=1,c=2,d=0,u=-2,h=1,p=852,f=592;function m(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=h,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(f),t.sane=1,t.back=-1,d):u}function y(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,v(e)):u}function b(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?u:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,y(e))):u}function w(e,t){var n,r;return e?(r=new g,(e.state=r).window=null,(n=b(e,t))!==d&&(e.state=null),n):u}var x,k,_=!0;function S(e){if(_){var t;for(x=new r.Buf32(512),k=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(l,e.lens,0,288,x,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(c,e.lens,0,32,k,0,e.work,{bits:5}),_=!1}
vendor: 4,826 bytes, line 1
1e.lencode=x,e.lenbits=9,e.distcode=k,e.distbits=5}function C(e,t,n,i){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new r.Buf8(s.wsize)),i>=s.wsize?(r.arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(o=s.wsize-s.wnext)&&(o=i),r.arraySet(s.window,t,n-i,o,s.wnext),(i-=o)?(r.arraySet(s.window,t,n-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}n.inflateReset=y,n.inflateReset2=b,n.inflateResetKeep=v,n.inflateInit=function(e){return w(e,15)},n.inflateInit2=w,n.inflate=function(e,t){var n,p,f,g,v,y,b,w,x,k,_,T,O,M,E,A,N,I,D,R,L,P,z,B,j=0,F=new r.Buf8(4),$=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return u;12===(n=e.state).mode&&(n.mode=13),v=e.next_out,f=e.output,b=e.avail_out,g=e.next_in,p=e.input,y=e.avail_in,w=n.hold,x=n.bits,k=y,_=b,P=d;e:for(;;)switch(n.mode){case h:if(0===n.wrap){n.mode=13;break}for(;x<16;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(2&n.wrap&&35615===w){F[n.check=0]=255&w,F[1]=w>>>8&255,n.check=o(n.check,F,2,0),x=w=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&w)<<8)+(w>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&w)){e.msg="unknown compression method",n.mode=30;break}if(x-=4,L=8+(15&(w>>>=4)),0===n.wbits)n.wbits=L;else if(L>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<L,e.adler=n.check=1,n.mode=512&w?10:12,x=w=0;break;case 2:for(;x<16;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(n.flags=w,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=w>>8&1),512&n.flags&&(F[0]=255&w,F[1]=w>>>8&255,n.check=o(n.check,F,2,0)),x=w=0,n.mode=3;case 3:for(;x<32;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}n.head&&(n.head.time=w),512&n.flags&&(F[0]=255&w,F[1]=w>>>8&255,F[2]=w>>>16&255,F[3]=w>>>24&255,n.check=o(n.check,F,4,0)),x=w=0,n.mode=4;case 4:for(;x<16;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}n.head&&(n.head.xflags=255&w,n.head.os=w>>8),512&n.flags&&(F[0]=255&w,F[1]=w>>>8&255,n.check=o(n.check,F,2,0)),x=w=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}n.length=w,n.head&&(n.head.extra_len=w),512&n.flags&&(F[0]=255&w,F[1]=w>>>8&255,n.check=o(n.check,F,2,0)),x=w=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(y<(T=n.length)&&(T=y),T&&(n.head&&(L=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,T,L)),512&n.flags&&(n.check=o(n.check,p,T,g)),y-=T,g+=T,n.length-=T),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===y)break e;for(T=0;L=p[g+T++],n.head&&L&&n.length<65536&&(n.head.name+=String.fromCharCode(L)),L&&T<y;);if(512&n.flags&&(n.check=o(n.check,p,T,g)),y-=T,g+=T,L)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===y)break e;for(T=0;L=p[g+T++],n.head&&L&&n.length<65536&&(n.head.comment+=String.fromCharCode(L)),L&&T<y;);if(512&n.flags&&(n.check=o(n.check,p,T,g)),y-=T,g+=T,L)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;x<16;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(w!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}x=w=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}e.adler=n.check=m(w),x=w=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=v,e.avail_out=b,e.next_in=g,e.avail_in=y,n.hold=w,n.bits=x,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){w>>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}switch(n.last=1&w,x-=1,3&(w>>>=1)){case 0:n.mode=14;break;case 1:if(S(n),n.mode=20,6!==t)break;w>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}w>>>=2,x-=2;break;case 14:for(w>>>=7&x,x-=7&x;x<32;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if((65535&w)!=(w>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&w,x=w=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(T=n.length){if(y<T&&(T=y),b<T&&(T=b),0===T)break e;r.arraySet(f,p,g,T,v),y-=T,g+=T,b-=T,v+=T,n.length-=T;break}n.mode=12;break;case 17:for(;x<14;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(n.nlen=257+(31&w),w>>>=5,x-=5,n.ndist=1+(31&w),w>>>=5,x-=5,n.ncode=4+(15&w),w>>>=4,x-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;x<3;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}n.lens[$[n.have++]]=7&w,w>>>=3,x-=3}for(;n.have<19;)n.lens[$[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,z={bits:n.lenbits}
vendor: 7,353 bytes, line 1
1,P=a(0,n.lens,0,19,n.lencode,0,n.work,z),n.lenbits=z.bits,P){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;A=(j=n.lencode[w&(1<<n.lenbits)-1])>>>16&255,N=65535&j,!((E=j>>>24)<=x);){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(N<16)w>>>=E,x-=E,n.lens[n.have++]=N;else{if(16===N){for(B=E+2;x<B;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(w>>>=E,x-=E,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}L=n.lens[n.have-1],T=3+(3&w),w>>>=2,x-=2}else if(17===N){for(B=E+3;x<B;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}x-=E,L=0,T=3+(7&(w>>>=E)),w>>>=3,x-=3}else{for(B=E+7;x<B;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}x-=E,L=0,T=11+(127&(w>>>=E)),w>>>=7,x-=7}if(n.have+T>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;T--;)n.lens[n.have++]=L}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,z={bits:n.lenbits},P=a(l,n.lens,0,n.nlen,n.lencode,0,n.work,z),n.lenbits=z.bits,P){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,z={bits:n.distbits},P=a(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,z),n.distbits=z.bits,P){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=y&&258<=b){e.next_out=v,e.avail_out=b,e.next_in=g,e.avail_in=y,n.hold=w,n.bits=x,s(e,_),v=e.next_out,f=e.output,b=e.avail_out,g=e.next_in,p=e.input,y=e.avail_in,w=n.hold,x=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;A=(j=n.lencode[w&(1<<n.lenbits)-1])>>>16&255,N=65535&j,!((E=j>>>24)<=x);){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(A&&!(240&A)){for(I=E,D=A,R=N;A=(j=n.lencode[R+((w&(1<<I+D)-1)>>I)])>>>16&255,N=65535&j,!(I+(E=j>>>24)<=x);){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}w>>>=I,x-=I,n.back+=I}if(w>>>=E,x-=E,n.back+=E,n.length=N,0===A){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(B=n.extra;x<B;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}n.length+=w&(1<<n.extra)-1,w>>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(j=n.distcode[w&(1<<n.distbits)-1])>>>16&255,N=65535&j,!((E=j>>>24)<=x);){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(!(240&A)){for(I=E,D=A,R=N;A=(j=n.distcode[R+((w&(1<<I+D)-1)>>I)])>>>16&255,N=65535&j,!(I+(E=j>>>24)<=x);){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}w>>>=I,x-=I,n.back+=I}if(w>>>=E,x-=E,n.back+=E,64&A){e.msg="invalid distance code",n.mode=30;break}n.offset=N,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(B=n.extra;x<B;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}n.offset+=w&(1<<n.extra)-1,w>>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===b)break e;if(T=_-b,n.offset>T){if((T=n.offset-T)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}O=T>n.wnext?(T-=n.wnext,n.wsize-T):n.wnext-T,T>n.length&&(T=n.length),M=n.window}else M=f,O=v-n.offset,T=n.length;for(b<T&&(T=b),b-=T,n.length-=T;f[v++]=M[O++],--T;);0===n.length&&(n.mode=21);break;case 26:if(0===b)break e;f[v++]=n.length,b--,n.mode=21;break;case 27:if(n.wrap){for(;x<32;){if(0===y)break e;y--,w|=p[g++]<<x,x+=8}if(_-=b,e.total_out+=_,n.total+=_,_&&(e.adler=n.check=n.flags?o(n.check,f,_,v-_):i(n.check,f,_,v-_)),_=b,(n.flags?w:m(w))!==n.check){e.msg="incorrect data check",n.mode=30;break}x=w=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;x<32;){if(0===y)break e;y--,w+=p[g++]<<x,x+=8}if(w!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}x=w=0}n.mode=29;case 29:P=1;break e;case 30:P=-3;break e;case 31:return-4;default:return u}return e.next_out=v,e.avail_out=b,e.next_in=g,e.avail_in=y,n.hold=w,n.bits=x,(n.wsize||_!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&C(e,e.output,e.next_out,_-e.avail_out)?(n.mode=31,-4):(k-=e.avail_in,_-=e.avail_out,e.total_in+=k,e.total_out+=_,n.total+=_,n.wrap&&_&&(e.adler=n.check=n.flags?o(n.check,f,_,e.next_out-_):i(n.check,f,_,e.next_out-_)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==k&&0===_||4===t)&&P===d&&(P=-5),P)},n.inflateEnd=function(e){if(!e||!e.state)return u;var t=e.state;return t.window&&(t.window=null),e.state=null,d},n.inflateGetHeader=function(e,t){var n;return e&&e.state&&2&(n=e.state).wrap?((n.head=t).done=!1,d):u},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?u:11===n.mode&&i(1,t,r,0)!==n.check?-3:C(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,d):u},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){var r=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,l,c,d,u,h){var p,f,m,g,v,y,b,w,x,k=h.bits,_=0,S=0,C=0,T=0,O=0,M=0,E=0,A=0,N=0,I=0,D=null,R=0,L=new r.Buf16(16),P=new r.Buf16(16),z=null,B=0;for(_=0;_<=15;_++)L[_]=0;for(S=0;S<l;S++)L[t[n+S]]++;for(O=k,T=15;1<=T&&0===L[T];T--);if(T<O&&(O=T),0===T)return c[d++]=20971520,c[d++]=20971520,h.bits=1,0;for(C=1;C<T&&0===L[C];C++);for(O<C&&(O=C),_=A=1;_<=15;_++)if(A<<=1,(A-=L[_])<0)return-1;if(0<A&&(0===e||1!==T))return-1;for(P[1]=0,_=1;_<15;_++)P[_+1]=P[_]+L[_];for(S=0;S<l;S++)0!==t[n+S]&&(u[P[t[n+S]]++]=S);if(y=0===e?(D=z=u,19):1===e?(D=i,R-=257,z=o,B-=257,256):(D=s,z=a,-1),_=C,v=d,E=S=I=0,m=-1,g=(N=1<<(M=O))-1,1===e&&852<N||2===e&&592<N)return 1;for(;;){for(b=_-E,x=u[S]<y?(w=0,u[S]):u[S]>y?(w=z[B+u[S]],D[R+u[S]]):(w=96,0),p=1<<_-E,C=f=1<<M;c[v+(I>>E)+(f-=p)]=b<<24|w<<16|x,0!==f;);for(p=1<<_-1;I&p;)p>>=1;if(0!==p?(I&=p-1,I+=p):I=0,S++,0==--L[_]){if(_===T)break;_=t[n+u[S]]}if(O<_&&(I&g)!==m){for(0===E&&(E=O),v+=C,A=1<<(M=_-E);M+E<T&&!((A-=L[M+E])<=0);)M++,A<<=1;if(N+=1<<M,1===e&&852<N||2===e&&592<N)return 1;c[m=I&g]=O<<24|M<<16|v-d}}return 0!==I&&(c[v+I]=_-E<<24|64<<16),h.bits=O,0}},{"../utils/common":41}],51:[function(e,t,n){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){var r=e("../utils/common"),i=0,o=1;function s(e){for(var t=e.length;0<=--t;)e[t]=0}var a=0,l=29,c=256,d=c+1+l,u=30,h=19,p=2*d+1,f=15,m=16,g=7,v=256,y=16,b=17,w=18,x=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],k=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=new Array(2*(d+2));s(C);var T=new Array(2*u);s(T);var O=new Array(512);s(O);var M=new Array(256);s(M);var E=new Array(l);s(E);var A,N,I,D=new Array(u);function R(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function L(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function P(e){return e<256?O[e]:O[256+(e>>>7)]}
vendor: 5,521 bytes, line 1
1function z(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function B(e,t,n){e.bi_valid>m-n?(e.bi_buf|=t<<e.bi_valid&65535,z(e,e.bi_buf),e.bi_buf=t>>m-e.bi_valid,e.bi_valid+=n-m):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function j(e,t,n){B(e,n[2*t],n[2*t+1])}function F(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function $(e,t,n){var r,i,o=new Array(f+1),s=0;for(r=1;r<=f;r++)o[r]=s=s+n[r-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=F(o[a]++,a))}}function V(e){var t;for(t=0;t<d;t++)e.dyn_ltree[2*t]=0;for(t=0;t<u;t++)e.dyn_dtree[2*t]=0;for(t=0;t<h;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*v]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function H(e){8<e.bi_valid?z(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function U(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function W(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&U(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!U(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function q(e,t,n){var r,i,o,s,a=0;if(0!==e.last_lit)for(;r=e.pending_buf[e.d_buf+2*a]<<8|e.pending_buf[e.d_buf+2*a+1],i=e.pending_buf[e.l_buf+a],a++,0===r?j(e,i,t):(j(e,(o=M[i])+c+1,t),0!==(s=x[o])&&B(e,i-=E[o],s),j(e,o=P(--r),n),0!==(s=k[o])&&B(e,r-=D[o],s)),a<e.last_lit;);j(e,v,t)}function K(e,t){var n,r,i,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=p,n=0;n<l;n++)0!==o[2*n]?(e.heap[++e.heap_len]=c=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=s[2*i+1]);for(t.max_code=c,n=e.heap_len>>1;1<=n;n--)W(e,o,n);for(i=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],W(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,W(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,s,a,l=t.dyn_tree,c=t.max_code,d=t.stat_desc.static_tree,u=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,m=t.stat_desc.extra_base,g=t.stat_desc.max_length,v=0;for(o=0;o<=f;o++)e.bl_count[o]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<p;n++)g<(o=l[2*l[2*(r=e.heap[n])+1]+1]+1)&&(o=g,v++),l[2*r+1]=o,c<r||(e.bl_count[o]++,s=0,m<=r&&(s=h[r-m]),a=l[2*r],e.opt_len+=a*(o+s),u&&(e.static_len+=a*(d[2*r+1]+s)));if(0!==v){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,v-=2}while(0<v);for(o=g;0!==o;o--)for(r=e.bl_count[o];0!==r;)c<(i=e.heap[--n])||(l[2*i+1]!==o&&(e.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),r--)}}(e,t),$(o,c,e.bl_count)}function J(e,t,n){var r,i,o=-1,s=t[1],a=0,l=7,c=4;for(0===s&&(l=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=s,s=t[2*(r+1)+1],++a<l&&i===s||(a<c?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[2*y]++):a<=10?e.bl_tree[2*b]++:e.bl_tree[2*w]++,o=i,c=(a=0)===s?(l=138,3):i===s?(l=6,3):(l=7,4))}function G(e,t,n){var r,i,o=-1,s=t[1],a=0,l=7,c=4;for(0===s&&(l=138,c=3),r=0;r<=n;r++)if(i=s,s=t[2*(r+1)+1],!(++a<l&&i===s)){if(a<c)for(;j(e,i,e.bl_tree),0!=--a;);else 0!==i?(i!==o&&(j(e,i,e.bl_tree),a--),j(e,y,e.bl_tree),B(e,a-3,2)):a<=10?(j(e,b,e.bl_tree),B(e,a-3,3)):(j(e,w,e.bl_tree),B(e,a-11,7));o=i,c=(a=0)===s?(l=138,3):i===s?(l=6,3):(l=7,4)}}s(D);var Z=!1;function X(e,t,n,i){var o,s,l,c;B(e,(a<<1)+(i?1:0),3),s=t,l=n,c=!0,H(o=e),c&&(z(o,l),z(o,~l)),r.arraySet(o.pending_buf,o.window,s,l,o.pending),o.pending+=l}n._tr_init=function(e){Z||(function(){var e,t,n,r,i,o=new Array(f+1);for(r=n=0;r<l-1;r++)for(E[r]=n,e=0;e<1<<x[r];e++)M[n++]=r;for(M[n-1]=r,r=i=0;r<16;r++)for(D[r]=i,e=0;e<1<<k[r];e++)O[i++]=r;for(i>>=7;r<u;r++)for(D[r]=i<<7,e=0;e<1<<k[r]-7;e++)O[256+i++]=r;for(t=0;t<=f;t++)o[t]=0;for(e=0;e<=143;)C[2*e+1]=8,e++,o[8]++;for(;e<=255;)C[2*e+1]=9,e++,o[9]++;for(;e<=279;)C[2*e+1]=7,e++,o[7]++;for(;e<=287;)C[2*e+1]=8,e++,o[8]++;for($(C,d+1,o),e=0;e<u;e++)T[2*e+1]=5,T[2*e]=F(e,5);A=new R(C,x,c+1,d,f),N=new R(T,k,0,u,f),I=new R(new Array(0),_,0,h,g)}(),Z=!0),e.l_desc=new L(e.dyn_ltree,A),e.d_desc=new L(e.dyn_dtree,N),e.bl_desc=new L(e.bl_tree,I),e.bi_buf=0,e.bi_valid=0,V(e)},n._tr_stored_block=X,n._tr_flush_block=function(e,t,n,r){var s,a,l=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t<c;t++)if(0!==e.dyn_ltree[2*t])return o;return i}(e)),K(e,e.l_desc),K(e,e.d_desc),l=function(e){var t;for(J(e,e.dyn_ltree,e.l_desc.max_code),J(e,e.dyn_dtree,e.d_desc.max_code),K(e,e.bl_desc),t=h-1;3<=t&&0===e.bl_tree[2*S[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),s=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=s&&(s=a)):s=a=n+5,n+4<=s&&-1!==t?X(e,t,n,r):4===e.strategy||a===s?(B(e,2+(r?1:0),3),q(e,C,T)):(B(e,4+(r?1:0),3),function(e,t,n,r){var i;for(B(e,t-257,5),B(e,n-1,5),B(e,r-4,4),i=0;i<r;i++)B(e,e.bl_tree[2*S[i]+1],3);G(e,e.dyn_ltree,t-1),G(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),q(e,e.dyn_ltree,e.dyn_dtree)),V(e),r&&H(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(M[n]+c+1)]++,e.dyn_dtree[2*P(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){var t;
1B(e,2,3),j(e,v,C),16===(t=e).bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){!function(e,t){if(!e.setImmediate){var n,r,i,o,s=1,a={},l=!1,c=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,n="[object process]"==={}.toString.call(e.process)?function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",p,!1):e.attachEvent("onmessage",p),function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},function(e){i.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(r=c.documentElement,function(e){var t=c.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(h,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return a[s]=i,n(s),s++},d.clearImmediate=u}function u(e){delete a[e]}function h(e){if(l)setTimeout(h,0,e);else{var n=a[e];if(n){l=!0;try{!function(e){var n=e.callback,r=e.args;switch(r.length){case 0:n();break;case 1:n(r[0]);break;case 2:n(r[0],r[1]);break;case 3:n(r[0],r[1],r[2]);break;default:n.apply(t,r)}}(n)}finally{u(e),l=!1}}}}function p(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==Ve?Ve:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10);var gv=mv.exports;Object.defineProperty(Ag,"__esModule",{value:!0});var vv=Ag.asBlob=void 0,yv=zg,bv=jg,wv=gv;vv=Ag.asBlob=function(e,t){return void 0===t&&(t={}),yv.__awaiter(this,void 0,void 0,(function(){var n;return yv.__generator(this,(function(r){switch(r.label){case 0:return n=new wv,bv.addFiles(n,e,t),[4,bv.generateDocument(n)];case 1:return[2,r.sent()]}}))}))};const xv={key:0,class:"mask"},kv={class:"drama-wrap"},_v={id:"export-word"},Sv={class:"heading-title",style:{"text-align":"center"}},Cv={class:"role"},Tv=(e=>(b("data-v-c3bef95b"),e=e(),w(),e))((()=>l("div",{class:"label"},"è§è²ï¼",-1))),Ov={class:"content"},Mv={class:"sence-title",style:{"text-align":"center"}},Ev={class:"out-line"},Av={class:"label"},Nv={class:"content"},Iv={class:"shot"},Dv={class:"desc"},Rv={class:"label"},Lv={class:"content"},Pv=r({__name:"index",props:{previewVisible:{type:Boolean,default:!1}},emits:["handleClose"],setup(t,{emit:n}){const r=X(),i=x((()=>r.dramaForm.drama)),o=x((()=>r.formRoles.map((e=>e.material_name)).join("ã"))),c=x((()=>G.get(r.dramaForm.drama,"scene_list",[])||[])),d=e=>{var t;const n=G.get(e,"layout",[]);return[{label:"大纲ï¼",name:e.outline||""},{label:"å¸å±ï¼",name:(null==(t=null==n?void 0:n[0])?void 0:t.second_type)||""},{label:"åºæ¯ï¼",name:e.bg_name||""}]},f=e=>{const t=G.get(e,"shot_list",[]);return 1!==t.length||0!==t[0].role_id||t[0].dialogue?e.shot_list||[]:[{name:"对è¯",dialogue:""}]},g=()=>{y("handleClose")},y=n,b=async()=>{var e;const t=i.value.drama_name,n=null==(e=document.getElementById("export-word"))?void 0:e.innerHTML,r=await vv(n),o=document.createElement("a");o.href=URL.createObjectURL(r),o.download=`${t}.docx`,o.click()};return(n,r)=>t.previewVisible?(s(),a("div",xv,[l("div",kv,[l("div",{class:"btn"},[l("div",{class:"back-btn",onClick:g},"è¿å"),l("div",{class:"download-btn",onClick:b},"ä¸è½½å°æ¬å°")]),l("div",_v,[l("div",Sv,m(p(i).drama_name||"æ é¢"),1),l("div",Cv,[Tv,l("span",Ov,m(p(o)),1)]),(s(!0),a(u,null,h(p(c),((t,n)=>{return s(),a("div",{class:"sence",key:n},[l("div",Mv," 第"+m(p(e)(n+1))+"åº ",1),l("div",Ev,[(s(!0),a(u,null,h(d(t),((e,t)=>(s(),a("div",{class:"out-line-item",key:t},[l("div",Av,m(e.label),1),l("span",Nv,m(e.name),1)])))),128))]),l("div",Iv,[(s(!0),a(u,null,h((r=t,r.plot_list||[]),((e,t)=>(s(),a("div",{class:"shot-item",key:t},[l("div",Dv,"ï¼"+m(e.desc||"æ æè¿°")+"ï¼",1),(s(!0),a(u,null,h(f(e),((e,t)=>(s(),a("div",{class:"action-item",key:t},[l("div",Rv,m(e.name||"ï¼æ è§è²ï¼")+"ï¼",1),l("span",Lv,m(e.dialogue||""),1)])))),128))])))),128))])]);var r})),128))])])])):v("",!0)}}),zv=ie(Pv,[["__scopeId","data-v-c3bef95b"]]),Bv=r({__name:"index",setup(e){const r=O(),o=i(),l=X(),d=i(!1),h=x((()=>l.isStreaming?P(Gf):P(xn))),m=()=>{d.value=!1},g=e=>{l.updateRoleList(e)},v=()=>{var e;l.isStreaming&&(null==(e=o.value)||e.mergeDrama()),d.value=!0},y=e=>{l.setScreenType(e),l.searchLayout(e)};return E((()=>{var e;t.on(Se.PREVIEW_DRAMA,v);const n=r.params.id;if(null==(e=r.query)?void 0:e.series_id){const e=Number(r.query.series_id);l.handleSeriesDrama(e)}
1if("landscapeScreen"===n)y(0);else if("verticalScreen"===n)y(1);else if(r.params.taskId){const e=r.params.projectId,t=r.params.taskId;l.getDrama(t,e)}else n&&l.getDrama(n,"")})),A((()=>{t.remove(Se.PREVIEW_DRAMA,v),l.$reset()})),(e,t)=>(s(),a(u,null,[c(n),(s(),f(R(p(h)),{ref_key:"child",ref:o},null,512)),c(ze,{onHandleSubmit:g}),c(kg),c(Eg,{ref:"chooseLayout"},null,512),c(zv,{previewVisible:p(d),onHandleClose:m},null,8,["previewVisible"])],64))}});export{Bv as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.