aitu-app 1.0.0 → 1.0.2
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.
- package/README.md +3 -3
- package/assets/{CanvasAudioPlayer-DyUPmMV6.js → CanvasAudioPlayer-HtUs8HDj.js} +2 -2
- package/assets/ComicCreator-DhxXCyJR.js +43 -0
- package/assets/{DeferredAIInputBar-Cq0t7wNK.js → DeferredAIInputBar-B2R2-2RU.js} +3 -3
- package/assets/{DrawnixDeferredFeatures-B9y0GPYR.js → DrawnixDeferredFeatures-DHTr0c-V.js} +2 -2
- package/assets/{KnowledgeBaseContent-C8zmce09.js → KnowledgeBaseContent-CAq5kXdt.js} +6 -6
- package/assets/{MVCreator-Bl8GH4mR.js → MVCreator-B9uaRsGE.js} +16 -16
- package/assets/{ModelBenchmarkWorkbench-BwfeZDt-.js → ModelBenchmarkWorkbench-CK33zizl.js} +1 -1
- package/assets/{MusicAnalyzer-CdMhl-kU.js → MusicAnalyzer-D2NTonEA.js} +1 -1
- package/assets/{PromptHistoryTool-CCxoST3H.js → PromptHistoryTool-q6vOxFr6.js} +1 -1
- package/assets/{ResizableDivider-D1jgqdmh.js → ResizableDivider-BvT-DCEo.js} +2 -2
- package/assets/{TaskQueuePanel-WF6aq1G7.js → TaskQueuePanel-PayswYlG.js} +1 -1
- package/assets/{VideoAnalyzer-BOqRFjZ9.js → VideoAnalyzer-DnowtohS.js} +1 -1
- package/assets/{VideoAnalyzer-BrEKSLeh.js → VideoAnalyzer-DoaGlK92.js} +2 -2
- package/assets/{ai-chat-DbjmzngX.css → ai-chat-BlxYfB4O.css} +1 -1
- package/assets/ai-chat-BnWVpTEI.js +2977 -0
- package/assets/{batch-image-generation-DyWeiTsw.js → batch-image-generation-CkmX4dem.js} +5 -5
- package/assets/{bootstrap-DadYvnge.js → bootstrap-CQRLkOtk.js} +7 -7
- package/assets/{clean-confirm-CpWpcTF5.js → clean-confirm-CIViVQ8s.js} +1 -1
- package/assets/{diagram-engines-C0Ljec4Z.js → diagram-engines-DpAsX7pc.js} +3 -3
- package/assets/{editor-engines-Dz5Mk5YB.js → editor-engines-9_72Ghfn.js} +1 -1
- package/assets/{external-skill-service-BQUJLLLc.js → external-skill-service-BN8ZCtPn.js} +1 -1
- package/assets/{frame-size-matcher-2sxA9X-P.js → frame-size-matcher-9rxQ-bAY.js} +1 -1
- package/assets/{index-CRuDVxTu.js → index-291TeU7i.js} +1 -1
- package/assets/{index-BNtKpMlh.js → index-BJ-vS89P.js} +1 -1
- package/assets/{index-Ct7MFvFo.js → index-BSZAS0wO.js} +1 -1
- package/assets/{index-BfdBtWT6.js → index-C7DAD_xK.js} +1 -1
- package/assets/{index-o8hm5yhT.js → index-CIgiIDgZ.js} +1 -1
- package/assets/{index-BwW4Qp-A.js → index-CpHWUe__.js} +1 -1
- package/assets/{index-D7UBK5T7.js → index-D1LQ9eQM.js} +1 -1
- package/assets/{index-D_Yn26AT.js → index-DRGxmFyd.js} +1 -1
- package/assets/{index-CBMgStgL.js → index-DmtcRYr8.js} +1 -1
- package/assets/{index.es-CYBRnsv6.js → index.es-Ch45-H39.js} +1 -1
- package/assets/{jspdf.es.min-I7TkFvGI.js → jspdf.es.min-bNprb1JY.js} +3 -3
- package/assets/{link-popup-fCfgZp17.js → link-popup-B6ReK6iq.js} +1 -1
- package/assets/{markdown-to-drawnix-3yksNvbU.js → markdown-to-drawnix-BqT-3zQO.js} +3 -3
- package/assets/{mermaid-to-drawnix-C7rF-30X.js → mermaid-to-drawnix-CSctnpU0.js} +3 -3
- package/assets/{model-benchmark-launcher-uYoranwQ.js → model-benchmark-launcher-DNMp2MLQ.js} +1 -1
- package/assets/{photo-wall-splitter-CfRBAwCy.js → photo-wall-splitter-DhBTEpdG.js} +1 -1
- package/assets/{popup-toolbar-tKtYPGvw.js → popup-toolbar-BChsudwW.js} +7 -7
- package/assets/{prompt-utils-C_mjEqkz.js → prompt-utils-BX0pRV-Z.js} +1 -1
- package/assets/quick-creation-toolbar-3-AYFpEF.js +2 -0
- package/assets/{settings-dialog-DfK6bcBd.js → settings-dialog-Ccemaout.js} +1 -1
- package/assets/{size-picker-DvMt8S3Z.js → size-picker-DTrdjyLh.js} +1 -1
- package/assets/{skill-dsl-parser-CTM4hEIp.js → skill-dsl-parser-ZR--uu5h.js} +1 -1
- package/assets/{startup-app-9gZEGv85.js → startup-app-CH3QzBb4.js} +2 -2
- package/assets/{task-sync-D7bw59_K.js → task-sync-C5XXOQ5m.js} +1 -1
- package/assets/{tool-windows-BnDZa9FH.js → tool-windows-Bf_pMml-.js} +6 -6
- package/assets/ttd-dialog-CohjwODB.js +6 -0
- package/assets/{ttd-dialog-submit-shortcut-UfHT9Z9k.js → ttd-dialog-submit-shortcut-BVB8O_wE.js} +1 -1
- package/assets/{useCharacters-6u0Wuwt4.js → useCharacters-CFlPvydq.js} +1 -1
- package/assets/{useWorkflowSubmission-DTWha6Vn.js → useWorkflowSubmission-CKkOEcAT.js} +3 -3
- package/assets/{video-merge-webcodecs-Cwy2df91.js → video-merge-webcodecs-BInWo9HA.js} +2 -2
- package/assets/{video-recovery-service-CgZ3pA_1.js → video-recovery-service-DITdD0pC.js} +1 -1
- package/assets/{workflow-generation-utils-BPT49S-Z.js → workflow-generation-utils-e0nRpAgJ.js} +3 -3
- package/assets/{workflow-submission-service-C-6Uf9FA.js → workflow-submission-service-BqiL_5Cj.js} +3 -3
- package/changelog.json +105 -6
- package/idle-prefetch-manifest.json +136 -288
- package/manifest.json +3 -3
- package/package.json +1 -1
- package/precache-manifest.json +6 -6
- package/sw.js +1 -1
- package/version.json +63 -3
- package/.DS_Store +0 -0
- package/assets/ComicCreator-DjOhYrZt.js +0 -43
- package/assets/ai-chat-B-XdoWBQ.js +0 -2976
- package/assets/quick-creation-toolbar-CrQ0g0kO.js +0 -2
- package/assets/ttd-dialog-DS6KiOOa.js +0 -6
- package/assets/useMediaViewer-BrBFopM-.js +0 -1
- package/user-manual/gifs//346/200/235/347/273/264/345/257/274/345/233/276/345/210/233/345/273/272/346/274/224/347/244/272.gif +0 -0
- package/user-manual/screenshots/ai-step-0.png +0 -0
- package/user-manual/screenshots/ai-step-1.png +0 -0
- package/user-manual/screenshots/ai-step-2.png +0 -0
- package/user-manual/screenshots/ai-step-3.png +0 -0
- package/user-manual/screenshots/app-menu.png +0 -0
- package/user-manual/screenshots/backup-restore.png +0 -0
- package/user-manual/screenshots/canvas-tools.png +0 -0
- package/user-manual/screenshots/debug-panel.png +0 -0
- package/user-manual/screenshots/drawing-step-0.png +0 -0
- package/user-manual/screenshots/drawing-step-1.png +0 -0
- package/user-manual/screenshots/drawing-step-2.png +0 -0
- package/user-manual/screenshots/edit-selected.png +0 -0
- package/user-manual/screenshots/element-selected.png +0 -0
- package/user-manual/screenshots/flowchart-step-1.png +0 -0
- package/user-manual/screenshots/flowchart-step-2.png +0 -0
- package/user-manual/screenshots/flowchart-step-3.png +0 -0
- package/user-manual/screenshots/image-preview-empty.png +0 -0
- package/user-manual/screenshots/insert-from-library.png +0 -0
- package/user-manual/screenshots/insert-tools.png +0 -0
- package/user-manual/screenshots/inspiration-step-1.png +0 -0
- package/user-manual/screenshots/inspiration-step-2.png +0 -0
- package/user-manual/screenshots/media-library.png +0 -0
- package/user-manual/screenshots/mindmap-step-1.png +0 -0
- package/user-manual/screenshots/mindmap-step-2.png +0 -0
- package/user-manual/screenshots/mindmap-toolbar-menu.png +0 -0
- package/user-manual/screenshots/project-drawer.png +0 -0
- package/user-manual/screenshots/settings-dialog.png +0 -0
- package/user-manual/screenshots/shape-step-1.png +0 -0
- package/user-manual/screenshots/shape-step-2.png +0 -0
- package/user-manual/screenshots/text-step-1.png +0 -0
- package/user-manual/screenshots/text-step-2.png +0 -0
- package/user-manual/screenshots/toolbox-drawer.png +0 -0
- package/user-manual/screenshots/toolbox-entry.png +0 -0
- package/user-manual/screenshots/video-entry.png +0 -0
- package/user-manual/screenshots/view-navigation.png +0 -0
- package/user-manual/screenshots/zoom-menu.png +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var F7=t=>{throw TypeError(t)};var Pv=(t,e,n)=>e.has(t)||F7("Cannot "+n);var U=(t,e,n)=>(Pv(t,e,"read from private field"),n?n.call(t):e.get(t)),ge=(t,e,n)=>e.has(t)?F7("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),te=(t,e,n,r)=>(Pv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),s1=(t,e,n)=>(Pv(t,e,"access private method"),n);import{g as LH,_ as ee}from"./startup-runtime-BrfuwjQS.js";import{H as Qy,I as DT,J as fu,K as ns,L as LT,M as GH,N as H7,O as BH,P as bo,R as zZ}from"./ai-chat-B-XdoWBQ.js";import{d as GT,p as Wo}from"./diagram-engines-C0Ljec4Z.js";function K7(t){if(t)throw t}var wv,J7;function FH(){if(J7)return wv;J7=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(O){return typeof Array.isArray=="function"?Array.isArray(O):e.call(O)==="[object Array]"},o=function(O){if(!O||e.call(O)!=="[object Object]")return!1;var c=t.call(O,"constructor"),u=O.constructor&&O.constructor.prototype&&t.call(O.constructor.prototype,"isPrototypeOf");if(O.constructor&&!c&&!u)return!1;var d;for(d in O);return typeof d>"u"||t.call(O,d)},a=function(O,c){n&&c.name==="__proto__"?n(O,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):O[c.name]=c.newValue},s=function(O,c){if(c==="__proto__")if(t.call(O,c)){if(r)return r(O,c).value}else return;return O[c]};return wv=function l(){var O,c,u,d,f,h,p=arguments[0],g=1,$=arguments.length,b=!1;for(typeof p=="boolean"&&(b=p,p=arguments[1]||{},g=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});g<$;++g)if(O=arguments[g],O!=null)for(c in O)u=s(p,c),d=s(O,c),p!==d&&(b&&d&&(o(d)||(f=i(d)))?(f?(f=!1,h=u&&i(u)?u:[]):h=u&&o(u)?u:{},a(p,{name:c,newValue:l(b,h,d)})):typeof d<"u"&&a(p,{name:c,newValue:d}));return p},wv}var HH=FH();const xv=LH(HH);function Cw(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function KH(){const t=[],e={run:n,use:r};return e;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...O){const c=t[++o];let u=-1;if(l){a(l);return}for(;++u<i.length;)(O[u]===null||O[u]===void 0)&&(O[u]=i[u]);i=O,c?JH(c,s)(...O):a(null,...O)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function JH(t,e){let n;return r;function r(...a){const s=t.length>a.length;let l;s&&a.push(i);try{l=t.apply(this,a)}catch(O){const c=O;if(s&&n)throw c;return i(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,e(a,...s))}function o(a){i(null,a)}}function Ip(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?e3(t.position):"start"in t||"end"in t?e3(t):"line"in t||"column"in t?qw(t):""}function qw(t){return t3(t&&t.line)+":"+t3(t&&t.column)}function e3(t){return qw(t&&t.start)+"-"+qw(t&&t.end)}function t3(t){return t&&typeof t=="number"?t:1}class xi extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(a=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Ip(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}xi.prototype.file="";xi.prototype.name="";xi.prototype.reason="";xi.prototype.message="";xi.prototype.stack="";xi.prototype.column=void 0;xi.prototype.line=void 0;xi.prototype.ancestors=void 0;xi.prototype.cause=void 0;xi.prototype.fatal=void 0;xi.prototype.place=void 0;xi.prototype.ruleId=void 0;xi.prototype.source=void 0;const Ya={basename:eK,dirname:tK,extname:nK,join:rK,sep:"/"};function eK(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ag(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,s=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(t.codePointAt(i)===e.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function tK(t){if(ag(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function nK(t){ag(t);let e=t.length,n=-1,r=0,i=-1,o=0,a;for(;e--;){const s=t.codePointAt(e);if(s===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),s===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function rK(...t){let e=-1,n;for(;++e<t.length;)ag(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":iK(n)}function iK(t){ag(t);const e=t.codePointAt(0)===47;let n=oK(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function oK(t,e){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=t.length;){if(a<t.length)s=t.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function ag(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const aK={cwd:sK};function sK(){return"/"}function Ew(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function lK(t){if(typeof t=="string")t=new URL(t);else if(!Ew(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return OK(t)}function OK(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Tv=["history","path","basename","stem","extname","dirname"];class cK{constructor(e){let n;e?Ew(e)?n={path:e}:typeof e=="string"||uK(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":aK.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Tv.length;){const o=Tv[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Tv.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ya.basename(this.path):void 0}set basename(e){Xv(e,"basename"),_v(e,"basename"),this.path=Ya.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Ya.dirname(this.path):void 0}set dirname(e){n3(this.basename,"dirname"),this.path=Ya.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Ya.extname(this.path):void 0}set extname(e){if(_v(e,"extname"),n3(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ya.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ew(e)&&(e=lK(e)),Xv(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Ya.basename(this.path,this.extname):void 0}set stem(e){Xv(e,"stem"),_v(e,"stem"),this.path=Ya.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new xi(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function _v(t,e){if(t&&t.includes(Ya.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ya.sep+"`")}function Xv(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function n3(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function uK(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const dK=(function(t){const r=this.constructor.prototype,i=r[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),fK={}.hasOwnProperty;class BT extends dK{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=KH()}copy(){const e=new BT;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(xv(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Cv("data",this.frozen),this.namespace[e]=n,this):fK.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Cv("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=l1(e),r=this.parser||this.Parser;return Rv("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),Rv("process",this.parser||this.Parser),zv("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=l1(e),l=r.parse(s);r.run(l,s,function(c,u,d){if(c||!u||!d)return O(c);const f=u,h=r.stringify(f,d);pK(h)?d.value=h:d.result=h,O(c,d)});function O(c,u){c||!u?a(c):o?o(u):n(void 0,u)}}}processSync(e){let n=!1,r;return this.freeze(),Rv("processSync",this.parser||this.Parser),zv("processSync",this.compiler||this.Compiler),this.process(e,i),i3("processSync","process",n),r;function i(o,a){n=!0,K7(o),r=a}}run(e,n,r){r3(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=l1(n);i.run(e,l,O);function O(c,u,d){const f=u||e;c?s(c):a?a(f):r(void 0,f,d)}}}runSync(e,n){let r=!1,i;return this.run(e,n,o),i3("runSync","run",r),i;function o(a,s){K7(a),i=s,r=!0}}stringify(e,n){this.freeze();const r=l1(n),i=this.compiler||this.Compiler;return zv("stringify",i),r3(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(Cv("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?s(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(O){if(typeof O=="function")l(O,[]);else if(typeof O=="object")if(Array.isArray(O)){const[c,...u]=O;l(c,u)}else a(O);else throw new TypeError("Expected usable value, not `"+O+"`")}function a(O){if(!("plugins"in O)&&!("settings"in O))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(O.plugins),O.settings&&(i.settings=xv(!0,i.settings,O.settings))}function s(O){let c=-1;if(O!=null)if(Array.isArray(O))for(;++c<O.length;){const u=O[c];o(u)}else throw new TypeError("Expected a list of plugins, not `"+O+"`")}function l(O,c){let u=-1,d=-1;for(;++u<r.length;)if(r[u][0]===O){d=u;break}if(d===-1)r.push([O,...c]);else if(c.length>0){let[f,...h]=c;const p=r[d][1];Cw(p)&&Cw(f)&&(f=xv(!0,p,f)),r[d]=[O,f,...h]}}}}const Zw=new BT().freeze();function Rv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function zv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Cv(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function r3(t){if(!Cw(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function i3(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function l1(t){return hK(t)?t:new cK(t)}function hK(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function pK(t){return typeof t=="string"||mK(t)}function mK(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const gK={};function FT(t,e){const n=gK,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return CZ(t,r,i)}function CZ(t,e,n){if($K(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return o3(t.children,e,n)}return Array.isArray(t)?o3(t,e,n):""}function o3(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=CZ(t[i],e,n);return r.join("")}function $K(t){return!!(t&&typeof t=="object")}function no(t,e,n,r){const i=t.length;let o=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(e,0),t.splice(...a),o+=1e4,e+=1e4}function $o(t,e){return t.length>0?(no(t,t.length,0,e),t):e}const a3={}.hasOwnProperty;function qZ(t){const e={};let n=-1;for(;++n<t.length;)QK(e,t[n]);return e}function QK(t,e){let n;for(n in e){const i=(a3.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n];let a;if(o)for(a in o){a3.call(i,a)||(i[a]=[]);const s=o[a];bK(i[a],Array.isArray(s)?s:s?[s]:[])}}}function bK(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);no(t,0,0,r)}function EZ(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ca(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Hr=WO(/[A-Za-z]/),Si=WO(/[\dA-Za-z]/),yK=WO(/[#-'*+\--9=?A-Z^-~]/);function HQ(t){return t!==null&&(t<32||t===127)}const Yw=WO(/\d/),SK=WO(/[\dA-Fa-f]/),vK=WO(/[!-/:-@[-`{-~]/);function De(t){return t!==null&&t<-2}function on(t){return t!==null&&(t<0||t===32)}function wt(t){return t===-2||t===-1||t===32}const by=WO(new RegExp("\\p{P}|\\p{S}","u")),hu=WO(/\s/);function WO(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function yt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return wt(l)?(t.enter(n),s(l)):e(l)}function s(l){return wt(l)&&o++<i?(t.consume(l),s):(t.exit(n),e(l))}}const kK={tokenize:PK};function PK(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),yt(t,e,"linePrefix")}function i(s){return t.enter("paragraph"),o(s)}function o(s){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return De(s)?(t.consume(s),t.exit("chunkText"),o):(t.consume(s),a)}}const wK={tokenize:xK},s3={tokenize:TK};function xK(t){const e=this,n=[];let r=0,i,o,a;return s;function s(S){if(r<n.length){const x=n[r];return e.containerState=x[1],t.attempt(x[0].continuation,l,O)(S)}return O(S)}function l(S){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&b();const x=e.events.length;let v=x,k;for(;v--;)if(e.events[v][0]==="exit"&&e.events[v][1].type==="chunkFlow"){k=e.events[v][1].end;break}$(r);let w=x;for(;w<e.events.length;)e.events[w][1].end={...k},w++;return no(e.events,v+1,0,e.events.slice(x)),e.events.length=w,O(S)}return s(S)}function O(S){if(r===n.length){if(!i)return d(S);if(i.currentConstruct&&i.currentConstruct.concrete)return h(S);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(s3,c,u)(S)}function c(S){return i&&b(),$(r),d(S)}function u(S){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,h(S)}function d(S){return e.containerState={},t.attempt(s3,f,h)(S)}function f(S){return r++,n.push([e.currentConstruct,e.containerState]),d(S)}function h(S){if(S===null){i&&b(),$(0),t.consume(S);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(S)}function p(S){if(S===null){g(t.exit("chunkFlow"),!0),$(0),t.consume(S);return}return De(S)?(t.consume(S),g(t.exit("chunkFlow")),r=0,e.interrupt=void 0,s):(t.consume(S),p)}function g(S,x){const v=e.sliceStream(S);if(x&&v.push(null),S.previous=o,o&&(o.next=S),o=S,i.defineSkip(S.start),i.write(v),e.parser.lazy[S.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const w=e.events.length;let q=w,_,C;for(;q--;)if(e.events[q][0]==="exit"&&e.events[q][1].type==="chunkFlow"){if(_){C=e.events[q][1].end;break}_=!0}for($(r),k=w;k<e.events.length;)e.events[k][1].end={...C},k++;no(e.events,q+1,0,e.events.slice(w)),e.events.length=k}}function $(S){let x=n.length;for(;x-- >S;){const v=n[x];e.containerState=v[1],v[0].exit.call(e,t)}n.length=S}function b(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function TK(t,e,n){return yt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yf(t){if(t===null||on(t)||hu(t))return 1;if(by(t))return 2}function yy(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const o=t[i].resolveAll;o&&!r.includes(o)&&(e=o(e,n),r.push(o))}return e}const Vw={name:"attention",resolveAll:_K,tokenize:XK};function _K(t,e){let n=-1,r,i,o,a,s,l,O,c;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const u={...t[r][1].end},d={...t[n][1].start};l3(u,-l),l3(d,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...t[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:d},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},t[r][1].end={...a.start},t[n][1].start={...s.end},O=[],t[r][1].end.offset-t[r][1].start.offset&&(O=$o(O,[["enter",t[r][1],e],["exit",t[r][1],e]])),O=$o(O,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),O=$o(O,yy(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),O=$o(O,[["exit",o,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,O=$o(O,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,no(t,r-1,n-r+3,O),n=r+O.length-c-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function XK(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yf(r);let o;return a;function a(l){return o=l,t.enter("attentionSequence"),s(l)}function s(l){if(l===o)return t.consume(l),s;const O=t.exit("attentionSequence"),c=yf(l),u=!c||c===2&&i||n.includes(l),d=!i||i===2&&c||n.includes(r);return O._open=!!(o===42?u:u&&(i||!d)),O._close=!!(o===42?d:d&&(c||!u)),e(l)}}function l3(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const RK={name:"autolink",tokenize:zK};function zK(t,e,n){let r=0;return i;function i(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(f){return Hr(f)?(t.consume(f),a):f===64?n(f):O(f)}function a(f){return f===43||f===45||f===46||Si(f)?(r=1,s(f)):O(f)}function s(f){return f===58?(t.consume(f),r=0,l):(f===43||f===45||f===46||Si(f))&&r++<32?(t.consume(f),s):(r=0,O(f))}function l(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||HQ(f)?n(f):(t.consume(f),l)}function O(f){return f===64?(t.consume(f),c):yK(f)?(t.consume(f),O):n(f)}function c(f){return Si(f)?u(f):n(f)}function u(f){return f===46?(t.consume(f),r=0,c):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):d(f)}function d(f){if((f===45||Si(f))&&r++<63){const h=f===45?d:u;return t.consume(f),h}return n(f)}}const sg={partial:!0,tokenize:CK};function CK(t,e,n){return r;function r(o){return wt(o)?yt(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||De(o)?e(o):n(o)}}const ZZ={continuation:{tokenize:EK},exit:ZK,name:"blockQuote",tokenize:qK};function qK(t,e,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(t.enter("blockQuote",{_container:!0}),s.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),o}return n(a)}function o(a){return wt(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function EK(t,e,n){const r=this;return i;function i(a){return wt(a)?yt(t,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return t.attempt(ZZ,e,n)(a)}}function ZK(t){t.exit("blockQuote")}const YZ={name:"characterEscape",tokenize:YK};function YK(t,e,n){return r;function r(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return vK(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}const VZ={name:"characterReference",tokenize:VK};function VK(t,e,n){const r=this;let i=0,o,a;return s;function s(u){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(u),t.exit("characterReferenceMarker"),l}function l(u){return u===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(u),t.exit("characterReferenceMarkerNumeric"),O):(t.enter("characterReferenceValue"),o=31,a=Si,c(u))}function O(u){return u===88||u===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(u),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,a=SK,c):(t.enter("characterReferenceValue"),o=7,a=Yw,c(u))}function c(u){if(u===59&&i){const d=t.exit("characterReferenceValue");return a===Si&&!GT(r.sliceSerialize(d))?n(u):(t.enter("characterReferenceMarker"),t.consume(u),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(u)&&i++<o?(t.consume(u),c):n(u)}}const O3={partial:!0,tokenize:UK},c3={concrete:!0,name:"codeFenced",tokenize:WK};function WK(t,e,n){const r=this,i={partial:!0,tokenize:v};let o=0,a=0,s;return l;function l(k){return O(k)}function O(k){const w=r.events[r.events.length-1];return o=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,s=k,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===s?(a++,t.consume(k),c):a<3?n(k):(t.exit("codeFencedFenceSequence"),wt(k)?yt(t,u,"whitespace")(k):u(k))}function u(k){return k===null||De(k)?(t.exit("codeFencedFence"),r.interrupt?e(k):t.check(O3,p,x)(k)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||De(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),u(k)):wt(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),yt(t,f,"whitespace")(k)):k===96&&k===s?n(k):(t.consume(k),d)}function f(k){return k===null||De(k)?u(k):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||De(k)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),u(k)):k===96&&k===s?n(k):(t.consume(k),h)}function p(k){return t.attempt(i,x,g)(k)}function g(k){return t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),$}function $(k){return o>0&&wt(k)?yt(t,b,"linePrefix",o+1)(k):b(k)}function b(k){return k===null||De(k)?t.check(O3,p,x)(k):(t.enter("codeFlowValue"),S(k))}function S(k){return k===null||De(k)?(t.exit("codeFlowValue"),b(k)):(t.consume(k),S)}function x(k){return t.exit("codeFenced"),e(k)}function v(k,w,q){let _=0;return C;function C(N){return k.enter("lineEnding"),k.consume(N),k.exit("lineEnding"),I}function I(N){return k.enter("codeFencedFence"),wt(N)?yt(k,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):A(N)}function A(N){return N===s?(k.enter("codeFencedFenceSequence"),G(N)):q(N)}function G(N){return N===s?(_++,k.consume(N),G):_>=a?(k.exit("codeFencedFenceSequence"),wt(N)?yt(k,z,"whitespace")(N):z(N)):q(N)}function z(N){return N===null||De(N)?(k.exit("codeFencedFence"),w(N)):q(N)}}}function UK(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const qv={name:"codeIndented",tokenize:IK},AK={partial:!0,tokenize:MK};function IK(t,e,n){const r=this;return i;function i(O){return t.enter("codeIndented"),yt(t,o,"linePrefix",5)(O)}function o(O){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(O):n(O)}function a(O){return O===null?l(O):De(O)?t.attempt(AK,a,l)(O):(t.enter("codeFlowValue"),s(O))}function s(O){return O===null||De(O)?(t.exit("codeFlowValue"),a(O)):(t.consume(O),s)}function l(O){return t.exit("codeIndented"),e(O)}}function MK(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):De(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):yt(t,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):De(a)?i(a):n(a)}}const jK={name:"codeText",previous:DK,resolve:NK,tokenize:LK};function NK(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function DK(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LK(t,e,n){let r=0,i,o;return a;function a(u){return t.enter("codeText"),t.enter("codeTextSequence"),s(u)}function s(u){return u===96?(t.consume(u),r++,s):(t.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(t.enter("space"),t.consume(u),t.exit("space"),l):u===96?(o=t.enter("codeTextSequence"),i=0,c(u)):De(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),l):(t.enter("codeTextData"),O(u))}function O(u){return u===null||u===32||u===96||De(u)?(t.exit("codeTextData"),l(u)):(t.consume(u),O)}function c(u){return u===96?(t.consume(u),i++,c):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(u)):(o.type="codeTextData",O(u))}}class GK{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Th(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Th(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Th(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Th(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Th(this.left,n.reverse())}}}function Th(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function WZ(t){const e={};let n=-1,r,i,o,a,s,l,O;const c=new GK(t);for(;++n<c.length;){for(;n in e;)n=e[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,BK(c,n)),n=e[n],O=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=c.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},s=c.slice(i,n),s.unshift(r),c.splice(i,n-i+1,s))}}return no(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!O}function BK(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],O={};let c,u,d=-1,f=n,h=0,p=0;const g=[p];for(;f;){for(;t.get(++i)[1]!==f;);o.push(i),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),u&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++d<s.length;)s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(p=d+1,g.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const $=s.slice(g[d],g[d+1]),b=o.pop();l.push([b,b+$.length-1]),t.splice(b,2,$)}for(l.reverse(),d=-1;++d<l.length;)O[h+l[d][0]]=h+l[d][1],h+=l[d][1]-l[d][0]-1;return O}const FK={resolve:KK,tokenize:JK},HK={partial:!0,tokenize:eJ};function KK(t){return WZ(t),t}function JK(t,e){let n;return r;function r(s){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):De(s)?t.check(HK,a,o)(s):(t.consume(s),i)}function o(s){return t.exit("chunkContent"),t.exit("content"),e(s)}function a(s){return t.consume(s),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function eJ(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),yt(t,o,"linePrefix")}function o(a){if(a===null||De(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function UZ(t,e,n,r,i,o,a,s,l){const O=l||Number.POSITIVE_INFINITY;let c=0;return u;function u($){return $===60?(t.enter(r),t.enter(i),t.enter(o),t.consume($),t.exit(o),d):$===null||$===32||$===41||HQ($)?n($):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),p($))}function d($){return $===62?(t.enter(o),t.consume($),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),f($))}function f($){return $===62?(t.exit("chunkString"),t.exit(s),d($)):$===null||$===60||De($)?n($):(t.consume($),$===92?h:f)}function h($){return $===60||$===62||$===92?(t.consume($),f):f($)}function p($){return!c&&($===null||$===41||on($))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e($)):c<O&&$===40?(t.consume($),c++,p):$===41?(t.consume($),c--,p):$===null||$===32||$===40||HQ($)?n($):(t.consume($),$===92?g:p)}function g($){return $===40||$===41||$===92?(t.consume($),p):p($)}}function AZ(t,e,n,r,i,o){const a=this;let s=0,l;return O;function O(f){return t.enter(r),t.enter(i),t.consume(f),t.exit(i),t.enter(o),c}function c(f){return s>999||f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(t.exit(o),t.enter(i),t.consume(f),t.exit(i),t.exit(r),e):De(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===null||f===91||f===93||De(f)||s++>999?(t.exit("chunkString"),c(f)):(t.consume(f),l||(l=!wt(f)),f===92?d:u)}function d(f){return f===91||f===92||f===93?(t.consume(f),s++,u):u(f)}}function IZ(t,e,n,r,i,o){let a;return s;function s(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),a=d===40?41:d,l):n(d)}function l(d){return d===a?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),O(d))}function O(d){return d===a?(t.exit(o),l(a)):d===null?n(d):De(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),yt(t,O,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===a||d===null||De(d)?(t.exit("chunkString"),O(d)):(t.consume(d),d===92?u:c)}function u(d){return d===a||d===92?(t.consume(d),c):c(d)}}function Mp(t,e){let n;return r;function r(i){return De(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):wt(i)?yt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const tJ={name:"definition",tokenize:rJ},nJ={partial:!0,tokenize:iJ};function rJ(t,e,n){const r=this;let i;return o;function o(f){return t.enter("definition"),a(f)}function a(f){return AZ.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=ca(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),l):n(f)}function l(f){return on(f)?Mp(t,O)(f):O(f)}function O(f){return UZ(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function c(f){return t.attempt(nJ,u,u)(f)}function u(f){return wt(f)?yt(t,d,"whitespace")(f):d(f)}function d(f){return f===null||De(f)?(t.exit("definition"),r.parser.defined.push(i),e(f)):n(f)}}function iJ(t,e,n){return r;function r(s){return on(s)?Mp(t,i)(s):n(s)}function i(s){return IZ(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return wt(s)?yt(t,a,"whitespace")(s):a(s)}function a(s){return s===null||De(s)?e(s):n(s)}}const oJ={name:"hardBreakEscape",tokenize:aJ};function aJ(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return De(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const sJ={name:"headingAtx",resolve:lJ,tokenize:OJ};function lJ(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},no(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function OJ(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(t.consume(c),a):c===null||on(c)?(t.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||De(c)?(t.exit("atxHeading"),e(c)):wt(c)?yt(t,s,"whitespace")(c):(t.enter("atxHeadingText"),O(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),s(c))}function O(c){return c===null||c===35||on(c)?(t.exit("atxHeadingText"),s(c)):(t.consume(c),O)}}const cJ=["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"],u3=["pre","script","style","textarea"],uJ={concrete:!0,name:"htmlFlow",resolveTo:hJ,tokenize:pJ},dJ={partial:!0,tokenize:gJ},fJ={partial:!0,tokenize:mJ};function hJ(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function pJ(t,e,n){const r=this;let i,o,a,s,l;return O;function O(Z){return c(Z)}function c(Z){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(Z),u}function u(Z){return Z===33?(t.consume(Z),d):Z===47?(t.consume(Z),o=!0,p):Z===63?(t.consume(Z),i=3,r.interrupt?e:R):Hr(Z)?(t.consume(Z),a=String.fromCharCode(Z),g):n(Z)}function d(Z){return Z===45?(t.consume(Z),i=2,f):Z===91?(t.consume(Z),i=5,s=0,h):Hr(Z)?(t.consume(Z),i=4,r.interrupt?e:R):n(Z)}function f(Z){return Z===45?(t.consume(Z),r.interrupt?e:R):n(Z)}function h(Z){const _t="CDATA[";return Z===_t.charCodeAt(s++)?(t.consume(Z),s===_t.length?r.interrupt?e:A:h):n(Z)}function p(Z){return Hr(Z)?(t.consume(Z),a=String.fromCharCode(Z),g):n(Z)}function g(Z){if(Z===null||Z===47||Z===62||on(Z)){const _t=Z===47,se=a.toLowerCase();return!_t&&!o&&u3.includes(se)?(i=1,r.interrupt?e(Z):A(Z)):cJ.includes(a.toLowerCase())?(i=6,_t?(t.consume(Z),$):r.interrupt?e(Z):A(Z)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(Z):o?b(Z):S(Z))}return Z===45||Si(Z)?(t.consume(Z),a+=String.fromCharCode(Z),g):n(Z)}function $(Z){return Z===62?(t.consume(Z),r.interrupt?e:A):n(Z)}function b(Z){return wt(Z)?(t.consume(Z),b):C(Z)}function S(Z){return Z===47?(t.consume(Z),C):Z===58||Z===95||Hr(Z)?(t.consume(Z),x):wt(Z)?(t.consume(Z),S):C(Z)}function x(Z){return Z===45||Z===46||Z===58||Z===95||Si(Z)?(t.consume(Z),x):v(Z)}function v(Z){return Z===61?(t.consume(Z),k):wt(Z)?(t.consume(Z),v):S(Z)}function k(Z){return Z===null||Z===60||Z===61||Z===62||Z===96?n(Z):Z===34||Z===39?(t.consume(Z),l=Z,w):wt(Z)?(t.consume(Z),k):q(Z)}function w(Z){return Z===l?(t.consume(Z),l=null,_):Z===null||De(Z)?n(Z):(t.consume(Z),w)}function q(Z){return Z===null||Z===34||Z===39||Z===47||Z===60||Z===61||Z===62||Z===96||on(Z)?v(Z):(t.consume(Z),q)}function _(Z){return Z===47||Z===62||wt(Z)?S(Z):n(Z)}function C(Z){return Z===62?(t.consume(Z),I):n(Z)}function I(Z){return Z===null||De(Z)?A(Z):wt(Z)?(t.consume(Z),I):n(Z)}function A(Z){return Z===45&&i===2?(t.consume(Z),L):Z===60&&i===1?(t.consume(Z),D):Z===62&&i===4?(t.consume(Z),oe):Z===63&&i===3?(t.consume(Z),R):Z===93&&i===5?(t.consume(Z),de):De(Z)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(dJ,Qe,G)(Z)):Z===null||De(Z)?(t.exit("htmlFlowData"),G(Z)):(t.consume(Z),A)}function G(Z){return t.check(fJ,z,Qe)(Z)}function z(Z){return t.enter("lineEnding"),t.consume(Z),t.exit("lineEnding"),N}function N(Z){return Z===null||De(Z)?G(Z):(t.enter("htmlFlowData"),A(Z))}function L(Z){return Z===45?(t.consume(Z),R):A(Z)}function D(Z){return Z===47?(t.consume(Z),a="",le):A(Z)}function le(Z){if(Z===62){const _t=a.toLowerCase();return u3.includes(_t)?(t.consume(Z),oe):A(Z)}return Hr(Z)&&a.length<8?(t.consume(Z),a+=String.fromCharCode(Z),le):A(Z)}function de(Z){return Z===93?(t.consume(Z),R):A(Z)}function R(Z){return Z===62?(t.consume(Z),oe):Z===45&&i===2?(t.consume(Z),R):A(Z)}function oe(Z){return Z===null||De(Z)?(t.exit("htmlFlowData"),Qe(Z)):(t.consume(Z),oe)}function Qe(Z){return t.exit("htmlFlow"),e(Z)}}function mJ(t,e,n){const r=this;return i;function i(a){return De(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function gJ(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(sg,e,n)}}const $J={name:"htmlText",tokenize:QJ};function QJ(t,e,n){const r=this;let i,o,a;return s;function s(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),l}function l(R){return R===33?(t.consume(R),O):R===47?(t.consume(R),v):R===63?(t.consume(R),S):Hr(R)?(t.consume(R),q):n(R)}function O(R){return R===45?(t.consume(R),c):R===91?(t.consume(R),o=0,h):Hr(R)?(t.consume(R),b):n(R)}function c(R){return R===45?(t.consume(R),f):n(R)}function u(R){return R===null?n(R):R===45?(t.consume(R),d):De(R)?(a=u,D(R)):(t.consume(R),u)}function d(R){return R===45?(t.consume(R),f):u(R)}function f(R){return R===62?L(R):R===45?d(R):u(R)}function h(R){const oe="CDATA[";return R===oe.charCodeAt(o++)?(t.consume(R),o===oe.length?p:h):n(R)}function p(R){return R===null?n(R):R===93?(t.consume(R),g):De(R)?(a=p,D(R)):(t.consume(R),p)}function g(R){return R===93?(t.consume(R),$):p(R)}function $(R){return R===62?L(R):R===93?(t.consume(R),$):p(R)}function b(R){return R===null||R===62?L(R):De(R)?(a=b,D(R)):(t.consume(R),b)}function S(R){return R===null?n(R):R===63?(t.consume(R),x):De(R)?(a=S,D(R)):(t.consume(R),S)}function x(R){return R===62?L(R):S(R)}function v(R){return Hr(R)?(t.consume(R),k):n(R)}function k(R){return R===45||Si(R)?(t.consume(R),k):w(R)}function w(R){return De(R)?(a=w,D(R)):wt(R)?(t.consume(R),w):L(R)}function q(R){return R===45||Si(R)?(t.consume(R),q):R===47||R===62||on(R)?_(R):n(R)}function _(R){return R===47?(t.consume(R),L):R===58||R===95||Hr(R)?(t.consume(R),C):De(R)?(a=_,D(R)):wt(R)?(t.consume(R),_):L(R)}function C(R){return R===45||R===46||R===58||R===95||Si(R)?(t.consume(R),C):I(R)}function I(R){return R===61?(t.consume(R),A):De(R)?(a=I,D(R)):wt(R)?(t.consume(R),I):_(R)}function A(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),i=R,G):De(R)?(a=A,D(R)):wt(R)?(t.consume(R),A):(t.consume(R),z)}function G(R){return R===i?(t.consume(R),i=void 0,N):R===null?n(R):De(R)?(a=G,D(R)):(t.consume(R),G)}function z(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||on(R)?_(R):(t.consume(R),z)}function N(R){return R===47||R===62||on(R)?_(R):n(R)}function L(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),e):n(R)}function D(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),le}function le(R){return wt(R)?yt(t,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):de(R)}function de(R){return t.enter("htmlTextData"),a(R)}}const HT={name:"labelEnd",resolveAll:vJ,resolveTo:kJ,tokenize:PJ},bJ={tokenize:wJ},yJ={tokenize:xJ},SJ={tokenize:TJ};function vJ(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&no(t,0,t.length,n),t}function kJ(t,e){let n=t.length,r=0,i,o,a,s;for(;n--;)if(i=t[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},O={type:"label",start:{...t[o][1].start},end:{...t[a][1].end}},c={type:"labelText",start:{...t[o+r+2][1].end},end:{...t[a-2][1].start}};return s=[["enter",l,e],["enter",O,e]],s=$o(s,t.slice(o+1,o+r+3)),s=$o(s,[["enter",c,e]]),s=$o(s,yy(e.parser.constructs.insideSpan.null,t.slice(o+r+4,a-3),e)),s=$o(s,[["exit",c,e],t[a-2],t[a-1],["exit",O,e]]),s=$o(s,t.slice(a+1)),s=$o(s,[["exit",l,e]]),no(t,o,t.length,s),t}function PJ(t,e,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(d){return o?o._inactive?u(d):(a=r.parser.defined.includes(ca(r.sliceSerialize({start:o.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelEnd"),l):n(d)}function l(d){return d===40?t.attempt(bJ,c,a?c:u)(d):d===91?t.attempt(yJ,c,a?O:u)(d):a?c(d):u(d)}function O(d){return t.attempt(SJ,c,u)(d)}function c(d){return e(d)}function u(d){return o._balanced=!0,n(d)}}function wJ(t,e,n){return r;function r(u){return t.enter("resource"),t.enter("resourceMarker"),t.consume(u),t.exit("resourceMarker"),i}function i(u){return on(u)?Mp(t,o)(u):o(u)}function o(u){return u===41?c(u):UZ(t,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return on(u)?Mp(t,l)(u):c(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?IZ(t,O,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):c(u)}function O(u){return on(u)?Mp(t,c)(u):c(u)}function c(u){return u===41?(t.enter("resourceMarker"),t.consume(u),t.exit("resourceMarker"),t.exit("resource"),e):n(u)}}function xJ(t,e,n){const r=this;return i;function i(s){return AZ.call(r,t,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(ca(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(s):n(s)}function a(s){return n(s)}}function TJ(t,e,n){return r;function r(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}const _J={name:"labelStartImage",resolveAll:HT.resolveAll,tokenize:XJ};function XJ(t,e,n){const r=this;return i;function i(s){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(s),t.exit("labelImageMarker"),o}function o(s){return s===91?(t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const RJ={name:"labelStartLink",resolveAll:HT.resolveAll,tokenize:zJ};function zJ(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const Ev={name:"lineEnding",tokenize:CJ};function CJ(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),yt(t,e,"linePrefix")}}const E$={name:"thematicBreak",tokenize:qJ};function qJ(t,e,n){let r=0,i;return o;function o(O){return t.enter("thematicBreak"),a(O)}function a(O){return i=O,s(O)}function s(O){return O===i?(t.enter("thematicBreakSequence"),l(O)):r>=3&&(O===null||De(O))?(t.exit("thematicBreak"),e(O)):n(O)}function l(O){return O===i?(t.consume(O),r++,l):(t.exit("thematicBreakSequence"),wt(O)?yt(t,s,"whitespace")(O):s(O))}}const ci={continuation:{tokenize:VJ},exit:UJ,name:"list",tokenize:YJ},EJ={partial:!0,tokenize:AJ},ZJ={partial:!0,tokenize:WJ};function YJ(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const h=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Yw(f)){if(r.containerState.type||(r.containerState.type=h,t.enter(h,{_container:!0})),h==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(E$,n,O)(f):O(f);if(!r.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(f)}return n(f)}function l(f){return Yw(f)&&++a<10?(t.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),O(f)):n(f)}function O(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,t.check(sg,r.interrupt?n:c,t.attempt(EJ,d,u))}function c(f){return r.containerState.initialBlankLine=!0,o++,d(f)}function u(f){return wt(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),d):n(f)}function d(f){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}function VJ(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(sg,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,yt(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!wt(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(ZJ,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,yt(t,t.attempt(ci,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function WJ(t,e,n){const r=this;return yt(t,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(o):n(o)}}function UJ(t){t.exit(this.containerState.type)}function AJ(t,e,n){const r=this;return yt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!wt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const d3={name:"setextUnderline",resolveTo:IJ,tokenize:MJ};function IJ(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",a,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function MJ(t,e,n){const r=this;let i;return o;function o(O){let c=r.events.length,u;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){u=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(t.enter("setextHeadingLine"),i=O,a(O)):n(O)}function a(O){return t.enter("setextHeadingLineSequence"),s(O)}function s(O){return O===i?(t.consume(O),s):(t.exit("setextHeadingLineSequence"),wt(O)?yt(t,l,"lineSuffix")(O):l(O))}function l(O){return O===null||De(O)?(t.exit("setextHeadingLine"),e(O)):n(O)}}const jJ={tokenize:NJ};function NJ(t){const e=this,n=t.attempt(sg,r,t.attempt(this.parser.constructs.flowInitial,i,yt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(FK,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const DJ={resolveAll:jZ()},LJ=MZ("string"),GJ=MZ("text");function MZ(t){return{resolveAll:jZ(t==="text"?BJ:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,a,s);return a;function a(c){return O(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return O(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function O(c){if(c===null)return!0;const u=i[c];let d=-1;if(u)for(;++d<u.length;){const f=u[d];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function jZ(t){return e;function e(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(n,r):n}}function BJ(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const O=i[o];if(typeof O=="string"){for(a=O.length;O.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(O===-2)l=!0,s++;else if(O!==-1){o++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(s=0),s){const O={type:n===t.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...O.start},r.start.offset===r.end.offset?Object.assign(r,O):(t.splice(n,0,["enter",O,e],["exit",O,e]),n+=2)}n++}return t}const FJ={42:ci,43:ci,45:ci,48:ci,49:ci,50:ci,51:ci,52:ci,53:ci,54:ci,55:ci,56:ci,57:ci,62:ZZ},HJ={91:tJ},KJ={[-2]:qv,[-1]:qv,32:qv},JJ={35:sJ,42:E$,45:[d3,E$],60:uJ,61:d3,95:E$,96:c3,126:c3},eee={38:VZ,92:YZ},tee={[-5]:Ev,[-4]:Ev,[-3]:Ev,33:_J,38:VZ,42:Vw,60:[RK,$J],91:RJ,92:[oJ,YZ],93:HT,95:Vw,96:jK},nee={null:[Vw,DJ]},ree={null:[42,95]},iee={null:[]},oee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ree,contentInitial:HJ,disable:iee,document:FJ,flow:JJ,flowInitial:KJ,insideSpan:nee,string:eee,text:tee},Symbol.toStringTag,{value:"Module"}));function aee(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:w(v),check:w(k),consume:b,enter:S,exit:x,interrupt:w(k,{interrupt:!0})},O={code:null,containerState:{},defineSkip:p,events:[],now:h,parser:t,previous:null,sliceSerialize:d,sliceStream:f,write:u};let c=e.tokenize.call(O,l);return e.resolveAll&&o.push(e),O;function u(I){return a=$o(a,I),g(),a[a.length-1]!==null?[]:(q(e,0),O.events=yy(o,O.events,O),O.events)}function d(I,A){return lee(f(I),A)}function f(I){return see(a,I)}function h(){const{_bufferIndex:I,_index:A,line:G,column:z,offset:N}=r;return{_bufferIndex:I,_index:A,line:G,column:z,offset:N}}function p(I){i[I.line]=I.column,C()}function g(){let I;for(;r._index<a.length;){const A=a[r._index];if(typeof A=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<A.length;)$(A.charCodeAt(r._bufferIndex));else $(A)}}function $(I){c=c(I)}function b(I){De(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,C()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),O.previous=I}function S(I,A){const G=A||{};return G.type=I,G.start=h(),O.events.push(["enter",G,O]),s.push(G),G}function x(I){const A=s.pop();return A.end=h(),O.events.push(["exit",A,O]),A}function v(I,A){q(I,A.from)}function k(I,A){A.restore()}function w(I,A){return G;function G(z,N,L){let D,le,de,R;return Array.isArray(z)?Qe(z):"tokenize"in z?Qe([z]):oe(z);function oe(Pe){return tt;function tt(ht){const Ct=ht!==null&&Pe[ht],Ft=ht!==null&&Pe.null,fr=[...Array.isArray(Ct)?Ct:Ct?[Ct]:[],...Array.isArray(Ft)?Ft:Ft?[Ft]:[]];return Qe(fr)(ht)}}function Qe(Pe){return D=Pe,le=0,Pe.length===0?L:Z(Pe[le])}function Z(Pe){return tt;function tt(ht){return R=_(),de=Pe,Pe.partial||(O.currentConstruct=Pe),Pe.name&&O.parser.constructs.disable.null.includes(Pe.name)?se():Pe.tokenize.call(A?Object.assign(Object.create(O),A):O,l,_t,se)(ht)}}function _t(Pe){return I(de,R),N}function se(Pe){return R.restore(),++le<D.length?Z(D[le]):L}}}function q(I,A){I.resolveAll&&!o.includes(I)&&o.push(I),I.resolve&&no(O.events,A,O.events.length-A,I.resolve(O.events.slice(A),O)),I.resolveTo&&(O.events=I.resolveTo(O.events,O))}function _(){const I=h(),A=O.previous,G=O.currentConstruct,z=O.events.length,N=Array.from(s);return{from:z,restore:L};function L(){r=I,O.previous=A,O.currentConstruct=G,O.events.length=z,s=N,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function see(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,o)];else{if(a=t.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(t[i].slice(0,o))}return a}function lee(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const o=t[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
1
|
+
var F7=t=>{throw TypeError(t)};var Pv=(t,e,n)=>e.has(t)||F7("Cannot "+n);var U=(t,e,n)=>(Pv(t,e,"read from private field"),n?n.call(t):e.get(t)),ge=(t,e,n)=>e.has(t)?F7("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),te=(t,e,n,r)=>(Pv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),s1=(t,e,n)=>(Pv(t,e,"access private method"),n);import{g as LH,_ as ee}from"./startup-runtime-BrfuwjQS.js";import{H as Qy,I as DT,J as fu,K as ns,L as LT,M as GH,N as H7,O as BH,P as bo,R as zZ}from"./ai-chat-BnWVpTEI.js";import{d as GT,p as Wo}from"./diagram-engines-DpAsX7pc.js";function K7(t){if(t)throw t}var wv,J7;function FH(){if(J7)return wv;J7=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(O){return typeof Array.isArray=="function"?Array.isArray(O):e.call(O)==="[object Array]"},o=function(O){if(!O||e.call(O)!=="[object Object]")return!1;var c=t.call(O,"constructor"),u=O.constructor&&O.constructor.prototype&&t.call(O.constructor.prototype,"isPrototypeOf");if(O.constructor&&!c&&!u)return!1;var d;for(d in O);return typeof d>"u"||t.call(O,d)},a=function(O,c){n&&c.name==="__proto__"?n(O,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):O[c.name]=c.newValue},s=function(O,c){if(c==="__proto__")if(t.call(O,c)){if(r)return r(O,c).value}else return;return O[c]};return wv=function l(){var O,c,u,d,f,h,p=arguments[0],g=1,$=arguments.length,b=!1;for(typeof p=="boolean"&&(b=p,p=arguments[1]||{},g=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});g<$;++g)if(O=arguments[g],O!=null)for(c in O)u=s(p,c),d=s(O,c),p!==d&&(b&&d&&(o(d)||(f=i(d)))?(f?(f=!1,h=u&&i(u)?u:[]):h=u&&o(u)?u:{},a(p,{name:c,newValue:l(b,h,d)})):typeof d<"u"&&a(p,{name:c,newValue:d}));return p},wv}var HH=FH();const xv=LH(HH);function Cw(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function KH(){const t=[],e={run:n,use:r};return e;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...O){const c=t[++o];let u=-1;if(l){a(l);return}for(;++u<i.length;)(O[u]===null||O[u]===void 0)&&(O[u]=i[u]);i=O,c?JH(c,s)(...O):a(null,...O)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function JH(t,e){let n;return r;function r(...a){const s=t.length>a.length;let l;s&&a.push(i);try{l=t.apply(this,a)}catch(O){const c=O;if(s&&n)throw c;return i(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,e(a,...s))}function o(a){i(null,a)}}function Ip(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?e3(t.position):"start"in t||"end"in t?e3(t):"line"in t||"column"in t?qw(t):""}function qw(t){return t3(t&&t.line)+":"+t3(t&&t.column)}function e3(t){return qw(t&&t.start)+"-"+qw(t&&t.end)}function t3(t){return t&&typeof t=="number"?t:1}class xi extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(a=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Ip(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}xi.prototype.file="";xi.prototype.name="";xi.prototype.reason="";xi.prototype.message="";xi.prototype.stack="";xi.prototype.column=void 0;xi.prototype.line=void 0;xi.prototype.ancestors=void 0;xi.prototype.cause=void 0;xi.prototype.fatal=void 0;xi.prototype.place=void 0;xi.prototype.ruleId=void 0;xi.prototype.source=void 0;const Ya={basename:eK,dirname:tK,extname:nK,join:rK,sep:"/"};function eK(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ag(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,s=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(t.codePointAt(i)===e.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function tK(t){if(ag(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function nK(t){ag(t);let e=t.length,n=-1,r=0,i=-1,o=0,a;for(;e--;){const s=t.codePointAt(e);if(s===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),s===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function rK(...t){let e=-1,n;for(;++e<t.length;)ag(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":iK(n)}function iK(t){ag(t);const e=t.codePointAt(0)===47;let n=oK(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function oK(t,e){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=t.length;){if(a<t.length)s=t.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function ag(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const aK={cwd:sK};function sK(){return"/"}function Ew(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function lK(t){if(typeof t=="string")t=new URL(t);else if(!Ew(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return OK(t)}function OK(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Tv=["history","path","basename","stem","extname","dirname"];class cK{constructor(e){let n;e?Ew(e)?n={path:e}:typeof e=="string"||uK(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":aK.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Tv.length;){const o=Tv[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Tv.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ya.basename(this.path):void 0}set basename(e){Xv(e,"basename"),_v(e,"basename"),this.path=Ya.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Ya.dirname(this.path):void 0}set dirname(e){n3(this.basename,"dirname"),this.path=Ya.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Ya.extname(this.path):void 0}set extname(e){if(_v(e,"extname"),n3(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ya.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ew(e)&&(e=lK(e)),Xv(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Ya.basename(this.path,this.extname):void 0}set stem(e){Xv(e,"stem"),_v(e,"stem"),this.path=Ya.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new xi(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function _v(t,e){if(t&&t.includes(Ya.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ya.sep+"`")}function Xv(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function n3(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function uK(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const dK=(function(t){const r=this.constructor.prototype,i=r[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),fK={}.hasOwnProperty;class BT extends dK{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=KH()}copy(){const e=new BT;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(xv(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Cv("data",this.frozen),this.namespace[e]=n,this):fK.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Cv("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=l1(e),r=this.parser||this.Parser;return Rv("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),Rv("process",this.parser||this.Parser),zv("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=l1(e),l=r.parse(s);r.run(l,s,function(c,u,d){if(c||!u||!d)return O(c);const f=u,h=r.stringify(f,d);pK(h)?d.value=h:d.result=h,O(c,d)});function O(c,u){c||!u?a(c):o?o(u):n(void 0,u)}}}processSync(e){let n=!1,r;return this.freeze(),Rv("processSync",this.parser||this.Parser),zv("processSync",this.compiler||this.Compiler),this.process(e,i),i3("processSync","process",n),r;function i(o,a){n=!0,K7(o),r=a}}run(e,n,r){r3(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=l1(n);i.run(e,l,O);function O(c,u,d){const f=u||e;c?s(c):a?a(f):r(void 0,f,d)}}}runSync(e,n){let r=!1,i;return this.run(e,n,o),i3("runSync","run",r),i;function o(a,s){K7(a),i=s,r=!0}}stringify(e,n){this.freeze();const r=l1(n),i=this.compiler||this.Compiler;return zv("stringify",i),r3(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(Cv("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?s(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(O){if(typeof O=="function")l(O,[]);else if(typeof O=="object")if(Array.isArray(O)){const[c,...u]=O;l(c,u)}else a(O);else throw new TypeError("Expected usable value, not `"+O+"`")}function a(O){if(!("plugins"in O)&&!("settings"in O))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(O.plugins),O.settings&&(i.settings=xv(!0,i.settings,O.settings))}function s(O){let c=-1;if(O!=null)if(Array.isArray(O))for(;++c<O.length;){const u=O[c];o(u)}else throw new TypeError("Expected a list of plugins, not `"+O+"`")}function l(O,c){let u=-1,d=-1;for(;++u<r.length;)if(r[u][0]===O){d=u;break}if(d===-1)r.push([O,...c]);else if(c.length>0){let[f,...h]=c;const p=r[d][1];Cw(p)&&Cw(f)&&(f=xv(!0,p,f)),r[d]=[O,f,...h]}}}}const Zw=new BT().freeze();function Rv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function zv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Cv(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function r3(t){if(!Cw(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function i3(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function l1(t){return hK(t)?t:new cK(t)}function hK(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function pK(t){return typeof t=="string"||mK(t)}function mK(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const gK={};function FT(t,e){const n=gK,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return CZ(t,r,i)}function CZ(t,e,n){if($K(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return o3(t.children,e,n)}return Array.isArray(t)?o3(t,e,n):""}function o3(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=CZ(t[i],e,n);return r.join("")}function $K(t){return!!(t&&typeof t=="object")}function no(t,e,n,r){const i=t.length;let o=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(e,0),t.splice(...a),o+=1e4,e+=1e4}function $o(t,e){return t.length>0?(no(t,t.length,0,e),t):e}const a3={}.hasOwnProperty;function qZ(t){const e={};let n=-1;for(;++n<t.length;)QK(e,t[n]);return e}function QK(t,e){let n;for(n in e){const i=(a3.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n];let a;if(o)for(a in o){a3.call(i,a)||(i[a]=[]);const s=o[a];bK(i[a],Array.isArray(s)?s:s?[s]:[])}}}function bK(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);no(t,0,0,r)}function EZ(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ca(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Hr=WO(/[A-Za-z]/),Si=WO(/[\dA-Za-z]/),yK=WO(/[#-'*+\--9=?A-Z^-~]/);function HQ(t){return t!==null&&(t<32||t===127)}const Yw=WO(/\d/),SK=WO(/[\dA-Fa-f]/),vK=WO(/[!-/:-@[-`{-~]/);function De(t){return t!==null&&t<-2}function on(t){return t!==null&&(t<0||t===32)}function wt(t){return t===-2||t===-1||t===32}const by=WO(new RegExp("\\p{P}|\\p{S}","u")),hu=WO(/\s/);function WO(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function yt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return wt(l)?(t.enter(n),s(l)):e(l)}function s(l){return wt(l)&&o++<i?(t.consume(l),s):(t.exit(n),e(l))}}const kK={tokenize:PK};function PK(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),yt(t,e,"linePrefix")}function i(s){return t.enter("paragraph"),o(s)}function o(s){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return De(s)?(t.consume(s),t.exit("chunkText"),o):(t.consume(s),a)}}const wK={tokenize:xK},s3={tokenize:TK};function xK(t){const e=this,n=[];let r=0,i,o,a;return s;function s(S){if(r<n.length){const x=n[r];return e.containerState=x[1],t.attempt(x[0].continuation,l,O)(S)}return O(S)}function l(S){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&b();const x=e.events.length;let v=x,k;for(;v--;)if(e.events[v][0]==="exit"&&e.events[v][1].type==="chunkFlow"){k=e.events[v][1].end;break}$(r);let w=x;for(;w<e.events.length;)e.events[w][1].end={...k},w++;return no(e.events,v+1,0,e.events.slice(x)),e.events.length=w,O(S)}return s(S)}function O(S){if(r===n.length){if(!i)return d(S);if(i.currentConstruct&&i.currentConstruct.concrete)return h(S);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(s3,c,u)(S)}function c(S){return i&&b(),$(r),d(S)}function u(S){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,h(S)}function d(S){return e.containerState={},t.attempt(s3,f,h)(S)}function f(S){return r++,n.push([e.currentConstruct,e.containerState]),d(S)}function h(S){if(S===null){i&&b(),$(0),t.consume(S);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(S)}function p(S){if(S===null){g(t.exit("chunkFlow"),!0),$(0),t.consume(S);return}return De(S)?(t.consume(S),g(t.exit("chunkFlow")),r=0,e.interrupt=void 0,s):(t.consume(S),p)}function g(S,x){const v=e.sliceStream(S);if(x&&v.push(null),S.previous=o,o&&(o.next=S),o=S,i.defineSkip(S.start),i.write(v),e.parser.lazy[S.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const w=e.events.length;let q=w,_,C;for(;q--;)if(e.events[q][0]==="exit"&&e.events[q][1].type==="chunkFlow"){if(_){C=e.events[q][1].end;break}_=!0}for($(r),k=w;k<e.events.length;)e.events[k][1].end={...C},k++;no(e.events,q+1,0,e.events.slice(w)),e.events.length=k}}function $(S){let x=n.length;for(;x-- >S;){const v=n[x];e.containerState=v[1],v[0].exit.call(e,t)}n.length=S}function b(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function TK(t,e,n){return yt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yf(t){if(t===null||on(t)||hu(t))return 1;if(by(t))return 2}function yy(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const o=t[i].resolveAll;o&&!r.includes(o)&&(e=o(e,n),r.push(o))}return e}const Vw={name:"attention",resolveAll:_K,tokenize:XK};function _K(t,e){let n=-1,r,i,o,a,s,l,O,c;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const u={...t[r][1].end},d={...t[n][1].start};l3(u,-l),l3(d,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...t[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:d},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},t[r][1].end={...a.start},t[n][1].start={...s.end},O=[],t[r][1].end.offset-t[r][1].start.offset&&(O=$o(O,[["enter",t[r][1],e],["exit",t[r][1],e]])),O=$o(O,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),O=$o(O,yy(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),O=$o(O,[["exit",o,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,O=$o(O,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,no(t,r-1,n-r+3,O),n=r+O.length-c-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function XK(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yf(r);let o;return a;function a(l){return o=l,t.enter("attentionSequence"),s(l)}function s(l){if(l===o)return t.consume(l),s;const O=t.exit("attentionSequence"),c=yf(l),u=!c||c===2&&i||n.includes(l),d=!i||i===2&&c||n.includes(r);return O._open=!!(o===42?u:u&&(i||!d)),O._close=!!(o===42?d:d&&(c||!u)),e(l)}}function l3(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const RK={name:"autolink",tokenize:zK};function zK(t,e,n){let r=0;return i;function i(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(f){return Hr(f)?(t.consume(f),a):f===64?n(f):O(f)}function a(f){return f===43||f===45||f===46||Si(f)?(r=1,s(f)):O(f)}function s(f){return f===58?(t.consume(f),r=0,l):(f===43||f===45||f===46||Si(f))&&r++<32?(t.consume(f),s):(r=0,O(f))}function l(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||HQ(f)?n(f):(t.consume(f),l)}function O(f){return f===64?(t.consume(f),c):yK(f)?(t.consume(f),O):n(f)}function c(f){return Si(f)?u(f):n(f)}function u(f){return f===46?(t.consume(f),r=0,c):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):d(f)}function d(f){if((f===45||Si(f))&&r++<63){const h=f===45?d:u;return t.consume(f),h}return n(f)}}const sg={partial:!0,tokenize:CK};function CK(t,e,n){return r;function r(o){return wt(o)?yt(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||De(o)?e(o):n(o)}}const ZZ={continuation:{tokenize:EK},exit:ZK,name:"blockQuote",tokenize:qK};function qK(t,e,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(t.enter("blockQuote",{_container:!0}),s.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),o}return n(a)}function o(a){return wt(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function EK(t,e,n){const r=this;return i;function i(a){return wt(a)?yt(t,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return t.attempt(ZZ,e,n)(a)}}function ZK(t){t.exit("blockQuote")}const YZ={name:"characterEscape",tokenize:YK};function YK(t,e,n){return r;function r(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return vK(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}const VZ={name:"characterReference",tokenize:VK};function VK(t,e,n){const r=this;let i=0,o,a;return s;function s(u){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(u),t.exit("characterReferenceMarker"),l}function l(u){return u===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(u),t.exit("characterReferenceMarkerNumeric"),O):(t.enter("characterReferenceValue"),o=31,a=Si,c(u))}function O(u){return u===88||u===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(u),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,a=SK,c):(t.enter("characterReferenceValue"),o=7,a=Yw,c(u))}function c(u){if(u===59&&i){const d=t.exit("characterReferenceValue");return a===Si&&!GT(r.sliceSerialize(d))?n(u):(t.enter("characterReferenceMarker"),t.consume(u),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(u)&&i++<o?(t.consume(u),c):n(u)}}const O3={partial:!0,tokenize:UK},c3={concrete:!0,name:"codeFenced",tokenize:WK};function WK(t,e,n){const r=this,i={partial:!0,tokenize:v};let o=0,a=0,s;return l;function l(k){return O(k)}function O(k){const w=r.events[r.events.length-1];return o=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,s=k,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===s?(a++,t.consume(k),c):a<3?n(k):(t.exit("codeFencedFenceSequence"),wt(k)?yt(t,u,"whitespace")(k):u(k))}function u(k){return k===null||De(k)?(t.exit("codeFencedFence"),r.interrupt?e(k):t.check(O3,p,x)(k)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||De(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),u(k)):wt(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),yt(t,f,"whitespace")(k)):k===96&&k===s?n(k):(t.consume(k),d)}function f(k){return k===null||De(k)?u(k):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||De(k)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),u(k)):k===96&&k===s?n(k):(t.consume(k),h)}function p(k){return t.attempt(i,x,g)(k)}function g(k){return t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),$}function $(k){return o>0&&wt(k)?yt(t,b,"linePrefix",o+1)(k):b(k)}function b(k){return k===null||De(k)?t.check(O3,p,x)(k):(t.enter("codeFlowValue"),S(k))}function S(k){return k===null||De(k)?(t.exit("codeFlowValue"),b(k)):(t.consume(k),S)}function x(k){return t.exit("codeFenced"),e(k)}function v(k,w,q){let _=0;return C;function C(N){return k.enter("lineEnding"),k.consume(N),k.exit("lineEnding"),I}function I(N){return k.enter("codeFencedFence"),wt(N)?yt(k,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):A(N)}function A(N){return N===s?(k.enter("codeFencedFenceSequence"),G(N)):q(N)}function G(N){return N===s?(_++,k.consume(N),G):_>=a?(k.exit("codeFencedFenceSequence"),wt(N)?yt(k,z,"whitespace")(N):z(N)):q(N)}function z(N){return N===null||De(N)?(k.exit("codeFencedFence"),w(N)):q(N)}}}function UK(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const qv={name:"codeIndented",tokenize:IK},AK={partial:!0,tokenize:MK};function IK(t,e,n){const r=this;return i;function i(O){return t.enter("codeIndented"),yt(t,o,"linePrefix",5)(O)}function o(O){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(O):n(O)}function a(O){return O===null?l(O):De(O)?t.attempt(AK,a,l)(O):(t.enter("codeFlowValue"),s(O))}function s(O){return O===null||De(O)?(t.exit("codeFlowValue"),a(O)):(t.consume(O),s)}function l(O){return t.exit("codeIndented"),e(O)}}function MK(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):De(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):yt(t,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):De(a)?i(a):n(a)}}const jK={name:"codeText",previous:DK,resolve:NK,tokenize:LK};function NK(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function DK(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LK(t,e,n){let r=0,i,o;return a;function a(u){return t.enter("codeText"),t.enter("codeTextSequence"),s(u)}function s(u){return u===96?(t.consume(u),r++,s):(t.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(t.enter("space"),t.consume(u),t.exit("space"),l):u===96?(o=t.enter("codeTextSequence"),i=0,c(u)):De(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),l):(t.enter("codeTextData"),O(u))}function O(u){return u===null||u===32||u===96||De(u)?(t.exit("codeTextData"),l(u)):(t.consume(u),O)}function c(u){return u===96?(t.consume(u),i++,c):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(u)):(o.type="codeTextData",O(u))}}class GK{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Th(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Th(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Th(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Th(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Th(this.left,n.reverse())}}}function Th(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function WZ(t){const e={};let n=-1,r,i,o,a,s,l,O;const c=new GK(t);for(;++n<c.length;){for(;n in e;)n=e[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,BK(c,n)),n=e[n],O=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=c.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},s=c.slice(i,n),s.unshift(r),c.splice(i,n-i+1,s))}}return no(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!O}function BK(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],O={};let c,u,d=-1,f=n,h=0,p=0;const g=[p];for(;f;){for(;t.get(++i)[1]!==f;);o.push(i),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),u&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++d<s.length;)s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(p=d+1,g.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const $=s.slice(g[d],g[d+1]),b=o.pop();l.push([b,b+$.length-1]),t.splice(b,2,$)}for(l.reverse(),d=-1;++d<l.length;)O[h+l[d][0]]=h+l[d][1],h+=l[d][1]-l[d][0]-1;return O}const FK={resolve:KK,tokenize:JK},HK={partial:!0,tokenize:eJ};function KK(t){return WZ(t),t}function JK(t,e){let n;return r;function r(s){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):De(s)?t.check(HK,a,o)(s):(t.consume(s),i)}function o(s){return t.exit("chunkContent"),t.exit("content"),e(s)}function a(s){return t.consume(s),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function eJ(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),yt(t,o,"linePrefix")}function o(a){if(a===null||De(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function UZ(t,e,n,r,i,o,a,s,l){const O=l||Number.POSITIVE_INFINITY;let c=0;return u;function u($){return $===60?(t.enter(r),t.enter(i),t.enter(o),t.consume($),t.exit(o),d):$===null||$===32||$===41||HQ($)?n($):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),p($))}function d($){return $===62?(t.enter(o),t.consume($),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),f($))}function f($){return $===62?(t.exit("chunkString"),t.exit(s),d($)):$===null||$===60||De($)?n($):(t.consume($),$===92?h:f)}function h($){return $===60||$===62||$===92?(t.consume($),f):f($)}function p($){return!c&&($===null||$===41||on($))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e($)):c<O&&$===40?(t.consume($),c++,p):$===41?(t.consume($),c--,p):$===null||$===32||$===40||HQ($)?n($):(t.consume($),$===92?g:p)}function g($){return $===40||$===41||$===92?(t.consume($),p):p($)}}function AZ(t,e,n,r,i,o){const a=this;let s=0,l;return O;function O(f){return t.enter(r),t.enter(i),t.consume(f),t.exit(i),t.enter(o),c}function c(f){return s>999||f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(t.exit(o),t.enter(i),t.consume(f),t.exit(i),t.exit(r),e):De(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===null||f===91||f===93||De(f)||s++>999?(t.exit("chunkString"),c(f)):(t.consume(f),l||(l=!wt(f)),f===92?d:u)}function d(f){return f===91||f===92||f===93?(t.consume(f),s++,u):u(f)}}function IZ(t,e,n,r,i,o){let a;return s;function s(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),a=d===40?41:d,l):n(d)}function l(d){return d===a?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),O(d))}function O(d){return d===a?(t.exit(o),l(a)):d===null?n(d):De(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),yt(t,O,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===a||d===null||De(d)?(t.exit("chunkString"),O(d)):(t.consume(d),d===92?u:c)}function u(d){return d===a||d===92?(t.consume(d),c):c(d)}}function Mp(t,e){let n;return r;function r(i){return De(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):wt(i)?yt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const tJ={name:"definition",tokenize:rJ},nJ={partial:!0,tokenize:iJ};function rJ(t,e,n){const r=this;let i;return o;function o(f){return t.enter("definition"),a(f)}function a(f){return AZ.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=ca(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),l):n(f)}function l(f){return on(f)?Mp(t,O)(f):O(f)}function O(f){return UZ(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function c(f){return t.attempt(nJ,u,u)(f)}function u(f){return wt(f)?yt(t,d,"whitespace")(f):d(f)}function d(f){return f===null||De(f)?(t.exit("definition"),r.parser.defined.push(i),e(f)):n(f)}}function iJ(t,e,n){return r;function r(s){return on(s)?Mp(t,i)(s):n(s)}function i(s){return IZ(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return wt(s)?yt(t,a,"whitespace")(s):a(s)}function a(s){return s===null||De(s)?e(s):n(s)}}const oJ={name:"hardBreakEscape",tokenize:aJ};function aJ(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return De(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const sJ={name:"headingAtx",resolve:lJ,tokenize:OJ};function lJ(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},no(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function OJ(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(t.consume(c),a):c===null||on(c)?(t.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||De(c)?(t.exit("atxHeading"),e(c)):wt(c)?yt(t,s,"whitespace")(c):(t.enter("atxHeadingText"),O(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),s(c))}function O(c){return c===null||c===35||on(c)?(t.exit("atxHeadingText"),s(c)):(t.consume(c),O)}}const cJ=["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"],u3=["pre","script","style","textarea"],uJ={concrete:!0,name:"htmlFlow",resolveTo:hJ,tokenize:pJ},dJ={partial:!0,tokenize:gJ},fJ={partial:!0,tokenize:mJ};function hJ(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function pJ(t,e,n){const r=this;let i,o,a,s,l;return O;function O(Z){return c(Z)}function c(Z){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(Z),u}function u(Z){return Z===33?(t.consume(Z),d):Z===47?(t.consume(Z),o=!0,p):Z===63?(t.consume(Z),i=3,r.interrupt?e:R):Hr(Z)?(t.consume(Z),a=String.fromCharCode(Z),g):n(Z)}function d(Z){return Z===45?(t.consume(Z),i=2,f):Z===91?(t.consume(Z),i=5,s=0,h):Hr(Z)?(t.consume(Z),i=4,r.interrupt?e:R):n(Z)}function f(Z){return Z===45?(t.consume(Z),r.interrupt?e:R):n(Z)}function h(Z){const _t="CDATA[";return Z===_t.charCodeAt(s++)?(t.consume(Z),s===_t.length?r.interrupt?e:A:h):n(Z)}function p(Z){return Hr(Z)?(t.consume(Z),a=String.fromCharCode(Z),g):n(Z)}function g(Z){if(Z===null||Z===47||Z===62||on(Z)){const _t=Z===47,se=a.toLowerCase();return!_t&&!o&&u3.includes(se)?(i=1,r.interrupt?e(Z):A(Z)):cJ.includes(a.toLowerCase())?(i=6,_t?(t.consume(Z),$):r.interrupt?e(Z):A(Z)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(Z):o?b(Z):S(Z))}return Z===45||Si(Z)?(t.consume(Z),a+=String.fromCharCode(Z),g):n(Z)}function $(Z){return Z===62?(t.consume(Z),r.interrupt?e:A):n(Z)}function b(Z){return wt(Z)?(t.consume(Z),b):C(Z)}function S(Z){return Z===47?(t.consume(Z),C):Z===58||Z===95||Hr(Z)?(t.consume(Z),x):wt(Z)?(t.consume(Z),S):C(Z)}function x(Z){return Z===45||Z===46||Z===58||Z===95||Si(Z)?(t.consume(Z),x):v(Z)}function v(Z){return Z===61?(t.consume(Z),k):wt(Z)?(t.consume(Z),v):S(Z)}function k(Z){return Z===null||Z===60||Z===61||Z===62||Z===96?n(Z):Z===34||Z===39?(t.consume(Z),l=Z,w):wt(Z)?(t.consume(Z),k):q(Z)}function w(Z){return Z===l?(t.consume(Z),l=null,_):Z===null||De(Z)?n(Z):(t.consume(Z),w)}function q(Z){return Z===null||Z===34||Z===39||Z===47||Z===60||Z===61||Z===62||Z===96||on(Z)?v(Z):(t.consume(Z),q)}function _(Z){return Z===47||Z===62||wt(Z)?S(Z):n(Z)}function C(Z){return Z===62?(t.consume(Z),I):n(Z)}function I(Z){return Z===null||De(Z)?A(Z):wt(Z)?(t.consume(Z),I):n(Z)}function A(Z){return Z===45&&i===2?(t.consume(Z),L):Z===60&&i===1?(t.consume(Z),D):Z===62&&i===4?(t.consume(Z),oe):Z===63&&i===3?(t.consume(Z),R):Z===93&&i===5?(t.consume(Z),de):De(Z)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(dJ,Qe,G)(Z)):Z===null||De(Z)?(t.exit("htmlFlowData"),G(Z)):(t.consume(Z),A)}function G(Z){return t.check(fJ,z,Qe)(Z)}function z(Z){return t.enter("lineEnding"),t.consume(Z),t.exit("lineEnding"),N}function N(Z){return Z===null||De(Z)?G(Z):(t.enter("htmlFlowData"),A(Z))}function L(Z){return Z===45?(t.consume(Z),R):A(Z)}function D(Z){return Z===47?(t.consume(Z),a="",le):A(Z)}function le(Z){if(Z===62){const _t=a.toLowerCase();return u3.includes(_t)?(t.consume(Z),oe):A(Z)}return Hr(Z)&&a.length<8?(t.consume(Z),a+=String.fromCharCode(Z),le):A(Z)}function de(Z){return Z===93?(t.consume(Z),R):A(Z)}function R(Z){return Z===62?(t.consume(Z),oe):Z===45&&i===2?(t.consume(Z),R):A(Z)}function oe(Z){return Z===null||De(Z)?(t.exit("htmlFlowData"),Qe(Z)):(t.consume(Z),oe)}function Qe(Z){return t.exit("htmlFlow"),e(Z)}}function mJ(t,e,n){const r=this;return i;function i(a){return De(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function gJ(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(sg,e,n)}}const $J={name:"htmlText",tokenize:QJ};function QJ(t,e,n){const r=this;let i,o,a;return s;function s(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),l}function l(R){return R===33?(t.consume(R),O):R===47?(t.consume(R),v):R===63?(t.consume(R),S):Hr(R)?(t.consume(R),q):n(R)}function O(R){return R===45?(t.consume(R),c):R===91?(t.consume(R),o=0,h):Hr(R)?(t.consume(R),b):n(R)}function c(R){return R===45?(t.consume(R),f):n(R)}function u(R){return R===null?n(R):R===45?(t.consume(R),d):De(R)?(a=u,D(R)):(t.consume(R),u)}function d(R){return R===45?(t.consume(R),f):u(R)}function f(R){return R===62?L(R):R===45?d(R):u(R)}function h(R){const oe="CDATA[";return R===oe.charCodeAt(o++)?(t.consume(R),o===oe.length?p:h):n(R)}function p(R){return R===null?n(R):R===93?(t.consume(R),g):De(R)?(a=p,D(R)):(t.consume(R),p)}function g(R){return R===93?(t.consume(R),$):p(R)}function $(R){return R===62?L(R):R===93?(t.consume(R),$):p(R)}function b(R){return R===null||R===62?L(R):De(R)?(a=b,D(R)):(t.consume(R),b)}function S(R){return R===null?n(R):R===63?(t.consume(R),x):De(R)?(a=S,D(R)):(t.consume(R),S)}function x(R){return R===62?L(R):S(R)}function v(R){return Hr(R)?(t.consume(R),k):n(R)}function k(R){return R===45||Si(R)?(t.consume(R),k):w(R)}function w(R){return De(R)?(a=w,D(R)):wt(R)?(t.consume(R),w):L(R)}function q(R){return R===45||Si(R)?(t.consume(R),q):R===47||R===62||on(R)?_(R):n(R)}function _(R){return R===47?(t.consume(R),L):R===58||R===95||Hr(R)?(t.consume(R),C):De(R)?(a=_,D(R)):wt(R)?(t.consume(R),_):L(R)}function C(R){return R===45||R===46||R===58||R===95||Si(R)?(t.consume(R),C):I(R)}function I(R){return R===61?(t.consume(R),A):De(R)?(a=I,D(R)):wt(R)?(t.consume(R),I):_(R)}function A(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),i=R,G):De(R)?(a=A,D(R)):wt(R)?(t.consume(R),A):(t.consume(R),z)}function G(R){return R===i?(t.consume(R),i=void 0,N):R===null?n(R):De(R)?(a=G,D(R)):(t.consume(R),G)}function z(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||on(R)?_(R):(t.consume(R),z)}function N(R){return R===47||R===62||on(R)?_(R):n(R)}function L(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),e):n(R)}function D(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),le}function le(R){return wt(R)?yt(t,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):de(R)}function de(R){return t.enter("htmlTextData"),a(R)}}const HT={name:"labelEnd",resolveAll:vJ,resolveTo:kJ,tokenize:PJ},bJ={tokenize:wJ},yJ={tokenize:xJ},SJ={tokenize:TJ};function vJ(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&no(t,0,t.length,n),t}function kJ(t,e){let n=t.length,r=0,i,o,a,s;for(;n--;)if(i=t[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},O={type:"label",start:{...t[o][1].start},end:{...t[a][1].end}},c={type:"labelText",start:{...t[o+r+2][1].end},end:{...t[a-2][1].start}};return s=[["enter",l,e],["enter",O,e]],s=$o(s,t.slice(o+1,o+r+3)),s=$o(s,[["enter",c,e]]),s=$o(s,yy(e.parser.constructs.insideSpan.null,t.slice(o+r+4,a-3),e)),s=$o(s,[["exit",c,e],t[a-2],t[a-1],["exit",O,e]]),s=$o(s,t.slice(a+1)),s=$o(s,[["exit",l,e]]),no(t,o,t.length,s),t}function PJ(t,e,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(d){return o?o._inactive?u(d):(a=r.parser.defined.includes(ca(r.sliceSerialize({start:o.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelEnd"),l):n(d)}function l(d){return d===40?t.attempt(bJ,c,a?c:u)(d):d===91?t.attempt(yJ,c,a?O:u)(d):a?c(d):u(d)}function O(d){return t.attempt(SJ,c,u)(d)}function c(d){return e(d)}function u(d){return o._balanced=!0,n(d)}}function wJ(t,e,n){return r;function r(u){return t.enter("resource"),t.enter("resourceMarker"),t.consume(u),t.exit("resourceMarker"),i}function i(u){return on(u)?Mp(t,o)(u):o(u)}function o(u){return u===41?c(u):UZ(t,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return on(u)?Mp(t,l)(u):c(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?IZ(t,O,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):c(u)}function O(u){return on(u)?Mp(t,c)(u):c(u)}function c(u){return u===41?(t.enter("resourceMarker"),t.consume(u),t.exit("resourceMarker"),t.exit("resource"),e):n(u)}}function xJ(t,e,n){const r=this;return i;function i(s){return AZ.call(r,t,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(ca(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(s):n(s)}function a(s){return n(s)}}function TJ(t,e,n){return r;function r(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}const _J={name:"labelStartImage",resolveAll:HT.resolveAll,tokenize:XJ};function XJ(t,e,n){const r=this;return i;function i(s){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(s),t.exit("labelImageMarker"),o}function o(s){return s===91?(t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const RJ={name:"labelStartLink",resolveAll:HT.resolveAll,tokenize:zJ};function zJ(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const Ev={name:"lineEnding",tokenize:CJ};function CJ(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),yt(t,e,"linePrefix")}}const E$={name:"thematicBreak",tokenize:qJ};function qJ(t,e,n){let r=0,i;return o;function o(O){return t.enter("thematicBreak"),a(O)}function a(O){return i=O,s(O)}function s(O){return O===i?(t.enter("thematicBreakSequence"),l(O)):r>=3&&(O===null||De(O))?(t.exit("thematicBreak"),e(O)):n(O)}function l(O){return O===i?(t.consume(O),r++,l):(t.exit("thematicBreakSequence"),wt(O)?yt(t,s,"whitespace")(O):s(O))}}const ci={continuation:{tokenize:VJ},exit:UJ,name:"list",tokenize:YJ},EJ={partial:!0,tokenize:AJ},ZJ={partial:!0,tokenize:WJ};function YJ(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const h=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Yw(f)){if(r.containerState.type||(r.containerState.type=h,t.enter(h,{_container:!0})),h==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(E$,n,O)(f):O(f);if(!r.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(f)}return n(f)}function l(f){return Yw(f)&&++a<10?(t.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),O(f)):n(f)}function O(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,t.check(sg,r.interrupt?n:c,t.attempt(EJ,d,u))}function c(f){return r.containerState.initialBlankLine=!0,o++,d(f)}function u(f){return wt(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),d):n(f)}function d(f){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}function VJ(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(sg,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,yt(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!wt(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(ZJ,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,yt(t,t.attempt(ci,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function WJ(t,e,n){const r=this;return yt(t,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(o):n(o)}}function UJ(t){t.exit(this.containerState.type)}function AJ(t,e,n){const r=this;return yt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!wt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const d3={name:"setextUnderline",resolveTo:IJ,tokenize:MJ};function IJ(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",a,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function MJ(t,e,n){const r=this;let i;return o;function o(O){let c=r.events.length,u;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){u=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(t.enter("setextHeadingLine"),i=O,a(O)):n(O)}function a(O){return t.enter("setextHeadingLineSequence"),s(O)}function s(O){return O===i?(t.consume(O),s):(t.exit("setextHeadingLineSequence"),wt(O)?yt(t,l,"lineSuffix")(O):l(O))}function l(O){return O===null||De(O)?(t.exit("setextHeadingLine"),e(O)):n(O)}}const jJ={tokenize:NJ};function NJ(t){const e=this,n=t.attempt(sg,r,t.attempt(this.parser.constructs.flowInitial,i,yt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(FK,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const DJ={resolveAll:jZ()},LJ=MZ("string"),GJ=MZ("text");function MZ(t){return{resolveAll:jZ(t==="text"?BJ:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,a,s);return a;function a(c){return O(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return O(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function O(c){if(c===null)return!0;const u=i[c];let d=-1;if(u)for(;++d<u.length;){const f=u[d];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function jZ(t){return e;function e(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(n,r):n}}function BJ(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const O=i[o];if(typeof O=="string"){for(a=O.length;O.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(O===-2)l=!0,s++;else if(O!==-1){o++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(s=0),s){const O={type:n===t.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...O.start},r.start.offset===r.end.offset?Object.assign(r,O):(t.splice(n,0,["enter",O,e],["exit",O,e]),n+=2)}n++}return t}const FJ={42:ci,43:ci,45:ci,48:ci,49:ci,50:ci,51:ci,52:ci,53:ci,54:ci,55:ci,56:ci,57:ci,62:ZZ},HJ={91:tJ},KJ={[-2]:qv,[-1]:qv,32:qv},JJ={35:sJ,42:E$,45:[d3,E$],60:uJ,61:d3,95:E$,96:c3,126:c3},eee={38:VZ,92:YZ},tee={[-5]:Ev,[-4]:Ev,[-3]:Ev,33:_J,38:VZ,42:Vw,60:[RK,$J],91:RJ,92:[oJ,YZ],93:HT,95:Vw,96:jK},nee={null:[Vw,DJ]},ree={null:[42,95]},iee={null:[]},oee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ree,contentInitial:HJ,disable:iee,document:FJ,flow:JJ,flowInitial:KJ,insideSpan:nee,string:eee,text:tee},Symbol.toStringTag,{value:"Module"}));function aee(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:w(v),check:w(k),consume:b,enter:S,exit:x,interrupt:w(k,{interrupt:!0})},O={code:null,containerState:{},defineSkip:p,events:[],now:h,parser:t,previous:null,sliceSerialize:d,sliceStream:f,write:u};let c=e.tokenize.call(O,l);return e.resolveAll&&o.push(e),O;function u(I){return a=$o(a,I),g(),a[a.length-1]!==null?[]:(q(e,0),O.events=yy(o,O.events,O),O.events)}function d(I,A){return lee(f(I),A)}function f(I){return see(a,I)}function h(){const{_bufferIndex:I,_index:A,line:G,column:z,offset:N}=r;return{_bufferIndex:I,_index:A,line:G,column:z,offset:N}}function p(I){i[I.line]=I.column,C()}function g(){let I;for(;r._index<a.length;){const A=a[r._index];if(typeof A=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<A.length;)$(A.charCodeAt(r._bufferIndex));else $(A)}}function $(I){c=c(I)}function b(I){De(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,C()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),O.previous=I}function S(I,A){const G=A||{};return G.type=I,G.start=h(),O.events.push(["enter",G,O]),s.push(G),G}function x(I){const A=s.pop();return A.end=h(),O.events.push(["exit",A,O]),A}function v(I,A){q(I,A.from)}function k(I,A){A.restore()}function w(I,A){return G;function G(z,N,L){let D,le,de,R;return Array.isArray(z)?Qe(z):"tokenize"in z?Qe([z]):oe(z);function oe(Pe){return tt;function tt(ht){const Ct=ht!==null&&Pe[ht],Ft=ht!==null&&Pe.null,fr=[...Array.isArray(Ct)?Ct:Ct?[Ct]:[],...Array.isArray(Ft)?Ft:Ft?[Ft]:[]];return Qe(fr)(ht)}}function Qe(Pe){return D=Pe,le=0,Pe.length===0?L:Z(Pe[le])}function Z(Pe){return tt;function tt(ht){return R=_(),de=Pe,Pe.partial||(O.currentConstruct=Pe),Pe.name&&O.parser.constructs.disable.null.includes(Pe.name)?se():Pe.tokenize.call(A?Object.assign(Object.create(O),A):O,l,_t,se)(ht)}}function _t(Pe){return I(de,R),N}function se(Pe){return R.restore(),++le<D.length?Z(D[le]):L}}}function q(I,A){I.resolveAll&&!o.includes(I)&&o.push(I),I.resolve&&no(O.events,A,O.events.length-A,I.resolve(O.events.slice(A),O)),I.resolveTo&&(O.events=I.resolveTo(O.events,O))}function _(){const I=h(),A=O.previous,G=O.currentConstruct,z=O.events.length,N=Array.from(s);return{from:z,restore:L};function L(){r=I,O.previous=A,O.currentConstruct=G,O.events.length=z,s=N,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function see(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,o)];else{if(a=t.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(t[i].slice(0,o))}return a}function lee(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const o=t[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
2
2
|
`;break}case-3:{a=`\r
|
|
3
3
|
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function Oee(t){const r={constructs:qZ([oee,...(t||{}).extensions||[]]),content:i(kK),defined:[],document:i(wK),flow:i(jJ),lazy:{},string:i(LJ),text:i(GJ)};return r;function i(o){return a;function a(s){return aee(r,o,s)}}}function cee(t){for(;!WZ(t););return t}const f3=/[\0\t\n\r]/g;function uee(){let t=1,e="",n=!0,r;return i;function i(o,a,s){const l=[];let O,c,u,d,f;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),u=0,e="",n&&(o.charCodeAt(0)===65279&&u++,n=void 0);u<o.length;){if(f3.lastIndex=u,O=f3.exec(o),d=O&&O.index!==void 0?O.index:o.length,f=o.charCodeAt(d),!O){e=o.slice(u);break}if(f===10&&u===d&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<d&&(l.push(o.slice(u,d)),t+=d-u),f){case 0:{l.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,l.push(-2);t++<c;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}u=d+1}return s&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const dee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function NZ(t){return t.replace(dee,fee)}function fee(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return EZ(n.slice(o?2:1),o?16:10)}return GT(n)||t}const DZ={}.hasOwnProperty;function hee(t,e,n){return typeof e!="string"&&(n=e,e=void 0),pee(n)(cee(Oee(n).document().write(uee()(t,e,!0))))}function pee(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(be),autolinkProtocol:_,autolinkEmail:_,atxHeading:o(fe),blockQuote:o(Ft),characterEscape:_,characterReference:_,codeFenced:o(fr),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(fr,a),codeText:o(W,a),codeTextData:_,data:_,codeFlowValue:_,definition:o(j),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(K),hardBreakEscape:o(Oe),hardBreakTrailing:o(Oe),htmlFlow:o(ce,a),htmlFlowData:_,htmlText:o(ce,a),htmlTextData:_,image:o(ke),label:a,link:o(be),listItem:o(he),listItemValue:d,listOrdered:o(Se,u),listUnordered:o(Se),paragraph:o(Le),reference:Z,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(fe),strong:o(xe),thematicBreak:o(Ge)},exit:{atxHeading:l(),atxHeadingSequence:v,autolink:l(),autolinkEmail:Ct,autolinkProtocol:ht,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:Pe,characterReference:tt,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:h,codeFlowValue:C,codeIndented:l($),codeText:l(N),codeTextData:C,data:C,definition:l(),definitionDestinationString:x,definitionLabelString:b,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(G),htmlFlowData:C,htmlText:l(z),htmlTextData:C,image:l(D),label:de,labelText:le,lineEnding:I,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:_t,resourceDestinationString:R,resourceTitleString:oe,resource:Qe,setextHeading:l(q),setextHeadingLineSequence:w,setextHeadingText:k,strong:l(),thematicBreak:l()}};LZ(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(B){let ae={type:"root",children:[]};const Xe={stack:[ae],tokenStack:[],config:e,enter:s,exit:O,buffer:a,resume:c,data:n},Be=[];let ct=-1;for(;++ct<B.length;)if(B[ct][1].type==="listOrdered"||B[ct][1].type==="listUnordered")if(B[ct][0]==="enter")Be.push(ct);else{const Ke=Be.pop();ct=i(B,Ke,ct)}for(ct=-1;++ct<B.length;){const Ke=e[B[ct][0]];DZ.call(Ke,B[ct][1].type)&&Ke[B[ct][1].type].call(Object.assign({sliceSerialize:B[ct][2].sliceSerialize},Xe),B[ct][1])}if(Xe.tokenStack.length>0){const Ke=Xe.tokenStack[Xe.tokenStack.length-1];(Ke[1]||h3).call(Xe,void 0,Ke[0])}for(ae.position={start:Tl(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Tl(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},ct=-1;++ct<e.transforms.length;)ae=e.transforms[ct](ae)||ae;return ae}function i(B,ae,Xe){let Be=ae-1,ct=-1,Ke=!1,Pn,Rn,hr,ln;for(;++Be<=Xe;){const Gt=B[Be];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?ct++:ct--,ln=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(Pn&&!ln&&!ct&&!hr&&(hr=Be),ln=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ln=void 0}if(!ct&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||ct===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(Pn){let Pr=Be;for(Rn=void 0;Pr--;){const dn=B[Pr];if(dn[1].type==="lineEnding"||dn[1].type==="lineEndingBlank"){if(dn[0]==="exit")continue;Rn&&(B[Rn][1].type="lineEndingBlank",Ke=!0),dn[1].type="lineEnding",Rn=Pr}else if(!(dn[1].type==="linePrefix"||dn[1].type==="blockQuotePrefix"||dn[1].type==="blockQuotePrefixWhitespace"||dn[1].type==="blockQuoteMarker"||dn[1].type==="listItemIndent"))break}hr&&(!Rn||hr<Rn)&&(Pn._spread=!0),Pn.end=Object.assign({},Rn?B[Rn][1].start:Gt[1].end),B.splice(Rn||Be,0,["exit",Pn,Gt[2]]),Be++,Xe++}if(Gt[1].type==="listItemPrefix"){const Pr={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};Pn=Pr,B.splice(Be,0,["enter",Pr,Gt[2]]),Be++,Xe++,hr=void 0,ln=!0}}}return B[ae][1]._spread=Ke,Xe}function o(B,ae){return Xe;function Xe(Be){s.call(this,B(Be),Be),ae&&ae.call(this,Be)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(B,ae,Xe){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([ae,Xe||void 0]),B.position={start:Tl(ae.start),end:void 0}}function l(B){return ae;function ae(Xe){B&&B.call(this,Xe),O.call(this,Xe)}}function O(B,ae){const Xe=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==B.type&&(ae?ae.call(this,B,Be[0]):(Be[1]||h3).call(this,B,Be[0]));else throw new Error("Cannot close `"+B.type+"` ("+Ip({start:B.start,end:B.end})+"): it’s not open");Xe.position.end=Tl(B.end)}function c(){return FT(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(B){if(this.data.expectingFirstListItemValue){const ae=this.stack[this.stack.length-2];ae.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function f(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.lang=B}function h(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.meta=B}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function $(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.value=B.replace(/(\r?\n|\r)$/g,"")}function b(B){const ae=this.resume(),Xe=this.stack[this.stack.length-1];Xe.label=ae,Xe.identifier=ca(this.sliceSerialize(B)).toLowerCase()}function S(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.title=B}function x(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.url=B}function v(B){const ae=this.stack[this.stack.length-1];if(!ae.depth){const Xe=this.sliceSerialize(B).length;ae.depth=Xe}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function w(B){const ae=this.stack[this.stack.length-1];ae.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function _(B){const Xe=this.stack[this.stack.length-1].children;let Be=Xe[Xe.length-1];(!Be||Be.type!=="text")&&(Be=Ce(),Be.position={start:Tl(B.start),end:void 0},Xe.push(Be)),this.stack.push(Be)}function C(B){const ae=this.stack.pop();ae.value+=this.sliceSerialize(B),ae.position.end=Tl(B.end)}function I(B){const ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Xe=ae.children[ae.children.length-1];Xe.position.end=Tl(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ae.type)&&(_.call(this,B),C.call(this,B))}function A(){this.data.atHardBreak=!0}function G(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.value=B}function z(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.value=B}function N(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.value=B}function L(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=ae,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function D(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=ae,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function le(B){const ae=this.sliceSerialize(B),Xe=this.stack[this.stack.length-2];Xe.label=NZ(ae),Xe.identifier=ca(ae).toLowerCase()}function de(){const B=this.stack[this.stack.length-1],ae=this.resume(),Xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Xe.type==="link"){const Be=B.children;Xe.children=Be}else Xe.alt=ae}function R(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.url=B}function oe(){const B=this.resume(),ae=this.stack[this.stack.length-1];ae.title=B}function Qe(){this.data.inReference=void 0}function Z(){this.data.referenceType="collapsed"}function _t(B){const ae=this.resume(),Xe=this.stack[this.stack.length-1];Xe.label=ae,Xe.identifier=ca(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function se(B){this.data.characterReferenceType=B.type}function Pe(B){const ae=this.sliceSerialize(B),Xe=this.data.characterReferenceType;let Be;Xe?(Be=EZ(ae,Xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=GT(ae);const ct=this.stack[this.stack.length-1];ct.value+=Be}function tt(B){const ae=this.stack.pop();ae.position.end=Tl(B.end)}function ht(B){C.call(this,B);const ae=this.stack[this.stack.length-1];ae.url=this.sliceSerialize(B)}function Ct(B){C.call(this,B);const ae=this.stack[this.stack.length-1];ae.url="mailto:"+this.sliceSerialize(B)}function Ft(){return{type:"blockquote",children:[]}}function fr(){return{type:"code",lang:null,meta:null,value:""}}function W(){return{type:"inlineCode",value:""}}function j(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function fe(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function ce(){return{type:"html",value:""}}function ke(){return{type:"image",title:null,url:"",alt:null}}function be(){return{type:"link",title:null,url:"",children:[]}}function Se(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function he(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function Le(){return{type:"paragraph",children:[]}}function xe(){return{type:"strong",children:[]}}function Ce(){return{type:"text",value:""}}function Ge(){return{type:"thematicBreak"}}}function Tl(t){return{line:t.line,column:t.column,offset:t.offset}}function LZ(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?LZ(t,r):mee(t,r)}}function mee(t,e){let n;for(n in e)if(DZ.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function h3(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Ip({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Ip({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Ip({start:e.start,end:e.end})+") is still open")}function Ww(t){const e=this;e.parser=n;function n(r){return hee(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}var Ti=(t=>(t.docTypeError="docTypeError",t.contextNotFound="contextNotFound",t.timerNotFound="timerNotFound",t.ctxCallOutOfScope="ctxCallOutOfScope",t.createNodeInParserFail="createNodeInParserFail",t.stackOverFlow="stackOverFlow",t.parserMatchError="parserMatchError",t.serializerMatchError="serializerMatchError",t.getAtomFromSchemaFail="getAtomFromSchemaFail",t.expectDomTypeError="expectDomTypeError",t.callCommandBeforeEditorView="callCommandBeforeEditorView",t.missingRootElement="missingRootElement",t.missingNodeInSchema="missingNodeInSchema",t.missingMarkInSchema="missingMarkInSchema",t.ctxNotBind="ctxNotBind",t.missingYjsDoc="missingYjsDoc",t))(Ti||{});class oo extends Error{constructor(e,n){super(n),this.name="MilkdownError",this.code=e}}const gee=(t,e)=>typeof e=="function"?"[Function]":e,Sy=t=>JSON.stringify(t,gee);function $ee(t){return new oo(Ti.docTypeError,`Doc type error, unsupported type: ${Sy(t)}`)}function Qee(t){return new oo(Ti.contextNotFound,`Context "${t}" not found, do you forget to inject it?`)}function bee(t){return new oo(Ti.timerNotFound,`Timer "${t}" not found, do you forget to record it?`)}function vy(){return new oo(Ti.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function yee(t,e,n){const i=`Cannot create node for ${"name"in t?t.name:t}`,o=c=>{if(c==null)return"null";if(Array.isArray(c))return`[${c.map(o).join(", ")}]`;if(typeof c=="object")return"toJSON"in c&&typeof c.toJSON=="function"?JSON.stringify(c.toJSON()):"spec"in c?JSON.stringify(c.spec):JSON.stringify(c);if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")return JSON.stringify(c);if(typeof c=="function")return`[Function: ${c.name||"anonymous"}]`;try{return String(c)}catch{return"[Unserializable]"}},a=["[Description]",i],s=["[Attributes]",e],l=["[Content]",(n??[]).map(c=>c?typeof c=="object"&&"type"in c?`${c}`:o(c):"null")],O=[a,s,l].reduce((c,[u,d])=>{const f=`${u}: ${o(d)}.`;return c.concat(f)},[]);return new oo(Ti.createNodeInParserFail,O.join(`
|
|
4
4
|
`))}function GZ(){return new oo(Ti.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function See(t){return new oo(Ti.parserMatchError,`Cannot match target parser for node: ${Sy(t)}.`)}function vee(t){return new oo(Ti.serializerMatchError,`Cannot match target serializer for node: ${Sy(t)}.`)}function kee(t,e){return new oo(Ti.getAtomFromSchemaFail,`Cannot get ${t}: ${e} from schema.`)}function $a(t){return new oo(Ti.expectDomTypeError,`Expect to be a dom, but get: ${Sy(t)}.`)}function Zv(){return new oo(Ti.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function Pee(t){return new oo(Ti.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${t}" in schema.`)}function wee(t){return new oo(Ti.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${t}" in schema.`)}class BZ{constructor(){this.sliceMap=new Map,this.get=e=>{const n=typeof e=="string"?[...this.sliceMap.values()].find(r=>r.type.name===e):this.sliceMap.get(e.id);if(!n){const r=typeof e=="string"?e:e.name;throw Qee(r)}return n},this.remove=e=>{const n=typeof e=="string"?[...this.sliceMap.values()].find(r=>r.type.name===e):this.sliceMap.get(e.id);n&&this.sliceMap.delete(n.type.id)},this.has=e=>typeof e=="string"?[...this.sliceMap.values()].some(n=>n.type.name===e):this.sliceMap.has(e.id)}}var ta,As,Dd,RZ;let xee=(RZ=class{constructor(e,n,r){ge(this,ta);ge(this,As);ge(this,Dd);te(this,ta,[]),te(this,Dd,()=>{U(this,ta).forEach(i=>i(U(this,As)))}),this.set=i=>{te(this,As,i),U(this,Dd).call(this)},this.get=()=>U(this,As),this.update=i=>{te(this,As,i(U(this,As))),U(this,Dd).call(this)},this.type=r,te(this,As,n),e.set(r.id,this)}on(e){return U(this,ta).push(e),()=>{te(this,ta,U(this,ta).filter(n=>n!==e))}}once(e){const n=this.on(r=>{e(r),n()});return n}off(e){te(this,ta,U(this,ta).filter(n=>n!==e))}offAll(){te(this,ta,[])}},ta=new WeakMap,As=new WeakMap,Dd=new WeakMap,RZ);class Tee{constructor(e,n){this.id=Symbol(`Context-${n}`),this.name=n,this._defaultValue=e,this._typeInfo=()=>{throw vy()}}create(e,n=this._defaultValue){return new xee(e,n,this)}}const vt=(t,e)=>new Tee(t,e);var z0,C0,q0,Ac,Ld,rO,Gd,Bd,Fd;class _ee{constructor(e,n,r){ge(this,z0);ge(this,C0);ge(this,q0);ge(this,Ac);ge(this,Ld);ge(this,rO);ge(this,Gd);ge(this,Bd);ge(this,Fd);te(this,Ac,new Set),te(this,Ld,new Set),te(this,rO,new Map),te(this,Gd,new Map),this.read=()=>({metadata:U(this,z0),injectedSlices:[...U(this,Ac)].map(i=>({name:typeof i=="string"?i:i.name,value:U(this,Bd).call(this,i)})),consumedSlices:[...U(this,Ld)].map(i=>({name:typeof i=="string"?i:i.name,value:U(this,Bd).call(this,i)})),recordedTimers:[...U(this,rO)].map(([i,{duration:o}])=>({name:i.name,duration:o,status:U(this,Fd).call(this,i)})),waitTimers:[...U(this,Gd)].map(([i,{duration:o}])=>({name:i.name,duration:o,status:U(this,Fd).call(this,i)}))}),this.onRecord=i=>{U(this,rO).set(i,{start:Date.now(),duration:0})},this.onClear=i=>{U(this,rO).delete(i)},this.onDone=i=>{const o=U(this,rO).get(i);o&&(o.duration=Date.now()-o.start)},this.onWait=(i,o)=>{const a=Date.now();o.finally(()=>{U(this,Gd).set(i,{duration:Date.now()-a})}).catch(console.error)},this.onInject=i=>{U(this,Ac).add(i)},this.onRemove=i=>{U(this,Ac).delete(i)},this.onUse=i=>{U(this,Ld).add(i)},te(this,Bd,i=>U(this,C0).get(i).get()),te(this,Fd,i=>U(this,q0).get(i).status),te(this,C0,e),te(this,q0,n),te(this,z0,r)}}z0=new WeakMap,C0=new WeakMap,q0=new WeakMap,Ac=new WeakMap,Ld=new WeakMap,rO=new WeakMap,Gd=new WeakMap,Bd=new WeakMap,Fd=new WeakMap;var Is,Ms,E0,ho;const j7=class j7{constructor(e,n,r){ge(this,Is);ge(this,Ms);ge(this,E0);ge(this,ho);this.produce=i=>i&&Object.keys(i).length?new j7(U(this,Is),U(this,Ms),{...i}):this,this.inject=(i,o)=>{var s;const a=i.create(U(this,Is).sliceMap);return o!=null&&a.set(o),(s=U(this,ho))==null||s.onInject(i),this},this.remove=i=>{var o;return U(this,Is).remove(i),(o=U(this,ho))==null||o.onRemove(i),this},this.record=i=>{var o;return i.create(U(this,Ms).store),(o=U(this,ho))==null||o.onRecord(i),this},this.clearTimer=i=>{var o;return U(this,Ms).remove(i),(o=U(this,ho))==null||o.onClear(i),this},this.isInjected=i=>U(this,Is).has(i),this.isRecorded=i=>U(this,Ms).has(i),this.use=i=>{var o;return(o=U(this,ho))==null||o.onUse(i),U(this,Is).get(i)},this.get=i=>this.use(i).get(),this.set=(i,o)=>this.use(i).set(o),this.update=(i,o)=>this.use(i).update(o),this.timer=i=>U(this,Ms).get(i),this.done=i=>{var o;this.timer(i).done(),(o=U(this,ho))==null||o.onDone(i)},this.wait=i=>{var a;const o=this.timer(i).start();return(a=U(this,ho))==null||a.onWait(i,o),o},this.waitTimers=async i=>{await Promise.all(this.get(i).map(o=>this.wait(o)))},te(this,Is,e),te(this,Ms,n),te(this,E0,r),r&&te(this,ho,new _ee(e,n,r))}get meta(){return U(this,E0)}get inspector(){return U(this,ho)}};Is=new WeakMap,Ms=new WeakMap,E0=new WeakMap,ho=new WeakMap;let Uw=j7;class Xee{constructor(){this.store=new Map,this.get=e=>{const n=this.store.get(e.id);if(!n)throw bee(e.name);return n},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}}var Hd,iO,Kd,js,Jd,Z0;class Ree{constructor(e,n){ge(this,Hd);ge(this,iO);ge(this,Kd);ge(this,js);ge(this,Jd);ge(this,Z0);te(this,Hd,null),te(this,iO,null),te(this,js,"pending"),this.start=()=>(U(this,Hd)??te(this,Hd,new Promise((r,i)=>{te(this,iO,o=>{o instanceof CustomEvent&&o.detail.id===U(this,Kd)&&(te(this,js,"resolved"),U(this,Jd).call(this),o.stopImmediatePropagation(),r())}),U(this,Z0).call(this,()=>{U(this,js)==="pending"&&te(this,js,"rejected"),U(this,Jd).call(this),i(new Error(`Timing ${this.type.name} timeout.`))}),te(this,js,"pending"),addEventListener(this.type.name,U(this,iO))})),U(this,Hd)),this.done=()=>{const r=new CustomEvent(this.type.name,{detail:{id:U(this,Kd)}});dispatchEvent(r)},te(this,Jd,()=>{U(this,iO)&&removeEventListener(this.type.name,U(this,iO))}),te(this,Z0,r=>{setTimeout(()=>{r()},this.type.timeout)}),te(this,Kd,Symbol(n.name)),this.type=n,e.set(n.id,this)}get status(){return U(this,js)}}Hd=new WeakMap,iO=new WeakMap,Kd=new WeakMap,js=new WeakMap,Jd=new WeakMap,Z0=new WeakMap;class zee{constructor(e,n=3e3){this.create=r=>new Ree(r,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=n}}const ls=(t,e=3e3)=>new zee(t,e);function mr(t){this.content=t}mr.prototype={constructor:mr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new mr(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new mr(n)},addToStart:function(t,e){return new mr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new mr(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new mr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=mr.from(t),t.size?new mr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=mr.from(t),t.size?new mr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=mr.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};mr.from=function(t){if(t instanceof mr)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new mr(e)};function FZ(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=FZ(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function HZ(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=t.child(--i),s=e.child(--o),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let O=0,c=Math.min(a.text.length,s.text.length);for(;O<c&&a.text[a.text.length-O-1]==s.text[s.text.length-O-1];)O++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let O=HZ(a.content,s.content,n-1,r-1);if(O)return O}n-=l,r-=l}}let ye=class Nr{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let l=this.content[a],O=s+l.nodeSize;if(O>e&&r(l,i+s,o||null,a)!==!1&&l.content.size){let c=s+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}s=O}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",a=!0;return this.nodesBetween(e,n,(s,l)=>{let O=s.isText?s.text.slice(Math.max(e,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&O||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=O},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new Nr(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,a=0;a<n;o++){let s=this.content[o],l=a+s.nodeSize;l>e&&((a<e||l>n)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new Nr(r,i)}cutByIndex(e,n){return e==n?Nr.empty:e==0&&n==this.content.length?this:new Nr(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Nr(i,o)}addToStart(e){return new Nr([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Nr(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return FZ(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return HZ(this,e,n,r)}findIndex(e){if(e==0)return O1(0,e);if(e==this.size)return O1(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=e)return o==e?O1(n+1,o):O1(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Nr.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Nr(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Nr.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Nr(n||e,r)}static from(e){if(!e)return Nr.empty;if(e instanceof Nr)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Nr([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};ye.empty=new ye([],0);const Yv={index:0,offset:0};function O1(t,e){return Yv.index=t,Yv.offset=e,Yv}function KQ(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!KQ(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!KQ(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class $t{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&KQ(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $t.none;if(e instanceof $t)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}}$t.none=[];class JQ extends Error{}class Te{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=JZ(this.content,e+this.openStart,n);return r&&new Te(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Te(KZ(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Te.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Te(ye.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new Te(e,r,i)}}Te.empty=new Te(ye.empty,0,0);function KZ(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:a,offset:s}=t.findIndex(n);if(i==e||o.isText){if(s!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(KZ(o.content,e-i-1,n-i-1)))}function JZ(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),a=t.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let s=JZ(a.content,e-o-1,n,a);return s&&t.replaceChild(i,a.copy(s))}function Cee(t,e,n){if(n.openStart>t.depth)throw new JQ("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new JQ("Inconsistent open depths");return eY(t,e,n,0)}function eY(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=eY(t,e,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,s=a.content;return eu(a,s.cut(0,t.parentOffset).append(n.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=qee(n,t);return eu(o,nY(t,a,s,e,r))}else return eu(o,eb(t,e,r))}function tY(t,e){if(!e.type.compatibleContent(t.type))throw new JQ("Cannot join "+e.type.name+" onto "+t.type.name)}function Aw(t,e,n){let r=t.node(n);return tY(r,e.node(n)),r}function Jc(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function jp(t,e,n,r){let i=(e||t).node(n),o=0,a=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Jc(t.nodeAfter,r),o++));for(let s=o;s<a;s++)Jc(i.child(s),r);e&&e.depth==n&&e.textOffset&&Jc(e.nodeBefore,r)}function eu(t,e){return t.type.checkContent(e),t.copy(e)}function nY(t,e,n,r,i){let o=t.depth>i&&Aw(t,e,i+1),a=r.depth>i&&Aw(n,r,i+1),s=[];return jp(null,t,i,s),o&&a&&e.index(i)==n.index(i)?(tY(o,a),Jc(eu(o,nY(t,e,n,r,i+1)),s)):(o&&Jc(eu(o,eb(t,e,i+1)),s),jp(e,n,i,s),a&&Jc(eu(a,eb(n,r,i+1)),s)),jp(r,null,i,s),new ye(s)}function eb(t,e,n){let r=[];if(jp(null,t,n,r),t.depth>n){let i=Aw(t,e,n+1);Jc(eu(i,eb(t,e,n+1)),r)}return jp(e,null,n,r),new ye(r)}function qee(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(ye.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Xm{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $t.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new rY(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=e;;){let{index:s,offset:l}=a.content.findIndex(o),O=o-l;if(r.push(a,s,i+l),!O||(a=a.child(s),a.isText))break;o=O-1,i+=l+1}return new Xm(n,r,o)}static resolveCached(e,n){let r=p3.get(e);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else p3.set(e,r=new Eee);let i=r.elts[r.i]=Xm.resolve(e,n);return r.i=(r.i+1)%Zee,i}}class Eee{constructor(){this.elts=[],this.i=0}}const Zee=12,p3=new WeakMap;class rY{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Yee=Object.create(null);class Xo{constructor(e,n,r,i=$t.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||ye.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&KQ(this.attrs,n||e.defaultAttrs||Yee)&&$t.sameSet(this.marks,r||$t.none)}copy(e=null){return e==this.content?this:new Xo(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xo(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Te.empty;let i=this.resolve(e),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),O=i.node(a).content.cut(i.pos-s,o.pos-s);return new Te(O,i.depth-a,o.depth-a)}replace(e,n,r){return Cee(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Xm.resolveCached(this,e)}resolveNoCache(e){return Xm.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),iY(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ye.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$t.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$t.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=ye.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}Xo.prototype.text=void 0;let Vee=class Iw extends Xo{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):iY(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Iw(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Iw(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function iY(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class pu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Wee(e,n);if(r.next==null)return pu.empty;let i=oY(r);r.next&&r.err("Unexpected trailing text");let o=Dee(Nee(i));return Lee(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(a,s){let l=a.matchFragment(e,r);if(l&&(!n||l.validEnd))return ye.from(s.map(O=>O.createAndFill()));for(let O=0;O<a.next.length;O++){let{type:c,next:u}=a.next[O];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let d=o(u,s.concat(c));if(d)return d}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as v}from"./startup-runtime-BrfuwjQS.js";import{r as L,c as z}from"./skills-DHghxQBn.js";import{p as B,a as O,b as V}from"./external-skill-parser-y-iaYa67.js";import{S as l}from"./ai-chat-
|
|
1
|
+
import{_ as v}from"./startup-runtime-BrfuwjQS.js";import{r as L,c as z}from"./skills-DHghxQBn.js";import{p as B,a as O,b as V}from"./external-skill-parser-y-iaYa67.js";import{S as l}from"./ai-chat-BnWVpTEI.js";const r="external-skill-packages";let x=[],y=[],_=!1;async function f(){var e,n;if(!_){try{let t=await l.get(r),a=null;try{a=await j()}catch(i){console.warn("[ExternalSkillService] 预构建 bundle 加载失败(非致命):",i)}if(!(t&&Array.isArray(t)&&t.length>0))a&&a.skills&&a.skills.length>0&&(t=[{name:a.name||"baoyu-skills",skills:a.skills,metadata:a.metadata}],await l.set(r,t));else if(a&&a.skills&&a.skills.length>0){const i=(e=a.metadata)==null?void 0:e.bundleVersion,o=t.find(c=>c.name===(a.name||"baoyu-skills")),u=(n=o==null?void 0:o.metadata)==null?void 0:n.bundleVersion;if(i&&i!==u){const c={name:a.name||"baoyu-skills",skills:a.skills,metadata:a.metadata},k=t.filter(m=>m.name!==c.name);t=[c,...k],await l.set(r,t)}else if(!i&&!u){const c={name:a.name||"baoyu-skills",skills:a.skills,metadata:a.metadata},k=t.filter(m=>m.name!==c.name);t=[c,...k],await l.set(r,t)}}t&&Array.isArray(t)&&await g(t)}catch(t){console.error("[ExternalSkillService] 初始化失败:",t)}_=!0}}async function j(){try{const e=await v(()=>import("./external-skills-BcV6ATYi.js"),[],import.meta.url);return e.default||e}catch{return null}}async function F(){return await f(),[...x]}async function A(e){await f();const n=await l.get(r),t=n&&Array.isArray(n)?[...n]:[],a=t.findIndex(s=>s.name===e.name);a>=0?t[a]=e:t.push(e),await l.set(r,t),await g(t)}async function R(e){await f();const n=await l.get(r);if(!n||!Array.isArray(n))return;const t=n.filter(a=>a.name!==e);await l.set(r,t),await g(t)}async function $(e){await f();const n=await l.get(r);if(!n)return[];const t=n.find(a=>a.name===e);return(t==null?void 0:t.skills)??[]}async function Z(){return await f(),[...y]}async function D(){await f();const e=await l.get(r);return e?e.flatMap(n=>n.skills):[]}async function M(e){await f();const n=await l.get(r);if(!n)return null;for(const t of n){const a=t.skills.find(s=>s.id===e);if(a)return a}return null}async function J(e){const n=await M(e);return(n==null?void 0:n.content)??null}async function W(e,n){var P;const a=await(await v(async()=>{const{default:d}=await import("./office-data-DMEex_0S.js").then(p=>p.j);return{default:d}},[],import.meta.url)).default.loadAsync(e);let s=null;const i=((P=a.file(/\.claude-plugin\/marketplace\.json$/))==null?void 0:P[0])||a.file("marketplace.json");if(i){const d=await i.async("text");s=O(d)}const o=n||(s==null?void 0:s.name)||e.name.replace(/\.zip$/i,""),u=[],c=/(?:^|\/)(skills\/([^/]+)\/SKILL\.md)$/;for(const[d,p]of Object.entries(a.files)){if(p.dir)continue;const E=d.match(c);if(E){const C=E[2],K=await p.async("text"),w=new Map,b=d.substring(0,d.lastIndexOf("SKILL.md"));for(const[h,I]of Object.entries(a.files))if(!I.dir&&h.startsWith(b)&&h!==d){const S=h.substring(b.length);if(S.startsWith("references/")||S.startsWith("prompts/")){const T=await I.async("text");w.set(S,T)}}u.push({dirName:C,skillMdContent:K,references:w.size>0?w:void 0})}}if(u.length===0)throw new Error("ZIP 文件中未找到有效的 Skill(预期路径: skills/*/SKILL.md)");const k=V(u,o,s),m={name:o,url:void 0,skills:k,metadata:s==null?void 0:s.metadata};return await A(m),m}async function Y(e,n="custom"){const t=B(e);if(!t)throw new Error("无法解析 SKILL.md 内容,请检查格式是否正确(需包含 YAML front matter)");const a={id:`${n}:${t.name}`,name:t.name,description:t.description,type:z,content:t.body,source:n};await f();const s=await l.get(r),i=s&&Array.isArray(s)?[...s]:[];let o=i.find(c=>c.name===n);o||(o={name:n,skills:[],metadata:{description:"手动导入的 Skill"}},i.push(o));const u=o.skills.findIndex(c=>c.id===a.id);return u>=0?o.skills[u]=a:o.skills.push(a),await l.set(r,i),await g(i),a}async function G(e){await A(e)}async function g(e){x=e.map(t=>({name:t.name,url:t.url,skillCount:t.skills.length,metadata:t.metadata})),y=[];for(const t of e)for(const a of t.skills)y.push({id:a.id,name:a.name,description:a.description,source:a.source,sourceUrl:a.sourceUrl,category:a.category,outputType:a.outputType});const n=e.flatMap(t=>t.skills);L(n)}async function U(){await l.remove(r),x=[],y=[],L([]),_=!1}const Q={initialize:f,getPackages:F,addPackage:A,removePackage:R,getSkillsByPackage:$,getAllExternalSkillsMeta:Z,getAllExternalSkills:D,getSkillById:M,getSkillContentById:J,importFromZip:W,importFromPastedContent:Y,importFromBundle:G,clearAll:U};export{Q as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o1 as d,o0 as M}from"./ai-chat-
|
|
1
|
+
import{o1 as d,o0 as M}from"./ai-chat-BnWVpTEI.js";function p(o,i){return Math.abs(Math.log(o)-Math.log(i))}function g(o,i,r){if(o<=0||i<=0)return;const c=o/i,a=M(r);if(a.length===0)return;const e=a.filter(n=>n.value!=="auto");if(e.length===0)return;let t,s=1/0;for(const n of e){const l=n.value.split("x");if(l.length!==2)continue;const f=parseFloat(l[0]),u=parseFloat(l[1]);if(isNaN(f)||isNaN(u)||u===0)continue;const v=f/u,h=p(c,v);h<s&&(s=h,t=n.value)}if(!(s>.25))return t}function F(o,i){if(o<=0||i<=0)return;const r=o/i,c=d.filter(t=>t.value!=="auto"&&t.width>0&&t.height>0);let a,e=1/0;for(const t of c){const s=t.width/t.height,n=p(r,s);n<e&&(e=n,a=t.value)}if(!(e>.25))return a}export{g as a,F as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a8 as e,pU as o,pV as _,ge as b,co as i,f6 as m,iP as u,cO as c,m7 as x,pW as j,pX as h,i0 as d,eM as p}from"./ai-chat-
|
|
1
|
+
import{a8 as e,pU as o,pV as _,ge as b,co as i,f6 as m,iP as u,cO as c,m7 as x,pW as j,pX as h,i0 as d,eM as p}from"./ai-chat-BnWVpTEI.js";import{pZ as f,p$ as z,pY as I,p_ as D,fA as M}from"./ai-chat-BnWVpTEI.js";/* empty css */import"./startup-runtime-BrfuwjQS.js";function y({assetCount:a,storageStatus:r}){var t,n;const l=((t=r==null?void 0:r.quota)==null?void 0:t.percentUsed)||0,s=((n=r==null?void 0:r.quota)==null?void 0:n.usage)||0;return e.jsxs("div",{className:"storage-bar",children:[e.jsxs("div",{className:"storage-bar__header",children:[e.jsxs("div",{className:"storage-bar__header-left",children:[e.jsx(o,{size:14,className:"storage-bar__icon"}),e.jsx("span",{className:"storage-bar__title",children:"本地存储空间"})]}),e.jsxs("span",{className:"storage-bar__count",children:[a," 个素材"]})]}),e.jsx("div",{className:"storage-bar__usage",children:e.jsxs("span",{className:"storage-bar__usage-value",children:["已用:",_(s)]})}),e.jsx(b,{percentage:l,size:"small",strokeWidth:6,label:!1})]})}function E({filters:a,assetCount:r,storageStatus:l,onFilterChange:s}){return e.jsxs("div",{className:"media-library-sidebar",children:[e.jsxs("div",{className:"media-library-sidebar__section",children:[e.jsx("h3",{className:"media-library-sidebar__title",children:"类型"}),e.jsxs("div",{className:"media-library-sidebar__buttons",children:[e.jsxs(i,{variant:a.activeType==="ALL"?"base":"outline",onClick:()=>s({activeType:"ALL"}),block:!0,theme:"default","data-track":"sidebar_filter_type_all",children:[e.jsx(m,{size:16}),e.jsx("span",{children:"全部素材"})]}),e.jsxs(i,{variant:a.activeType===c.IMAGE?"base":"outline",onClick:()=>s({activeType:c.IMAGE}),block:!0,theme:"default","data-track":"sidebar_filter_type_image",children:[e.jsx(u,{size:16}),e.jsx("span",{children:"图片"})]}),e.jsxs(i,{variant:a.activeType===c.VIDEO?"base":"outline",onClick:()=>s({activeType:c.VIDEO}),block:!0,theme:"default","data-track":"sidebar_filter_type_video",children:[e.jsx(x,{size:16}),e.jsx("span",{children:"视频"})]})]})]}),e.jsxs("div",{className:"media-library-sidebar__section",children:[e.jsx("h3",{className:"media-library-sidebar__title",children:"来源"}),e.jsxs("div",{className:"media-library-sidebar__buttons",children:[e.jsxs(i,{variant:a.activeSource==="ALL"?"base":"outline",onClick:()=>s({activeSource:"ALL"}),block:!0,theme:"default","data-track":"sidebar_filter_source_all",children:[e.jsx(j,{size:16}),e.jsx("span",{children:"全部来源"})]}),e.jsxs(i,{variant:a.activeSource===d.LOCAL?"base":"outline",onClick:()=>s({activeSource:d.LOCAL}),block:!0,theme:"default","data-track":"sidebar_filter_source_local",children:[e.jsx(h,{size:16}),e.jsx("span",{children:"本地上传"})]}),e.jsxs(i,{variant:a.activeSource===d.AI_GENERATED?"base":"outline",onClick:()=>s({activeSource:d.AI_GENERATED}),block:!0,theme:"default","data-track":"sidebar_filter_source_ai",children:[e.jsx(p,{size:16}),e.jsx("span",{children:"AI生成"})]})]})]}),e.jsxs("div",{className:"media-library-sidebar__section",children:[e.jsx("h3",{className:"media-library-sidebar__title",children:"排序"}),e.jsxs("div",{className:"media-library-sidebar__buttons",children:[e.jsx(i,{variant:a.sortBy==="DATE_DESC"?"base":"outline",onClick:()=>s({sortBy:"DATE_DESC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_date_desc",children:"最新优先"}),e.jsx(i,{variant:a.sortBy==="DATE_ASC"?"base":"outline",onClick:()=>s({sortBy:"DATE_ASC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_date_asc",children:"最旧优先"}),e.jsx(i,{variant:a.sortBy==="NAME_ASC"?"base":"outline",onClick:()=>s({sortBy:"NAME_ASC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_name_asc",children:"名称排序"}),e.jsx(i,{variant:a.sortBy==="SIZE_DESC"?"base":"outline",onClick:()=>s({sortBy:"SIZE_DESC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_size_desc",children:"大小排序"})]})]}),e.jsx("div",{className:"media-library-sidebar__section media-library-sidebar__section--storage",children:e.jsx(y,{assetCount:r,storageStatus:l})})]})}export{f as AssetItem,z as MediaLibraryEmpty,I as MediaLibraryGrid,D as MediaLibraryInspector,M as MediaLibraryModal,E as MediaLibrarySidebar,y as MediaLibraryStorageBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pR as d,pJ as g,pS as m,pT as R}from"./ai-chat-
|
|
1
|
+
import{pR as d,pJ as g,pS as m,pT as R}from"./ai-chat-BnWVpTEI.js";import{u as b,r as v}from"./editor-engines-9_72Ghfn.js";import"./startup-runtime-BrfuwjQS.js";import"./diagram-engines-DpAsX7pc.js";const y=s=>{let i="";const h=e=>{if(e.type==="text"||e.type==="inlineCode"||e.type==="code"){i+=e.value;return}if(e.type==="link"){i+=`${e.url}`;return}e.children&&e.children.length>0&&e.children.forEach(a=>{h(a)})};return h(s),i},C=(s,i)=>{if(s.type==="heading"){const h=s.depth;for(let e=h-1;e>=0;e--)if(i[`${e}`])return i[`${e}`]}return i[0]},L=(s,i)=>{var M,P,$;const e=b().use(v).parse(s);let a=!1;const f=(M=e.children)==null?void 0:M.find(t=>{if(t.type==="heading")return t});f&&((P=e.children)==null?void 0:P.filter(t=>t.type==="heading"&&f&&t.depth===f.depth).length)===1&&(a=!0);const S=y(f),T=i||a&&S||"中心主题",w=d(null,!0,!1,g(T)),o=m(T,w.width,w.height,{layout:R.right});o.isRoot=!0,o.type="mindmap";const E={0:o};let l=o;const x=(t,z=!1)=>{var k;if(!(a&&!i&&t===f))if(t.type==="heading"){const r=C(t,E),n=y(t);if(!n)return;const{width:p,height:c}=d(null,!1,!1,g(n)),u=m(n,p,c,{});r.children.push(u),E[`${t.depth}`]=u,l=u}else if(t.type==="list")(k=t.children)==null||k.forEach(r=>{x(r)});else if(t.type==="listItem"){if(t.children&&t.children.length>1){const u=l;t.children.forEach((H,N)=>{x(H,N===0)}),l=u;return}const r=y(t);if(!r)return;const{width:n,height:p}=d(null,!1,!1,g(r)),c=m(r,n,p,{});l.children.push(c)}else{const r=y(t);if(!r)return;const{width:n,height:p}=d(null,!1,!1,g(r)),c=m(r,n,p,{});l.children.push(c),z&&(l=c)}};return($=e.children)==null||$.forEach(t=>{x(t)}),o};export{C as getParentMindNode,y as getTextFromNode,L as parseMarkdownToDrawnix};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{el as k,cm as x,P as o,i$ as P,az as h,bP as m,bd as f,a8 as n,aa as C,n4 as T,n5 as j,n6 as v}from"./ai-chat-
|
|
1
|
+
import{el as k,cm as x,P as o,i$ as P,az as h,bP as m,bd as f,a8 as n,aa as C,n4 as T,n5 as j,n6 as v}from"./ai-chat-BnWVpTEI.js";import{g as I,I as A,S as W}from"./bootstrap-CQRLkOtk.js";import{e as d,q as E,af as N,c as z}from"./tool-windows-Bf_pMml-.js";import{S as R}from"./size-picker-DTrdjyLh.js";import"./startup-runtime-BrfuwjQS.js";import"./startup-app-CH3QzBb4.js";const w=[1,2,4,8,12,16,24,32,48,64,96,100],K=[{icon:n.jsx(T,{}),type:"corner",titleKey:"toolbar.anchorCorner"},{icon:n.jsx(j,{}),type:"smooth",titleKey:"toolbar.anchorSmooth"},{icon:n.jsx(v,{}),type:"symmetric",titleKey:"toolbar.anchorSymmetric"}],O=()=>{const t=I(),{appState:a}=k(),{t:s}=x(),i=o.useRef(null);P(i,{enablePositionTracking:!0,enableScaleCompensation:!0});const c=d(t),[u,l]=o.useState(c.strokeWidth),[r,p]=o.useState(c.defaultAnchorType),S=a.pointer===h.pen&&t.pointer===h.pen;o.useEffect(()=>{const e=d(t);l(e.strokeWidth),p(e.defaultAnchorType)},[t,a.pointer,t.pointer,a.toolSettingsVersion]);const g=o.useCallback(e=>{l(e),E(t,e)},[t]),y=o.useCallback(e=>{m.trackUIInteraction({area:"canvas_tool_settings",action:"pen_stroke_width_changed",control:"pen_size_picker",value:e,source:"pen_settings_toolbar"})},[]),b=o.useCallback(e=>{e!==r&&m.trackUIInteraction({area:"canvas_tool_settings",action:"pen_anchor_type_changed",control:"anchor_type_button",value:e,source:"pen_settings_toolbar"}),p(e),N(t,e)},[r,t]);if(!S)return null;const _=f.getBoardContainer(t);return n.jsx("div",{className:"pen-settings-toolbar",children:n.jsx(A,{ref:i,padding:1,children:n.jsxs(W.Row,{gap:1,align:"center",children:[n.jsx(R,{size:u,onSizeChange:g,onSizeCommit:y,presets:w,previewColor:"#999",title:s("toolbar.strokeWidth"),min:1,max:100,container:_}),n.jsx("div",{className:"pen-settings-divider"}),n.jsx("div",{className:"pen-anchor-type-picker",children:K.map(e=>n.jsx(z,{className:C("pen-anchor-type-button",{active:r===e.type}),type:"button",visible:!0,icon:e.icon,tooltip:s(e.titleKey),"aria-label":s(e.titleKey),onPointerUp:()=>b(e.type)},e.type))})]})})})};export{O as PenSettingsToolbar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as r}from"./startup-runtime-BrfuwjQS.js";(async function(){try{await(window.__OPENTU_START_MAIN_ENTRY__||Promise.resolve()),await r(()=>import("./startup-app-
|
|
1
|
+
import{_ as r}from"./startup-runtime-BrfuwjQS.js";(async function(){try{await(window.__OPENTU_START_MAIN_ENTRY__||Promise.resolve()),await r(()=>import("./startup-app-CH3QzBb4.js").then(_=>_.m),[],import.meta.url)}catch(_){if(window.__OPENTU_BOOT_DYNAMIC_IMPORT_RECOVERY__&&window.__OPENTU_BOOT_DYNAMIC_IMPORT_RECOVERY__(_))return;throw _}})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as m,a8 as e,aa as E,gt as i,ix as h,iq as k,dU as R,iy as T,iz as I,iA as N,iB as P,iC as S,iD as A,iE as D}from"./ai-chat-
|
|
1
|
+
import{P as m,a8 as e,aa as E,gt as i,ix as h,iq as k,dU as R,iy as T,iz as I,iA as N,iB as P,iC as S,iD as A,iE as D}from"./ai-chat-BnWVpTEI.js";import{I as v,S as w}from"./bootstrap-CQRLkOtk.js";import{c as L}from"./tool-windows-Bf_pMml-.js";import"./startup-runtime-BrfuwjQS.js";import"./startup-app-CH3QzBb4.js";const C=[{icon:e.jsx(T,{}),title:"Rectangle",pointer:i.rectangle},{icon:e.jsx(I,{}),title:"Ellipse",pointer:i.ellipse},{icon:e.jsx(N,{}),title:"Triangle",pointer:i.triangle},{icon:e.jsx(P,{}),title:"Terminal",pointer:h.terminal},{icon:e.jsx(S,{}),title:"Diamond",pointer:i.diamond},{icon:e.jsx(A,{}),title:"Parallelogram",pointer:i.parallelogram},{icon:e.jsx(D,{}),title:"RoundRectangle",pointer:i.roundRectangle}],z=({visible:r,position:o,currentShape:y,onSelectShape:p,onClose:s,container:u})=>{const c=m.useRef(null);m.useEffect(()=>{if(!r)return;const t=d=>{c.current&&!c.current.contains(d.target)&&s()},a=d=>{d.key==="Escape"&&s()},l=setTimeout(()=>{document.addEventListener("mousedown",t),document.addEventListener("keydown",a)},50);return()=>{clearTimeout(l),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",a)}},[r,s]);const j=m.useCallback(t=>{p(t)},[p]);if(!r)return null;const n={x:isNaN(o.x)?0:o.x,y:isNaN(o.y)?0:o.y},x=200,g=80;typeof window<"u"&&(n.x+x>window.innerWidth&&(n.x=window.innerWidth-x-10),n.y+g>window.innerHeight&&(n.y=o.y-g-20));const f=e.jsx("div",{ref:c,className:E("auto-complete-shape-picker",k),style:{left:n.x,top:n.y},children:e.jsx(v,{padding:1,children:e.jsx(w.Col,{gap:1,children:e.jsx(w.Row,{gap:1,children:C.map((t,a)=>e.jsx(L,{className:E("shape-button",{"is-current":y===t.pointer}),type:"icon",size:"small",visible:!0,icon:t.icon,tooltip:t.title,"aria-label":t.title,onPointerDown:({event:l})=>{l.stopPropagation(),j(t.pointer)}},a))})})})});return u?R.createPortal(f,u):f};export{z as AutoCompleteShapePicker};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{at as A,ar as C,jF as w,pI as F,pJ as L,pK as it,pL as R,gt as N,pM as K,pN as Z,pO as Q,ix as wt,jK as ct,pP as St,gu as et,pQ as kt,a0 as At,eb as Tt,aB as j}from"./ai-chat-
|
|
1
|
+
import{at as A,ar as C,jF as w,pI as F,pJ as L,pK as it,pL as R,gt as N,pM as K,pN as Z,pO as Q,ix as wt,jK as ct,pP as St,gu as et,pQ as kt,a0 as At,eb as Tt,aB as j}from"./ai-chat-BnWVpTEI.js";import{m as st}from"./diagram-engines-DpAsX7pc.js";import"./startup-runtime-BrfuwjQS.js";const rt=20,It={rect:"rectangle",circle:"ellipse"},dt={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:`${rt}px`},maxEdges:500,maxTextSize:5e4};class nt{constructor({converter:e}){this.convert=(r,n)=>this.converter(r,{...n,fontSize:n.fontSize||rt}),this.converter=e}}var X;(function(t){t.ROUND="round",t.STADIUM="stadium",t.DOUBLECIRCLE="doublecircle",t.CIRCLE="circle",t.DIAMOND="diamond"})(X||(X={}));var ot;(function(t){t.COLOR="color"})(ot||(ot={}));var M;(function(t){t.FILL="fill",t.STROKE="stroke",t.STROKE_WIDTH="stroke-width",t.STROKE_DASHARRAY="stroke-dasharray"})(M||(M={}));const Ot=(t,e={listUnicodeChar:""})=>{e=e||{},e.listUnicodeChar=e.hasOwnProperty("listUnicodeChar")?e.listUnicodeChar:!1,e.stripListLeaders=e.hasOwnProperty("stripListLeaders")?e.stripListLeaders:!0,e.gfm=e.hasOwnProperty("gfm")?e.gfm:!0,e.useImgAltText=e.hasOwnProperty("useImgAltText")?e.useImgAltText:!0,e.preserveLinks=e.hasOwnProperty("preserveLinks")?e.preserveLinks:!1;let r=t||"";r=r.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{e.stripListLeaders&&(e.listUnicodeChar?r=r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,e.listUnicodeChar+" $1"):r=r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),e.gfm&&(r=r.replace(/\n={2,}/g,`
|
|
2
2
|
`).replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),e.preserveLinks&&(r=r.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),r=r.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,e.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,`
|
|
3
3
|
|
|
4
4
|
`).replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,`
|