azdiffs 1.0.1 → 1.1.0
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 +6 -0
- package/dist/cli.js +88 -31
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId-BfEZAJVI.js +1 -0
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits._commitId-DvqTmFzX.js +1 -0
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits.index-Bd3xdIex.js +1 -0
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.conflicts-DV0pCnK1.js +1 -0
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.files-Mr-AIHvi.js +1 -0
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.index-DoV2Gs7F.js +1 -0
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId-ChLX3uCr.js +1 -0
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits._commitId-DXZcIPBR.js +1 -0
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits.index-Bd3xdIex.js +1 -0
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.conflicts-DkEZ314x.js +1 -0
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.files-N3xJdxPo.js +1 -0
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.index-Dt7ItZCC.js +1 -0
- package/dist/web/assets/_organization.index-DVTzM87W.js +1 -0
- package/dist/web/assets/commit-diff-view-BNA-1iz5.js +1 -0
- package/dist/web/assets/commits-view-Cq3oHLFX.js +13 -0
- package/dist/web/assets/conflicts-view-Bca0Tnmk.js +8 -0
- package/dist/web/assets/dev.diff-jb6X8hTd.js +1 -0
- package/dist/web/assets/file-header-B2S9b0sl.js +49 -0
- package/dist/web/assets/files-view-C2YnVYtG.js +1460 -0
- package/dist/web/assets/grammars-B3laSCck.js +2 -0
- package/dist/web/assets/{highlights-BJb1-tzP.js → highlights-C-SBVYal.js} +1 -1
- package/dist/web/assets/home-page-BUnNaCN6.js +1 -0
- package/dist/web/assets/inbox-D8-BBgQT.js +1 -0
- package/dist/web/assets/index-DsrXp1aY.js +11 -0
- package/dist/web/assets/overview-view-B9qPTEMk.js +2 -0
- package/dist/web/assets/pull-request-layout-R9F6zMxd.js +35 -0
- package/dist/web/assets/routes-D2t0cGUy.js +1 -0
- package/dist/web/assets/shiki-mTy6Inae.js +1 -0
- package/dist/web/assets/shortcut-help-D99FihA2.js +1 -0
- package/dist/web/assets/{stream-tokenizer-B5Ok5N3S.js → stream-tokenizer-CKeNSKPz.js} +2 -2
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId-D7saE-jO.js +0 -1
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits._commitId-DOwGbBTQ.js +0 -1
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +0 -1
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.conflicts-Cjr34xFt.js +0 -1
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.files-BjjJ4Yb8.js +0 -1
- package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.index-iY62N_zR.js +0 -1
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId-CrHRklAE.js +0 -1
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits._commitId-WC7fEryq.js +0 -1
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +0 -1
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.conflicts-BhUkafpV.js +0 -1
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.files-_RVmv4sD.js +0 -1
- package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.index-BJrgfbSD.js +0 -1
- package/dist/web/assets/_organization.index-hKcWlBrk.js +0 -1
- package/dist/web/assets/commit-diff-view-CQeZylif.js +0 -1
- package/dist/web/assets/commits-view-B_TQ6AnD.js +0 -13
- package/dist/web/assets/conflicts-view-CnGEkjaP.js +0 -8
- package/dist/web/assets/dev.diff-DH1qvnWe.js +0 -1
- package/dist/web/assets/file-header-keBlejWu.js +0 -49
- package/dist/web/assets/files-view-Bu3bjrNf.js +0 -1460
- package/dist/web/assets/grammars-DmFYBwmS.js +0 -2
- package/dist/web/assets/home-page-Y5jGxOav.js +0 -1
- package/dist/web/assets/inbox-jP8QPtzZ.js +0 -1
- package/dist/web/assets/index-B297yCgq.js +0 -11
- package/dist/web/assets/overview-view-cEOsI9TY.js +0 -2
- package/dist/web/assets/pull-request-layout-DsDKURcq.js +0 -35
- package/dist/web/assets/routes-BruvNNp9.js +0 -1
- package/dist/web/assets/shiki-DueA5xDi.js +0 -1
- package/dist/web/assets/shortcut-help-Cb0be4f3.js +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-BLXQ4ufn.js";import{Bt as r,Cr as i,Ct as a,Dn as o,Dt as s,F as c,Ft as l,H as u,Hn as d,M as f,N as p,Nt as m,On as h,Ot as g,P as _,Pt as v,R as y,Sr as b,Tt as x,W as S,Y as C,Z as w,_t as T,bn as E,dt as D,fn as O,gt as k,k as A,kn as j,kt as M,mt as N,pn as ee,vn as te,wt as P,xn as ne,yn as re,z as ie}from"./index-DsrXp1aY.js";import{A as ae,F as oe,G as se,H as ce,I as le,J as ue,K as de,O as fe,Q as pe,U as me,W as he,X as ge,Y as _e,Z as ve,at as ye,g as be,it as xe,j as Se,ot as Ce,q as we}from"./pull-request-layout-R9F6zMxd.js";import{a as Te,i as Ee,n as De,o as Oe,r as ke,s as Ae,t as je}from"./lib-rf_jxHx0.js";import{_ as Me,g as Ne,n as Pe}from"./inbox-D8-BBgQT.js";var Fe={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},F=t(i(),1),I=b();function Ie(e){if(e.isDeleted||Le(e).length===0)return{kind:`deleted`};if(e.comments[0]?.commentType===`system`)return{kind:`system`};let t=e.threadContext;if(t===null)return{kind:`pull-request`};let n=oe(t.filePath);if(n.length===0)return{kind:`pull-request`};let r=t.rightFileEnd??t.rightFileStart;if(r!==null&&r.line>0){let e=t.rightFileStart?.line??r.line;return{kind:`line`,path:n,side:`additions`,lineNumber:r.line,startLineNumber:Math.min(e,r.line)}}let i=t.leftFileEnd??t.leftFileStart;if(i!==null&&i.line>0){let e=t.leftFileStart?.line??i.line;return{kind:`line`,path:n,side:`deletions`,lineNumber:i.line,startLineNumber:Math.min(e,i.line)}}return{kind:`file`,path:n}}function Le(e){return e.comments.filter(e=>!e.isDeleted)}var Re=new Set([`fixed`,`closed`,`wontFix`,`byDesign`]);function ze(e){return e!==null&&Re.has(e)}function Be(e){let t=e.publishedDate??e.comments[0]?.publishedDate??null,n=t===null?NaN:Date.parse(t);return Number.isNaN(n)?0:n}function Ve(e,t){return Be(e)-Be(t)||e.id-t.id}function He(e){let t=e.side??`additions`,n=e.endSide??t;return n===t?{side:t,startLine:Math.min(e.start,e.end),endLine:Math.max(e.start,e.end)}:{side:n,startLine:e.end,endLine:e.end}}function Ue(e){let{file:t,comparison:n}=e,r=le(t.path),i;if(`side`in e){let n=t.change===`added`?`additions`:t.change===`deleted`?`deletions`:e.side,a=Math.max(1,Math.min(e.startLine,e.endLine)),o=Math.max(1,e.startLine,e.endLine);i=x(r,{side:n===`additions`?`right`:`left`,startLine:a,endLine:o,endLineLength:Math.max(0,e.endLineLength)})}else i=x(r,null);return{threadContext:i,pullRequestThreadContext:{changeTrackingId:t.changeTrackingId,iterationContext:{firstComparingIteration:n.baseIteration??n.iteration,secondComparingIteration:n.iteration}}}}function We(e,t){return e.kind===`file`?`new|file|${e.path}`:`new|line|${t}|${e.side}|${e.startLine}|${e.endLine}|${e.path}`}function Ge(e,t){let n=e.split(`|`);if(n[0]!==`new`)return null;if(n[1]===`file`&&n.length>=3)return{kind:`file`,path:n.slice(2).join(`|`)};if(n[1]!==`line`||n.length<7)return null;let[,,r,i,a,o]=n;if(Number(r)!==t||i!==`additions`&&i!==`deletions`)return null;let s=Number(a),c=Number(o);return!Number.isInteger(s)||!Number.isInteger(c)||s<1?null:{kind:`line`,path:n.slice(6).join(`|`),side:i,startLine:s,endLine:c}}var Ke=`new|pull-request`,qe=e=>`reply|${e}`,L=(e,t)=>`edit|${e}|${t}`,R=e=>`thread|${e}`;function Je(e){let t=o().review.newThread;return e.kind===`file`?t.commentOnFile:t.commentOnLines(e.startLine,e.endLine,e.side===`deletions`)}function Ye(e){return`azdiffs:drafts:${e.organization.toLowerCase()}:${e.repositoryId.toLowerCase()}:${e.pullRequestId}`}function Xe(e,t){let n=Ye(t),r=null,i=()=>{if(r!==null)return r;r={};try{let t=e?.getItem(n)??null,i=t===null?null:JSON.parse(t);if(typeof i==`object`&&i&&!Array.isArray(i))for(let[e,t]of Object.entries(i))typeof t==`string`&&t.trim().length>0&&(r[e]=t)}catch{}return r},a=()=>{let t=i();try{Object.keys(t).length===0?e?.removeItem(n):e?.setItem(n,JSON.stringify(t))}catch{}};return{read:e=>i()[e]??``,write(e,t){let n=i();if(t.trim().length===0){if(!(e in n))return;delete n[e]}else{if(n[e]===t)return;n[e]=t}a()},clear(e){let t=i();e in t&&(delete t[e],a())},keys:()=>Object.keys(i())}}function Ze(){try{return globalThis.sessionStorage??null}catch{return null}}var Qe={composers:[],replies:new Set,editing:new Set,busy:new Set,errors:new Map,focus:null};function $e(e={}){let t={...Qe,...e},n=new Set;return{get:()=>t,update(e){t={...t,...e(t)};for(let e of n)e()},subscribe(e){return n.add(e),()=>n.delete(e)}}}function z(e,t,n){if(e.has(t)===n)return e;let r=new Set(e);return n?r.add(t):r.delete(t),r}function et(e,t,n){if(n===null&&!e.has(t))return e;let r=new Map(e);return n===null?r.delete(t):r.set(t,n),r}function B(e,t){return(0,F.useSyncExternalStore)(e.subscribe,()=>t(e.get()))}var tt=-1;function nt(){return tt--}function rt(e){return e<0}function it(e,t,n,r,i=new Date().toISOString()){return{id:e,parentCommentId:r,author:t,content:n,commentType:`text`,publishedDate:i,lastUpdatedDate:i,isDeleted:!1,likes:0}}function at(e,t,n,r,i=new Date().toISOString()){return{id:e,status:`active`,isDeleted:!1,publishedDate:i,lastUpdatedDate:i,comments:[it(e,t,n,0,i)],threadContext:r?.threadContext??null,pullRequestThreadContext:r?.pullRequestThreadContext??null,identities:[]}}function ot(e,t){return[...(e??[]).filter(e=>e.id!==t.id),t]}function st(e,t,n){let r=(e??[]).filter(e=>e.id!==n.id),i=r.findIndex(e=>e.id===t);return i===-1?[...r,n]:r.map((e,t)=>t===i?n:e)}function ct(e,t){return(e??[]).filter(e=>e.id!==t)}function lt(e,t,n){return(e??[]).map(e=>e.id===t?{...e,...n(e)}:e)}function ut(e){return{comments:e,lastUpdatedDate:new Date().toISOString()}}function dt(e,t,n){return lt(e,t,e=>ut([...e.comments.filter(e=>e.id!==n.id),n]))}function ft(e,t,n,r){return lt(e,t,e=>{let t=e.comments.filter(e=>e.id!==r.id||e.id===n);return ut(t.some(e=>e.id===n)?t.map(e=>e.id===n?r:e):[...t,r])})}function pt(e,t,n){return lt(e,t,e=>ut(e.comments.filter(e=>e.id!==n)))}function mt(e,t,n,r){return lt(e,t,e=>ut(e.comments.map(e=>e.id===n?{...e,...r}:e)))}var ht=(0,F.createContext)(null);function gt({controller:e,children:t}){return(0,I.jsx)(ht.Provider,{value:e,children:t})}function _t(){return(0,F.useContext)(ht)}var vt=(e,t)=>e.toLowerCase()===t.toLowerCase();function yt(e){let{scope:t,comparison:n}=e,r=d(),i=D(t.organization),o=(0,F.useMemo)(()=>i.data===void 0?null:{id:i.data.id,displayName:i.data.displayName,...i.data.uniqueName===void 0?{}:{uniqueName:i.data.uniqueName}},[i.data]),c=(0,F.useMemo)(()=>$e(),[]),l=(0,F.useMemo)(()=>Xe(Ze(),{organization:t.organization,repositoryId:t.repositoryId,pullRequestId:t.pullRequestId}),[t.organization,t.repositoryId,t.pullRequestId]),u=(0,F.useRef)({input:e,me:o});u.current={input:e,me:o};let f=n?.iteration??0,p=n?.since??0,m=e.threadsKey??Se.threads(t,f,p),h=(0,F.useRef)(m);h.current=m;let _=(0,F.useMemo)(()=>Se.allThreads(t),[t]),v=e=>r.setQueryData(h.current,e),y=async e=>{c.update(t=>({busy:z(t.busy,e,!0),errors:et(t.errors,e,null)})),await r.cancelQueries({queryKey:h.current})},b=e=>{c.update(t=>({busy:z(t.busy,e,!1)})),r.isMutating({mutationKey:_})<=1&&r.invalidateQueries({queryKey:_})},x=(e,t)=>c.update(n=>({errors:et(n.errors,e,t)})),S=()=>N(t.organization),C={project:t.project,repositoryId:t.repositoryId,pullRequestId:t.pullRequestId},w=Ce({mutationKey:_,retry:!1,mutationFn:({content:e,context:t})=>a(S(),{...C,content:e,...t===null?{}:{threadContext:t.threadContext,pullRequestThreadContext:t.pullRequestThreadContext}}),onMutate:async({key:e,content:t,context:n,tempId:r})=>{await y(e);let i=u.current.me;i!==null&&v(e=>ot(e,at(r,i,t,n)))},onSuccess:(e,{key:t,tempId:n})=>{v(t=>st(t,n,e)),l.clear(t)},onError:(e,{key:t,entry:n,tempId:r})=>{v(e=>ct(e,r)),c.update(r=>({composers:n===null||r.composers.some(e=>e.key===n.key)?r.composers:[...r.composers,n],errors:et(r.errors,t,e),focus:t}))},onSettled:(e,t,{key:n})=>b(n)}),T=Ce({mutationKey:_,retry:!1,mutationFn:({thread:e,status:t})=>g(S(),{...C,threadId:e.id,status:t}),onMutate:async({thread:e,status:t})=>{await y(R(e.id)),v(n=>lt(n,e.id,()=>({status:t})))},onSuccess:(e,{thread:t})=>v(n=>lt(n,t.id,()=>({status:e.status,lastUpdatedDate:e.lastUpdatedDate}))),onError:(e,{thread:t,previous:n})=>{v(e=>lt(e,t.id,()=>({status:n}))),x(R(t.id),e)},onSettled:(e,t,{thread:n})=>b(R(n.id))}),E=Ce({mutationKey:_,retry:!1,mutationFn:({thread:e,content:t})=>s(S(),{...C,threadId:e.id,parentCommentId:e.comments[0]?.id??1,content:t}),onMutate:async({thread:e,content:t,tempId:n})=>{await y(qe(e.id));let r=u.current.me;r!==null&&v(i=>dt(i,e.id,it(n,r,t,e.comments[0]?.id??1)))},onSuccess:(e,{thread:t,tempId:n,resolve:r})=>{v(r=>ft(r,t.id,n,e)),l.clear(qe(t.id)),r&&T.mutate({thread:t,status:`fixed`,previous:t.status})},onError:(e,{thread:t,tempId:n})=>{v(e=>pt(e,t.id,n)),c.update(n=>({replies:z(n.replies,t.id,!0),errors:et(n.errors,qe(t.id),e),focus:qe(t.id)}))},onSettled:(e,t,{thread:n})=>b(qe(n.id))}),O=Ce({mutationKey:_,retry:!1,mutationFn:({thread:e,comment:t,content:n})=>M(S(),{...C,threadId:e.id,commentId:t.id,content:n}),onMutate:({thread:e,comment:t})=>y(L(e.id,t.id)),onSuccess:(e,{thread:t,comment:n})=>{v(r=>mt(r,t.id,n.id,{content:e.content,lastUpdatedDate:e.lastUpdatedDate??new Date().toISOString()})),l.clear(L(t.id,n.id)),c.update(e=>({editing:z(e.editing,L(t.id,n.id),!1)}))},onError:(e,{thread:t,comment:n})=>x(L(t.id,n.id),e),onSettled:(e,t,{thread:n,comment:r})=>b(L(n.id,r.id))}),A=Ce({mutationKey:_,retry:!1,mutationFn:({thread:e,comment:t})=>P(S(),{...C,threadId:e.id,commentId:t.id}),onMutate:async({thread:e,comment:t})=>{await y(R(e.id)),v(n=>mt(n,e.id,t.id,{isDeleted:!0}))},onError:(e,{thread:t,comment:n})=>{v(e=>mt(e,t.id,n.id,{isDeleted:!1})),x(R(t.id),e)},onSettled:(e,t,{thread:n})=>b(R(n.id))}),j=(0,F.useRef)({create:w,status:T,reply:E,edit:O,remove:A});j.current={create:w,status:T,reply:E,edit:O,remove:A};let ee=(0,F.useRef)(null),te=`${f}:${p}:${e.files.length}`;return(0,F.useEffect)(()=>{if(n===null||e.files.length===0||ee.current===te)return;ee.current=te;let t=new Set(e.files.map(e=>e.path)),r=[];for(let e of l.keys()){let n=Ge(e,p);n!==null&&t.has(n.path)&&r.push({key:e,anchor:n})}r.length!==0&&c.update(e=>({composers:[...e.composers,...r.filter(t=>!e.composers.some(e=>e.key===t.key))]}))},[n,e.files,l,c,p,te]),(0,F.useMemo)(()=>{let e=e=>o!==null&&vt(e.author.id,o.id);return{organization:t.organization,store:c,drafts:l,me:o,isMine:e,describe:e=>ae(e,{repository:u.current.input.repositoryName,method:k(t.organization)}),openComposer(e){let t=We(e,p),n={key:t,anchor:e};return c.update(e=>({composers:e.composers.some(e=>e.key===t)?e.composers:[...e.composers,n],focus:t})),n},closeComposer(e){c.update(t=>({composers:t.composers.filter(t=>t.key!==e),errors:et(t.errors,e,null),focus:t.focus===e?null:t.focus}))},submitComposer(e,t){let r=t.trim();if(r.length===0||c.get().busy.has(e.key))return;let i=u.current.input.files.find(t=>t.path===e.anchor.path);if(i===void 0||n===null)return;let a={iteration:n.iteration,...n.since>0?{baseIteration:n.since}:{}},{anchor:o}=e,s=o.kind===`file`?Ue({file:i,comparison:a}):Ue({file:i,comparison:a,side:o.side,startLine:o.startLine,endLine:o.endLine,endLineLength:u.current.input.lineText(o.path,o.side,o.endLine)?.length??0});c.update(t=>({composers:t.composers.filter(t=>t.key!==e.key),busy:z(t.busy,e.key,!0)})),j.current.create.mutate({key:e.key,entry:e,content:r,context:s,tempId:nt()})},commentOnPullRequest(e){let t=e.trim(),n=Ke;t.length===0||c.get().busy.has(n)||(c.update(e=>({busy:z(e.busy,n,!0)})),j.current.create.mutate({key:n,entry:null,content:t,context:null,tempId:nt()}))},setReplyOpen(e,t){c.update(n=>({replies:z(n.replies,e,t),errors:t?n.errors:et(n.errors,qe(e),null),focus:t?qe(e):n.focus}))},reply(e,t,n={}){let r=t.trim(),i=qe(e.id);r.length===0||c.get().busy.has(i)||(c.update(t=>({replies:z(t.replies,e.id,!1),busy:z(t.busy,i,!0)})),j.current.reply.mutate({thread:e,content:r,resolve:n.resolve===!0,tempId:nt()}))},setEditing(e,t,n){let r=L(e,t);n||l.clear(r),c.update(e=>({editing:z(e.editing,r,n),errors:et(e.errors,r,null),focus:n?r:e.focus}))},edit(t,n,r){let i=r.trim(),a=L(t.id,n.id);i.length!==0&&!c.get().busy.has(a)&&e(n)&&(i===n.content.trim()?(c.update(e=>({editing:z(e.editing,a,!1)})),l.clear(a)):(c.update(e=>({busy:z(e.busy,a,!0)})),j.current.edit.mutate({thread:t,comment:n,content:i})))},remove(t,n){let r=R(t.id);!c.get().busy.has(r)&&e(n)&&(c.update(e=>({busy:z(e.busy,r,!0)})),j.current.remove.mutate({thread:t,comment:n}))},setStatus(e,t){let n=R(e.id);c.get().busy.has(n)||e.status===t||(c.update(e=>({busy:z(e.busy,n,!0)})),j.current.status.mutate({thread:e,status:t,previous:e.status}))},clearError(e){c.update(t=>({errors:et(t.errors,e,null)}))}}},[c,l,o,t.organization,p,n])}var bt=(e,t)=>e.toLowerCase()===t.toLowerCase();async function xt(e,t){let n=(e,t=!1)=>({ok:!1,problem:e,pushed:t}),r,i;try{if(r=await e.branchHead(),r===null)return n({kind:`branch-gone`});if(!bt(r,t.expectedHead))return n({kind:`stale`});i=await e.readFile(r)}catch(e){return n({kind:`failed`,error:e})}let a=se(i);if(!a.ok)return n({kind:`not-text`});let o=he(a.file,t.startLine,t.endLine);if(o===null||!de(o,t.original))return n({kind:`lines-changed`});let s=ce(i,t.startLine,t.endLine,ve(t.suggestion));if(!s.ok)return n({kind:s.reason===`not-text`?`not-text`:`lines-changed`});try{return{ok:!0,commitId:(await e.push({oldObjectId:r,contentBase64:pe(s.bytes),message:t.message})).commitId}}catch(e){return n(v(e)?{kind:`stale`}:{kind:`failed`,error:e},!0)}}var St=(0,F.createContext)(null);function Ct({value:e,children:t}){return(0,I.jsx)(St.Provider,{value:e,children:t})}function wt(){return(0,F.useContext)(St)}var Tt=()=>void 0,Et=()=>()=>{};function Dt(e,t){return(0,F.useSyncExternalStore)(e?.subscribe??Et,e===null?Tt:()=>e.state(t))}function Ot(e,t){return`https://dev.azure.com/${[e.organization,e.project,`_git`,e.repository,`commit`].map(encodeURIComponent).join(`/`)}/${t}`}var kt=(e,t)=>e.toLowerCase()===t.toLowerCase();function At(e){return{status:e.pullRequest.status,head:e.latest?.sourceCommit??null,mergeSource:e.pullRequest.lastMergeSourceCommit,since:e.since}}function jt({status:e,head:t,mergeSource:n,since:r}){return e===`active`?t===null?{kind:`loading`}:n!==null&&!kt(n,t)?{kind:`newer`}:r===null?null:{kind:`since`}:{kind:`inactive`,status:e}}function Mt(e){let t=o().review.blocked;return e.kind===`inactive`?t.inactive(e.status):t[e.kind]}function Nt(e){let t=d(),n=(0,F.useRef)(e);n.current=e;let i=(0,F.useMemo)(()=>{let e=new Map,t=new Set;return{get:t=>e.get(t),set(n,r){r===null?e.delete(n):e.set(n,r);for(let e of t)e()},subscribe(e){return t.add(e),()=>t.delete(e)}}},[]),a=(0,F.useRef)(new Set),{pullRequest:s,review:c,scope:u,location:f}=e,p=c.me,h=p!==null&&kt(p.id,s.author.id),g=At(e),{status:_,mergeSource:v,since:y}=g,b=g.head,x=(0,F.useMemo)(()=>jt({status:_,head:b,mergeSource:v,since:y}),[_,b,v,y]);return(0,F.useMemo)(()=>{let e=(e,t)=>{let n=s.sourceBranch,r=o().review.suggestion,i=e=>({message:e,signIn:null});switch(e.kind){case`stale`:return i(r.stale(n));case`branch-gone`:return i(r.branchGone(n));case`lines-changed`:return i(r.linesChanged);case`not-text`:return i(r.notText);case`failed`:{let{error:n}=e;if(T(n)||O(n,`unauthorized`))return{message:``,signIn:n};if(t&&O(n,`network`))return i(r.mayHaveLanded);let a=c.describe(n);return{message:a.kind===`message`?a.message:``,signIn:a.kind===`sign-in`?n:null}}}},d=e=>{t.invalidateQueries({queryKey:fe.detail(f)}),t.invalidateQueries({queryKey:Se.iterations(u)}),e&&t.invalidateQueries({queryKey:Se.allThreads(u)})};return{newSideLines(e,t,r){if(t<1||r<t)return null;let i=[];for(let a=t;a<=r;a++){let t=n.current.lineText(e,`additions`,a);if(t===null)return null;i.push(t)}return i},viewerIsAuthor:h,blocked:x,organization:u.organization,pullRequestId:s.pullRequestId,branch:s.sourceBranch,pullRequestUrl:r(f),state:i.get,explain:e,subscribe:i.subscribe,clear:e=>{a.current.has(e)||i.set(e,null)},apply(e){let t=n.current,r=t.latest?.sourceCommit??null;if(a.current.has(e.key)||jt(At(t))!==null||r===null||i.get(e.key)?.phase===`done`)return;a.current.add(e.key),i.set(e.key,{phase:`busy`});let o=N(u.organization),p={project:u.project,repositoryId:u.repositoryId},h=`/${e.path.replace(/^\/+/,``)}`;xt({branchHead:()=>m(o,{...p,branch:s.sourceRefName}),readFile:async e=>new Uint8Array((await ye(o,{...p,path:h,commitId:e})).bytes),push:e=>l(o,{...p,branch:s.sourceRefName,path:h,...e})},{path:h,startLine:e.startLine,endLine:e.endLine,original:e.original,suggestion:e.suggestion,expectedHead:r,message:e.message}).then(t=>{if(t.ok){i.set(e.key,{phase:`done`,commitId:t.commitId,url:Ot(f,t.commitId)});let n=e.resolve&&e.thread.status!==`fixed`;n&&c.setStatus(e.thread,`fixed`),d(!n)}else i.set(e.key,{phase:`error`,problem:t.problem,pushed:t.pushed}),(t.pushed||t.problem.kind===`stale`)&&d(!0)}).finally(()=>{a.current.delete(e.key)})}}},[x,h,s,c,u,f,i,t])}var Pt=new Map;function Ft(e){return`${e.organization.toLowerCase()}:${e.repositoryId}:${e.pullRequestId}:${e.iteration}`}function It(e,t){Pt.set(e,t)}function Lt(e){return Pt.get(e)}var Rt=new Set([`bun.lock`,`bun.lockb`,`package-lock.json`,`npm-shrinkwrap.json`,`pnpm-lock.yaml`,`yarn.lock`,`cargo.lock`,`packages.lock.json`,`composer.lock`,`gemfile.lock`,`poetry.lock`]),zt=[`.lock`,`.min.js`,`.min.css`,`.snap`,`.designer.cs`,`.g.cs`,`.g.i.cs`],Bt=new Set([`dist`,`node_modules`]);function Vt(e){let t=e.replace(/^\/+/,``).split(`/`),n=(t.at(-1)??``).toLowerCase();return n.length===0?!1:Rt.has(n)||zt.some(e=>n.endsWith(e)&&n.length>e.length)?!0:t.slice(0,-1).some(e=>Bt.has(e))}function Ht({concurrency:e=6,run:t}){let n=[],r=new Set,i=new Map,a=!1;function o(){for(;!a&&i.size<e&&n.length>0;){let e=n.shift(),r=new AbortController;i.set(e,r),t(e,r.signal).catch(()=>{}).finally(()=>{i.delete(e),o()})}}return{add(e){if(!a){for(let t of e)r.has(t)||(r.add(t),n.push(t));o()}},prioritize(e){if(a)return;let t=e.filter(e=>!i.has(e)&&(!r.has(e)||n.includes(e)));if(t.length===0)return;let s=new Set(t);n=[...t,...n.filter(e=>!s.has(e))];for(let e of t)r.add(e);o()},forget(e){i.has(e)||(r.delete(e),n=n.filter(t=>t!==e))},pending:()=>[...n],running:()=>i.size,dispose(){a=!0,n=[];for(let e of i.values())e.abort();i.clear()}}}var Ut=8192;function Wt(e,t={}){if(e.byteLength===0)return{kind:`text`,text:``};let n=Gt(e);if(n===null&&e.subarray(0,Ut).includes(0))return{kind:`binary`};if(!t.ignoreLimits&&e.byteLength>1048576)return{kind:`too-large`,reason:`size`,bytes:e.byteLength};let r=new TextDecoder(n??`utf-8`).decode(e);return!t.ignoreLimits&&Kt(r)>2e4?{kind:`too-large`,reason:`long-line`,bytes:e.byteLength}:{kind:`text`,text:r}}function Gt(e){return e.byteLength<2?null:e[0]===255&&e[1]===254?`utf-16le`:e[0]===254&&e[1]===255?`utf-16be`:null}function Kt(e){let t=0,n=0;for(;n<=e.length;){let r=e.indexOf(`
|
|
2
|
+
`,n);r===-1&&(r=e.length),r-n>t&&(t=r-n),n=r+1}return t}function qt(e,t){return e.change===`added`?null:e.originalObjectId===void 0?t===null?{kind:`missing`,reason:o().files.errors.noBaseCommit}:{kind:`item`,path:le(e.originalPath??e.path),commitId:t}:{kind:`blob`,objectId:e.originalObjectId}}function Jt(e){return e.change===`deleted`?null:e.objectId===void 0?{kind:`missing`,reason:o().files.errors.noVersion}:{kind:`blob`,objectId:e.objectId}}function Yt(e){return e.kind===`blob`?`blob:${e.objectId}`:e.kind===`item`?`item:${e.commitId}:${e.path}`:`missing:${e.reason}`}var Xt=18e5;function Zt(e,t,n,r){if(r.kind===`missing`)return Promise.reject(Error(r.reason));let i=N(t.organization),a={project:t.project,repositoryId:t.repositoryId};return e.fetchQuery({queryKey:Se.content(t,n),queryFn:async({signal:e})=>{let t=r.kind===`blob`?await xe(i,{...a,objectId:r.objectId,signal:e}):await ye(i,{...a,path:r.path,commitId:r.commitId,signal:e});return new Uint8Array(t.bytes)},staleTime:1/0,gcTime:Xt,retry:!1})}function Qt(e,t){let n=d(),[r,i]=(0,F.useState)(()=>new Map),[a,s]=(0,F.useState)(null),c=(0,F.useRef)(new Map),l=(0,F.useRef)(new Set),u=(0,F.useRef)(new Map),f=(0,F.useRef)({waiting:new Map,sources:new Map,keys:new Map}),p=(0,F.useRef)(null),m=(0,F.useCallback)(()=>{p.current===null&&(p.current=setTimeout(()=>{p.current=null,i(new Map(c.current))},16))},[]),h=(0,F.useCallback)((e,t,n)=>{let r=c.current.get(e);r!==void 0&&(c.current.set(e,{...r,[t]:n}),m())},[m]),g=(0,F.useCallback)((e,t,n)=>{let r=Wt(n,{ignoreLimits:l.current.has(e)});h(e,t,{state:`loaded`,content:r})},[h]),_=(0,F.useMemo)(()=>e===null?null:Ht({run:async(t,r)=>{let i=f.current.sources.get(t),a=()=>f.current.waiting.get(t)??[];if(i===void 0)return;let c=Se.content(e,t),l=()=>void n.cancelQueries({queryKey:c,exact:!0});r.addEventListener(`abort`,l,{once:!0});try{let o=await Zt(n,e,t,i);if(r.aborted)return;u.current.set(t,o);for(let{path:e,side:t}of a())g(e,t,o)}catch(e){if(r.aborted)return;(T(e)||O(e,`unauthorized`))&&s(t=>t??e);let t=e instanceof Error?e.message:o().files.errors.loadFailed;for(let{path:e,side:n}of a())h(e,n,{state:`error`,message:t})}finally{r.removeEventListener(`abort`,l)}}}),[e,n,g,h]);(0,F.useEffect)(()=>()=>_?.dispose(),[_]),(0,F.useEffect)(()=>{if(_===null||t===null)return;let r={waiting:new Map,sources:new Map,keys:new Map},a=new Map,o=t.files.length>1e3?300:t.files.length,s=[];t.files.forEach((e,n)=>{let i={old:qt(e,t.baseCommit),new:Jt(e)},c={old:null,new:null},l={old:{state:`absent`},new:{state:`absent`}};for(let t of[`old`,`new`]){let a=i[t];if(a===null)continue;let u=Yt(a);c[t]=u,r.sources.set(u,a);let d=r.waiting.get(u)??[];d.push({path:e.path,side:t}),r.waiting.set(u,d),l[t]=n<o?{state:`pending`}:{state:`idle`},n<o&&s.push(u)}r.keys.set(e.path,c),a.set(e.path,l)}),f.current=r,c.current=a,i(new Map(a));for(let[t,i]of r.waiting){let r=u.current.get(t)??(e===null?void 0:n.getQueryData(Se.content(e,t)));if(r!==void 0){u.current.set(t,r);for(let{path:e,side:t}of i)g(e,t,r)}}let l=s.filter(e=>!u.current.has(e));for(let e of l)_.forget(e);_.add(l)},[_,t,e,n,g]);let v=(0,F.useCallback)(e=>{let t=[];for(let n of e){let e=f.current.keys.get(n);e?.old!=null&&t.push(e.old),e?.new!=null&&t.push(e.new)}return t},[]),y=(0,F.useCallback)(e=>{if(_===null)return;let t=v(e).filter(e=>!u.current.has(e));for(let e of t)for(let{path:t,side:n}of f.current.waiting.get(e)??[])c.current.get(t)?.[n].state===`idle`&&h(t,n,{state:`pending`});_.prioritize(t)},[_,v,h]),b=(0,F.useCallback)(e=>{if(_===null)return;let t=v([e]).filter(e=>!u.current.has(e));for(let e of t){_.forget(e);for(let t of f.current.waiting.get(e)??[])h(t.path,t.side,{state:`pending`})}_.prioritize(t)},[_,v,h]),x=(0,F.useCallback)(()=>{s(null);for(let[e,t]of c.current)(t.old.state===`error`||t.new.state===`error`)&&b(e)},[b]),S=(0,F.useCallback)(e=>{l.current.add(e);let t=f.current.keys.get(e);for(let n of[`old`,`new`]){let r=t?.[n],i=r==null?void 0:u.current.get(r);i!==void 0&&g(e,n,i)}},[g]);return(0,F.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]),{sides:r,prioritize:y,retry:b,loadLarge:S,sessionError:a,retryFailed:x,inFlight:()=>_?.running()??0}}var $t={diffStyle:`split`,overflow:`scroll`,panelWidth:280,panelCollapsed:!1,commentFilter:`all`},en=`azdiffs:files-view`;function tn(e){return Math.round(Math.min(640,Math.max(180,e)))}function nn(e){if(e===null)return $t;try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return $t;let n=Object.fromEntries(Object.entries(t));return{diffStyle:n.diffStyle===`unified`?`unified`:`split`,overflow:n.overflow===`wrap`?`wrap`:`scroll`,panelWidth:typeof n.panelWidth==`number`&&Number.isFinite(n.panelWidth)?tn(n.panelWidth):$t.panelWidth,panelCollapsed:n.panelCollapsed===!0,commentFilter:n.commentFilter===`active`||n.commentFilter===`hidden`?n.commentFilter:`all`}}catch{return $t}}function rn(){try{return globalThis.localStorage??null}catch{return null}}var an=nn(rn()?.getItem(en)??null),on=new Set;function sn(e){let t={...an,...e};t.panelWidth=tn(t.panelWidth),an=t;try{rn()?.setItem(en,JSON.stringify(an))}catch{}for(let e of on)e()}function cn(e){return on.add(e),()=>on.delete(e)}function ln(){return(0,F.useSyncExternalStore)(cn,()=>an)}var un=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fn={};function pn(e,t){return((t||fn).jsx?dn:un).test(e)}var mn=/\/\*(?:[^*]|\*(?!\/))*\*\//g,hn=/\n/g,gn=/^\s*/,_n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,vn=/^:\s*/,yn=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,bn=/^[;\s]*/,xn=`
|
|
3
|
+
`,Sn=`/`,Cn=`*`,wn=``,Tn=`comment`,En=`declaration`;function Dn(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(hn);t&&(n+=t.length);var i=e.lastIndexOf(xn);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(gn)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(Sn==e.charAt(0)&&Cn==e.charAt(1)){for(var n=2;wn!=e.charAt(n)&&(Cn!=e.charAt(n)||Sn!=e.charAt(n+1));)++n;if(n+=2,wn===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Tn,comment:o})}}function f(){var e=a(),t=c(_n);if(t){if(d(),!c(vn))return s(`property missing ':'`);var n=c(yn),r=e({type:En,property:t[0].replace(mn,wn).trim(),value:n?n[0].replace(mn,wn).trim():wn});return c(bn),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function On(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Dn(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var kn=jn(`end`),An=jn(`start`);function jn(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Mn(e){let t=An(e),n=kn(e);if(t&&n)return{start:t,end:n}}function Nn(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Fn(e.position):`start`in e||`end`in e?Fn(e):`line`in e||`column`in e?Pn(e):``}function Pn(e){return In(e&&e.line)+`:`+In(e&&e.column)}function Fn(e){return Pn(e&&e.start)+`-`+Pn(e&&e.end)}function In(e){return e&&typeof e==`number`?e:1}var Ln=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Nn(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(Ln.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var Rn={}.hasOwnProperty,zn=new Map,Bn=/[A-Z]/g,Vn=/-([a-z])/g,Hn=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Un=new Set([`td`,`th`]),Wn=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Gn(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=nr(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=tr(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Oe:Te,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Kn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Kn(e,t,n){if(t.type===`element`)return qn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Jn(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Xn(e,t,n);if(t.type===`mdxjsEsm`)return Yn(e,t);if(t.type===`root`)return Zn(e,t,n);if(t.type===`text`)return Qn(e,t)}function qn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Oe,e.schema=i),e.ancestors.push(t);let a=cr(e,t.tagName,!1),o=rr(e,t),s=ar(e,t);return Hn.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!je(e)})),$n(e,o,a,t),er(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Jn(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}lr(e,t.position)}function Yn(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lr(e,t.position)}function Xn(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Oe,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:cr(e,t.name,!0),o=ir(e,t),s=ar(e,t);return $n(e,o,a,t),er(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zn(e,t,n){let r={};return er(r,ar(e,t)),e.create(t,e.Fragment,r,n)}function Qn(e,t){return t.value}function $n(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function er(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function tr(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function nr(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=An(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function rr(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Rn.call(t.properties,i)){let a=or(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Un.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ir(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else lr(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else lr(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function ar(e,t){let n=[],r=-1,i=e.passKeys?new Map:zn;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Kn(e,a,o);s!==void 0&&n.push(s)}return n}function or(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=Ae(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?ke(n):De(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:ur(n):sr(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?Fe[r.property]||r.property:r.attribute,n]}function sr(e,t){let n={};try{On(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(Vn,pr))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Ln("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Wn+`#cannot-parse-style-attribute`,r}return n}function cr(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=pn(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=pn(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Rn.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);lr(e)}function lr(e,t){let n=new Ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Wn+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ur(e){let t={},n;for(n in e)Rn.call(e,n)&&(t[dr(n)]=e[n]);return t}function dr(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(Bn,fr);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function fr(e){return`-`+e.toLowerCase()}function pr(e,t){return t.toUpperCase()}var mr={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},hr={};function gr(e,t){let n=t||hr;return _r(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function _r(e,t,n){if(yr(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return vr(e.children,t,n)}return Array.isArray(e)?vr(e,t,n):``}function vr(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=_r(e[i],t,n);return r.join(``)}function yr(e){return!!(e&&typeof e==`object`)}var br=document.createElement(`i`);function xr(e){let t=`&`+e+`;`;br.innerHTML=t;let n=br.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function V(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function H(e,t){return e.length>0?(V(e,e.length,0,t),e):t}var Sr={}.hasOwnProperty;function Cr(e){let t={},n=-1;for(;++n<e.length;)wr(t,e[n]);return t}function wr(e,t){let n;for(n in t){let r=(Sr.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Sr.call(r,a)||(r[a]=[]);let e=i[a];Tr(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Tr(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);V(e,0,0,r)}function Er(e,t){let n=Number.parseInt(e,t);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 U(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var W=Pr(/[A-Za-z]/),G=Pr(/[\dA-Za-z]/),Dr=Pr(/[#-'*+\--9=?A-Z^-~]/);function Or(e){return e!==null&&(e<32||e===127)}var kr=Pr(/\d/),Ar=Pr(/[\dA-Fa-f]/),jr=Pr(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}var Mr=Pr(/\p{P}|\p{S}/u),Nr=Pr(/\s/);function Pr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Fr(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&G(e.charCodeAt(n+1))&&G(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return J(r)?(e.enter(n),s(r)):t(r)}function s(r){return J(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Ir(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&J(t)?(e.enter(r),c(t)):l(t)}function c(t){return J(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Lr={tokenize:Rr};function Rr(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return K(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var zr=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Br(this,e,t,n,!1)}addBefore(e,t,n){Br(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Br(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Vr={tokenize:Ur},Hr={tokenize:Wr};function Ur(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new zr;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Hr,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Hr,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return K(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new zr;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Wr(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Gr(e){if(e===null||q(e)||Nr(e))return 1;if(Mr(e))return 2}function Kr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var qr={name:`attention`,resolveAll:Jr,tokenize:Yr};function Jr(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Xr(o,-a),Xr(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=H(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=H(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=H(r,Kr(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=H(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=H(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),V(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Yr(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Gr(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Gr(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Xr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Zr={name:`autolink`,tokenize:Qr};function Qr(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return W(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||G(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||G(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Or(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Dr(t)?(e.consume(t),l):n(t)}function u(e){return G(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||G(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var $r={partial:!0,tokenize:ei};function ei(e,t,n){return r;function r(t){return J(t)?Y(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||K(e)?t(e):n(e)}}var ti={continuation:{tokenize:ri},exit:ii,name:`blockQuote`,tokenize:ni};function ni(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return J(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ri(e,t,n){let r=this;return i;function i(t){return J(t)?Y(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ti,t,n)(r)}}function ii(e){e.exit(`blockQuote`)}var ai={name:`characterEscape`,tokenize:oi};function oi(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return jr(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var si={name:`characterReference`,tokenize:ci};function ci(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=G,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Ar,u):(e.enter(`characterReferenceValue`),a=7,o=kr,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===G&&!xr(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var li={partial:!0,tokenize:ui};function ui(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var di={concrete:!0,name:`codeFenced`,tokenize:fi};function fi(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||K(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(li,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Y(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||K(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&J(t)?Y(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||K(t)?e.check(li,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||K(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),J(t)?Y(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||K(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var pi={name:`codeIndented`,tokenize:hi},mi={partial:!0,tokenize:gi};function hi(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Ir(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):K(t)?e.attempt(mi,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||K(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function gi(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):K(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Ir(e,t,a,`linePrefix`,4,4)(o)}function a(e){return K(e)?i(e):n(e)}}var _i={name:`codeText`,previous:yi,resolve:vi,tokenize:bi};function vi(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function yi(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function bi(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||K(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var xi=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw 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,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Si(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Si(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Si(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){let t=this.left.splice(e,1/0);Si(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Si(this.left,t.reverse())}}}};function Si(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ci(e){let t={},n=-1,r,i,a,o,s,c,l,u=new xi(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,wi(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return V(e,0,1/0,u.slice(0)),!l}function wi(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ti={resolve:Di,tokenize:Oi},Ei={partial:!0,tokenize:ki};function Di(e){return Ci(e),e}function Oi(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):K(t)?e.check(Ei,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ki(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,a,`linePrefix`)}function a(i){if(i===null||K(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ai(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Or(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||K(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||q(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Or(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ji(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):K(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||K(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!J(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Mi(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||K(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ni(e,t){let n;return r;function r(i){return K(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):J(i)?Y(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Pi={name:`definition`,tokenize:Ii},Fi={partial:!0,tokenize:Li};function Ii(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ji.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=U(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return q(t)?Ni(e,l)(t):l(t)}function l(t){return Ai(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Fi,d,d)(t)}function d(t){return J(t)?Y(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||K(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Li(e,t,n){return r;function r(t){return q(t)?Ni(e,i)(t):n(t)}function i(t){return Mi(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return J(t)?Y(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||K(e)?t(e):n(e)}}var Ri={name:`hardBreakEscape`,tokenize:zi};function zi(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return K(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Bi={name:`headingAtx`,resolve:Vi,tokenize:Hi};function Vi(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};V(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Hi(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||q(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||K(n)?(e.exit(`atxHeading`),t(n)):J(n)?Y(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||q(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ui=`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`.split(`.`),Wi=[`pre`,`script`,`style`,`textarea`],Gi={concrete:!0,name:`htmlFlow`,resolveTo:qi,tokenize:Ji},Ki={partial:!0,tokenize:Yi};function qi(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ji(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):W(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):W(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return W(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||q(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Wi.includes(l)?(i=1,r.interrupt?t(s):O(s)):Ui.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||G(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return J(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||W(t)?(e.consume(t),b):J(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):J(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):J(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||K(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||q(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||J(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||K(t)?O(t):J(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):K(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Ki,re,k)(t)):t===null||K(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(li,A,re)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||K(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return Wi.includes(n)?(e.consume(t),ne):O(t)}return W(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||K(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function Yi(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt($r,t,n)}}var Xi={name:`htmlText`,tokenize:Zi};function Zi(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):W(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):W(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):K(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):K(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):K(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):K(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return W(t)?(e.consume(t),S):n(t)}function S(t){return t===45||G(t)?(e.consume(t),S):C(t)}function C(t){return K(t)?(o=C,N(t)):J(t)?(e.consume(t),C):M(t)}function w(t){return t===45||G(t)?(e.consume(t),w):t===47||t===62||q(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||W(t)?(e.consume(t),E):K(t)?(o=T,N(t)):J(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):K(t)?(o=D,N(t)):J(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):K(t)?(o=O,N(t)):J(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):K(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||q(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||q(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return J(t)?Y(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var Qi={name:`labelEnd`,resolveAll:na,resolveTo:ra,tokenize:ia},$i={tokenize:aa},ea={tokenize:oa},ta={tokenize:sa};function na(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&V(e,0,e.length,n),e}function ra(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=H(o,e.slice(i+1,i+r+3)),o=H(o,[[`enter`,l,t]]),o=H(o,Kr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=H(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=H(o,e.slice(a+1)),o=H(o,[[`exit`,s,t]]),V(e,i,e.length,o),e}function ia(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(U(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt($i,u,o?u:d)(t):t===91?e.attempt(ea,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ta,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function aa(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return q(t)?Ni(e,a)(t):a(t)}function a(t){return t===41?u(t):Ai(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return q(t)?Ni(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Mi(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return q(t)?Ni(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function oa(e,t,n){let r=this;return i;function i(t){return ji.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(U(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function sa(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var ca={name:`labelStartImage`,resolveAll:Qi.resolveAll,tokenize:la};function la(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var ua={name:`labelStartLink`,resolveAll:Qi.resolveAll,tokenize:da};function da(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var fa={name:`lineEnding`,tokenize:pa};function pa(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y(e,t,`linePrefix`)}}var ma={name:`thematicBreak`,tokenize:ha};function ha(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||K(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),J(t)?Y(e,s,`whitespace`)(t):s(t))}}var X={continuation:{tokenize:ya},exit:xa,name:`list`,tokenize:va},ga={partial:!0,tokenize:Sa},_a={partial:!0,tokenize:ba};function va(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:kr(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(ma,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return kr(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check($r,r.interrupt?n:u,e.attempt(ga,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return J(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ya(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check($r,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!J(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(_a,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(X,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ba(e,t,n){let r=this;return Y(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function xa(e){e.exit(this.containerState.type)}function Sa(e,t,n){let r=this;return Y(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!J(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ca={name:`setextUnderline`,resolveTo:wa,tokenize:Ta};function wa(e,t){let n=new zr,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Ta(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),J(t)?Y(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||K(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Ea={tokenize:Da};function Da(e){let t=this,n=e.attempt($r,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ti,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Oa={resolveAll:Ma()},ka=ja(`string`),Aa=ja(`text`);function ja(e){return{resolveAll:Ma(e===`text`?Na:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Ma(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Na(e,t){let n=new zr,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Pa=e({attentionMarkers:()=>Ha,contentInitial:()=>Ia,disable:()=>Ua,document:()=>Fa,flow:()=>Ra,flowInitial:()=>La,insideSpan:()=>Va,string:()=>za,text:()=>Ba}),Fa={42:X,43:X,45:X,48:X,49:X,50:X,51:X,52:X,53:X,54:X,55:X,56:X,57:X,62:ti},Ia={91:Pi},La={[-2]:pi,[-1]:pi,32:pi},Ra={35:Bi,42:ma,45:[Ca,ma],60:Gi,61:Ca,95:ma,96:di,126:di},za={38:si,92:ai},Ba={[-5]:fa,[-4]:fa,[-3]:fa,33:ca,38:si,42:qr,60:[Zr,Xi],91:ua,92:[Ri,ai],93:Qi,95:qr,96:_i},Va={null:[qr,Oa]},Ha={null:[42,95]},Ua={null:[]};function Wa(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=H(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Kr(a,l.events,l),l.events):[]}function f(e,t){return Ka(p(e),t)}function p(e){return Ga(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){K(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&V(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ga(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Ka(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
4
|
+
`;break;case-3:o=`\r
|
|
5
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function qa(e){let t={constructs:Cr([Pa,...(e||{}).extensions||[]]),content:n(Lr),defined:[],document:n(Vr),flow:n(Ea),lazy:{},string:n(ka),text:n(Aa)};return t;function n(e){return n;function n(n){return Wa(t,e,n)}}}function Ja(e){for(;!Ci(e););return e}var Ya=/[\0\t\n\r]/g;function Xa(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){Ya.lastIndex=c;let n=Ya.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Za=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qa(e){return e.replace(Za,$a)}function $a(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Er(n.slice(t?2:1),t?16:10)}return xr(n)||e}var eo={}.hasOwnProperty;function to(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),no(n)(Ja(qa(n).document().write(Xa()(e,t,!0))))}function no(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(xe),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(_e),blockQuote:o(fe),characterEscape:E,characterReference:E,codeFenced:o(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(pe,s),codeText:o(me,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(he),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(ve),hardBreakTrailing:o(ve),htmlFlow:o(ye,s),htmlFlowData:E,htmlText:o(ye,s),htmlTextData:E,image:o(be),label:s,link:o(xe),listItem:o(Ce),listItemValue:p,listOrdered:o(Se,f),listUnordered:o(Se),paragraph:o(we),reference:ae,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(_e),strong:o(Te),thematicBreak:o(De)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(ee),label:P,labelText:te,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:ne,resourceTitleString:re,resource:ie,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};io(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),eo.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||oo).call(o,void 0,e[0])}for(r.position={start:ro(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ro(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ro(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Nn({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||oo).call(this,e,r[0])),n.position.end=ro(e.end)}function d(){return gr(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=U(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Ee(),n.position={start:ro(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ro(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ro(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Qa(t),n.identifier=U(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=U(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Er(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=xr(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=ro(e.end)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[],position:void 0}}function pe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function me(){return{type:`inlineCode`,value:``,position:void 0}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ge(){return{type:`emphasis`,children:[],position:void 0}}function _e(){return{type:`heading`,depth:0,children:[],position:void 0}}function ve(){return{type:`break`,position:void 0}}function ye(){return{type:`html`,value:``,position:void 0}}function be(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function xe(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function we(){return{type:`paragraph`,children:[],position:void 0}}function Te(){return{type:`strong`,children:[],position:void 0}}function Ee(){return{type:`text`,value:``,position:void 0}}function De(){return{type:`thematicBreak`,position:void 0}}}function ro(e){return{line:e.line,column:e.column,offset:e.offset}}function io(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?io(e,r):ao(e,r)}}function ao(e,t){let n;for(n in t)if(eo.call(t,n))switch(n){case`canContainEols`:case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function oo(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Nn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Nn({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Nn({start:t.start,end:t.end})+`) is still open`)}function so(e){let t=this;t.parser=n;function n(n){return to(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function co(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function lo(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
6
|
+
`}]}function uo(e,t){let n=t.value?t.value+`
|
|
7
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function fo(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function po(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mo(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Fr(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function ho(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function go(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _o(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function vo(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _o(e,t);let i={src:Fr(r.url||``)};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function yo(e,t){let n={src:Fr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function bo(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function xo(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _o(e,t);let i={href:Fr(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function So(e,t){let n={href:Fr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Co(e,t,n){let r=e.all(t),i=n?wo(n):To(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
8
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
9
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function wo(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let{children:n}=e,r=-1;for(;!t&&++r<n.length;)t=To(n[r])}return t}function To(e){let{spread:t}=e;return t??e.children.length>1}function Eo(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Do(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oo(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ko(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ao(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=An(t.children[1]),o=kn(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function jo(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Mo(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var No=9,Po=32;function Fo(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Io(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Io(t.slice(i),i>0,!1)),a.join(``)}function Io(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===No||t===Po;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===No||t===Po;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Lo(e,t){let n={type:`text`,value:Fo(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ro(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var zo={blockquote:co,break:lo,code:uo,delete:fo,emphasis:po,footnoteReference:mo,heading:ho,html:go,imageReference:vo,image:yo,inlineCode:bo,linkReference:xo,link:So,listItem:Co,list:Eo,paragraph:Do,root:Oo,strong:ko,table:Ao,tableCell:Mo,tableRow:jo,text:Lo,thematicBreak:Ro,toml:Bo,yaml:Bo,definition:Bo,footnoteDefinition:Bo};function Bo(){}var{defineProperty:Vo}=Object,Ho=typeof self==`object`?self:globalThis,Uo=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Ho[e](t)},Wo=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Vo(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Ho[e]==`function`?Uo(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Uo(a,o),i)};return r},Go=e=>Wo(new Map,e)(0),Ko=``,{toString:qo}={},{keys:Jo,is:Yo}=Object,Xo=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=qo.call(e).slice(8,-1);switch(n){case`Array`:return[1,Ko];case`Object`:return[2,Ko];case`Date`:return[3,Ko];case`RegExp`:return[4,Ko];case`Map`:return[5,Ko];case`Set`:return[6,Ko];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Zo=([e,t])=>e===0&&(t===`function`||t===`symbol`),Qo=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=Xo(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Yo(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Jo(o))(e||!Zo(Xo(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Ko:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(Zo(Xo(n))||Zo(Xo(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Zo(Xo(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},$o=(e,{json:t,lossy:n}={})=>{let r=[];return Qo(!(t||n),!!t,new Map,r)(e),r},es=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Go($o(e,t)):structuredClone(e):(e,t)=>Go($o(e,t));function ts(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function ns(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function rs(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||ts,r=e.options.footnoteBackLabel||ns,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=[],l=-1;for(;++l<e.footnoteOrder.length;){let t=e.footnoteById.get(e.footnoteOrder[l]);t&&(s[l]=e.all(t))}for(l=-1;++l<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;let a=s[l],o=String(i.identifier).toUpperCase(),u=Fr(o.toLowerCase()),d=0,f=[],p=e.footnoteCounts.get(o);for(;p!==void 0&&++d<=p;){f.length>0&&f.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(l,d);typeof e==`string`&&(e={type:`text`,value:e}),f.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+u+(d>1?`-`+d:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(l,d),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let m=a[a.length-1];if(m&&m.type===`element`&&m.tagName===`p`){let e=m.children[m.children.length-1];e&&e.type===`text`?e.value+=` `:m.children.push({type:`text`,value:` `}),m.children.push(...f)}else a.push(...f);let h={type:`element`,tagName:`li`,properties:{id:t+`fn-`+u},children:e.wrap(a,!0)};e.patch(i,h),c.push(h)}if(c.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...es(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
10
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(c,!0)},{type:`text`,value:`
|
|
11
|
+
`}]}}var is=(function(e){if(e==null)return ls;if(typeof e==`function`)return cs(e);if(typeof e==`object`)return Array.isArray(e)?as(e):os(e);if(typeof e==`string`)return ss(e);throw Error(`Expected function, string, or object as test`)});function as(e){let t=[],n=-1;for(;++n<e.length;)t[n]=is(e[n]);return cs(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function os(e){let t=e;return cs(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ss(e){return cs(t);function t(t){return t&&t.type===e}}function cs(e){return t;function t(t,n,r){return!!(us(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ls(){return!0}function us(e){return typeof e==`object`&&!!e&&`type`in e}function ds(e){return e}var fs=[],ps=`skip`;function ms(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=is(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+ds(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=fs;if(s&&r&&(o=hs(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=d(t.children[e],e,r)();if(n[0]===!1)return n;e=typeof n[1]==`number`?n[1]:e+u}}}if(c&&r){let r=hs(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function hs(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?fs:[e]}function gs(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?ms(e,i,vs(a),o):ms(e,i,_s(a),o)}function _s(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?vs(e.enter):e.enter,exit:typeof e.exit==`function`?vs(e.exit):e.exit}}function vs(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var ys={}.hasOwnProperty,bs={};function xs(e,t){let n=t||bs,r=new Map,i=new Map,a={all:s,applyData:Cs,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...zo,...n.handlers},one:o,options:n,patch:Ss,wrap:Ts};return gs(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=String(e.identifier).toUpperCase();e.type===`definition`?r.has(t)||r.set(t,e):i.has(t)||i.set(t,e)}}),a;function o(e,t){let{type:n}=e,r=a.handlers[n];if(ys.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e;return{...es(n),children:a.all(e)}}return es(e)}return(a.options.unknownHandler||ws)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Es(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Es(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Ss(e,t){e.position&&(t.position=Mn(e))}function Cs(e,t){let n=t;if(e&&e.data){let{hChildren:t,hName:r,hProperties:i}=e.data;typeof r==`string`&&(n.type===`element`?n.tagName=r:n={type:`element`,tagName:r,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,es(i)),`children`in n&&n.children&&t!=null&&(n.children=t)}return n}function ws(e,t){let n=t.data||{},r=`value`in t&&!(ys.call(n,`hProperties`)||ys.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ts(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
12
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
13
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
14
|
+
`}),n}function Es(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ds(e,t){let n=xs(e,t),r=n.one(e,void 0),i=rs(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
15
|
+
`},i)),a}function Os(e,t){return e&&`run`in e?async function(n,r){let i=Ds(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ds(n,{file:r,...e||t})}}function ks(e){if(e)throw e}var As=t(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function js(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ms(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ns(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ns(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Z={basename:Ps,dirname:Fs,extname:Is,join:Ls,sep:`/`};function Ps(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Bs(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Fs(e){if(Bs(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Is(e){Bs(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Ls(...e){let t=-1,n;for(;++t<e.length;)Bs(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Rs(n)}function Rs(e){Bs(e);let t=e.codePointAt(0)===47,n=zs(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function zs(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Bs(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Vs={cwd:Hs};function Hs(){return`/`}function Us(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Ws(e){if(typeof e==`string`)e=new URL(e);else if(!Us(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Gs(e)}function Gs(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Ks=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],qs=class{constructor(e){let t;t=e?Us(e)?{path:e}:typeof e==`string`||Zs(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Vs.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Ks.length;){let e=Ks[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Ks.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Z.basename(this.path):void 0}set basename(e){Ys(e,`basename`),Js(e,`basename`),this.path=Z.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Z.dirname(this.path):void 0}set dirname(e){Xs(this.basename,`dirname`),this.path=Z.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Z.extname(this.path):void 0}set extname(e){if(Js(e,`extname`),Xs(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Z.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Us(e)&&(e=Ws(e)),Ys(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Z.basename(this.path,this.extname):void 0}set stem(e){Ys(e,`stem`),Js(e,`stem`),this.path=Z.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Ln(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Js(e,t){if(e&&e.includes(Z.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Z.sep+"`")}function Ys(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Xs(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Zs(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Qs=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),$s={}.hasOwnProperty,ec=new class e extends Qs{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=Ms()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,As.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(rc(`data`,this.frozen),this.namespace[e]=t,this):$s.call(this.namespace,e)&&this.namespace[e]||void 0:e?(rc(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=oc(e),n=this.parser||this.Parser;return tc(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),tc(`process`,this.parser||this.Parser),nc(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=oc(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);cc(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),tc(`processSync`,this.parser||this.Parser),nc(`processSync`,this.compiler||this.Compiler),this.process(e,r),ac(`processSync`,`process`,t),n;function r(e,r){t=!0,ks(e),n=r}}run(e,t,n){ic(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=oc(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),ac(`runSync`,`run`,n),r;function i(e,t){ks(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=oc(t),r=this.compiler||this.Compiler;return nc(`stringify`,r),ic(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(rc(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,As.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;)i(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];js(o)&&js(r)&&(r=(0,As.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function tc(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function nc(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function rc(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ic(e){if(!js(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ac(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function oc(e){return sc(e)?e:new qs(e)}function sc(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function cc(e){return typeof e==`string`||lc(e)}function lc(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var uc=[],dc={allowDangerousHtml:!0},fc=/^(https?|ircs?|mailto|xmpp)$/i,pc=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function mc(e){let t=hc(e),n=gc(e);return _c(t.runSync(t.parse(n),n),e)}function hc(e){let t=e.rehypePlugins||uc,n=e.remarkPlugins||uc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dc}:dc;return ec().use(so).use(n).use(Os,r).use(t)}function gc(e){let t=e.children||``,n=new qs;return typeof t==`string`?n.value=t:``+t,n}function _c(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||vc;for(let e of pc)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return gs(e,l),Gn(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in mr)if(Object.hasOwn(mr,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=mr[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function vc(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||fc.test(e.slice(0,t))?e:``}function yc(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function bc(e,t,n){let r=is((n||{}).ignore||[]),i=xc(t),a=-1;for(;++a<i.length;)ms(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return ps}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i!==!1){if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(i===!1||d[0].length===0){let t=e.value.codePointAt(n)||0;o.lastIndex=n+(/[uv]/.test(o.flags)&&t>65535?2:1)}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function xc(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Sc(e[0]),Cc(e[1])])}return t}function Sc(e){return typeof e==`string`?new RegExp(yc(e),`g`):e}function Cc(e){return typeof e==`function`?e:function(){return e}}var wc=`phrasing`,Tc=[`autolink`,`link`,`image`,`label`];function Ec(){return{transforms:[Pc],enter:{literalAutolink:Oc,literalAutolinkEmail:kc,literalAutolinkHttp:kc,literalAutolinkWww:kc},exit:{literalAutolink:Nc,literalAutolinkEmail:Mc,literalAutolinkHttp:Ac,literalAutolinkWww:jc}}}function Dc(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:wc,notInConstruct:Tc},{character:`.`,before:`[Ww]{3}`,inConstruct:wc,notInConstruct:Tc},{character:`:`,before:`[PSps]`,after:`\\/`,inConstruct:wc,notInConstruct:Tc}]}}function Oc(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function kc(e){this.config.enter.autolinkProtocol.call(this,e)}function Ac(e){this.config.exit.autolinkProtocol.call(this,e)}function jc(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Mc(e){this.config.exit.autolinkEmail.call(this,e)}function Nc(e){this.exit(e)}function Pc(e){bc(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,Fc],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,Rc],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Lc],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Ic]],{ignore:[`link`,`linkReference`]})}function Fc(e,t,n,r,i){if(!Vc(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),Mr(n.charCodeAt(0))||!zc(n))return!1;let o=Bc(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function Ic(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function Lc(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function Rc(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function zc(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function Bc(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=Ee(e,`(`),a=Ee(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Vc(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||Nr(t)||Mr(t)}Zc.peek=Xc;function Hc(){this.buffer()}function Uc(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Wc(){this.buffer()}function Gc(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Kc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=U(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qc(e){this.exit(e)}function Jc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=U(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Yc(e){this.exit(e)}function Xc(){return`[`}function Zc(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Qc(){return{enter:{gfmFootnoteCallString:Hc,gfmFootnoteCall:Uc,gfmFootnoteDefinitionLabelString:Wc,gfmFootnoteDefinition:Gc},exit:{gfmFootnoteCallString:Kc,gfmFootnoteCall:qc,gfmFootnoteDefinitionLabelString:Jc,gfmFootnoteDefinition:Yc}}}function $c(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Zc},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
16
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?tl:el))),s(),o}}function el(e,t,n){return t===0?e:tl(e,t,n)}function tl(e,t,n){return(n?``:` `)+e}var nl=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];sl.attention=cl,sl.peek=ll;function rl(){return{canContainEols:[`delete`],enter:{strikethrough:al},exit:{strikethrough:ol}}}function il(){return{handlers:{delete:sl},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:nl}]}}function al(e){this.enter({type:`delete`,children:[],position:void 0},e)}function ol(e){this.exit(e)}function sl(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function cl(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function ll(){return`~`}function ul(e){return e.length}function dl(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ul,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=fl(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=pl(r[d]);else{let e=pl(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding===!1||n.alignDelimiters===!1&&o===``||n.delimiterStart===!1&&!d||i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
|
|
17
|
+
`)}function fl(e){return e==null?``:String(e)}function pl(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var ml=is([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function hl(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),gl);return i(),o}function gl(e,t,n){return`>`+(n?``:` `)+e}function _l(e,t){return vl(e,t.inConstruct,!0)&&!vl(e,t.notInConstruct,!1)}function vl(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function yl(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
18
|
+
`&&!e.before&&!e.after&&_l(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
19
|
+
`}function bl(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function xl(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Sl(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Cl(e,t,n,r){let i=Sl(n),a=e.value||``;if(xl(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,wl);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(bl(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
20
|
+
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
21
|
+
`),a&&(u+=o.move(a+`
|
|
22
|
+
`)),u+=o.move(s),c(),u}function wl(e,t,n){return(n?``:` `)+e}function Tl(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function El(e,t,n,r){let i=Tl(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/^<|[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
23
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Dl(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ol(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function kl(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function Al(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function jl(e,t,n){let r=Gr(e),i=Gr(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Ml(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:W(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!W(a))return;for(;a===45||G(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&Wi.includes(o)?1:Ui.includes(o)?6:7}var Nl=new Map([[`*`,!1],[`_`,!0]]);function Pl(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function Fl(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=Nl.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=Gr(u.charCodeAt(u.length-1)),f=Gr((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(Rl(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:Pl(e,t,a),index:o}}}function Il(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?Ol(n.value):kl(n.value),i=Al(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function Ll(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=Wl(e,c,r,i),u=Fl(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function Rl(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function zl(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!jr(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function Bl(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?Ol(n(i[o+1],e,t,{before:``,after:``,...c.current()})):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
|
|
24
|
+
`)&&l.type===`html`&&Ml(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(Gl(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=Vl(l,f.attention,t,c);if(!e)continue;a.push(e),s=kl(e.sequences[0])}else{let n=t.handle(l,e,t,{...c.current(),after:u,before:s});if(!n)continue;c.move(n),a.push(n),s=kl(n)}}return r.pop(),a}function Vl(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=zl(e.type,a,o),c=s[0],l=n.enter(i),u=n.createTracker(r.current());u.move(c);let d=Bl(e,n,{...u.current(),before:c,after:c});if(l(),d.length!==0)return r.move(c),r.move(Gl(d,c,c)),r.move(c),{children:d,sequences:s}}function Hl(e,t,n,r){let i=Wl(e,t,n,r),a=Fl(i,n,r);for(;a;){let o=Ll(e,t,a,n,r);if(!o)return;t=o.chosen,i=o.tokens,a=o.mistake}return i}function Ul(e,t,n,r){let i=n,a=-1;for(;++a<e.length;){let o=e[a];if(typeof o==`string`){i=``;continue}let s=a===e.length-1?r:``,c=o.sequences.find(function(t){let r=t.charAt(0);return r!==i.charAt(0)&&r!==s.charAt(0)||e.length===1&&Nl.has(r)&&t.length>n.length})||o.sequences[0];c!==o.sequences[0]&&t.set(o,c),Ul(o.children,t,c,c),i=c}}function Wl(e,t,n,r){let i=[],a,o=kl(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===Ol(n)&&Il([e],!0),a=void 0,i.push(e),e.value&&(o=kl(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=Ol(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=Wl(n.children,t,c,c),m=p[0].value,h=jl(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&Il(p,!0);let g=kl(p[p.length-1].value),_=jl(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&Il(p,!1),h.outside&&d!==`
|
|
25
|
+
`&&d!==`\r`&&Il(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function Gl(e,t,n){let r=new Map;Ul(e,r,t,n);let i=(r.size>0?Hl(e,r,t,n):void 0)||Hl(e,new Map,t,n)||Wl(e,new Map,t,n),a=``;for(let e of i)a+=e.value;return a}Kl.attention=ql,Kl.peek=Jl;function Kl(e,t,n,r){let i=n.enter(`phrasing`),a=Vl(e,ql,n,n.createTracker(r)),o=a?Gl([a],r.before,r.after):``;return i(),o}function ql(e,t){return{construct:`emphasis`,markers:Dl(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Jl(e,t,n){return n.options.emphasis||`*`}function Yl(e,t){let n=!1;return gs(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&gr(e)&&(t.options.setext||n))}function Xl(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Yl(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
26
|
+
`,after:`
|
|
27
|
+
`});return r(),t(),o+`
|
|
28
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
29
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
30
|
+
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Al(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Zl.peek=Ql;function Zl(e){return e.value||``}function Ql(){return`<`}$l.peek=eu;function $l(e,t,n,r){let i=Tl(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/^<|[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function eu(){return`!`}tu.peek=nu;function tu(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function nu(){return`!`}ru.peek=iu;function ru(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function iu(){return"`"}function au(e,t){let n=gr(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}ou.peek=su;function ou(e,t,n,r){let i=Tl(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(au(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,{before:l,after:`](`,...o.current()});l+=o.move(u),c(),l+=o.move(`](`);let d=/^<|[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
|
|
31
|
+
`||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function su(e,t,n){return au(e,n)?`<`:`[`}cu.peek=lu;function cu(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function lu(){return`[`}function uu(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function du(e){let t=uu(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function fu(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function pu(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function mu(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?fu(n):uu(n),s=e.ordered?o===`.`?`)`:`.`:du(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),pu(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function hu(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function gu(e,t,n,r){let i=hu(n),a=n.bulletCurrent||uu(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function _u(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function vu(e,t,n,r){if(!e.children.some(function(e){return ml(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function yu(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}bu.attention=xu,bu.peek=Su;function bu(e,t,n,r){let i=n.enter(`phrasing`),a=Vl(e,xu,n,n.createTracker(r)),o=a?Gl([a],r.before,r.after):``;return i(),o}function xu(e,t){return{construct:`strong`,markers:yu(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function Su(e,t,n){return n.options.strong||`*`}function Cu(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function wu(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Tu(e,t,n){let r=(pu(n)+(n.options.ruleSpaces?` `:``)).repeat(wu(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Eu={blockquote:hl,break:yl,code:Cl,definition:El,emphasis:Kl,hardBreak:yl,heading:Xl,html:Zl,image:$l,imageReference:tu,inlineCode:ru,link:ou,linkReference:cu,list:mu,listItem:gu,paragraph:_u,root:vu,strong:bu,text:Cu,thematicBreak:Tu};function Du(){return{enter:{table:Ou,tableData:Mu,tableHeader:Mu,tableRow:Au},exit:{codeText:Nu,table:ku,tableData:ju,tableHeader:ju,tableRow:ju}}}function Ou(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function ku(e){this.exit(e),this.data.inTable=void 0}function Au(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function ju(e){this.exit(e)}function Mu(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function Nu(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Pu));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Pu(e,t){return t===`|`?t:e}function Fu(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[Iu],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
32
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
33
|
+
`))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return dl(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=Eu.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function Iu(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&Lu(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function Lu(e,t){let n=!1;return gs(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&gr(e)&&(t.options.setext||n))}function Ru(){return{exit:{taskListCheckValueChecked:Bu,taskListCheckValueUnchecked:Bu,paragraph:Vu}}}function zu(){return{handlers:{paragraph:Hu},join:[Uu]}}function Bu(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Vu(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function Hu(e,t,n,r){if(!t||t.type!==`listItem`||Wu(t)!==e)return Eu.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+Eu.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function Uu(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=Wu(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function Wu(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function Gu(){return[Ec(),Qc(),rl(),Du(),Ru()]}function Ku(e){return{extensions:[Dc(),$c(e),il(),Fu(e),zu()]}}var qu={tokenize:od,partial:!0},Ju={tokenize:sd,partial:!0},Yu={tokenize:cd,partial:!0},Xu={tokenize:ld,partial:!0},Zu={tokenize:ud,partial:!0},Qu={name:`wwwAutolink`,tokenize:id,previous:dd},$u={name:`protocolAutolink`,tokenize:ad,previous:fd},ed={name:`emailAutolink`,tokenize:rd,previous:pd},Q={};function td(){return{text:Q}}for(var nd=48;nd<123;)Q[nd]=ed,nd++,nd===58?nd=65:nd===91&&(nd=97);Q[43]=ed,Q[45]=ed,Q[46]=ed,Q[95]=ed,Q[72]=[ed,$u],Q[104]=[ed,$u],Q[87]=[ed,Qu],Q[119]=[ed,Qu];function rd(e,t,n){let r=this,i,a;return o;function o(t){return!md(t)||!pd.call(r,r.previous)||hd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return md(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Zu,u,l)(t):t===45||t===95||G(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&W(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function id(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!dd.call(r,r.previous)||hd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(qu,e.attempt(Ju,e.attempt(Yu,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function ad(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&fd.call(r,r.previous)&&!hd(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(W(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Or(t)||q(t)||Nr(t)||Mr(t)?n(t):e.attempt(Ju,e.attempt(Yu,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function od(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function sd(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Xu,c,s)(t):t===null||q(t)||Nr(t)||t!==45&&Mr(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function cd(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Xu,t,a)(o):o===null||q(o)||Nr(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function ld(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||q(o)||Nr(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||q(e)||Nr(e)?t(e):r(e)}function a(e){return W(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):W(t)?(e.consume(t),o):n(t)}}function ud(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return G(e)?n(e):t(e)}}function dd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||q(e)}function fd(e){return!W(e)}function pd(e){return!(e===47||md(e))}function md(e){return e===43||e===45||e===46||e===95||G(e)}function hd(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var gd={tokenize:wd,partial:!0};function _d(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:xd,continuation:{tokenize:Sd},exit:Cd}},text:{91:{name:`gfmFootnoteCall`,tokenize:bd},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:vd,resolveTo:yd}}}}function vd(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function yd(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function bd(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function xd(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Sd(e,t,n){return e.check($r,t,e.attempt(gd,t,n))}function Cd(e){e.exit(`gfmFootnoteDefinition`)}function wd(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Td(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&V(o,o.length,0,Kr(s,e.slice(r+1,n),t)),V(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),V(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Gr(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Gr(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Ed=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Dd(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Dd(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function Od(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function kd(){return{flow:{null:{name:`table`,tokenize:Ad,resolveAll:jd}}}}function Ad(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function jd(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Ed;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Nd(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Md(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Md(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Md(f,t,o,i,n,d)):(o[0]=o[1],d=Md(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Nd(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Od(t.events,n))}return e}function Md(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Pd(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Pd(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Pd(t.events,n[2]),a=Pd(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Pd(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Nd(e,t,n,r,i){let a=[],o=Pd(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Pd(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Fd={name:`tasklistCheck`,tokenize:Ld};function Id(){return{text:{91:Fd}}}function Ld(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:Rd},t,n)(r):n(r)}}function Rd(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function zd(e){return Cr([td(),_d(),Td(e),kd(),Id()])}var Bd={};function Vd(e){let t=this,n=e||Bd,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(zd(n)),a.push(Gu()),o.push(Ku(n))}var Hd=/<!--[\s\S]*?-->/g;function Ud(e){return e.replace(Hd,``)}function Wd(){let e=t=>{t.children!==void 0&&(t.children=t.children.filter(e=>{if(e.type!==`html`)return!0;let t=Ud(e.value??``);return t.trim().length!==0&&(e.type=`text`,e.value=t,!0)}));for(let n of t.children??[])e(n)};return e}var Gd=[Vd,Wd],Kd=`dataAzdBlockIndex`;function qd(e){let t=e.properties?.className,n=(Array.isArray(t)?t:[]).find(e=>typeof e==`string`&&e.startsWith(`language-`));return n===void 0?``:n.slice(9).toLowerCase()}function Jd(){return e=>{let t=new Map,n=e=>{if(e.type===`element`&&e.tagName===`pre`){let n=e.children?.find(e=>e.tagName===`code`);if(n!==void 0){let e=qd(n),r=t.get(e)??0;t.set(e,r+1),n.properties={...n.properties,[Kd]:r}}}for(let t of e.children??[])n(t)};n(e)}}var Yd=[Jd];function Xd(e){return e.type===`text`?e.value??``:(e.children??[]).map(Xd).join(``)}function Zd({src:e,alt:t}){let n=j(),r=t!==void 0&&t.length>0?n.common.markdown.namedImage(t):n.common.markdown.image;return typeof e==`string`&&e.length>0?(0,I.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`text-accent underline-offset-2 hover:underline`,children:r}):(0,I.jsx)(`span`,{children:r})}function Qd({children:e}){return(0,I.jsx)(`pre`,{className:`my-1.5 overflow-x-auto rounded border border-border bg-raised p-2 font-mono text-xs`,children:e})}var $d={a:({href:e,children:t})=>e===void 0||e.length===0?(0,I.jsx)(`span`,{children:t}):(0,I.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`text-accent underline-offset-2 hover:underline`,children:t}),img:({src:e,alt:t})=>(0,I.jsx)(Zd,{src:e,alt:t}),pre:({children:e})=>(0,I.jsx)(Qd,{children:e}),code:({children:e,className:t})=>(0,I.jsx)(`code`,{className:t===void 0?`rounded bg-raised px-1 py-px font-mono text-[0.92em]`:`${t} font-mono`,children:e}),table:({children:e})=>(0,I.jsx)(`div`,{className:`my-1.5 overflow-x-auto`,children:(0,I.jsx)(`table`,{className:`border-collapse text-xs [&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-0.5 [&_th]:border [&_th]:border-border [&_th]:px-2 [&_th]:py-0.5`,children:e})})};function ef(e){let t=vc(e);return/^(https?:|mailto:|#)/i.test(t)?t:``}function tf(e){return{...$d,pre:({node:t,children:n})=>{let r=t?.children?.find(e=>e.tagName===`code`);if(r!==void 0){let t=e({language:qd(r),text:Xd(r),index:Number(r.properties?.[Kd]??0)});if(t!==null)return(0,I.jsx)(I.Fragment,{children:t})}return(0,I.jsx)(Qd,{children:n})}}}var nf=(0,F.memo)(function({source:e,codeBlock:t}){let n=(0,F.useMemo)(()=>t===void 0?$d:tf(t),[t]);return(0,I.jsx)(`div`,{className:`azd-markdown min-w-0 break-words text-[13px] leading-relaxed text-fg`,children:(0,I.jsx)(mc,{remarkPlugins:Gd,rehypePlugins:Yd,components:n,urlTransform:ef,children:e})})}),rf={bold:`**`,italic:`_`,strikethrough:`~~`,code:"`"},af={heading:`### `,quote:`> `,"bulleted-list":`- `,"task-list":`- [ ] `},of=/^(\s*)(?:[-*+] \[[ xX]\] |[-*+] |\d+[.)] )/;function sf(e,t){if(typeof t==`object`)return xf(e,t.lines);switch(t){case`bold`:case`italic`:case`strikethrough`:case`code`:return lf(e,rf[t]);case`link`:return ff(e);case`code-block`:return bf(e);default:return vf(e,t)}}function cf(e){return[Math.min(e.selectionStart,e.selectionEnd),Math.max(e.selectionStart,e.selectionEnd)]}function lf(e,t){let{text:n}=e,[r,i]=cf(e),a=n.slice(r,i),o=t.length;if(n.slice(r-o,r)===t&&n.slice(i,i+o)===t&&(t!==`_`||n.slice(r-2,r)!==`__`))return{text:n.slice(0,r-o)+a+n.slice(i+o),selectionStart:r-o,selectionEnd:i-o};if(a.length>=2*o&&a.startsWith(t)&&a.endsWith(t)){let e=a.slice(o,a.length-o);return{text:n.slice(0,r)+e+n.slice(i),selectionStart:r,selectionEnd:r+e.length}}let s=a.length-a.trimStart().length,c=a.length-a.trimEnd().length;if(a.trim().length===0)return{text:`${n.slice(0,r)}${t}${t}${n.slice(i)}`,selectionStart:r+o,selectionEnd:r+o};let l=r+s,u=i-c,d=n.slice(l,u);return{text:`${n.slice(0,l)}${t}${d}${t}${n.slice(u)}`,selectionStart:l+o,selectionEnd:u+o}}var uf=/^https?:\/\/\S+$/i;function df(e){return uf.test(e.trim())}function ff(e){let{text:t}=e,[n,r]=cf(e),i=t.slice(n,r);if(df(i)){let e=`[](${i.trim()})`;return{text:t.slice(0,n)+e+t.slice(r),selectionStart:n+1,selectionEnd:n+1}}let a=`[${i}](url)`,o=n+i.length+3;return{text:t.slice(0,n)+a+t.slice(r),selectionStart:o,selectionEnd:o+3}}function pf(e,t){let[n,r]=cf(e),i=e.text.slice(n,r);if(n===r||!df(t)||df(i)||i.includes(`
|
|
34
|
+
`))return null;let a=`[${i}](${t.trim()})`,o=n+a.length;return{text:e.text.slice(0,n)+a+e.text.slice(r),selectionStart:o,selectionEnd:o}}function mf(e,t,n){let r=e.lastIndexOf(`
|
|
35
|
+
`,t-1)+1,i=n>t&&e[n-1]===`
|
|
36
|
+
`?n-1:n,a=e.indexOf(`
|
|
37
|
+
`,i);return[r,a===-1?e.length:a]}function hf(e,t){return e===`numbered-list`?`${t+1}. `:af[e]}function gf(e,t){return t===`numbered-list`?/^\s*\d+[.)] /.test(e):t===`bulleted-list`?/^\s*[-*+] (?!\[[ xX]\] )/.test(e):t===`task-list`?/^\s*[-*+] \[[ xX]\] /.test(e):t===`heading`?/^#{1,6} /.test(e):e.startsWith(`>`)}function _f(e,t){return t===`heading`?e.replace(/^#{1,6} /,``):t===`quote`?e.replace(/^> ?/,``):e.replace(of,`$1`)}function vf(e,t){let{text:n}=e,[r,i]=cf(e),[a,o]=mf(n,r,i),s=n.slice(a,o).split(`
|
|
38
|
+
`),c=s.map(e=>s.length===1||t===`quote`||e.trim().length>0),l=s.every((e,n)=>!c[n]||gf(e,t)),u=0,d=s.map((e,n)=>{if(!c[n])return e;if(l)return _f(e,t);let r=t===`bulleted-list`||t===`numbered-list`||t===`task-list`,i=r?e.replace(of,`$1`):e,a=r?/^\s*/.exec(i)?.[0]??``:``;return`${a}${hf(t,u++)}${i.slice(a.length)}`}).join(`
|
|
39
|
+
`),f=n.slice(0,a)+d+n.slice(o);if(r===i&&s.length===1){let e=d.length-(o-a),t=Math.max(a,r+e);return{text:f,selectionStart:t,selectionEnd:t}}return{text:f,selectionStart:a,selectionEnd:a+d.length}}function yf(e,t,n,r){let i=t===0||e[t-1]===`
|
|
40
|
+
`?``:`
|
|
41
|
+
`,a=n===e.length||e[n]===`
|
|
42
|
+
`?``:`
|
|
43
|
+
`;return{text:`${e.slice(0,t)}${i}${r}${a}${e.slice(n)}`,offset:t+i.length}}function bf(e){let{text:t}=e,[n,r]=cf(e),i=t.slice(n,r),a=/^```[^\n]*\n([\s\S]*)\n```$/.exec(i);if(a!==null){let e=a[1]??``;return{text:t.slice(0,n)+e+t.slice(r),selectionStart:n,selectionEnd:n+e.length}}let o=i.replace(/\n$/,``),s=yf(t,n,r,`\`\`\`\n${o}\n\`\`\``),c=s.offset+4;return{text:s.text,selectionStart:c,selectionEnd:c+o.length}}function xf(e,t){let[n,r]=cf(e),i=ue(t),a=yf(e.text,n,r,i.text);return{text:a.text,selectionStart:a.offset+i.innerStart,selectionEnd:a.offset+i.innerEnd}}function Sf(e,t){let n=e.slice(0,t).split(`
|
|
44
|
+
`).slice(0,-1),r=null;for(let e of n){let t=/^ {0,3}(`{3,}|~{3,})/.exec(e)?.[1];t!==void 0&&(r===null?r=t:t[0]===r[0]&&t.length>=r.length&&e.trim()===t&&(r=null))}return r!==null}function Cf(e){let{text:t}=e,[n,r]=cf(e);if(n!==r)return null;let i=t.lastIndexOf(`
|
|
45
|
+
`,n-1)+1,a=t.indexOf(`
|
|
46
|
+
`,n),o=a===-1?t.length:a,s=t.slice(i,o);if(Sf(t,i))return null;let c=/^(\s*)([-*+] \[[ xX]\] |[-*+] |(\d+)([.)]) )/.exec(s);if(c===null)return null;let[l,u=``,d=``,f,p]=c;if(n<i+l.length)return null;if(s.slice(l.length).trim().length===0)return{text:t.slice(0,i)+t.slice(o),selectionStart:i,selectionEnd:i};let m=`\n${u}${f===void 0?/\[[ xX]\]/.test(d)?`${d[0]??`-`} [ ] `:d:`${Number(f)+1}${p??`.`} `}`,h=n+m.length;return{text:t.slice(0,n)+m+t.slice(n),selectionStart:h,selectionEnd:h}}function wf(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;let i=0;for(;i<r-n&&e[e.length-1-i]===t[t.length-1-i];)i++;return{start:n,end:e.length-i,insert:t.slice(n,t.length-i)}}var Tf=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform??``);function $({children:e}){return(0,I.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:`size-4 shrink-0`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:e})}var Ef=[[{action:`heading`,shortcut:null,icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M4 3v10M12 3v10M4 8h8`})})},{action:`bold`,shortcut:{key:`b`,shift:!1,label:`B`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{strokeWidth:`1.9`,d:`M5 3h3.75a2.5 2.5 0 0 1 0 5H5zM5 8h4.25a2.5 2.5 0 0 1 0 5H5z`})})},{action:`italic`,shortcut:{key:`i`,shift:!1,label:`I`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M7.5 3H12M4 13h4.5M10 3 6 13`})})},{action:`strikethrough`,shortcut:{key:`x`,shift:!0,label:`Shift+X`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M2.75 8h10.5M11 4.75C10.5 3.75 9.4 3 8 3 6.3 3 5 4 5 5.3c0 .8.4 1.4 1.1 1.8M5 11.25C5.5 12.25 6.6 13 8 13c1.7 0 3-1 3-2.3 0-.5-.15-.95-.45-1.3`})})}],[{action:`quote`,shortcut:{code:`Period`,shift:!0,label:`Shift+.`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M3 3.5v9M6.5 5h6.5M6.5 8h6.5M6.5 11h4`})})},{action:`code`,shortcut:{key:`e`,shift:!1,label:`E`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M5.75 4.5 2.5 8l3.25 3.5M10.25 4.5 13.5 8l-3.25 3.5`})})},{action:`code-block`,shortcut:null,icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`rect`,{x:`2`,y:`2.75`,width:`12`,height:`10.5`,rx:`1.75`}),(0,I.jsx)(`path`,{d:`M6.25 6.25 4.75 8l1.5 1.75M9.75 6.25 11.25 8l-1.5 1.75`})]})},{action:`link`,shortcut:{key:`k`,shift:!1,label:`K`},icon:(0,I.jsx)(C,{className:`size-4`})}],[{action:`bulleted-list`,shortcut:{code:`Digit8`,shift:!0,label:`Shift+8`},icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`path`,{d:`M6.5 4h6.5M6.5 8h6.5M6.5 12h6.5`}),(0,I.jsx)(`path`,{strokeWidth:`2.2`,d:`M3.25 4h.01M3.25 8h.01M3.25 12h.01`})]})},{action:`numbered-list`,shortcut:{code:`Digit7`,shift:!0,label:`Shift+7`},icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`path`,{d:`M7 4h6M7 8h6M7 12h6`}),(0,I.jsx)(`path`,{strokeWidth:`1.25`,d:`M2.75 3.25 3.75 2.75v3M2.5 10.25c.3-.5 1.9-.6 1.6.5L2.5 13h2`})]})},{action:`task-list`,shortcut:null,icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`rect`,{x:`2.25`,y:`2.75`,width:`3.5`,height:`3.5`,rx:`.75`}),(0,I.jsx)(`path`,{d:`M2.5 11.25 3.6 12.4 5.75 10M8 4.5h5M8 11.25h5`})]})}]],Df={action:`suggestion`,shortcut:{key:`g`,shift:!1,label:`G`},icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`path`,{d:`M8 2.75v5M5.5 5.25h5M5.5 11.5h5`}),(0,I.jsx)(`rect`,{x:`2.25`,y:`1.75`,width:`11.5`,height:`12.5`,rx:`2`})]})},Of=[...Ef.flat(),Df],kf=Tf?`⌘`:`Ctrl+`;function Af(e){return Tf?`⌘${e.label.replace(`Shift+`,`⇧`)}`:`${kf}${e.label}`}function jf(e,t){return e.shortcut===null?t:`${t} (${Af(e.shortcut)})`}function Mf(e,t){if(!(Tf?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)||e.altKey)return null;for(let n of Of){let r=n.shortcut;if(r!==null&&r.shift===e.shiftKey&&(n.action!==`suggestion`||t)&&(r.code===void 0?e.key.toLowerCase()===r.key:e.code===r.code))return n.action}return null}var Nf=`inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted transition-colors hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--azd-focus)] disabled:cursor-not-allowed disabled:opacity-50`;function Pf({onAction:e,suggestion:t,disabled:n,label:r}){let i=j().review.toolbar,a=t?[...Ef,[Df]]:Ef,o=a.flat(),[s,c]=(0,F.useState)(0),l=(0,F.useRef)([]),u=e=>{let t=null;e.key===`ArrowRight`?t=(s+1)%o.length:e.key===`ArrowLeft`?t=(s-1+o.length)%o.length:e.key===`Home`?t=0:e.key===`End`&&(t=o.length-1),t!==null&&(e.preventDefault(),c(t),l.current[t]?.focus())},d=0;return(0,I.jsx)(`div`,{role:`toolbar`,"aria-label":r,"aria-orientation":`horizontal`,onKeyDown:u,className:`flex min-w-0 flex-wrap items-center gap-px`,"data-testid":`markdown-toolbar`,children:a.map((t,r)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-px`,children:[r>0&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-4 w-px shrink-0 bg-[var(--azd-border)]`}),t.map(t=>{let r=d++,a=t.action===`suggestion`;return(0,I.jsxs)(`button`,{ref:e=>{l.current[r]=e},type:`button`,tabIndex:r===s?0:-1,"aria-label":i[t.action],title:jf(t,i[t.action]),...t.shortcut?.key===void 0?{}:{"aria-keyshortcuts":`${Tf?`Meta`:`Control`}+${t.shortcut.shift?`Shift+`:``}${t.shortcut.key.toUpperCase()}`},disabled:n,onMouseDown:e=>e.preventDefault(),onFocus:()=>c(r),onClick:()=>e(t.action),className:a?`inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-1.5 text-xs font-medium text-muted transition-colors hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--azd-focus)] disabled:cursor-not-allowed disabled:opacity-50`:Nf,"data-action":t.action,children:[t.icon,a&&(0,I.jsx)(`span`,{className:`hidden @[27rem]:inline`,children:i.suggestion})]},t.action)})]},t[0]?.action??r))})}function Ff({original:e,suggestion:t,where:n,children:r}){let i=j().review.suggestion,a=e===null?t.map(e=>({kind:`added`,text:e})):ge(e,t),o=e!==null&&t.length===0;return(0,I.jsxs)(`figure`,{className:`my-1.5 overflow-hidden rounded-[8px] border border-border bg-canvas`,"data-testid":`suggested-change`,"data-diff":e===null?`false`:`true`,children:[(0,I.jsxs)(`figcaption`,{className:`flex min-w-0 items-center gap-2 border-b border-border bg-header px-2.5 py-1 text-xs`,children:[(0,I.jsx)(`span`,{className:`font-medium text-fg`,children:i.title}),n!=null&&e!==null&&(0,I.jsx)(`span`,{className:`truncate text-muted tabular-nums`,children:n}),o&&(0,I.jsx)(`span`,{className:`text-muted`,children:i.deletesLines}),(0,I.jsx)(`span`,{className:`ml-auto`,children:(0,I.jsx)(If,{text:t.join(`
|
|
47
|
+
`)})})]}),a.length===0?(0,I.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted`,children:i.empty}):(0,I.jsx)(`div`,{className:`overflow-x-auto py-1 font-mono text-xs leading-5 [tab-size:4]`,children:a.map((t,n)=>(0,I.jsxs)(`div`,{className:`flex min-w-max ${e===null?``:t.kind===`removed`?`bg-deleted/12`:`bg-added/12`}`,"data-row":e===null?`text`:t.kind,children:[e!==null&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`w-6 shrink-0 select-none text-center ${t.kind===`removed`?`text-deleted`:`text-added`}`,children:t.kind===`removed`?`−`:`+`}),e!==null&&(0,I.jsx)(`span`,{className:`sr-only`,children:t.kind===`removed`?i.removed:i.added}),(0,I.jsx)(`span`,{className:`whitespace-pre pr-3 text-fg ${e===null?`pl-2.5`:``}`,children:t.text.length===0?` `:t.text})]},n))}),r!=null&&(0,I.jsx)(`div`,{className:`border-t border-border px-2.5 py-1.5`,children:r})]})}function If({text:e}){let t=j().review.suggestion,[n,r]=(0,F.useState)(`idle`),i=(0,F.useRef)(void 0);(0,F.useEffect)(()=>()=>window.clearTimeout(i.current),[]);let a=async()=>{try{await navigator.clipboard.writeText(e),r(`copied`)}catch{r(`failed`)}window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(`idle`),1500)};return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>void a(),className:`inline-flex h-6 items-center gap-1 rounded-md px-1.5 text-xs text-muted hover:bg-hover hover:text-fg`,title:t.copyTitle,children:[n===`copied`?(0,I.jsx)(p,{className:`size-3.5`}):(0,I.jsx)(u,{className:`size-3.5`}),(0,I.jsx)(`span`,{"aria-live":`polite`,children:n===`copied`?t.copied:n===`failed`?t.copyFailed:t.copy})]})}function Lf(e,t){let n=wf(e.value,t.text);if(e.focus(),n.start!==n.end||n.insert.length>0){e.setSelectionRange(n.start,n.end);let r=!1;try{r=n.insert.length>0?document.execCommand(`insertText`,!1,n.insert):document.execCommand(`delete`,!1)}catch{r=!1}r&&e.value===t.text||(e.setRangeText(t.text,0,e.value.length),e.dispatchEvent(new Event(`input`,{bubbles:!0})))}e.setSelectionRange(t.selectionStart,t.selectionEnd)}function Rf(e){return{text:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}}var zf=`inline-flex h-7 items-center rounded-[7px] border border-border bg-raised px-2.5 text-xs font-medium text-fg hover:border-border-strong hover:bg-hover disabled:cursor-not-allowed disabled:opacity-50`,Bf=`inline-flex h-7 items-center rounded-[7px] bg-primary px-2.5 text-xs font-medium text-primary-fg hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,Vf=`h-6 rounded-md px-2 text-xs font-medium text-muted hover:text-fg aria-selected:bg-[var(--azd-selected)] aria-selected:text-fg`,Hf=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform??``);function Uf({drafts:e,draftKey:t,label:n,placeholder:r,initialText:i=``,submitLabel:a,secondary:o,onSubmit:s,onCancel:c,busy:l,problem:u,autoFocus:d,onFocused:f,returnFocus:p,testId:m=`composer`,suggestion:h}){let g=j().review.composer,[_,v]=(0,F.useState)(()=>{let n=e.read(t);return n.length>0?n:i}),[y,b]=(0,F.useState)(`write`),[x,S]=(0,F.useState)(!1),C=(0,F.useRef)(null),w=(0,F.useRef)(null),T=(0,F.useId)();(0,F.useEffect)(()=>{d&&(C.current?.focus(),f?.())},[d,f]),(0,F.useEffect)(()=>{x&&w.current?.focus()},[x]);let E=n=>{v(n),e.write(t,n===i?``:n)},D=_.trim().length===0,O=e=>{l||D||e(_)},k=()=>{e.clear(t),S(!1),c(),p?.()},A=()=>{l||(D||_===i?k():S(!0))},M=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),e.stopPropagation(),x||O(s)):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),x?(S(!1),C.current?.focus()):A())},N=e=>{let t=C.current;t===null||l||(e!==`suggestion`||h!==void 0)&&Lf(t,sf(Rf(t),e===`suggestion`?{kind:`suggestion`,lines:h?.original??[]}:e))},ee=e=>{let t=e.currentTarget,n=Mf(e,h!==void 0);if(n!==null)e.preventDefault(),e.stopPropagation(),N(n);else if(e.key===`Enter`&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.nativeEvent.isComposing){let n=Cf(Rf(t));n!==null&&(e.preventDefault(),Lf(t,n))}},te=e=>{let t=e.clipboardData.getData(`text/plain`),n=pf(Rf(e.currentTarget),t);n!==null&&(e.preventDefault(),Lf(e.currentTarget,n))},P=h?.original??null,ne=(0,F.useCallback)(e=>{if(e.language!==`suggestion`)return null;let t=me(_)[e.index]?.lines??_e(e.text);return(0,I.jsx)(Ff,{original:P,suggestion:t})},[P,_]),re=Hf?`⌘↵`:`Ctrl+Enter`;return(0,I.jsxs)(`div`,{className:`max-w-3xl overflow-hidden rounded-[10px] border border-border bg-surface text-fg shadow-[0_1px_2px_rgb(0_0_0/0.08)] focus-within:border-border-strong`,"data-testid":m,onKeyDown:M,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border px-2 py-1.5`,role:`tablist`,children:[(0,I.jsx)(`button`,{type:`button`,role:`tab`,id:`${T}-write`,"aria-selected":y===`write`,"aria-controls":`${T}-panel`,className:Vf,onClick:()=>{b(`write`),requestAnimationFrame(()=>C.current?.focus())},children:g.write}),(0,I.jsx)(`button`,{type:`button`,role:`tab`,id:`${T}-preview`,"aria-selected":y===`preview`,"aria-controls":`${T}-panel`,className:Vf,onClick:()=>b(`preview`),children:g.preview}),(0,I.jsx)(`span`,{className:`ml-auto truncate pl-2 text-xs text-muted`,children:n})]}),(0,I.jsxs)(`div`,{id:`${T}-panel`,role:`tabpanel`,"aria-labelledby":`${T}-${y}`,className:`px-2 pt-2`,children:[y===`write`&&(0,I.jsx)(`div`,{className:`@container pb-1.5`,children:(0,I.jsx)(Pf,{label:g.formattingFor(n),suggestion:h!==void 0,disabled:l,onAction:N})}),y===`write`?(0,I.jsx)(`textarea`,{ref:C,"data-markdown-editor":``,"aria-label":n,placeholder:r??g.placeholder,value:_,disabled:l,onChange:e=>E(e.currentTarget.value),onKeyDown:ee,onPaste:te,rows:Math.min(12,Math.max(3,_.split(`
|
|
48
|
+
`).length+1)),className:`block w-full resize-y rounded-[7px] border border-border bg-canvas px-2.5 py-2 font-sans text-[13px] leading-relaxed text-fg placeholder:text-muted focus:border-[var(--azd-focus)] focus:outline-none disabled:opacity-60`}):(0,I.jsx)(`div`,{className:`min-h-[4.5rem] rounded-[7px] border border-border bg-canvas px-2.5 py-2 text-[13px]`,children:D?(0,I.jsx)(`p`,{className:`text-xs text-muted`,children:g.nothingToPreview}):(0,I.jsx)(nf,{source:_,codeBlock:ne})})]}),u!=null&&(0,I.jsx)(`div`,{className:`px-2 pt-2`,children:u}),(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 px-2 py-2`,children:x?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-xs text-fg`,role:`alert`,children:g.discardQuestion}),(0,I.jsx)(`button`,{type:`button`,className:zf,onClick:k,children:g.discard}),(0,I.jsx)(`button`,{ref:w,type:`button`,className:zf,onClick:()=>{S(!1),C.current?.focus()},children:g.keepEditing})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:l?g.sending:g.hint(re)}),(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,className:zf,onClick:A,disabled:l,children:g.cancel}),o!==void 0&&(0,I.jsx)(`button`,{type:`button`,className:zf,onClick:()=>O(o.onSubmit),disabled:l||D,children:o.label}),(0,I.jsx)(`button`,{type:`button`,className:Bf,onClick:()=>O(s),disabled:l||D,children:a})]})]})})]})}function Wf({review:e,errorKey:t,error:n,organization:r}){h();let i=e.describe(n);return i.kind===`sign-in`?(0,I.jsx)(`div`,{"data-testid":`write-problem`,children:(0,I.jsx)(Pe,{variant:`inline`,error:n,organization:r,onRetry:()=>e.clearError(t)})}):(0,I.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,"data-testid":`write-problem`,children:i.message})}var Gf=/@<([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})>/gi;function Kf(e){return e.replace(/[\\`*_{}[\]()#+\-.!|<>~]/g,e=>`\\${e}`)}function qf(e,t){if(t.length===0||!e.includes(`@<`))return e;let n=new Map(t.map(e=>[e.id.toLowerCase(),e]));return e.replace(Gf,(e,t)=>{let r=n.get(t.toLowerCase());return r===void 0?e:`**@${Kf(r.displayName)}**`})}function Jf({path:e,where:t,branch:n,defaultMessage:r,canResolve:i,busy:a,problem:o,onConfirm:s,onClose:c}){let l=j().review.applyDialog,u=(0,F.useId)(),d=(0,F.useId)(),[f,p]=(0,F.useState)(r),[m,h]=(0,F.useState)(!0),g=f.trim().length===0;return(0,I.jsx)(be,{titleId:u,busy:a,onClose:c,testId:`apply-suggestion-dialog`,children:(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a||g||s({message:f.trim(),resolve:i&&m})},className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:u,className:`text-[16px] font-semibold text-fg-strong`,children:l.title}),(0,I.jsx)(`p`,{className:`mt-1 text-[13px] text-muted`,children:l.intro})]}),(0,I.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1.5 rounded-[8px] bg-raised px-3 py-2 text-[13px]`,children:[(0,I.jsx)(`dt`,{className:`text-muted`,children:l.file}),(0,I.jsx)(`dd`,{className:`truncate font-mono text-xs leading-5 text-fg`,title:e,children:e}),(0,I.jsx)(`dt`,{className:`text-muted`,children:l.lines}),(0,I.jsx)(`dd`,{className:`tabular-nums text-fg`,children:t}),(0,I.jsx)(`dt`,{className:`text-muted`,children:l.branch}),(0,I.jsx)(`dd`,{className:`truncate font-mono text-xs leading-5 text-fg`,title:n,children:n})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`label`,{htmlFor:d,className:`block text-xs font-medium text-muted`,children:l.message}),(0,I.jsx)(`textarea`,{id:d,value:f,disabled:a,onChange:e=>p(e.target.value),rows:4,className:`w-full resize-y rounded-[8px] border border-border bg-canvas px-2.5 py-2 font-mono text-xs text-fg focus:border-[var(--azd-focus)] focus:outline-none disabled:opacity-60`})]}),i&&(0,I.jsxs)(`label`,{className:`flex items-start gap-2.5 text-[13px] text-fg`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:m,disabled:a,onChange:e=>h(e.target.checked),className:`mt-0.5 accent-[var(--azd-accent)]`}),l.resolveThread]}),o,(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:c,disabled:a,className:E,children:l.cancel}),(0,I.jsx)(`button`,{type:`submit`,disabled:a||g,className:re,"data-testid":`apply-suggestion-confirm`,children:a?l.committing:l.confirm})]})]})})}function Yf({thread:e,comment:t,block:n}){let r=j(),i=wt(),a=(0,F.useMemo)(()=>me(t.content),[t.content]),o=a[n.index]?.lines??_e(n.text),s=Ie(e),c=s.kind===`line`&&s.side===`additions`?s:null,l=i===null||c===null?null:i.newSideLines(c.path,c.startLineNumber,c.lineNumber),u=c===null?null:r.review.suggestion.lines(c.startLineNumber,c.lineNumber),d=i?.viewerIsAuthor===!0&&c!==null&&n.index===0&&!rt(e.id)&&!rt(t.id);return(0,I.jsx)(Ff,{original:l,suggestion:o,where:u,children:d&&i!==null&&c!==null?(0,I.jsx)(Xf,{environment:i,thread:e,comment:t,blockCount:a.length,path:c.path,startLine:c.startLineNumber,endLine:c.lineNumber,original:l,suggestion:o}):null})}function Xf({environment:e,thread:t,comment:n,blockCount:r,path:i,startLine:a,endLine:o,original:s,suggestion:c}){let l=j().review.suggestion,u=`${t.id}:${n.id}`,d=Dt(e,u),[f,p]=(0,F.useState)(!1),m=(0,F.useRef)(null);if(d?.phase===`done`)return(0,I.jsx)(`p`,{className:`text-xs text-fg`,role:`status`,"data-testid":`suggestion-applied`,children:l.committed((0,I.jsx)(`span`,{className:`font-mono`,children:e.branch}),(0,I.jsx)(`a`,{href:d.url,target:`_blank`,rel:`noreferrer noopener`,className:`font-mono text-accent underline-offset-2 hover:underline`,children:d.commitId.slice(0,8)}))});if(r>1)return(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 text-xs text-muted`,children:[l.manyBlocks(r),(0,I.jsxs)(`a`,{href:e.pullRequestUrl,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 font-medium text-accent underline-offset-2 hover:underline`,children:[l.applyInAzure,(0,I.jsx)(S,{className:`size-3`})]})]});let h=e.blocked===null?s===null?l.notLoaded:null:Mt(e.blocked);if(h!==null||s===null)return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted`,children:[(0,I.jsx)(`button`,{type:`button`,className:ne,disabled:!0,children:l.apply}),(0,I.jsx)(`span`,{"data-testid":`apply-blocked`,children:h})]});let g=d?.phase===`busy`,_=()=>{p(!1),e.clear(u),requestAnimationFrame(()=>m.current?.focus())},v=d?.phase===`error`?e.explain(d.problem,d.pushed):null,y=v===null?null:v.signIn===null?(0,I.jsx)(`p`,{role:`alert`,className:`text-[13px] text-danger`,"data-testid":`apply-problem`,children:v.message}):(0,I.jsx)(Pe,{variant:`inline`,error:v.signIn,organization:e.organization,onRetry:()=>e.clear(u)});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{ref:m,type:`button`,className:ne,onClick:()=>p(!0),"data-testid":`apply-suggestion`,children:l.apply}),f&&(0,I.jsx)(Jf,{path:i,where:l.lines(a,o),branch:e.branch,defaultMessage:we({reviewer:n.author.displayName,pullRequestId:e.pullRequestId,threadId:t.id}),canResolve:!ze(t.status),busy:g,problem:y,onConfirm:({message:n,resolve:r})=>e.apply({key:u,thread:t,path:i,startLine:a,endLine:o,original:s,suggestion:c,message:n,resolve:r}),onClose:_})]})}var Zf={active:`text-accent`,pending:`text-accent`},Qf=[`active`,`pending`,`fixed`,`wontFix`,`closed`],$f=`rounded-md px-1.5 py-0.5 text-xs text-muted hover:bg-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`;function ep({thread:e}){let t=j().review.thread.statuses;if(e.status===null)return null;let n=ze(e.status);return(0,I.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-raised px-2 text-xs leading-5 shadow-[0_0_0_1px_var(--azd-border)] ${Zf[e.status]??`text-muted`}`,"data-testid":`thread-status`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:n?`✓`:`●`}),t[e.status]]})}function tp({thread:e,label:t}){let n=j().review.thread,r=_t(),i=Le(e),[a,o]=(0,F.useState)(()=>!ze(e.status)),s=i[0];if(s===void 0)return null;let l=i.slice(1),u=rt(e.id);return(0,I.jsxs)(`article`,{className:`max-w-3xl overflow-hidden rounded-[10px] border border-border bg-surface text-[13px] text-fg`,"data-testid":`thread`,"data-thread-id":u?void 0:e.id,"data-sending":u?`true`:void 0,"aria-label":t??n.threadBy(s.author.displayName),"aria-busy":u,children:[(0,I.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 px-3 py-2`,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-muted`,children:a?(0,I.jsx)(_,{className:`size-3.5`}):(0,I.jsx)(c,{className:`size-3.5`})}),(0,I.jsx)(`span`,{className:`sr-only`,children:a?n.collapse:n.expand}),(0,I.jsx)(ee,{name:s.author.displayName,size:`sm`}),(0,I.jsx)(`span`,{className:`shrink-0 font-medium`,children:s.author.displayName}),(0,I.jsx)(`time`,{className:`shrink-0 text-xs text-muted`,dateTime:s.publishedDate??void 0,title:Ne(s.publishedDate),children:Me(s.publishedDate)}),!a&&(0,I.jsxs)(`span`,{className:`min-w-0 truncate text-muted`,children:[up(qf(s.content,e.identities)),l.length>0?` · ${n.replyCount(l.length)}`:``]})]}),u?(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:n.sending}):(0,I.jsx)(ep,{thread:e})]}),a&&(0,I.jsxs)(`div`,{className:`border-t border-border px-3 pt-2.5 pb-3`,children:[(0,I.jsx)(rp,{thread:e,comment:s,review:r}),l.length>0&&(0,I.jsx)(`ol`,{className:`mt-3 space-y-3 border-l-2 border-border pl-3`,children:l.map(t=>(0,I.jsxs)(`li`,{children:[(0,I.jsx)(np,{comment:t,thread:e,review:r}),(0,I.jsx)(rp,{thread:e,comment:t,review:r})]},t.id))}),r!==null&&!u&&(0,I.jsx)(op,{thread:e,review:r})]})]})}function np({comment:e,thread:t,review:n}){let r=j().review.thread;return(0,I.jsxs)(`p`,{className:`mb-1 flex items-center gap-2`,children:[(0,I.jsx)(ee,{name:e.author.displayName,size:`sm`}),(0,I.jsx)(`span`,{className:`font-medium`,children:e.author.displayName}),(0,I.jsx)(`time`,{className:`text-xs text-muted`,dateTime:e.publishedDate??void 0,title:Ne(e.publishedDate),children:Me(e.publishedDate)}),rt(e.id)&&(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:r.sending}),n!==null&&(0,I.jsx)(ap,{thread:t,comment:e,review:n})]})}function rp({thread:e,comment:t,review:n}){let r=L(e.id,t.id),i=B(n?.store??cp,e=>n!==null&&e.editing.has(r)),a=e.comments.find(e=>!e.isDeleted)?.id===t.id,o=(0,F.useCallback)(n=>n.language===`suggestion`?(0,I.jsx)(Yf,{thread:e,comment:t,block:n}):null,[e,t]);return n!==null&&i?(0,I.jsx)(ip,{thread:e,comment:t,review:n}):(0,I.jsxs)(`div`,{className:`group/comment relative`,children:[(0,I.jsx)(nf,{source:qf(t.content,e.identities),codeBlock:o}),a&&n!==null&&(0,I.jsx)(`div`,{className:`mt-0.5 flex justify-end`,children:(0,I.jsx)(ap,{thread:e,comment:t,review:n})})]})}function ip({thread:e,comment:t,review:n}){let r=j().review.thread,i=L(e.id,t.id),a=B(n.store,e=>e.busy.has(i)),o=B(n.store,e=>e.errors.get(i)),s=B(n.store,e=>e.focus===i),c=sp(e);return(0,I.jsx)(`div`,{className:`my-1`,children:(0,I.jsx)(Uf,{suggestion:c,drafts:n.drafts,draftKey:i,label:r.editComment,initialText:t.content,submitLabel:r.save,busy:a,autoFocus:s,onFocused:()=>n.store.update(()=>({focus:null})),onSubmit:r=>n.edit(e,t,r),onCancel:()=>n.setEditing(e.id,t.id,!1),problem:o===void 0?null:(0,I.jsx)(Wf,{review:n,errorKey:i,error:o,organization:n.organization}),testId:`comment-editor`})})}function ap({thread:e,comment:t,review:n}){let r=j().review.thread,[i,a]=(0,F.useState)(!1),o=B(n.store,t=>t.busy.has(R(e.id))),s=(0,F.useRef)(null),c=(0,F.useRef)(null);return(0,F.useEffect)(()=>{i&&c.current?.focus()},[i]),!n.isMine(t)||rt(t.id)||rt(e.id)||t.commentType!==`text`?null:i?(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 text-xs`,children:[(0,I.jsx)(`span`,{role:`alert`,children:r.deleteQuestion}),(0,I.jsx)(`button`,{ref:c,type:`button`,className:`${$f} text-danger`,onClick:()=>{a(!1),n.remove(e,t)},children:r.delete}),(0,I.jsx)(`button`,{type:`button`,className:$f,onClick:()=>{a(!1),requestAnimationFrame(()=>s.current?.focus())},onKeyDown:e=>{e.key===`Escape`&&a(!1)},children:r.cancel})]}):(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,className:$f,disabled:o,"aria-label":r.editComment,onClick:()=>n.setEditing(e.id,t.id,!0),children:r.edit}),(0,I.jsx)(`button`,{ref:s,type:`button`,className:$f,disabled:o,"aria-label":r.deleteComment,onClick:()=>a(!0),children:r.delete})]})}function op({thread:e,review:t}){let n=j().review.thread,r=qe(e.id),i=B(t.store,t=>t.replies.has(e.id)),a=B(t.store,e=>e.busy.has(r)),o=B(t.store,e=>e.errors.get(r)),s=B(t.store,e=>e.focus===r),c=B(t.store,t=>t.busy.has(R(e.id))),l=B(t.store,t=>t.errors.get(R(e.id))),u=(0,F.useRef)(null),d=t.drafts.read(r).length>0,f=ze(e.status),p=e.comments.length>=500,m=i||d&&!a,h=sp(e);return(0,I.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[m?(0,I.jsx)(Uf,{suggestion:h,drafts:t.drafts,draftKey:r,label:n.reply,placeholder:n.replyPlaceholder,submitLabel:n.reply,secondary:f?void 0:{label:n.replyAndResolve,onSubmit:n=>t.reply(e,n,{resolve:!0})},busy:a,autoFocus:s,onFocused:()=>t.store.update(()=>({focus:null})),onSubmit:n=>t.reply(e,n),onCancel:()=>t.setReplyOpen(e.id,!1),returnFocus:()=>requestAnimationFrame(()=>u.current?.focus()),problem:o===void 0?null:(0,I.jsx)(Wf,{review:t,errorKey:r,error:o,organization:t.organization}),testId:`reply-composer`}):null,(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[!m&&(0,I.jsx)(`button`,{ref:u,type:`button`,disabled:p,title:p?n.full:void 0,onClick:()=>t.setReplyOpen(e.id,!0),className:`h-7 min-w-0 flex-1 rounded-[7px] border border-border bg-canvas px-2.5 text-left text-xs text-muted hover:border-border-strong hover:text-fg disabled:opacity-50`,children:n.replyOpener}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2 ${m?`ml-auto`:``}`,children:[(0,I.jsx)(`button`,{type:`button`,className:ne,disabled:c,onClick:()=>t.setStatus(e,f?`active`:`fixed`),children:f?n.reopen:n.resolve}),(0,I.jsx)(`label`,{className:`sr-only`,htmlFor:`status-${e.id}`,children:n.status}),(0,I.jsxs)(`select`,{id:`status-${e.id}`,value:e.status??`unknown`,disabled:c,onChange:n=>t.setStatus(e,n.currentTarget.value),className:`h-6 rounded-md border border-border bg-raised px-1.5 text-xs text-fg hover:border-border-strong disabled:opacity-50`,"data-testid":`status-select`,children:[e.status!==null&&!Qf.includes(e.status)&&(0,I.jsx)(`option`,{value:e.status,disabled:!0,children:n.statuses[e.status]}),Qf.map(e=>(0,I.jsx)(`option`,{value:e,children:n.statuses[e]},e))]})]})]}),l!==void 0&&(0,I.jsx)(Wf,{review:t,errorKey:R(e.id),error:l,organization:t.organization})]})}function sp(e){let t=wt(),n=Ie(e);if(t===null||n.kind!==`line`||n.side!==`additions`)return;let r=t.newSideLines(n.path,n.startLineNumber,n.lineNumber);return r===null?void 0:{original:r}}var cp={get:()=>lp,update:()=>{},subscribe:()=>()=>{}},lp={composers:[],replies:new Set,editing:new Set,busy:new Set,errors:new Map,focus:null};function up(e){return(e.split(`
|
|
49
|
+
`).find(e=>e.trim().length>0)??``).replace(/[`*_#>[\]()!\\]/g,``).trim().slice(0,140)}var dp={get added(){return o().files.change.added},get modified(){return o().files.change.modified},get deleted(){return o().files.change.deleted},get renamed(){return o().files.change.renamed}},fp={added:`text-added`,modified:`text-modified`,deleted:`text-deleted`,renamed:`text-renamed`};function pp({change:e,path:t}){let n=j().files.change[e];return(0,I.jsxs)(`span`,{title:n,"data-testid":`change-marker`,"data-change":e,"data-path":t,className:`inline-flex shrink-0 ${fp[e]}`,children:[(0,I.jsx)(f,{change:e}),(0,I.jsx)(`span`,{className:`sr-only`,children:n})]})}function mp(e){let t=e.lastIndexOf(`/`);return t===-1?{name:e,directory:``}:{name:e.slice(t+1),directory:e.slice(0,t)}}function hp({summary:e,generated:t,collapsed:n,onToggleCollapsed:r,viewed:i,onViewedChange:a,onCommentOnFile:o,webUrl:s,conflict:l}){let d=j().files.header,{file:f}=e,{name:p,directory:m}=mp(f.path),[h,g]=(0,F.useState)(!1),v=()=>{navigator.clipboard.writeText(f.path).then(()=>{g(!0),window.setTimeout(()=>g(!1),1200)},()=>g(!1))},b=[...o===void 0?[]:[{label:d.commentOnFile,icon:(0,I.jsx)(ie,{className:`size-3.5`}),onSelect:o,testId:`comment-on-file`}],{label:d.copyPath,icon:(0,I.jsx)(u,{className:`size-3.5`}),onSelect:v},{label:d.openInAzureDevOps,icon:(0,I.jsx)(S,{className:`size-3.5`}),onSelect:()=>window.open(s,`_blank`,`noopener,noreferrer`)}],x=e.stats;return(0,I.jsxs)(`div`,{className:`azd-file-header flex items-center gap-2 bg-header pr-2 pl-2 font-sans text-[13px] text-fg ${n?``:`shadow-[inset_0_-1px_0_var(--azd-border)]`}`,style:{height:44},"data-testid":`file-header`,"data-path":f.path,children:[(0,I.jsx)(`button`,{type:`button`,onClick:r,"aria-expanded":!n,"aria-label":n?d.expand(f.path):d.collapse(f.path),title:n?d.expandTitle:d.collapseTitle,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-fg`,children:n?(0,I.jsx)(c,{className:`size-3.5`}):(0,I.jsx)(_,{className:`size-3.5`})}),(0,I.jsx)(pp,{change:f.change,path:f.path}),(0,I.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,title:f.path,children:[(0,I.jsx)(`span`,{className:`shrink-0 truncate font-medium text-fg-strong`,children:p}),m.length>0&&(0,I.jsx)(`span`,{className:`min-w-0 truncate text-muted [direction:rtl] [text-align:left]`,children:(0,I.jsx)(`bdi`,{children:m})}),f.change===`renamed`&&f.originalPath!==void 0&&(0,I.jsx)(`span`,{className:`min-w-0 shrink truncate text-xs text-muted`,children:d.renamedFrom((0,I.jsx)(`span`,{className:`font-mono`,children:f.originalPath}))})]}),(0,I.jsx)(`button`,{type:`button`,onClick:v,"aria-label":d.copyPathOf(f.path),title:d.copyPath,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-fg`,children:h?(0,I.jsx)(`span`,{className:`text-[10px] text-fg`,children:`✓`}):(0,I.jsx)(u,{className:`size-3.5`})}),l,t&&(0,I.jsx)(`span`,{className:`shrink-0 rounded-md px-1.5 text-xs leading-5 text-muted shadow-[0_0_0_1px_var(--azd-border)]`,children:d.generated}),(0,I.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-3 pl-2`,children:[e.threadCount>0&&(0,I.jsxs)(`span`,{title:d.threads(e.threadCount),className:`flex items-center gap-1 text-xs tabular-nums text-muted`,children:[(0,I.jsx)(y,{className:`size-3.5`}),e.threadCount,(0,I.jsx)(`span`,{className:`sr-only`,children:d.threadsSr(e.threadCount)})]}),x!==null&&(0,I.jsx)(te,{additions:x.additions,deletions:x.deletions}),a!==void 0&&(0,I.jsxs)(I.Fragment,{children:[(x!==null||e.threadCount>0)&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px bg-border`}),(0,I.jsxs)(`label`,{className:`flex h-7 cursor-pointer items-center gap-2 rounded-md px-1.5 text-[13px] text-muted hover:bg-hover hover:text-fg has-[:checked]:text-fg`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:i===!0,onChange:e=>a(e.currentTarget.checked),"aria-label":d.viewedOf(f.path),className:`size-3.5`}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:d.viewed})]})]}),(0,I.jsx)(A,{label:d.fileActions(f.path),entries:b,trigger:e=>(0,I.jsx)(`button`,{type:`button`,...e,ref:e.ref,"aria-label":d.moreActions(f.path),title:d.moreActionsTitle,className:`inline-flex size-7 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-fg aria-expanded:bg-hover aria-expanded:text-fg`,"data-testid":`file-menu-button`,children:(0,I.jsx)(w,{className:`size-4`})})})]})]})}export{Ve as A,gt as C,Ke as D,B as E,He as M,Be as N,Je as O,wt as S,yt as T,It as _,Uf as a,Ct as b,ln as c,qt as d,Yt as f,Vt as g,Ht as h,Wf as i,ze as j,Ie as k,Zt as l,Wt as m,hp as n,nf as o,Qt as p,tp as r,sn as s,dp as t,Jt as u,Lt as v,_t as w,Nt as x,Ft as y};
|