@ucap-llm/ai-ui 1.2.0-beta.11 → 1.2.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/{_basePickBy-DCVQK7rw.mjs → _basePickBy-BWB4bTVi.mjs} +2 -2
  2. package/ai-ui.es.js +1 -1
  3. package/ai-ui.umd.js +2 -2
  4. package/{arc-Boj_lamS.mjs → arc-X81XOSSd.mjs} +1 -1
  5. package/{architecture-4AB2E3PP-BvPI75lt.mjs → architecture-4AB2E3PP-BWSj6tGU.mjs} +1 -1
  6. package/{architectureDiagram-IEHRJDOE-CwbEEJkO.mjs → architectureDiagram-IEHRJDOE-Bt1NRwnq.mjs} +4 -4
  7. package/{blockDiagram-JOT3LUYC-BABdPT1V.mjs → blockDiagram-JOT3LUYC-DBY5Y9D4.mjs} +4 -4
  8. package/{c4Diagram-VJAJSXHY-CzxsyV8t.mjs → c4Diagram-VJAJSXHY-mYiJG4gX.mjs} +2 -2
  9. package/{channel-BqB22bzO.mjs → channel-BU3MLQyZ.mjs} +1 -1
  10. package/{chunk-4BMEZGHF-yu8lVMGG.mjs → chunk-4BMEZGHF-nDiC69yv.mjs} +1 -1
  11. package/{chunk-A2AXSNBT-BFs8jFGW.mjs → chunk-A2AXSNBT-RcPlCCHm.mjs} +2 -2
  12. package/{chunk-AEK57VVT-CfBAZ3pn.mjs → chunk-AEK57VVT-CP3PYGhE.mjs} +2 -2
  13. package/{chunk-D6G4REZN-CsmBRWNG.mjs → chunk-D6G4REZN-CpD2gmk7.mjs} +1 -1
  14. package/{chunk-RZ5BOZE2--8BYpDTb.mjs → chunk-RZ5BOZE2-BdHHf-fb.mjs} +1 -1
  15. package/{chunk-XZIHB7SX-CStXbatc.mjs → chunk-XZIHB7SX-P8cZKNUX.mjs} +1 -1
  16. package/{classDiagram-GIVACNV2-Dp-4WHdl.mjs → classDiagram-GIVACNV2-I8_nWkZX.mjs} +2 -2
  17. package/{classDiagram-v2-COTLJTTW-Dp-4WHdl.mjs → classDiagram-v2-COTLJTTW-I8_nWkZX.mjs} +2 -2
  18. package/{clone-DC_Xewab.mjs → clone-BZg7N8Rr.mjs} +1 -1
  19. package/{dagre-OKDRZEBW-07Io9wQK.mjs → dagre-OKDRZEBW-C3UCYt9D.mjs} +6 -6
  20. package/{diagram-SSKATNLV-C6OtFk63.mjs → diagram-SSKATNLV-kGKB70Wb.mjs} +3 -3
  21. package/{diagram-VNBRO52H-BIrY1QiX.mjs → diagram-VNBRO52H-Dgd7wmOI.mjs} +3 -3
  22. package/{erDiagram-Q7BY3M3F-BhNeg8bO.mjs → erDiagram-Q7BY3M3F-Cm7UVOKw.mjs} +3 -3
  23. package/{flowDiagram-4HSFHLVR-CZYn4FiL.mjs → flowDiagram-4HSFHLVR-BZIy5VfK.mjs} +3 -3
  24. package/{ganttDiagram-APWFNJXF-CU-_ShBy.mjs → ganttDiagram-APWFNJXF-Cac4Poq6.mjs} +2 -2
  25. package/{gitGraph-O2Q2CXLX-CHZmlnQl.mjs → gitGraph-O2Q2CXLX-BEoJaMTG.mjs} +1 -1
  26. package/{gitGraphDiagram-7IBYFJ6S-Dw6WSLV1.mjs → gitGraphDiagram-7IBYFJ6S-BSwBCksW.mjs} +4 -4
  27. package/{graph-Cuplymd2.mjs → graph-BH_yITec.mjs} +2 -2
  28. package/{index-Bc8u-TCg.mjs → index-u_1OizEd.mjs} +34 -32
  29. package/info-4N47QTOZ-sIJ1ry2P.mjs +5 -0
  30. package/{infoDiagram-PH2N3AL5-AKB6SyuZ.mjs → infoDiagram-PH2N3AL5-CXFHQ_jX.mjs} +2 -2
  31. package/{journeyDiagram-U35MCT3I-Bwcn86e_.mjs → journeyDiagram-U35MCT3I-CjYNiy1T.mjs} +3 -3
  32. package/{kanban-definition-NDS4AKOZ-DcgI4gop.mjs → kanban-definition-NDS4AKOZ-CITs2sH3.mjs} +1 -1
  33. package/{layout-BpbjP0To.mjs → layout-BgTw-_9z.mjs} +4 -4
  34. package/{linear-BDPWfqmI.mjs → linear-CzYVn0p7.mjs} +1 -1
  35. package/{mermaid-parser.core-Dw6LJl8m.mjs → mermaid-parser.core-v3S1ne0I.mjs} +10 -10
  36. package/{mindmap-definition-ALO5MXBD-0UHmAVWi.mjs → mindmap-definition-ALO5MXBD-D8chYL9E.mjs} +1 -1
  37. package/package.json +1 -1
  38. package/{packet-KVYON367-sJ5SYQ7B.mjs → packet-KVYON367-CqmTiWgl.mjs} +1 -1
  39. package/pie-R6RNRRYF-CWj-opv8.mjs +5 -0
  40. package/{pieDiagram-IB7DONF6-CJOsDe4S.mjs → pieDiagram-IB7DONF6-CViTeAd-.mjs} +4 -4
  41. package/{quadrantDiagram-7GDLP6J5-CxEpiFlI.mjs → quadrantDiagram-7GDLP6J5-rou1br5f.mjs} +2 -2
  42. package/{radar-MK3ICKWK-D5_VUbnM.mjs → radar-MK3ICKWK-JDDtEQhD.mjs} +1 -1
  43. package/{reduce-BEg2ZpV5.mjs → reduce-dnXXp7u5.mjs} +1 -1
  44. package/{requirementDiagram-KVF5MWMF-BI6l2Zc1.mjs → requirementDiagram-KVF5MWMF-CQ5GYtMj.mjs} +2 -2
  45. package/{sankeyDiagram-QLVOVGJD-DJ6WUvQv.mjs → sankeyDiagram-QLVOVGJD-DKh3H5KV.mjs} +1 -1
  46. package/{sequenceDiagram-X6HHIX6F-9Q1vV8zv.mjs → sequenceDiagram-X6HHIX6F-CLMwX1u2.mjs} +3 -3
  47. package/{stateDiagram-DGXRK772-H7txmcog.mjs → stateDiagram-DGXRK772-h4j_Yec8.mjs} +4 -4
  48. package/{stateDiagram-v2-YXO3MK2T-DtoQ-t_x.mjs → stateDiagram-v2-YXO3MK2T-CY_iL_Vi.mjs} +2 -2
  49. package/{timeline-definition-BDJGKUSR-CMV-Hdko.mjs → timeline-definition-BDJGKUSR-DadUJZnz.mjs} +2 -2
  50. package/{xychartDiagram-VJFVF3MP-bzFDLiVs.mjs → xychartDiagram-VJFVF3MP-DziX2-IY.mjs} +2 -2
  51. package/info-4N47QTOZ-CQGeBdf2.mjs +0 -5
  52. package/pie-R6RNRRYF-C4OFbe7K.mjs +0 -5
@@ -1,5 +1,5 @@
1
- import { d as x, a as b, e as v, g as P, h as p, j as w, k as I, t as N, l as A } from "./reduce-BEg2ZpV5.mjs";
2
- import { aM as g, az as E, aN as M, aO as c, aP as F, aQ as l, aE as T, aR as _, aS as $, aT as B, aU as S, aV as y } from "./index-Bc8u-TCg.mjs";
1
+ import { d as x, a as b, e as v, g as P, h as p, j as w, k as I, t as N, l as A } from "./reduce-dnXXp7u5.mjs";
2
+ import { aM as g, az as E, aN as M, aO as c, aP as F, aQ as l, aE as T, aR as _, aS as $, aT as B, aU as S, aV as y } from "./index-u_1OizEd.mjs";
3
3
  var R = /\s/;
4
4
  function z(n) {
5
5
  for (var r = n.length; r-- && R.test(n.charAt(r)); )
package/ai-ui.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bN as i, bM as r, bQ as b, bP as t, bO as e, bR as A, bV as o, bS as d, bU as h, bW as n, bT as C, bK as c, bX as u, bL as l } from "./index-Bc8u-TCg.mjs";
1
+ import { bN as i, bM as r, bQ as b, bP as t, bO as e, bR as A, bV as o, bS as d, bU as h, bW as n, bT as C, bK as c, bX as u, bL as l } from "./index-u_1OizEd.mjs";
2
2
  export {
3
3
  i as AiChat,
4
4
  r as AiChatList,
package/ai-ui.umd.js CHANGED
@@ -886,8 +886,8 @@ function print() { __p += __j.call(arguments, '') }
886
886
  `))]))),128)),o[20]||(o[20]=R.createTextVNode(`
887
887
  `))],2),o[23]||(o[23]=R.createTextVNode(`
888
888
  `))])}}},[["__scopeId","data-v-d36bf829"]]);function x$(t){return R.getCurrentScope()?(R.onScopeDispose(t),!0):!1}const VQt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $Qt=t=>t!=null,UQt=Object.prototype.toString,GQt=t=>UQt.call(t)==="[object Object]",x7=()=>{};function S$(t,e){function r(...n){return new Promise((i,a)=>{Promise.resolve(t(()=>e.apply(this,n),{fn:e,thisArg:this,args:n})).then(i).catch(a)})}return r}const zQt=t=>t();function Gge(t,e={}){let r,n,i=x7;const a=l=>{clearTimeout(l),i(),i=x7};let o;return l=>{const u=R.toValue(t),d=R.toValue(e.maxWait);return r&&a(r),u<=0||d!==void 0&&d<=0?(n&&(a(n),n=null),Promise.resolve(l())):new Promise((h,f)=>{i=e.rejectOnCancel?f:h,o=l,d&&!n&&(n=setTimeout(()=>{r&&a(r),n=null,h(o())},d)),r=setTimeout(()=>{n&&a(n),n=null,h(l())},u)})}}function qQt(...t){let e=0,r,n=!0,i=x7,a,o,s,l,u;!R.isRef(t[0])&&typeof t[0]=="object"?{delay:o,trailing:s=!0,leading:l=!0,rejectOnCancel:u=!1}=t[0]:[o,s=!0,l=!0,u=!1]=t;const d=()=>{r&&(clearTimeout(r),r=void 0,i(),i=x7)};return f=>{const p=R.toValue(o),T=Date.now()-e,g=()=>a=f();return d(),p<=0?(e=Date.now(),g()):(T>p&&(l||!n)?(e=Date.now(),g()):s&&(a=new Promise((v,m)=>{i=u?m:v,r=setTimeout(()=>{e=Date.now(),n=!0,v(g()),d()},Math.max(0,p-T))})),!l&&!r&&(r=setTimeout(()=>n=!0,p)),n=!1,a)}}function yC(t){return Array.isArray(t)?t:[t]}function YQt(t){return R.getCurrentInstance()}function WQt(t,e=200,r={}){return S$(Gge(e,r),t)}function jQt(t,e=200,r=!1,n=!0,i=!1){return S$(qQt(e,r,n,i),t)}function XQt(t,e,r={}){const{eventFilter:n=zQt,...i}=r;return R.watch(t,S$(n,e),i)}function KQt(t,e=!0,r){YQt()?R.onMounted(t,r):e?t():R.nextTick(t)}function ZQt(t,e,r={}){const{debounce:n=0,maxWait:i=void 0,...a}=r;return XQt(t,e,{...a,eventFilter:Gge(n,{maxWait:i})})}function JQt(t,e,r){return R.watch(t,e,{...r,immediate:!0})}const _C=VQt?window:void 0;function S7(t){var e;const r=R.toValue(t);return(e=r==null?void 0:r.$el)!=null?e:r}function zge(...t){const e=[],r=()=>{e.forEach(s=>s()),e.length=0},n=(s,l,u,d)=>(s.addEventListener(l,u,d),()=>s.removeEventListener(l,u,d)),i=R.computed(()=>{const s=yC(R.toValue(t[0])).filter(l=>l!=null);return s.every(l=>typeof l!="string")?s:void 0}),a=JQt(()=>{var s,l;return[(l=(s=i.value)==null?void 0:s.map(u=>S7(u)))!=null?l:[_C].filter(u=>u!=null),yC(R.toValue(i.value?t[1]:t[0])),yC(R.unref(i.value?t[2]:t[1])),R.toValue(i.value?t[3]:t[2])]},([s,l,u,d])=>{if(r(),!(s!=null&&s.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const h=GQt(d)?{...d}:d;e.push(...s.flatMap(f=>l.flatMap(p=>u.map(T=>n(f,p,T,h)))))},{flush:"post"}),o=()=>{a(),r()};return x$(r),o}function ebt(){const t=R.shallowRef(!1),e=R.getCurrentInstance();return e&&R.onMounted(()=>{t.value=!0},e),t}function qge(t){const e=ebt();return R.computed(()=>(e.value,!!t()))}function tbt(t,e,r={}){const{window:n=_C,...i}=r;let a;const o=qge(()=>n&&"MutationObserver"in n),s=()=>{a&&(a.disconnect(),a=void 0)},l=R.computed(()=>{const f=R.toValue(t),p=yC(f).map(S7).filter($Qt);return new Set(p)}),u=R.watch(()=>l.value,f=>{s(),o.value&&f.size&&(a=new MutationObserver(e),f.forEach(p=>a.observe(p,i)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),h=()=>{u(),s()};return x$(h),{isSupported:o,stop:h,takeRecords:d}}function rbt(t,e,r={}){const{window:n=_C,...i}=r;let a;const o=qge(()=>n&&"ResizeObserver"in n),s=()=>{a&&(a.disconnect(),a=void 0)},l=R.computed(()=>{const h=R.toValue(t);return Array.isArray(h)?h.map(f=>S7(f)):[S7(h)]}),u=R.watch(l,h=>{if(s(),o.value&&n){a=new ResizeObserver(e);for(const f of h)f&&a.observe(f,i)}},{immediate:!0,flush:"post"}),d=()=>{s(),u()};return x$(d),{isSupported:o,stop:d}}const Yge=1;function nbt(t,e={}){const{throttle:r=0,idle:n=200,onStop:i=x7,onScroll:a=x7,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:l="auto",window:u=_C,onError:d=x=>{console.error(x)}}=e,h=R.shallowRef(0),f=R.shallowRef(0),p=R.computed({get(){return h.value},set(x){g(x,void 0)}}),T=R.computed({get(){return f.value},set(x){g(void 0,x)}});function g(x,S){var C,L,w,M;if(!u)return;const P=R.toValue(t);if(!P)return;(w=P instanceof Document?u.document.body:P)==null||w.scrollTo({top:(C=R.toValue(S))!=null?C:T.value,left:(L=R.toValue(x))!=null?L:p.value,behavior:R.toValue(l)});const N=((M=P==null?void 0:P.document)==null?void 0:M.documentElement)||(P==null?void 0:P.documentElement)||P;p!=null&&(h.value=N.scrollLeft),T!=null&&(f.value=N.scrollTop)}const v=R.shallowRef(!1),m=R.reactive({left:!0,right:!1,top:!0,bottom:!1}),y=R.reactive({left:!1,right:!1,top:!1,bottom:!1}),_=x=>{v.value&&(v.value=!1,y.left=!1,y.right=!1,y.top=!1,y.bottom=!1,i(x))},E=WQt(_,r+n),Q=x=>{var S;if(!u)return;const C=((S=x==null?void 0:x.document)==null?void 0:S.documentElement)||(x==null?void 0:x.documentElement)||S7(x),{display:L,flexDirection:w,direction:M}=getComputedStyle(C),P=M==="rtl"?-1:1,N=C.scrollLeft;y.left=N<h.value,y.right=N>h.value;const I=Math.abs(N*P)<=(o.left||0),H=Math.abs(N*P)+C.clientWidth>=C.scrollWidth-(o.right||0)-Yge;L==="flex"&&w==="row-reverse"?(m.left=H,m.right=I):(m.left=I,m.right=H),h.value=N;let F=C.scrollTop;x===u.document&&!F&&(F=u.document.body.scrollTop),y.top=F<f.value,y.bottom=F>f.value;const k=Math.abs(F)<=(o.top||0),V=Math.abs(F)+C.clientHeight>=C.scrollHeight-(o.bottom||0)-Yge;L==="flex"&&w==="column-reverse"?(m.top=V,m.bottom=k):(m.top=k,m.bottom=V),f.value=F},b=x=>{var S;if(!u)return;const C=(S=x.target.documentElement)!=null?S:x.target;Q(C),v.value=!0,E(x),a(x)};return zge(t,"scroll",r?jQt(b,r,!0,!1):b,s),KQt(()=>{try{const x=R.toValue(t);if(!x)return;Q(x)}catch(x){d(x)}}),zge(t,"scrollend",_,s),{x:p,y:T,isScrolling:v,arrivedState:m,directions:y,measure(){const x=R.toValue(t);u&&x&&Q(x)}}}const ibt={class:"mermaid-wrapper"},abt={class:"mermaid-body"},obt=["innerHTML"],sbt={key:1,style:{margin:"32px 0"}},lbt=Si({__name:"MermaidParser",props:{code:{type:String,required:!0}},setup(t){const e=t,r=_5.PRESENTED_IMAGE_SIMPLE,n=[{value:1,label:"\u56FE\u8868"},{value:2,label:"\u6E90\u7801"}],i=R.ref(n[0].value),a=R.ref("");R.onMounted(()=>{Yg.initialize({startOnLoad:!1,theme:"default",securityLevel:"loose",fontFamily:"arial"})});const o=R.computed(()=>!a.value);ZQt(()=>e.code,async b=>{if(b){try{await Yg.parse(b)}catch{return}try{const{svg:x}=await Yg.render(`mermaid-${Date.now()}`,b);a.value=x}catch{a.value=""}}},{immediate:!0,debounce:50,maxWait:100});const s=async()=>{try{await UF(e.code),ia.success("\u590D\u5236\u6210\u529F!")}catch(b){ia.error(b)}};function l({key:b}){b==="1"?u():b==="2"?d():b==="3"&&h()}function u(){if(!a.value){ia.error("\u6682\u65E0\u53EF\u4E0B\u8F7D\u7684SVG");return}const b=a.value,x=new Blob([b],{type:"image/svg+xml"}),S=URL.createObjectURL(x),C=document.createElement("a");C.href=S;const L=new Date,w=P=>P.toString().padStart(2,"0"),M=`${L.getFullYear()}${w(L.getMonth()+1)}${w(L.getDate())}`;C.download=`${M}-mermaid.svg`,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(S),ia.success("\u4E0B\u8F7D\u6210\u529F!")}function d(){if(!a.value){ia.error("\u6682\u65E0\u53EF\u4E0B\u8F7D\u7684PNG");return}let b=a.value;b.includes('xmlns="http://www.w3.org/2000/svg"')||(b=b.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let x=800,S=600;const C=b.match(/viewBox="([\d.\s]+)"/);if(C){const I=C[1].split(" ");I.length===4&&(x=parseFloat(I[2]),S=parseFloat(I[3]))}else{const I=b.match(/width="([\d.]+)(px)?"/),H=b.match(/height="([\d.]+)(px)?"/);I&&(x=parseFloat(I[1])),H&&(S=parseFloat(H[1]))}const L=2,w=x*L,M=S*L,P=window.btoa(unescape(encodeURIComponent(b))),N=new Image;N.onload=function(){const I=document.createElement("canvas");I.width=w,I.height=M;const H=I.getContext("2d");H.fillStyle="#fff",H.fillRect(0,0,w,M),H.drawImage(N,0,0,w,M),I.toBlob(function(F){if(!F){ia.error("PNG\u751F\u6210\u5931\u8D25\uFF0Ccanvas\u5185\u5BB9\u4E3A\u7A7A");return}const k=document.createElement("a");k.href=URL.createObjectURL(F);const V=new Date,B=z=>z.toString().padStart(2,"0"),$=`${V.getFullYear()}${B(V.getMonth()+1)}${B(V.getDate())}`;k.download=`${$}-mermaid.png`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(k.href),ia.success("PNG\u5DF2\u4E0B\u8F7D")},"image/png")},N.onerror=function(){ia.error("PNG\u751F\u6210\u5931\u8D25")},N.src=`data:image/svg+xml;base64,${P}`}function h(){if(!e.code){ia.error("\u6682\u65E0\u53EF\u4E0B\u8F7D\u7684\u6E90\u7801");return}const b=new Blob([e.code],{type:"text/plain"}),x=URL.createObjectURL(b),S=document.createElement("a");S.href=x;const C=new Date,L=M=>M.toString().padStart(2,"0"),w=`${C.getFullYear()}${L(C.getMonth()+1)}${L(C.getDate())}`;S.download=`${w}-mermaid.txt`,document.body.appendChild(S),S.click(),document.body.removeChild(S),URL.revokeObjectURL(x),ia.success("\u6E90\u7801\u5DF2\u4E0B\u8F7D")}const f=R.ref(1),p=R.ref({x:0,y:0}),T=R.ref(!1),g=R.ref({x:0,y:0}),v=R.computed(()=>({transform:`translate(${p.value.x}px, ${p.value.y}px) scale(${f.value})`,"transform-origin":"center top",cursor:T.value?"grabbing":"grab",userSelect:T.value?"none":"auto"}));function m(){f.value<3&&(f.value+=.1)}function y(){f.value>.2&&(f.value-=.1)}function _(b){T.value=!0,g.value={x:b.clientX,y:b.clientY},document.addEventListener("mousemove",E),document.addEventListener("mouseup",Q)}function E(b){if(!T.value)return;const x=b.clientX-g.value.x,S=b.clientY-g.value.y;p.value.x+=x,p.value.y+=S,g.value={x:b.clientX,y:b.clientY}}function Q(){T.value=!1,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",Q)}return(b,x)=>{const S=XKe,C=Kc,L=A9,w=iE,M=MXe,P=yp,N=k4,I=T0,H=_5;return R.openBlock(),R.createElementBlock("div",ibt,[R.createVNode(Uge,null,{title:R.withCtx(()=>[R.createVNode(S,{value:i.value,"onUpdate:value":x[0]||(x[0]=F=>i.value=F),options:n},null,8,["value"])]),actions:R.withCtx(()=>[i.value===1?(R.openBlock(),R.createBlock(w,{key:0},{default:R.withCtx(()=>[R.createVNode(L,null,{title:R.withCtx(()=>x[1]||(x[1]=[R.createTextVNode("\u7F29\u5C0F")])),default:R.withCtx(()=>[R.createVNode(C,{type:"text",size:"small",disabled:f.value<=.2||o.value,onClick:y},{default:R.withCtx(()=>[R.createVNode(R.unref(xE))]),_:1},8,["disabled"])]),_:1}),R.createVNode(L,null,{title:R.withCtx(()=>x[2]||(x[2]=[R.createTextVNode("\u653E\u5927")])),default:R.withCtx(()=>[R.createVNode(C,{type:"text",size:"small",disabled:f.value>=3||o.value,onClick:m},{default:R.withCtx(()=>[R.createVNode(R.unref(EE))]),_:1},8,["disabled"])]),_:1})]),_:1})):R.createCommentVNode("",!0),i.value===1?(R.openBlock(),R.createBlock(M,{key:1,type:"vertical"})):R.createCommentVNode("",!0),R.createVNode(L,null,{title:R.withCtx(()=>x[3]||(x[3]=[R.createTextVNode("\u590D\u5236")])),default:R.withCtx(()=>[R.createVNode(C,{type:"text",size:"small",onClick:s},{default:R.withCtx(()=>[R.createVNode(R.unref(CE))]),_:1})]),_:1}),R.createVNode(I,{disabled:o.value},{overlay:R.withCtx(()=>[R.createVNode(N,{onClick:l},{default:R.withCtx(()=>[R.createVNode(P,{key:"1"},{default:R.withCtx(()=>x[4]||(x[4]=[R.createTextVNode(" \u4E0B\u8F7DSVG ")])),_:1,__:[4]}),R.createVNode(P,{key:"2"},{default:R.withCtx(()=>x[5]||(x[5]=[R.createTextVNode(" \u4E0B\u8F7DPNG ")])),_:1,__:[5]}),R.createVNode(P,{key:"3"},{default:R.withCtx(()=>x[6]||(x[6]=[R.createTextVNode(" \u4E0B\u8F7D\u6E90\u7801 ")])),_:1,__:[6]})]),_:1})]),default:R.withCtx(()=>[R.createVNode(C,{type:"text",size:"small"},{default:R.withCtx(()=>[R.createVNode(R.unref(LE))]),_:1})]),_:1},8,["disabled"])]),_:1}),R.createElementVNode("div",abt,[i.value===1?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[a.value?(R.openBlock(),R.createElementBlock("div",{key:0,innerHTML:a.value,class:"mermaid-content",style:R.normalizeStyle(v.value),onMousedown:_},null,44,obt)):(R.openBlock(),R.createBlock(H,{key:1,description:"\u6E32\u67D3\u5931\u8D25",image:R.unref(r)},null,8,["image"]))],64)):(R.openBlock(),R.createElementBlock("pre",sbt,[x[7]||(x[7]=R.createTextVNode(" ")),R.createElementVNode("code",null,R.toDisplayString(t.code),1),x[8]||(x[8]=R.createTextVNode(`
889
- `))]))])])}}},[["__scopeId","data-v-285e7110"]]),cbt={__name:"FenceParser",props:{node:{type:Object,default:()=>null}},setup(t){const e=R.ref(""),r=R.ref("");return R.watch(()=>t.node,()=>{t.node&&Kg(t.node,n=>{var i,a,o;n.type==="text"?e.value=n.value:n.type==="element"&&n.tagName==="code"&&(r.value=((o=(a=(i=n.properties)==null?void 0:i.className)==null?void 0:a[0])==null?void 0:o.replace("language-",""))||"")})},{immediate:!0}),(n,i)=>r.value==="mermaid"?(R.openBlock(),R.createBlock(lbt,{key:0,code:e.value},null,8,["code"])):(R.openBlock(),R.createBlock(FQt,{key:1,code:e.value,lang:r.value},null,8,["code","lang"]))}},ubt={class:"markdown-body"},dbt=["href"],QC=Object.assign({name:"AiMdParser"},{__name:"MdParser",props:R.mergeDefaults({content:String},{content:""}),setup(t){function e(d){const h=[];let f=0;return d=d.replace(/\$\$([\s\S]*?)\$\$/g,p=>{const T=`__PROTECTED_MATH_BLOCK_${f}__`;return h[f]=p,f++,T}),d=d.replace(/\$([^\$\n]+?)\$/g,p=>{const T=`__PROTECTED_INLINE_MATH_${f}__`;return h[f]=p,f++,T}),d=d.replace(/```[\s\S]*?```/g,p=>{const T=`__PROTECTED_CODE_BLOCK_${f}__`;return h[f]=p,f++,T}),d=d.replace(/`([^`]+)`/g,p=>{const T=`__PROTECTED_INLINE_CODE_${f}__`;return h[f]=p,f++,T}),{markdown:d,protectedRegions:h}}function r(d,h){let f=d;return h.forEach((p,T)=>{let g="INLINE_CODE";p.startsWith("```")?g="CODE_BLOCK":p.startsWith("$$")?g="MATH_BLOCK":p.startsWith("$")&&(g="INLINE_MATH");const v=`__PROTECTED_${g}_${T}__`;f=f.split(v).join(p)}),f}function n(d){return d.replace(/\\n/g,`
890
- `).replace(/\\r/g,"\r").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v")}function i(d){const{markdown:h,protectedRegions:f}=e(d),p=n(h);return r(p,f)}const a=/(?:https?:\/\/|www\.)?[a-zA-Z0-9][-a-zA-Z0-9.]+(?:\.[a-zA-Z]{2,})(?:\/[^\s\)\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:\?[^\s\)\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:#[^\s\)\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?/g;function o(d){return d.replace(a,h=>` ${h} `)}const s=d=>JKe(i,o)(d),l=R.computed(()=>s(t.content)),u={singleTilde:!1};return(d,h)=>{const f=H5;return R.openBlock(),R.createElementBlock("div",ubt,[R.createVNode(E$,{markdown:l.value,remarkPlugins:[[R.unref(r7t),u],R.unref(m7t),R.unref(a7t),R.unref(g7t)],rehypePlugins:[R.unref(K9t),R.unref(_gt),R.unref(o_t)]},{a:R.withCtx(({node:p})=>{var T;return[R.createElementVNode("a",{href:p.properties.href,target:"_blank",rel:"noopener noreferrer"},R.toDisplayString((T=p.children[0])==null?void 0:T.value),9,dbt)]}),pre:R.withCtx(({node:p})=>[R.createVNode(cbt,{node:p},null,8,["node"])]),img:R.withCtx(({node:p})=>[R.createVNode(f,{src:p.properties.src,previewMask:!1,style:{cursor:"pointer"}},null,8,["src"])]),_:1},8,["markdown","remarkPlugins","rehypePlugins"])])}}}),hbt={key:0,class:"ai-chat-record-avatar"},fbt={class:"ai-chat-record-wrap"},pbt={class:"ai-chat-record-head"},Tbt={key:0,class:"ai-chat-record-time"},gbt={class:"ai-chat-record-body"},mbt={key:0,class:"ai-chat-record-loading-wrap"},vbt={key:1,class:"ai-chat-record-content"},ybt={class:"ai-chat-record-content-before"},_bt={class:"ai-chat-record-content-inner"},Qbt={class:"ai-chat-record-content-after"},bbt={key:0,class:"character-count"},Ebt={key:0,class:"ai-chat-record-foot"},xbt={class:"foot-actions"},Sbt={key:0,class:"copy-tooltip-inner"},Cbt={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},Wge=Si(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(t,{expose:e,emit:r}){const n={Loading:"loading",Generating:"generating",Done:"done"},i=t,a=r,o=R.ref(),s=R.ref(!0),l=R.ref(!1),u=R.computed(()=>v5e(i.time,i.timeFormat)),d=R.computed(()=>{var f,p;if(i.status==="done"){let T=(p=(f=o.value)==null?void 0:f.querySelector(".ai-chat-record-content-inner"))==null?void 0:p.innerText;return(T==null?void 0:T.length)??0}else return 0});function h(){var T;let f=(T=o.value)==null?void 0:T.querySelector(".ai-chat-record-content-inner");if(!f)return;function p(){i.copyTipType==="message"?s.value?ia.success("\u590D\u5236\u6210\u529F"):ia.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}y5e(f).then(()=>{s.value=!0,p()}).catch(()=>{s.value=!1,p()})}return e({statusEnum:n}),(f,p)=>{const T=gp,g=A9;return R.openBlock(),R.createElementBlock("div",{ref_key:"elRef",ref:o,class:R.normalizeClass(["ai-chat-record",{"ai-chat-record--r":t.pos==="r","ai-chat-record--full-width":t.fullWidth,"ai-chat-record--show-time":t.showTime}])},[t.showAvatar?(R.openBlock(),R.createElementBlock("div",hbt,[R.renderSlot(f.$slots,"avatar",{},()=>[R.createVNode(T,{size:40,src:t.avatar},{icon:R.withCtx(()=>p[1]||(p[1]=[])),_:1},8,["src"])],!0)])):R.createCommentVNode("",!0),R.createElementVNode("div",fbt,[R.createElementVNode("div",pbt,[R.renderSlot(f.$slots,"head",{},()=>[t.showTime?(R.openBlock(),R.createElementBlock("div",Tbt,[R.renderSlot(f.$slots,"time",{time:u.value},()=>[R.createTextVNode(R.toDisplayString(u.value),1)],!0)])):R.createCommentVNode("",!0),R.renderSlot(f.$slots,"headRight",{},void 0,!0)],!0)]),R.createElementVNode("div",gbt,[t.status===n.Loading?(R.openBlock(),R.createElementBlock("div",mbt,[R.renderSlot(f.$slots,"loading",{},()=>[R.createVNode(mdt,{theme:t.pos==="r"?"light":"",message:t.loadingMessage},null,8,["theme","message"])],!0)])):(R.openBlock(),R.createElementBlock("div",vbt,[R.createElementVNode("div",ybt,[R.renderSlot(f.$slots,"contentBefore",{},void 0,!0)]),R.createElementVNode("div",_bt,[R.renderSlot(f.$slots,"content",{},()=>[R.createVNode(QC,{content:t.content},null,8,["content"])],!0)]),R.createElementVNode("div",Qbt,[R.renderSlot(f.$slots,"contentAfter",{},void 0,!0)]),t.showCharacterCount&&t.status===n.Done?(R.openBlock(),R.createElementBlock("div",bbt,[R.renderSlot(f.$slots,"characterCountBefore",{},void 0,!0),R.renderSlot(f.$slots,"characterCount",{},()=>[R.withDirectives(R.createElementVNode("span",null,"\u5171"+R.toDisplayString(d.value)+"\u4E2A\u5B57\u7B26",513),[[R.vShow,d.value]])],!0),R.renderSlot(f.$slots,"characterCountAfter",{},void 0,!0)])):R.createCommentVNode("",!0)]))]),t.showFoot?(R.openBlock(),R.createElementBlock("div",Ebt,[R.renderSlot(f.$slots,"foot",{},()=>[R.createElementVNode("div",xbt,[R.renderSlot(f.$slots,"actionsBefore",{},void 0,!0),R.renderSlot(f.$slots,"actions",{},()=>[R.createVNode(g,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:R.withCtx(()=>[s.value?(R.openBlock(),R.createElementBlock("span",Sbt,[R.createVNode(R.unref(D5),{class:"copy-tooltip-icon"}),p[2]||(p[2]=R.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(R.openBlock(),R.createElementBlock("span",Cbt,[R.createVNode(R.unref(eE),{class:"copy-tooltip-icon"}),p[3]||(p[3]=R.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:R.withCtx(()=>[t.status===n.Done&&t.actions.includes("copy")?(R.openBlock(),R.createElementBlock("button",{key:0,class:"action",onClick:h},p[4]||(p[4]=[R.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1),R.createTextVNode(" \u590D\u5236 ")]))):R.createCommentVNode("",!0)]),_:1},8,["open"]),t.status===n.Done&&t.actions.includes("regenerate")?(R.openBlock(),R.createElementBlock("button",{key:0,class:"action",onClick:p[0]||(p[0]=v=>a("regenerate"))},p[5]||(p[5]=[R.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1),R.createTextVNode(" \u91CD\u65B0\u751F\u6210 ")]))):R.createCommentVNode("",!0)],!0),R.renderSlot(f.$slots,"actionsAfter",{},void 0,!0)])],!0)])):R.createCommentVNode("",!0),R.renderSlot(f.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-b789f5b0"]]);var jge=11;function Lbt(t,e){var r=e.attributes,n,i,a,o,s;if(!(e.nodeType===jge||t.nodeType===jge)){for(var l=r.length-1;l>=0;l--)n=r[l],i=n.name,a=n.namespaceURI,o=n.value,a?(i=n.localName||i,s=t.getAttributeNS(a,i),s!==o&&(n.prefix==="xmlns"&&(i=n.name),t.setAttributeNS(a,i,o))):(s=t.getAttribute(i),s!==o&&t.setAttribute(i,o));for(var u=t.attributes,d=u.length-1;d>=0;d--)n=u[d],i=n.name,a=n.namespaceURI,a?(i=n.localName||i,e.hasAttributeNS(a,i)||t.removeAttributeNS(a,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var bC,Abt="http://www.w3.org/1999/xhtml",Sl=typeof document>"u"?void 0:document,wbt=!!Sl&&"content"in Sl.createElement("template"),Obt=!!Sl&&Sl.createRange&&"createContextualFragment"in Sl.createRange();function Rbt(t){var e=Sl.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function Nbt(t){bC||(bC=Sl.createRange(),bC.selectNode(Sl.body));var e=bC.createContextualFragment(t);return e.childNodes[0]}function Mbt(t){var e=Sl.createElement("body");return e.innerHTML=t,e.childNodes[0]}function Ibt(t){return t=t.trim(),wbt?Rbt(t):Obt?Nbt(t):Mbt(t)}function EC(t,e){var r=t.nodeName,n=e.nodeName,i,a;return r===n?!0:(i=r.charCodeAt(0),a=n.charCodeAt(0),i<=90&&a>=97?r===n.toUpperCase():a<=90&&i>=97?n===r.toUpperCase():!1)}function Dbt(t,e){return!e||e===Abt?Sl.createElement(t):Sl.createElementNS(e,t)}function kbt(t,e){for(var r=t.firstChild;r;){var n=r.nextSibling;e.appendChild(r),r=n}return e}function C$(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r))}var Xge={OPTION:function(t,e){var r=t.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),r.selectedIndex=-1)}C$(t,e,"selected")},INPUT:function(t,e){C$(t,e,"checked"),C$(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var n=t.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==t.placeholder)return;n.nodeValue=r}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var r=-1,n=0,i=t.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild;else{if(o==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}t.selectedIndex=r}}},ay=1,Kge=11,Zge=3,Jge=8;function d6(){}function Pbt(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function Hbt(t){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var a=n;n=Sl.createElement("html"),n.innerHTML=a}else n=Ibt(n);else n.nodeType===Kge&&(n=n.firstElementChild);var o=i.getNodeKey||Pbt,s=i.onBeforeNodeAdded||d6,l=i.onNodeAdded||d6,u=i.onBeforeElUpdated||d6,d=i.onElUpdated||d6,h=i.onBeforeNodeDiscarded||d6,f=i.onNodeDiscarded||d6,p=i.onBeforeElChildrenUpdated||d6,T=i.skipFromChildren||d6,g=i.addChild||function(F,k){return F.appendChild(k)},v=i.childrenOnly===!0,m=Object.create(null),y=[];function _(F){y.push(F)}function E(F,k){if(F.nodeType===ay)for(var V=F.firstChild;V;){var B=void 0;k&&(B=o(V))?_(B):(f(V),V.firstChild&&E(V,k)),V=V.nextSibling}}function Q(F,k,V){h(F)!==!1&&(k&&k.removeChild(F),f(F),E(F,V))}function b(F){if(F.nodeType===ay||F.nodeType===Kge)for(var k=F.firstChild;k;){var V=o(k);V&&(m[V]=k),b(k),k=k.nextSibling}}b(r);function x(F){l(F);for(var k=F.firstChild;k;){var V=k.nextSibling,B=o(k);if(B){var $=m[B];$&&EC(k,$)?(k.parentNode.replaceChild($,k),C($,k)):x(k)}else x(k);k=V}}function S(F,k,V){for(;k;){var B=k.nextSibling;(V=o(k))?_(V):Q(k,F,!0),k=B}}function C(F,k,V){var B=o(k);if(B&&delete m[B],!V){var $=u(F,k);if($===!1||($ instanceof HTMLElement&&(F=$,b(F)),t(F,k),d(F),p(F,k)===!1))return}F.nodeName!=="TEXTAREA"?L(F,k):Xge.TEXTAREA(F,k)}function L(F,k){var V=T(F,k),B=k.firstChild,$=F.firstChild,z,G,J,ie,re;e:for(;B;){for(ie=B.nextSibling,z=o(B);!V&&$;){if(J=$.nextSibling,B.isSameNode&&B.isSameNode($)){B=ie,$=J;continue e}G=o($);var j=$.nodeType,oe=void 0;if(j===B.nodeType&&(j===ay?(z?z!==G&&((re=m[z])?J===re?oe=!1:(F.insertBefore(re,$),G?_(G):Q($,F,!0),$=re,G=o($)):oe=!1):G&&(oe=!1),oe=oe!==!1&&EC($,B),oe&&C($,B)):(j===Zge||j==Jge)&&(oe=!0,$.nodeValue!==B.nodeValue&&($.nodeValue=B.nodeValue))),oe){B=ie,$=J;continue e}G?_(G):Q($,F,!0),$=J}if(z&&(re=m[z])&&EC(re,B))V||g(F,re),C(re,B);else{var ee=s(B);ee!==!1&&(ee&&(B=ee),B.actualize&&(B=B.actualize(F.ownerDocument||Sl)),g(F,B),x(B))}B=ie,$=J}S(F,$,G);var X=Xge[F.nodeName];X&&X(F,k)}var w=r,M=w.nodeType,P=n.nodeType;if(!v){if(M===ay)P===ay?EC(r,n)||(f(r),w=kbt(r,Dbt(n.nodeName,n.namespaceURI))):w=n;else if(M===Zge||M===Jge){if(P===M)return w.nodeValue!==n.nodeValue&&(w.nodeValue=n.nodeValue),w;w=n}}if(w===n)f(r);else{if(n.isSameNode&&n.isSameNode(w))return;if(C(w,n,v),y)for(var N=0,I=y.length;N<I;N++){var H=m[y[N]];H&&Q(H,H.parentNode,!1)}}return!v&&w!==r&&r.parentNode&&(w.actualize&&(w=w.actualize(r.ownerDocument||Sl)),r.parentNode.replaceChild(w,r)),w}}var Bbt=Hbt(Lbt);const Fbt={key:1,class:"ai-content-parser-inner"},eme=Object.assign({name:"AiContentParser"},{__name:"ContentParser",props:{type:{type:String,default:"text"},content:String,stream:{type:Boolean,default:!1},streamDone:{type:Boolean,default:!1}},setup(t){const e=t,r=R.ref(null),n=R.ref("");return R.onMounted(()=>{R.watch(()=>e.content,()=>{if(n.value=e.type==="markdown"?_5e.parse(e.content):e.content,e.type==="markdown"||e.type==="html"){const i=document.createElement("div");i.innerHTML=n.value,i.classList.add("ai-content-parser-inner"),Bbt(r.value,i)}},{immediate:!0})}),(i,a)=>(R.openBlock(),R.createElementBlock("div",{class:R.normalizeClass(["ai-content-parser",`ai-content-parser--${t.type}`])},[t.type==="html"||t.type==="markdown"?(R.openBlock(),R.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"ai-content-parser-inner"},null,512)):(R.openBlock(),R.createElementBlock("div",Fbt,R.toDisplayString(n.value),1))],2))}}),Vbt={class:"ai-think-parser"},$bt={class:"ai-think-parser-content"},tme=Si(Object.assign({name:"AiThinkParser"},{__name:"ThinkParser",setup(t){return(e,r)=>(R.openBlock(),R.createElementBlock("div",Vbt,[R.createElementVNode("div",$bt,[R.renderSlot(e.$slots,"content",{},()=>[R.createVNode(QC,R.normalizeProps(R.guardReactiveProps(e.$attrs)),null,16)],!0)])]))}}),[["__scopeId","data-v-70d4677e"]]);function Vo(t){this.content=t}Vo.prototype={constructor:Vo,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Vo(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Vo(r)},addToStart:function(t,e){return new Vo([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Vo(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Vo(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Vo.from(t),t.size?new Vo(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Vo.from(t),t.size?new Vo(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Vo.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}},Vo.from=function(t){if(t instanceof Vo)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Vo(e)};function rme(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)r++;return r}if(i.content.size||a.content.size){let o=rme(i.content,a.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function nme(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let o=t.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){r-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:r,b:n};if(o.isText&&o.text!=s.text){let u=0,d=Math.min(o.text.length,s.text.length);for(;u<d&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||s.content.size){let u=nme(o.content,s.content,r-1,n-1);if(u)return u}r-=l,n-=l}}class Pt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let o=0,s=0;s<r;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,i+d)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",o=!0;return this.nodesBetween(e,r,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,r-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Pt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,o=0;o<r;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>r)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,r-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,r-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Pt(n,i)}cutByIndex(e,r){return e==r?Pt.empty:e==0&&r==this.content.length?this:new Pt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Pt(i,a)}addToStart(e){return new Pt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Pt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))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 r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return rme(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return nme(this,e,r,n)}findIndex(e){if(e==0)return xC(0,e);if(e==this.size)return xC(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?xC(r+1,a):xC(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Pt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Pt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Pt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new Pt(r||e,n)}static from(e){if(!e)return Pt.empty;if(e instanceof Pt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Pt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Pt.empty=new Pt([],0);const L$={index:0,offset:0};function xC(t,e){return L$.index=t,L$.offset=e,L$}function SC(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!SC(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!SC(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let pi=class UX{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&SC(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return UX.none;if(e instanceof UX)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};pi.none=[];class CC extends Error{}class or{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=ame(this.content,e+this.openStart,r);return n&&new or(n,this.openStart,this.openEnd)}removeBetween(e,r){return new or(ime(this.content,e+this.openStart,r+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,r){if(!r)return or.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new or(Pt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new or(e,n,i)}}or.empty=new or(Pt.empty,0,0);function ime(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:o,offset:s}=t.findIndex(r);if(i==e||a.isText){if(s!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(ime(a.content,e-i-1,r-i-1)))}function ame(t,e,r,n){let{index:i,offset:a}=t.findIndex(e),o=t.maybeChild(i);if(a==e||o.isText)return t.cut(0,e).append(r).append(t.cut(e));let s=ame(o.content,e-a-1,r);return s&&t.replaceChild(i,o.copy(s))}function Ubt(t,e,r){if(r.openStart>t.depth)throw new CC("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new CC("Inconsistent open depths");return ome(t,e,r,0)}function ome(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=ome(t,e,r,n+1);return a.copy(a.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,s=o.content;return mh(o,s.cut(0,t.parentOffset).append(r.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=Gbt(r,t);return mh(a,lme(t,o,s,e,n))}else return mh(a,LC(t,e,n))}function sme(t,e){if(!e.type.compatibleContent(t.type))throw new CC("Cannot join "+e.type.name+" onto "+t.type.name)}function A$(t,e,r){let n=t.node(r);return sme(n,e.node(r)),n}function gh(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function oy(t,e,r,n){let i=(e||t).node(r),a=0,o=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(gh(t.nodeAfter,n),a++));for(let s=a;s<o;s++)gh(i.child(s),n);e&&e.depth==r&&e.textOffset&&gh(e.nodeBefore,n)}function mh(t,e){return t.type.checkContent(e),t.copy(e)}function lme(t,e,r,n,i){let a=t.depth>i&&A$(t,e,i+1),o=n.depth>i&&A$(r,n,i+1),s=[];return oy(null,t,i,s),a&&o&&e.index(i)==r.index(i)?(sme(a,o),gh(mh(a,lme(t,e,r,n,i+1)),s)):(a&&gh(mh(a,LC(t,e,i+1)),s),oy(e,r,i,s),o&&gh(mh(o,LC(r,n,i+1)),s)),oy(n,null,i,s),new Pt(s)}function LC(t,e,r){let n=[];if(oy(null,t,r,n),t.depth>r){let i=A$(t,e,r+1);gh(mh(i,LC(t,e,r+1)),n)}return oy(e,null,r,n),new Pt(n)}function Gbt(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(Pt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class sy{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?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[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return pi.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){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)&&(!r||r(this.node(n))))return new AC(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 r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new sy(r,n,a)}static resolveCached(e,r){let n=cme.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==r)return o}else cme.set(e,n=new zbt);let i=n.elts[n.i]=sy.resolve(e,r);return n.i=(n.i+1)%qbt,i}}class zbt{constructor(){this.elts=[],this.i=0}}const qbt=12,cme=new WeakMap;class AC{constructor(e,r,n){this.$from=e,this.$to=r,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 Ybt=Object.create(null);class H2{constructor(e,r,n,i=pi.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||Pt.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}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,r,n){return this.type==e&&SC(this.attrs,r||e.defaultAttrs||Ybt)&&pi.sameSet(this.marks,n||pi.none)}copy(e=null){return e==this.content?this:new H2(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new H2(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return or.empty;let i=this.resolve(e),a=this.resolve(r),o=n?0:i.sharedDepth(r),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new or(u,i.depth-o,a.depth-o)}replace(e,r,n){return Ubt(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return sy.resolveCached(this,e)}resolveNoCache(e){return sy.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}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()+")"),ume(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Pt.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,r);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,r);return o?o.validEnd:!1}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=pi.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!pi.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r 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(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Pt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}}H2.prototype.text=void 0;class wC extends H2{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ume(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new wC(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new wC(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ume(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class vh{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new Wbt(e,r);if(n.next==null)return vh.empty;let i=dme(n);n.next&&n.err("Unexpected trailing text");let a=tEt(eEt(i));return rEt(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return Pt.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let f=a(h,s.concat(d));if(f)return f}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),r[s.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=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
889
+ `))]))])])}}},[["__scopeId","data-v-285e7110"]]),cbt={__name:"FenceParser",props:{node:{type:Object,default:()=>null}},setup(t){const e=R.ref(""),r=R.ref("");return R.watch(()=>t.node,()=>{t.node&&Kg(t.node,n=>{var i,a,o;n.type==="text"?e.value=n.value:n.type==="element"&&n.tagName==="code"&&(r.value=((o=(a=(i=n.properties)==null?void 0:i.className)==null?void 0:a[0])==null?void 0:o.replace("language-",""))||"")})},{immediate:!0}),(n,i)=>r.value==="mermaid"?(R.openBlock(),R.createBlock(lbt,{key:0,code:e.value},null,8,["code"])):(R.openBlock(),R.createBlock(FQt,{key:1,code:e.value,lang:r.value},null,8,["code","lang"]))}},ubt={class:"markdown-body"},dbt=["href"],QC=Object.assign({name:"AiMdParser"},{__name:"MdParser",props:R.mergeDefaults({content:String},{content:""}),setup(t){function e(d){const h=[];let f=0;return d=d.replace(/\$\$([\s\S]*?)\$\$/g,p=>{const T=`__PROTECTED_MATH_BLOCK_${f}__`;return h[f]=p,f++,T}),d=d.replace(/\$([^\$\n]+?)\$/g,(p,T)=>{if(/[\u4e00-\u9fa5。,、“”‘’;:?!【】()《》]/.test(T))return p;const g=`__PROTECTED_INLINE_MATH_${f}__`;return h[f]=p,f++,g}),d=d.replace(/```[\s\S]*?```/g,p=>{const T=`__PROTECTED_CODE_BLOCK_${f}__`;return h[f]=p,f++,T}),d=d.replace(/`([^`]+)`/g,p=>{const T=`__PROTECTED_INLINE_CODE_${f}__`;return h[f]=p,f++,T}),{markdown:d,protectedRegions:h}}function r(d,h){let f=d;return h.forEach((p,T)=>{let g="INLINE_CODE";p.startsWith("```")?g="CODE_BLOCK":p.startsWith("$$")?g="MATH_BLOCK":p.startsWith("$")&&(g="INLINE_MATH");const v=`__PROTECTED_${g}_${T}__`;f=f.split(v).join(p)}),f}function n(d){return d.replace(/\\n/g,`
890
+ `).replace(/\\r/g,"\r").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v").replace(/\$/g,"\\$")}function i(d){const{markdown:h,protectedRegions:f}=e(d),p=n(h);return r(p,f)}const a=/(?:https?:\/\/|www\.)?[a-zA-Z0-9][-a-zA-Z0-9.]+(?:\.[a-zA-Z]{2,})(?:\/[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:\?[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:#[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?/g;function o(d){return d.replace(a,h=>` ${h} `)}const s=d=>JKe(i,o)(d),l=R.computed(()=>s(t.content)),u={singleTilde:!1};return(d,h)=>{const f=H5;return R.openBlock(),R.createElementBlock("div",ubt,[R.createVNode(E$,{markdown:l.value,remarkPlugins:[[R.unref(r7t),u],R.unref(m7t),R.unref(a7t),R.unref(g7t)],rehypePlugins:[R.unref(K9t),R.unref(_gt),R.unref(o_t)]},{a:R.withCtx(({node:p})=>{var T;return[R.createElementVNode("a",{href:p.properties.href,target:"_blank",rel:"noopener noreferrer"},R.toDisplayString((T=p.children[0])==null?void 0:T.value),9,dbt)]}),pre:R.withCtx(({node:p})=>[R.createVNode(cbt,{node:p},null,8,["node"])]),img:R.withCtx(({node:p})=>[R.createVNode(f,{src:p.properties.src,previewMask:!1,style:{cursor:"pointer"}},null,8,["src"])]),_:1},8,["markdown","remarkPlugins","rehypePlugins"])])}}}),hbt={key:0,class:"ai-chat-record-avatar"},fbt={class:"ai-chat-record-wrap"},pbt={class:"ai-chat-record-head"},Tbt={key:0,class:"ai-chat-record-time"},gbt={class:"ai-chat-record-body"},mbt={key:0,class:"ai-chat-record-loading-wrap"},vbt={key:1,class:"ai-chat-record-content"},ybt={class:"ai-chat-record-content-before"},_bt={class:"ai-chat-record-content-inner"},Qbt={class:"ai-chat-record-content-after"},bbt={key:0,class:"character-count"},Ebt={key:0,class:"ai-chat-record-foot"},xbt={class:"foot-actions"},Sbt={key:0,class:"copy-tooltip-inner"},Cbt={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},Wge=Si(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(t,{expose:e,emit:r}){const n={Loading:"loading",Generating:"generating",Done:"done"},i=t,a=r,o=R.ref(),s=R.ref(!0),l=R.ref(!1),u=R.computed(()=>v5e(i.time,i.timeFormat)),d=R.computed(()=>{var f,p;if(i.status==="done"){let T=(p=(f=o.value)==null?void 0:f.querySelector(".ai-chat-record-content-inner"))==null?void 0:p.innerText;return(T==null?void 0:T.length)??0}else return 0});function h(){var T;let f=(T=o.value)==null?void 0:T.querySelector(".ai-chat-record-content-inner");if(!f)return;function p(){i.copyTipType==="message"?s.value?ia.success("\u590D\u5236\u6210\u529F"):ia.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}y5e(f).then(()=>{s.value=!0,p()}).catch(()=>{s.value=!1,p()})}return e({statusEnum:n}),(f,p)=>{const T=gp,g=A9;return R.openBlock(),R.createElementBlock("div",{ref_key:"elRef",ref:o,class:R.normalizeClass(["ai-chat-record",{"ai-chat-record--r":t.pos==="r","ai-chat-record--full-width":t.fullWidth,"ai-chat-record--show-time":t.showTime}])},[t.showAvatar?(R.openBlock(),R.createElementBlock("div",hbt,[R.renderSlot(f.$slots,"avatar",{},()=>[R.createVNode(T,{size:40,src:t.avatar},{icon:R.withCtx(()=>p[1]||(p[1]=[])),_:1},8,["src"])],!0)])):R.createCommentVNode("",!0),R.createElementVNode("div",fbt,[R.createElementVNode("div",pbt,[R.renderSlot(f.$slots,"head",{},()=>[t.showTime?(R.openBlock(),R.createElementBlock("div",Tbt,[R.renderSlot(f.$slots,"time",{time:u.value},()=>[R.createTextVNode(R.toDisplayString(u.value),1)],!0)])):R.createCommentVNode("",!0),R.renderSlot(f.$slots,"headRight",{},void 0,!0)],!0)]),R.createElementVNode("div",gbt,[t.status===n.Loading?(R.openBlock(),R.createElementBlock("div",mbt,[R.renderSlot(f.$slots,"loading",{},()=>[R.createVNode(mdt,{theme:t.pos==="r"?"light":"",message:t.loadingMessage},null,8,["theme","message"])],!0)])):(R.openBlock(),R.createElementBlock("div",vbt,[R.createElementVNode("div",ybt,[R.renderSlot(f.$slots,"contentBefore",{},void 0,!0)]),R.createElementVNode("div",_bt,[R.renderSlot(f.$slots,"content",{},()=>[R.createVNode(QC,{content:t.content},null,8,["content"])],!0)]),R.createElementVNode("div",Qbt,[R.renderSlot(f.$slots,"contentAfter",{},void 0,!0)]),t.showCharacterCount&&t.status===n.Done?(R.openBlock(),R.createElementBlock("div",bbt,[R.renderSlot(f.$slots,"characterCountBefore",{},void 0,!0),R.renderSlot(f.$slots,"characterCount",{},()=>[R.withDirectives(R.createElementVNode("span",null,"\u5171"+R.toDisplayString(d.value)+"\u4E2A\u5B57\u7B26",513),[[R.vShow,d.value]])],!0),R.renderSlot(f.$slots,"characterCountAfter",{},void 0,!0)])):R.createCommentVNode("",!0)]))]),t.showFoot?(R.openBlock(),R.createElementBlock("div",Ebt,[R.renderSlot(f.$slots,"foot",{},()=>[R.createElementVNode("div",xbt,[R.renderSlot(f.$slots,"actionsBefore",{},void 0,!0),R.renderSlot(f.$slots,"actions",{},()=>[R.createVNode(g,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:R.withCtx(()=>[s.value?(R.openBlock(),R.createElementBlock("span",Sbt,[R.createVNode(R.unref(D5),{class:"copy-tooltip-icon"}),p[2]||(p[2]=R.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(R.openBlock(),R.createElementBlock("span",Cbt,[R.createVNode(R.unref(eE),{class:"copy-tooltip-icon"}),p[3]||(p[3]=R.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:R.withCtx(()=>[t.status===n.Done&&t.actions.includes("copy")?(R.openBlock(),R.createElementBlock("button",{key:0,class:"action",onClick:h},p[4]||(p[4]=[R.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1),R.createTextVNode(" \u590D\u5236 ")]))):R.createCommentVNode("",!0)]),_:1},8,["open"]),t.status===n.Done&&t.actions.includes("regenerate")?(R.openBlock(),R.createElementBlock("button",{key:0,class:"action",onClick:p[0]||(p[0]=v=>a("regenerate"))},p[5]||(p[5]=[R.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1),R.createTextVNode(" \u91CD\u65B0\u751F\u6210 ")]))):R.createCommentVNode("",!0)],!0),R.renderSlot(f.$slots,"actionsAfter",{},void 0,!0)])],!0)])):R.createCommentVNode("",!0),R.renderSlot(f.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-b789f5b0"]]);var jge=11;function Lbt(t,e){var r=e.attributes,n,i,a,o,s;if(!(e.nodeType===jge||t.nodeType===jge)){for(var l=r.length-1;l>=0;l--)n=r[l],i=n.name,a=n.namespaceURI,o=n.value,a?(i=n.localName||i,s=t.getAttributeNS(a,i),s!==o&&(n.prefix==="xmlns"&&(i=n.name),t.setAttributeNS(a,i,o))):(s=t.getAttribute(i),s!==o&&t.setAttribute(i,o));for(var u=t.attributes,d=u.length-1;d>=0;d--)n=u[d],i=n.name,a=n.namespaceURI,a?(i=n.localName||i,e.hasAttributeNS(a,i)||t.removeAttributeNS(a,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var bC,Abt="http://www.w3.org/1999/xhtml",Sl=typeof document>"u"?void 0:document,wbt=!!Sl&&"content"in Sl.createElement("template"),Obt=!!Sl&&Sl.createRange&&"createContextualFragment"in Sl.createRange();function Rbt(t){var e=Sl.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function Nbt(t){bC||(bC=Sl.createRange(),bC.selectNode(Sl.body));var e=bC.createContextualFragment(t);return e.childNodes[0]}function Mbt(t){var e=Sl.createElement("body");return e.innerHTML=t,e.childNodes[0]}function Ibt(t){return t=t.trim(),wbt?Rbt(t):Obt?Nbt(t):Mbt(t)}function EC(t,e){var r=t.nodeName,n=e.nodeName,i,a;return r===n?!0:(i=r.charCodeAt(0),a=n.charCodeAt(0),i<=90&&a>=97?r===n.toUpperCase():a<=90&&i>=97?n===r.toUpperCase():!1)}function Dbt(t,e){return!e||e===Abt?Sl.createElement(t):Sl.createElementNS(e,t)}function kbt(t,e){for(var r=t.firstChild;r;){var n=r.nextSibling;e.appendChild(r),r=n}return e}function C$(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r))}var Xge={OPTION:function(t,e){var r=t.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),r.selectedIndex=-1)}C$(t,e,"selected")},INPUT:function(t,e){C$(t,e,"checked"),C$(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var n=t.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==t.placeholder)return;n.nodeValue=r}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var r=-1,n=0,i=t.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild;else{if(o==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}t.selectedIndex=r}}},ay=1,Kge=11,Zge=3,Jge=8;function d6(){}function Pbt(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function Hbt(t){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var a=n;n=Sl.createElement("html"),n.innerHTML=a}else n=Ibt(n);else n.nodeType===Kge&&(n=n.firstElementChild);var o=i.getNodeKey||Pbt,s=i.onBeforeNodeAdded||d6,l=i.onNodeAdded||d6,u=i.onBeforeElUpdated||d6,d=i.onElUpdated||d6,h=i.onBeforeNodeDiscarded||d6,f=i.onNodeDiscarded||d6,p=i.onBeforeElChildrenUpdated||d6,T=i.skipFromChildren||d6,g=i.addChild||function(F,k){return F.appendChild(k)},v=i.childrenOnly===!0,m=Object.create(null),y=[];function _(F){y.push(F)}function E(F,k){if(F.nodeType===ay)for(var V=F.firstChild;V;){var B=void 0;k&&(B=o(V))?_(B):(f(V),V.firstChild&&E(V,k)),V=V.nextSibling}}function Q(F,k,V){h(F)!==!1&&(k&&k.removeChild(F),f(F),E(F,V))}function b(F){if(F.nodeType===ay||F.nodeType===Kge)for(var k=F.firstChild;k;){var V=o(k);V&&(m[V]=k),b(k),k=k.nextSibling}}b(r);function x(F){l(F);for(var k=F.firstChild;k;){var V=k.nextSibling,B=o(k);if(B){var $=m[B];$&&EC(k,$)?(k.parentNode.replaceChild($,k),C($,k)):x(k)}else x(k);k=V}}function S(F,k,V){for(;k;){var B=k.nextSibling;(V=o(k))?_(V):Q(k,F,!0),k=B}}function C(F,k,V){var B=o(k);if(B&&delete m[B],!V){var $=u(F,k);if($===!1||($ instanceof HTMLElement&&(F=$,b(F)),t(F,k),d(F),p(F,k)===!1))return}F.nodeName!=="TEXTAREA"?L(F,k):Xge.TEXTAREA(F,k)}function L(F,k){var V=T(F,k),B=k.firstChild,$=F.firstChild,z,G,J,ie,re;e:for(;B;){for(ie=B.nextSibling,z=o(B);!V&&$;){if(J=$.nextSibling,B.isSameNode&&B.isSameNode($)){B=ie,$=J;continue e}G=o($);var j=$.nodeType,oe=void 0;if(j===B.nodeType&&(j===ay?(z?z!==G&&((re=m[z])?J===re?oe=!1:(F.insertBefore(re,$),G?_(G):Q($,F,!0),$=re,G=o($)):oe=!1):G&&(oe=!1),oe=oe!==!1&&EC($,B),oe&&C($,B)):(j===Zge||j==Jge)&&(oe=!0,$.nodeValue!==B.nodeValue&&($.nodeValue=B.nodeValue))),oe){B=ie,$=J;continue e}G?_(G):Q($,F,!0),$=J}if(z&&(re=m[z])&&EC(re,B))V||g(F,re),C(re,B);else{var ee=s(B);ee!==!1&&(ee&&(B=ee),B.actualize&&(B=B.actualize(F.ownerDocument||Sl)),g(F,B),x(B))}B=ie,$=J}S(F,$,G);var X=Xge[F.nodeName];X&&X(F,k)}var w=r,M=w.nodeType,P=n.nodeType;if(!v){if(M===ay)P===ay?EC(r,n)||(f(r),w=kbt(r,Dbt(n.nodeName,n.namespaceURI))):w=n;else if(M===Zge||M===Jge){if(P===M)return w.nodeValue!==n.nodeValue&&(w.nodeValue=n.nodeValue),w;w=n}}if(w===n)f(r);else{if(n.isSameNode&&n.isSameNode(w))return;if(C(w,n,v),y)for(var N=0,I=y.length;N<I;N++){var H=m[y[N]];H&&Q(H,H.parentNode,!1)}}return!v&&w!==r&&r.parentNode&&(w.actualize&&(w=w.actualize(r.ownerDocument||Sl)),r.parentNode.replaceChild(w,r)),w}}var Bbt=Hbt(Lbt);const Fbt={key:1,class:"ai-content-parser-inner"},eme=Object.assign({name:"AiContentParser"},{__name:"ContentParser",props:{type:{type:String,default:"text"},content:String,stream:{type:Boolean,default:!1},streamDone:{type:Boolean,default:!1}},setup(t){const e=t,r=R.ref(null),n=R.ref("");return R.onMounted(()=>{R.watch(()=>e.content,()=>{if(n.value=e.type==="markdown"?_5e.parse(e.content):e.content,e.type==="markdown"||e.type==="html"){const i=document.createElement("div");i.innerHTML=n.value,i.classList.add("ai-content-parser-inner"),Bbt(r.value,i)}},{immediate:!0})}),(i,a)=>(R.openBlock(),R.createElementBlock("div",{class:R.normalizeClass(["ai-content-parser",`ai-content-parser--${t.type}`])},[t.type==="html"||t.type==="markdown"?(R.openBlock(),R.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"ai-content-parser-inner"},null,512)):(R.openBlock(),R.createElementBlock("div",Fbt,R.toDisplayString(n.value),1))],2))}}),Vbt={class:"ai-think-parser"},$bt={class:"ai-think-parser-content"},tme=Si(Object.assign({name:"AiThinkParser"},{__name:"ThinkParser",setup(t){return(e,r)=>(R.openBlock(),R.createElementBlock("div",Vbt,[R.createElementVNode("div",$bt,[R.renderSlot(e.$slots,"content",{},()=>[R.createVNode(QC,R.normalizeProps(R.guardReactiveProps(e.$attrs)),null,16)],!0)])]))}}),[["__scopeId","data-v-70d4677e"]]);function Vo(t){this.content=t}Vo.prototype={constructor:Vo,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Vo(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Vo(r)},addToStart:function(t,e){return new Vo([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Vo(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Vo(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Vo.from(t),t.size?new Vo(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Vo.from(t),t.size?new Vo(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Vo.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}},Vo.from=function(t){if(t instanceof Vo)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Vo(e)};function rme(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)r++;return r}if(i.content.size||a.content.size){let o=rme(i.content,a.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function nme(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let o=t.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){r-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:r,b:n};if(o.isText&&o.text!=s.text){let u=0,d=Math.min(o.text.length,s.text.length);for(;u<d&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||s.content.size){let u=nme(o.content,s.content,r-1,n-1);if(u)return u}r-=l,n-=l}}class Pt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let o=0,s=0;s<r;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,i+d)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",o=!0;return this.nodesBetween(e,r,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,r-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Pt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,o=0;o<r;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>r)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,r-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,r-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Pt(n,i)}cutByIndex(e,r){return e==r?Pt.empty:e==0&&r==this.content.length?this:new Pt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Pt(i,a)}addToStart(e){return new Pt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Pt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))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 r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return rme(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return nme(this,e,r,n)}findIndex(e){if(e==0)return xC(0,e);if(e==this.size)return xC(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?xC(r+1,a):xC(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Pt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Pt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Pt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new Pt(r||e,n)}static from(e){if(!e)return Pt.empty;if(e instanceof Pt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Pt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Pt.empty=new Pt([],0);const L$={index:0,offset:0};function xC(t,e){return L$.index=t,L$.offset=e,L$}function SC(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!SC(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!SC(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let pi=class UX{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&SC(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return UX.none;if(e instanceof UX)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};pi.none=[];class CC extends Error{}class or{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=ame(this.content,e+this.openStart,r);return n&&new or(n,this.openStart,this.openEnd)}removeBetween(e,r){return new or(ime(this.content,e+this.openStart,r+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,r){if(!r)return or.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new or(Pt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new or(e,n,i)}}or.empty=new or(Pt.empty,0,0);function ime(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:o,offset:s}=t.findIndex(r);if(i==e||a.isText){if(s!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(ime(a.content,e-i-1,r-i-1)))}function ame(t,e,r,n){let{index:i,offset:a}=t.findIndex(e),o=t.maybeChild(i);if(a==e||o.isText)return t.cut(0,e).append(r).append(t.cut(e));let s=ame(o.content,e-a-1,r);return s&&t.replaceChild(i,o.copy(s))}function Ubt(t,e,r){if(r.openStart>t.depth)throw new CC("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new CC("Inconsistent open depths");return ome(t,e,r,0)}function ome(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=ome(t,e,r,n+1);return a.copy(a.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,s=o.content;return mh(o,s.cut(0,t.parentOffset).append(r.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=Gbt(r,t);return mh(a,lme(t,o,s,e,n))}else return mh(a,LC(t,e,n))}function sme(t,e){if(!e.type.compatibleContent(t.type))throw new CC("Cannot join "+e.type.name+" onto "+t.type.name)}function A$(t,e,r){let n=t.node(r);return sme(n,e.node(r)),n}function gh(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function oy(t,e,r,n){let i=(e||t).node(r),a=0,o=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(gh(t.nodeAfter,n),a++));for(let s=a;s<o;s++)gh(i.child(s),n);e&&e.depth==r&&e.textOffset&&gh(e.nodeBefore,n)}function mh(t,e){return t.type.checkContent(e),t.copy(e)}function lme(t,e,r,n,i){let a=t.depth>i&&A$(t,e,i+1),o=n.depth>i&&A$(r,n,i+1),s=[];return oy(null,t,i,s),a&&o&&e.index(i)==r.index(i)?(sme(a,o),gh(mh(a,lme(t,e,r,n,i+1)),s)):(a&&gh(mh(a,LC(t,e,i+1)),s),oy(e,r,i,s),o&&gh(mh(o,LC(r,n,i+1)),s)),oy(n,null,i,s),new Pt(s)}function LC(t,e,r){let n=[];if(oy(null,t,r,n),t.depth>r){let i=A$(t,e,r+1);gh(mh(i,LC(t,e,r+1)),n)}return oy(e,null,r,n),new Pt(n)}function Gbt(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(Pt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class sy{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?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[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return pi.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){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)&&(!r||r(this.node(n))))return new AC(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 r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new sy(r,n,a)}static resolveCached(e,r){let n=cme.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==r)return o}else cme.set(e,n=new zbt);let i=n.elts[n.i]=sy.resolve(e,r);return n.i=(n.i+1)%qbt,i}}class zbt{constructor(){this.elts=[],this.i=0}}const qbt=12,cme=new WeakMap;class AC{constructor(e,r,n){this.$from=e,this.$to=r,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 Ybt=Object.create(null);class H2{constructor(e,r,n,i=pi.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||Pt.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}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,r,n){return this.type==e&&SC(this.attrs,r||e.defaultAttrs||Ybt)&&pi.sameSet(this.marks,n||pi.none)}copy(e=null){return e==this.content?this:new H2(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new H2(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return or.empty;let i=this.resolve(e),a=this.resolve(r),o=n?0:i.sharedDepth(r),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new or(u,i.depth-o,a.depth-o)}replace(e,r,n){return Ubt(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return sy.resolveCached(this,e)}resolveNoCache(e){return sy.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}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()+")"),ume(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Pt.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,r);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,r);return o?o.validEnd:!1}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=pi.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!pi.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r 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(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Pt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}}H2.prototype.text=void 0;class wC extends H2{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ume(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new wC(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new wC(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ume(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class vh{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new Wbt(e,r);if(n.next==null)return vh.empty;let i=dme(n);n.next&&n.err("Unexpected trailing text");let a=tEt(eEt(i));return rEt(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return Pt.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let f=a(h,s.concat(d));if(f)return f}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),r[s.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=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
891
891
  `)}}vh.empty=new vh(!0);class Wbt{constructor(e,r){this.string=e,this.nodeTypes=r,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 dme(t){let e=[];do e.push(jbt(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function jbt(t){let e=[];do e.push(Xbt(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Xbt(t){let e=Jbt(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Kbt(t,e);else break;return e}function hme(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Kbt(t,e){let r=hme(t),n=r;return t.eat(",")&&(t.next!="}"?n=hme(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function Zbt(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let a in r){let o=r[a];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Jbt(t){if(t.eat("(")){let e=dme(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Zbt(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function eEt(t){let e=[[]];return i(a(t,0),r()),e;function r(){return e.push([])-1}function n(o,s,l){let u={term:l,to:s};return e[o].push(u),u}function i(o,s){o.forEach(l=>l.to=s)}function a(o,s){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(a(u,s)),[]);if(o.type=="seq")for(let l=0;;l++){let u=a(o.exprs[l],s);if(l==o.exprs.length-1)return u;i(u,s=r())}else if(o.type=="star"){let l=r();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=r();return i(a(o.expr,s),l),i(a(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(s)].concat(a(o.expr,s));if(o.type=="range"){let l=s;for(let u=0;u<o.min;u++){let d=r();i(a(o.expr,l),d),l=d}if(o.max==-1)i(a(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let d=r();n(l,d),i(a(o.expr,l),d),l=d}return[n(l)]}else{if(o.type=="name")return[n(s,void 0,o.value)];throw new Error("Unknown expr type")}}}}function fme(t,e){return e-t}function pme(t,e){let r=[];return n(e),r.sort(fme);function n(i){let a=t[i];if(a.length==1&&!a[0].term)return n(a[0].to);r.push(i);for(let o=0;o<a.length;o++){let{term:s,to:l}=a[o];!s&&r.indexOf(l)==-1&&n(l)}}}function tEt(t){let e=Object.create(null);return r(pme(t,0));function r(n){let i=[];n.forEach(o=>{t[o].forEach(({term:s,to:l})=>{if(!s)return;let u;for(let d=0;d<i.length;d++)i[d][0]==s&&(u=i[d][1]);pme(t,l).forEach(d=>{u||i.push([s,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let a=e[n.join(",")]=new vh(n.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let s=i[o][1].sort(fme);a.next.push({type:i[o][0],next:e[s.join(",")]||r(s)})}return a}}function rEt(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],a=!i.validEnd,o=[];for(let s=0;s<i.next.length;s++){let{type:l,next:u}=i.next[s];o.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),n.indexOf(u)==-1&&n.push(u)}a&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Tme(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function gme(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let a=t[n];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function mme(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let a=t[i];a.validate&&a.validate(e[i])}}function vme(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new iEt(t,n,e[n]);return r}let yme=class SDe{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=vme(e,n.attrs),this.defaultAttrs=Tme(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==vh.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:gme(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new H2(this,this.computeAttrs(e),Pt.from(r),pi.setFrom(n))}createChecked(e=null,r,n){return r=Pt.from(r),this.checkContent(r),new H2(this,this.computeAttrs(e),r,pi.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=Pt.from(r),r.size){let o=this.contentMatch.fillBefore(r);if(!o)return null;r=o.append(r)}let i=this.contentMatch.matchFragment(r),a=i&&i.fillBefore(Pt.empty,!0);return a?new H2(this,e,r.append(a),pi.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.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){mme(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:pi.none:e}static compile(e,r){let n=Object.create(null);e.forEach((a,o)=>n[a]=new SDe(a,r,o));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function nEt(t,e,r){let n=r.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${a}`)}}class iEt{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?nEt(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class OC{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=vme(e,i.attrs),this.excluded=null;let a=Tme(this.attrs);this.instance=a?new pi(this,a):null}create(e=null){return!e&&this.instance?this.instance:new pi(this,gme(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new OC(a,i++,r,o)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){mme(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class _me{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=Vo.from(e.nodes),r.marks=Vo.from(e.marks||{}),this.nodes=yme.compile(this.spec.nodes,this),this.marks=OC.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],o=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=n[o]||(n[o]=vh.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?Qme(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:Qme(this,o.split(" "))}this.nodeFromJSON=i=>H2.fromJSON(this,i),this.markFromJSON=i=>pi.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof yme){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new wC(n,n.defaultAttrs,e,pi.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function Qme(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t.marks[i],o=a;if(a)r.push(a);else for(let s in t.marks){let l=t.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function aEt(t){return t.tag!=null}function oEt(t){return t.style!=null}let ly=class GX{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(aEt(i))this.tags.push(i);else if(oEt(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,r={}){let n=new Sme(this,r,!1);return n.addAll(e,pi.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new Sme(this,r,!0);return n.addAll(e,pi.none,r.from,r.to),or.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(cEt(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||r.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(e);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(e,r,n,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let o=this.styles[a],s=o.style;if(!(s.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=r))){if(o.getAttrs){let l=o.getAttrs(r);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let r=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o<r.length;o++){let s=r[o];if((s.priority==null?50:s.priority)<a)break}r.splice(o,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(o=>{n(o=Cme(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(o=>{n(o=Cme(o)),o.node||o.ignore||o.mark||(o.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new GX(e,GX.schemaRules(e)))}};const bme={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},sEt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Eme={ol:!0,ul:!0},cy=1,w$=2,uy=4;function xme(t,e,r){return e!=null?(e?cy:0)|(e==="full"?w$:0):t&&t.whitespace=="pre"?cy|w$:r&~uy}class RC{constructor(e,r,n,i,a,o){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=pi.none,this.match=a||(o&uy?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Pt.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&cy)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let r=Pt.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(Pt.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!bme.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Sme{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,a,o=xme(null,r.preserveWhitespace,0)|(n?uy:0);i?a=new RC(i.type,i.attrs,pi.none,!0,r.topMatch||i.type.contentMatch,o):n?a=new RC(null,null,pi.none,!0,null,o):a=new RC(e.schema.topNodeType,null,pi.none,!0,null,o),this.nodes=[a],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,a=i.options&w$?"full":this.localPreserveWS||(i.options&cy)>0;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)a!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
892
892
  `);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;Eme.hasOwnProperty(o)&&this.parser.normalizeLists&&lEt(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:sEt.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,d=this.needsBlock;if(bme.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let h=l&&l.skip?r:this.readStyles(e,r);h&&this.addAll(e,h),u&&this.sync(a),this.needsBlock=d}else{let u=this.readStyles(e,r);u&&this.addElementByRule(e,l,u,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
893
893
  `),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],o=n.getPropertyValue(a);if(o)for(let s=void 0;;){let l=this.parser.matchStyle(a,o,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(u=>!l.clearMark(u)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return r}addElementByRule(e,r,n,i){let a,o;if(r.node)if(o=this.parser.schema.nodes[r.node],o.isLeaf)this.insertNode(o.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,r.attrs||null,n,r.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(s)&&this.open--}addAll(e,r,n,i){let a=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=i==null?null:e.childNodes[i];o!=s;o=o.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(o,r);this.findAtPoint(e,a)}findPlace(e,r,n){let i,a;for(let o=this.open,s=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+s)&&(i=u,a=l,!u.length))break;if(l.solid){if(n)break;s+=2}}if(!i)return null;this.sync(a);for(let o=0;o<i.length;o++)r=this.enterInner(i[o],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(r=this.enterInner(a,null,r))}let i=this.findPlace(e,r,n);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let o=pi.none;for(let s of i.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):Lme(s.type,e.type))&&(o=s.addToSet(o));return a.content.push(e.mark(o)),!0}return!1}enter(e,r,n,i){let a=this.findPlace(e.create(r),n,!1);return a&&(a=this.enterInner(e,r,n,!0,i)),a}enterInner(e,r,n,i=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=xme(e,a,o.options);o.options&uy&&o.content.length==0&&(s|=uy);let l=pi.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):Lme(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new RC(e,r,l,i,null,s)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].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 r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=cy)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let u=r[s];if(u==""){if(s==r.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function lEt(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Eme.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function cEt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Cme(t){let e={};for(let r in t)e[r]=t[r];return e}function Lme(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let a=[],o=s=>{a.push(s);for(let l=0;l<s.edgeCount;l++){let{type:u,next:d}=s.edge(l);if(u==e||a.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class yh{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=O$(r).createDocumentFragment());let i=n,a=[];return e.forEach(o=>{if(a.length||o.marks.length){let s=0,l=0;for(;s<a.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(a[s][0])||u.type.spec.spanning===!1)break;s++,l++}for(;s<a.length;)i=a.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],d=this.serializeMark(u,o.isInline,r);d&&(a.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=NC(O$(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,r);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&NC(O$(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return NC(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new yh(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=Ame(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return Ame(e.marks)}}function Ame(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function O$(t){return t.document||window.document}const wme=new WeakMap;function uEt(t){let e=wme.get(t);return e===void 0&&wme.set(t,e=dEt(t)),e}function dEt(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function NC(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(a=uEt(n))&&a.indexOf(e)>-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 o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?t.createElementNS(r,i):t.createElement(i),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let f=h.indexOf(" ");f>0?l.setAttributeNS(h.slice(0,f),h.slice(f+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=d;h<e.length;h++){let f=e[h];if(f===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:T}=NC(t,f,r,n);if(l.appendChild(p),T){if(s)throw new RangeError("Multiple content holes");s=T}}}return{dom:l,contentDOM:s}}const Ome=65535,Rme=Math.pow(2,16);function hEt(t,e){return t+e*Rme}function Nme(t){return t&Ome}function fEt(t){return(t-(t&Ome))/Rme}const Mme=1,Ime=2,MC=4,Dme=8;class R${constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&Dme)>0}get deletedBefore(){return(this.delInfo&(Mme|MC))>0}get deletedAfter(){return(this.delInfo&(Ime|MC))>0}get deletedAcross(){return(this.delInfo&MC)>0}}class I1{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&I1.empty)return I1.empty}recover(e){let r=0,n=Nme(e);if(!this.inverted)for(let i=0;i<n;i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+fEt(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[s+a],d=this.ranges[s+o],h=l+u;if(e<=h){let f=u?e==l?-1:e==h?1:r:r,p=l+i+(f<0?0:d);if(n)return p;let T=e==(r<0?l:h)?null:hEt(s/3,e-l),g=e==l?Ime:e==h?Mme:MC;return(r<0?e!=l:e!=h)&&(g|=Dme),new R$(p,g,T)}i+=d-u}return n?e+i:new R$(e+i,0,null)}touches(e,r){let n=0,i=Nme(r),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[s+a],d=l+u;if(e<=d&&s==i*3)return!0;n+=this.ranges[s+o]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?a:0),l=o+(this.inverted?0:a),u=this.ranges[i+r],d=this.ranges[i+n];e(s,s+u,l,l+d),a+=d-u}}invert(){return new I1(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?I1.empty:new I1(e<0?[0,-e,0]:[0,0,e])}}I1.empty=new I1([]);class dy{constructor(e,r,n=0,i=e?e.length:0){this.mirror=r,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new dy(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let i=e.getMirror(r);this.appendMap(e._maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new dy;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],s=o.mapResult(e,r);if(s.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return n?e:new R$(e,i,null)}}const N$=Object.create(null);class vs{getMap(){return I1.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=N$[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in N$)throw new RangeError("Duplicate use of step JSON ID "+e);return N$[e]=r,r.prototype.jsonID=e,r}}class Oa{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new Oa(e,null)}static fail(e){return new Oa(null,e)}static fromReplace(e,r,n,i){try{return Oa.ok(e.replace(r,n,i))}catch(a){if(a instanceof CC)return Oa.fail(a.message);throw a}}}function M$(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let a=t.child(i);a.content.size&&(a=a.copy(M$(a.content,e,a))),a.isInline&&(a=e(a,r,i)),n.push(a)}return Pt.fromArray(n)}class h6 extends vs{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),a=new or(M$(r.content,(o,s)=>!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),r.openStart,r.openEnd);return Oa.fromReplace(e,this.from,this.to,a)}invert(){return new B2(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new h6(r.pos,n.pos,this.mark)}merge(e){return e instanceof h6&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new h6(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,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new h6(r.from,r.to,e.markFromJSON(r.mark))}}vs.jsonID("addMark",h6);class B2 extends vs{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new or(M$(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return Oa.fromReplace(e,this.from,this.to,n)}invert(){return new h6(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new B2(r.pos,n.pos,this.mark)}merge(e){return e instanceof B2&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new B2(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,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new B2(r.from,r.to,e.markFromJSON(r.mark))}}vs.jsonID("removeMark",B2);class f6 extends vs{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Oa.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return Oa.fromReplace(e,this.pos,this.pos+1,new or(Pt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new f6(this.pos,r.marks[i]);return new f6(this.pos,this.mark)}}return new _h(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new f6(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new f6(r.pos,e.markFromJSON(r.mark))}}vs.jsonID("addNodeMark",f6);class _h extends vs{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Oa.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return Oa.fromReplace(e,this.pos,this.pos+1,new or(Pt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new f6(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new _h(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new _h(r.pos,e.markFromJSON(r.mark))}}vs.jsonID("removeNodeMark",_h);class _o extends vs{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&I$(e,this.from,this.to)?Oa.fail("Structure replace would overwrite content"):Oa.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new I1([this.from,this.to-this.from,this.slice.size])}invert(e){return new _o(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new _o(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof _o)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?or.empty:new or(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new _o(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?or.empty:new or(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new _o(e.from,this.to,r,this.structure)}else return null}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,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new _o(r.from,r.to,or.fromJSON(e,r.slice),!!r.structure)}}vs.jsonID("replace",_o);class Qo extends vs{constructor(e,r,n,i,a,o,s=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=a,this.insert=o,this.structure=s}apply(e){if(this.structure&&(I$(e,this.from,this.gapFrom)||I$(e,this.gapTo,this.to)))return Oa.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return Oa.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?Oa.fromReplace(e,this.from,this.to,n):Oa.fail("Content does not fit in gap")}getMap(){return new I1([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new Qo(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||a>n.pos?null:new Qo(r.pos,n.pos,i,a,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,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Qo(r.from,r.to,r.gapFrom,r.gapTo,or.fromJSON(e,r.slice),r.insert,!!r.structure)}}vs.jsonID("replaceAround",Qo);function I$(t,e,r){let n=t.resolve(e),i=r-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let o=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function pEt(t,e,r,n){let i=[],a=[],o,s;t.doc.nodesBetween(e,r,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!n.isInSet(h)&&d.type.allowsMarkType(n.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,r),T=n.addToSet(h);for(let g=0;g<h.length;g++)h[g].isInSet(T)||(o&&o.to==f&&o.mark.eq(h[g])?o.to=p:i.push(o=new B2(f,p,h[g])));s&&s.to==f?s.to=p:a.push(s=new h6(f,p,n))}}),i.forEach(l=>t.step(l)),a.forEach(l=>t.step(l))}function TEt(t,e,r,n){let i=[],a=0;t.doc.nodesBetween(e,r,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof OC){let u=o.marks,d;for(;d=n.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(s+o.nodeSize,r);for(let d=0;d<l.length;d++){let h=l[d],f;for(let p=0;p<i.length;p++){let T=i[p];T.step==a-1&&h.eq(i[p].style)&&(f=T)}f?(f.to=u,f.step=a):i.push({style:h,from:Math.max(s,e),to:u,step:a})}}}),i.forEach(o=>t.step(new B2(o.from,o.to,o.style)))}function D$(t,e,r,n=r.contentMatch,i=!0){let a=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l<a.childCount;l++){let u=a.child(l),d=s+u.nodeSize,h=n.matchType(u.type);if(!h)o.push(new _o(s,d,or.empty));else{n=h;for(let f=0;f<u.marks.length;f++)r.allowsMarkType(u.marks[f].type)||t.step(new B2(s,d,u.marks[f]));if(i&&u.isText&&r.whitespace!="pre"){let f,p=/\r?\n|\r/g,T;for(;f=p.exec(u.text);)T||(T=new or(Pt.from(r.schema.text(" ",r.allowedMarks(u.marks))),0,0)),o.push(new _o(s+f.index,s+f.index+f[0].length,T))}}s=d}if(!n.validEnd){let l=n.fillBefore(Pt.empty,!0);t.replace(s,s,new or(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function gEt(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function C7(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let i=t.$from.node(n),a=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&i.canReplace(a,o,r))return n;if(n==0||i.type.spec.isolating||!gEt(i,a,o))break}return null}function mEt(t,e,r){let{$from:n,$to:i,depth:a}=e,o=n.before(a+1),s=i.after(a+1),l=o,u=s,d=Pt.empty,h=0;for(let T=a,g=!1;T>r;T--)g||n.index(T)>0?(g=!0,d=Pt.from(n.node(T).copy(d)),h++):l--;let f=Pt.empty,p=0;for(let T=a,g=!1;T>r;T--)g||i.after(T+1)<i.end(T)?(g=!0,f=Pt.from(i.node(T).copy(f)),p++):u++;t.step(new Qo(l,u,o,s,new or(d.append(f),h,p),d.size-h,!0))}function kme(t,e,r=null,n=t){let i=vEt(t,e),a=i&&yEt(n,e);return a?i.map(Pme).concat({type:e,attrs:r}).concat(a.map(Pme)):null}function Pme(t){return{type:t,attrs:null}}function vEt(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.contentMatchAt(n).findWrapping(e);if(!a)return null;let o=a.length?a[0]:e;return r.canReplaceWith(n,i,o)?a:null}function yEt(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.child(n),o=e.contentMatch.findWrapping(a.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;l&&u<i;u++)l=l.matchType(r.child(u).type);return!l||!l.validEnd?null:o}function _Et(t,e,r){let n=Pt.empty;for(let o=r.length-1;o>=0;o--){if(n.size){let s=r[o].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Pt.from(r[o].type.create(r[o].attrs,n))}let i=e.start,a=e.end;t.step(new Qo(i,a,i,a,new or(n,0,0),r.length,!0))}function QEt(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,r,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&bEt(t.doc,t.mapping.slice(a).map(s),n)){let u=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",T=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!T?u=!1:!p&&T&&(u=!0)}u===!1&&Bme(t,o,s,a),D$(t,t.mapping.slice(a).map(s,1),n,void 0,u===null);let d=t.mapping.slice(a),h=d.map(s,1),f=d.map(s+o.nodeSize,1);return t.step(new Qo(h,f,h+1,f-1,new or(Pt.from(n.create(l,null,o.marks)),0,0),1,!0)),u===!0&&Hme(t,o,s,a),!1}})}function Hme(t,e,r,n){e.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=t.mapping.slice(n).map(r+1+a+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Bme(t,e,r,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(n).map(r+1+a);t.replaceWith(o,o+1,e.type.schema.text(`
@@ -1,4 +1,4 @@
1
- import { $ as ln, a0 as an, a1 as y, a2 as tn, a3 as G, a4 as q, a5 as _, a6 as un, a7 as z, a8 as rn, a9 as K, aa as o, ab as sn, ac as on, ad as fn } from "./index-Bc8u-TCg.mjs";
1
+ import { $ as ln, a0 as an, a1 as y, a2 as tn, a3 as G, a4 as q, a5 as _, a6 as un, a7 as z, a8 as rn, a9 as K, aa as o, ab as sn, ac as on, ad as fn } from "./index-u_1OizEd.mjs";
2
2
  function cn(l) {
3
3
  return l.innerRadius;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { A as c, e as t } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { A as c, e as t } from "./mermaid-parser.core-v3S1ne0I.mjs";
2
2
  export {
3
3
  c as ArchitectureModule,
4
4
  t as createArchitectureServices
@@ -1,7 +1,7 @@
1
- import { aI as qe, _ as nt, g as Je, s as Qe, a as Ke, b as je, q as _e, p as tr, H as er, U as rr, y as ir, l as Pe, aj as Le, c as ge, aJ as me, d as ar, F as nr, aK as or, aL as sr } from "./index-Bc8u-TCg.mjs";
2
- import { p as hr } from "./chunk-4BMEZGHF-yu8lVMGG.mjs";
3
- import { I as lr } from "./chunk-XZIHB7SX-CStXbatc.mjs";
4
- import { p as fr } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { aI as qe, _ as nt, g as Je, s as Qe, a as Ke, b as je, q as _e, p as tr, H as er, U as rr, y as ir, l as Pe, aj as Le, c as ge, aJ as me, d as ar, F as nr, aK as or, aL as sr } from "./index-u_1OizEd.mjs";
2
+ import { p as hr } from "./chunk-4BMEZGHF-nDiC69yv.mjs";
3
+ import { I as lr } from "./chunk-XZIHB7SX-P8cZKNUX.mjs";
4
+ import { p as fr } from "./mermaid-parser.core-v3S1ne0I.mjs";
5
5
  import { c as Ge } from "./cytoscape.esm-D1A2YP3J.mjs";
6
6
  var le = { exports: {} }, fe = { exports: {} }, ce = { exports: {} }, cr = ce.exports, xe;
7
7
  function ur() {
@@ -1,7 +1,7 @@
1
- import { _ as d, E as at, d as R, e as de, l as L, y as ge, A as ue, c as z, ah as pe, Q as fe, R as xe, ai as Z, aj as Yt, ak as ye, u as tt, k as be, al as we, am as xt, an as me, i as Tt } from "./index-Bc8u-TCg.mjs";
2
- import { c as Le } from "./clone-DC_Xewab.mjs";
3
- import { G as Se } from "./graph-Cuplymd2.mjs";
4
- import { c as ve } from "./channel-BqB22bzO.mjs";
1
+ import { _ as d, E as at, d as R, e as de, l as L, y as ge, A as ue, c as z, ah as pe, Q as fe, R as xe, ai as Z, aj as Yt, ak as ye, u as tt, k as be, al as we, am as xt, an as me, i as Tt } from "./index-u_1OizEd.mjs";
2
+ import { c as Le } from "./clone-BZg7N8Rr.mjs";
3
+ import { G as Se } from "./graph-BH_yITec.mjs";
4
+ import { c as ve } from "./channel-BU3MLQyZ.mjs";
5
5
  var yt = function() {
6
6
  var e = /* @__PURE__ */ d(function(N, x, g, u) {
7
7
  for (g = g || {}, u = N.length; u--; g[N[u]] = x) ;
@@ -1,5 +1,5 @@
1
- import { g as Se, d as De } from "./chunk-D6G4REZN-CsmBRWNG.mjs";
2
- import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./index-Bc8u-TCg.mjs";
1
+ import { g as Se, d as De } from "./chunk-D6G4REZN-CpD2gmk7.mjs";
2
+ import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./index-u_1OizEd.mjs";
3
3
  var Ft = function() {
4
4
  var e = /* @__PURE__ */ g(function(_t, x, m, v) {
5
5
  for (m = m || {}, v = _t.length; v--; m[_t[v]] = x) ;
@@ -1,4 +1,4 @@
1
- import { ao as r, ap as n } from "./index-Bc8u-TCg.mjs";
1
+ import { ao as r, ap as n } from "./index-u_1OizEd.mjs";
2
2
  const t = (a, o) => r.lang.round(n.parse(a)[o]);
3
3
  export {
4
4
  t as c
@@ -1,4 +1,4 @@
1
- import { _ as l } from "./index-Bc8u-TCg.mjs";
1
+ import { _ as l } from "./index-u_1OizEd.mjs";
2
2
  function m(e, c) {
3
3
  var i, t, o;
4
4
  e.accDescr && ((i = c.setAccDescription) == null || i.call(c, e.accDescr)), e.accTitle && ((t = c.setAccTitle) == null || t.call(c, e.accTitle)), e.title && ((o = c.setDiagramTitle) == null || o.call(c, e.title));
@@ -1,5 +1,5 @@
1
- import { g as et, s as tt } from "./chunk-RZ5BOZE2--8BYpDTb.mjs";
2
- import { _ as f, l as Oe, c as F, o as st, r as it, u as we, d as $, b as at, a as nt, s as rt, g as ut, p as lt, q as ct, k as v, y as ot, x as ht, i as dt, P as R } from "./index-Bc8u-TCg.mjs";
1
+ import { g as et, s as tt } from "./chunk-RZ5BOZE2-BdHHf-fb.mjs";
2
+ import { _ as f, l as Oe, c as F, o as st, r as it, u as we, d as $, b as at, a as nt, s as rt, g as ut, p as lt, q as ct, k as v, y as ot, x as ht, i as dt, P as R } from "./index-u_1OizEd.mjs";
3
3
  var Ve = function() {
4
4
  var s = /* @__PURE__ */ f(function(I, c, h, p) {
5
5
  for (h = h || {}, p = I.length; p--; h[I[p]] = c) ;
@@ -1,8 +1,8 @@
1
1
  var re = Object.defineProperty;
2
2
  var ae = (e, t, s) => t in e ? re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var b = (e, t, s) => ae(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { g as ne, s as le } from "./chunk-RZ5BOZE2--8BYpDTb.mjs";
5
- import { _ as p, l as v, c as A, r as oe, u as ce, S as he, k as j, y as ue, a as de, b as fe, g as pe, s as Se, p as ye, q as ge } from "./index-Bc8u-TCg.mjs";
4
+ import { g as ne, s as le } from "./chunk-RZ5BOZE2-BdHHf-fb.mjs";
5
+ import { _ as p, l as v, c as A, r as oe, u as ce, S as he, k as j, y as ue, a as de, b as fe, g as pe, s as Se, p as ye, q as ge } from "./index-u_1OizEd.mjs";
6
6
  var bt = function() {
7
7
  var e = /* @__PURE__ */ p(function(P, l, h, a) {
8
8
  for (h = h || {}, a = P.length; a--; h[P[a]] = l) ;
@@ -1,4 +1,4 @@
1
- import { _ as n, T as o, j as l } from "./index-Bc8u-TCg.mjs";
1
+ import { _ as n, T as o, j as l } from "./index-u_1OizEd.mjs";
2
2
  var x = /* @__PURE__ */ n((s, t) => {
3
3
  const e = s.append("rect");
4
4
  if (e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), t.name && e.attr("name", t.name), t.rx && e.attr("rx", t.rx), t.ry && e.attr("ry", t.ry), t.attrs !== void 0)
@@ -1,4 +1,4 @@
1
- import { _ as n, d as r, e as d, l as g } from "./index-Bc8u-TCg.mjs";
1
+ import { _ as n, d as r, e as d, l as g } from "./index-u_1OizEd.mjs";
2
2
  var u = /* @__PURE__ */ n((e, t) => {
3
3
  let o;
4
4
  return t === "sandbox" && (o = r("#i" + e)), (t === "sandbox" ? r(o.nodes()[0].contentDocument.body) : r("body")).select(`[id="${e}"]`);
@@ -1,4 +1,4 @@
1
- import { _ as s } from "./index-Bc8u-TCg.mjs";
1
+ import { _ as s } from "./index-u_1OizEd.mjs";
2
2
  var t, e = (t = class {
3
3
  /**
4
4
  * @param init - Function that creates the default state.
@@ -1,5 +1,5 @@
1
- import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-BFs8jFGW.mjs";
2
- import { _ as l } from "./index-Bc8u-TCg.mjs";
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-RcPlCCHm.mjs";
2
+ import { _ as l } from "./index-u_1OizEd.mjs";
3
3
  var d = {
4
4
  parser: e,
5
5
  get db() {
@@ -1,5 +1,5 @@
1
- import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-BFs8jFGW.mjs";
2
- import { _ as l } from "./index-Bc8u-TCg.mjs";
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-A2AXSNBT-RcPlCCHm.mjs";
2
+ import { _ as l } from "./index-u_1OizEd.mjs";
3
3
  var d = {
4
4
  parser: e,
5
5
  get db() {
@@ -1,4 +1,4 @@
1
- import { b as r } from "./reduce-BEg2ZpV5.mjs";
1
+ import { b as r } from "./reduce-dnXXp7u5.mjs";
2
2
  var e = 4;
3
3
  function a(o) {
4
4
  return r(o, e);
@@ -1,9 +1,9 @@
1
- import { _ as X, aq as F, ar as Y, as as _, at as H, l as i, c as V, au as q, av as U, af as $, ak as z, ag as P, ae as K, aw as Q, ax as W, ay as Z } from "./index-Bc8u-TCg.mjs";
2
- import { G as B } from "./graph-Cuplymd2.mjs";
3
- import { l as I } from "./layout-BpbjP0To.mjs";
4
- import { i as x } from "./reduce-BEg2ZpV5.mjs";
5
- import { c as L } from "./clone-DC_Xewab.mjs";
6
- import { m as A } from "./_basePickBy-DCVQK7rw.mjs";
1
+ import { _ as X, aq as F, ar as Y, as as _, at as H, l as i, c as V, au as q, av as U, af as $, ak as z, ag as P, ae as K, aw as Q, ax as W, ay as Z } from "./index-u_1OizEd.mjs";
2
+ import { G as B } from "./graph-BH_yITec.mjs";
3
+ import { l as I } from "./layout-BgTw-_9z.mjs";
4
+ import { i as x } from "./reduce-dnXXp7u5.mjs";
5
+ import { c as L } from "./clone-BZg7N8Rr.mjs";
6
+ import { m as A } from "./_basePickBy-BWB4bTVi.mjs";
7
7
  function p(e) {
8
8
  var t = {
9
9
  options: {
@@ -1,6 +1,6 @@
1
- import { p as k } from "./chunk-4BMEZGHF-yu8lVMGG.mjs";
2
- import { _ as l, s as R, g as E, q as F, p as I, a as _, b as D, H as G, y as P, D as f, E as C, F as z, l as H, K as V } from "./index-Bc8u-TCg.mjs";
3
- import { p as W } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { p as k } from "./chunk-4BMEZGHF-nDiC69yv.mjs";
2
+ import { _ as l, s as R, g as E, q as F, p as I, a as _, b as D, H as G, y as P, D as f, E as C, F as z, l as H, K as V } from "./index-u_1OizEd.mjs";
3
+ import { p as W } from "./mermaid-parser.core-v3S1ne0I.mjs";
4
4
  var x = {
5
5
  showLegend: !0,
6
6
  ticks: 5,
@@ -1,6 +1,6 @@
1
- import { p as w } from "./chunk-4BMEZGHF-yu8lVMGG.mjs";
2
- import { _ as n, s as B, g as S, q as F, p as z, a as P, b as W, D as x, H as D, e as T, y as E, E as _, F as A, l as m } from "./index-Bc8u-TCg.mjs";
3
- import { p as N } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { p as w } from "./chunk-4BMEZGHF-nDiC69yv.mjs";
2
+ import { _ as n, s as B, g as S, q as F, p as z, a as P, b as W, D as x, H as D, e as T, y as E, E as _, F as A, l as m } from "./index-u_1OizEd.mjs";
3
+ import { p as N } from "./mermaid-parser.core-v3S1ne0I.mjs";
4
4
  var C = {
5
5
  packet: []
6
6
  }, v = structuredClone(C), L = A.packet, Y = /* @__PURE__ */ n(() => {
@@ -1,6 +1,6 @@
1
- import { g as Dt, s as wt } from "./chunk-RZ5BOZE2--8BYpDTb.mjs";
2
- import { _ as u, b as Vt, a as Lt, s as Mt, g as Bt, p as Ft, q as Yt, c as tt, l as D, y as Pt, x as zt, A as Gt, B as Kt, o as Zt, r as Ut, d as jt, u as Wt } from "./index-Bc8u-TCg.mjs";
3
- import { c as Qt } from "./channel-BqB22bzO.mjs";
1
+ import { g as Dt, s as wt } from "./chunk-RZ5BOZE2-BdHHf-fb.mjs";
2
+ import { _ as u, b as Vt, a as Lt, s as Mt, g as Bt, p as Ft, q as Yt, c as tt, l as D, y as Pt, x as zt, A as Gt, B as Kt, o as Zt, r as Ut, d as jt, u as Wt } from "./index-u_1OizEd.mjs";
3
+ import { c as Qt } from "./channel-BU3MLQyZ.mjs";
4
4
  var dt = function() {
5
5
  var s = /* @__PURE__ */ u(function(R, n, a, c) {
6
6
  for (a = a || {}, c = R.length; c--; a[R[c]] = n) ;
@@ -1,6 +1,6 @@
1
- import { _ as m, n as Ot, l as Z, c as G1, d as C1, o as Ht, r as qt, u as it, b as Xt, s as Qt, p as Jt, a as Zt, g as $t, q as te, k as ee, t as se, J as ie, v as re, x as st, y as ae, z as ne, A as ue } from "./index-Bc8u-TCg.mjs";
2
- import { g as le, s as oe } from "./chunk-RZ5BOZE2--8BYpDTb.mjs";
3
- import { c as ce } from "./channel-BqB22bzO.mjs";
1
+ import { _ as m, n as Ot, l as Z, c as G1, d as C1, o as Ht, r as qt, u as it, b as Xt, s as Qt, p as Jt, a as Zt, g as $t, q as te, k as ee, t as se, J as ie, v as re, x as st, y as ae, z as ne, A as ue } from "./index-u_1OizEd.mjs";
2
+ import { g as le, s as oe } from "./chunk-RZ5BOZE2-BdHHf-fb.mjs";
3
+ import { c as ce } from "./channel-BU3MLQyZ.mjs";
4
4
  var he = "flowchart-", P1, de = (P1 = class {
5
5
  // cspell:ignore funs
6
6
  constructor() {
@@ -1,5 +1,5 @@
1
- import { aI as we, aW as nn, aX as An, aY as rn, aZ as an, a_ as sn, a$ as se, b0 as In, _ as h, g as Ln, s as Wn, q as On, p as Hn, a as Nn, b as Vn, c as _t, d as Bt, e as Pn, b1 as at, l as Kt, k as zn, j as Rn, y as qn, u as Bn } from "./index-Bc8u-TCg.mjs";
2
- import { b as Zn, t as Oe, c as Xn, a as Gn, l as Qn } from "./linear-BDPWfqmI.mjs";
1
+ import { aI as we, aW as nn, aX as An, aY as rn, aZ as an, a_ as sn, a$ as se, b0 as In, _ as h, g as Ln, s as Wn, q as On, p as Hn, a as Nn, b as Vn, c as _t, d as Bt, e as Pn, b1 as at, l as Kt, k as zn, j as Rn, y as qn, u as Bn } from "./index-u_1OizEd.mjs";
2
+ import { b as Zn, t as Oe, c as Xn, a as Gn, l as Qn } from "./linear-CzYVn0p7.mjs";
3
3
  import { i as jn } from "./init-DjUOC4st.mjs";
4
4
  var Xt = { exports: {} }, $n = Xt.exports, He;
5
5
  function Jn() {
@@ -1,4 +1,4 @@
1
- import { G as a, f as G } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { G as a, f as G } from "./mermaid-parser.core-v3S1ne0I.mjs";
2
2
  export {
3
3
  a as GitGraphModule,
4
4
  G as createGitGraphServices
@@ -1,7 +1,7 @@
1
- import { p as Z } from "./chunk-4BMEZGHF-yu8lVMGG.mjs";
2
- import { I as F } from "./chunk-XZIHB7SX-CStXbatc.mjs";
3
- import { _ as h, q as U, p as rr, s as er, g as tr, a as ar, b as nr, l as w, c as sr, d as or, u as cr, C as ir, y as dr, k as B, D as hr, E as lr, F as $r, G as fr } from "./index-Bc8u-TCg.mjs";
4
- import { p as gr } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { p as Z } from "./chunk-4BMEZGHF-nDiC69yv.mjs";
2
+ import { I as F } from "./chunk-XZIHB7SX-P8cZKNUX.mjs";
3
+ import { _ as h, q as U, p as rr, s as er, g as tr, a as ar, b as nr, l as w, c as sr, d as or, u as cr, C as ir, y as dr, k as B, D as hr, E as lr, F as $r, G as fr } from "./index-u_1OizEd.mjs";
4
+ import { p as gr } from "./mermaid-parser.core-v3S1ne0I.mjs";
5
5
  var x = {
6
6
  NORMAL: 0,
7
7
  REVERSE: 1,
@@ -1,5 +1,5 @@
1
- import { az as N, aA as j, aB as v, aC as f, aD as b, aE as _, aF as E } from "./index-Bc8u-TCg.mjs";
2
- import { a as P, f as g, c as d, i as l, v as p, r as D } from "./reduce-BEg2ZpV5.mjs";
1
+ import { az as N, aA as j, aB as v, aC as f, aD as b, aE as _, aF as E } from "./index-u_1OizEd.mjs";
2
+ import { a as P, f as g, c as d, i as l, v as p, r as D } from "./reduce-dnXXp7u5.mjs";
3
3
  var w = N(function(o) {
4
4
  return j(P(o, 1, v, !0));
5
5
  }), F = "\0", a = "\0", O = "";
@@ -96565,7 +96565,7 @@ var JF = /* @__PURE__ */ B(function(e, t, r) {
96565
96565
  Jie([
96566
96566
  {
96567
96567
  name: "dagre",
96568
- loader: /* @__PURE__ */ B(async () => await import("./dagre-OKDRZEBW-07Io9wQK.mjs"), "loader")
96568
+ loader: /* @__PURE__ */ B(async () => await import("./dagre-OKDRZEBW-C3UCYt9D.mjs"), "loader")
96569
96569
  }
96570
96570
  ]);
96571
96571
  }, "registerDefaultLayoutLoaders");
@@ -96732,7 +96732,7 @@ var tst = /* @__PURE__ */ B(async (e, t) => {
96732
96732
  }
96733
96733
  return r.select(`#${e}`);
96734
96734
  }, "selectSvgElement"), eae = "c4", zHe = /* @__PURE__ */ B((e) => /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e), "detector"), GHe = /* @__PURE__ */ B(async () => {
96735
- const { diagram: e } = await import("./c4Diagram-VJAJSXHY-CzxsyV8t.mjs");
96735
+ const { diagram: e } = await import("./c4Diagram-VJAJSXHY-mYiJG4gX.mjs");
96736
96736
  return { id: eae, diagram: e };
96737
96737
  }, "loader"), qHe = {
96738
96738
  id: eae,
@@ -96742,7 +96742,7 @@ var tst = /* @__PURE__ */ B(async (e, t) => {
96742
96742
  var r, n;
96743
96743
  return ((r = t == null ? void 0 : t.flowchart) == null ? void 0 : r.defaultRenderer) === "dagre-wrapper" || ((n = t == null ? void 0 : t.flowchart) == null ? void 0 : n.defaultRenderer) === "elk" ? !1 : /^\s*graph/.test(e);
96744
96744
  }, "detector"), jHe = /* @__PURE__ */ B(async () => {
96745
- const { diagram: e } = await import("./flowDiagram-4HSFHLVR-CZYn4FiL.mjs");
96745
+ const { diagram: e } = await import("./flowDiagram-4HSFHLVR-BZIy5VfK.mjs");
96746
96746
  return { id: tae, diagram: e };
96747
96747
  }, "loader"), KHe = {
96748
96748
  id: tae,
@@ -96752,70 +96752,70 @@ var tst = /* @__PURE__ */ B(async (e, t) => {
96752
96752
  var r, n, i;
96753
96753
  return ((r = t == null ? void 0 : t.flowchart) == null ? void 0 : r.defaultRenderer) === "dagre-d3" ? !1 : (((n = t == null ? void 0 : t.flowchart) == null ? void 0 : n.defaultRenderer) === "elk" && (t.layout = "elk"), /^\s*graph/.test(e) && ((i = t == null ? void 0 : t.flowchart) == null ? void 0 : i.defaultRenderer) === "dagre-wrapper" ? !0 : /^\s*flowchart/.test(e));
96754
96754
  }, "detector"), JHe = /* @__PURE__ */ B(async () => {
96755
- const { diagram: e } = await import("./flowDiagram-4HSFHLVR-CZYn4FiL.mjs");
96755
+ const { diagram: e } = await import("./flowDiagram-4HSFHLVR-BZIy5VfK.mjs");
96756
96756
  return { id: rae, diagram: e };
96757
96757
  }, "loader"), ePe = {
96758
96758
  id: rae,
96759
96759
  detector: XHe,
96760
96760
  loader: JHe
96761
96761
  }, tPe = ePe, nae = "er", rPe = /* @__PURE__ */ B((e) => /^\s*erDiagram/.test(e), "detector"), nPe = /* @__PURE__ */ B(async () => {
96762
- const { diagram: e } = await import("./erDiagram-Q7BY3M3F-BhNeg8bO.mjs");
96762
+ const { diagram: e } = await import("./erDiagram-Q7BY3M3F-Cm7UVOKw.mjs");
96763
96763
  return { id: nae, diagram: e };
96764
96764
  }, "loader"), iPe = {
96765
96765
  id: nae,
96766
96766
  detector: rPe,
96767
96767
  loader: nPe
96768
96768
  }, aPe = iPe, iae = "gitGraph", oPe = /* @__PURE__ */ B((e) => /^\s*gitGraph/.test(e), "detector"), sPe = /* @__PURE__ */ B(async () => {
96769
- const { diagram: e } = await import("./gitGraphDiagram-7IBYFJ6S-Dw6WSLV1.mjs");
96769
+ const { diagram: e } = await import("./gitGraphDiagram-7IBYFJ6S-BSwBCksW.mjs");
96770
96770
  return { id: iae, diagram: e };
96771
96771
  }, "loader"), lPe = {
96772
96772
  id: iae,
96773
96773
  detector: oPe,
96774
96774
  loader: sPe
96775
96775
  }, cPe = lPe, aae = "gantt", uPe = /* @__PURE__ */ B((e) => /^\s*gantt/.test(e), "detector"), dPe = /* @__PURE__ */ B(async () => {
96776
- const { diagram: e } = await import("./ganttDiagram-APWFNJXF-CU-_ShBy.mjs");
96776
+ const { diagram: e } = await import("./ganttDiagram-APWFNJXF-Cac4Poq6.mjs");
96777
96777
  return { id: aae, diagram: e };
96778
96778
  }, "loader"), fPe = {
96779
96779
  id: aae,
96780
96780
  detector: uPe,
96781
96781
  loader: dPe
96782
96782
  }, TPe = fPe, oae = "info", hPe = /* @__PURE__ */ B((e) => /^\s*info/.test(e), "detector"), pPe = /* @__PURE__ */ B(async () => {
96783
- const { diagram: e } = await import("./infoDiagram-PH2N3AL5-AKB6SyuZ.mjs");
96783
+ const { diagram: e } = await import("./infoDiagram-PH2N3AL5-CXFHQ_jX.mjs");
96784
96784
  return { id: oae, diagram: e };
96785
96785
  }, "loader"), mPe = {
96786
96786
  id: oae,
96787
96787
  detector: hPe,
96788
96788
  loader: pPe
96789
96789
  }, sae = "pie", gPe = /* @__PURE__ */ B((e) => /^\s*pie/.test(e), "detector"), QPe = /* @__PURE__ */ B(async () => {
96790
- const { diagram: e } = await import("./pieDiagram-IB7DONF6-CJOsDe4S.mjs");
96790
+ const { diagram: e } = await import("./pieDiagram-IB7DONF6-CViTeAd-.mjs");
96791
96791
  return { id: sae, diagram: e };
96792
96792
  }, "loader"), _Pe = {
96793
96793
  id: sae,
96794
96794
  detector: gPe,
96795
96795
  loader: QPe
96796
96796
  }, lae = "quadrantChart", vPe = /* @__PURE__ */ B((e) => /^\s*quadrantChart/.test(e), "detector"), yPe = /* @__PURE__ */ B(async () => {
96797
- const { diagram: e } = await import("./quadrantDiagram-7GDLP6J5-CxEpiFlI.mjs");
96797
+ const { diagram: e } = await import("./quadrantDiagram-7GDLP6J5-rou1br5f.mjs");
96798
96798
  return { id: lae, diagram: e };
96799
96799
  }, "loader"), bPe = {
96800
96800
  id: lae,
96801
96801
  detector: vPe,
96802
96802
  loader: yPe
96803
96803
  }, EPe = bPe, cae = "xychart", SPe = /* @__PURE__ */ B((e) => /^\s*xychart-beta/.test(e), "detector"), xPe = /* @__PURE__ */ B(async () => {
96804
- const { diagram: e } = await import("./xychartDiagram-VJFVF3MP-bzFDLiVs.mjs");
96804
+ const { diagram: e } = await import("./xychartDiagram-VJFVF3MP-DziX2-IY.mjs");
96805
96805
  return { id: cae, diagram: e };
96806
96806
  }, "loader"), CPe = {
96807
96807
  id: cae,
96808
96808
  detector: SPe,
96809
96809
  loader: xPe
96810
96810
  }, LPe = CPe, uae = "requirement", APe = /* @__PURE__ */ B((e) => /^\s*requirement(Diagram)?/.test(e), "detector"), OPe = /* @__PURE__ */ B(async () => {
96811
- const { diagram: e } = await import("./requirementDiagram-KVF5MWMF-BI6l2Zc1.mjs");
96811
+ const { diagram: e } = await import("./requirementDiagram-KVF5MWMF-CQ5GYtMj.mjs");
96812
96812
  return { id: uae, diagram: e };
96813
96813
  }, "loader"), wPe = {
96814
96814
  id: uae,
96815
96815
  detector: APe,
96816
96816
  loader: OPe
96817
96817
  }, MPe = wPe, dae = "sequence", RPe = /* @__PURE__ */ B((e) => /^\s*sequenceDiagram/.test(e), "detector"), NPe = /* @__PURE__ */ B(async () => {
96818
- const { diagram: e } = await import("./sequenceDiagram-X6HHIX6F-9Q1vV8zv.mjs");
96818
+ const { diagram: e } = await import("./sequenceDiagram-X6HHIX6F-CLMwX1u2.mjs");
96819
96819
  return { id: dae, diagram: e };
96820
96820
  }, "loader"), DPe = {
96821
96821
  id: dae,
@@ -96825,7 +96825,7 @@ var tst = /* @__PURE__ */ B(async (e, t) => {
96825
96825
  var r;
96826
96826
  return ((r = t == null ? void 0 : t.class) == null ? void 0 : r.defaultRenderer) === "dagre-wrapper" ? !1 : /^\s*classDiagram/.test(e);
96827
96827
  }, "detector"), HPe = /* @__PURE__ */ B(async () => {
96828
- const { diagram: e } = await import("./classDiagram-GIVACNV2-Dp-4WHdl.mjs");
96828
+ const { diagram: e } = await import("./classDiagram-GIVACNV2-I8_nWkZX.mjs");
96829
96829
  return { id: fae, diagram: e };
96830
96830
  }, "loader"), PPe = {
96831
96831
  id: fae,
@@ -96835,7 +96835,7 @@ var tst = /* @__PURE__ */ B(async (e, t) => {
96835
96835
  var r;
96836
96836
  return /^\s*classDiagram/.test(e) && ((r = t == null ? void 0 : t.class) == null ? void 0 : r.defaultRenderer) === "dagre-wrapper" ? !0 : /^\s*classDiagram-v2/.test(e);
96837
96837
  }, "detector"), VPe = /* @__PURE__ */ B(async () => {
96838
- const { diagram: e } = await import("./classDiagram-v2-COTLJTTW-Dp-4WHdl.mjs");
96838
+ const { diagram: e } = await import("./classDiagram-v2-COTLJTTW-I8_nWkZX.mjs");
96839
96839
  return { id: Tae, diagram: e };
96840
96840
  }, "loader"), $Pe = {
96841
96841
  id: Tae,
@@ -96845,7 +96845,7 @@ var tst = /* @__PURE__ */ B(async (e, t) => {
96845
96845
  var r;
96846
96846
  return ((r = t == null ? void 0 : t.state) == null ? void 0 : r.defaultRenderer) === "dagre-wrapper" ? !1 : /^\s*stateDiagram/.test(e);
96847
96847
  }, "detector"), GPe = /* @__PURE__ */ B(async () => {
96848
- const { diagram: e } = await import("./stateDiagram-DGXRK772-H7txmcog.mjs");
96848
+ const { diagram: e } = await import("./stateDiagram-DGXRK772-h4j_Yec8.mjs");
96849
96849
  return { id: hae, diagram: e };
96850
96850
  }, "loader"), qPe = {
96851
96851
  id: hae,
@@ -96855,14 +96855,14 @@ var tst = /* @__PURE__ */ B(async (e, t) => {
96855
96855
  var r;
96856
96856
  return !!(/^\s*stateDiagram-v2/.test(e) || /^\s*stateDiagram/.test(e) && ((r = t == null ? void 0 : t.state) == null ? void 0 : r.defaultRenderer) === "dagre-wrapper");
96857
96857
  }, "detector"), jPe = /* @__PURE__ */ B(async () => {
96858
- const { diagram: e } = await import("./stateDiagram-v2-YXO3MK2T-DtoQ-t_x.mjs");
96858
+ const { diagram: e } = await import("./stateDiagram-v2-YXO3MK2T-CY_iL_Vi.mjs");
96859
96859
  return { id: pae, diagram: e };
96860
96860
  }, "loader"), KPe = {
96861
96861
  id: pae,
96862
96862
  detector: YPe,
96863
96863
  loader: jPe
96864
96864
  }, ZPe = KPe, mae = "journey", XPe = /* @__PURE__ */ B((e) => /^\s*journey/.test(e), "detector"), JPe = /* @__PURE__ */ B(async () => {
96865
- const { diagram: e } = await import("./journeyDiagram-U35MCT3I-Bwcn86e_.mjs");
96865
+ const { diagram: e } = await import("./journeyDiagram-U35MCT3I-CjYNiy1T.mjs");
96866
96866
  return { id: mae, diagram: e };
96867
96867
  }, "loader"), eBe = {
96868
96868
  id: mae,
@@ -96906,63 +96906,63 @@ var tst = /* @__PURE__ */ B(async (e, t) => {
96906
96906
  /^\s*flowchart|graph/.test(e) && ((r = t == null ? void 0 : t.flowchart) == null ? void 0 : r.defaultRenderer) === "elk" ? (t.layout = "elk", !0) : !1
96907
96907
  );
96908
96908
  }, "detector"), sBe = /* @__PURE__ */ B(async () => {
96909
- const { diagram: e } = await import("./flowDiagram-4HSFHLVR-CZYn4FiL.mjs");
96909
+ const { diagram: e } = await import("./flowDiagram-4HSFHLVR-BZIy5VfK.mjs");
96910
96910
  return { id: Qae, diagram: e };
96911
96911
  }, "loader"), lBe = {
96912
96912
  id: Qae,
96913
96913
  detector: oBe,
96914
96914
  loader: sBe
96915
96915
  }, cBe = lBe, _ae = "timeline", uBe = /* @__PURE__ */ B((e) => /^\s*timeline/.test(e), "detector"), dBe = /* @__PURE__ */ B(async () => {
96916
- const { diagram: e } = await import("./timeline-definition-BDJGKUSR-CMV-Hdko.mjs");
96916
+ const { diagram: e } = await import("./timeline-definition-BDJGKUSR-DadUJZnz.mjs");
96917
96917
  return { id: _ae, diagram: e };
96918
96918
  }, "loader"), fBe = {
96919
96919
  id: _ae,
96920
96920
  detector: uBe,
96921
96921
  loader: dBe
96922
96922
  }, TBe = fBe, vae = "mindmap", hBe = /* @__PURE__ */ B((e) => /^\s*mindmap/.test(e), "detector"), pBe = /* @__PURE__ */ B(async () => {
96923
- const { diagram: e } = await import("./mindmap-definition-ALO5MXBD-0UHmAVWi.mjs");
96923
+ const { diagram: e } = await import("./mindmap-definition-ALO5MXBD-D8chYL9E.mjs");
96924
96924
  return { id: vae, diagram: e };
96925
96925
  }, "loader"), mBe = {
96926
96926
  id: vae,
96927
96927
  detector: hBe,
96928
96928
  loader: pBe
96929
96929
  }, gBe = mBe, yae = "kanban", QBe = /* @__PURE__ */ B((e) => /^\s*kanban/.test(e), "detector"), _Be = /* @__PURE__ */ B(async () => {
96930
- const { diagram: e } = await import("./kanban-definition-NDS4AKOZ-DcgI4gop.mjs");
96930
+ const { diagram: e } = await import("./kanban-definition-NDS4AKOZ-CITs2sH3.mjs");
96931
96931
  return { id: yae, diagram: e };
96932
96932
  }, "loader"), vBe = {
96933
96933
  id: yae,
96934
96934
  detector: QBe,
96935
96935
  loader: _Be
96936
96936
  }, yBe = vBe, bae = "sankey", bBe = /* @__PURE__ */ B((e) => /^\s*sankey-beta/.test(e), "detector"), EBe = /* @__PURE__ */ B(async () => {
96937
- const { diagram: e } = await import("./sankeyDiagram-QLVOVGJD-DJ6WUvQv.mjs");
96937
+ const { diagram: e } = await import("./sankeyDiagram-QLVOVGJD-DKh3H5KV.mjs");
96938
96938
  return { id: bae, diagram: e };
96939
96939
  }, "loader"), SBe = {
96940
96940
  id: bae,
96941
96941
  detector: bBe,
96942
96942
  loader: EBe
96943
96943
  }, xBe = SBe, Eae = "packet", CBe = /* @__PURE__ */ B((e) => /^\s*packet-beta/.test(e), "detector"), LBe = /* @__PURE__ */ B(async () => {
96944
- const { diagram: e } = await import("./diagram-VNBRO52H-BIrY1QiX.mjs");
96944
+ const { diagram: e } = await import("./diagram-VNBRO52H-Dgd7wmOI.mjs");
96945
96945
  return { id: Eae, diagram: e };
96946
96946
  }, "loader"), ABe = {
96947
96947
  id: Eae,
96948
96948
  detector: CBe,
96949
96949
  loader: LBe
96950
96950
  }, Sae = "radar", OBe = /* @__PURE__ */ B((e) => /^\s*radar-beta/.test(e), "detector"), wBe = /* @__PURE__ */ B(async () => {
96951
- const { diagram: e } = await import("./diagram-SSKATNLV-C6OtFk63.mjs");
96951
+ const { diagram: e } = await import("./diagram-SSKATNLV-kGKB70Wb.mjs");
96952
96952
  return { id: Sae, diagram: e };
96953
96953
  }, "loader"), MBe = {
96954
96954
  id: Sae,
96955
96955
  detector: OBe,
96956
96956
  loader: wBe
96957
96957
  }, xae = "block", RBe = /* @__PURE__ */ B((e) => /^\s*block-beta/.test(e), "detector"), NBe = /* @__PURE__ */ B(async () => {
96958
- const { diagram: e } = await import("./blockDiagram-JOT3LUYC-BABdPT1V.mjs");
96958
+ const { diagram: e } = await import("./blockDiagram-JOT3LUYC-DBY5Y9D4.mjs");
96959
96959
  return { id: xae, diagram: e };
96960
96960
  }, "loader"), DBe = {
96961
96961
  id: xae,
96962
96962
  detector: RBe,
96963
96963
  loader: NBe
96964
96964
  }, IBe = DBe, Cae = "architecture", kBe = /* @__PURE__ */ B((e) => /^\s*architecture/.test(e), "detector"), HBe = /* @__PURE__ */ B(async () => {
96965
- const { diagram: e } = await import("./architectureDiagram-IEHRJDOE-CwbEEJkO.mjs");
96965
+ const { diagram: e } = await import("./architectureDiagram-IEHRJDOE-Bt1NRwnq.mjs");
96966
96966
  return { id: Cae, diagram: e };
96967
96967
  }, "loader"), PBe = {
96968
96968
  id: Cae,
@@ -153541,9 +153541,11 @@ const Vet = { class: "mermaid-wrapper" }, $et = { class: "mermaid-body" }, Uet =
153541
153541
  return u = u.replace(/\$\$([\s\S]*?)\$\$/g, (T) => {
153542
153542
  const h = `__PROTECTED_MATH_BLOCK_${f}__`;
153543
153543
  return d[f] = T, f++, h;
153544
- }), u = u.replace(/\$([^\$\n]+?)\$/g, (T) => {
153545
- const h = `__PROTECTED_INLINE_MATH_${f}__`;
153546
- return d[f] = T, f++, h;
153544
+ }), u = u.replace(/\$([^\$\n]+?)\$/g, (T, h) => {
153545
+ if (/[\u4e00-\u9fa5。,、“”‘’;:?!【】()《》]/.test(h))
153546
+ return T;
153547
+ const p = `__PROTECTED_INLINE_MATH_${f}__`;
153548
+ return d[f] = T, f++, p;
153547
153549
  }), u = u.replace(/```[\s\S]*?```/g, (T) => {
153548
153550
  const h = `__PROTECTED_CODE_BLOCK_${f}__`;
153549
153551
  return d[f] = T, f++, h;
@@ -153563,13 +153565,13 @@ const Vet = { class: "mermaid-wrapper" }, $et = { class: "mermaid-body" }, Uet =
153563
153565
  }
153564
153566
  function n(u) {
153565
153567
  return u.replace(/\\n/g, `
153566
- `).replace(/\\r/g, "\r").replace(/\\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\v/g, "\v");
153568
+ `).replace(/\\r/g, "\r").replace(/\\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\v/g, "\v").replace(/\$/g, "\\$");
153567
153569
  }
153568
153570
  function i(u) {
153569
153571
  const { markdown: d, protectedRegions: f } = t(u), T = n(d);
153570
153572
  return r(T, f);
153571
153573
  }
153572
- const a = /(?:https?:\/\/|www\.)?[a-zA-Z0-9][-a-zA-Z0-9.]+(?:\.[a-zA-Z]{2,})(?:\/[^\s\)\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:\?[^\s\)\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:#[^\s\)\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?/g;
153574
+ const a = /(?:https?:\/\/|www\.)?[a-zA-Z0-9][-a-zA-Z0-9.]+(?:\.[a-zA-Z]{2,})(?:\/[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:\?[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:#[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?/g;
153573
153575
  function o(u) {
153574
153576
  return u.replace(a, (d) => ` ${d} `);
153575
153577
  }
@@ -0,0 +1,5 @@
1
+ import { I as r, c as a } from "./mermaid-parser.core-v3S1ne0I.mjs";
2
+ export {
3
+ r as InfoModule,
4
+ a as createInfoServices
5
+ };
@@ -1,5 +1,5 @@
1
- import { _ as e, l as s, H as o, e as i, I as g } from "./index-Bc8u-TCg.mjs";
2
- import { p } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { _ as e, l as s, H as o, e as i, I as g } from "./index-u_1OizEd.mjs";
2
+ import { p } from "./mermaid-parser.core-v3S1ne0I.mjs";
3
3
  var v = {
4
4
  parse: /* @__PURE__ */ e(async (r) => {
5
5
  const a = await p("info", r);
@@ -1,6 +1,6 @@
1
- import { a as ft, g as at, f as gt, d as mt } from "./chunk-D6G4REZN-CsmBRWNG.mjs";
2
- import { _ as i, g as xt, s as kt, a as _t, b as vt, q as bt, p as wt, c as A, d as W, e as Tt, y as St } from "./index-Bc8u-TCg.mjs";
3
- import { d as tt } from "./arc-Boj_lamS.mjs";
1
+ import { a as ft, g as at, f as gt, d as mt } from "./chunk-D6G4REZN-CpD2gmk7.mjs";
2
+ import { _ as i, g as xt, s as kt, a as _t, b as vt, q as bt, p as wt, c as A, d as W, e as Tt, y as St } from "./index-u_1OizEd.mjs";
3
+ import { d as tt } from "./arc-X81XOSSd.mjs";
4
4
  var H = function() {
5
5
  var t = /* @__PURE__ */ i(function(g, r, a, l) {
6
6
  for (a = a || {}, l = g.length; l--; a[g[l]] = r) ;
@@ -1,4 +1,4 @@
1
- import { _ as c, l as te, c as W, H as fe, ae as ye, af as be, ag as me, U as _e, F as Y, i as G, t as Ee, J as ke, V as Se, W as le, X as ce } from "./index-Bc8u-TCg.mjs";
1
+ import { _ as c, l as te, c as W, H as fe, ae as ye, af as be, ag as me, U as _e, F as Y, i as G, t as Ee, J as ke, V as Se, W as le, X as ce } from "./index-u_1OizEd.mjs";
2
2
  var $ = function() {
3
3
  var t = /* @__PURE__ */ c(function(_, s, n, a) {
4
4
  for (n = n || {}, a = _.length; a--; n[_[a]] = s) ;
@@ -1,7 +1,7 @@
1
- import { G as g } from "./graph-Cuplymd2.mjs";
2
- import { b as Te, m as ce, n as le, e as z, d as ee, h as j, l as Ie, o as Me, a as Se, p as Fe, c as f, i as m, f as _, v as x, r as M } from "./reduce-BEg2ZpV5.mjs";
3
- import { f as O, b as he, a as je, c as Ve, d as Ae, t as V, m as w, e as P, h as ve, g as X, l as T, i as Be } from "./_basePickBy-DCVQK7rw.mjs";
4
- import { b7 as Ge, b8 as Ye, b9 as De, aO as $e, ba as qe, aT as pe, aS as we, bb as We, aN as $, az as ze, aV as Xe, aC as Ue, bc as q } from "./index-Bc8u-TCg.mjs";
1
+ import { G as g } from "./graph-BH_yITec.mjs";
2
+ import { b as Te, m as ce, n as le, e as z, d as ee, h as j, l as Ie, o as Me, a as Se, p as Fe, c as f, i as m, f as _, v as x, r as M } from "./reduce-dnXXp7u5.mjs";
3
+ import { f as O, b as he, a as je, c as Ve, d as Ae, t as V, m as w, e as P, h as ve, g as X, l as T, i as Be } from "./_basePickBy-BWB4bTVi.mjs";
4
+ import { b7 as Ge, b8 as Ye, b9 as De, aO as $e, ba as qe, aT as pe, aS as we, bb as We, aN as $, az as ze, aV as Xe, aC as Ue, bc as q } from "./index-u_1OizEd.mjs";
5
5
  function He(e) {
6
6
  return Ge(Ye(e, void 0, O), e + "");
7
7
  }
@@ -1,4 +1,4 @@
1
- import { b2 as un, b3 as I, b4 as U, b5 as fn, b6 as Y } from "./index-Bc8u-TCg.mjs";
1
+ import { b2 as un, b3 as I, b4 as U, b5 as fn, b6 as Y } from "./index-u_1OizEd.mjs";
2
2
  import { i as cn } from "./init-DjUOC4st.mjs";
3
3
  function F(n, t) {
4
4
  return n == null || t == null ? NaN : n < t ? -1 : n > t ? 1 : n >= t ? 0 : NaN;
@@ -1,10 +1,10 @@
1
1
  var su = Object.defineProperty;
2
2
  var au = (n, e, t) => e in n ? su(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var Qe = (n, e, t) => au(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { bB as ou, bC as lu, aQ as gl, bj as cu, aE as Ht, aV as uu, aS as te, bD as du, bE as fu, bF as hu, az as pu, aB as la, ba as mu, bd as yl, be as Tl, bG as Rl, bb as gu, br as ca, bA as yu, bH as Tu, aA as Ru, bI as _s, aD as Tt, aF as D, aT as ua, bJ as Y, aM as vu } from "./index-Bc8u-TCg.mjs";
5
- import { g as Ls, e as Qt, a as vl, v as z, h as Au, q as Eu, s as ku, c as $, i as qe, r as oe, f as xe } from "./reduce-BEg2ZpV5.mjs";
6
- import { j as bs, m as S, d as xu, f as Ne, g as jt, h as N, i as Os, l as zt, e as Su } from "./_basePickBy-DCVQK7rw.mjs";
7
- import { c as re } from "./clone-DC_Xewab.mjs";
4
+ import { bB as ou, bC as lu, aQ as gl, bj as cu, aE as Ht, aV as uu, aS as te, bD as du, bE as fu, bF as hu, az as pu, aB as la, ba as mu, bd as yl, be as Tl, bG as Rl, bb as gu, br as ca, bA as yu, bH as Tu, aA as Ru, bI as _s, aD as Tt, aF as D, aT as ua, bJ as Y, aM as vu } from "./index-u_1OizEd.mjs";
5
+ import { g as Ls, e as Qt, a as vl, v as z, h as Au, q as Eu, s as ku, c as $, i as qe, r as oe, f as xe } from "./reduce-dnXXp7u5.mjs";
6
+ import { j as bs, m as S, d as xu, f as Ne, g as jt, h as N, i as Os, l as zt, e as Su } from "./_basePickBy-BWB4bTVi.mjs";
7
+ import { c as re } from "./clone-BZg7N8Rr.mjs";
8
8
  var Iu = Object.prototype, Cu = Iu.hasOwnProperty, ke = ou(function(n, e) {
9
9
  if (lu(e) || gl(e)) {
10
10
  cu(e, Ht(e), n);
@@ -12772,27 +12772,27 @@ function ly(n = kt) {
12772
12772
  k(ly, "createRadarServices");
12773
12773
  var Ze = {}, cy = {
12774
12774
  info: /* @__PURE__ */ k(async () => {
12775
- const { createInfoServices: n } = await import("./info-4N47QTOZ-CQGeBdf2.mjs"), e = n().Info.parser.LangiumParser;
12775
+ const { createInfoServices: n } = await import("./info-4N47QTOZ-sIJ1ry2P.mjs"), e = n().Info.parser.LangiumParser;
12776
12776
  Ze.info = e;
12777
12777
  }, "info"),
12778
12778
  packet: /* @__PURE__ */ k(async () => {
12779
- const { createPacketServices: n } = await import("./packet-KVYON367-sJ5SYQ7B.mjs"), e = n().Packet.parser.LangiumParser;
12779
+ const { createPacketServices: n } = await import("./packet-KVYON367-CqmTiWgl.mjs"), e = n().Packet.parser.LangiumParser;
12780
12780
  Ze.packet = e;
12781
12781
  }, "packet"),
12782
12782
  pie: /* @__PURE__ */ k(async () => {
12783
- const { createPieServices: n } = await import("./pie-R6RNRRYF-C4OFbe7K.mjs"), e = n().Pie.parser.LangiumParser;
12783
+ const { createPieServices: n } = await import("./pie-R6RNRRYF-CWj-opv8.mjs"), e = n().Pie.parser.LangiumParser;
12784
12784
  Ze.pie = e;
12785
12785
  }, "pie"),
12786
12786
  architecture: /* @__PURE__ */ k(async () => {
12787
- const { createArchitectureServices: n } = await import("./architecture-4AB2E3PP-BvPI75lt.mjs"), e = n().Architecture.parser.LangiumParser;
12787
+ const { createArchitectureServices: n } = await import("./architecture-4AB2E3PP-BWSj6tGU.mjs"), e = n().Architecture.parser.LangiumParser;
12788
12788
  Ze.architecture = e;
12789
12789
  }, "architecture"),
12790
12790
  gitGraph: /* @__PURE__ */ k(async () => {
12791
- const { createGitGraphServices: n } = await import("./gitGraph-O2Q2CXLX-CHZmlnQl.mjs"), e = n().GitGraph.parser.LangiumParser;
12791
+ const { createGitGraphServices: n } = await import("./gitGraph-O2Q2CXLX-BEoJaMTG.mjs"), e = n().GitGraph.parser.LangiumParser;
12792
12792
  Ze.gitGraph = e;
12793
12793
  }, "gitGraph"),
12794
12794
  radar: /* @__PURE__ */ k(async () => {
12795
- const { createRadarServices: n } = await import("./radar-MK3ICKWK-D5_VUbnM.mjs"), e = n().Radar.parser.LangiumParser;
12795
+ const { createRadarServices: n } = await import("./radar-MK3ICKWK-JDDtEQhD.mjs"), e = n().Radar.parser.LangiumParser;
12796
12796
  Ze.radar = e;
12797
12797
  }, "radar")
12798
12798
  };
@@ -1,4 +1,4 @@
1
- import { aI as Nt, _ as S, l as z, c as ot, H as Dt, U as mt, F as it, i as nt, V as Ot, W as At, X as It, d as Ct, aj as Rt, N as xt } from "./index-Bc8u-TCg.mjs";
1
+ import { aI as Nt, _ as S, l as z, c as ot, H as Dt, U as mt, F as it, i as nt, V as Ot, W as At, X as It, d as Ct, aj as Rt, N as xt } from "./index-u_1OizEd.mjs";
2
2
  import { c as dt } from "./cytoscape.esm-D1A2YP3J.mjs";
3
3
  var tt = { exports: {} }, et = { exports: {} }, rt = { exports: {} }, Mt = rt.exports, ut;
4
4
  function wt() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucap-llm/ai-ui",
3
- "version": "1.2.0-beta.11",
3
+ "version": "1.2.0-beta.12",
4
4
  "description": "common component library for vue3",
5
5
  "main": "ai-ui.es.js",
6
6
  "publishConfig": {
@@ -1,4 +1,4 @@
1
- import { P as c, a as r } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { P as c, a as r } from "./mermaid-parser.core-v3S1ne0I.mjs";
2
2
  export {
3
3
  c as PacketModule,
4
4
  r as createPacketServices
@@ -0,0 +1,5 @@
1
+ import { b as a, d as i } from "./mermaid-parser.core-v3S1ne0I.mjs";
2
+ export {
3
+ a as PieModule,
4
+ i as createPieServices
5
+ };
@@ -1,7 +1,7 @@
1
- import { p as V } from "./chunk-4BMEZGHF-yu8lVMGG.mjs";
2
- import { a7 as S, a2 as z, aH as H, _ as u, g as U, s as j, a as q, b as Z, q as J, p as K, l as F, c as Q, D as X, H as Y, N as tt, e as et, y as at, F as rt } from "./index-Bc8u-TCg.mjs";
3
- import { p as nt } from "./mermaid-parser.core-Dw6LJl8m.mjs";
4
- import { d as P } from "./arc-Boj_lamS.mjs";
1
+ import { p as V } from "./chunk-4BMEZGHF-nDiC69yv.mjs";
2
+ import { a7 as S, a2 as z, aH as H, _ as u, g as U, s as j, a as q, b as Z, q as J, p as K, l as F, c as Q, D as X, H as Y, N as tt, e as et, y as at, F as rt } from "./index-u_1OizEd.mjs";
3
+ import { p as nt } from "./mermaid-parser.core-v3S1ne0I.mjs";
4
+ import { d as P } from "./arc-X81XOSSd.mjs";
5
5
  import { o as it } from "./ordinal-C0oynhte.mjs";
6
6
  function st(t, a) {
7
7
  return a < t ? -1 : a > t ? 1 : a >= t ? 0 : NaN;
@@ -1,5 +1,5 @@
1
- import { _ as o, s as _e, g as Ae, q as ie, p as ke, a as Fe, b as Pe, c as wt, l as At, d as zt, e as ve, y as Ce, F as D, K as Le, i as Ee } from "./index-Bc8u-TCg.mjs";
2
- import { l as ee } from "./linear-BDPWfqmI.mjs";
1
+ import { _ as o, s as _e, g as Ae, q as ie, p as ke, a as Fe, b as Pe, c as wt, l as At, d as zt, e as ve, y as Ce, F as D, K as Le, i as Ee } from "./index-u_1OizEd.mjs";
2
+ import { l as ee } from "./linear-CzYVn0p7.mjs";
3
3
  var Vt = function() {
4
4
  var t = /* @__PURE__ */ o(function(j, r, l, g) {
5
5
  for (l = l || {}, g = j.length; g--; l[j[g]] = r) ;
@@ -1,4 +1,4 @@
1
- import { R as r, g as d } from "./mermaid-parser.core-Dw6LJl8m.mjs";
1
+ import { R as r, g as d } from "./mermaid-parser.core-v3S1ne0I.mjs";
2
2
  export {
3
3
  r as RadarModule,
4
4
  d as createRadarServices
@@ -1,4 +1,4 @@
1
- import { bd as O, be as fn, aS as u, bf as y, bg as on, bh as D, bi as G, bj as h, aE as d, aO as I, bk as N, bl as un, bm as cn, bn, bo as K, bp as gn, bq as w, bb as q, br as T, aM as v, bs as ln, bt as yn, bu as dn, bv as pn, bw as z, bx as Tn, aV as hn, by as Z, bz as An, aU as mn, aT as H, b9 as Sn, aQ as On, bA as In } from "./index-Bc8u-TCg.mjs";
1
+ import { bd as O, be as fn, aS as u, bf as y, bg as on, bh as D, bi as G, bj as h, aE as d, aO as I, bk as N, bl as un, bm as cn, bn, bo as K, bp as gn, bq as w, bb as q, br as T, aM as v, bs as ln, bt as yn, bu as dn, bv as pn, bw as z, bx as Tn, aV as hn, by as Z, bz as An, aU as mn, aT as H, b9 as Sn, aQ as On, bA as In } from "./index-u_1OizEd.mjs";
2
2
  var wn = "[object Symbol]";
3
3
  function $(n) {
4
4
  return typeof n == "symbol" || O(n) && fn(n) == wn;
@@ -1,5 +1,5 @@
1
- import { g as Ge, s as ze } from "./chunk-RZ5BOZE2--8BYpDTb.mjs";
2
- import { _ as f, b as Xe, a as Je, s as Ze, g as et, p as tt, q as st, c as Ne, l as qe, y as it, B as rt, o as nt, r as at, u as lt } from "./index-Bc8u-TCg.mjs";
1
+ import { g as Ge, s as ze } from "./chunk-RZ5BOZE2-BdHHf-fb.mjs";
2
+ import { _ as f, b as Xe, a as Je, s as Ze, g as et, p as tt, q as st, c as Ne, l as qe, y as it, B as rt, o as nt, r as at, u as lt } from "./index-u_1OizEd.mjs";
3
3
  var Ae = function() {
4
4
  var e = /* @__PURE__ */ f(function(P, i, r, l) {
5
5
  for (r = r || {}, l = P.length; l--; r[P[l]] = i) ;
@@ -1,4 +1,4 @@
1
- import { _ as p, p as _t, q as xt, s as vt, g as bt, b as wt, a as St, c as lt, z as Lt, d as H, U as Et, y as At, k as Tt } from "./index-Bc8u-TCg.mjs";
1
+ import { _ as p, p as _t, q as xt, s as vt, g as bt, b as wt, a as St, c as lt, z as Lt, d as H, U as Et, y as At, k as Tt } from "./index-u_1OizEd.mjs";
2
2
  import { o as Mt } from "./ordinal-C0oynhte.mjs";
3
3
  function Nt(t) {
4
4
  for (var e = t.length / 6 | 0, i = new Array(e), a = 0; a < e; ) i[a] = "#" + t.slice(a * 6, ++a * 6);
@@ -1,6 +1,6 @@
1
- import { a as xe, b as Yt, g as At, d as Te, c as ye, e as Ee } from "./chunk-D6G4REZN-CsmBRWNG.mjs";
2
- import { I as be } from "./chunk-XZIHB7SX-CStXbatc.mjs";
3
- import { _ as u, n as me, c as $, d as Lt, l as G, j as Zt, e as we, f as ve, k as I, b as Gt, s as Ie, p as Le, a as _e, g as Pe, q as Ae, y as ke, i as _t, u as Y, L as ot, M as bt, N as Qt, Z as Ne, O as jt, E as Ct } from "./index-Bc8u-TCg.mjs";
1
+ import { a as xe, b as Yt, g as At, d as Te, c as ye, e as Ee } from "./chunk-D6G4REZN-CpD2gmk7.mjs";
2
+ import { I as be } from "./chunk-XZIHB7SX-P8cZKNUX.mjs";
3
+ import { _ as u, n as me, c as $, d as Lt, l as G, j as Zt, e as we, f as ve, k as I, b as Gt, s as Ie, p as Le, a as _e, g as Pe, q as Ae, y as ke, i as _t, u as Y, L as ot, M as bt, N as Qt, Z as Ne, O as jt, E as Ct } from "./index-u_1OizEd.mjs";
4
4
  var Ot = function() {
5
5
  var e = /* @__PURE__ */ u(function(ht, v, L, P) {
6
6
  for (L = L || {}, P = ht.length; P--; L[ht[P]] = v) ;
@@ -1,7 +1,7 @@
1
- import { s as W, a as P, S as N } from "./chunk-AEK57VVT-CfBAZ3pn.mjs";
2
- import { _ as u, c as t, d as H, l as S, e as C, k as z, Q as U, R as F, u as O } from "./index-Bc8u-TCg.mjs";
3
- import { G as J } from "./graph-Cuplymd2.mjs";
4
- import { l as X } from "./layout-BpbjP0To.mjs";
1
+ import { s as W, a as P, S as N } from "./chunk-AEK57VVT-CP3PYGhE.mjs";
2
+ import { _ as u, c as t, d as H, l as S, e as C, k as z, Q as U, R as F, u as O } from "./index-u_1OizEd.mjs";
3
+ import { G as J } from "./graph-BH_yITec.mjs";
4
+ import { l as X } from "./layout-BgTw-_9z.mjs";
5
5
  var L = {}, D = /* @__PURE__ */ u((e, i) => {
6
6
  L[e] = i;
7
7
  }, "set"), Y = /* @__PURE__ */ u((e) => L[e], "get"), A = /* @__PURE__ */ u(() => Object.keys(L), "keys"), I = /* @__PURE__ */ u(() => A().length, "size"), $ = {
@@ -1,5 +1,5 @@
1
- import { s as a, b as t, a as r, S as s } from "./chunk-AEK57VVT-CfBAZ3pn.mjs";
2
- import { _ as i } from "./index-Bc8u-TCg.mjs";
1
+ import { s as a, b as t, a as r, S as s } from "./chunk-AEK57VVT-CP3PYGhE.mjs";
2
+ import { _ as i } from "./index-u_1OizEd.mjs";
3
3
  var _ = {
4
4
  parser: r,
5
5
  get db() {
@@ -1,5 +1,5 @@
1
- import { _ as s, c as xt, l as T, d as U, U as kt, V as vt, W as _t, X as bt, B as wt, Y as St, y as Et } from "./index-Bc8u-TCg.mjs";
2
- import { d as nt } from "./arc-Boj_lamS.mjs";
1
+ import { _ as s, c as xt, l as T, d as U, U as kt, V as vt, W as _t, X as bt, B as wt, Y as St, y as Et } from "./index-u_1OizEd.mjs";
2
+ import { d as nt } from "./arc-X81XOSSd.mjs";
3
3
  var X = function() {
4
4
  var n = /* @__PURE__ */ s(function(f, i, a, d) {
5
5
  for (a = a || {}, d = f.length; d--; a[f[d]] = i) ;
@@ -1,7 +1,7 @@
1
- import { _ as a, s as ui, g as gi, q as Ft, p as xi, a as di, b as pi, l as Xt, H as fi, e as mi, y as yi, E as At, D as Nt, F as bi, K as Ai, i as wi, aG as Ci, Q as Bt } from "./index-Bc8u-TCg.mjs";
1
+ import { _ as a, s as ui, g as gi, q as Ft, p as xi, a as di, b as pi, l as Xt, H as fi, e as mi, y as yi, E as At, D as Nt, F as bi, K as Ai, i as wi, aG as Ci, Q as Bt } from "./index-u_1OizEd.mjs";
2
2
  import { i as Si } from "./init-DjUOC4st.mjs";
3
3
  import { o as _i } from "./ordinal-C0oynhte.mjs";
4
- import { l as Wt } from "./linear-BDPWfqmI.mjs";
4
+ import { l as Wt } from "./linear-CzYVn0p7.mjs";
5
5
  function ki(e, t, i) {
6
6
  e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
7
7
  for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
@@ -1,5 +0,0 @@
1
- import { I as r, c as a } from "./mermaid-parser.core-Dw6LJl8m.mjs";
2
- export {
3
- r as InfoModule,
4
- a as createInfoServices
5
- };
@@ -1,5 +0,0 @@
1
- import { b as a, d as i } from "./mermaid-parser.core-Dw6LJl8m.mjs";
2
- export {
3
- a as PieModule,
4
- i as createPieServices
5
- };