@gnai/message-content-renderer 0.1.6 → 0.1.7

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.
@@ -1 +1 @@
1
- .vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg) scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%) scale(1)}.vjs-check-controller .vjs-check-controller-inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{border-radius:100%;height:4px;background-color:#fff;left:50%;top:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;outline:none;position:absolute;z-index:-1;inset:0;margin:0}.vjs-carets{position:absolute;right:0;cursor:pointer}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{display:flex;position:relative;line-height:20px}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff;border-radius:4px}.vjs-tree-node.is-highlight .vjs-tree-node-actions,.vjs-tree-node:hover .vjs-tree-node-actions{display:block}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node .vjs-tree-node-actions{display:none;position:absolute;right:0;top:0;padding:0 4px;background-color:#e6f7ff;border-radius:4px}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item{cursor:pointer}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item:hover{color:#1890ff}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark .vjs-tree-node-actions,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{position:absolute;right:100%;margin-right:4px;-webkit-user-select:none;user-select:none}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-value{word-break:break-word}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px;text-align:left}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}.image-viewer[data-v-92c159ee]{position:fixed;inset:0;background:#000000e6;display:flex;align-items:center;justify-content:center;z-index:2000;padding:32px;cursor:zoom-out}.close-button[data-v-92c159ee]{position:fixed;top:24px;right:24px;width:48px;height:48px;display:flex;align-items:center;justify-content:center;color:#fff;background:#00000080;border-radius:50%;cursor:pointer;transition:all .15s cubic-bezier(.4,0,.2,1);z-index:2001}.close-button[data-v-92c159ee]:hover{background:#000c;transform:scale(1.1)}.close-button svg[data-v-92c159ee]{width:24px;height:24px}.viewer-content[data-v-92c159ee]{max-width:90%;max-height:90%;display:flex;align-items:center;justify-content:center;cursor:default}.viewer-content img[data-v-92c159ee]{max-width:100%;max-height:90vh;object-fit:contain;border-radius:10px;box-shadow:0 8px 32px #00000080}.viewer-enter-active[data-v-92c159ee],.viewer-leave-active[data-v-92c159ee]{transition:opacity .2s cubic-bezier(.4,0,.2,1)}.viewer-enter-from[data-v-92c159ee],.viewer-leave-to[data-v-92c159ee]{opacity:0}@media(max-width:768px){.image-viewer[data-v-92c159ee]{padding:16px}.close-button[data-v-92c159ee]{top:16px;right:16px;width:40px;height:40px}.close-button svg[data-v-92c159ee]{width:20px;height:20px}.viewer-content img[data-v-92c159ee]{border-radius:6px}}.content-text[data-v-bc62b03b]{font-size:15px;line-height:1.6;color:#1d1d1f;background:#fff;border-radius:10px;padding:10px 14px;display:inline-block;max-width:100%}.content-text.is-plain[data-v-bc62b03b]{white-space:pre-wrap;word-wrap:break-word}.content-text[data-v-bc62b03b] p{margin:0 0 8px;white-space:pre-wrap;word-wrap:break-word}.content-text[data-v-bc62b03b] p:last-child{margin-bottom:0}.content-text[data-v-bc62b03b] code{background:#fff;padding:2px 6px;border-radius:4px;font-family:Courier New,monospace;font-size:14px}.content-text[data-v-bc62b03b] pre{background:#fff;padding:16px;border-radius:10px;overflow-x:auto;margin:8px 0}.content-text[data-v-bc62b03b] pre code{background:none;padding:0}.content-text[data-v-bc62b03b] a{color:#007aff;text-decoration:none}.content-text[data-v-bc62b03b] a:hover{text-decoration:underline}.content-text[data-v-bc62b03b] ul,.content-text[data-v-bc62b03b] ol{margin:8px 0;padding-left:32px}.content-text[data-v-bc62b03b] blockquote{border-left:4px solid #d2d2d7;padding-left:16px;margin:8px 0;color:#6e6e73}.content-text.role-user[data-v-bc62b03b]{background:#007aff;color:#fff}.content-text.role-user[data-v-bc62b03b] a{color:#fff}.content-text.role-user[data-v-bc62b03b] code,.content-text.role-user[data-v-bc62b03b] pre{background:#2f4f4f}.content-file[data-v-24190b61]{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;background:#fff;border:1px solid #d2d2d7;border-radius:10px;cursor:pointer;transition:all .15s cubic-bezier(.4,0,.2,1)}.content-file[data-v-24190b61]:hover{background:#f5f5f7;border-color:#007aff}.content-file .file-icon[data-v-24190b61]{width:20px;height:20px;color:#6e6e73}.content-file .file-name[data-v-24190b61]{font-size:14px;color:#1d1d1f;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-file .download-icon[data-v-24190b61]{width:16px;height:16px;color:#007aff}@media(max-width:768px){.content-file .file-name[data-v-24190b61]{max-width:150px}}.message-image[data-v-24952cda]{display:block;max-width:300px;width:auto;height:220px;border-radius:10px;object-fit:cover;cursor:pointer;transition:transform .2s cubic-bezier(.4,0,.2,1)}.message-image[data-v-24952cda]:hover{transform:scale(1.02)}.message-image.is-full-width[data-v-24952cda]{width:100%;max-width:100%}@media(max-width:768px){.message-image[data-v-24952cda]{max-width:200px;height:180px}}.message-video[data-v-be6bb72d]{display:block;max-width:100%;max-height:220px;border-radius:10px}.message-video.is-full-width[data-v-be6bb72d]{width:100%}@media(max-width:768px){.message-video[data-v-be6bb72d]{max-height:180px}}.message-audio[data-v-c0d42074]{max-width:100%;height:40px}.message-content-renderer[data-v-02192e04]{display:inline-flex;max-width:100%;position:relative}.renderer-actions[data-v-02192e04]{position:absolute;top:-30px;display:inline-flex;gap:4px;padding:4px 6px;border-radius:var(--radius-md);border:1px solid var(--color-border-light);background:var(--color-bg-secondary);box-shadow:var(--shadow-sm);opacity:0;pointer-events:none;transition:opacity var(--transition-fast),transform var(--transition-fast);transform:translateY(-4px);word-break:keep-all}.renderer-actions.actions-user[data-v-02192e04]{right:0}.renderer-actions.actions-assistant[data-v-02192e04]{left:0}.renderer-action-btn[data-v-02192e04]{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;font-size:12px;color:var(--color-text-secondary);border-radius:var(--radius-sm);transition:background var(--transition-fast),color var(--transition-fast)}.renderer-action-btn[data-v-02192e04]:hover{background:var(--color-bg);color:var(--color-text-primary)}.renderer-action-btn.danger[data-v-02192e04]:hover{color:var(--color-error)}.renderer-action-btn svg[data-v-02192e04]{width:14px;height:14px}.content-user-message[data-v-02192e04]{display:flex;flex-direction:column;gap:16px;align-items:flex-start}.files-grid[data-v-02192e04]{display:inline-flex;flex-direction:column;align-items:flex-start;gap:8px}.role-user .content-user-message[data-v-02192e04],.role-user .files-grid[data-v-02192e04]{align-items:flex-end}.content-medialib .json-viewer[data-v-02192e04]{background:#fff;padding:16px;border-radius:10px;font-size:13px;max-height:400px;overflow:auto}@media(max-width:768px){.renderer-actions[data-v-02192e04]{display:none}}
1
+ .vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg) scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%) scale(1)}.vjs-check-controller .vjs-check-controller-inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{border-radius:100%;height:4px;background-color:#fff;left:50%;top:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;outline:none;position:absolute;z-index:-1;inset:0;margin:0}.vjs-carets{position:absolute;right:0;cursor:pointer}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{display:flex;position:relative;line-height:20px}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff;border-radius:4px}.vjs-tree-node.is-highlight .vjs-tree-node-actions,.vjs-tree-node:hover .vjs-tree-node-actions{display:block}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node .vjs-tree-node-actions{display:none;position:absolute;right:0;top:0;padding:0 4px;background-color:#e6f7ff;border-radius:4px}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item{cursor:pointer}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item:hover{color:#1890ff}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark .vjs-tree-node-actions,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{position:absolute;right:100%;margin-right:4px;-webkit-user-select:none;user-select:none}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-value{word-break:break-word}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px;text-align:left}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}.image-viewer[data-v-92c159ee]{position:fixed;inset:0;background:#000000e6;display:flex;align-items:center;justify-content:center;z-index:2000;padding:32px;cursor:zoom-out}.close-button[data-v-92c159ee]{position:fixed;top:24px;right:24px;width:48px;height:48px;display:flex;align-items:center;justify-content:center;color:#fff;background:#00000080;border-radius:50%;cursor:pointer;transition:all .15s cubic-bezier(.4,0,.2,1);z-index:2001}.close-button[data-v-92c159ee]:hover{background:#000c;transform:scale(1.1)}.close-button svg[data-v-92c159ee]{width:24px;height:24px}.viewer-content[data-v-92c159ee]{max-width:90%;max-height:90%;display:flex;align-items:center;justify-content:center;cursor:default}.viewer-content img[data-v-92c159ee]{max-width:100%;max-height:90vh;object-fit:contain;border-radius:10px;box-shadow:0 8px 32px #00000080}.viewer-enter-active[data-v-92c159ee],.viewer-leave-active[data-v-92c159ee]{transition:opacity .2s cubic-bezier(.4,0,.2,1)}.viewer-enter-from[data-v-92c159ee],.viewer-leave-to[data-v-92c159ee]{opacity:0}@media(max-width:768px){.image-viewer[data-v-92c159ee]{padding:16px}.close-button[data-v-92c159ee]{top:16px;right:16px;width:40px;height:40px}.close-button svg[data-v-92c159ee]{width:20px;height:20px}.viewer-content img[data-v-92c159ee]{border-radius:6px}}.content-text[data-v-d4935523]{font-size:15px;line-height:1.6;color:#1d1d1f;background:#fff;border-radius:10px;padding:10px 14px;display:inline-block;max-width:100%;word-break:break-all}.content-text.is-plain[data-v-d4935523]{white-space:pre-wrap;word-wrap:break-word}.content-text[data-v-d4935523] p{margin:0 0 8px;white-space:pre-wrap;word-wrap:break-word}.content-text[data-v-d4935523] p:last-child{margin-bottom:0}.content-text[data-v-d4935523] code{background:#fff;padding:2px 6px;border-radius:4px;font-family:Courier New,monospace;font-size:14px;color:#000}.content-text[data-v-d4935523] pre{background:#fff;padding:16px;border-radius:10px;overflow-x:auto;margin:8px 0}.content-text[data-v-d4935523] pre code{background:none;padding:0;color:#000}.content-text[data-v-d4935523] a{color:#007aff;text-decoration:none}.content-text[data-v-d4935523] a:hover{text-decoration:underline}.content-text[data-v-d4935523] ul,.content-text[data-v-d4935523] ol{margin:8px 0;padding-left:32px}.content-text[data-v-d4935523] blockquote{border-left:4px solid #d2d2d7;padding-left:16px;margin:8px 0;color:#6e6e73}.content-text.role-user[data-v-d4935523]{background:#007aff;color:#fff}.content-text.role-user[data-v-d4935523] a{color:#fff}.content-text.role-user[data-v-d4935523] code,.content-text.role-user[data-v-d4935523] pre{background:#2f4f4f}.content-file[data-v-24190b61]{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;background:#fff;border:1px solid #d2d2d7;border-radius:10px;cursor:pointer;transition:all .15s cubic-bezier(.4,0,.2,1)}.content-file[data-v-24190b61]:hover{background:#f5f5f7;border-color:#007aff}.content-file .file-icon[data-v-24190b61]{width:20px;height:20px;color:#6e6e73}.content-file .file-name[data-v-24190b61]{font-size:14px;color:#1d1d1f;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-file .download-icon[data-v-24190b61]{width:16px;height:16px;color:#007aff}@media(max-width:768px){.content-file .file-name[data-v-24190b61]{max-width:150px}}.message-image[data-v-24952cda]{display:block;max-width:300px;width:auto;height:220px;border-radius:10px;object-fit:cover;cursor:pointer;transition:transform .2s cubic-bezier(.4,0,.2,1)}.message-image[data-v-24952cda]:hover{transform:scale(1.02)}.message-image.is-full-width[data-v-24952cda]{width:100%;max-width:100%}@media(max-width:768px){.message-image[data-v-24952cda]{max-width:200px;height:180px}}.message-video[data-v-be6bb72d]{display:block;max-width:100%;max-height:220px;border-radius:10px}.message-video.is-full-width[data-v-be6bb72d]{width:100%}@media(max-width:768px){.message-video[data-v-be6bb72d]{max-height:180px}}.message-audio[data-v-c0d42074]{max-width:100%;height:40px}.message-content-renderer[data-v-02192e04]{display:inline-flex;max-width:100%;position:relative}.renderer-actions[data-v-02192e04]{position:absolute;top:-30px;display:inline-flex;gap:4px;padding:4px 6px;border-radius:var(--radius-md);border:1px solid var(--color-border-light);background:var(--color-bg-secondary);box-shadow:var(--shadow-sm);opacity:0;pointer-events:none;transition:opacity var(--transition-fast),transform var(--transition-fast);transform:translateY(-4px);word-break:keep-all}.renderer-actions.actions-user[data-v-02192e04]{right:0}.renderer-actions.actions-assistant[data-v-02192e04]{left:0}.renderer-action-btn[data-v-02192e04]{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;font-size:12px;color:var(--color-text-secondary);border-radius:var(--radius-sm);transition:background var(--transition-fast),color var(--transition-fast)}.renderer-action-btn[data-v-02192e04]:hover{background:var(--color-bg);color:var(--color-text-primary)}.renderer-action-btn.danger[data-v-02192e04]:hover{color:var(--color-error)}.renderer-action-btn svg[data-v-02192e04]{width:14px;height:14px}.content-user-message[data-v-02192e04]{display:flex;flex-direction:column;gap:16px;align-items:flex-start}.files-grid[data-v-02192e04]{display:inline-flex;flex-direction:column;align-items:flex-start;gap:8px}.role-user .content-user-message[data-v-02192e04],.role-user .files-grid[data-v-02192e04]{align-items:flex-end}.content-medialib .json-viewer[data-v-02192e04]{background:#fff;padding:16px;border-radius:10px;font-size:13px;max-height:400px;overflow:auto}@media(max-width:768px){.renderer-actions[data-v-02192e04]{display:none}}
@@ -4953,7 +4953,7 @@ const kc = ["src", "alt"], yc = /* @__PURE__ */ mu({
4953
4953
  innerHTML: u.html
4954
4954
  }, null, 10, vc));
4955
4955
  }
4956
- }), St = /* @__PURE__ */ _u(Dc, [["__scopeId", "data-v-bc62b03b"]]), Ec = { class: "file-name" }, Fc = /* @__PURE__ */ mu({
4956
+ }), St = /* @__PURE__ */ _u(Dc, [["__scopeId", "data-v-d4935523"]]), Ec = { class: "file-name" }, Fc = /* @__PURE__ */ mu({
4957
4957
  __name: "MessageFileContent",
4958
4958
  props: {
4959
4959
  name: {}
@@ -15,6 +15,6 @@
15
15
  `),e=e.replace(Qn,"�"),u.src=e}function Kn(u){let e;u.inlineMode?(e=new u.Token("inline","",0),e.content=u.src,e.map=[0,1],e.children=[],u.tokens.push(e)):u.md.block.parse(u.src,u.md,u.env,u.tokens)}function Yn(u){const e=u.tokens;for(let t=0,n=e.length;t<n;t++){const r=e[t];r.type==="inline"&&u.md.inline.parse(r.content,u.md,u.env,r.children)}}function Xn(u){return/^<a[>\s]/i.test(u)}function ur(u){return/^<\/a\s*>/i.test(u)}function er(u){const e=u.tokens;if(u.md.options.linkify)for(let t=0,n=e.length;t<n;t++){if(e[t].type!=="inline"||!u.md.linkify.pretest(e[t].content))continue;let r=e[t].children,o=0;for(let c=r.length-1;c>=0;c--){const i=r[c];if(i.type==="link_close"){for(c--;r[c].level!==i.level&&r[c].type!=="link_open";)c--;continue}if(i.type==="html_inline"&&(Xn(i.content)&&o>0&&o--,ur(i.content)&&o++),!(o>0)&&i.type==="text"&&u.md.linkify.test(i.content)){const a=i.content;let s=u.md.linkify.match(a);const l=[];let f=i.level,x=0;s.length>0&&s[0].index===0&&c>0&&r[c-1].type==="text_special"&&(s=s.slice(1));for(let b=0;b<s.length;b++){const d=s[b].url,F=u.md.normalizeLink(d);if(!u.md.validateLink(F))continue;let k=s[b].text;s[b].schema?s[b].schema==="mailto:"&&!/^mailto:/i.test(k)?k=u.md.normalizeLinkText("mailto:"+k).replace(/^mailto:/,""):k=u.md.normalizeLinkText(k):k=u.md.normalizeLinkText("http://"+k).replace(/^http:\/\//,"");const w=s[b].index;if(w>x){const C=new u.Token("text","",0);C.content=a.slice(x,w),C.level=f,l.push(C)}const E=new u.Token("link_open","a",1);E.attrs=[["href",F]],E.level=f++,E.markup="linkify",E.info="auto",l.push(E);const D=new u.Token("text","",0);D.content=k,D.level=f,l.push(D);const p=new u.Token("link_close","a",-1);p.level=--f,p.markup="linkify",p.info="auto",l.push(p),x=s[b].lastIndex}if(x<a.length){const b=new u.Token("text","",0);b.content=a.slice(x),b.level=f,l.push(b)}e[t].children=r=dt(r,c,l)}}}}const bt=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,tr=/\((c|tm|r)\)/i,nr=/\((c|tm|r)\)/ig,rr={c:"©",r:"®",tm:"™"};function or(u,e){return rr[e.toLowerCase()]}function cr(u){let e=0;for(let t=u.length-1;t>=0;t--){const n=u[t];n.type==="text"&&!e&&(n.content=n.content.replace(nr,or)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}function ir(u){let e=0;for(let t=u.length-1;t>=0;t--){const n=u[t];n.type==="text"&&!e&&bt.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}function ar(u){let e;if(u.md.options.typographer)for(e=u.tokens.length-1;e>=0;e--)u.tokens[e].type==="inline"&&(tr.test(u.tokens[e].content)&&cr(u.tokens[e].children),bt.test(u.tokens[e].content)&&ir(u.tokens[e].children))}const sr=/['"]/,mt=/['"]/g,xt="’";function $u(u,e,t){return u.slice(0,e)+t+u.slice(e+1)}function lr(u,e){let t;const n=[];for(let r=0;r<u.length;r++){const o=u[r],c=u[r].level;for(t=n.length-1;t>=0&&!(n[t].level<=c);t--);if(n.length=t+1,o.type!=="text")continue;let i=o.content,a=0,s=i.length;u:for(;a<s;){mt.lastIndex=a;const l=mt.exec(i);if(!l)break;let f=!0,x=!0;a=l.index+1;const b=l[0]==="'";let d=32;if(l.index-1>=0)d=i.charCodeAt(l.index-1);else for(t=r-1;t>=0&&!(u[t].type==="softbreak"||u[t].type==="hardbreak");t--)if(u[t].content){d=u[t].content.charCodeAt(u[t].content.length-1);break}let F=32;if(a<s)F=i.charCodeAt(a);else for(t=r+1;t<u.length&&!(u[t].type==="softbreak"||u[t].type==="hardbreak");t++)if(u[t].content){F=u[t].content.charCodeAt(0);break}const k=Au(d)||Fu(String.fromCharCode(d)),w=Au(F)||Fu(String.fromCharCode(F)),E=Du(d),D=Du(F);if(D?f=!1:w&&(E||k||(f=!1)),E?x=!1:k&&(D||w||(x=!1)),F===34&&l[0]==='"'&&d>=48&&d<=57&&(x=f=!1),f&&x&&(f=k,x=w),!f&&!x){b&&(o.content=$u(o.content,l.index,xt));continue}if(x)for(t=n.length-1;t>=0;t--){let p=n[t];if(n[t].level<c)break;if(p.single===b&&n[t].level===c){p=n[t];let C,m;b?(C=e.md.options.quotes[2],m=e.md.options.quotes[3]):(C=e.md.options.quotes[0],m=e.md.options.quotes[1]),o.content=$u(o.content,l.index,m),u[p.token].content=$u(u[p.token].content,p.pos,C),a+=m.length-1,p.token===r&&(a+=C.length-1),i=o.content,s=i.length,n.length=t;continue u}}f?n.push({token:r,pos:l.index,single:b,level:c}):x&&b&&(o.content=$u(o.content,l.index,xt))}}}function fr(u){if(u.md.options.typographer)for(let e=u.tokens.length-1;e>=0;e--)u.tokens[e].type!=="inline"||!sr.test(u.tokens[e].content)||lr(u.tokens[e].children,u)}function dr(u){let e,t;const n=u.tokens,r=n.length;for(let o=0;o<r;o++){if(n[o].type!=="inline")continue;const c=n[o].children,i=c.length;for(e=0;e<i;e++)c[e].type==="text_special"&&(c[e].type="text");for(e=t=0;e<i;e++)c[e].type==="text"&&e+1<i&&c[e+1].type==="text"?c[e+1].content=c[e].content+c[e+1].content:(e!==t&&(c[t]=c[e]),t++);e!==t&&(c.length=t)}}const fe=[["normalize",Jn],["block",Kn],["inline",Yn],["linkify",er],["replacements",ar],["smartquotes",fr],["text_join",dr]];function de(){this.ruler=new Z;for(let u=0;u<fe.length;u++)this.ruler.push(fe[u][0],fe[u][1])}de.prototype.process=function(u){const e=this.ruler.getRules("");for(let t=0,n=e.length;t<n;t++)e[t](u)},de.prototype.State=pt;function eu(u,e,t,n){this.src=u,this.md=e,this.env=t,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let o=0,c=0,i=0,a=0,s=r.length,l=!1;c<s;c++){const f=r.charCodeAt(c);if(!l)if(z(f)){i++,f===9?a+=4-a%4:a++;continue}else l=!0;(f===10||c===s-1)&&(f!==10&&c++,this.bMarks.push(o),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(a),this.bsCount.push(0),l=!1,i=0,a=0,o=c+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}eu.prototype.push=function(u,e,t){const n=new K(u,e,t);return n.block=!0,t<0&&this.level--,n.level=this.level,t>0&&this.level++,this.tokens.push(n),n},eu.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},eu.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},eu.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){const n=this.src.charCodeAt(e);if(!z(n))break}return e},eu.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!z(this.src.charCodeAt(--e)))return e+1;return e},eu.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},eu.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},eu.prototype.getLines=function(e,t,n,r){if(e>=t)return"";const o=new Array(t-e);for(let c=0,i=e;i<t;i++,c++){let a=0;const s=this.bMarks[i];let l=s,f;for(i+1<t||r?f=this.eMarks[i]+1:f=this.eMarks[i];l<f&&a<n;){const x=this.src.charCodeAt(l);if(z(x))x===9?a+=4-(a+this.bsCount[i])%4:a++;else if(l-s<this.tShift[i])a++;else break;l++}a>n?o[c]=new Array(a-n+1).join(" ")+this.src.slice(l,f):o[c]=this.src.slice(l,f)}return o.join("")},eu.prototype.Token=K;const hr=65536;function he(u,e){const t=u.bMarks[e]+u.tShift[e],n=u.eMarks[e];return u.src.slice(t,n)}function gt(u){const e=[],t=u.length;let n=0,r=u.charCodeAt(n),o=!1,c=0,i="";for(;n<t;)r===124&&(o?(i+=u.substring(c,n-1),c=n):(e.push(i+u.substring(c,n)),i="",c=n+1)),o=r===92,n++,r=u.charCodeAt(n);return e.push(i+u.substring(c)),e}function pr(u,e,t,n){if(e+2>t)return!1;let r=e+1;if(u.sCount[r]<u.blkIndent||u.sCount[r]-u.blkIndent>=4)return!1;let o=u.bMarks[r]+u.tShift[r];if(o>=u.eMarks[r])return!1;const c=u.src.charCodeAt(o++);if(c!==124&&c!==45&&c!==58||o>=u.eMarks[r])return!1;const i=u.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58&&!z(i)||c===45&&z(i))return!1;for(;o<u.eMarks[r];){const p=u.src.charCodeAt(o);if(p!==124&&p!==45&&p!==58&&!z(p))return!1;o++}let a=he(u,e+1),s=a.split("|");const l=[];for(let p=0;p<s.length;p++){const C=s[p].trim();if(!C){if(p===0||p===s.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?l.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?l.push("left"):l.push("")}if(a=he(u,e).trim(),a.indexOf("|")===-1||u.sCount[e]-u.blkIndent>=4)return!1;s=gt(a),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop();const f=s.length;if(f===0||f!==l.length)return!1;if(n)return!0;const x=u.parentType;u.parentType="table";const b=u.md.block.ruler.getRules("blockquote"),d=u.push("table_open","table",1),F=[e,0];d.map=F;const k=u.push("thead_open","thead",1);k.map=[e,e+1];const w=u.push("tr_open","tr",1);w.map=[e,e+1];for(let p=0;p<s.length;p++){const C=u.push("th_open","th",1);l[p]&&(C.attrs=[["style","text-align:"+l[p]]]);const m=u.push("inline","",0);m.content=s[p].trim(),m.children=[],u.push("th_close","th",-1)}u.push("tr_close","tr",-1),u.push("thead_close","thead",-1);let E,D=0;for(r=e+2;r<t&&!(u.sCount[r]<u.blkIndent);r++){let p=!1;for(let m=0,g=b.length;m<g;m++)if(b[m](u,r,t,!0)){p=!0;break}if(p||(a=he(u,r).trim(),!a)||u.sCount[r]-u.blkIndent>=4||(s=gt(a),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop(),D+=f-s.length,D>hr))break;if(r===e+2){const m=u.push("tbody_open","tbody",1);m.map=E=[e+2,0]}const C=u.push("tr_open","tr",1);C.map=[r,r+1];for(let m=0;m<f;m++){const g=u.push("td_open","td",1);l[m]&&(g.attrs=[["style","text-align:"+l[m]]]);const v=u.push("inline","",0);v.content=s[m]?s[m].trim():"",v.children=[],u.push("td_close","td",-1)}u.push("tr_close","tr",-1)}return E&&(u.push("tbody_close","tbody",-1),E[1]=r),u.push("table_close","table",-1),F[1]=r,u.parentType=x,u.line=r,!0}function br(u,e,t){if(u.sCount[e]-u.blkIndent<4)return!1;let n=e+1,r=n;for(;n<t;){if(u.isEmpty(n)){n++;continue}if(u.sCount[n]-u.blkIndent>=4){n++,r=n;continue}break}u.line=r;const o=u.push("code_block","code",0);return o.content=u.getLines(e,r,4+u.blkIndent,!1)+`
16
16
  `,o.map=[e,u.line],!0}function mr(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4||r+3>o)return!1;const c=u.src.charCodeAt(r);if(c!==126&&c!==96)return!1;let i=r;r=u.skipChars(r,c);let a=r-i;if(a<3)return!1;const s=u.src.slice(i,r),l=u.src.slice(r,o);if(c===96&&l.indexOf(String.fromCharCode(c))>=0)return!1;if(n)return!0;let f=e,x=!1;for(;f++,!(f>=t||(r=i=u.bMarks[f]+u.tShift[f],o=u.eMarks[f],r<o&&u.sCount[f]<u.blkIndent));)if(u.src.charCodeAt(r)===c&&!(u.sCount[f]-u.blkIndent>=4)&&(r=u.skipChars(r,c),!(r-i<a)&&(r=u.skipSpaces(r),!(r<o)))){x=!0;break}a=u.sCount[e],u.line=f+(x?1:0);const b=u.push("fence","code",0);return b.info=l,b.content=u.getLines(e+1,f,a,!0),b.markup=s,b.map=[e,u.line],!0}function xr(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];const c=u.lineMax;if(u.sCount[e]-u.blkIndent>=4||u.src.charCodeAt(r)!==62)return!1;if(n)return!0;const i=[],a=[],s=[],l=[],f=u.md.block.ruler.getRules("blockquote"),x=u.parentType;u.parentType="blockquote";let b=!1,d;for(d=e;d<t;d++){const D=u.sCount[d]<u.blkIndent;if(r=u.bMarks[d]+u.tShift[d],o=u.eMarks[d],r>=o)break;if(u.src.charCodeAt(r++)===62&&!D){let C=u.sCount[d]+1,m,g;u.src.charCodeAt(r)===32?(r++,C++,g=!1,m=!0):u.src.charCodeAt(r)===9?(m=!0,(u.bsCount[d]+C)%4===3?(r++,C++,g=!1):g=!0):m=!1;let v=C;for(i.push(u.bMarks[d]),u.bMarks[d]=r;r<o;){const S=u.src.charCodeAt(r);if(z(S))S===9?v+=4-(v+u.bsCount[d]+(g?1:0))%4:v++;else break;r++}b=r>=o,a.push(u.bsCount[d]),u.bsCount[d]=u.sCount[d]+1+(m?1:0),s.push(u.sCount[d]),u.sCount[d]=v-C,l.push(u.tShift[d]),u.tShift[d]=r-u.bMarks[d];continue}if(b)break;let p=!1;for(let C=0,m=f.length;C<m;C++)if(f[C](u,d,t,!0)){p=!0;break}if(p){u.lineMax=d,u.blkIndent!==0&&(i.push(u.bMarks[d]),a.push(u.bsCount[d]),l.push(u.tShift[d]),s.push(u.sCount[d]),u.sCount[d]-=u.blkIndent);break}i.push(u.bMarks[d]),a.push(u.bsCount[d]),l.push(u.tShift[d]),s.push(u.sCount[d]),u.sCount[d]=-1}const F=u.blkIndent;u.blkIndent=0;const k=u.push("blockquote_open","blockquote",1);k.markup=">";const w=[e,0];k.map=w,u.md.block.tokenize(u,e,d);const E=u.push("blockquote_close","blockquote",-1);E.markup=">",u.lineMax=c,u.parentType=x,w[1]=u.line;for(let D=0;D<l.length;D++)u.bMarks[D+e]=i[D],u.tShift[D+e]=l[D],u.sCount[D+e]=s[D],u.bsCount[D+e]=a[D];return u.blkIndent=F,!0}function gr(u,e,t,n){const r=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4)return!1;let o=u.bMarks[e]+u.tShift[e];const c=u.src.charCodeAt(o++);if(c!==42&&c!==45&&c!==95)return!1;let i=1;for(;o<r;){const s=u.src.charCodeAt(o++);if(s!==c&&!z(s))return!1;s===c&&i++}if(i<3)return!1;if(n)return!0;u.line=e+1;const a=u.push("hr","hr",0);return a.map=[e,u.line],a.markup=Array(i+1).join(String.fromCharCode(c)),!0}function _t(u,e){const t=u.eMarks[e];let n=u.bMarks[e]+u.tShift[e];const r=u.src.charCodeAt(n++);if(r!==42&&r!==45&&r!==43)return-1;if(n<t){const o=u.src.charCodeAt(n);if(!z(o))return-1}return n}function kt(u,e){const t=u.bMarks[e]+u.tShift[e],n=u.eMarks[e];let r=t;if(r+1>=n)return-1;let o=u.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=n)return-1;if(o=u.src.charCodeAt(r++),o>=48&&o<=57){if(r-t>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<n&&(o=u.src.charCodeAt(r),!z(o))?-1:r}function _r(u,e){const t=u.level+2;for(let n=e+2,r=u.tokens.length-2;n<r;n++)u.tokens[n].level===t&&u.tokens[n].type==="paragraph_open"&&(u.tokens[n+2].hidden=!0,u.tokens[n].hidden=!0,n+=2)}function kr(u,e,t,n){let r,o,c,i,a=e,s=!0;if(u.sCount[a]-u.blkIndent>=4||u.listIndent>=0&&u.sCount[a]-u.listIndent>=4&&u.sCount[a]<u.blkIndent)return!1;let l=!1;n&&u.parentType==="paragraph"&&u.sCount[a]>=u.blkIndent&&(l=!0);let f,x,b;if((b=kt(u,a))>=0){if(f=!0,c=u.bMarks[a]+u.tShift[a],x=Number(u.src.slice(c,b-1)),l&&x!==1)return!1}else if((b=_t(u,a))>=0)f=!1;else return!1;if(l&&u.skipSpaces(b)>=u.eMarks[a])return!1;if(n)return!0;const d=u.src.charCodeAt(b-1),F=u.tokens.length;f?(i=u.push("ordered_list_open","ol",1),x!==1&&(i.attrs=[["start",x]])):i=u.push("bullet_list_open","ul",1);const k=[a,0];i.map=k,i.markup=String.fromCharCode(d);let w=!1;const E=u.md.block.ruler.getRules("list"),D=u.parentType;for(u.parentType="list";a<t;){o=b,r=u.eMarks[a];const p=u.sCount[a]+b-(u.bMarks[a]+u.tShift[a]);let C=p;for(;o<r;){const L=u.src.charCodeAt(o);if(L===9)C+=4-(C+u.bsCount[a])%4;else if(L===32)C++;else break;o++}const m=o;let g;m>=r?g=1:g=C-p,g>4&&(g=1);const v=p+g;i=u.push("list_item_open","li",1),i.markup=String.fromCharCode(d);const S=[a,0];i.map=S,f&&(i.info=u.src.slice(c,b-1));const N=u.tight,R=u.tShift[a],P=u.sCount[a],I=u.listIndent;if(u.listIndent=u.blkIndent,u.blkIndent=v,u.tight=!0,u.tShift[a]=m-u.bMarks[a],u.sCount[a]=C,m>=r&&u.isEmpty(a+1)?u.line=Math.min(u.line+2,t):u.md.block.tokenize(u,a,t,!0),(!u.tight||w)&&(s=!1),w=u.line-a>1&&u.isEmpty(u.line-1),u.blkIndent=u.listIndent,u.listIndent=I,u.tShift[a]=R,u.sCount[a]=P,u.tight=N,i=u.push("list_item_close","li",-1),i.markup=String.fromCharCode(d),a=u.line,S[1]=a,a>=t||u.sCount[a]<u.blkIndent||u.sCount[a]-u.blkIndent>=4)break;let M=!1;for(let L=0,$=E.length;L<$;L++)if(E[L](u,a,t,!0)){M=!0;break}if(M)break;if(f){if(b=kt(u,a),b<0)break;c=u.bMarks[a]+u.tShift[a]}else if(b=_t(u,a),b<0)break;if(d!==u.src.charCodeAt(b-1))break}return f?i=u.push("ordered_list_close","ol",-1):i=u.push("bullet_list_close","ul",-1),i.markup=String.fromCharCode(d),k[1]=a,u.line=a,u.parentType=D,s&&_r(u,F),!0}function yr(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e],c=e+1;if(u.sCount[e]-u.blkIndent>=4||u.src.charCodeAt(r)!==91)return!1;function i(E){const D=u.lineMax;if(E>=D||u.isEmpty(E))return null;let p=!1;if(u.sCount[E]-u.blkIndent>3&&(p=!0),u.sCount[E]<0&&(p=!0),!p){const g=u.md.block.ruler.getRules("reference"),v=u.parentType;u.parentType="reference";let S=!1;for(let N=0,R=g.length;N<R;N++)if(g[N](u,E,D,!0)){S=!0;break}if(u.parentType=v,S)return null}const C=u.bMarks[E]+u.tShift[E],m=u.eMarks[E];return u.src.slice(C,m+1)}let a=u.src.slice(r,o+1);o=a.length;let s=-1;for(r=1;r<o;r++){const E=a.charCodeAt(r);if(E===91)return!1;if(E===93){s=r;break}else if(E===10){const D=i(c);D!==null&&(a+=D,o=a.length,c++)}else if(E===92&&(r++,r<o&&a.charCodeAt(r)===10)){const D=i(c);D!==null&&(a+=D,o=a.length,c++)}}if(s<0||a.charCodeAt(s+1)!==58)return!1;for(r=s+2;r<o;r++){const E=a.charCodeAt(r);if(E===10){const D=i(c);D!==null&&(a+=D,o=a.length,c++)}else if(!z(E))break}const l=u.md.helpers.parseLinkDestination(a,r,o);if(!l.ok)return!1;const f=u.md.normalizeLink(l.str);if(!u.md.validateLink(f))return!1;r=l.pos;const x=r,b=c,d=r;for(;r<o;r++){const E=a.charCodeAt(r);if(E===10){const D=i(c);D!==null&&(a+=D,o=a.length,c++)}else if(!z(E))break}let F=u.md.helpers.parseLinkTitle(a,r,o);for(;F.can_continue;){const E=i(c);if(E===null)break;a+=E,r=o,o=a.length,c++,F=u.md.helpers.parseLinkTitle(a,r,o,F)}let k;for(r<o&&d!==r&&F.ok?(k=F.str,r=F.pos):(k="",r=x,c=b);r<o;){const E=a.charCodeAt(r);if(!z(E))break;r++}if(r<o&&a.charCodeAt(r)!==10&&k)for(k="",r=x,c=b;r<o;){const E=a.charCodeAt(r);if(!z(E))break;r++}if(r<o&&a.charCodeAt(r)!==10)return!1;const w=Vu(a.slice(1,s));return w?(n||(typeof u.env.references>"u"&&(u.env.references={}),typeof u.env.references[w]>"u"&&(u.env.references[w]={title:k,href:f}),u.line=c),!0):!1}const Cr=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vr="[a-zA-Z_:][a-zA-Z0-9:._-]*",Er="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",yt="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+vr+"(?:\\s*=\\s*"+Er+")?)")+"*\\s*\\/?>",Ct="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Dr="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",Fr="<[?][\\s\\S]*?[?]>",Ar="<![A-Za-z][^>]*>",wr="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Sr=new RegExp("^(?:"+yt+"|"+Ct+"|"+Dr+"|"+Fr+"|"+Ar+"|"+wr+")"),Br=new RegExp("^(?:"+yt+"|"+Ct+")"),_u=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Cr.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Br.source+"\\s*$"),/^$/,!1]];function Tr(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4||!u.md.options.html||u.src.charCodeAt(r)!==60)return!1;let c=u.src.slice(r,o),i=0;for(;i<_u.length&&!_u[i][0].test(c);i++);if(i===_u.length)return!1;if(n)return _u[i][2];let a=e+1;if(!_u[i][1].test(c)){for(;a<t&&!(u.sCount[a]<u.blkIndent);a++)if(r=u.bMarks[a]+u.tShift[a],o=u.eMarks[a],c=u.src.slice(r,o),_u[i][1].test(c)){c.length!==0&&a++;break}}u.line=a;const s=u.push("html_block","",0);return s.map=[e,a],s.content=u.getLines(e,a,u.blkIndent,!0),!0}function Ir(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4)return!1;let c=u.src.charCodeAt(r);if(c!==35||r>=o)return!1;let i=1;for(c=u.src.charCodeAt(++r);c===35&&r<o&&i<=6;)i++,c=u.src.charCodeAt(++r);if(i>6||r<o&&!z(c))return!1;if(n)return!0;o=u.skipSpacesBack(o,r);const a=u.skipCharsBack(o,35,r);a>r&&z(u.src.charCodeAt(a-1))&&(o=a),u.line=e+1;const s=u.push("heading_open","h"+String(i),1);s.markup="########".slice(0,i),s.map=[e,u.line];const l=u.push("inline","",0);l.content=u.src.slice(r,o).trim(),l.map=[e,u.line],l.children=[];const f=u.push("heading_close","h"+String(i),-1);return f.markup="########".slice(0,i),!0}function Nr(u,e,t){const n=u.md.block.ruler.getRules("paragraph");if(u.sCount[e]-u.blkIndent>=4)return!1;const r=u.parentType;u.parentType="paragraph";let o=0,c,i=e+1;for(;i<t&&!u.isEmpty(i);i++){if(u.sCount[i]-u.blkIndent>3)continue;if(u.sCount[i]>=u.blkIndent){let b=u.bMarks[i]+u.tShift[i];const d=u.eMarks[i];if(b<d&&(c=u.src.charCodeAt(b),(c===45||c===61)&&(b=u.skipChars(b,c),b=u.skipSpaces(b),b>=d))){o=c===61?1:2;break}}if(u.sCount[i]<0)continue;let x=!1;for(let b=0,d=n.length;b<d;b++)if(n[b](u,i,t,!0)){x=!0;break}if(x)break}if(!o)return!1;const a=u.getLines(e,i,u.blkIndent,!1).trim();u.line=i+1;const s=u.push("heading_open","h"+String(o),1);s.markup=String.fromCharCode(c),s.map=[e,u.line];const l=u.push("inline","",0);l.content=a,l.map=[e,u.line-1],l.children=[];const f=u.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(c),u.parentType=r,!0}function Or(u,e,t){const n=u.md.block.ruler.getRules("paragraph"),r=u.parentType;let o=e+1;for(u.parentType="paragraph";o<t&&!u.isEmpty(o);o++){if(u.sCount[o]-u.blkIndent>3||u.sCount[o]<0)continue;let s=!1;for(let l=0,f=n.length;l<f;l++)if(n[l](u,o,t,!0)){s=!0;break}if(s)break}const c=u.getLines(e,o,u.blkIndent,!1).trim();u.line=o;const i=u.push("paragraph_open","p",1);i.map=[e,u.line];const a=u.push("inline","",0);return a.content=c,a.map=[e,u.line],a.children=[],u.push("paragraph_close","p",-1),u.parentType=r,!0}const Hu=[["table",pr,["paragraph","reference"]],["code",br],["fence",mr,["paragraph","reference","blockquote","list"]],["blockquote",xr,["paragraph","reference","blockquote","list"]],["hr",gr,["paragraph","reference","blockquote","list"]],["list",kr,["paragraph","reference","blockquote"]],["reference",yr],["html_block",Tr,["paragraph","reference","blockquote"]],["heading",Ir,["paragraph","reference","blockquote"]],["lheading",Nr],["paragraph",Or]];function Uu(){this.ruler=new Z;for(let u=0;u<Hu.length;u++)this.ruler.push(Hu[u][0],Hu[u][1],{alt:(Hu[u][2]||[]).slice()})}Uu.prototype.tokenize=function(u,e,t){const n=this.ruler.getRules(""),r=n.length,o=u.md.options.maxNesting;let c=e,i=!1;for(;c<t&&(u.line=c=u.skipEmptyLines(c),!(c>=t||u.sCount[c]<u.blkIndent));){if(u.level>=o){u.line=t;break}const a=u.line;let s=!1;for(let l=0;l<r;l++)if(s=n[l](u,c,t,!1),s){if(a>=u.line)throw new Error("block rule didn't increment state.line");break}if(!s)throw new Error("none of the block rules matched");u.tight=!i,u.isEmpty(u.line-1)&&(i=!0),c=u.line,c<t&&u.isEmpty(c)&&(i=!0,c++,u.line=c)}},Uu.prototype.parse=function(u,e,t,n){if(!u)return;const r=new this.State(u,e,t,n);this.tokenize(r,r.line,r.lineMax)},Uu.prototype.State=eu;function wu(u,e,t,n){this.src=u,this.env=t,this.md=e,this.tokens=n,this.tokens_meta=Array(n.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}wu.prototype.pushPending=function(){const u=new K("text","",0);return u.content=this.pending,u.level=this.pendingLevel,this.tokens.push(u),this.pending="",u},wu.prototype.push=function(u,e,t){this.pending&&this.pushPending();const n=new K(u,e,t);let r=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(r),n},wu.prototype.scanDelims=function(u,e){const t=this.posMax,n=this.src.charCodeAt(u),r=u>0?this.src.charCodeAt(u-1):32;let o=u;for(;o<t&&this.src.charCodeAt(o)===n;)o++;const c=o-u,i=o<t?this.src.charCodeAt(o):32,a=Au(r)||Fu(String.fromCharCode(r)),s=Au(i)||Fu(String.fromCharCode(i)),l=Du(r),f=Du(i),x=!f&&(!s||l||a),b=!l&&(!a||f||s);return{can_open:x&&(e||!b||a),can_close:b&&(e||!x||s),length:c}},wu.prototype.Token=K;function Lr(u){switch(u){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Mr(u,e){let t=u.pos;for(;t<u.posMax&&!Lr(u.src.charCodeAt(t));)t++;return t===u.pos?!1:(e||(u.pending+=u.src.slice(u.pos,t)),u.pos=t,!0)}const Pr=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function jr(u,e){if(!u.md.options.linkify||u.linkLevel>0)return!1;const t=u.pos,n=u.posMax;if(t+3>n||u.src.charCodeAt(t)!==58||u.src.charCodeAt(t+1)!==47||u.src.charCodeAt(t+2)!==47)return!1;const r=u.pending.match(Pr);if(!r)return!1;const o=r[1],c=u.md.linkify.matchAtStart(u.src.slice(t-o.length));if(!c)return!1;let i=c.url;if(i.length<=o.length)return!1;i=i.replace(/\*+$/,"");const a=u.md.normalizeLink(i);if(!u.md.validateLink(a))return!1;if(!e){u.pending=u.pending.slice(0,-o.length);const s=u.push("link_open","a",1);s.attrs=[["href",a]],s.markup="linkify",s.info="auto";const l=u.push("text","",0);l.content=u.md.normalizeLinkText(i);const f=u.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return u.pos+=i.length-o.length,!0}function zr(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==10)return!1;const n=u.pending.length-1,r=u.posMax;if(!e)if(n>=0&&u.pending.charCodeAt(n)===32)if(n>=1&&u.pending.charCodeAt(n-1)===32){let o=n-1;for(;o>=1&&u.pending.charCodeAt(o-1)===32;)o--;u.pending=u.pending.slice(0,o),u.push("hardbreak","br",0)}else u.pending=u.pending.slice(0,-1),u.push("softbreak","br",0);else u.push("softbreak","br",0);for(t++;t<r&&z(u.src.charCodeAt(t));)t++;return u.pos=t,!0}const pe=[];for(let u=0;u<256;u++)pe.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(u){pe[u.charCodeAt(0)]=1});function Rr(u,e){let t=u.pos;const n=u.posMax;if(u.src.charCodeAt(t)!==92||(t++,t>=n))return!1;let r=u.src.charCodeAt(t);if(r===10){for(e||u.push("hardbreak","br",0),t++;t<n&&(r=u.src.charCodeAt(t),!!z(r));)t++;return u.pos=t,!0}let o=u.src[t];if(r>=55296&&r<=56319&&t+1<n){const i=u.src.charCodeAt(t+1);i>=56320&&i<=57343&&(o+=u.src[t+1],t++)}const c="\\"+o;if(!e){const i=u.push("text_special","",0);r<256&&pe[r]!==0?i.content=o:i.content=c,i.markup=c,i.info="escape"}return u.pos=t+1,!0}function qr(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==96)return!1;const r=t;t++;const o=u.posMax;for(;t<o&&u.src.charCodeAt(t)===96;)t++;const c=u.src.slice(r,t),i=c.length;if(u.backticksScanned&&(u.backticks[i]||0)<=r)return e||(u.pending+=c),u.pos+=i,!0;let a=t,s;for(;(s=u.src.indexOf("`",a))!==-1;){for(a=s+1;a<o&&u.src.charCodeAt(a)===96;)a++;const l=a-s;if(l===i){if(!e){const f=u.push("code_inline","code",0);f.markup=c,f.content=u.src.slice(t,s).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return u.pos=a,!0}u.backticks[l]=s}return u.backticksScanned=!0,e||(u.pending+=c),u.pos+=i,!0}function Vr(u,e){const t=u.pos,n=u.src.charCodeAt(t);if(e||n!==126)return!1;const r=u.scanDelims(u.pos,!0);let o=r.length;const c=String.fromCharCode(n);if(o<2)return!1;let i;o%2&&(i=u.push("text","",0),i.content=c,o--);for(let a=0;a<o;a+=2)i=u.push("text","",0),i.content=c+c,u.delimiters.push({marker:n,length:0,token:u.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return u.pos+=r.length,!0}function vt(u,e){let t;const n=[],r=e.length;for(let o=0;o<r;o++){const c=e[o];if(c.marker!==126||c.end===-1)continue;const i=e[c.end];t=u.tokens[c.token],t.type="s_open",t.tag="s",t.nesting=1,t.markup="~~",t.content="",t=u.tokens[i.token],t.type="s_close",t.tag="s",t.nesting=-1,t.markup="~~",t.content="",u.tokens[i.token-1].type==="text"&&u.tokens[i.token-1].content==="~"&&n.push(i.token-1)}for(;n.length;){const o=n.pop();let c=o+1;for(;c<u.tokens.length&&u.tokens[c].type==="s_close";)c++;c--,o!==c&&(t=u.tokens[c],u.tokens[c]=u.tokens[o],u.tokens[o]=t)}}function $r(u){const e=u.tokens_meta,t=u.tokens_meta.length;vt(u,u.delimiters);for(let n=0;n<t;n++)e[n]&&e[n].delimiters&&vt(u,e[n].delimiters)}const Et={tokenize:Vr,postProcess:$r};function Hr(u,e){const t=u.pos,n=u.src.charCodeAt(t);if(e||n!==95&&n!==42)return!1;const r=u.scanDelims(u.pos,n===42);for(let o=0;o<r.length;o++){const c=u.push("text","",0);c.content=String.fromCharCode(n),u.delimiters.push({marker:n,length:r.length,token:u.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return u.pos+=r.length,!0}function Dt(u,e){const t=e.length;for(let n=t-1;n>=0;n--){const r=e[n];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=e[r.end],c=n>0&&e[n-1].end===r.end+1&&e[n-1].marker===r.marker&&e[n-1].token===r.token-1&&e[r.end+1].token===o.token+1,i=String.fromCharCode(r.marker),a=u.tokens[r.token];a.type=c?"strong_open":"em_open",a.tag=c?"strong":"em",a.nesting=1,a.markup=c?i+i:i,a.content="";const s=u.tokens[o.token];s.type=c?"strong_close":"em_close",s.tag=c?"strong":"em",s.nesting=-1,s.markup=c?i+i:i,s.content="",c&&(u.tokens[e[n-1].token].content="",u.tokens[e[r.end+1].token].content="",n--)}}function Ur(u){const e=u.tokens_meta,t=u.tokens_meta.length;Dt(u,u.delimiters);for(let n=0;n<t;n++)e[n]&&e[n].delimiters&&Dt(u,e[n].delimiters)}const Ft={tokenize:Hr,postProcess:Ur};function Zr(u,e){let t,n,r,o,c="",i="",a=u.pos,s=!0;if(u.src.charCodeAt(u.pos)!==91)return!1;const l=u.pos,f=u.posMax,x=u.pos+1,b=u.md.helpers.parseLinkLabel(u,u.pos,!0);if(b<0)return!1;let d=b+1;if(d<f&&u.src.charCodeAt(d)===40){for(s=!1,d++;d<f&&(t=u.src.charCodeAt(d),!(!z(t)&&t!==10));d++);if(d>=f)return!1;if(a=d,r=u.md.helpers.parseLinkDestination(u.src,d,u.posMax),r.ok){for(c=u.md.normalizeLink(r.str),u.md.validateLink(c)?d=r.pos:c="",a=d;d<f&&(t=u.src.charCodeAt(d),!(!z(t)&&t!==10));d++);if(r=u.md.helpers.parseLinkTitle(u.src,d,u.posMax),d<f&&a!==d&&r.ok)for(i=r.str,d=r.pos;d<f&&(t=u.src.charCodeAt(d),!(!z(t)&&t!==10));d++);}(d>=f||u.src.charCodeAt(d)!==41)&&(s=!0),d++}if(s){if(typeof u.env.references>"u")return!1;if(d<f&&u.src.charCodeAt(d)===91?(a=d+1,d=u.md.helpers.parseLinkLabel(u,d),d>=0?n=u.src.slice(a,d++):d=b+1):d=b+1,n||(n=u.src.slice(x,b)),o=u.env.references[Vu(n)],!o)return u.pos=l,!1;c=o.href,i=o.title}if(!e){u.pos=x,u.posMax=b;const F=u.push("link_open","a",1),k=[["href",c]];F.attrs=k,i&&k.push(["title",i]),u.linkLevel++,u.md.inline.tokenize(u),u.linkLevel--,u.push("link_close","a",-1)}return u.pos=d,u.posMax=f,!0}function Gr(u,e){let t,n,r,o,c,i,a,s,l="";const f=u.pos,x=u.posMax;if(u.src.charCodeAt(u.pos)!==33||u.src.charCodeAt(u.pos+1)!==91)return!1;const b=u.pos+2,d=u.md.helpers.parseLinkLabel(u,u.pos+1,!1);if(d<0)return!1;if(o=d+1,o<x&&u.src.charCodeAt(o)===40){for(o++;o<x&&(t=u.src.charCodeAt(o),!(!z(t)&&t!==10));o++);if(o>=x)return!1;for(s=o,i=u.md.helpers.parseLinkDestination(u.src,o,u.posMax),i.ok&&(l=u.md.normalizeLink(i.str),u.md.validateLink(l)?o=i.pos:l=""),s=o;o<x&&(t=u.src.charCodeAt(o),!(!z(t)&&t!==10));o++);if(i=u.md.helpers.parseLinkTitle(u.src,o,u.posMax),o<x&&s!==o&&i.ok)for(a=i.str,o=i.pos;o<x&&(t=u.src.charCodeAt(o),!(!z(t)&&t!==10));o++);else a="";if(o>=x||u.src.charCodeAt(o)!==41)return u.pos=f,!1;o++}else{if(typeof u.env.references>"u")return!1;if(o<x&&u.src.charCodeAt(o)===91?(s=o+1,o=u.md.helpers.parseLinkLabel(u,o),o>=0?r=u.src.slice(s,o++):o=d+1):o=d+1,r||(r=u.src.slice(b,d)),c=u.env.references[Vu(r)],!c)return u.pos=f,!1;l=c.href,a=c.title}if(!e){n=u.src.slice(b,d);const F=[];u.md.inline.parse(n,u.md,u.env,F);const k=u.push("image","img",0),w=[["src",l],["alt",""]];k.attrs=w,k.children=F,k.content=n,a&&w.push(["title",a])}return u.pos=o,u.posMax=x,!0}const Wr=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Qr=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Jr(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==60)return!1;const n=u.pos,r=u.posMax;for(;;){if(++t>=r)return!1;const c=u.src.charCodeAt(t);if(c===60)return!1;if(c===62)break}const o=u.src.slice(n+1,t);if(Qr.test(o)){const c=u.md.normalizeLink(o);if(!u.md.validateLink(c))return!1;if(!e){const i=u.push("link_open","a",1);i.attrs=[["href",c]],i.markup="autolink",i.info="auto";const a=u.push("text","",0);a.content=u.md.normalizeLinkText(o);const s=u.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return u.pos+=o.length+2,!0}if(Wr.test(o)){const c=u.md.normalizeLink("mailto:"+o);if(!u.md.validateLink(c))return!1;if(!e){const i=u.push("link_open","a",1);i.attrs=[["href",c]],i.markup="autolink",i.info="auto";const a=u.push("text","",0);a.content=u.md.normalizeLinkText(o);const s=u.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return u.pos+=o.length+2,!0}return!1}function Kr(u){return/^<a[>\s]/i.test(u)}function Yr(u){return/^<\/a\s*>/i.test(u)}function Xr(u){const e=u|32;return e>=97&&e<=122}function uo(u,e){if(!u.md.options.html)return!1;const t=u.posMax,n=u.pos;if(u.src.charCodeAt(n)!==60||n+2>=t)return!1;const r=u.src.charCodeAt(n+1);if(r!==33&&r!==63&&r!==47&&!Xr(r))return!1;const o=u.src.slice(n).match(Sr);if(!o)return!1;if(!e){const c=u.push("html_inline","",0);c.content=o[0],Kr(c.content)&&u.linkLevel++,Yr(c.content)&&u.linkLevel--}return u.pos+=o[0].length,!0}const eo=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,to=/^&([a-z][a-z0-9]{1,31});/i;function no(u,e){const t=u.pos,n=u.posMax;if(u.src.charCodeAt(t)!==38||t+1>=n)return!1;if(u.src.charCodeAt(t+1)===35){const o=u.src.slice(t).match(eo);if(o){if(!e){const c=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=u.push("text_special","",0);i.content=le(c)?qu(c):qu(65533),i.markup=o[0],i.info="entity"}return u.pos+=o[0].length,!0}}else{const o=u.src.slice(t).match(to);if(o){const c=ft(o[0]);if(c!==o[0]){if(!e){const i=u.push("text_special","",0);i.content=c,i.markup=o[0],i.info="entity"}return u.pos+=o[0].length,!0}}}return!1}function At(u){const e={},t=u.length;if(!t)return;let n=0,r=-2;const o=[];for(let c=0;c<t;c++){const i=u[c];if(o.push(0),(u[n].marker!==i.marker||r!==i.token-1)&&(n=c),r=i.token,i.length=i.length||0,!i.close)continue;e.hasOwnProperty(i.marker)||(e[i.marker]=[-1,-1,-1,-1,-1,-1]);const a=e[i.marker][(i.open?3:0)+i.length%3];let s=n-o[n]-1,l=s;for(;s>a;s-=o[s]+1){const f=u[s];if(f.marker===i.marker&&f.open&&f.end<0){let x=!1;if((f.close||i.open)&&(f.length+i.length)%3===0&&(f.length%3!==0||i.length%3!==0)&&(x=!0),!x){const b=s>0&&!u[s-1].open?o[s-1]+1:0;o[c]=c-s+b,o[s]=b,i.open=!1,f.end=c,f.close=!1,l=-1,r=-2;break}}}l!==-1&&(e[i.marker][(i.open?3:0)+(i.length||0)%3]=l)}}function ro(u){const e=u.tokens_meta,t=u.tokens_meta.length;At(u.delimiters);for(let n=0;n<t;n++)e[n]&&e[n].delimiters&&At(e[n].delimiters)}function oo(u){let e,t,n=0;const r=u.tokens,o=u.tokens.length;for(e=t=0;e<o;e++)r[e].nesting<0&&n--,r[e].level=n,r[e].nesting>0&&n++,r[e].type==="text"&&e+1<o&&r[e+1].type==="text"?r[e+1].content=r[e].content+r[e+1].content:(e!==t&&(r[t]=r[e]),t++);e!==t&&(r.length=t)}const be=[["text",Mr],["linkify",jr],["newline",zr],["escape",Rr],["backticks",qr],["strikethrough",Et.tokenize],["emphasis",Ft.tokenize],["link",Zr],["image",Gr],["autolink",Jr],["html_inline",uo],["entity",no]],me=[["balance_pairs",ro],["strikethrough",Et.postProcess],["emphasis",Ft.postProcess],["fragments_join",oo]];function Su(){this.ruler=new Z;for(let u=0;u<be.length;u++)this.ruler.push(be[u][0],be[u][1]);this.ruler2=new Z;for(let u=0;u<me.length;u++)this.ruler2.push(me[u][0],me[u][1])}Su.prototype.skipToken=function(u){const e=u.pos,t=this.ruler.getRules(""),n=t.length,r=u.md.options.maxNesting,o=u.cache;if(typeof o[e]<"u"){u.pos=o[e];return}let c=!1;if(u.level<r){for(let i=0;i<n;i++)if(u.level++,c=t[i](u,!0),u.level--,c){if(e>=u.pos)throw new Error("inline rule didn't increment state.pos");break}}else u.pos=u.posMax;c||u.pos++,o[e]=u.pos},Su.prototype.tokenize=function(u){const e=this.ruler.getRules(""),t=e.length,n=u.posMax,r=u.md.options.maxNesting;for(;u.pos<n;){const o=u.pos;let c=!1;if(u.level<r){for(let i=0;i<t;i++)if(c=e[i](u,!1),c){if(o>=u.pos)throw new Error("inline rule didn't increment state.pos");break}}if(c){if(u.pos>=n)break;continue}u.pending+=u.src[u.pos++]}u.pending&&u.pushPending()},Su.prototype.parse=function(u,e,t,n){const r=new this.State(u,e,t,n);this.tokenize(r);const o=this.ruler2.getRules(""),c=o.length;for(let i=0;i<c;i++)o[i](r)},Su.prototype.State=wu;function co(u){const e={};u=u||{},e.src_Any=ct.source,e.src_Cc=it.source,e.src_Z=st.source,e.src_P=ce.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const t="[><|]";return e.src_pseudo_letter="(?:(?!"+t+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+t+"|"+e.src_ZPCc+")(?!"+(u["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+t+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(u["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function xe(u){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){u[n]=t[n]})}),u}function Zu(u){return Object.prototype.toString.call(u)}function io(u){return Zu(u)==="[object String]"}function ao(u){return Zu(u)==="[object Object]"}function so(u){return Zu(u)==="[object RegExp]"}function wt(u){return Zu(u)==="[object Function]"}function lo(u){return u.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const St={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function fo(u){return Object.keys(u||{}).reduce(function(e,t){return e||St.hasOwnProperty(t)},!1)}const ho={"http:":{validate:function(u,e,t){const n=u.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(n)?n.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(u,e,t){const n=u.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(n)?e>=3&&u[e-3]===":"||e>=3&&u[e-3]==="/"?0:n.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(u,e,t){const n=u.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(n)?n.match(t.re.mailto)[0].length:0}}},po="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",bo="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function mo(u){u.__index__=-1,u.__text_cache__=""}function xo(u){return function(e,t){const n=e.slice(t);return u.test(n)?n.match(u)[0].length:0}}function Bt(){return function(u,e){e.normalize(u)}}function Gu(u){const e=u.re=co(u.__opts__),t=u.__tlds__.slice();u.onCompile(),u.__tlds_replaced__||t.push(po),t.push(e.src_xn),e.src_tlds=t.join("|");function n(i){return i.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");const r=[];u.__compiled__={};function o(i,a){throw new Error('(LinkifyIt) Invalid schema "'+i+'": '+a)}Object.keys(u.__schemas__).forEach(function(i){const a=u.__schemas__[i];if(a===null)return;const s={validate:null,link:null};if(u.__compiled__[i]=s,ao(a)){so(a.validate)?s.validate=xo(a.validate):wt(a.validate)?s.validate=a.validate:o(i,a),wt(a.normalize)?s.normalize=a.normalize:a.normalize?o(i,a):s.normalize=Bt();return}if(io(a)){r.push(i);return}o(i,a)}),r.forEach(function(i){u.__compiled__[u.__schemas__[i]]&&(u.__compiled__[i].validate=u.__compiled__[u.__schemas__[i]].validate,u.__compiled__[i].normalize=u.__compiled__[u.__schemas__[i]].normalize)}),u.__compiled__[""]={validate:null,normalize:Bt()};const c=Object.keys(u.__compiled__).filter(function(i){return i.length>0&&u.__compiled__[i]}).map(lo).join("|");u.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","i"),u.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","ig"),u.re.schema_at_start=RegExp("^"+u.re.schema_search.source,"i"),u.re.pretest=RegExp("("+u.re.schema_test.source+")|("+u.re.host_fuzzy_test.source+")|@","i"),mo(u)}function go(u,e){const t=u.__index__,n=u.__last_index__,r=u.__text_cache__.slice(t,n);this.schema=u.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=n+e,this.raw=r,this.text=r,this.url=r}function ge(u,e){const t=new go(u,e);return u.__compiled__[t.schema].normalize(t,u),t}function G(u,e){if(!(this instanceof G))return new G(u,e);e||fo(u)&&(e=u,u={}),this.__opts__=xe({},St,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=xe({},ho,u),this.__compiled__={},this.__tlds__=bo,this.__tlds_replaced__=!1,this.re={},Gu(this)}G.prototype.add=function(e,t){return this.__schemas__[e]=t,Gu(this),this},G.prototype.set=function(e){return this.__opts__=xe(this.__opts__,e),this},G.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,o,c,i,a,s,l;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(t=a.exec(e))!==null;)if(o=this.testSchemaAt(e,t[2],a.lastIndex),o){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=e.search(this.re.host_fuzzy_test),s>=0&&(this.__index__<0||s<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(c=n.index+n[1].length,(this.__index__<0||c<this.__index__)&&(this.__schema__="",this.__index__=c,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(l=e.indexOf("@"),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(c=r.index+r[1].length,i=r.index+r[0].length,(this.__index__<0||c<this.__index__||c===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=c,this.__last_index__=i))),this.__index__>=0},G.prototype.pretest=function(e){return this.re.pretest.test(e)},G.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},G.prototype.match=function(e){const t=[];let n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(ge(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(ge(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},G.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,ge(this,0)):null},G.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(n,r,o){return n!==o[r-1]}).reverse(),Gu(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Gu(this),this)},G.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)},G.prototype.onCompile=function(){};const ku=2147483647,tu=36,_e=1,Bu=26,_o=38,ko=700,Tt=72,It=128,Nt="-",yo=/^xn--/,Co=/[^\0-\x7F]/,vo=/[\x2E\u3002\uFF0E\uFF61]/g,Eo={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ke=tu-_e,nu=Math.floor,ye=String.fromCharCode;function fu(u){throw new RangeError(Eo[u])}function Do(u,e){const t=[];let n=u.length;for(;n--;)t[n]=e(u[n]);return t}function Ot(u,e){const t=u.split("@");let n="";t.length>1&&(n=t[0]+"@",u=t[1]),u=u.replace(vo,".");const r=u.split("."),o=Do(r,e).join(".");return n+o}function Lt(u){const e=[];let t=0;const n=u.length;for(;t<n;){const r=u.charCodeAt(t++);if(r>=55296&&r<=56319&&t<n){const o=u.charCodeAt(t++);(o&64512)==56320?e.push(((r&1023)<<10)+(o&1023)+65536):(e.push(r),t--)}else e.push(r)}return e}const Fo=u=>String.fromCodePoint(...u),Ao=function(u){return u>=48&&u<58?26+(u-48):u>=65&&u<91?u-65:u>=97&&u<123?u-97:tu},Mt=function(u,e){return u+22+75*(u<26)-((e!=0)<<5)},Pt=function(u,e,t){let n=0;for(u=t?nu(u/ko):u>>1,u+=nu(u/e);u>ke*Bu>>1;n+=tu)u=nu(u/ke);return nu(n+(ke+1)*u/(u+_o))},jt=function(u){const e=[],t=u.length;let n=0,r=It,o=Tt,c=u.lastIndexOf(Nt);c<0&&(c=0);for(let i=0;i<c;++i)u.charCodeAt(i)>=128&&fu("not-basic"),e.push(u.charCodeAt(i));for(let i=c>0?c+1:0;i<t;){const a=n;for(let l=1,f=tu;;f+=tu){i>=t&&fu("invalid-input");const x=Ao(u.charCodeAt(i++));x>=tu&&fu("invalid-input"),x>nu((ku-n)/l)&&fu("overflow"),n+=x*l;const b=f<=o?_e:f>=o+Bu?Bu:f-o;if(x<b)break;const d=tu-b;l>nu(ku/d)&&fu("overflow"),l*=d}const s=e.length+1;o=Pt(n-a,s,a==0),nu(n/s)>ku-r&&fu("overflow"),r+=nu(n/s),n%=s,e.splice(n++,0,r)}return String.fromCodePoint(...e)},zt=function(u){const e=[];u=Lt(u);const t=u.length;let n=It,r=0,o=Tt;for(const a of u)a<128&&e.push(ye(a));const c=e.length;let i=c;for(c&&e.push(Nt);i<t;){let a=ku;for(const l of u)l>=n&&l<a&&(a=l);const s=i+1;a-n>nu((ku-r)/s)&&fu("overflow"),r+=(a-n)*s,n=a;for(const l of u)if(l<n&&++r>ku&&fu("overflow"),l===n){let f=r;for(let x=tu;;x+=tu){const b=x<=o?_e:x>=o+Bu?Bu:x-o;if(f<b)break;const d=f-b,F=tu-b;e.push(ye(Mt(b+d%F,0))),f=nu(d/F)}e.push(ye(Mt(f,0))),o=Pt(r,s,i===c),r=0,++i}++r,++n}return e.join("")},Rt={version:"2.3.1",ucs2:{decode:Lt,encode:Fo},decode:jt,encode:zt,toASCII:function(u){return Ot(u,function(e){return Co.test(e)?"xn--"+zt(e):e})},toUnicode:function(u){return Ot(u,function(e){return yo.test(e)?jt(e.slice(4).toLowerCase()):e})}},wo={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},So=/^(vbscript|javascript|file|data):/,Bo=/^data:image\/(gif|png|jpeg|webp);/;function To(u){const e=u.trim().toLowerCase();return So.test(e)?Bo.test(e):!0}const qt=["http:","https:","mailto:"];function Io(u){const e=oe(u,!0);if(e.hostname&&(!e.protocol||qt.indexOf(e.protocol)>=0))try{e.hostname=Rt.toASCII(e.hostname)}catch{}return Eu(re(e))}function No(u){const e=oe(u,!0);if(e.hostname&&(!e.protocol||qt.indexOf(e.protocol)>=0))try{e.hostname=Rt.toUnicode(e.hostname)}catch{}return mu(re(e),mu.defaultChars+"%")}function J(u,e){if(!(this instanceof J))return new J(u,e);e||se(u)||(e=u||{},u="default"),this.inline=new Su,this.block=new Uu,this.core=new de,this.renderer=new gu,this.linkify=new G,this.validateLink=To,this.normalizeLink=Io,this.normalizeLinkText=No,this.utils=$n,this.helpers=Ru({},Gn),this.options={},this.configure(u),e&&this.set(e)}J.prototype.set=function(u){return Ru(this.options,u),this},J.prototype.configure=function(u){const e=this;if(se(u)){const t=u;if(u=wo[t],!u)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!u)throw new Error("Wrong `markdown-it` preset, can't be empty");return u.options&&e.set(u.options),u.components&&Object.keys(u.components).forEach(function(t){u.components[t].rules&&e[t].ruler.enableOnly(u.components[t].rules),u.components[t].rules2&&e[t].ruler2.enableOnly(u.components[t].rules2)}),this},J.prototype.enable=function(u,e){let t=[];Array.isArray(u)||(u=[u]),["core","block","inline"].forEach(function(r){t=t.concat(this[r].ruler.enable(u,!0))},this),t=t.concat(this.inline.ruler2.enable(u,!0));const n=u.filter(function(r){return t.indexOf(r)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},J.prototype.disable=function(u,e){let t=[];Array.isArray(u)||(u=[u]),["core","block","inline"].forEach(function(r){t=t.concat(this[r].ruler.disable(u,!0))},this),t=t.concat(this.inline.ruler2.disable(u,!0));const n=u.filter(function(r){return t.indexOf(r)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},J.prototype.use=function(u){const e=[this].concat(Array.prototype.slice.call(arguments,1));return u.apply(u,e),this},J.prototype.parse=function(u,e){if(typeof u!="string")throw new Error("Input data should be a String");const t=new this.core.State(u,this,e);return this.core.process(t),t.tokens},J.prototype.render=function(u,e){return e=e||{},this.renderer.render(this.parse(u,e),this.options,e)},J.prototype.parseInline=function(u,e){const t=new this.core.State(u,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens},J.prototype.renderInline=function(u,e){return e=e||{},this.renderer.render(this.parseInline(u,e),this.options,e)};var Oo={207:(u,e,t)=>{u.exports=t(452)},452:u=>{var e=(function(t){var n,r=Object.prototype,o=r.hasOwnProperty,c=typeof Symbol=="function"?Symbol:{},i=c.iterator||"@@iterator",a=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function l(y,_,T){return Object.defineProperty(y,_,{value:T,enumerable:!0,configurable:!0,writable:!0}),y[_]}try{l({},"")}catch{l=function(_,T,O){return _[T]=O}}function f(y,_,T,O){var B=_&&_.prototype instanceof E?_:E,H=Object.create(B.prototype),U=new M(O||[]);return H._invoke=(function(X,cu,j){var Q=b;return function(ru,n0){if(Q===F)throw new Error("Generator is already running");if(Q===k){if(ru==="throw")throw n0;return $()}for(j.method=ru,j.arg=n0;;){var r0=j.delegate;if(r0){var Se=R(r0,j);if(Se){if(Se===w)continue;return Se}}if(j.method==="next")j.sent=j._sent=j.arg;else if(j.method==="throw"){if(Q===b)throw Q=k,j.arg;j.dispatchException(j.arg)}else j.method==="return"&&j.abrupt("return",j.arg);Q=F;var Iu=x(X,cu,j);if(Iu.type==="normal"){if(Q=j.done?k:d,Iu.arg===w)continue;return{value:Iu.arg,done:j.done}}Iu.type==="throw"&&(Q=k,j.method="throw",j.arg=Iu.arg)}}})(y,T,U),H}function x(y,_,T){try{return{type:"normal",arg:y.call(_,T)}}catch(O){return{type:"throw",arg:O}}}t.wrap=f;var b="suspendedStart",d="suspendedYield",F="executing",k="completed",w={};function E(){}function D(){}function p(){}var C={};l(C,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(L([])));g&&g!==r&&o.call(g,i)&&(C=g);var v=p.prototype=E.prototype=Object.create(C);function S(y){["next","throw","return"].forEach((function(_){l(y,_,(function(T){return this._invoke(_,T)}))}))}function N(y,_){function T(B,H,U,X){var cu=x(y[B],y,H);if(cu.type!=="throw"){var j=cu.arg,Q=j.value;return Q&&typeof Q=="object"&&o.call(Q,"__await")?_.resolve(Q.__await).then((function(ru){T("next",ru,U,X)}),(function(ru){T("throw",ru,U,X)})):_.resolve(Q).then((function(ru){j.value=ru,U(j)}),(function(ru){return T("throw",ru,U,X)}))}X(cu.arg)}var O;this._invoke=function(B,H){function U(){return new _((function(X,cu){T(B,H,X,cu)}))}return O=O?O.then(U,U):U()}}function R(y,_){var T=y.iterator[_.method];if(T===n){if(_.delegate=null,_.method==="throw"){if(y.iterator.return&&(_.method="return",_.arg=n,R(y,_),_.method==="throw"))return w;_.method="throw",_.arg=new TypeError("The iterator does not provide a 'throw' method")}return w}var O=x(T,y.iterator,_.arg);if(O.type==="throw")return _.method="throw",_.arg=O.arg,_.delegate=null,w;var B=O.arg;return B?B.done?(_[y.resultName]=B.value,_.next=y.nextLoc,_.method!=="return"&&(_.method="next",_.arg=n),_.delegate=null,w):B:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,w)}function P(y){var _={tryLoc:y[0]};1 in y&&(_.catchLoc=y[1]),2 in y&&(_.finallyLoc=y[2],_.afterLoc=y[3]),this.tryEntries.push(_)}function I(y){var _=y.completion||{};_.type="normal",delete _.arg,y.completion=_}function M(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(P,this),this.reset(!0)}function L(y){if(y){var _=y[i];if(_)return _.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var T=-1,O=function B(){for(;++T<y.length;)if(o.call(y,T))return B.value=y[T],B.done=!1,B;return B.value=n,B.done=!0,B};return O.next=O}}return{next:$}}function $(){return{value:n,done:!0}}return D.prototype=p,l(v,"constructor",p),l(p,"constructor",D),D.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(y){var _=typeof y=="function"&&y.constructor;return!!_&&(_===D||(_.displayName||_.name)==="GeneratorFunction")},t.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,p):(y.__proto__=p,l(y,s,"GeneratorFunction")),y.prototype=Object.create(v),y},t.awrap=function(y){return{__await:y}},S(N.prototype),l(N.prototype,a,(function(){return this})),t.AsyncIterator=N,t.async=function(y,_,T,O,B){B===void 0&&(B=Promise);var H=new N(f(y,_,T,O),B);return t.isGeneratorFunction(_)?H:H.next().then((function(U){return U.done?U.value:H.next()}))},S(v),l(v,s,"Generator"),l(v,i,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),t.keys=function(y){var _=[];for(var T in y)_.push(T);return _.reverse(),function O(){for(;_.length;){var B=_.pop();if(B in y)return O.value=B,O.done=!1,O}return O.done=!0,O}},t.values=L,M.prototype={constructor:M,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(I),!y)for(var _ in this)_.charAt(0)==="t"&&o.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=n)},stop:function(){this.done=!0;var y=this.tryEntries[0].completion;if(y.type==="throw")throw y.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var _=this;function T(cu,j){return H.type="throw",H.arg=y,_.next=cu,j&&(_.method="next",_.arg=n),!!j}for(var O=this.tryEntries.length-1;O>=0;--O){var B=this.tryEntries[O],H=B.completion;if(B.tryLoc==="root")return T("end");if(B.tryLoc<=this.prev){var U=o.call(B,"catchLoc"),X=o.call(B,"finallyLoc");if(U&&X){if(this.prev<B.catchLoc)return T(B.catchLoc,!0);if(this.prev<B.finallyLoc)return T(B.finallyLoc)}else if(U){if(this.prev<B.catchLoc)return T(B.catchLoc,!0)}else{if(!X)throw new Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return T(B.finallyLoc)}}}},abrupt:function(y,_){for(var T=this.tryEntries.length-1;T>=0;--T){var O=this.tryEntries[T];if(O.tryLoc<=this.prev&&o.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var B=O;break}}B&&(y==="break"||y==="continue")&&B.tryLoc<=_&&_<=B.finallyLoc&&(B=null);var H=B?B.completion:{};return H.type=y,H.arg=_,B?(this.method="next",this.next=B.finallyLoc,w):this.complete(H)},complete:function(y,_){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&_&&(this.next=_),w},finish:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var T=this.tryEntries[_];if(T.finallyLoc===y)return this.complete(T.completion,T.afterLoc),I(T),w}},catch:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var T=this.tryEntries[_];if(T.tryLoc===y){var O=T.completion;if(O.type==="throw"){var B=O.arg;I(T)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(y,_,T){return this.delegate={iterator:L(y),resultName:_,nextLoc:T},this.method==="next"&&(this.arg=n),w}},t})(u.exports);try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},Vt={};function Y(u){var e=Vt[u];if(e!==void 0)return e.exports;var t=Vt[u]={exports:{}};return Oo[u](t,t.exports,Y),t.exports}Y.n=u=>{var e=u&&u.__esModule?()=>u.default:()=>u;return Y.d(e,{a:e}),e},Y.d=(u,e)=>{for(var t in e)Y.o(e,t)&&!Y.o(u,t)&&Object.defineProperty(u,t,{enumerable:!0,get:e[t]})},Y.o=(u,e)=>Object.prototype.hasOwnProperty.call(u,e);var $t={};function Ce(u,e){(e==null||e>u.length)&&(e=u.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=u[t];return n}function Ht(u,e){if(u){if(typeof u=="string")return Ce(u,e);var t=Object.prototype.toString.call(u).slice(8,-1);return t==="Object"&&u.constructor&&(t=u.constructor.name),t==="Map"||t==="Set"?Array.from(u):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ce(u,e):void 0}}function Wu(u){return(function(e){if(Array.isArray(e))return Ce(e)})(u)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(u)||Ht(u)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
17
17
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Tu(u,e,t){return e in u?Object.defineProperty(u,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):u[e]=t,u}Y.d($t,{A:()=>Ro});const A=(Ut={Fragment:()=>ou.Fragment,computed:()=>ou.computed,createTextVNode:()=>ou.createTextVNode,createVNode:()=>ou.createVNode,defineComponent:()=>ou.defineComponent,reactive:()=>ou.reactive,ref:()=>ou.ref,watch:()=>ou.watch,watchEffect:()=>ou.watchEffect},ve={},Y.d(ve,Ut),ve),Lo=(0,A.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var u=this.data,e=this.onClick;return(0,A.createVNode)("span",{class:"vjs-tree-brackets",onClick:e},[u])}}),Mo=(0,A.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(u,e){var t=e.emit;return{uiType:(0,A.computed)((function(){return u.isMultiple?"checkbox":"radio"})),model:(0,A.computed)({get:function(){return u.checked},set:function(n){return t("update:modelValue",n)}})}},render:function(){var u=this.uiType,e=this.model,t=this.$emit;return(0,A.createVNode)("label",{class:["vjs-check-controller",e?"is-checked":""],onClick:function(n){return n.stopPropagation()}},[(0,A.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(u)},null),(0,A.createVNode)("input",{checked:e,class:"vjs-check-controller-original is-".concat(u),type:u,onChange:function(){return t("change",e)}},null)])}}),Po=(0,A.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var u=this.nodeType,e=this.onClick,t=u==="objectStart"||u==="arrayStart";return t||u==="objectCollapsed"||u==="arrayCollapsed"?(0,A.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(t?"open":"close"),onClick:e},[(0,A.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,A.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var Ut,ve;function Ee(u){return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(u)}function Zt(u){return Object.prototype.toString.call(u).slice(8,-1).toLowerCase()}function du(u){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(arguments.length>3?arguments[3]:void 0)||{},r=n.key,o=n.index,c=n.type,i=c===void 0?"content":c,a=n.showComma,s=a!==void 0&&a,l=n.length,f=l===void 0?1:l,x=Zt(u);if(x==="array"){var b=Gt(u.map((function(k,w,E){return du(k,"".concat(e,"[").concat(w,"]"),t+1,{index:w,showComma:w!==E.length-1,length:f,type:i})})));return[du("[",e,t,{showComma:!1,key:r,length:u.length,type:"arrayStart"})[0]].concat(b,du("]",e,t,{showComma:s,length:u.length,type:"arrayEnd"})[0])}if(x==="object"){var d=Object.keys(u),F=Gt(d.map((function(k,w,E){return du(u[k],/^[a-zA-Z_]\w*$/.test(k)?"".concat(e,".").concat(k):"".concat(e,'["').concat(k,'"]'),t+1,{key:k,showComma:w!==E.length-1,length:f,type:i})})));return[du("{",e,t,{showComma:!1,key:r,index:o,length:d.length,type:"objectStart"})[0]].concat(F,du("}",e,t,{showComma:s,length:d.length,type:"objectEnd"})[0])}return[{content:u,level:t,key:r,index:o,path:e,showComma:s,length:f,type:i}]}function Gt(u){if(typeof Array.prototype.flat=="function")return u.flat();for(var e=Wu(u),t=[];e.length;){var n=e.shift();Array.isArray(n)?e.unshift.apply(e,Wu(n)):t.push(n)}return t}function De(u){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(u==null)return u;if(u instanceof Date)return new Date(u);if(u instanceof RegExp)return new RegExp(u);if(Ee(u)!=="object")return u;if(e.get(u))return e.get(u);if(Array.isArray(u)){var t=u.map((function(o){return De(o,e)}));return e.set(u,t),t}var n={};for(var r in u)n[r]=De(u[r],e);return e.set(u,n),n}function Wt(u,e,t,n,r,o,c){try{var i=u[o](c),a=i.value}catch(s){return void t(s)}i.done?e(a):Promise.resolve(a).then(n,r)}var jo=Y(207),Qt=Y.n(jo);function Jt(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);e&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable}))),t.push.apply(t,n)}return t}function Kt(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jt(Object(t),!0).forEach((function(n){Tu(u,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):Jt(Object(t)).forEach((function(n){Object.defineProperty(u,n,Object.getOwnPropertyDescriptor(t,n))}))}return u}var Yt={data:{type:[String,Number,Boolean,Array,Object],default:null},rootPath:{type:String,default:"root"},indent:{type:Number,default:2},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,renderNodeActions:{type:[Boolean,Function],default:void 0},selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},theme:{type:String,default:"light"},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onNodeMouseover:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}};const zo=(0,A.defineComponent)({name:"TreeNode",props:Kt(Kt({},Yt),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(u,e){var t=e.emit,n=(0,A.computed)((function(){return Zt(u.node.content)})),r=(0,A.computed)((function(){return"vjs-value vjs-value-".concat(n.value)})),o=(0,A.computed)((function(){return u.showDoubleQuotes?'"'.concat(u.node.key,'"'):u.node.key})),c=(0,A.computed)((function(){return u.selectableType==="multiple"})),i=(0,A.computed)((function(){return u.selectableType==="single"})),a=(0,A.computed)((function(){return u.nodeSelectable(u.node)&&(c.value||i.value)})),s=(0,A.reactive)({editing:!1}),l=function(m){var g,v,S=(v=(g=m.target)===null||g===void 0?void 0:g.value)==="null"?null:v==="undefined"?void 0:v==="true"||v!=="false"&&(v[0]+v[v.length-1]==='""'||v[0]+v[v.length-1]==="''"?v.slice(1,-1):typeof Number(v)=="number"&&!isNaN(Number(v))||v==="NaN"?Number(v):v);t("valueChange",S,u.node.path)},f=(0,A.computed)((function(){var m,g=(m=u.node)===null||m===void 0?void 0:m.content;return g===null?g="null":g===void 0&&(g="undefined"),n.value==="string"?'"'.concat(g,'"'):g+""})),x=function(){var m=u.renderNodeValue;return m?m({node:u.node,defaultValue:f.value}):f.value},b=function(){t("bracketsClick",!u.collapsed,u.node)},d=function(){t("iconClick",!u.collapsed,u.node)},F=function(){t("selectedChange",u.node)},k=function(){t("nodeClick",u.node),a.value&&u.selectOnClickNode&&t("selectedChange",u.node)},w=function(){t("nodeMouseover",u.node)},E=function(m){if(u.editable&&!s.editing){s.editing=!0;var g=function v(S){var N;S.target!==m.target&&((N=S.target)===null||N===void 0?void 0:N.parentElement)!==m.target&&(s.editing=!1,document.removeEventListener("click",v))};document.removeEventListener("click",g),document.addEventListener("click",g)}},D=(function(){var m=(0,A.ref)(!1),g=(function(){var v,S=(v=Qt().mark((function N(R){return Qt().wrap((function(P){for(;;)switch(P.prev=P.next){case 0:return P.prev=0,P.next=3,navigator.clipboard.writeText(R);case 3:m.value=!0,setTimeout((function(){m.value=!1}),300),P.next=10;break;case 7:P.prev=7,P.t0=P.catch(0),console.error("[vue-json-pretty] Copy failed: ",P.t0);case 10:case"end":return P.stop()}}),N,null,[[0,7]])})),function(){var N=this,R=arguments;return new Promise((function(P,I){var M=v.apply(N,R);function L(y){Wt(M,P,I,L,$,"next",y)}function $(y){Wt(M,P,I,L,$,"throw",y)}L(void 0)}))});return function(N){return S.apply(this,arguments)}})();return{copy:g}})().copy,p=function(){var m=u.node,g=m.key,v=m.path,S=u.rootPath,N=new Function("data","return data".concat(v.slice(S.length)))(u.data),R=JSON.stringify(g?Tu({},g,N):N,null,2);D(R)},C=function(){var m=u.renderNodeActions;if(!m)return null;var g={copy:p};return typeof m=="function"?m({node:u.node,defaultActions:g}):(0,A.createVNode)("span",{onClick:p,class:"vjs-tree-node-actions-item"},[(0,A.createTextVNode)("copy")])};return function(){var m,g=u.node;return(0,A.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":u.showSelectController,"has-carets":u.showIcon,"is-highlight":u.highlightSelectedNode&&u.checked,dark:u.theme==="dark"},onClick:k,onMouseover:w,style:u.style},[u.showLineNumber&&(0,A.createVNode)("span",{class:"vjs-node-index"},[g.id+1]),u.showSelectController&&a.value&&g.type!=="objectEnd"&&g.type!=="arrayEnd"&&(0,A.createVNode)(Mo,{isMultiple:c.value,checked:u.checked,onChange:F},null),(0,A.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(g.level)).map((function(v,S){return(0,A.createVNode)("div",{key:S,class:{"vjs-indent-unit":!0,"has-line":u.showLine}},[Array.from(Array(u.indent)).map((function(){return(0,A.createVNode)(A.Fragment,null,[(0,A.createTextVNode)(" ")])}))])})),u.showIcon&&(0,A.createVNode)(Po,{nodeType:g.type,onClick:d},null)]),g.key&&(0,A.createVNode)("span",{class:"vjs-key"},[(m=u.renderNodeKey,m?m({node:u.node,defaultKey:o.value||""}):o.value),(0,A.createVNode)("span",{class:"vjs-colon"},[":".concat(u.showKeyValueSpace?" ":"")])]),(0,A.createVNode)("span",null,[g.type!=="content"&&g.content?(0,A.createVNode)(Lo,{data:g.content.toString(),onClick:b},null):(0,A.createVNode)("span",{class:r.value,onClick:!u.editable||u.editableTrigger&&u.editableTrigger!=="click"?void 0:E,onDblclick:u.editable&&u.editableTrigger==="dblclick"?E:void 0},[u.editable&&s.editing?(0,A.createVNode)("input",{value:f.value,onChange:l,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):x()]),g.showComma&&(0,A.createVNode)("span",null,[","]),u.showLength&&u.collapsed&&(0,A.createVNode)("span",{class:"vjs-comment"},[(0,A.createTextVNode)(" // "),g.length,(0,A.createTextVNode)(" items ")])]),u.renderNodeActions&&(0,A.createVNode)("span",{class:"vjs-tree-node-actions"},[C()])])}}});function Xt(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);e&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable}))),t.push.apply(t,n)}return t}function W(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xt(Object(t),!0).forEach((function(n){Tu(u,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):Xt(Object(t)).forEach((function(n){Object.defineProperty(u,n,Object.getOwnPropertyDescriptor(t,n))}))}return u}const Ro=(0,A.defineComponent)({name:"Tree",props:W(W({},Yt),{},{collapsedNodeLength:{type:Number,default:1/0},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function},theme:{type:String,default:"light"}}),slots:["renderNodeKey","renderNodeValue","renderNodeActions"],emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(u,e){var t=e.emit,n=e.slots,r=(0,A.ref)(),o=(0,A.computed)((function(){return du(u.data,u.rootPath)})),c=function(p,C){return o.value.reduce((function(m,g){var v,S=g.level>=p||g.length>=C,N=(v=u.pathCollapsible)===null||v===void 0?void 0:v.call(u,g);return g.type!=="objectStart"&&g.type!=="arrayStart"||!S&&!N?m:W(W({},m),{},Tu({},g.path,1))}),{})},i=(0,A.reactive)({translateY:0,visibleData:null,hiddenPaths:c(u.deep,u.collapsedNodeLength)}),a=(0,A.computed)((function(){for(var p=null,C=[],m=o.value.length,g=0;g<m;g++){var v=W(W({},o.value[g]),{},{id:g}),S=i.hiddenPaths[v.path];if(p&&p.path===v.path){var N=p.type==="objectStart",R=W(W(W({},v),p),{},{showComma:v.showComma,content:N?"{...}":"[...]",type:N?"objectCollapsed":"arrayCollapsed"});p=null,C.push(R)}else{if(S&&!p){p=v;continue}if(p)continue;C.push(v)}}return C})),s=(0,A.computed)((function(){var p=u.selectedValue;return p&&u.selectableType==="multiple"&&Array.isArray(p)?p:[p]})),l=(0,A.computed)((function(){return!u.selectableType||u.selectOnClickNode||u.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."})),f=function(){var p=a.value;if(u.virtual){var C,m=u.height/u.itemHeight,g=((C=r.value)===null||C===void 0?void 0:C.scrollTop)||0,v=Math.floor(g/u.itemHeight),S=v<0?0:v+m>p.length?p.length-m:v;S<0&&(S=0);var N=S+m;i.translateY=S*u.itemHeight,i.visibleData=p.filter((function(R,P){return P>=S&&P<N}))}else i.visibleData=p},x=function(){f()},b=function(p){var C,m,g=p.path,v=u.selectableType;if(v==="multiple"){var S=s.value.findIndex((function(I){return I===g})),N=Wu(s.value);S!==-1?N.splice(S,1):N.push(g),t("update:selectedValue",N),t("selectedChange",N,Wu(s.value))}else if(v==="single"&&s.value[0]!==g){var R=(C=s.value,m=1,(function(I){if(Array.isArray(I))return I})(C)||(function(I,M){var L=I==null?null:typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(L!=null){var $,y,_=[],T=!0,O=!1;try{for(L=L.call(I);!(T=($=L.next()).done)&&(_.push($.value),!M||_.length!==M);T=!0);}catch(B){O=!0,y=B}finally{try{T||L.return==null||L.return()}finally{if(O)throw y}}return _}})(C,m)||Ht(C,m)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})())[0],P=g;t("update:selectedValue",P),t("selectedChange",P,R)}},d=function(p){t("nodeClick",p)},F=function(p){t("nodeMouseover",p)},k=function(p,C){if(p)i.hiddenPaths=W(W({},i.hiddenPaths),{},Tu({},C,1));else{var m=W({},i.hiddenPaths);delete m[C],i.hiddenPaths=m}},w=function(p,C){u.collapsedOnClickBrackets&&k(p,C.path),t("bracketsClick",p,C)},E=function(p,C){k(p,C.path),t("iconClick",p,C)},D=function(p,C){var m=De(u.data),g=u.rootPath;new Function("data","val","data".concat(C.slice(g.length),"=val"))(m,p),t("update:data",m)};return(0,A.watchEffect)((function(){l.value&&(function(p){throw new Error("[VueJSONPretty] ".concat(p))})(l.value)})),(0,A.watchEffect)((function(){a.value&&f()})),(0,A.watch)((function(){return u.deep}),(function(p){p&&(i.hiddenPaths=c(p,u.collapsedNodeLength))})),(0,A.watch)((function(){return u.collapsedNodeLength}),(function(p){p&&(i.hiddenPaths=c(u.deep,p))})),function(){var p,C,m,g,v=(p=u.renderNodeKey)!==null&&p!==void 0?p:n.renderNodeKey,S=(C=u.renderNodeValue)!==null&&C!==void 0?C:n.renderNodeValue,N=(m=(g=u.renderNodeActions)!==null&&g!==void 0?g:n.renderNodeActions)!==null&&m!==void 0&&m,R=i.visibleData&&i.visibleData.map((function(P){return(0,A.createVNode)(zo,{key:P.id,data:u.data,rootPath:u.rootPath,indent:u.indent,node:P,collapsed:!!i.hiddenPaths[P.path],theme:u.theme,showDoubleQuotes:u.showDoubleQuotes,showLength:u.showLength,checked:s.value.includes(P.path),selectableType:u.selectableType,showLine:u.showLine,showLineNumber:u.showLineNumber,showSelectController:u.showSelectController,selectOnClickNode:u.selectOnClickNode,nodeSelectable:u.nodeSelectable,highlightSelectedNode:u.highlightSelectedNode,editable:u.editable,editableTrigger:u.editableTrigger,showIcon:u.showIcon,showKeyValueSpace:u.showKeyValueSpace,renderNodeKey:v,renderNodeValue:S,renderNodeActions:N,onNodeClick:d,onNodeMouseover:F,onBracketsClick:w,onIconClick:E,onSelectedChange:b,onValueChange:D,style:u.itemHeight&&u.itemHeight!==20?{lineHeight:"".concat(u.itemHeight,"px")}:{}},null)}));return(0,A.createVNode)("div",{ref:r,class:{"vjs-tree":!0,"is-virtual":u.virtual,dark:u.theme==="dark"},onScroll:u.virtual?x:void 0,style:u.showLineNumber?W({paddingLeft:"".concat(12*Number(o.value.length.toString().length),"px")},u.style):u.style},[u.virtual?(0,A.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(u.height,"px")}},[(0,A.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(a.value.length*u.itemHeight,"px")}},[(0,A.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(i.translateY,"px)")}},[R])])]):R])}}});var qo=$t.A;const Vo=["src","alt"],$o=h.defineComponent({__name:"ImageViewer",props:{show:{type:Boolean},imageUrl:{},alt:{}},emits:["close"],setup(u){return(e,t)=>(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(h.Transition,{name:"viewer"},{default:h.withCtx(()=>[u.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"image-viewer",onClick:t[2]||(t[2]=n=>e.$emit("close"))},[h.createElementVNode("div",{class:"close-button",onClick:t[0]||(t[0]=h.withModifiers(n=>e.$emit("close"),["stop"]))},[h.createVNode(h.unref(bu),{icon:"mdi:close"})]),h.createElementVNode("div",{class:"viewer-content",onClick:t[1]||(t[1]=h.withModifiers(()=>{},["stop"]))},[h.createElementVNode("img",{src:u.imageUrl,alt:u.alt},null,8,Vo)])])):h.createCommentVNode("",!0)]),_:1})]))}}),hu=(u,e)=>{const t=u.__vccOpts||u;for(const[n,r]of e)t[n]=r;return t},u0=hu($o,[["__scopeId","data-v-92c159ee"]]),Ho=["innerHTML"],e0=hu(h.defineComponent({__name:"MessageTextContent",props:{html:{},role:{},plain:{type:Boolean,default:!1}},setup(u){const e=u,t=h.computed(()=>e.role?`role-${e.role}`:""),n=h.computed(()=>e.plain);return(r,o)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["content-text",[t.value,{"is-plain":n.value}]]),innerHTML:u.html},null,10,Ho))}}),[["__scopeId","data-v-bc62b03b"]]),Uo={class:"file-name"},Fe=hu(h.defineComponent({__name:"MessageFileContent",props:{name:{}},emits:["click"],setup(u){return(e,t)=>(h.openBlock(),h.createElementBlock("div",{class:"content-file",onClick:t[0]||(t[0]=n=>e.$emit("click"))},[h.createVNode(h.unref(bu),{icon:"mdi:file-document-outline",class:"file-icon"}),h.createElementVNode("span",Uo,h.toDisplayString(u.name),1),h.createVNode(h.unref(bu),{icon:"mdi:download",class:"download-icon"})]))}}),[["__scopeId","data-v-24190b61"]]),Zo=["src"],Ae=hu(h.defineComponent({__name:"MessageImageContent",props:{src:{},fullWidth:{type:Boolean}},emits:["click"],setup(u){return(e,t)=>(h.openBlock(),h.createElementBlock("img",{src:u.src,alt:"图片",class:h.normalizeClass(["message-image",{"is-full-width":u.fullWidth}]),onClick:t[0]||(t[0]=n=>e.$emit("click"))},null,10,Zo))}}),[["__scopeId","data-v-24952cda"]]),Go=["src"],t0=hu(h.defineComponent({__name:"MessageVideoContent",props:{src:{},fullWidth:{type:Boolean}},setup(u){return(e,t)=>(h.openBlock(),h.createElementBlock("video",{controls:"",src:u.src,class:h.normalizeClass(["message-video",{"is-full-width":u.fullWidth}])}," 您的浏览器不支持视频播放 ",10,Go))}}),[["__scopeId","data-v-be6bb72d"]]),Wo=["src"],we=hu(h.defineComponent({__name:"MessageAudioContent",props:{src:{}},setup(u){return(e,t)=>(h.openBlock(),h.createElementBlock("audio",{controls:"",src:u.src,class:"message-audio"}," 您的浏览器不支持音频播放 ",8,Wo))}}),[["__scopeId","data-v-c0d42074"]]),Qo={key:2,class:"content-user-message"},Jo={key:1,class:"files-grid"},Ko={key:6,class:"content-medialib"},Yo=hu(h.defineComponent({__name:"MessageContentRenderer",props:{content:{},role:{},showActions:{type:Boolean},allowRegenerate:{type:Boolean}},emits:["copy","regenerate","delete"],setup(u,{emit:e}){const t=u,n=e,r=h.computed(()=>t.role?`role-${t.role}`:""),o=h.computed(()=>t.role?`actions-${t.role}`:""),c=h.computed(()=>t.showActions!==!1&&!!t.role),i=h.computed(()=>t.role==="assistant"&&t.allowRegenerate!==!1),a=h.computed(()=>{const I=t.content;return typeof I=="string"?{type:"text",content:I}:I});function s(I){return!("type"in I)}const l=new J({html:!0,linkify:!0,typographer:!0,breaks:!0}),f=h.computed(()=>!s(a.value)&&a.value.type==="text"?l.render(a.value.content):""),x=h.ref(!1),b=h.ref("");function d(){const I=a.value;if(s(I)){const M=[];return Array.isArray(I.texts)&&M.push(...I.texts.filter(Boolean)),M.join(`
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})())[0],P=g;t("update:selectedValue",P),t("selectedChange",P,R)}},d=function(p){t("nodeClick",p)},F=function(p){t("nodeMouseover",p)},k=function(p,C){if(p)i.hiddenPaths=W(W({},i.hiddenPaths),{},Tu({},C,1));else{var m=W({},i.hiddenPaths);delete m[C],i.hiddenPaths=m}},w=function(p,C){u.collapsedOnClickBrackets&&k(p,C.path),t("bracketsClick",p,C)},E=function(p,C){k(p,C.path),t("iconClick",p,C)},D=function(p,C){var m=De(u.data),g=u.rootPath;new Function("data","val","data".concat(C.slice(g.length),"=val"))(m,p),t("update:data",m)};return(0,A.watchEffect)((function(){l.value&&(function(p){throw new Error("[VueJSONPretty] ".concat(p))})(l.value)})),(0,A.watchEffect)((function(){a.value&&f()})),(0,A.watch)((function(){return u.deep}),(function(p){p&&(i.hiddenPaths=c(p,u.collapsedNodeLength))})),(0,A.watch)((function(){return u.collapsedNodeLength}),(function(p){p&&(i.hiddenPaths=c(u.deep,p))})),function(){var p,C,m,g,v=(p=u.renderNodeKey)!==null&&p!==void 0?p:n.renderNodeKey,S=(C=u.renderNodeValue)!==null&&C!==void 0?C:n.renderNodeValue,N=(m=(g=u.renderNodeActions)!==null&&g!==void 0?g:n.renderNodeActions)!==null&&m!==void 0&&m,R=i.visibleData&&i.visibleData.map((function(P){return(0,A.createVNode)(zo,{key:P.id,data:u.data,rootPath:u.rootPath,indent:u.indent,node:P,collapsed:!!i.hiddenPaths[P.path],theme:u.theme,showDoubleQuotes:u.showDoubleQuotes,showLength:u.showLength,checked:s.value.includes(P.path),selectableType:u.selectableType,showLine:u.showLine,showLineNumber:u.showLineNumber,showSelectController:u.showSelectController,selectOnClickNode:u.selectOnClickNode,nodeSelectable:u.nodeSelectable,highlightSelectedNode:u.highlightSelectedNode,editable:u.editable,editableTrigger:u.editableTrigger,showIcon:u.showIcon,showKeyValueSpace:u.showKeyValueSpace,renderNodeKey:v,renderNodeValue:S,renderNodeActions:N,onNodeClick:d,onNodeMouseover:F,onBracketsClick:w,onIconClick:E,onSelectedChange:b,onValueChange:D,style:u.itemHeight&&u.itemHeight!==20?{lineHeight:"".concat(u.itemHeight,"px")}:{}},null)}));return(0,A.createVNode)("div",{ref:r,class:{"vjs-tree":!0,"is-virtual":u.virtual,dark:u.theme==="dark"},onScroll:u.virtual?x:void 0,style:u.showLineNumber?W({paddingLeft:"".concat(12*Number(o.value.length.toString().length),"px")},u.style):u.style},[u.virtual?(0,A.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(u.height,"px")}},[(0,A.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(a.value.length*u.itemHeight,"px")}},[(0,A.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(i.translateY,"px)")}},[R])])]):R])}}});var qo=$t.A;const Vo=["src","alt"],$o=h.defineComponent({__name:"ImageViewer",props:{show:{type:Boolean},imageUrl:{},alt:{}},emits:["close"],setup(u){return(e,t)=>(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(h.Transition,{name:"viewer"},{default:h.withCtx(()=>[u.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"image-viewer",onClick:t[2]||(t[2]=n=>e.$emit("close"))},[h.createElementVNode("div",{class:"close-button",onClick:t[0]||(t[0]=h.withModifiers(n=>e.$emit("close"),["stop"]))},[h.createVNode(h.unref(bu),{icon:"mdi:close"})]),h.createElementVNode("div",{class:"viewer-content",onClick:t[1]||(t[1]=h.withModifiers(()=>{},["stop"]))},[h.createElementVNode("img",{src:u.imageUrl,alt:u.alt},null,8,Vo)])])):h.createCommentVNode("",!0)]),_:1})]))}}),hu=(u,e)=>{const t=u.__vccOpts||u;for(const[n,r]of e)t[n]=r;return t},u0=hu($o,[["__scopeId","data-v-92c159ee"]]),Ho=["innerHTML"],e0=hu(h.defineComponent({__name:"MessageTextContent",props:{html:{},role:{},plain:{type:Boolean,default:!1}},setup(u){const e=u,t=h.computed(()=>e.role?`role-${e.role}`:""),n=h.computed(()=>e.plain);return(r,o)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["content-text",[t.value,{"is-plain":n.value}]]),innerHTML:u.html},null,10,Ho))}}),[["__scopeId","data-v-d4935523"]]),Uo={class:"file-name"},Fe=hu(h.defineComponent({__name:"MessageFileContent",props:{name:{}},emits:["click"],setup(u){return(e,t)=>(h.openBlock(),h.createElementBlock("div",{class:"content-file",onClick:t[0]||(t[0]=n=>e.$emit("click"))},[h.createVNode(h.unref(bu),{icon:"mdi:file-document-outline",class:"file-icon"}),h.createElementVNode("span",Uo,h.toDisplayString(u.name),1),h.createVNode(h.unref(bu),{icon:"mdi:download",class:"download-icon"})]))}}),[["__scopeId","data-v-24190b61"]]),Zo=["src"],Ae=hu(h.defineComponent({__name:"MessageImageContent",props:{src:{},fullWidth:{type:Boolean}},emits:["click"],setup(u){return(e,t)=>(h.openBlock(),h.createElementBlock("img",{src:u.src,alt:"图片",class:h.normalizeClass(["message-image",{"is-full-width":u.fullWidth}]),onClick:t[0]||(t[0]=n=>e.$emit("click"))},null,10,Zo))}}),[["__scopeId","data-v-24952cda"]]),Go=["src"],t0=hu(h.defineComponent({__name:"MessageVideoContent",props:{src:{},fullWidth:{type:Boolean}},setup(u){return(e,t)=>(h.openBlock(),h.createElementBlock("video",{controls:"",src:u.src,class:h.normalizeClass(["message-video",{"is-full-width":u.fullWidth}])}," 您的浏览器不支持视频播放 ",10,Go))}}),[["__scopeId","data-v-be6bb72d"]]),Wo=["src"],we=hu(h.defineComponent({__name:"MessageAudioContent",props:{src:{}},setup(u){return(e,t)=>(h.openBlock(),h.createElementBlock("audio",{controls:"",src:u.src,class:"message-audio"}," 您的浏览器不支持音频播放 ",8,Wo))}}),[["__scopeId","data-v-c0d42074"]]),Qo={key:2,class:"content-user-message"},Jo={key:1,class:"files-grid"},Ko={key:6,class:"content-medialib"},Yo=hu(h.defineComponent({__name:"MessageContentRenderer",props:{content:{},role:{},showActions:{type:Boolean},allowRegenerate:{type:Boolean}},emits:["copy","regenerate","delete"],setup(u,{emit:e}){const t=u,n=e,r=h.computed(()=>t.role?`role-${t.role}`:""),o=h.computed(()=>t.role?`actions-${t.role}`:""),c=h.computed(()=>t.showActions!==!1&&!!t.role),i=h.computed(()=>t.role==="assistant"&&t.allowRegenerate!==!1),a=h.computed(()=>{const I=t.content;return typeof I=="string"?{type:"text",content:I}:I});function s(I){return!("type"in I)}const l=new J({html:!0,linkify:!0,typographer:!0,breaks:!0}),f=h.computed(()=>!s(a.value)&&a.value.type==="text"?l.render(a.value.content):""),x=h.ref(!1),b=h.ref("");function d(){const I=a.value;if(s(I)){const M=[];return Array.isArray(I.texts)&&M.push(...I.texts.filter(Boolean)),M.join(`
19
19
 
20
20
  `).trim()}return I.type==="text"?I.content:""}async function F(){const I=d();if(I)try{await navigator.clipboard.writeText(I)}catch(M){console.error("Failed to copy content",M)}n("copy")}function k(){n("regenerate")}function w(){n("delete")}function E(){s(a.value)||(a.value.type==="image"?(b.value=a.value.content,x.value=!0):a.value.type==="medialib"&&R.value==="image"&&(b.value=S.value,x.value=!0))}function D(I){b.value=I,x.value=!0}function p(I){try{const $=new URL(I).pathname.split("/");return $[$.length-1]||"未知文件"}catch{return"未知文件"}}function C(){s(a.value)||window.open(a.value.content,"_blank")}function m(I){window.open(I,"_blank")}function g(I){if(!I)return"file";const M=I.toLowerCase();return M.match(/\.(mp4|webm|ogg|mov|avi|wmv|flv|mkv)$/)?"video":M.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)$/)?"image":M.match(/\.(mp3|wav|ogg|aac|flac|m4a)$/)?"audio":"file"}const v=h.computed(()=>{if(!s(a.value)&&a.value.type==="medialib")try{return JSON.parse(a.value.content)}catch{return null}return null}),S=h.computed(()=>v.value?.file_url||""),N=h.computed(()=>v.value?.file_name||p(S.value)),R=h.computed(()=>{if(!S.value)return"json";const I=S.value.toLowerCase();return I.match(/\.(mp4|webm|ogg|mov|avi|wmv|flv|mkv)$/)?"video":I.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)$/)?"image":I.match(/\.(mp3|wav|ogg|aac|flac|m4a)$/)?"audio":"file"});function P(){S.value&&window.open(S.value,"_blank")}return(I,M)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["message-content-renderer",r.value])},[c.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["renderer-actions",o.value])},[h.createElementVNode("button",{type:"button",class:"renderer-action-btn",onClick:F},[h.createVNode(h.unref(bu),{icon:"mdi:content-copy"}),M[1]||(M[1]=h.createElementVNode("span",null,"复制",-1))]),i.value?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"renderer-action-btn",onClick:k},[h.createVNode(h.unref(bu),{icon:"mdi:refresh"}),M[2]||(M[2]=h.createElementVNode("span",null,"重新生成",-1))])):h.createCommentVNode("",!0),h.createElementVNode("button",{type:"button",class:"renderer-action-btn danger",onClick:w},[h.createVNode(h.unref(bu),{icon:"mdi:delete-outline"}),M[3]||(M[3]=h.createElementVNode("span",null,"删除",-1))])],2)):h.createCommentVNode("",!0),!s(a.value)&&a.value.type==="text"?(h.openBlock(),h.createBlock(e0,{key:1,html:f.value,role:u.role},null,8,["html","role"])):s(a.value)?(h.openBlock(),h.createElementBlock("div",Qo,[a.value.texts&&a.value.texts.length>0?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(a.value.texts,(L,$)=>(h.openBlock(),h.createBlock(e0,{key:`text-${$}`,html:L,role:u.role,plain:""},null,8,["html","role"]))),128)):h.createCommentVNode("",!0),a.value.files&&a.value.files.length>0?(h.openBlock(),h.createElementBlock("div",Jo,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(a.value.files,(L,$)=>(h.openBlock(),h.createElementBlock("div",{key:`file-${$}`},[g(L)==="image"?(h.openBlock(),h.createBlock(Ae,{key:0,src:L,"full-width":!0,onClick:y=>D(L)},null,8,["src","onClick"])):g(L)==="video"?(h.openBlock(),h.createBlock(t0,{key:1,src:L,"full-width":!0},null,8,["src"])):g(L)==="audio"?(h.openBlock(),h.createBlock(we,{key:2,src:L},null,8,["src"])):(h.openBlock(),h.createBlock(Fe,{key:3,name:p(L),onClick:y=>m(L)},null,8,["name","onClick"]))]))),128))])):h.createCommentVNode("",!0)])):!s(a.value)&&a.value.type==="file"?(h.openBlock(),h.createBlock(Fe,{key:3,name:p(a.value.content),onClick:C},null,8,["name"])):!s(a.value)&&a.value.type==="image"?(h.openBlock(),h.createBlock(Ae,{key:4,src:a.value.content,onClick:E},null,8,["src"])):!s(a.value)&&a.value.type==="voice"?(h.openBlock(),h.createBlock(we,{key:5,src:a.value.content},null,8,["src"])):!s(a.value)&&a.value.type==="medialib"?(h.openBlock(),h.createElementBlock("div",Ko,[R.value==="video"?(h.openBlock(),h.createBlock(t0,{key:0,src:S.value,"full-width":!0},null,8,["src"])):R.value==="image"?(h.openBlock(),h.createBlock(Ae,{key:1,src:S.value,onClick:E},null,8,["src"])):R.value==="audio"?(h.openBlock(),h.createBlock(we,{key:2,src:S.value},null,8,["src"])):R.value==="file"?(h.openBlock(),h.createBlock(Fe,{key:3,name:N.value,onClick:P},null,8,["name"])):(h.openBlock(),h.createBlock(h.unref(qo),{key:4,data:v.value,deep:3,class:"json-viewer"},null,8,["data"]))])):h.createCommentVNode("",!0),h.createVNode(u0,{show:x.value,"image-url":b.value,onClose:M[0]||(M[0]=L=>x.value=!1)},null,8,["show","image-url"])],2))}}),[["__scopeId","data-v-02192e04"]]);iu.ImageViewer=u0,iu.MessageContentRenderer=Yo,Object.defineProperty(iu,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnai/message-content-renderer",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/message-content-renderer.umd.js",