@petercjl/omni-desktop-app 0.1.6 → 0.1.8
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/app/assets/{CartesianChart-BLyO9U-C.js → CartesianChart-Bwf4u0Tg.js} +4 -4
- package/app/assets/CollaborationWorkspace-Bd6Sjj31.js +57 -0
- package/app/assets/CollaborationWorkspace-D7ttfUjn.css +1 -0
- package/app/assets/EmptyState-CE7obISq.js +1 -0
- package/app/assets/{EvidenceSourceGuide-BqwES_45.js → EvidenceSourceGuide-CwfB7Z6T.js} +1 -1
- package/app/assets/Favorites-4oU1mgEb.js +1 -0
- package/app/assets/{HelpTip-DgowTr-K.js → HelpTip-CX2LFdwD.js} +1 -1
- package/app/assets/{LineChart-BOoSfV72.js → LineChart-B6igYupv.js} +1 -1
- package/app/assets/Opportunities-CogyuZvI.css +1 -0
- package/app/assets/Opportunities-a5IpRN6k.js +1 -0
- package/app/assets/ProgressiveRows-ByxDeTyy.js +1 -0
- package/app/assets/ShopLayoutPage-BlPpfB06.css +1 -0
- package/app/assets/ShopLayoutPage-D7KKJVEq.js +1 -0
- package/app/assets/{TrendChart-ozEGn1ai.js → TrendChart-BdRXaz4z.js} +1 -1
- package/app/assets/api-hjUd9Skg.js +1 -0
- package/app/assets/arrow-down-DSjucZgz.js +1 -0
- package/app/assets/arrow-left-DmIga4jN.js +1 -0
- package/app/assets/arrow-up-right-DzAKT3cL.js +1 -0
- package/app/assets/book-open-C0B9Pao9.js +1 -0
- package/app/assets/chart-no-axes-combined-XDy9u9SV.js +1 -0
- package/app/assets/check-BB89tIU6.js +1 -0
- package/app/assets/chevron-down-BiokgLxD.js +1 -0
- package/app/assets/chevron-right-CZlQQ5gV.js +1 -0
- package/app/assets/clock-3-TH35nOP-.js +1 -0
- package/app/assets/components-C2-vHJtu.js +2 -0
- package/app/assets/{download-DYUXwy45.js → download-BlJN0Lg8.js} +1 -1
- package/app/assets/entry-B_LLuTIf.css +1 -0
- package/app/assets/entry-BryQeuNT.css +1 -0
- package/app/assets/entry-Bxc-KNuY.js +1 -0
- package/app/assets/entry-CYGrMJuR.js +2 -0
- package/app/assets/entry-CdLi3Z9F.js +2 -0
- package/app/assets/entry-DM3aLe2I.js +1 -0
- package/app/assets/entry-OcErMaMp.css +1 -0
- package/app/assets/entry-ZwyGbRek.js +1 -0
- package/app/assets/entry-ffP7X21A.js +2 -0
- package/app/assets/{file-text-BE0hF4rH.js → file-text-Hd45wNTe.js} +1 -1
- package/app/assets/{grid-2x2-lULFcGs7.js → grid-2x2-C0aJVeyS.js} +1 -1
- package/app/assets/index-BguiS02-.js +10 -0
- package/app/assets/index-D1qZkLPg.css +1 -0
- package/app/assets/{layers-shcwXKIH.js → layers-Dj9z2et6.js} +1 -1
- package/app/assets/layout-dashboard-DS537D8b.js +1 -0
- package/app/assets/{link-2-BlbKNthn.js → link-2-CCKUDMV6.js} +1 -1
- package/app/assets/{list-CrDQ8uHL.js → list-LZcXKWKD.js} +1 -1
- package/app/assets/market-DqV9l-vR.css +1 -0
- package/app/assets/market.module-BSrEp5Ak.js +1 -0
- package/app/assets/module-host-C4vqZw2y.js +1 -0
- package/app/assets/orbit-G4ZspWKB.js +1 -0
- package/app/assets/package-BFlv-jYw.js +1 -0
- package/app/assets/play-DxbesM66.js +1 -0
- package/app/assets/plus-QakkcxdA.js +1 -0
- package/app/assets/products-BAKFF--e.js +1 -0
- package/app/assets/project-public-BCoD2Anq.js +1 -0
- package/app/assets/project-public-HdtYycKS.js +4 -0
- package/app/assets/public-JUGpS2z7.js +1 -0
- package/app/assets/{refresh-cw-C_4G0Mri.js → refresh-cw-dsQ_f-9j.js} +1 -1
- package/app/assets/search-Cisx0wBF.js +1 -0
- package/app/assets/triangle-alert-l-Mfj0iE.js +1 -0
- package/app/assets/{create-intent-ZWl5yZd5.css → ui-public-BPe2GJZ-.css} +1 -1
- package/app/assets/ui-public-DWkIf658.js +1 -0
- package/app/assets/{use-favorites-BOjIArhk.js → use-favorites-ALxrDxDW.js} +1 -1
- package/app/assets/workbench-DZTf1DRZ.js +2 -0
- package/app/assets/workbench-Db45mF6t.css +1 -0
- package/app/assets/{workspace-view-state-CRfq5jgZ.js → workspace-view-state-BJMX6vWb.js} +1 -1
- package/app/index.html +2 -2
- package/package.json +1 -1
- package/release.json +1 -1
- package/release.sig +1 -1
- package/app/assets/EmptyState-Cgx7dIy3.js +0 -1
- package/app/assets/Favorites-JpOkiZFS.js +0 -1
- package/app/assets/ShopLayoutPage-BPjWnPjn.css +0 -1
- package/app/assets/ShopLayoutPage-xv0PhUXv.js +0 -1
- package/app/assets/activity-BV0UMcx6.js +0 -1
- package/app/assets/api-DTsZ_OeY.js +0 -1
- package/app/assets/arrow-right-DMEu-HBO.js +0 -1
- package/app/assets/arrow-up-right-Bi_SzYu1.js +0 -1
- package/app/assets/chart-column-x5fvXs9m.js +0 -1
- package/app/assets/check-qCcwSYDE.js +0 -1
- package/app/assets/chevron-down-p3oUrcsv.js +0 -1
- package/app/assets/chevron-right-DqmFJybY.js +0 -1
- package/app/assets/clock-3-BThph9Fd.js +0 -1
- package/app/assets/components-BVWswT0B.js +0 -2
- package/app/assets/create-intent-9uYVhJHt.js +0 -1
- package/app/assets/demand-planning-client-DVOcsKAy.css +0 -1
- package/app/assets/demand-planning-client-cRvN3aET.js +0 -130
- package/app/assets/entry-BXB2Nzyc.js +0 -2
- package/app/assets/entry-BxaHKvMx.js +0 -2
- package/app/assets/entry-C3TFTQrn.js +0 -1
- package/app/assets/entry-C_j4PEhB.css +0 -1
- package/app/assets/entry-Crfux-R-.js +0 -1
- package/app/assets/entry-DHP4cb-p.css +0 -1
- package/app/assets/entry-DQpz8kvM.js +0 -58
- package/app/assets/entry-OPB3MGoc.css +0 -1
- package/app/assets/entry-WYptT5dv.js +0 -2
- package/app/assets/flag-DspBXBR4.js +0 -1
- package/app/assets/git-branch-BAJikW8Q.js +0 -1
- package/app/assets/index-7NKGenq7.css +0 -1
- package/app/assets/index-Cez2mr3h.js +0 -10
- package/app/assets/market-B2oImfqS.css +0 -1
- package/app/assets/market.module-vHIsXpQH.js +0 -1
- package/app/assets/module-host-CyMfvPpR.js +0 -1
- package/app/assets/pin-C4E_u351.js +0 -1
- package/app/assets/play-D07b6r1X.js +0 -1
- package/app/assets/plus-iTTlNMxD.js +0 -1
- package/app/assets/products-fIIO39ry.js +0 -1
- package/app/assets/project-execution-DMEIpSz3.js +0 -1
- package/app/assets/project-public-4Gjaxeyh.js +0 -1
- package/app/assets/project-public-DCJ5Ry0f.js +0 -4
- package/app/assets/project-public-tKjd5rma.js +0 -1
- package/app/assets/public-BlU5YmdO.js +0 -1
- package/app/assets/search-CUzSX_06.js +0 -1
- package/app/assets/ui-public-9lmhhAop.js +0 -1
- package/app/assets/use-workspace-query-C-vrOrvK.js +0 -1
- package/app/assets/workbench-13XxpUuA.css +0 -1
- package/app/assets/workbench-BMO5cSO0.js +0 -2
- /package/app/assets/{graphicalItemSelectors-DGWLDzMl.js → graphicalItemSelectors-Hc730Dd1.js} +0 -0
- /package/app/assets/{group-eZxxe_Hb.js → group-CjIFQYrJ.js} +0 -0
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./project-public-tKjd5rma.js","./index-Cez2mr3h.js","./index-7NKGenq7.css","./demand-planning-client-cRvN3aET.js","./arrow-right-DMEu-HBO.js","./chevron-down-p3oUrcsv.js","./git-branch-BAJikW8Q.js","./project-execution-DMEIpSz3.js","./play-D07b6r1X.js","./workspace-view-state-CRfq5jgZ.js","./EvidenceSourceGuide-BqwES_45.js","./HelpTip-DgowTr-K.js","./HelpTip-BsHPhMNf.css","./demand-planning-client-DVOcsKAy.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./check-qCcwSYDE.js";import{t}from"./chevron-down-p3oUrcsv.js";import{t as n}from"./chevron-right-DqmFJybY.js";import{d as r,i,n as a,t as o}from"./create-intent-9uYVhJHt.js";import{t as s}from"./file-text-BE0hF4rH.js";import{n as c,t as l}from"./pin-C4E_u351.js";import{t as u}from"./list-CrDQ8uHL.js";import{t as d}from"./plus-iTTlNMxD.js";import{t as f}from"./search-CUzSX_06.js";import{a as p,f as m,g as h,h as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w}from"./index-Cez2mr3h.js";import{n as ee}from"./module-host-CyMfvPpR.js";import{n as T}from"./workspace-view-state-CRfq5jgZ.js";import"./public-BlU5YmdO.js";var E=w(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),D=w(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),te=w(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ne=w(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),re=w(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ie=w(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),O=w(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ae=w(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),oe=w(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),se=w(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),ce=w(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),k=h(b(),1),A=p(),le=(0,k.createContext)(null),j=`/api/workbench/collaboration`;async function ue(e,t){let n=await fetch(j+e,{method:t?`POST`:`GET`,headers:t?{"Content-Type":`application/json`}:void 0,body:t?JSON.stringify(t):void 0}),r=await n.json();if(!n.ok)throw Error(typeof r.error==`string`?r.error:r.error?.message||`项目服务暂时不可用`);return r}function de(e){return`${location.origin}${location.pathname}?mode=center&view=projects§ion=all&project=${encodeURIComponent(e)}`}function M({children:e}){let[t,n]=(0,k.useState)(null),[r,i]=(0,k.useState)(``),a=(0,k.useRef)(void 0),o=(0,k.useRef)(Promise.resolve()),s=(0,k.useRef)(!0);(0,k.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]),(0,k.useEffect)(()=>{let e=!0;return ue(`/session`).then(t=>{e&&n(t)}).catch(t=>{e&&i(t.message)}),()=>{e=!1}},[]);let c=(0,k.useCallback)(async(e,n={})=>{let r=o.current.then(async()=>{try{if(!s.current)throw Error(`项目工作区已切换,本次操作已停止`);let r=new URL(e,location.origin),i=r.pathname.replace(/^\/api/,``)+r.search;if(i===`/auth/session`)return Response.json({ok:!0,data:t});if(i===`/state`){let e=await ue(`/state`);return a.current=e.data.revision,Response.json(e)}let o={},c;if(n.body instanceof FormData){c=[];for(let[e,t]of n.body.entries())if(t instanceof File){if(t.size>2*1024*1024)throw Error(`附件最大为 2 MB`);let n=new Uint8Array(await t.arrayBuffer()),r=``;for(let e=0;e<n.length;e+=16384)r+=String.fromCharCode(...n.subarray(e,e+16384));c.push({name:e,file:!0,filename:t.name,type:t.type,base64:btoa(r)})}else c.push({name:e,value:t})}else n.body&&(o=JSON.parse(String(n.body)));let l=new Headers(n.headers),u=await ue(`/command`,{path:i,method:n.method||`GET`,body:o,form:c,clientMemberId:t?.memberId,expectedRevision:a.current,requestId:l.get(`idempotency-key`)||crypto.randomUUID()});return typeof u.revision==`number`&&(a.current=u.revision),Response.json(u)}catch(e){return Response.json({ok:!1,error:{message:e.message,code:`PROJECT_REQUEST_FAILED`}},{status:400})}});return o.current=r.then(()=>void 0,()=>void 0),r},[t]),l=(0,k.useMemo)(()=>({fetch:c,platformIdentity:()=>{if(!t)throw Error(`企业身份尚未就绪`);return t}}),[t,c]);return r?(0,A.jsxs)(`p`,{role:`alert`,children:[r,` `,(0,A.jsx)(`button`,{onClick:()=>location.reload(),children:`重新连接`})]}):t?(0,A.jsx)(le.Provider,{value:l,children:e}):(0,A.jsx)(`p`,{role:`status`,children:`正在确认企业身份…`})}function fe(){let e=(0,k.useContext)(le);if(!e)throw Error(`需要企业项目上下文`);return e}function pe(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var N=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,me=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P={};function he(e,t){return((t||P).jsx?me:N).test(e)}var ge=/[ \t\n\f\r]/g;function _e(e){return typeof e==`object`?e.type===`text`?ve(e.value):!1:ve(e)}function ve(e){return e.replace(ge,``)===``}var ye=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ye.prototype.normal={},ye.prototype.property={},ye.prototype.space=void 0;function be(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ye(n,r,t)}function F(e){return e.toLowerCase()}var I=class{constructor(e,t){this.attribute=t,this.property=e}};I.prototype.attribute=``,I.prototype.booleanish=!1,I.prototype.boolean=!1,I.prototype.commaOrSpaceSeparated=!1,I.prototype.commaSeparated=!1,I.prototype.defined=!1,I.prototype.mustUseProperty=!1,I.prototype.number=!1,I.prototype.overloadedBoolean=!1,I.prototype.property=``,I.prototype.spaceSeparated=!1,I.prototype.space=void 0;var xe=g({boolean:()=>L,booleanish:()=>R,commaOrSpaceSeparated:()=>we,commaSeparated:()=>V,number:()=>z,overloadedBoolean:()=>Ce,spaceSeparated:()=>B}),Se=0,L=H(),R=H(),Ce=H(),z=H(),B=H(),V=H(),we=H();function H(){return 2**++Se}var Te=Object.keys(xe),Ee=class extends I{constructor(e,t,n,r){let i=-1;if(super(e,t),De(this,`space`,r),typeof n==`number`)for(;++i<Te.length;){let e=Te[i];De(this,Te[i],(n&xe[e])===xe[e])}}};Ee.prototype.defined=!0;function De(e,t,n){n&&(e[t]=n)}function Oe(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Ee(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[F(r)]=r,n[F(a.attribute)]=r}return new ye(t,n,e.space)}var ke=Oe({properties:{ariaActiveDescendant:null,ariaAtomic:R,ariaAutoComplete:null,ariaBusy:R,ariaChecked:R,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:B,ariaCurrent:null,ariaDescribedBy:B,ariaDetails:null,ariaDisabled:R,ariaDropEffect:B,ariaErrorMessage:null,ariaExpanded:R,ariaFlowTo:B,ariaGrabbed:R,ariaHasPopup:null,ariaHidden:R,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:B,ariaLevel:z,ariaLive:null,ariaModal:R,ariaMultiLine:R,ariaMultiSelectable:R,ariaOrientation:null,ariaOwns:B,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:R,ariaReadOnly:R,ariaRelevant:null,ariaRequired:R,ariaRoleDescription:B,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:R,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ae(e,t){return t in e?e[t]:t}function je(e,t){return Ae(e,t.toLowerCase())}var Me=Oe({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:V,acceptCharset:B,accessKey:B,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:B,autoFocus:L,autoPlay:L,blocking:B,capture:null,charSet:null,checked:L,cite:null,className:B,closedBy:null,colorSpace:null,cols:z,colSpan:z,command:null,commandFor:null,content:null,contentEditable:R,controls:L,controlsList:B,coords:z|V,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:Ce,draggable:R,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:B,height:z,hidden:Ce,high:z,href:null,hrefLang:null,htmlFor:B,httpEquiv:B,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:B,itemRef:B,itemScope:L,itemType:B,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:L,optimum:z,pattern:null,ping:B,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:B,required:L,reversed:L,rows:z,rowSpan:z,sandbox:B,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:R,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:R,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:B,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:R,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:V,part:B,prefix:null,property:null,results:z,security:null,unselectable:null},space:`html`,transform:je}),Ne=Oe({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:we,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:B,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:V,g2:V,glyphName:V,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:we,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:B,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:we,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:we,rev:we,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:we,requiredFeatures:we,requiredFonts:we,requiredFormats:we,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:we,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:we,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:we,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ae}),U=Oe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Pe=Oe({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:je}),Fe=Oe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ie={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`},Le=/[A-Z]/g,Re=/-[a-z]/g,ze=/^data[-\w.:]+$/i;function Be(e,t){let n=F(t),r=t,i=I;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ze.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Re,He);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Re.test(e)){let n=e.replace(Le,Ve);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ee}return new i(r,t)}function Ve(e){return`-`+e.toLowerCase()}function He(e){return e.charAt(1).toUpperCase()}var Ue=be([ke,Me,U,Pe,Fe],`html`),We=be([ke,Ne,U,Pe,Fe],`svg`);function Ge(e){return e.join(` `).trim()}var Ke=/\/\*(?:[^*]|\*(?!\/))*\*\//g,qe=/\n/g,Je=/^\s*/,Ye=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xe=/^:\s*/,Ze=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,Qe=/^[;\s]*/,$e=`
|
|
3
|
-
`,et=`/`,tt=`*`,nt=``,rt=`comment`,it=`declaration`;function at(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(qe);t&&(n+=t.length);var i=e.lastIndexOf($e);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(Je)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(!(et!=e.charAt(0)||tt!=e.charAt(1))){for(var n=2;nt!=e.charAt(n)&&(tt!=e.charAt(n)||et!=e.charAt(n+1));)++n;if(n+=2,nt===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:rt,comment:o})}}function f(){var e=a(),t=c(Ye);if(t){if(d(),!c(Xe))return s(`property missing ':'`);var n=c(Ze),r=e({type:it,property:t[0].replace(Ke,nt).trim(),value:n?n[0].replace(Ke,nt).trim():nt});return c(Qe),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function ot(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=at(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 st=lt(`end`),ct=lt(`start`);function lt(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 ut(e){let t=ct(e),n=st(e);if(t&&n)return{start:t,end:n}}function dt(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?pt(e.position):`start`in e||`end`in e?pt(e):`line`in e||`column`in e?ft(e):``}function ft(e){return mt(e&&e.line)+`:`+mt(e&&e.column)}function pt(e){return ft(e&&e.start)+`-`+ft(e&&e.end)}function mt(e){return e&&typeof e==`number`?e:1}var ht=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=dt(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(ht.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 gt={}.hasOwnProperty,_t=new Map,vt=/[A-Z]/g,yt=/-([a-z])/g,bt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),xt=new Set([`td`,`th`]),St=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ct(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=Pt(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=Nt(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`?We:Ue,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=wt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function wt(e,t,n){if(t.type===`element`)return Tt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Et(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ot(e,t,n);if(t.type===`mdxjsEsm`)return Dt(e,t);if(t.type===`root`)return kt(e,t,n);if(t.type===`text`)return At(e,t)}function Tt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=We,e.schema=i),e.ancestors.push(t);let a=Bt(e,t.tagName,!1),o=Ft(e,t),s=Lt(e,t);return bt.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!_e(e):!0})),jt(e,o,a,t),Mt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Et(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)}W(e,t.position)}function Dt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);W(e,t.position)}function Ot(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=We,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Bt(e,t.name,!0),o=It(e,t),s=Lt(e,t);return jt(e,o,a,t),Mt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function kt(e,t,n){let r={};return Mt(r,Lt(e,t)),e.create(t,e.Fragment,r,n)}function At(e,t){return t.value}function jt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Mt(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Nt(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 Pt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ct(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 Ft(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&>.call(t.properties,i)){let a=Rt(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&xt.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 It(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 W(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 W(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Lt(e,t){let n=[],r=-1,i=e.passKeys?new Map:_t;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=wt(e,a,o);s!==void 0&&n.push(s)}return n}function Rt(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=Be(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?pe(n):Ge(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:Vt(n):zt(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?Ie[r.property]||r.property:r.attribute,n]}function zt(e,t){let n={};try{ot(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(yt,Wt))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ht("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=St+`#cannot-parse-style-attribute`,r}return n}function Bt(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=he(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=he(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return gt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);W(e)}function W(e,t){let n=new ht("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=St+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Vt(e){let t={},n;for(n in e)gt.call(e,n)&&(t[Ht(n)]=e[n]);return t}function Ht(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(vt,Ut);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ut(e){return`-`+e.toLowerCase()}function Wt(e,t){return t.toUpperCase()}var Gt={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`]},Kt={};function qt(e,t){let n=t||Kt;return Jt(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Jt(e,t,n){if(Xt(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 Yt(e.children,t,n)}return Array.isArray(e)?Yt(e,t,n):``}function Yt(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Jt(e[i],t,n);return r.join(``)}function Xt(e){return!!(e&&typeof e==`object`)}var Zt=document.createElement(`i`);function G(e){let t=`&`+e+`;`;Zt.innerHTML=t;let n=Zt.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function Qt(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 $t(e,t){return e.length>0?(Qt(e,e.length,0,t),e):t}var en={}.hasOwnProperty;function tn(e){let t={},n=-1;for(;++n<e.length;)nn(t,e[n]);return t}function nn(e,t){let n;for(n in t){let r=(en.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){en.call(r,a)||(r[a]=[]);let e=i[a];rn(r[a],Array.isArray(e)?e:e?[e]:[])}}}function rn(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Qt(e,0,0,r)}function an(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 on(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var sn=pn(/[A-Za-z]/),K=pn(/[\dA-Za-z]/),cn=pn(/[#-'*+\--9=?A-Z^-~]/);function ln(e){return e!==null&&(e<32||e===127)}var un=pn(/\d/),dn=pn(/[\dA-Fa-f]/),fn=pn(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function Y(e){return e===-2||e===-1||e===32}var X=pn(/\p{P}|\p{S}/u),Z=pn(/\s/);function pn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function mn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&K(e.charCodeAt(n+1))&&K(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 Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Y(r)?(e.enter(n),s(r)):t(r)}function s(r){return Y(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function hn(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Y(t)?(e.enter(r),c(t)):l(t)}function c(t){return Y(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var gn={tokenize:_n};function _n(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(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);return}return q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var vn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){yn(this,e,t,n,!1)}addBefore(e,t,n){yn(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 yn(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 bn={tokenize:Sn},xn={tokenize:Cn};function Sn(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 vn;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(xn,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(xn,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);return}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);return}return q(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 vn;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 Cn(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function wn(e){if(e===null||J(e)||Z(e))return 1;if(X(e))return 2}function Tn(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 En={name:`attention`,resolveAll:Dn,tokenize:On};function Dn(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};kn(o,-a),kn(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=$t(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=$t(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=$t(r,Tn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=$t(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=$t(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Qt(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 On(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wn(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=wn(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 kn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var An={name:`autolink`,tokenize:jn};function jn(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 sn(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||K(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||K(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||ln(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):cn(t)?(e.consume(t),l):n(t)}function u(e){return K(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||K(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Mn={partial:!0,tokenize:Nn};function Nn(e,t,n){return r;function r(t){return Y(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||q(e)?t(e):n(e)}}var Pn={continuation:{tokenize:In},exit:Ln,name:`blockQuote`,tokenize:Fn};function Fn(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 Y(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function In(e,t,n){let r=this;return i;function i(t){return Y(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Pn,t,n)(r)}}function Ln(e){e.exit(`blockQuote`)}var Rn={name:`characterEscape`,tokenize:zn};function zn(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 fn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Bn={name:`characterReference`,tokenize:Vn};function Vn(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=K,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=dn,u):(e.enter(`characterReferenceValue`),a=7,o=un,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===K&&!G(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 Hn={partial:!0,tokenize:Un};function Un(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 Wn={concrete:!0,name:`codeFenced`,tokenize:Gn};function Gn(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`),Y(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Hn,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||q(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&&Y(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||q(t)?e.check(Hn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||q(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`),Y(t)?Q(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`),Y(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Kn={name:`codeIndented`,tokenize:Jn},qn={partial:!0,tokenize:Yn};function Jn(e,t,n){return r;function r(t){return e.enter(`codeIndented`),hn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):q(t)?e.attempt(qn,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Yn(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):hn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return q(e)?i(e):n(e)}}var Xn={name:`codeText`,previous:Qn,resolve:Zn,tokenize:$n};function Zn(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 Qn(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $n(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)):q(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||q(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 er=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&&tr(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),tr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tr(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);tr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tr(this.left,t.reverse())}}};function tr(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 nr(e){let t={},n=-1,r,i,a,o,s,c,l,u=new er(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,rr(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 Qt(e,0,1/0,u.slice(0)),!l}function rr(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 ir={resolve:or,tokenize:sr},ar={partial:!0,tokenize:cr};function or(e){return nr(e),e}function sr(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):q(t)?e.check(ar,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 cr(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||q(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 lr(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||ln(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||q(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||J(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||ln(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 ur(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):q(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||q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Y(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dr(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):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||q(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 fr(e,t){let n;return r;function r(i){return q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Y(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pr={name:`definition`,tokenize:hr},mr={partial:!0,tokenize:gr};function hr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ur.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=on(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 J(t)?fr(e,l)(t):l(t)}function l(t){return lr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mr,d,d)(t)}function d(t){return Y(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gr(e,t,n){return r;function r(t){return J(t)?fr(e,i)(t):n(t)}function i(t){return dr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Y(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||q(e)?t(e):n(e)}}var _r={name:`hardBreakEscape`,tokenize:vr};function vr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var yr={name:`headingAtx`,resolve:br,tokenize:xr};function br(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`};Qt(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function xr(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||J(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||q(n)?(e.exit(`atxHeading`),t(n)):Y(n)?Q(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||J(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Sr=`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(`.`),Cr=[`pre`,`script`,`style`,`textarea`],wr={concrete:!0,name:`htmlFlow`,resolveTo:Er,tokenize:Dr},Tr={partial:!0,tokenize:Or};function Er(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 Dr(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:se):sn(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):sn(a)?(e.consume(a),i=4,r.interrupt?t:se):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:se):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return sn(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||J(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Cr.includes(l)?(i=1,r.interrupt?t(s):D(s)):Sr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||K(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return Y(t)?(e.consume(t),v):T(t)}function y(t){return t===47?(e.consume(t),T):t===58||t===95||sn(t)?(e.consume(t),b):Y(t)?(e.consume(t),y):T(t)}function b(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Y(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):Y(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,ee):t===null||q(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||J(t)?x(t):(e.consume(t),w)}function ee(e){return e===47||e===62||Y(e)?y(e):n(e)}function T(t){return t===62?(e.consume(t),E):n(t)}function E(t){return t===null||q(t)?D(t):Y(t)?(e.consume(t),E):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),se):t===93&&i===5?(e.consume(t),oe):q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Tr,k,te)(t)):t===null||q(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(Hn,ne,k)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||q(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),se):D(t)}function O(t){return t===47?(e.consume(t),o=``,ae):D(t)}function ae(t){if(t===62){let n=o.toLowerCase();return Cr.includes(n)?(e.consume(t),ce):D(t)}return sn(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):D(t)}function oe(t){return t===93?(e.consume(t),se):D(t)}function se(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),se):D(t)}function ce(t){return t===null||q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),ce)}function k(n){return e.exit(`htmlFlow`),t(n)}}function Or(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Mn,t,n)}}var kr={name:`htmlText`,tokenize:Ar};function Ar(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):sn(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):sn(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):q(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(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):q(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):q(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):q(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return sn(t)?(e.consume(t),S):n(t)}function S(t){return t===45||K(t)?(e.consume(t),S):C(t)}function C(t){return q(t)?(o=C,O(t)):Y(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||K(t)?(e.consume(t),w):t===47||t===62||J(t)?ee(t):n(t)}function ee(t){return t===47?(e.consume(t),ie):t===58||t===95||sn(t)?(e.consume(t),T):q(t)?(o=ee,O(t)):Y(t)?(e.consume(t),ee):ie(t)}function T(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),T):E(t)}function E(t){return t===61?(e.consume(t),D):q(t)?(o=E,O(t)):Y(t)?(e.consume(t),E):ee(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):q(t)?(o=D,O(t)):Y(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):q(t)?(o=te,O(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||J(t)?ee(t):(e.consume(t),ne)}function re(e){return e===47||e===62||J(e)?ee(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return Y(t)?Q(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var jr={name:`labelEnd`,resolveAll:Fr,resolveTo:Ir,tokenize:Lr},Mr={tokenize:Rr},Nr={tokenize:zr},Pr={tokenize:Br};function Fr(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&&Qt(e,0,e.length,n),e}function Ir(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=$t(o,e.slice(i+1,i+r+3)),o=$t(o,[[`enter`,l,t]]),o=$t(o,Tn(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=$t(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=$t(o,e.slice(a+1)),o=$t(o,[[`exit`,s,t]]),Qt(e,i,e.length,o),e}function Lr(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(on(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(Mr,u,o?u:d)(t):t===91?e.attempt(Nr,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Pr,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Rr(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 J(t)?fr(e,a)(t):a(t)}function a(t){return t===41?u(t):lr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return J(t)?fr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?dr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return J(t)?fr(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 zr(e,t,n){let r=this;return i;function i(t){return ur.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(on(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Br(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 Vr={name:`labelStartImage`,resolveAll:jr.resolveAll,tokenize:Hr};function Hr(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 Ur={name:`labelStartLink`,resolveAll:jr.resolveAll,tokenize:Wr};function Wr(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 Gr={name:`lineEnding`,tokenize:Kr};function Kr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var qr={name:`thematicBreak`,tokenize:Jr};function Jr(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||q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Y(t)?Q(e,s,`whitespace`)(t):s(t))}}var Yr={continuation:{tokenize:$r},exit:ti,name:`list`,tokenize:Qr},Xr={partial:!0,tokenize:ni},Zr={partial:!0,tokenize:ei};function Qr(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:un(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(qr,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 un(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(Mn,r.interrupt?n:u,e.attempt(Xr,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Y(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 $r(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Mn,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Y(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(Zr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(Yr,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ei(e,t,n){let r=this;return Q(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 ti(e){e.exit(this.containerState.type)}function ni(e,t,n){let r=this;return Q(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!Y(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ri={name:`setextUnderline`,resolveTo:ii,tokenize:ai};function ii(e,t){let n=new vn,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 ai(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`),Y(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var oi={tokenize:si};function si(e){let t=this,n=e.attempt(Mn,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ir,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ci={resolveAll:fi()},li=di(`string`),ui=di(`text`);function di(e){return{resolveAll:fi(e===`text`?pi: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);return}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 fi(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 pi(e,t){let n=new vn,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 mi=g({attentionMarkers:()=>Si,contentInitial:()=>gi,disable:()=>Ci,document:()=>hi,flow:()=>vi,flowInitial:()=>_i,insideSpan:()=>xi,string:()=>yi,text:()=>bi}),hi={42:Yr,43:Yr,45:Yr,48:Yr,49:Yr,50:Yr,51:Yr,52:Yr,53:Yr,54:Yr,55:Yr,56:Yr,57:Yr,62:Pn},gi={91:pr},_i={[-2]:Kn,[-1]:Kn,32:Kn},vi={35:yr,42:qr,45:[ri,qr],60:wr,61:ri,95:qr,96:Wn,126:Wn},yi={38:Bn,92:Rn},bi={[-5]:Gr,[-4]:Gr,[-3]:Gr,33:Vr,38:Bn,42:En,60:[An,kr],91:Ur,92:[_r,Rn],93:jr,95:En,96:Xn},xi={null:[En,ci]},Si={null:[42,95]},Ci={null:[]};function wi(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=$t(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Tn(a,l.events,l),l.events):[]}function f(e,t){return Ei(p(e),t)}function p(e){return Ti(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,T()}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){q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,T()):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=ee(),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&&Qt(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function ee(){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,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ti(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 Ei(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 Di(e){let t={constructs:tn([mi,...(e||{}).extensions||[]]),content:n(gn),defined:[],document:n(bn),flow:n(oi),lazy:{},string:n(li),text:n(ui)};return t;function n(e){return n;function n(n){return wi(t,e,n)}}}function Oi(e){for(;!nr(e););return e}var ki=/[\0\t\n\r]/g;function Ai(){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;){ki.lastIndex=c;let n=ki.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 ji=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Mi(e){return e.replace(ji,Ni)}function Ni(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return an(n.slice(t?2:1),t?16:10)}return G(n)||e}var Pi={}.hasOwnProperty;function Fi(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Ii(n)(Oi(Di(n).document().write(Ai()(e,t,!0))))}function Ii(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(F),autolinkProtocol:T,autolinkEmail:T,atxHeading:o(_e),blockQuote:o(N),characterEscape:T,characterReference:T,codeFenced:o(me),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(me,s),codeText:o(P,s),codeTextData:T,data:T,codeFlowValue:T,definition:o(he),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(ve),hardBreakTrailing:o(ve),htmlFlow:o(ye,s),htmlFlowData:T,htmlText:o(ye,s),htmlTextData:T,image:o(be),label:s,link:o(F),listItem:o(xe),listItemValue:p,listOrdered:o(I,f),listUnordered:o(I),paragraph:o(Se),reference:le,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(_e),strong:o(L),thematicBreak:o(Ce)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:de,characterReference:M,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:E,codeIndented:l(v),codeText:l(ie),codeTextData:E,data:E,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(te),hardBreakTrailing:l(te),htmlFlow:l(ne),htmlFlowData:E,htmlText:l(re),htmlTextData:E,image:l(ae),label:se,labelText:oe,lineEnding:D,link:l(O),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:j,resourceDestinationString:ce,resourceTitleString:k,resource:A,setextHeading:l(ee),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};Ri(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]),Pi.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]||Bi).call(o,void 0,e[0])}for(r.position={start:Li(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Li(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:Li(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+"` ("+dt({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Bi).call(this,e,r[0])),n.position.end=Li(e.end)}function d(){return qt(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=on(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 ee(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=R(),n.position={start:Li(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Li(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Li(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function te(){this.data.atHardBreak=!0}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){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 ae(){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 oe(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Mi(t),n.identifier=on(t).toLowerCase()}function se(){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 ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function A(){this.data.inReference=void 0}function le(){this.data.referenceType=`collapsed`}function j(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=on(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ue(e){this.data.characterReferenceType=e.type}function de(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=an(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=G(t);let i=this.stack[this.stack.length-1];i.value+=r}function M(e){let t=this.stack.pop();t.position.end=Li(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function N(){return{type:`blockquote`,children:[],position:void 0}}function me(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function P(){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 F(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function I(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Se(){return{type:`paragraph`,children:[],position:void 0}}function L(){return{type:`strong`,children:[],position:void 0}}function R(){return{type:`text`,value:``,position:void 0}}function Ce(){return{type:`thematicBreak`,position:void 0}}}function Li(e){return{line:e.line,column:e.column,offset:e.offset}}function Ri(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Ri(e,r):zi(e,r)}}function zi(e,t){let n;for(n in t)if(Pi.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}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 Bi(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+dt({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+dt({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+dt({start:t.start,end:t.end})+`) is still open`)}function Vi(e){let t=this;t.parser=n;function n(n){return Fi(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Hi(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 Ui(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
6
|
-
`}]}function Wi(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 Gi(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ki(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qi(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=mn(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 Ji(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 Yi(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Xi(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 Zi(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xi(e,t);let i={src:mn(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 Qi(e,t){let n={src:mn(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 $i(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 ea(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xi(e,t);let i={href:mn(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 ta(e,t){let n={href:mn(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 na(e,t,n){let r=e.all(t),i=n?ra(n):ia(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 ra(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let{children:n}=e,r=-1;for(;!t&&++r<n.length;)t=ia(n[r])}return t}function ia(e){let{spread:t}=e;return t??e.children.length>1}function aa(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 oa(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sa(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ca(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function la(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=ct(t.children[1]),o=st(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 ua(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 da(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var fa=9,pa=32;function ma(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(ha(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(ha(t.slice(i),i>0,!1)),a.join(``)}function ha(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===fa||t===pa;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===fa||t===pa;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function ga(e,t){let n={type:`text`,value:ma(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _a(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var va={blockquote:Hi,break:Ui,code:Wi,delete:Gi,emphasis:Ki,footnoteReference:qi,heading:Ji,html:Yi,imageReference:Zi,image:Qi,inlineCode:$i,linkReference:ea,link:ta,listItem:na,list:aa,paragraph:oa,root:sa,strong:ca,table:la,tableCell:da,tableRow:ua,text:ga,thematicBreak:_a,toml:ya,yaml:ya,definition:ya,footnoteDefinition:ya};function ya(){}var{defineProperty:ba}=Object,xa=typeof self==`object`?self:globalThis,Sa=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new xa[e](t)},Ca=(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__`?ba(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 xa[e]==`function`?Sa(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(Sa(a,o),i)};return r},wa=e=>Ca(new Map,e)(0),Ta=``,{toString:Ea}={},{keys:Da,is:Oa}=Object,ka=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Ea.call(e).slice(8,-1);switch(n){case`Array`:return[1,Ta];case`Object`:return[2,Ta];case`Date`:return[3,Ta];case`RegExp`:return[4,Ta];case`Map`:return[5,Ta];case`Set`:return[6,Ta];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Aa=([e,t])=>e===0&&(t===`function`||t===`symbol`),ja=(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]=ka(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Oa(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 Da(o))(e||!Aa(ka(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Ta: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||!(Aa(ka(n))||Aa(ka(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Aa(ka(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Ma=(e,{json:t,lossy:n}={})=>{let r=[];return ja(!(t||n),!!t,new Map,r)(e),r},Na=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?wa(Ma(e,t)):structuredClone(e):(e,t)=>wa(Ma(e,t));function Pa(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 Fa(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Ia(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Pa,r=e.options.footnoteBackLabel||Fa,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=mn(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:{...Na(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 La=(function(e){if(e==null)return Ha;if(typeof e==`function`)return Va(e);if(typeof e==`object`)return Array.isArray(e)?Ra(e):za(e);if(typeof e==`string`)return Ba(e);throw Error(`Expected function, string, or object as test`)});function Ra(e){let t=[],n=-1;for(;++n<e.length;)t[n]=La(e[n]);return Va(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function za(e){let t=e;return Va(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ba(e){return Va(t);function t(t){return t&&t.type===e}}function Va(e){return t;function t(t,n,r){return!!(Ua(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Ha(){return!0}function Ua(e){return typeof e==`object`&&!!e&&`type`in e}function Wa(e){return e}var Ga=[],Ka=`skip`;function qa(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=La(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 (`+Wa(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=Ga;if(s&&r&&(o=Ja(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=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=Ja(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 Ja(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Ga:[e]}function Ya(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`?qa(e,i,Za(a),o):qa(e,i,Xa(a),o)}function Xa(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?Za(e.enter):e.enter,exit:typeof e.exit==`function`?Za(e.exit):e.exit}}function Za(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var Qa={}.hasOwnProperty,$a={};function eo(e,t){let n=t||$a,r=new Map,i=new Map,a={all:s,applyData:no,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...va,...n.handlers},one:o,options:n,patch:to,wrap:io};return Ya(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(Qa.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{...Na(n),children:a.all(e)}}return Na(e)}return(a.options.unknownHandler||ro)(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=ao(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=ao(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function to(e,t){e.position&&(t.position=ut(e))}function no(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,Na(i)),`children`in n&&n.children&&t!=null&&(n.children=t)}return n}function ro(e,t){let n=t.data||{},r=`value`in t&&!(Qa.call(n,`hProperties`)||Qa.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 io(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 ao(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function oo(e,t){let n=eo(e,t),r=n.one(e,void 0),i=Ia(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 so(e,t){return e&&`run`in e?async function(n,r){let i=oo(n,{file:r,...t});await e.run(i,r)}:function(n,r){return oo(n,{file:r,...e||t})}}function co(e){if(e)throw e}var lo=_(((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}}));function uo(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 fo(){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);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?po(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 po(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 mo={basename:ho,dirname:go,extname:_o,join:vo,sep:`/`};function ho(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);xo(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 go(e){if(xo(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 _o(e){xo(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}continue}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 vo(...e){let t=-1,n;for(;++t<e.length;)xo(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:yo(n)}function yo(e){xo(e);let t=e.codePointAt(0)===47,n=bo(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function bo(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 xo(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var So={cwd:Co};function Co(){return`/`}function wo(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function To(e){if(typeof e==`string`)e=new URL(e);else if(!wo(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 Eo(e)}function Eo(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 Do=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Oo=class{constructor(e){let t;t=e?wo(e)?{path:e}:typeof e==`string`||Mo(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:So.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Do.length;){let e=Do[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)Do.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?mo.basename(this.path):void 0}set basename(e){Ao(e,`basename`),ko(e,`basename`),this.path=mo.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?mo.dirname(this.path):void 0}set dirname(e){jo(this.basename,`dirname`),this.path=mo.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?mo.extname(this.path):void 0}set extname(e){if(ko(e,`extname`),jo(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=mo.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){wo(e)&&(e=To(e)),Ao(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?mo.basename(this.path,this.extname):void 0}set stem(e){Ao(e,`stem`),ko(e,`stem`),this.path=mo.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 ht(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 ko(e,t){if(e&&e.includes(mo.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+mo.sep+"`")}function Ao(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function jo(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Mo(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var No=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Po=h(lo(),1),Fo={}.hasOwnProperty,Io=new class e extends No{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=fo()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Po.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(zo(`data`,this.frozen),this.namespace[e]=t,this):Fo.call(this.namespace,e)&&this.namespace[e]||void 0:e?(zo(`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=Ho(e),n=this.parser||this.Parser;return Lo(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Lo(`process`,this.parser||this.Parser),Ro(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Ho(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);Wo(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(),Lo(`processSync`,this.parser||this.Parser),Ro(`processSync`,this.compiler||this.Compiler),this.process(e,r),Vo(`processSync`,`process`,t),n;function r(e,r){t=!0,co(e),n=r}}run(e,t,n){Bo(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=Ho(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),Vo(`runSync`,`run`,n),r;function i(e,t){co(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Ho(t),r=this.compiler||this.Compiler;return Ro(`stringify`,r),Bo(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(zo(`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,Po.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}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];uo(o)&&uo(r)&&(r=(0,Po.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Lo(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Ro(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function zo(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 Bo(e){if(!uo(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Vo(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ho(e){return Uo(e)?e:new Oo(e)}function Uo(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Wo(e){return typeof e==`string`||Go(e)}function Go(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Ko=[],qo={allowDangerousHtml:!0},Jo=/^(https?|ircs?|mailto|xmpp)$/i,Yo=[{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 Xo(e){let t=Zo(e),n=Qo(e);return $o(t.runSync(t.parse(n),n),e)}function Zo(e){let t=e.rehypePlugins||Ko,n=e.remarkPlugins||Ko,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qo}:qo;return Io().use(Vi).use(n).use(so,r).use(t)}function Qo(e){let t=e.children||``,n=new Oo;return typeof t==`string`?n.value=t:``+t,n}function $o(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||es;for(let e of Yo)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Ya(e,l),Ct(e,{Fragment:A.Fragment,components:i,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.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 Gt)if(Object.hasOwn(Gt,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Gt[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 es(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||Jo.test(e.slice(0,t))?e:``}function ts(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ns(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function rs(e,t,n){let r=La((n||{}).ignore||[]),i=is(t),a=-1;for(;++a<i.length;)qa(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 Ka}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)o.lastIndex=n+1;else{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(!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 is(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([as(e[0]),os(e[1])])}return t}function as(e){return typeof e==`string`?new RegExp(ns(e),`g`):e}function os(e){return typeof e==`function`?e:function(){return e}}var ss=`phrasing`,cs=[`autolink`,`link`,`image`,`label`];function ls(){return{transforms:[_s],enter:{literalAutolink:ds,literalAutolinkEmail:fs,literalAutolinkHttp:fs,literalAutolinkWww:fs},exit:{literalAutolink:gs,literalAutolinkEmail:hs,literalAutolinkHttp:ps,literalAutolinkWww:ms}}}function us(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:ss,notInConstruct:cs},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:ss,notInConstruct:cs},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:ss,notInConstruct:cs}]}}function ds(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function fs(e){this.config.enter.autolinkProtocol.call(this,e)}function ps(e){this.config.exit.autolinkProtocol.call(this,e)}function ms(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 hs(e){this.config.exit.autolinkEmail.call(this,e)}function gs(e){this.exit(e)}function _s(e){rs(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,vs],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,xs],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,bs],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,ys]],{ignore:[`link`,`linkReference`]})}function vs(e,t,n,r,i){if(!ws(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),X(n.charCodeAt(0))||!Ss(n))return!1;let o=Cs(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 ys(e,t,n){return/[\d\-_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function bs(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 xs(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 Ss(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 Cs(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=ts(e,`(`),a=ts(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 ws(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||Z(t)||X(t)}Ps.peek=Ns;function Ts(){this.buffer()}function Es(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Ds(){this.buffer()}function Os(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function ks(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=on(this.sliceSerialize(e)).toLowerCase(),n.label=t}function As(e){this.exit(e)}function js(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=on(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ms(e){this.exit(e)}function Ns(){return`[`}function Ps(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 Fs(){return{enter:{gfmFootnoteCallString:Ts,gfmFootnoteCall:Es,gfmFootnoteDefinitionLabelString:Ds,gfmFootnoteDefinition:Os},exit:{gfmFootnoteCallString:ks,gfmFootnoteCall:As,gfmFootnoteDefinitionLabelString:js,gfmFootnoteDefinition:Ms}}}function Is(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ps},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?Rs:Ls))),s(),o}}function Ls(e,t,n){return t===0?e:Rs(e,t,n)}function Rs(e,t,n){return(n?``:` `)+e}var zs=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Ws.attention=Gs,Ws.peek=Ks;function Bs(){return{canContainEols:[`delete`],enter:{strikethrough:Hs},exit:{strikethrough:Us}}}function Vs(){return{handlers:{delete:Ws},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:zs}]}}function Hs(e){this.enter({type:`delete`,children:[],position:void 0},e)}function Us(e){this.exit(e)}function Ws(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 Gs(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function Ks(){return`~`}function qs(e){return e.length}function Js(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||qs,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=Ys(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]=Xs(r[d]);else{let e=Xs(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 Ys(e){return e==null?``:String(e)}function Xs(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 Zs=La([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Qs(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()),$s);return i(),o}function $s(e,t,n){return`>`+(n?``:` `)+e}function ec(e,t){return tc(e,t.inConstruct,!0)&&!tc(e,t.notInConstruct,!1)}function tc(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 nc(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&&ec(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
19
|
-
`}function rc(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 ic(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 ac(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function oc(e,t,n,r){let i=ac(n),a=e.value||``;if(ic(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,sc);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(rc(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 sc(e,t,n){return(n?``:` `)+e}function cc(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function lc(e,t,n,r){let i=cc(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 uc(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function dc(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function fc(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function pc(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function mc(e,t,n){let r=wn(e),i=wn(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 hc(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:sn(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!sn(a))return;for(;a===45||K(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&Cr.includes(o)?1:Sr.includes(o)?6:7}var gc=new Map([[`*`,!1],[`_`,!0]]);function _c(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 vc(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=gc.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=wn(u.charCodeAt(u.length-1)),f=wn((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(xc(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:_c(e,t,a),index:o}}}function yc(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?dc(n.value):fc(n.value),i=pc(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 bc(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=Dc(e,c,r,i),u=vc(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function xc(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 Sc(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(!fn(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 Cc(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?dc(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`&&hc(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(Oc(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=wc(l,f.attention,t,c);if(!e)continue;a.push(e),s=fc(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=fc(n)}}return r.pop(),a}function wc(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=Sc(e.type,a,o),c=s[0],l=n.enter(i),u=n.createTracker(r.current());u.move(c);let d=Cc(e,n,{...u.current(),before:c,after:c});if(l(),d.length!==0)return r.move(c),r.move(Oc(d,c,c)),r.move(c),{children:d,sequences:s}}function Tc(e,t,n,r){let i=Dc(e,t,n,r),a=vc(i,n,r);for(;a;){let o=bc(e,t,a,n,r);if(!o)return;t=o.chosen,i=o.tokens,a=o.mistake}return i}function Ec(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&&gc.has(r)&&t.length>n.length})||o.sequences[0];c!==o.sequences[0]&&t.set(o,c),Ec(o.children,t,c,c),i=c}}function Dc(e,t,n,r){let i=[],a,o=fc(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===dc(n)&&yc([e],!0),a=void 0,i.push(e),e.value&&(o=fc(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=dc(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=Dc(n.children,t,c,c),m=p[0].value,h=mc(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&yc(p,!0);let g=fc(p[p.length-1].value),_=mc(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&yc(p,!1),h.outside&&d!==`
|
|
25
|
-
`&&d!==`\r`&&yc(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 Oc(e,t,n){let r=new Map;Ec(e,r,t,n);let i=(r.size>0?Tc(e,r,t,n):void 0)||Tc(e,new Map,t,n)||Dc(e,new Map,t,n),a=``;for(let e of i)a+=e.value;return a}kc.attention=Ac,kc.peek=jc;function kc(e,t,n,r){let i=n.enter(`phrasing`),a=wc(e,Ac,n,n.createTracker(r)),o=a?Oc([a],r.before,r.after):``;return i(),o}function Ac(e,t){return{construct:`emphasis`,markers:uc(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function jc(e,t,n){return n.options.emphasis||`*`}function Mc(e,t){let n=!1;return Ya(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)&&qt(e)&&(t.options.setext||n))}function Nc(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Mc(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=pc(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Pc.peek=Fc;function Pc(e){return e.value||``}function Fc(){return`<`}Ic.peek=Lc;function Ic(e,t,n,r){let i=cc(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 Lc(){return`!`}Rc.peek=zc;function Rc(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 zc(){return`!`}Bc.peek=Vc;function Bc(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 Vc(){return"`"}function Hc(e,t){let n=qt(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))}Uc.peek=Wc;function Uc(e,t,n,r){let i=cc(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(Hc(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 Wc(e,t,n){return Hc(e,n)?`<`:`[`}Gc.peek=Kc;function Gc(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 Kc(){return`[`}function qc(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 Jc(e){let t=qc(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 Yc(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Xc(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 Zc(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Yc(n):qc(n),s=e.ordered?o===`.`?`)`:`.`:Jc(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),Xc(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 Qc(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 $c(e,t,n,r){let i=Qc(n),a=n.bulletCurrent||qc(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 el(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function tl(e,t,n,r){if(!e.children.some(function(e){return Zs(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function nl(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rl.attention=il,rl.peek=al;function rl(e,t,n,r){let i=n.enter(`phrasing`),a=wc(e,il,n,n.createTracker(r)),o=a?Oc([a],r.before,r.after):``;return i(),o}function il(e,t){return{construct:`strong`,markers:nl(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function al(e,t,n){return n.options.strong||`*`}function ol(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 sl(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 cl(e,t,n){let r=(Xc(n)+(n.options.ruleSpaces?` `:``)).repeat(sl(n));return n.options.ruleSpaces?r.slice(0,-1):r}var ll={blockquote:Qs,break:nc,code:oc,definition:lc,emphasis:kc,hardBreak:nc,heading:Nc,html:Pc,image:Ic,imageReference:Rc,inlineCode:Bc,link:Uc,linkReference:Gc,list:Zc,listItem:$c,paragraph:el,root:tl,strong:rl,text:ol,thematicBreak:cl};function ul(){return{enter:{table:dl,tableData:hl,tableHeader:hl,tableRow:pl},exit:{codeText:gl,table:fl,tableData:ml,tableHeader:ml,tableRow:ml}}}function dl(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 fl(e){this.exit(e),this.data.inTable=void 0}function pl(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function ml(e){this.exit(e)}function hl(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function gl(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_l));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _l(e,t){return t===`|`?t:e}function vl(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[yl],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 Js(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=ll.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 yl(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&bl(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function bl(e,t){let n=!1;return Ya(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)&&qt(e)&&(t.options.setext||n))}function xl(){return{exit:{taskListCheckValueChecked:Cl,taskListCheckValueUnchecked:Cl,paragraph:wl}}}function Sl(){return{handlers:{paragraph:Tl},join:[El]}}function Cl(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function wl(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 Tl(e,t,n,r){if(!t||t.type!==`listItem`||Dl(t)!==e)return ll.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+ll.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function El(e,t,n){if(!(e.type===`definition`&&n.type===`listItem`))return;let r=Dl(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function Dl(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function Ol(){return[ls(),Fs(),Bs(),ul(),xl()]}function kl(e){return{extensions:[us(),Is(e),Vs(),vl(e),Sl()]}}var Al={tokenize:Wl,partial:!0},jl={tokenize:Gl,partial:!0},Ml={tokenize:Kl,partial:!0},Nl={tokenize:ql,partial:!0},Pl={tokenize:Jl,partial:!0},Fl={name:`wwwAutolink`,tokenize:Hl,previous:Yl},Il={name:`protocolAutolink`,tokenize:Ul,previous:Xl},Ll={name:`emailAutolink`,tokenize:Vl,previous:Zl},Rl={};function zl(){return{text:Rl}}for(var Bl=48;Bl<123;)Rl[Bl]=Ll,Bl++,Bl===58?Bl=65:Bl===91&&(Bl=97);Rl[43]=Ll,Rl[45]=Ll,Rl[46]=Ll,Rl[95]=Ll,Rl[72]=[Ll,Il],Rl[104]=[Ll,Il],Rl[87]=[Ll,Fl],Rl[119]=[Ll,Fl];function Vl(e,t,n){let r=this,i,a;return o;function o(t){return!Ql(t)||!Zl.call(r,r.previous)||$l(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Ql(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Pl,u,l)(t):t===45||t===95||K(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&&sn(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Hl(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Yl.call(r,r.previous)||$l(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Al,e.attempt(jl,e.attempt(Ml,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Ul(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Xl.call(r,r.previous)&&!$l(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(sn(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||ln(t)||J(t)||Z(t)||X(t)?n(t):e.attempt(jl,e.attempt(Ml,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Wl(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 Gl(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Nl,c,s)(t):t===null||J(t)||Z(t)||t!==45&&X(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 Kl(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(Nl,t,a)(o):o===null||J(o)||Z(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function ql(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||J(o)||Z(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||J(e)||Z(e)?t(e):r(e)}function a(e){return sn(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):sn(t)?(e.consume(t),o):n(t)}}function Jl(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return K(e)?n(e):t(e)}}function Yl(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||J(e)}function Xl(e){return!sn(e)}function Zl(e){return!(e===47||Ql(e))}function Ql(e){return e===43||e===45||e===46||e===95||K(e)}function $l(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 eu={tokenize:cu,partial:!0};function tu(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:au,continuation:{tokenize:ou},exit:su}},text:{91:{name:`gfmFootnoteCall`,tokenize:iu},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:nu,resolveTo:ru}}}}function nu(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=on(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 ru(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 iu(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||J(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(on(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return J(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 au(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||J(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=on(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return J(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),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function ou(e,t,n){return e.check(Mn,t,e.attempt(eu,t,n))}function su(e){e.exit(`gfmFootnoteDefinition`)}function cu(e,t,n){let r=this;return Q(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 lu(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&&Qt(o,o.length,0,Tn(s,e.slice(r+1,n),t)),Qt(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Qt(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=wn(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=wn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var uu=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){du(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 du(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 fu(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 pu(){return{flow:{null:{name:`table`,tokenize:mu,resolveAll:hu}}}}function mu(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?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Y(t)?Q(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||J(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,Y(t)?Q(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 Y(t)?Q(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||q(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 Y(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||q(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||q(n)?(e.exit(`tableRow`),t(n)):Y(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||J(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?ee:w)}function ee(t){return t===92||t===124?(e.consume(t),w):w(t)}}function hu(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 uu;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(_u(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=gu(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=gu(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=gu(f,t,o,i,n,d)):(o[0]=o[1],d=gu(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&_u(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=fu(t.events,n))}return e}function gu(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},vu(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=vu(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=vu(t.events,n[2]),a=vu(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({},vu(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function _u(e,t,n,r,i){let a=[],o=vu(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 vu(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var yu={name:`tasklistCheck`,tokenize:xu};function bu(){return{text:{91:yu}}}function xu(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 J(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 q(r)?t(r):Y(r)?e.check({tokenize:Su},t,n)(r):n(r)}}function Su(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Cu(e){return tn([zl(),tu(),lu(e),pu(),bu()])}var wu={};function Tu(e){let t=this,n=e||wu,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Cu(n)),a.push(Ol()),o.push(kl(n))}var Eu=m(),Du={workspace:oe,folder:te,folderOpen:c,project:oe,search:f,plus:d,close:y,chevronRight:n,chevronDown:t,panel:S,trash:ce,grid:re,list:u,more:D,document:s,activity:ie,pin:l,edit:r,image:ne,check:e,expand:O,collapse:ae,attachment:se,clock:E};function $({name:e,size:t=`small`,className:n=``}){let r=Du[e];return(0,A.jsx)(r,{className:`icon icon--${t} ${n}`,"aria-hidden":`true`,focusable:`false`})}async function Ou(){return[]}function ku(e,t){let n=(0,k.useRef)(t),r=(0,k.useRef)(null);n.current=t,(0,k.useEffect)(()=>{let e=e=>{e.target instanceof HTMLElement&&!e.target.closest(`[role="dialog"]`)&&(r.current=e.target)};return document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[]),(0,k.useEffect)(()=>{if(!e)return;let t=document.querySelector(`.project-collaboration`);if(!t)return;let i=t.querySelectorAll(`[role="dialog"]`),a=i.item(i.length-1);if(!a)return;let o=r.current,s=t.style.overflow,c=()=>Array.from(a.querySelectorAll(`button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], summary, [tabindex="0"]`)).filter(e=>e.getClientRects().length>0);t.style.overflow=`hidden`,a.contains(document.activeElement)||(a.querySelector(`input:not([type=hidden]), textarea`)||c()[0])?.focus();let l=e=>{let r=t.querySelectorAll(`[role="dialog"]`);if(r.item(r.length-1)!==a||(e.key===`Escape`&&(e.preventDefault(),n.current()),e.key!==`Tab`))return;let i=c(),o=i[0],s=i[i.length-1];if(!o){e.preventDefault();return}!a.contains(document.activeElement)||e.shiftKey&&document.activeElement===o?(e.preventDefault(),(e.shiftKey?s:o).focus()):!e.shiftKey&&document.activeElement===s&&(e.preventDefault(),o.focus())};return document.addEventListener(`keydown`,l),()=>{document.removeEventListener(`keydown`,l),t.style.overflow=s,o?.isConnected&&o.focus()}},[e])}var Au=[{id:`launch`,name:`新品上架`,description:`从市场调研到上架推广`,nodes:[{name:`立项与目标`,description:`明确新品定位、目标人群、预算与上架计划。`},{name:`市场与竞品调研`,description:`分析市场需求、竞品价格和差异化机会。`},{name:`商品与定价`,description:`确认商品卖点、规格、成本与定价策略。`},{name:`内容与视觉`,description:`完成标题、主图、详情页及上架素材。`},{name:`上架准备`,description:`确认库存、物流、商品信息和平台要求。`},{name:`上线推广`,description:`完成商品上架,执行推广并跟踪初期表现。`},{name:`效果复盘`,description:`复盘流量、转化与销售表现,确定后续动作。`}]},{id:`optimize`,name:`老品优化`,description:`从经营诊断到效果复盘`,nodes:[{name:`经营诊断`,description:`分析商品流量、转化、利润和评价,定位主要问题。`},{name:`优化目标`,description:`确定优化指标、优先级、对照基线与周期。`},{name:`优化方案`,description:`制定卖点、视觉、定价与推广的优化方案。`},{name:`实施与测试`,description:`实施方案,记录变更并开展对照测试。`},{name:`效果复盘`,description:`对比优化前后指标,沉淀结论与后续计划。`}]}],ju=[`淘宝`,`京东`,`拼多多`,`抖音`,`小红书`],Mu=[...ju,`亚马逊`];function Nu(e){let t=[[/立项|立项与目标/,`明确项目为什么做、为谁做,以及本轮要达成的经营结果。`,[`整理商品定位与目标人群`,`明确预算、周期与衡量指标`,`确认阶段交付与负责人`]],[/经营诊断|成交链路诊断/,`拆解从流量到成交的链路,找出最需要优先解决的问题。`,[`整理近期流量、转化与销售数据`,`对比历史表现和主要竞品`,`定位瓶颈并形成问题优先级`]],[/内容与转化诊断/,`判断哪些笔记带来有效互动与成交,定位内容断点。`,[`汇总笔记曝光、互动与转化`,`对比选题、封面及评论反馈`,`整理低效内容与改进机会`]],[/选品与人群|人群与选品|用户与关键词|需求人群调研/,`弄清目标用户的需求与购买动机,确定商品切入点。`,[`梳理目标用户与使用场景`,`收集搜索词和用户需求反馈`,`形成商品机会与人群定位`]],[/竞品|需求与竞品|市场与价格|市场.*调研/,`识别市场机会、竞争格局及可进入的价格区间。`,[`筛选代表竞品并对比卖点`,`分析需求趋势与价格分布`,`整理差异化机会及定价建议`]],[/优化目标|确定优化目标|优化方向/,`把经营问题转成可衡量的优化目标与实施优先级。`,[`确认本轮要改善的核心指标`,`记录对照基线和观察周期`,`确定优先级与结果判断标准`]],[/优化方案/,`把诊断结论转为可执行、可对比的商品优化计划。`,[`拆解卖点、页面与推广改进项`,`评估各项投入及预期影响`,`确认执行顺序与验收标准`]],[/商品与定价|商品卖点/,`明确商品价值表达与价格策略,形成统一的销售主张。`,[`提炼用户利益点及证据`,`对照成本、毛利与竞争价格`,`确定规格组合和核心卖点`]],[/库存|履约准备|商品与库存/,`确保商品发布后具备可用库存和可靠履约能力。`,[`核对SKU规格与可售库存`,`确认发货时效及物流方案`,`整理缺货预案和售后说明`]],[/主图|卖点与视觉|商品内容|内容与视觉|商品视觉/,`把商品卖点转成用户易理解的主图与详情页内容。`,[`梳理页面信息顺序与卖点证据`,`制作主图、详情页及规格素材`,`核对图文一致性与上架要求`]],[/卖点与脚本|内容策划|种草选题/,`围绕用户关心的问题策划内容,形成可制作的选题与脚本。`,[`收集高频问题和同类内容`,`确定选题角度与内容结构`,`编写脚本及拍摄素材清单`]],[/短视频|内容素材|笔记素材|选题与素材|素材准备/,`制作能够表达商品价值的内容素材,准备多个可比较版本。`,[`确认脚本、选题及画面素材`,`制作视频或图文及封面版本`,`核对卖点表达与发布规格`]],[/直播/,`优化直播货盘与讲解流程,让商品展示衔接成交。`,[`梳理货盘、价格与讲解顺序`,`准备卖点话术和参考环节`,`确认互动承接与直播执行安排`]],[/流量与投放|搜索推广|推广执行|上线推广|运营推广/,`围绕目标人群配置推广方案,并保留效果对照记录。`,[`选择推广人群、关键词或渠道`,`设置预算、素材与观察指标`,`记录推广表现及调整动作`]],[/测试与放量|内容与投放测试|投放与转化/,`用小规模测试验证素材与转化链路,再判断是否扩大投入。`,[`划分测试素材、人群和预算`,`记录曝光、点击及成交表现`,`筛选有效组合并制定放量方案`]],[/实施与测试|实施与对照/,`分批实施方案并记录变量,判断改善是否来自本轮调整。`,[`记录实施前页面与指标基线`,`按计划上线并记录变更项`,`收集对照结果与异常情况`]],[/上架与活动|活动与推广/,`把商品准备、活动安排与推广执行对齐到同一计划。`,[`整理活动规则与商品利益点`,`确认活动价格、库存及时间`,`准备推广排期和执行检查单`]],[/上架准备|商品发布/,`完成商品信息核对和发布检查,让用户能够顺畅购买。`,[`核对标题、类目、属性与规格`,`确认价格、库存及售后信息`,`发布商品并检查购买链路`]],[/内容发布|发布与互动/,`按节奏发布内容并承接互动,记录用户真实反馈。`,[`确认发布时间与标题封面`,`执行发布并检查展示效果`,`整理评论问题与互动反馈`]],[/互动与转化/,`把内容互动承接到咨询和购买,定位转化过程的阻碍。`,[`整理评论、私信及购买问题`,`检查商品入口与承接页面`,`记录互动及成交线索`]],[/履约跟踪/,`跟踪库存和订单履约,及时处理影响用户体验的异常。`,[`跟进库存变化与发货进度`,`整理物流、退款与售后异常`,`形成履约问题与改进清单`]],[/Listing准备/,`准备目标站点的商品页面和上架资料。`,[`核对类目、规格与商品标识`,`整理英文标题、五点描述和主图`,`核对目标站点的商品资料要求`]],[/Listing优化/,`根据搜索和转化反馈改善商品详情页。`,[`整理搜索词与评价反馈`,`调整标题、五点描述和图片方案`,`记录修改前后的转化表现`]],[/复盘/,`对照项目目标汇总经营结果,明确下一轮继续和调整的动作。`,[`对比目标、基线与实际结果`,`归纳有效动作和未解决问题`,`输出复盘结论及下一轮计划`]]].find(([t])=>t.test(e));return t?{description:t[1],tasks:t[2]}:{description:`整理业务资料并形成可执行的阶段方案。`,tasks:[`梳理相关业务资料`,`制定并执行阶段计划`,`整理结果与后续建议`]}}function Pu(e,t,n,r,i,a,o,s){let c=s||a.map((e,t)=>[t]);return{id:e,platform:t,scene:n,name:r,description:i,audience:n===`新品上市`?`准备上新,希望明确从准备到起量的完整路径`:n===`老品优化`?`已有在售商品,需要定位问题并改善经营表现`:`希望把日常经营任务组织成可跟进的执行流程`,materials:o,outcome:a.length?a[a.length-1][1]:`自定义项目成果`,layers:c,nodes:a.map(([e,t])=>({name:e,...Nu(e),output:t}))}}var Fu={立项与目标:`项目目标与立项清单`,市场与竞品调研:`市场机会与竞品报告`,商品与定价:`商品卖点及定价方案`,内容与视觉:`商品视觉素材包`,上架准备:`商品上架检查单`,上线推广:`推广执行与效果记录`,效果复盘:`经营复盘与后续计划`,经营诊断:`经营问题与优先级清单`,优化目标:`优化指标与对照基线`,优化方案:`商品优化行动方案`,实施与测试:`优化实施与测试记录`},Iu=[...Au.map(e=>Pu(e.id,`通用`,e.id===`launch`?`新品上市`:`老品优化`,e.name,e.description,e.nodes.map(e=>[e.name,Fu[e.name]||`${e.name}交付记录`]),[`商品基本信息`,`已有经营资料`])),Pu(`taobao-launch`,`淘宝`,`新品上市`,`淘宝新品上市与起量`,`从需求验证到商品发布,建立新品的第一轮增长路径。`,[[`选品与人群`,`人群与需求定位`],[`竞品与定价`,`竞品及价格策略`],[`主图与详情页`,`上架视觉素材包`],[`库存与履约准备`,`库存与发货清单`],[`商品发布`,`商品发布检查单`],[`搜索推广`,`首轮推广方案`],[`转化复盘`,`新品经营复盘报告`]],[`商品规格与成本`,`目标类目及竞品`,`现有图片素材`],[[0],[1],[2,3],[4],[5],[6]]),Pu(`taobao-optimize`,`淘宝`,`老品优化`,`淘宝老品转化优化`,`找出商品转化瓶颈,形成可验证的优化方案。`,[[`经营诊断`,`流量转化诊断报告`],[`确定优化目标`,`优化目标与基线`],[`卖点与视觉优化`,`页面优化方案`],[`流量与投放优化`,`推广调整方案`],[`实施与对照`,`优化执行记录`],[`效果复盘`,`转化改善复盘报告`]],[`近30天经营数据`,`商品页面与评价`,`推广数据`],[[0],[1],[2,3],[4],[5]]),Pu(`jd-launch`,`京东`,`新品上市`,`京东新品运营`,`衔接商品内容、库存准备与首轮活动推广。`,[[`需求与竞品`,`新品定位建议`],[`商品与库存`,`商品及库存清单`],[`商品内容`,`商品内容素材包`],[`上架与活动`,`上架活动计划`],[`推广执行`,`推广执行记录`],[`销售复盘`,`新品销售复盘报告`]],[`商品与库存资料`,`类目及竞品信息`]),Pu(`pdd-growth`,`拼多多`,`新品上市`,`拼多多新品增长`,`从价格与卖点切入,完成上架活动及履约跟踪。`,[[`市场与价格`,`价格带与竞品分析`],[`商品卖点`,`商品卖点清单`],[`素材准备`,`商品素材包`],[`活动与推广`,`活动推广计划`],[`履约跟踪`,`履约跟踪记录`],[`经营复盘`,`商品经营复盘`]],[`商品成本与库存`,`竞品及价格资料`]),Pu(`douyin-launch`,`抖音`,`新品上市`,`抖音新品冷启动`,`先验证商品与内容,再衔接直播及投放测试。`,[[`人群与选品`,`新品人群定位`],[`卖点与脚本`,`卖点及脚本方案`],[`短视频素材`,`短视频素材包`],[`直播间准备`,`直播货盘与话术`],[`内容与投放测试`,`冷启动测试记录`],[`成交复盘`,`冷启动复盘报告`]],[`商品信息与毛利`,`现有视频素材`,`目标人群线索`],[[0],[1],[2,3],[4],[5]]),Pu(`douyin-optimize`,`抖音`,`老品优化`,`抖音老品成交提升`,`诊断内容、直播与投放,改善存量商品的成交表现。`,[[`成交链路诊断`,`成交问题清单`],[`优化目标`,`目标与评估基线`],[`内容素材迭代`,`新一轮内容素材`],[`直播转化优化`,`直播间优化方案`],[`测试与放量`,`分组测试记录`],[`经营复盘`,`成交提升复盘`]],[`商品成交数据`,`视频与直播数据`,`投放记录`],[[0],[1],[2,3],[4],[5]]),Pu(`douyin-content`,`抖音`,`内容运营`,`抖音内容带货`,`把选题、制作、直播准备和成交跟踪串成一条工作流。`,[[`人群与选品`,`内容选品方向`],[`内容策划`,`选题与脚本清单`],[`短视频制作`,`短视频成片`],[`直播准备`,`直播执行方案`],[`投放与转化`,`投放转化记录`],[`内容复盘`,`内容效果复盘`]],[`商品信息`,`账号内容与成交记录`]),Pu(`red-launch`,`小红书`,`新品上市`,`小红书新品种草`,`从用户洞察到内容发布,建立新品的种草与转化路径。`,[[`用户与关键词`,`用户与关键词地图`],[`种草选题`,`笔记选题清单`],[`笔记素材`,`笔记图文素材包`],[`内容发布`,`内容发布计划`],[`互动与转化`,`互动与转化记录`],[`种草复盘`,`新品种草复盘`]],[`商品卖点资料`,`目标用户与竞品笔记`]),Pu(`red-optimize`,`小红书`,`老品优化`,`小红书老品种草优化`,`复盘已有内容,迭代选题与素材并跟踪转化。`,[[`内容与转化诊断`,`笔记效果诊断`],[`优化方向`,`内容优化策略`],[`选题与素材迭代`,`新选题与素材包`],[`发布与互动`,`发布执行记录`],[`转化复盘`,`种草优化复盘`]],[`已有笔记及互动数据`,`商品页面与转化线索`]),Pu(`pdd-optimize`,`拼多多`,`老品优化`,`拼多多老品转化优化`,`从商品价格、卖点和活动表现定位转化瓶颈。`,[[`经营诊断`,`转化问题清单`],[`市场与价格`,`价格带对照表`],[`卖点与视觉优化`,`图文优化方案`],[`活动与推广`,`活动测试计划`],[`经营复盘`,`优化效果记录`]],[`商品成本及活动资料`,`近期商品数据`]),Pu(`amazon-launch`,`亚马逊`,`新品上市`,`亚马逊新品上架`,`围绕目标站点准备商品页面、库存及首轮推广。`,[[`需求与竞品`,`站点市场定位`],[`Listing准备`,`商品页面资料包`],[`库存与履约准备`,`首批备货计划`],[`商品发布`,`发布核对单`],[`搜索推广`,`关键词推广计划`],[`销售复盘`,`上架效果复盘`]],[`目标站点与商品规格`,`成本、图片与库存资料`]),Pu(`amazon-optimize`,`亚马逊`,`老品优化`,`亚马逊 Listing 转化优化`,`结合搜索词、评价和流量数据改善商品页面。`,[[`经营诊断`,`流量与转化诊断`],[`Listing优化`,`页面改版方案`],[`实施与对照`,`对照记录`],[`转化复盘`,`优化效果复盘`]],[`现有 Listing`,`搜索词、流量和评价数据`]),{id:`blank`,platform:`通用`,scene:`自定义`,name:`空白 SOP`,description:`不预设节点和任务`,audience:`已有自己的工作方式,希望自行组织项目流程`,materials:[],outcome:`按项目目标自由定义`,nodes:[],layers:[]}];function Lu(e){return[[/竞品|价格分布|价格策略/,`竞品对标与定价分析`],[/人群|用户|需求|搜索词/,`用户需求与人群分析`],[/经营数据|流量|销售数据/,`商品经营诊断`],[/问题|瓶颈/,`经营问题诊断`],[/主图|详情页|视觉|图文|封面/,`商品视觉与页面优化`],[/视频|脚本|选题|拍摄/,`电商内容策划与制作`],[/直播|货盘|讲解|话术/,`直播运营策划`],[/推广|预算|投放|放量/,`电商推广策略`],[/库存|物流|履约|发货|售后/,`商品库存与履约规划`],[/发布|标题|类目|属性/,`商品发布与内容核对`],[/复盘|下一轮|对照|测试|变更/,`经营测试与复盘`],[/目标|指标|优先级/,`经营目标与计划制定`],[/卖点|规格|毛利|成本/,`商品卖点与定价策划`],[/评论|私信|互动|成交/,`内容互动与成交分析`]].find(([t])=>t.test(e))?.[1]||`电商业务分析与交付`}var Ru=[],zu=new Set;for(let e of Iu)e.nodes.forEach((t,n)=>{let r=`${e.platform}:${t.name}`;if(zu.has(r))return;zu.add(r);let i=`demo-node:${e.id}:${n}`;Ru.push({id:i,version:1,name:t.name,platform:e.platform,scene:e.scene,description:t.description,output:t.output,tasks:t.tasks.map((r,a)=>({id:`${i}:task:${a}`,version:1,name:r,platform:e.platform,nodeName:t.name,description:`${r}。${t.description}`,output:t.output,skill:{id:`demo-skill:${e.id}:${n}:${a}`,name:Lu(r),status:`mock`}}))})});var Bu=Ru.flatMap(e=>e.tasks);function Vu({name:e}){return(0,A.jsxs)(`div`,{className:`library-task-skill-label`,children:[(0,A.jsx)(`span`,{children:`使用 Skill`}),(0,A.jsx)(`strong`,{children:e})]})}function Hu({kind:e,project:t,stage:n,members:r,currentMember:i,onClose:a,onCreate:o}){let s=r.filter(e=>e.id!==`agent`),c=i,[l,u]=(0,k.useState)(t.platforms?.length?`项目平台`:`全部`),d=Ru.find(e=>e.id===t.nodeDetails?.[t.nodeIds?.[n||``]]?.templateId)?.name,[f,p]=(0,k.useState)(d||(Bu.some(e=>e.nodeName===n)?n:`全部节点`)),[m,h]=(0,k.useState)(``),[g,_]=(0,k.useState)(``),[v,y]=(0,k.useState)(``),[b,x]=(0,k.useState)(``),[S,C]=(0,k.useState)({}),[w,ee]=(0,k.useState)(!1),[T,E]=(0,k.useState)(``),[D,te]=(0,k.useState)([]),[ne,re]=(0,k.useState)(``);function ie(){re(``),Ou().then(te).catch(e=>re(e.message))}(0,k.useEffect)(()=>{ie()},[]);let O=(0,k.useRef)(!1),ae=g===`custom`;ku(`node-task-template-picker`,()=>{O.current||a()});let oe=e=>l===`全部`||(l===`项目平台`?t.platforms.includes(e)||e===`通用`:l===e),se=Ru.filter(e=>oe(e.platform)),ce=[...new Set(se.map(e=>e.name))],le=Ru.find(e=>e.id===g),j=e===`node`&&!!le,ue=se.filter(e=>`${e.name} ${e.description} ${e.scene}`.includes(m.trim())),de=Bu.filter(e=>oe(e.platform)&&(f===`全部节点`||e.nodeName===f)&&`${e.name} ${e.nodeName} ${e.skill.name}`.includes(m.trim())),M=Object.values(S),fe=e=>D.find(t=>t.id===e.skillId)?.name||Bu.find(t=>t.id===e.templateId&&t.skill.id===e.skillId)?.skill.name||(e.skillId?`Skill 信息暂不可用`:`未关联 Skill`);function pe(e){return{key:e?.id||`custom:${crypto.randomUUID()}`,templateId:e?.id,title:e?.name||``,description:e?`${e.description}\n\n形成${e.output},记录依据与结论,完成任务。`:``,criteria:``,owner:c,startDate:``,dueDate:``,priority:`中`,skillId:e?.skill.id||``}}function N(e){let t=Ru.find(t=>t.id===e);_(e),y(t?.name||``),x(t?.description||``),E(``),C(Object.fromEntries((t?.tasks||[]).map(e=>[e.id,pe(e)])))}function me(e){j||C(t=>{let n={...t};return n[e.id]?delete n[e.id]:n[e.id]=pe(e),n})}function P(){if(j)return;let e=pe();C(t=>({...t,[e.key]:e})),E(``)}function he(e,t){C(n=>n[e]?.templateId?n:{...n,[e]:{...n[e],...t}})}async function ge(r){if(r.preventDefault(),!O.current){if(e===`node`&&(!g||!v.trim())){E(`请选择节点模板或自定义节点,并填写名称。`);return}if(e===`task`&&!M.length){E(`请选择模板任务或添加自定义任务。`);return}if(M.some(e=>!e.title.trim()||!e.description.trim()||!e.owner)){E(`请补全任务名称、项目目标、负责人。`);return}if(M.some(e=>e.startDate&&e.dueDate&&e.startDate>e.dueDate)){E(`任务截止时间不能早于开始时间。`);return}O.current=!0,ee(!0),E(``);try{await o({kind:e,customNode:ae,nodeTemplateId:le?.id,name:v.trim(),description:b.trim(),stage:n,contextToken:String(t.version),tasks:M.map(e=>({...e,title:e.title.trim(),description:e.description.trim(),criteria:e.criteria.trim()}))})}catch(e){E(e.message||`创建失败,请重试。`)}finally{O.current=!1,ee(!1)}}}function _e(e){return(0,A.jsxs)(`div`,{className:`library-task-row ${S[e.id]?`selected`:``}`,children:[(0,A.jsxs)(`label`,{className:`library-task-check`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:!!S[e.id],disabled:w,onChange:()=>me(e)}),(0,A.jsx)(`b`,{children:e.name}),(0,A.jsxs)(`span`,{className:`library-task-tag`,children:[e.platform,` · `,e.nodeName]})]}),(0,A.jsx)(`p`,{children:e.description}),(0,A.jsx)(Vu,{name:e.skill.name})]},e.id)}let ve=e===`task`||!!g;return(0,A.jsx)(`div`,{className:`modal-backdrop`,children:(0,A.jsxs)(`form`,{className:`modal item-library-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`item-library-title`,onSubmit:e=>void ge(e),children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{id:`item-library-title`,children:e===`node`?`添加节点`:`添加任务`}),(0,A.jsxs)(`p`,{children:[t.name,n?` / ${n}`:``,` · 从模板开始,也可以自定义`]})]}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`关闭`,title:`关闭`,disabled:w,onClick:a,children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsxs)(`div`,{className:`item-library-filters ${e===`task`?`task-library-toolbar`:``}`,children:[e===`task`&&(0,A.jsxs)(`div`,{className:`task-library-heading`,children:[(0,A.jsx)(`h3`,{children:`从任务模板库选择`}),(0,A.jsxs)(`button`,{type:`button`,className:`library-add-task-button`,disabled:w,onClick:P,children:[(0,A.jsx)($,{name:`plus`}),`添加自定义任务`]})]}),(0,A.jsxs)(`label`,{children:[`电商平台`,(0,A.jsx)(`select`,{value:l,disabled:w,onChange:t=>{u(t.target.value),e===`task`&&p(`全部节点`)},children:[`全部`,...t.platforms?.length?[`项目平台`]:[],...Mu,`通用`].map(e=>(0,A.jsx)(`option`,{children:e},e))})]}),e===`task`&&(0,A.jsxs)(`label`,{children:[`SOP节点`,(0,A.jsx)(`select`,{value:f,disabled:w,onChange:e=>p(e.target.value),children:[`全部节点`,...n&&!ce.includes(n)?[n]:[],...ce].map(e=>(0,A.jsx)(`option`,{children:e},e))})]}),(0,A.jsxs)(`label`,{className:`item-library-search`,children:[`搜索`,(0,A.jsx)(`input`,{type:`search`,placeholder:e===`node`?`搜索节点、用途或场景`:`搜索任务或Skill`,value:m,disabled:w,onChange:e=>h(e.target.value)})]})]}),(0,A.jsxs)(`div`,{className:`item-library-body${j?` node-preview-layout`:``}`,children:[(0,A.jsxs)(`section`,{className:`item-library-results`,"aria-label":`模板选择`,children:[e===`node`&&(0,A.jsxs)(`button`,{type:`button`,className:`library-custom-entry ${ae?`selected`:``}`,disabled:w,onClick:()=>e===`node`?N(`custom`):P(),children:[(0,A.jsx)($,{name:`plus`}),(0,A.jsx)(`span`,{children:e===`node`?`自定义节点`:`添加自定义任务`}),(0,A.jsx)(`small`,{children:e===`node`?`自由命名,可先创建空白节点`:`自行填写目标、负责人和执行安排`})]}),e===`node`?ue.map(e=>(0,A.jsxs)(`button`,{type:`button`,className:`library-node-choice ${g===e.id?`selected`:``}`,disabled:w,onClick:()=>N(e.id),children:[(0,A.jsxs)(`small`,{children:[e.platform,` · `,e.scene]}),(0,A.jsx)(`b`,{children:e.name}),(0,A.jsx)(`p`,{children:e.description}),(0,A.jsxs)(`span`,{children:[e.tasks.length,`个任务 · `,e.output]})]},e.id)):de.map(_e),(e===`node`?!ue.length:!de.length)&&(0,A.jsxs)(`div`,{className:`sop-no-results`,children:[(0,A.jsx)(`h3`,{children:`暂无匹配模板`}),(0,A.jsx)(`p`,{children:`可切换筛选,或使用上方的自定义入口。`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{u(`全部`),p(`全部节点`),h(``)},children:`查看全部模板`})]})]}),(0,A.jsxs)(`section`,{className:`item-library-detail${e===`task`?` task-preview-panel`:``}`,"aria-label":`创建信息`,children:[e===`task`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`h3`,{children:`任务设置`}),(0,A.jsxs)(`p`,{className:`muted`,children:[`添加到「`,n,`」。模板任务按看板样式预览,自定义任务可编辑。`]})]}):(0,A.jsx)(`h3`,{children:j?`节点预览`:`节点及任务设置`}),j&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`muted`,children:`创建后将按以下样式加入看板,任务均为待开始。`}),(0,A.jsxs)(`div`,{className:`column library-board-preview`,children:[(0,A.jsxs)(`div`,{className:`column-title`,children:[(0,A.jsx)(`span`,{className:`stage-order`,children:String((t.stages?.length||0)+1).padStart(2,`0`)}),(0,A.jsx)(`strong`,{children:v}),(0,A.jsx)(`span`,{className:`column-count`,children:M.length})]}),b&&(0,A.jsx)(`p`,{className:`sop-column-purpose`,children:b}),M.map(e=>{let t=s.find(t=>t.id===e.owner)?.name||`未指定`;return(0,A.jsxs)(`article`,{className:`card library-preview-task`,children:[(0,A.jsx)(`div`,{className:`card-top`,children:(0,A.jsx)(`span`,{className:`badge status-待开始`,children:`待开始`})}),(0,A.jsxs)(`h3`,{children:[v,` · `,e.title]}),(0,A.jsx)(`p`,{className:`library-preview-description`,children:e.description}),(0,A.jsx)(Vu,{name:fe(e)}),(0,A.jsx)(`div`,{className:`card-footer`,children:(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`i`,{className:`avatar`,children:t.slice(0,1)}),t]})})]},e.key)})]})]}),e===`node`&&ae&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`label`,{children:[`节点名称 `,(0,A.jsx)(`span`,{className:`required-mark`,children:`*`}),(0,A.jsx)(`input`,{required:!0,maxLength:80,disabled:w,value:v,onChange:e=>y(e.target.value)})]}),(0,A.jsxs)(`label`,{children:[`节点用途`,(0,A.jsx)(`textarea`,{rows:2,maxLength:2e3,disabled:w,value:b,onChange:e=>x(e.target.value)})]})]}),e===`node`&&!g&&(0,A.jsx)(`p`,{className:`muted`,children:`从左侧选择节点模板,或点击“自定义节点”。`}),ve&&!j&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`library-selected-heading`,children:[(0,A.jsxs)(`h4`,{children:[`本次添加 `,M.length,` 个任务`]}),e===`node`&&(0,A.jsx)(`button`,{type:`button`,className:`library-add-task-button`,disabled:w,onClick:P,children:`添加自定义任务`})]}),e===`task`&&!M.length&&(0,A.jsx)(`p`,{className:`muted`,children:`从左侧选择任务模板,或点击“添加自定义任务”。`}),M.map((e,t)=>e.templateId?(0,A.jsxs)(`article`,{className:`card library-preview-task`,children:[(0,A.jsxs)(`div`,{className:`card-top`,children:[(0,A.jsx)(`span`,{className:`badge status-待开始`,children:`待开始`}),(0,A.jsx)(`span`,{className:`library-task-tag`,children:`模板任务`}),(0,A.jsx)(`button`,{type:`button`,disabled:w,onClick:()=>C(t=>{let n={...t};return delete n[e.key],n}),children:`移除`})]}),(0,A.jsx)(`h3`,{children:e.title}),(0,A.jsx)(`p`,{className:`library-preview-description`,children:e.description}),(0,A.jsx)(Vu,{name:fe(e)}),(0,A.jsx)(`div`,{className:`card-footer`,children:(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`i`,{className:`avatar`,children:(s.find(t=>t.id===e.owner)?.name||`未指定`).slice(0,1)}),s.find(t=>t.id===e.owner)?.name||`未指定`]})})]},e.key):(0,A.jsxs)(`section`,{className:`library-task-editor`,children:[(0,A.jsxs)(`div`,{className:`library-task-editor-heading`,children:[(0,A.jsxs)(`div`,{className:`library-task-heading-title`,children:[(0,A.jsxs)(`b`,{children:[`任务 `,t+1]}),(0,A.jsx)(`span`,{children:e.templateId?`来自模板 · 只读`:`自定义`})]}),!j&&(0,A.jsx)(`button`,{type:`button`,disabled:w,onClick:()=>C(t=>{let n={...t};return delete n[e.key],n}),children:`移除`})]}),(0,A.jsxs)(`fieldset`,{disabled:w||!!e.templateId,children:[(0,A.jsxs)(`label`,{children:[`任务名称 `,(0,A.jsx)(`span`,{className:`required-mark`,children:`*`}),(0,A.jsx)(`input`,{required:!0,maxLength:200,value:e.title,onChange:t=>he(e.key,{title:t.target.value}),placeholder:`填写要完成的具体工作`})]}),(0,A.jsxs)(`label`,{children:[`项目目标 `,(0,A.jsx)(`span`,{className:`required-mark`,children:`*`}),(0,A.jsx)(`textarea`,{required:!0,maxLength:2e3,rows:3,value:e.description,onChange:t=>he(e.key,{description:t.target.value}),placeholder:`说明要完成的工作、期望结果和交付内容`})]}),(0,A.jsxs)(`div`,{className:`library-field-grid`,children:[(0,A.jsxs)(`label`,{children:[`负责人 `,(0,A.jsx)(`span`,{className:`required-mark`,children:`*`}),(0,A.jsx)(`select`,{required:!0,value:e.owner,onChange:t=>he(e.key,{owner:t.target.value}),children:s.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,A.jsxs)(`label`,{children:[`关联Skill`,(0,A.jsxs)(`select`,{value:e.skillId,onChange:t=>he(e.key,{skillId:t.target.value}),children:[(0,A.jsx)(`option`,{value:``,children:`暂不关联`}),e.skillId&&!D.some(t=>t.id===e.skillId)&&(0,A.jsx)(`option`,{value:e.skillId,children:Bu.find(t=>t.skill.id===e.skillId)?.skill.name}),D.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})]})]})]},e.key)),e===`node`&&!M.length&&(0,A.jsx)(`p`,{className:`muted`,children:`可先创建空白节点,稍后通过节点中的“添加任务”继续安排。`})]})]})]}),T&&(0,A.jsx)(`p`,{className:`error`,role:`alert`,children:T}),ne&&(0,A.jsxs)(`p`,{role:`alert`,children:[ne,` `,(0,A.jsx)(`button`,{type:`button`,onClick:ie,children:`重新加载Skill`})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`small`,{children:`带 * 的内容为必填。`}),(0,A.jsx)(`button`,{type:`button`,disabled:w,onClick:a,children:`取消`}),(0,A.jsx)(`button`,{type:`submit`,className:`primary`,disabled:w||(e===`task`?!M.length:!g||!v.trim()),children:w?`正在创建…`:e===`node`?`创建节点${M.length?`及${M.length}个任务`:``}`:`添加${M.length}个任务`})]})]})})}function Uu({name:e,label:t,value:n,defaultValue:r=``,onChange:i,children:a}){let[o,s]=(0,k.useState)(r),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(null),d=(0,k.useRef)(null),f=k.Children.toArray(a).filter(k.isValidElement).map(e=>{let t=e.props;return{value:String(t.value??t.children),label:t.children}}),p=n??o;return(0,k.useEffect)(()=>{if(!c)return;let e=e=>{u.current?.contains(e.target)||l(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[c]),(0,A.jsxs)(`div`,{className:`form-select`,ref:u,onKeyDown:e=>{if(e.key===`Escape`&&c&&(e.preventDefault(),e.stopPropagation(),l(!1),d.current?.focus()),(e.key===`ArrowDown`||e.key===`ArrowUp`)&&c){e.preventDefault();let t=Array.from(u.current?.querySelectorAll(`[role="option"]`)||[]);t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},children:[(0,A.jsx)(`input`,{type:`hidden`,name:e,value:p}),(0,A.jsxs)(`button`,{type:`button`,ref:d,className:`form-select-trigger`,"aria-label":t,title:t,"aria-haspopup":`listbox`,"aria-expanded":c,onClick:()=>l(!c),children:[(0,A.jsx)(`span`,{children:f.find(e=>e.value===p)?.label||`请选择`}),(0,A.jsx)($,{name:`chevronDown`,size:`indicator`})]}),c&&(0,A.jsx)(`div`,{className:`form-select-options`,role:`listbox`,"aria-label":t,children:f.map(e=>(0,A.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":p===e.value,onClick:()=>{s(e.value),i?.(e.value),l(!1),d.current?.focus()},children:[(0,A.jsx)(`span`,{children:e.label}),p===e.value&&(0,A.jsx)($,{name:`check`})]},e.value))})]})}var Wu=new Map([[`tumbler`,new URL(``+new URL(`project-tumbler-D2BmTnok.png`,import.meta.url).href,``+import.meta.url).href],[`travel-bag`,new URL(``+new URL(`project-travel-bag-DWCGqkcM.png`,import.meta.url).href,``+import.meta.url).href],[`cutting-board`,new URL(``+new URL(`project-cutting-board-CeIWMQLS.jpg`,import.meta.url).href,``+import.meta.url).href],[`tissue-box`,new URL(``+new URL(`project-tissue-box-DkxE74G5.jpg`,import.meta.url).href,``+import.meta.url).href],[`drinking-glass`,new URL(``+new URL(`project-drinking-glass-D8H-30yp.jpg`,import.meta.url).href,``+import.meta.url).href],[`double-11-thermos`,new URL(``+new URL(`project-double-11-thermos-D7tzhW-B.jpg`,import.meta.url).href,``+import.meta.url).href],[`collaboration-travel-bag`,new URL(``+new URL(`project-collaboration-travel-bag-BB2ARGd7.jpg`,import.meta.url).href,``+import.meta.url).href],[`portable-blender`,new URL(``+new URL(`project-portable-blender-CLylHN-m.jpg`,import.meta.url).href,``+import.meta.url).href],[`foldable-storage-crate`,new URL(``+new URL(`project-foldable-storage-crate-DlZP-j-z.jpg`,import.meta.url).href,``+import.meta.url).href],[`airtight-canisters`,new URL(``+new URL(`project-airtight-canisters-LLndxxjI.jpg`,import.meta.url).href,``+import.meta.url).href],[`microfiber-cloths`,new URL(``+new URL(`project-microfiber-cloths-Dda9f7He.jpg`,import.meta.url).href,``+import.meta.url).href],[`scented-candle`,new URL(``+new URL(`project-scented-candle-CDVqTvgw.jpg`,import.meta.url).href,``+import.meta.url).href],[`travel-bottles`,new URL(``+new URL(`project-travel-bottles-CgRJiJGs.jpg`,import.meta.url).href,``+import.meta.url).href],[`silicone-baking-mat`,new URL(``+new URL(`project-silicone-baking-mat-DUDDE63y.jpg`,import.meta.url).href,``+import.meta.url).href],[`desktop-cable-clips`,new URL(``+new URL(`project-desktop-cable-clips-DdPGOqI8.jpg`,import.meta.url).href,``+import.meta.url).href]]),Gu=[`image/jpeg`,`image/png`,`image/webp`];function Ku({project:e,onSave:t}){let n=(0,k.useRef)(null),r=(0,k.useRef)(!1),[i,a]=(0,k.useState)(null),[o,s]=(0,k.useState)(1),[c,l]=(0,k.useState)(50),[u,d]=(0,k.useState)(50),[f,p]=(0,k.useState)(!1),[m,h]=(0,k.useState)(``),g=e.cover?.dataUrl||Wu.get(e.cover?.asset)||``;(0,k.useEffect)(()=>()=>{i&&URL.revokeObjectURL(i.url)},[i]),ku(i?`cover-${e.id}`:``,()=>{f||a(null)});async function _(e){if(!e||r.current)return;if(!Gu.includes(e.type)||e.size>10*1024*1024){h(`请选择 10 MB 以内的 JPG、PNG 或 WebP 图片。`);return}r.current=!0;let t=URL.createObjectURL(e);try{let e=new Image;if(e.src=t,await e.decode(),!e.naturalWidth||!e.naturalHeight)throw Error(`invalid image`);s(1),l(50),d(50),h(``),a({url:t,width:e.naturalWidth,height:e.naturalHeight})}catch{URL.revokeObjectURL(t),h(`无法读取这张图片,请重新选择。`)}finally{r.current=!1}}async function v(){if(!(!i||f||!t)){p(!0),h(``);try{let e=new Image;e.src=i.url,await e.decode();let n=Math.min(i.width,i.height)/o,r=document.createElement(`canvas`);r.width=r.height=768;let s=r.getContext(`2d`);if(!s)throw Error(`当前浏览器无法裁剪图片。`);s.fillStyle=`#f5f5f5`,s.fillRect(0,0,768,768),s.drawImage(e,(i.width-n)*c/100,(i.height-n)*u/100,n,n,0,0,768,768);let l=await new Promise((e,t)=>r.toBlob(n=>n?e(n):t(Error(`图片保存失败。`)),`image/jpeg`,.88));await t(new File([l],`project-cover.jpg`,{type:`image/jpeg`})),a(null)}catch(e){h(e.message||`封面保存失败,请重试。`)}finally{p(!1)}}}let y=i?i.width/Math.min(i.width,i.height)*o*100:100,b=i?i.height/Math.min(i.width,i.height)*o*100:100;return t?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`project-cover-control`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),onContextMenu:e=>e.stopPropagation(),children:[(0,A.jsxs)(`button`,{className:`project-cover ${g?`has-cover`:``}`,type:`button`,"aria-label":`${g?`更换`:`上传`}${e.name}的封面`,title:`上传或更换封面 · 1:1`,onClick:()=>n.current?.click(),children:[g?(0,A.jsx)(`img`,{src:g,alt:`${e.name}产品封面`,loading:`lazy`}):(0,A.jsx)($,{name:`image`,size:`large`}),(0,A.jsxs)(`span`,{className:`project-cover-action`,children:[(0,A.jsx)($,{name:`image`}),g?`更换封面`:`上传封面`]})]}),(0,A.jsx)(`input`,{ref:n,hidden:!0,type:`file`,accept:`image/jpeg,image/png,image/webp`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,_(t)}}),m&&!i&&(0,A.jsx)(`span`,{className:`cover-inline-error`,role:`alert`,children:m})]}),i&&(0,Eu.createPortal)((0,A.jsx)(`div`,{className:`modal-backdrop cover-backdrop`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),onContextMenu:e=>e.stopPropagation(),children:(0,A.jsxs)(`section`,{className:`modal cover-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`cover-title-${e.id}`,children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`h2`,{id:`cover-title-${e.id}`,children:`调整项目封面`}),(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`关闭封面裁剪`,title:`关闭封面裁剪`,disabled:f,onClick:()=>a(null),children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsxs)(`p`,{children:[e.name,` · 1:1 正方形`]}),(0,A.jsx)(`div`,{className:`cover-crop-preview`,children:(0,A.jsx)(`img`,{src:i.url,alt:`封面裁剪预览`,style:{width:`${y}%`,height:`${b}%`,left:`${(100-y)*c/100}%`,top:`${(100-b)*u/100}%`}})}),(0,A.jsxs)(`label`,{children:[`缩放`,(0,A.jsx)(`input`,{type:`range`,min:`1`,max:`3`,step:`0.01`,value:o,disabled:f,onChange:e=>s(Number(e.target.value))})]}),(0,A.jsxs)(`label`,{children:[`水平位置`,(0,A.jsx)(`input`,{type:`range`,min:`0`,max:`100`,value:c,disabled:f,onChange:e=>l(Number(e.target.value))})]}),(0,A.jsxs)(`label`,{children:[`垂直位置`,(0,A.jsx)(`input`,{type:`range`,min:`0`,max:`100`,value:u,disabled:f,onChange:e=>d(Number(e.target.value))})]}),m&&(0,A.jsx)(`p`,{className:`error`,role:`alert`,children:m}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`button`,{disabled:f,onClick:()=>a(null),children:`取消`}),(0,A.jsx)(`button`,{className:`primary`,disabled:f,onClick:()=>void v(),children:f?`保存中…`:`保存封面`})]})]})}),document.querySelector(`.project-collaboration`)||document.body)]}):(0,A.jsx)(`div`,{className:`project-cover-control`,children:(0,A.jsx)(`div`,{className:`project-cover ${g?`has-cover`:``}`,children:g?(0,A.jsx)(`img`,{src:g,alt:`${e.name}产品封面`,loading:`lazy`}):(0,A.jsx)($,{name:`image`,size:`large`})})})}function qu({label:e,options:t,value:n,onChange:r}){let[i,a]=(0,k.useState)(!1),o=(0,k.useRef)(null),s=(0,k.useRef)(null);return(0,k.useEffect)(()=>{if(!i)return;let e=e=>{o.current?.contains(e.target)||a(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[i]),(0,A.jsxs)(`div`,{className:`form-select`,ref:o,onKeyDown:e=>{if(e.key===`Escape`&&i&&(e.preventDefault(),e.stopPropagation(),a(!1),s.current?.focus()),i&&[`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=Array.from(o.current?.querySelectorAll(`[role="menuitem"], [role="menuitemcheckbox"]`)||[]),n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:n<0?e.key===`ArrowUp`?t.length-1:0:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},children:[(0,A.jsxs)(`button`,{type:`button`,ref:s,className:`form-select-trigger`,"aria-label":e,title:n.join(`、`)||`未选择平台`,"aria-haspopup":`menu`,"aria-expanded":i,onClick:()=>a(!i),children:[(0,A.jsx)(`span`,{children:n.join(`、`)||`未选择平台`}),(0,A.jsx)($,{name:`chevronDown`,size:`indicator`})]}),i&&(0,A.jsxs)(`div`,{className:`form-select-options`,role:`menu`,"aria-label":e,children:[(0,A.jsxs)(`div`,{className:`form-multi-actions`,role:`group`,"aria-label":`平台批量选择`,children:[(0,A.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:e=>{e.stopPropagation(),r([...new Set(t)])},children:`全选`}),(0,A.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:e=>{e.stopPropagation(),r(t.filter(e=>!n.includes(e)))},children:`反选`})]}),t.map(e=>(0,A.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":n.includes(e),onClick:t=>{t.stopPropagation(),r(n.includes(e)?n.filter(t=>t!==e):[...n,e])},children:[(0,A.jsx)(`span`,{children:e}),(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`form-multi-check`,children:n.includes(e)&&(0,A.jsx)($,{name:`check`,size:`indicator`})})]},e))]})]})}var Ju={淘宝:`#ee711d`,京东:`#dc4854`,拼多多:`#e75a43`,抖音:`#272b39`,小红书:`#e94d6c`,亚马逊:`#985008`,通用:`#7455d8`};function Yu({task:e,onClose:t}){return ku(`sop-task-template:${e.id}`,t),(0,A.jsx)(`div`,{className:`modal-backdrop sop-task-preview-backdrop`,onMouseDown:e=>{e.target===e.currentTarget&&t()},children:(0,A.jsxs)(`section`,{className:`modal sop-task-preview-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`sop-task-template-title`,children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`h2`,{id:`sop-task-template-title`,children:`任务模板详情`}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`关闭任务模板详情`,onClick:t,children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsx)(`h3`,{children:e.name}),(0,A.jsxs)(`dl`,{className:`sop-task-template-meta`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:`适用平台`}),(0,A.jsx)(`dd`,{children:e.platform})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:`所属节点`}),(0,A.jsx)(`dd`,{children:e.nodeName})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:`关联 Skill`}),(0,A.jsx)(`dd`,{children:e.skill.name})]})]}),(0,A.jsxs)(`section`,{className:`sop-task-template-copy`,children:[(0,A.jsx)(`h4`,{children:`任务说明`}),(0,A.jsx)(`p`,{children:e.description||`任务模板尚未填写说明。`})]}),(0,A.jsxs)(`section`,{className:`sop-task-template-copy`,children:[(0,A.jsx)(`h4`,{children:`交付要求`}),(0,A.jsx)(`p`,{children:e.output||`任务模板尚未填写交付要求。`})]}),(0,A.jsx)(`div`,{className:`modal-actions`,children:(0,A.jsx)(`button`,{type:`button`,onClick:t,children:`关闭`})})]})})}function Xu({template:e,selected:t}){let[n,r]=(0,k.useState)(null);if(!e.nodes.length)return(0,A.jsxs)(`div`,{className:`sop-blank-canvas`,children:[(0,A.jsx)(`span`,{children:(0,A.jsx)($,{name:`document`,size:`display`})}),(0,A.jsx)(`h3`,{children:`空白 SOP`}),(0,A.jsx)(`p`,{children:`不预设节点和任务,创建项目后自行添加。`})]});let i=e.nodes[t]?t:0,a=e.nodes[i],o=e.layers.some(e=>e.includes(i)&&e.length>1);return(0,A.jsxs)(`div`,{className:`sop-template-board`,role:`region`,"aria-label":`所选模板节点详情`,children:[(0,A.jsxs)(`section`,{className:`column sop-template-column`,"aria-label":`${a.name},${a.tasks.length}个任务`,children:[(0,A.jsxs)(`div`,{className:`column-title`,children:[(0,A.jsx)(`span`,{className:`stage-order`,children:String(i+1).padStart(2,`0`)}),(0,A.jsx)(`strong`,{children:a.name}),(0,A.jsx)(`span`,{className:`column-count`,children:a.tasks.length})]}),(0,A.jsx)(`p`,{className:`sop-column-purpose`,children:a.description}),o&&(0,A.jsx)(`span`,{className:`sop-column-parallel`,children:`可与同组节点并行开展`}),(0,A.jsx)(`div`,{className:`sop-board-task-grid`,children:a.tasks.map((t,n)=>{let i=Bu.find(n=>n.platform===e.platform&&n.nodeName===a.name&&n.name===t),o=e=>{i&&r({task:i,trigger:e})};return(0,A.jsxs)(`article`,{className:`card sop-preview-task`,role:`button`,tabIndex:i?0:-1,"aria-label":`查看任务模板:${t}`,"aria-haspopup":`dialog`,"aria-disabled":!i,onClick:e=>o(e.currentTarget),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o(e.currentTarget))},children:[(0,A.jsxs)(`div`,{className:`card-top`,children:[(0,A.jsx)(`span`,{className:`badge status-待开始`,children:`待开始`}),(0,A.jsxs)(`small`,{children:[`任务 `,n+1]})]}),(0,A.jsx)(`h3`,{children:t}),(0,A.jsx)(`div`,{className:`card-footer`,children:(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`i`,{className:`avatar`,children:`负`}),`项目负责人`]})})]},t)})}),(0,A.jsxs)(`div`,{className:`sop-column-outcome`,children:[(0,A.jsx)($,{name:`document`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`small`,{children:`节点交付`}),(0,A.jsx)(`span`,{children:a.output})]})]})]}),n&&(0,A.jsx)(Yu,{task:n.task,onClose:()=>{let e=n.trigger;r(null),requestAnimationFrame(()=>{e.isConnected&&e.focus()})}})]})}function Zu({selectedId:e,projectPlatforms:t,onConfirm:n,onBack:r}){let i=[...new Set([...Mu,...t,`通用`])],[a,o]=(0,k.useState)(t.length?[...new Set([...t,`通用`])]:i),s=Array.isArray(a)?a:[],[c,l]=(0,k.useState)(e),[u,d]=(0,k.useState)(0),f=e=>s.includes(e.platform),p=Iu.filter(e=>e.id!==`blank`&&f(e)),m=Iu.find(e=>e.id===c);(0,k.useEffect)(()=>{c!==`blank`&&!p.some(e=>e.id===c)&&l(p[0]?.id||``)},[s]),(0,k.useEffect)(()=>{d(0)},[c]);let h=e=>{l(e),d(0)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`header`,{className:`sop-picker-header`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{id:`project-setup-title`,children:`选择电商 SOP 模板`}),(0,A.jsx)(`span`,{children:`查看节点、任务与交付,选择适合项目的工作流`})]}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`关闭模板库,返回项目设置`,title:`关闭模板库,返回项目设置`,onClick:r,children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsxs)(`div`,{className:`sop-picker-workspace`,children:[(0,A.jsxs)(`section`,{className:`sop-template-catalog`,"aria-label":`模板列表`,children:[(0,A.jsxs)(`div`,{className:`sop-catalog-title`,children:[(0,A.jsx)(`b`,{children:`选择模板`}),(0,A.jsx)(`div`,{className:`sop-platform-select`,children:(0,A.jsx)(qu,{label:`筛选模板平台`,options:i,value:s,onChange:o})})]}),p.map(e=>(0,A.jsxs)(`button`,{type:`button`,className:`sop-template-card ${c===e.id?`active`:``}`,"aria-pressed":c===e.id,onClick:()=>h(e.id),children:[(0,A.jsx)(`span`,{className:`sop-card-tags`,children:(0,A.jsx)(`span`,{style:{color:Ju[e.platform]},children:e.platform})}),(0,A.jsx)(`b`,{children:e.name}),(0,A.jsx)(`p`,{children:e.description})]},e.id)),!p.length&&(0,A.jsxs)(`div`,{className:`sop-no-results`,children:[(0,A.jsx)($,{name:`search`,size:`large`}),(0,A.jsx)(`h3`,{children:`暂无匹配模板`}),(0,A.jsx)(`p`,{children:`可以更换平台,也可以选择空白 SOP。`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{o(i)},children:`查看全部模板`})]}),(0,A.jsxs)(`button`,{type:`button`,className:`sop-template-card ${c===`blank`?`active`:``}`,"aria-pressed":c===`blank`,onClick:()=>h(`blank`),children:[(0,A.jsx)(`b`,{children:`空白 SOP`}),(0,A.jsx)(`p`,{children:`不预设节点和任务`})]})]}),(0,A.jsx)(`section`,{className:`sop-preview-panel`,"aria-label":`SOP节点及任务预览`,children:m?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`sop-preview-summary`,children:[(0,A.jsx)(`div`,{className:`sop-preview-heading`,children:(0,A.jsx)(`div`,{children:(0,A.jsxs)(`div`,{className:`sop-preview-title-line`,children:[(0,A.jsx)(`h3`,{children:m.name}),(0,A.jsx)(`p`,{children:m.description})]})})}),m.nodes.length>0&&(0,A.jsxs)(`div`,{className:`sop-template-notes`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`b`,{children:`建议准备`}),(0,A.jsx)(`p`,{children:m.materials.join(`、`)||`可在项目内逐步补充资料`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`b`,{children:`最终交付`}),(0,A.jsx)(`p`,{children:m.outcome})]})]})]}),(0,A.jsxs)(`div`,{className:`sop-preview-body`,children:[m.nodes.length>0&&(0,A.jsxs)(`div`,{className:`sop-overview`,children:[(0,A.jsxs)(`div`,{className:`sop-overview-heading`,children:[(0,A.jsx)(`b`,{children:`完整工作流`}),(0,A.jsxs)(`span`,{children:[m.nodes.length,`个节点 · `,(e=>e.nodes.reduce((e,t)=>e+t.tasks.length,0))(m),`个任务`]}),(0,A.jsx)(`small`,{children:`点击查看节点任务 · 横向滚动查看全部`})]}),(0,A.jsx)(`div`,{className:`sop-overview-path`,children:m.layers.map((e,t)=>(0,A.jsxs)(`div`,{className:`sop-overview-layer`,children:[t>0&&(0,A.jsx)(`span`,{className:`sop-overview-arrow`,"aria-hidden":`true`,children:`→`}),(0,A.jsxs)(`div`,{className:e.length>1?`sop-overview-parallel`:``,children:[e.map(e=>(0,A.jsxs)(`button`,{type:`button`,className:u===e?`active`:``,"aria-pressed":u===e,onClick:()=>d(e),children:[(0,A.jsx)(`span`,{children:String(e+1).padStart(2,`0`)}),m.nodes[e].name]},e)),e.length>1&&(0,A.jsx)(`small`,{children:`并行开展`})]})]},t))})]}),(0,A.jsx)(Xu,{template:m,selected:u})]},c)]}):(0,A.jsxs)(`div`,{className:`sop-no-results`,children:[(0,A.jsx)($,{name:`document`,size:`display`}),(0,A.jsx)(`h3`,{children:`选择一套模板,查看节点及任务`}),(0,A.jsx)(`p`,{children:`每个节点展示具体工作、任务清单和交付成果。`})]})})]}),(0,A.jsxs)(`footer`,{className:`sop-picker-footer`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:r,children:`取消`}),(0,A.jsx)(`button`,{type:`button`,className:`primary sop-use-template`,disabled:!m,onClick:()=>{m&&n(c)},children:`使用此模板`})]})]})}function Qu(e=0,t){let n=t?new Date(`${t}T12:00:00`):new Date;return n.setDate(n.getDate()+e),`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,`0`)}-${String(n.getDate()).padStart(2,`0`)}`}function $u(e){let t=Iu.find(t=>t.id===e);return!t||t.id===`blank`?[]:t.platform===`通用`?[...ju]:[t.platform]}function ed({members:e,folders:t,initialFolder:n,currentMember:r,project:i,onClose:a,onCreate:o}){let[s,c]=(0,k.useState)(i?.name||``),[l,u]=(0,k.useState)(i?.ownerMemberId||r),[d,f]=(0,k.useState)(()=>i?i.platforms||[]:$u(`launch`)),[p,m]=(0,k.useState)(!1),[h,g]=(0,k.useState)(``),[_,v]=(0,k.useState)(i?.cover||null),[y,b]=(0,k.useState)(n),[x,S]=(0,k.useState)(``),[C,w]=(0,k.useState)(i?i.workflowTemplateId||i.managementTemplateId||`legacy`:`launch`),[ee,T]=(0,k.useState)(!1),[E,D]=(0,k.useState)(i?i.startDate||``:Qu()),[te,ne]=(0,k.useState)(i?i.dueDate||``:Qu(7)),[re,ie]=(0,k.useState)(i?i.startDate&&i.dueDate?Math.round((Date.parse(i.dueDate)-Date.parse(i.startDate))/864e5):null:7),[O,ae]=(0,k.useState)(!!(i&&(i.durationMode===`custom`||![7,30,60,90].includes(re??0)||i.durationDays!=null&&i.durationDays!==re))),[oe,se]=(0,k.useState)(re&&re>0&&re<=999?String(re):``),[ce,le]=(0,k.useState)(i?.goal||``),[j,ue]=(0,k.useState)(!1),[de,M]=(0,k.useState)(``),fe=(0,k.useRef)(!1);ku(ee?`project-template-picker`:`project-create-form`,()=>{j||(ee?T(!1):a())});let pe=Iu.find(e=>e.id===C),N=e=>f(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);async function me(e){if(e.preventDefault(),!fe.current){if(O&&!/^[1-9]\d{0,2}$/.test(oe)){M(`请输入1–999之间的整数天数。`);return}if(!d.length&&!p){M(`请至少选择一个所属平台。`);return}if(E&&te&&te<E){M(`截止时间应晚于或等于开始时间。`);return}if(y===`__new__`&&!x.trim()){M(`请填写新文件夹名称。`);return}fe.current=!0,ue(!0),M(``);try{await o({name:s.trim(),goal:ce.trim(),setup:!0,ownerMemberId:l,platforms:[...d,...p?[h.trim()]:[]],cover:_,folderId:y===`__new__`?null:y||null,newFolderName:y===`__new__`?x.trim():``,workflowTemplateId:C,startDate:E,dueDate:te,durationMode:O?`custom`:`preset`,durationDays:re,...i?{}:{sop:{mode:C===`blank`?`blank`:`custom`,nodes:pe.nodes}}})}catch(e){M(e.message||`保存失败,请重试。`)}finally{fe.current=!1,ue(!1)}}}return(0,A.jsx)(`div`,{className:`modal-backdrop project-create-backdrop`,children:(0,A.jsx)(`form`,{className:`modal project-setup-modal ${ee?`sop-picker-modal`:``}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`project-setup-title`,onSubmit:e=>{ee?e.preventDefault():me(e)},children:ee?(0,A.jsx)(Zu,{selectedId:C,projectPlatforms:[...d,...p?[h.trim()]:[]],onBack:()=>T(!1),onConfirm:e=>{w(e),e!==`blank`&&(f($u(e)),m(!1),g(``)),T(!1)}}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`h2`,{id:`project-setup-title`,children:i?`编辑项目`:`新建项目`})}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:j,"aria-label":i?`关闭编辑项目`:`关闭新建项目`,title:i?`关闭编辑项目`:`关闭新建项目`,onClick:a,children:(0,A.jsx)($,{name:`close`})})]}),de&&(0,A.jsx)(`p`,{className:`error`,role:`alert`,children:de}),(0,A.jsxs)(`fieldset`,{disabled:j,className:`project-setup-fields`,children:[(0,A.jsxs)(`div`,{className:`setup-template-field`,children:[(0,A.jsxs)(`span`,{children:[`项目模板 `,(0,A.jsx)(`small`,{id:i?`project-template-readonly-note`:void 0,children:i?`模板不可更改,保留当前节点、任务与执行记录。`:`按新品上架、老品优化等场景,配置标准运营流程`})]}),(0,A.jsxs)(`button`,{type:`button`,className:`setup-template-trigger`,disabled:!!i,"aria-describedby":i?`project-template-readonly-note`:void 0,onClick:()=>T(!0),children:[(0,A.jsx)(`span`,{className:`setup-template-icon`,children:(0,A.jsx)($,{name:`project`,size:`large`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`b`,{children:pe?.name||`未记录模板`}),(0,A.jsx)(`small`,{children:pe?pe.nodes.length?`${pe.nodes.length}个阶段 · ${pe.platform}`:`空白项目,自由添加阶段`:`历史项目未保存所选模板信息`})]}),(0,A.jsxs)(`span`,{className:`setup-template-action`,children:[i?`当前模板`:`更换模板`,!i&&(0,A.jsx)($,{name:`chevronRight`})]})]})]}),(0,A.jsxs)(`label`,{children:[`项目名称 `,(0,A.jsx)(`span`,{className:`required-mark`,children:`*`}),(0,A.jsx)(`input`,{autoFocus:!0,required:!0,maxLength:80,value:s,onChange:e=>c(e.target.value),placeholder:`例如:轻量保温杯 · 新品上市`})]}),(0,A.jsxs)(`fieldset`,{className:`setup-platform-field`,children:[(0,A.jsxs)(`legend`,{children:[`所属平台 `,(0,A.jsx)(`span`,{className:`required-mark`,children:`*`}),(0,A.jsx)(`small`,{children:`可多选`})]}),(0,A.jsxs)(`details`,{className:`setup-platform-dropdown`,children:[(0,A.jsxs)(`summary`,{children:[(0,A.jsx)(`span`,{children:[...d,...p?[h||`自定义`]:[]].join(`、`)||`请选择平台`}),(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`⌄`})]}),(0,A.jsxs)(`div`,{className:`setup-platform-options`,children:[[...new Set([...Mu,...d])].map(e=>(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:d.includes(e),onChange:()=>N(e)}),e]},e)),(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>m(e.target.checked)}),`自定义`]})]})]}),p&&(0,A.jsx)(`input`,{required:!0,maxLength:30,"aria-label":`自定义平台名称`,placeholder:`输入自定义平台名称`,value:h,onChange:e=>g(e.target.value)})]}),(0,A.jsxs)(`fieldset`,{className:`setup-duration-field`,children:[(0,A.jsxs)(`legend`,{children:[`项目期限 `,(0,A.jsxs)(`small`,{children:[i?`从项目开始日期计算`:`从创建当天开始`,te?` · ${te.replaceAll(`-`,`/`)} 截止`:` · 未设置`]})]}),(0,A.jsxs)(`div`,{className:`setup-duration-row${O?` has-custom-duration`:``}`,children:[(0,A.jsxs)(`div`,{className:`setup-duration-options`,children:[[7,30,60,90].map(e=>(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`input`,{type:`radio`,name:`project-duration`,value:e,checked:!O&&re===e,onChange:()=>{let t=E||Qu();ae(!1),ie(e),D(t),ne(Qu(e,t))}}),(0,A.jsxs)(`span`,{children:[e,`天`]})]},e)),(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`input`,{type:`radio`,name:`project-duration`,value:`custom`,checked:O,onChange:()=>{let e=E||Qu();ae(!0),D(e),ie(Number(oe)||null),ne(Number(oe)>0?Qu(Number(oe),e):``)}}),(0,A.jsx)(`span`,{children:`自定义`})]})]}),(0,A.jsxs)(`div`,{className:`setup-custom-duration`,"aria-hidden":!O,children:[(0,A.jsx)(`input`,{disabled:!O||j,required:O,tabIndex:O?0:-1,type:`text`,inputMode:`numeric`,pattern:`[1-9][0-9]{0,2}`,maxLength:3,"aria-label":`自定义项目期限天数`,placeholder:`1–999`,value:oe,onChange:e=>{let t=e.target.value.replace(/\D/g,``).replace(/^0+/,``).slice(0,3),n=E||Qu();se(t),ie(t?Number(t):null),D(n),ne(t?Qu(Number(t),n):``)}}),(0,A.jsx)(`span`,{children:`天`})]})]})]}),(0,A.jsxs)(`details`,{className:`setup-more-settings`,onInvalidCapture:e=>{e.currentTarget.open=!0},children:[(0,A.jsxs)(`summary`,{children:[(0,A.jsx)(`span`,{className:`setup-more-expand`,children:`展开更多设置`}),(0,A.jsx)(`span`,{className:`setup-more-collapse`,children:`收起更多设置`}),(0,A.jsx)($,{name:`chevronDown`,size:`indicator`})]}),(0,A.jsxs)(`div`,{className:`setup-more-fields`,children:[(0,A.jsxs)(`div`,{className:`setup-cover`,children:[(0,A.jsxs)(`span`,{children:[`项目封面 `,(0,A.jsx)(`small`,{children:`选填 · 1:1`})]}),(0,A.jsx)(Ku,{project:{id:i?.id||`new-project`,name:s||`新项目`,cover:_},onSave:async e=>{v({dataUrl:await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(Error(`封面读取失败`)),r.readAsDataURL(e)}),name:e.name,width:768,height:768})}})]}),(0,A.jsxs)(`div`,{className:`setup-select-field`,children:[(0,A.jsxs)(`span`,{children:[`负责人 `,(0,A.jsx)(`small`,{children:`默认创建用户`})]}),(0,A.jsxs)(Uu,{name:`owner`,label:`负责人`,value:l,onChange:u,children:[(0,A.jsx)(`option`,{value:``,children:`请选择负责人`}),e.filter(e=>e.id!==`agent`).map(e=>(0,A.jsxs)(`option`,{value:e.id,children:[e.name,e.id===r?`(我)`:``]},e.id))]})]}),(0,A.jsxs)(`div`,{className:`setup-select-field`,children:[(0,A.jsx)(`span`,{children:`归属项目分组`}),(0,A.jsxs)(Uu,{name:`folder`,label:`归属项目分组`,value:y,onChange:b,children:[(0,A.jsx)(`option`,{value:``,children:`未分组`}),t.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.name},e.id)),(0,A.jsx)(`option`,{value:`__new__`,children:`+ 新建项目分组`})]}),y===`__new__`&&(0,A.jsx)(`input`,{required:!0,"aria-label":`新项目分组名称`,maxLength:40,value:x,onChange:e=>S(e.target.value),placeholder:`输入新项目分组名称`})]}),(0,A.jsxs)(`label`,{children:[`项目目标 `,(0,A.jsx)(`small`,{children:`选填`}),(0,A.jsx)(`textarea`,{maxLength:2e3,rows:2,value:ce,onChange:e=>le(e.target.value),placeholder:`用一句话说明希望达成的结果`})]})]})]})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:j,onClick:a,children:`取消`}),(0,A.jsx)(`button`,{className:`primary`,disabled:j||!s.trim()||!l||!d.length&&!p,children:j?i?`保存中…`:`创建中…`:i?`保存`:`创建项目`})]})]})})})}var td=[{title:`看看今天要做什么`,prompt:`我有哪些项目需要跟进?先做哪件事?`},{title:`接着做一个项目`,prompt:`看看“保温杯新品上市”做到哪了,接下来做什么?`},{title:`帮我做一项任务`,prompt:`帮我分析保温杯的竞品,把结果放到项目里。`},{title:`开始一个新项目`,prompt:`帮我建一个“618 上市准备”项目,看看先做什么。`}];function nd({onClose:e}){let[t,n]=(0,k.useState)(``),[r,i]=(0,k.useState)(0);ku(`workbench-ai-guide`,e);async function a(e){try{await navigator.clipboard.writeText(e),n(`已复制,可以粘贴到主对话。`)}catch{n(`复制失败,请选中示例文字手动复制。`)}}return(0,A.jsx)(`div`,{className:`modal-backdrop`,children:(0,A.jsxs)(`section`,{className:`modal ai-guide`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`ai-guide-title`,children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`h2`,{id:`ai-guide-title`,children:`让 AI 帮你做`}),(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`关闭使用指南`,title:`关闭`,onClick:e,children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsx)(`p`,{children:`选一件事,去主对话试试。`}),(0,A.jsx)(`div`,{className:`ai-guide-scenes`,role:`group`,"aria-label":`选择想做的事`,children:[`查待办`,`看进度`,`做任务`,`建项目`].map((e,t)=>(0,A.jsx)(`button`,{"aria-pressed":r===t,onClick:()=>{i(t),n(``)},children:e},e))}),(0,A.jsxs)(`div`,{className:`ai-guide-example`,children:[(0,A.jsx)(`span`,{children:`你可以这样说`}),(0,A.jsx)(`p`,{children:td[r].prompt}),(0,A.jsx)(`button`,{onClick:()=>void a(td[r].prompt),children:`复制这句话`})]}),t&&(0,A.jsx)(`p`,{className:`ai-guide-notice`,role:`status`,children:t})]})})}var rd=216,id=100,ad=264,od=132,sd=144,cd={x:40,y:230,scale:1};function ld({memberName:e,getPurpose:t,stages:n,getTasks:r,isVisible:i,openTask:a}){let o=(0,k.useRef)(null),s=(0,k.useId)(),c=(0,k.useRef)(null),[l,u]=(0,k.useState)(cd),[d,f]=(0,k.useState)(!1),[p,m]=(0,k.useState)(!1),[h,g]=(0,k.useState)(()=>[...n]);function _(e,t,n){u(r=>{let i=Math.min(2.5,Math.max(.1,r.scale*e)),a=i/r.scale;return{x:t-(t-r.x)*a,y:n-(n-r.y)*a,scale:i}})}(0,k.useEffect)(()=>{let e=o.current;if(!e)return;function t(t){if(t.preventDefault(),t.ctrlKey||t.metaKey){let n=e.getBoundingClientRect();_(Math.exp(-t.deltaY*.008),t.clientX-n.left,t.clientY-n.top)}else{let n=t.deltaMode===1?16:t.deltaMode===2?e.clientHeight:1;u(e=>({...e,x:e.x-t.deltaX*n,y:e.y-t.deltaY*n}))}}return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let v=n.map((e,t)=>{let n=r(e),a=n.filter(e=>e.status===`已完成`).length,o=h.includes(e)?n.filter(i):[];return{stage:e,x:40+t*320,y:40,tasks:o,completed:a,total:n.length}}),y=Math.max(180,...v.map(e=>e.tasks.length?190+(e.tasks.length-1)*sd+od+24:180)),b=Math.max(320,n.length*320+40);(0,k.useEffect)(()=>{x()},[p]),(0,k.useEffect)(()=>{if(!p)return;function e(e){e.key===`Escape`&&m(!1)}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p]);function x(){let e=o.current;if(!e)return;let t=Math.max(.1,Math.min(1,(e.clientWidth-48)/b,(e.clientHeight-64)/(y-0)));u({x:(e.clientWidth-b*t)/2,y:(e.clientHeight-(y+0)*t)/2,scale:t})}function S(e){let t=o.current;t&&_(e,t.clientWidth/2,t.clientHeight/2)}function C(){c.current=null,f(!1)}return(0,A.jsxs)(`section`,{className:`project-workflow${p?` mindmap-fullscreen`:``}`,"aria-label":`项目工作流`,children:[(0,A.jsxs)(`div`,{className:`workflow-controls`,children:[(0,A.jsx)(`span`,{children:`节点从左到右排列 · 任务向下展开`}),(0,A.jsx)(`span`,{children:`点击圆形按钮展开或收起`}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`缩小画布`,onClick:()=>S(1/1.2),children:`−`}),(0,A.jsxs)(`output`,{"aria-label":`画布缩放比例`,children:[Math.round(l.scale*100),`%`]}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`放大画布`,onClick:()=>S(1.2),children:`+`}),(0,A.jsx)(`button`,{type:`button`,onClick:x,children:`自适应`}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":p?`退出全屏`:`全屏`,title:p?`退出全屏`:`全屏`,"aria-pressed":p,onClick:()=>m(e=>!e),children:(0,A.jsx)($,{name:p?`collapse`:`expand`})})]}),(0,A.jsxs)(`div`,{ref:o,className:`workflow-viewport${d?` dragging`:``}`,tabIndex:0,"aria-label":`工作流画布,拖动或用方向键平移,按加号或减号缩放`,onPointerDown:e=>{e.button!==0||e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId),c.current={id:e.pointerId,x:e.clientX,y:e.clientY},f(!0))},onPointerMove:e=>{let t=c.current;if(t?.id!==e.pointerId)return;let n=e.clientX-t.x,r=e.clientY-t.y;c.current={id:e.pointerId,x:e.clientX,y:e.clientY},u(e=>({...e,x:e.x+n,y:e.y+r}))},onPointerUp:C,onPointerCancel:C,onLostPointerCapture:C,onKeyDown:e=>{if(e.target!==e.currentTarget)return;let t={ArrowLeft:[64,0],ArrowRight:[-64,0],ArrowUp:[0,64],ArrowDown:[0,-64]}[e.key];if(t)u(e=>({...e,x:e.x+t[0],y:e.y+t[1]}));else if(e.key===`+`||e.key===`=`)S(1.2);else if(e.key===`-`)S(1/1.2);else return;e.preventDefault()},children:[!v.length&&(0,A.jsx)(`p`,{className:`workflow-empty`,children:`暂无节点,可切换到看板添加。`}),(0,A.jsxs)(`div`,{className:`workflow-world`,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`},children:[(0,A.jsxs)(`svg`,{className:`workflow-links`,width:`1`,height:`1`,"aria-hidden":`true`,children:[(0,A.jsx)(`defs`,{children:(0,A.jsx)(`marker`,{id:s,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,A.jsx)(`path`,{d:`M1 1 L9 5 L1 9`,fill:`none`,stroke:`#c5bbd9`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),v.slice(0,-1).map((e,t)=>(0,A.jsxs)(`g`,{children:[(0,A.jsx)(`path`,{className:`mindmap-branch`,markerEnd:`url(#${s})`,d:`M${e.x+rd} ${e.y+id/2} H${v[t+1].x-5}`}),(0,A.jsx)(`path`,{className:`mindmap-flow`,d:`M${e.x+rd} ${e.y+id/2} H${v[t+1].x}`})]},e.stage)),v.map(e=>(0,A.jsx)(`path`,{className:`mindmap-branch`,d:ud(e.x,e.y+id,190,e.tasks.length)},e.stage)),v.map(e=>(0,A.jsx)(`path`,{className:`mindmap-flow`,d:ud(e.x,e.y+id,190,e.tasks.length)},e.stage))]}),v.map((n,r)=>(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`workflow-node mindmap-stage`,style:{left:n.x,top:n.y,width:rd,height:id},children:[(0,A.jsxs)(`div`,{className:`mindmap-stage-heading`,children:[(0,A.jsx)(`span`,{className:`stage-order`,children:String(r+1).padStart(2,`0`)}),(0,A.jsx)(`strong`,{title:n.stage,children:n.stage}),(0,A.jsx)(`span`,{className:`column-count`,title:`任务数量`,children:n.total})]}),t(n.stage)&&(0,A.jsx)(`p`,{className:`mindmap-stage-purpose`,title:t(n.stage),children:t(n.stage)}),n.total>0&&(0,A.jsx)(`button`,{type:`button`,className:`mindmap-toggle`,"aria-label":`${h.includes(n.stage)?`收起`:`展开`}${n.stage}的任务`,title:h.includes(n.stage)?`收起任务`:`展开 ${n.total} 个任务`,"aria-expanded":h.includes(n.stage),onClick:()=>g(e=>e.includes(n.stage)?e.filter(e=>e!==n.stage):[...e,n.stage]),children:h.includes(n.stage)?`−`:`+`})]}),n.tasks.map((t,r)=>(0,A.jsxs)(`article`,{className:`card workflow-task`,style:{left:n.x+20,top:190+r*sd,width:ad,height:od},tabIndex:0,"aria-label":`打开任务:${t.title}`,onPointerDown:e=>e.stopPropagation(),onClick:()=>a(t),onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a(t))},children:[(0,A.jsx)(`div`,{className:`card-top`,children:(0,A.jsx)(`span`,{className:`badge status-${t.status}`,children:t.status})}),(0,A.jsx)(`div`,{className:`workflow-task-title`,title:t.title,children:t.title.startsWith(n.stage+` · `)?t.title.slice(n.stage.length+3):t.title}),(0,A.jsx)(`div`,{className:`card-footer`,children:(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`i`,{className:`avatar`,children:e(t.owner).slice(0,1)}),e(t.owner)]})})]},t.id))]},n.stage))]})]})]})}function ud(e,t,n,r){if(!r)return``;let i=e+rd/2,a=e+6,o=t+24,s=n+(r-1)*sd+od/2;return[`M${i} ${t} V${o-10} Q${i} ${o} ${i-10} ${o} H${a+10} Q${a} ${o} ${a} ${o+10} V${s-8}`,...Array.from({length:r},(t,i)=>{let o=n+i*sd+od/2;return i===r-1?`M${a} ${o-8} Q${a} ${o} ${a+8} ${o} H${e+20}`:`M${a} ${o} H${e+20}`})].join(` `)}async function dd(e,t){let n=await fetch(`/api/workbench/collaboration`+e,{method:t?`POST`:`GET`,...t?{headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}:{}}),r=await n.json();if(!n.ok)throw Error(r.error||`项目服务不可用`);return r}function fd({projectId:e,task:t,onClose:n}){let[r,i]=(0,k.useState)([]),[a,o]=(0,k.useState)(``),[s,c]=(0,k.useState)(!1),[l,u]=(0,k.useState)(``),[d,f]=(0,k.useState)(``),[p,m]=(0,k.useState)(null),[h,g]=(0,k.useState)(!0),_=(0,k.useRef)(!1),y=(0,k.useRef)(crypto.randomUUID()),b=(0,k.useRef)(!1),S=(0,k.useRef)(!0),C=(0,k.useRef)(null);ku(`task-agent-dialog`,()=>{b.current||n()}),(0,k.useEffect)(()=>{S.current=!0;let e=!1,t=async()=>{if(!e){e=!0;try{let e=await v({op:`status`});S.current&&(i(e.agents||[]),_.current||o(t=>t||(e.agents||[]).find(e=>e.verified)?.id||``))}catch(e){S.current&&u(e.message)}finally{e=!1}}};t();let n=setInterval(()=>void t(),2e3);return()=>{S.current=!1,clearInterval(n)}},[]),(0,k.useEffect)(()=>{let t=!0;return e&&v({op:`workspace-info`,resource:{namespace:`projects`,id:e}}).then(e=>{t&&e.workspace&&(m(e.workspace),!_.current&&e.workspace.defaultAgent&&o(e.workspace.defaultAgent))}).catch(e=>{t&&u(e.message)}),()=>{t=!1}},[e]);async function w(){if(!b.current){_.current=!0,b.current=!0,c(!0),u(``),f(``);try{{if(!e)throw Error(`请先选择项目`);if(C.current&&C.current.agent!==a)throw Error(`当前任务已准备交给原 Agent,请继续原目标`);let n={namespace:`projects`,id:e},r=await v({op:`workspace-ensure`,resource:n});if(!r.workspace)throw Error(`项目工作目录尚未就绪`);if(m(r.workspace),h&&await v({op:`workspace-default`,resource:n,agent:a}),!t){let e=`请在山海项目工作目录 ${r.workspace.cwd} 中开始本次对话。先核对实际工作目录,完整读取 AGENTS.md 和 PROJECT.json;简短报告实际目录、项目编号、项目名称及目标、当前真实对话编号。本次仅核对项目背景,不执行其他业务任务,不修改项目背景文件。`;await v({op:`launch`,agent:a,operationId:y.current+`-`+a,prompt:e,resource:n}),f(`已在所选 Agent 中打开项目对话。请发送提示词,后续任务也将进入此项目工作目录。`);return}if(!C.current){let n=await dd(`/query/execution/context?`+new URLSearchParams({projectId:e,taskId:t.id}));C.current={id:(await dd(`/command`,{op:`execution`,action:`prepare`,projectId:e,taskId:t.id,agent:a,expectedRevision:n.revision,requestId:crypto.randomUUID()})).data.run.id,agent:a,context:n.data}}let i=C.current,o=i.context;if(!window.omni)throw Error(`请通过山海桌面发起任务`);let s=await window.omni.info();if(!s.ok)throw Error(s.error);let c=s.value.channel===`dev`?`dev`:`stable`,l=`先核对当前工作目录为 ${r.workspace.cwd},读取其中 AGENTS.md 和 PROJECT.json,再继续任务。请通过山海 OMNI 完成指定任务。先运行 omni skill source --name omni-project --json,读取当前配套 Skill,使用当前山海授权。执行编号:${i.id};项目:${o.project.name}(${e});节点:第${o.node.position}个 ${o.node.name};任务:${t.title}(${t.id});配置的 Skill:${(o.task.skills?.length?o.task.skills:[o.task.skill||`未配置`]).join(`、`)}。\n先运行 omni execution context --run-id ${i.id} --profile ${c} --json 获取最新目标、任务说明、完成标准、依赖和 Wiki。按关联业务 Skill 执行,与用户沟通补充和修改,不编造缺失事实。当前真实会话编号从 ${a===`workbuddy`?`CODEBUDDY_SESSION_ID`:`CODEX_THREAD_ID`} 读取并核对,使用本次 Agent 自己的编号。实际开始时使用 execution start 登记 --agent ${a}、--skills 实际加载的准确Skill名称、--conversation-id 当前真实对话编号,并带 --yes --profile ${c} --json。成果使用 execution attach 上传;最终用 execution finish 的 --wiki 正文文件、--summary 结果摘要提交至原任务并回读。各命令先查 --help --json。缺少业务 Skill 或资料时说明缺口,保留任务状态;不要用计划冒充完成。`;await v({op:`launch`,agent:a,operationId:i.id,prompt:l,resource:n}),f(`已打开任务交接。请在 Agent 中发送提示词;Agent 登记开始后,任务将更新为进行中,结果通过 CLI 回写。`)}}catch(e){S.current&&u(e.message)}finally{b.current=!1,S.current&&c(!1)}}}return(0,A.jsx)(`div`,{className:`modal-backdrop`,children:(0,A.jsxs)(`section`,{id:`task-agent-dialog`,className:`modal task-agent-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`task-agent-title`,children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`h2`,{id:`task-agent-title`,children:t?`去完成任务`:`项目 Agent 设置`}),(0,A.jsx)(`button`,{type:`button`,disabled:s,onClick:n,children:`关闭`})]}),t&&(0,A.jsx)(`p`,{children:t.title}),(0,A.jsx)(`p`,{className:`muted`,children:`选择已在系统中绑定的 Agent 执行任务。业务 Skill 由目标 Agent 加载。`}),r.map(e=>(0,A.jsxs)(`label`,{className:`task-agent-choice`,children:[(0,A.jsx)(`input`,{type:`radio`,name:`local-agent`,value:e.id,checked:a===e.id,disabled:s,onChange:()=>{_.current=!0,o(e.id)}}),(0,A.jsx)(`strong`,{children:e.name}),(0,A.jsx)(`span`,{children:e.installed?e.verified?`已验证连接`:e.pending?`等待回传验证`:`已安装 · 未验证`:`未安装`})]},e.id)),p&&(0,A.jsxs)(`p`,{className:`muted`,children:[`项目工作目录:`,p.cwd]}),(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:h,disabled:s,onChange:e=>g(e.target.checked)}),`记住为此项目在本机的默认 Agent`]}),(0,A.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>{n(),x()},children:`管理系统 Agent`}),l&&(0,A.jsx)(`p`,{role:`alert`,className:`error`,children:l}),d&&(0,A.jsx)(`p`,{role:`status`,children:d}),(0,A.jsx)(`div`,{className:`modal-actions`,children:(0,A.jsx)(`button`,{className:`primary`,disabled:s||!r.some(e=>e.id===a&&e.verified),onClick:()=>void w(),children:s?`正在打开…`:t?`打开 Agent 完成任务`:`打开 Agent 项目`})})]})})}function pd({task:e,members:t,pages:n,artifacts:r,skillOptions:i,pendingFiles:a,onFiles:o,onOpenPage:s,busy:c,executionControls:l}){let[u,d]=(0,k.useState)(Array.isArray(e.skills)?e.skills:e.skill?[e.skill]:[]),f=e.origin===`template`||!!e.sourceTemplate||e.required===!0,[p,m]=(0,k.useState)(!1),h=[e.description,e.criteria].filter(Boolean).join(`
|
|
34
|
-
|
|
35
|
-
`),[g,_]=(0,k.useState)(h),[v,y]=(0,k.useState)(!1),[b,x]=(0,k.useState)(``),S=(0,k.useRef)(null),C=(0,k.useRef)(null),w=[...new Set([...i,...u])];async function ee(e,t,n){e.preventDefault(),e.stopPropagation(),x(``);try{let e=await fetch(`/api/workbench/collaboration/files/${encodeURIComponent(t)}`);if(!e.ok)throw Error(`附件读取失败,请检查连接后重试`);let r=URL.createObjectURL(await e.blob()),i=document.createElement(`a`);i.href=r,i.download=n,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch(e){x(e.message)}}return(0,k.useEffect)(()=>{if(!p)return;let e=e=>{S.current?.contains(e.target)||m(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[p]),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`label`,{className:`task-title-field`,children:[`任务名称 `,(0,A.jsx)(`span`,{className:`required-mark`,children:`*`}),(0,A.jsx)(`input`,{name:`title`,defaultValue:e.title,required:!0,maxLength:200,placeholder:`输入任务标题,最多 200 字`})]}),(0,A.jsxs)(`label`,{children:[`项目目标 `,(0,A.jsx)(`span`,{className:`required-mark`,children:`*`}),(0,A.jsx)(`textarea`,{value:g,onChange:e=>{_(e.target.value),y(!0)},required:!0,maxLength:Math.max(2e3,h.length),placeholder:`说明要完成的工作、期望结果和交付内容`})]}),(0,A.jsx)(`input`,{type:`hidden`,name:`description`,value:v?g:e.description||``}),(0,A.jsx)(`input`,{type:`hidden`,name:`criteria`,value:v?``:e.criteria||``}),(0,A.jsx)(`input`,{type:`hidden`,name:`startDate`,value:e.startDate||``}),(0,A.jsx)(`input`,{type:`hidden`,name:`dueDate`,value:e.dueDate||``}),(0,A.jsx)(`input`,{type:`hidden`,name:`priority`,value:e.priority||`中`}),(0,A.jsx)(`input`,{type:`hidden`,name:`stage`,value:e.stage}),(0,A.jsxs)(`label`,{children:[`负责人`,(0,A.jsx)(Uu,{name:`owner`,label:`负责人`,defaultValue:e.owner,children:t.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,A.jsxs)(`div`,{className:`task-field`,children:[(0,A.jsxs)(`span`,{id:`task-skills-label`,children:[`关联 Skill`,f&&(0,A.jsx)(`small`,{className:`muted`,children:` · 来自模板`})]}),(0,A.jsxs)(`div`,{className:`form-select`,ref:S,onKeyDown:e=>{e.key===`Escape`&&p&&(e.preventDefault(),e.stopPropagation(),m(!1),S.current?.querySelector(`button`)?.focus())},children:[u.map(e=>(0,A.jsx)(`input`,{type:`hidden`,name:`skills`,value:e},e)),(0,A.jsxs)(`button`,{type:`button`,className:`form-select-trigger`,"aria-labelledby":`task-skills-label`,"aria-expanded":p,disabled:c||f,onClick:()=>m(!p),children:[(0,A.jsx)(`span`,{children:u.length?u.join(`、`):`选择 Skill(可多选)`}),(0,A.jsx)($,{name:`chevronDown`,size:`indicator`})]}),p&&!f&&(0,A.jsx)(`div`,{className:`form-select-options task-skill-options`,role:`group`,"aria-label":`可选 Skill`,children:w.length?w.map(e=>(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:u.includes(e),onChange:t=>d(t.target.checked?[...u,e]:u.filter(t=>t!==e))}),(0,A.jsx)(`span`,{children:e})]},e)):(0,A.jsx)(`p`,{className:`muted`,children:`暂无可选 Skill`})})]})]}),(0,A.jsxs)(`section`,{className:`task-field task-output`,"aria-label":`产出附件`,children:[(0,A.jsx)(`span`,{children:`产出附件`}),(0,A.jsxs)(`button`,{type:`button`,className:`task-upload-button`,disabled:c,onClick:()=>C.current?.click(),children:[(0,A.jsx)($,{name:`attachment`}),`上传附件`]}),(0,A.jsx)(`input`,{ref:C,hidden:!0,type:`file`,multiple:!0,onChange:e=>{let t=Array.from(e.target.files||[]);t.some(e=>e.size>2*1024*1024)?x(`单个附件不能超过 2 MB`):x(``),o([...a,...t.filter(e=>e.size<=2*1024*1024).map(e=>({file:e,key:crypto.randomUUID()}))]),e.target.value=``}}),b&&(0,A.jsx)(`small`,{role:`alert`,className:`required-mark`,children:b}),n.filter(t=>t.path===e.wikiPath).map(t=>(0,A.jsxs)(`button`,{type:`button`,className:`task-document-link`,onClick:()=>s(t.path),children:[(0,A.jsx)($,{name:`document`}),(0,A.jsx)(`span`,{children:t.title||e.title})]},t.id)),r.filter(t=>t.taskId===e.id).map(e=>(0,A.jsxs)(`a`,{className:`task-document-link`,href:`/api/workbench/collaboration/files/${encodeURIComponent(e.id)}`,download:e.name,onClick:t=>void ee(t,e.id,e.name),children:[(0,A.jsx)($,{name:`attachment`}),(0,A.jsx)(`span`,{children:e.name}),(0,A.jsxs)(`small`,{children:[(e.size/1024).toFixed(1),` KB`]})]},e.id)),a.map(e=>(0,A.jsxs)(`div`,{className:`task-document-link`,children:[(0,A.jsx)($,{name:`attachment`}),(0,A.jsx)(`span`,{children:e.file.name}),(0,A.jsx)(`small`,{children:`待上传`}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:c,"aria-label":`移除 ${e.file.name}`,title:`移除 ${e.file.name}`,onClick:()=>o(a.filter(t=>t.key!==e.key)),children:(0,A.jsx)($,{name:`close`})})]},e.key)),e.isNew&&(0,A.jsx)(`small`,{children:`附件随任务创建后上传,任务文档创建后生成。`})]}),l]})}function md(){let[e,t]=(0,k.useState)([]),n=(0,k.useRef)(0),r=(0,k.useRef)(new Map);(0,k.useEffect)(()=>()=>{r.current.forEach(e=>e(null)),r.current.clear()},[]);let i=(e,i,a)=>new Promise(o=>{let s=++n.current;r.current.set(s,o),t(t=>[...t,{id:s,kind:e,title:i,message:a,resolve:o}])}),a=e[0];return{dialog:a,settle:e=>{a&&(r.current.delete(a.id),t(e=>e.filter(e=>e.id!==a.id)),a.resolve(e))},confirmDialog:async e=>await i(`confirm`,`确认操作`,e)!==null,informDialog:async e=>{await i(`notice`,`提示`,e)},inputDialog:e=>i(`input`,`确认删除`,e),showDocument:(e,t)=>i(`document`,t,e)}}function hd({dialog:e,onClose:t}){let[n,r]=(0,k.useState)(``);return(0,A.jsx)(`div`,{className:`modal-backdrop app-dialog-backdrop`,onMouseDown:()=>t(null),children:(0,A.jsxs)(`form`,{className:`modal app-dialog ${e.kind===`document`?`document-preview-dialog`:`compact-modal`}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`app-dialog-title`,"aria-describedby":e.kind===`document`?void 0:`app-dialog-message`,onMouseDown:e=>e.stopPropagation(),onSubmit:r=>{r.preventDefault(),t(e.kind===`input`?n:`confirmed`)},children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`h2`,{id:`app-dialog-title`,children:e.title}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`关闭弹窗`,title:`关闭弹窗`,onClick:()=>t(null),children:(0,A.jsx)($,{name:`close`})})]}),e.kind===`document`?(0,A.jsx)(`div`,{className:`markdown history-preview`,children:(0,A.jsx)(Xo,{remarkPlugins:[Tu],children:e.message})}):(0,A.jsx)(`p`,{id:`app-dialog-message`,className:`app-dialog-message`,children:e.message}),e.kind===`input`&&(0,A.jsxs)(`label`,{children:[`任务完整名称`,(0,A.jsx)(`input`,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),required:!0,autoComplete:`off`})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(e.kind===`confirm`||e.kind===`input`)&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>t(null),children:`取消`}),(0,A.jsx)(`button`,{className:`primary`,disabled:e.kind===`input`&&!n.trim(),children:e.kind===`document`||e.kind===`notice`?`关闭`:`确认`})]})]})})}var gd={"project.created":`创建项目`,"project.edited":`编辑项目`,"project.renamed":`修改项目名称`,"project.moved":`移动项目`,"project.pinned":`置顶项目`,"project.unpinned":`取消置顶`,"project.deleted":`删除项目`,"project.restored":`恢复项目`,"project.icon.updated":`更新项目图片`,"task.created":`创建任务`,"task.updated":`修改任务信息`,"task.deleted":`删除任务`,"task.restored":`恢复任务`,"task.start":`开始任务`,"task.complete":`完成任务`,"task.submit":`提交审核(历史)`,"task.approve":`审核通过`,"task.reject":`退回任务`,"task.block":`阻塞任务`,"task.unblock":`恢复执行`,"node.created":`创建阶段`,"node.renamed":`修改阶段名称`,"node.deleted":`删除阶段`,"node.restored":`恢复阶段`,"wiki.updated":`更新文档`,"board.reordered":`调整看板顺序`,"artifact.added":`上传附件`,"run.started":`开始 Agent 执行`,"run.finished":`更新执行结果`,"folder.created":`创建分组`,"folder.renamed":`修改分组名称`,"folder.deleted":`删除分组`,"directory.reordered":`调整目录顺序`,"measurement.added":`记录耗时`,"member.created":`添加成员`},_d={title:`任务标题`,name:`名称`,description:`任务目标`,goal:`项目目标`,owner:`负责人`,reviewer:`审核人`,priority:`优先级`,startDate:`开始时间`,dueDate:`截止时间`,status:`执行状态`,progress:`执行进度`,criteria:`完成标准`,skills:`关联 Skill`,skill:`关联 Skill`,stage:`所属阶段`,dependencies:`前置依赖`,folderId:`所属分组`};function vd(e,t){let n=e.details||{},r=[],i=[],a=e=>t.tasks.find(t=>t.id===e)?.title||`已删除任务`,o=(e,n)=>e===`folderId`?t.folders?.find(e=>e.id===n)?.name||(n?`已删除分组`:`未归档`):n==null||n===``||Array.isArray(n)&&!n.length?`未设置`:e===`owner`||e===`reviewer`?t.members.find(e=>e.id===n)?.name||`未知成员`:e===`dependencies`?n.map(a).join(`、`):e===`progress`?`${n}%`:Array.isArray(n)?n.join(`、`):String(n);if(n.taskId&&r.push(`任务:${n.title||n.after?.title||a(n.taskId)}`),n.before&&n.after)for(let[e,t]of Object.entries(_d))e===`skill`&&(n.before.skills||n.after.skills)||JSON.stringify(n.before[e])!==JSON.stringify(n.after[e])&&i.push({label:t,before:o(e,n.before[e]),after:o(e,n.after[e])});else if(e.type===`wiki.updated`){let a=t.pages.find(t=>t.projectId===e.projectId&&t.path===n.path);r.push(`文档:${a?.title||n.path||`项目文档`}`),n.version&&r.push(`保存为第 ${n.version} 版`),n.contentChange?(i.push({label:`文档正文`,before:n.contentChange.before,after:n.contentChange.after}),n.contentChange.truncated&&r.push(`正文对比仅展示前 20000 字符,完整内容请查看文档历史版本。`)):r.push(`历史记录未保存正文差异,可在文档中查看历史版本。`)}else e.type===`board.reordered`?(n.beforeNodes&&n.nodeOrder&&JSON.stringify(n.beforeNodes)!==JSON.stringify(n.nodeOrder)&&i.push({label:`阶段顺序`,before:n.beforeNodes.join(` → `),after:n.nodeOrder.join(` → `)}),n.tasks?.length&&r.push(`调整后任务顺序:${n.tasks.map(e=>`${a(e.id)}(${e.stage})`).join(` → `)}`)):e.type===`project.moved`?i.push({label:`所属分组`,before:o(`folderId`,n.fromFolderId),after:n.toFolderName||o(`folderId`,n.toFolderId)}):n.previousName===void 0?(n.name&&r.push(`名称:${n.name}`),n.stage&&r.push(`所属阶段:${n.stage}`),n.order!==void 0&&r.push(`位置:第 ${Number(n.order)+1} 个阶段`),n.taskCount!==void 0&&r.push(`初始化任务:${n.taskCount} 项`),n.taskIds?.length&&r.push(`关联任务:${n.taskIds.map(a).join(`、`)}`),e.type===`project.edited`&&r.push(`项目目标:${o(`goal`,n.goal)}`,`所属分组:${o(`folderId`,n.folderId)}`),n.skill&&r.push(`Skill:${n.skill}`),n.input&&r.push(`输入:${n.input}`),n.output&&r.push(`输出:${n.output}`),n.size!==void 0&&r.push(`文件大小:${(n.size/1024).toFixed(1)} KB`)):i.push({label:`名称`,before:n.previousName,after:n.name});return n.reason&&r.push(`原因:${n.reason===`folder.deleted`?`原分组已删除`:n.reason}`),e.type.startsWith(`run.`)&&(n.status&&r.push(`执行状态:${{running:`执行中`,completed:`已完成`,failed:`失败`}[n.status]||`未知状态`}`),n.skillVersion&&r.push(`Skill 版本:${n.skillVersion}`),n.quality&&r.push(`质量说明:${n.quality}`)),n.dependencyPolicy===`detach`&&r.push(`已解除关联的下游依赖。`),{title:gd[e.type]||`更新项目记录`,lines:r.length||i.length?r:[`操作已记录,历史记录未提供更多变更内容。`],changes:i}}function yd(e,t){let n=e.events.filter(e=>e.projectId===t),r=[...n,...e.notifications.filter(e=>e.projectId===t).map(e=>({id:`notification:${e.id}`,type:`notification`,projectId:t,createdAt:e.createdAt,notification:e}))];for(let i of e.runs.filter(e=>e.projectId===t&&!e.deletedAt))for(let e of[`run.started`,...i.endedAt?[`run.finished`]:[]])n.some(t=>t.type===e&&(t.details?.id===i.id||t.details?.runId===i.id))||r.push({id:`${i.id}:${e}`,actor:i.actor,type:e,projectId:t,createdAt:e===`run.started`?i.startedAt:i.endedAt,details:e===`run.started`?{...i,status:`running`,output:``,quality:``}:i});return r.sort((e,t)=>String(t.createdAt).localeCompare(String(e.createdAt)))}function bd(e,t){let n=e.details||{},r=t.members.find(t=>t.id===e.actor),i=t.runs.find(t=>t.id===(e.type.startsWith(`run.`)&&n.id||n.runId));if(!(e.type.startsWith(`run.`)||r?.role===`agent`||i))return{kind:`用户`,name:r?.name||`未知用户`};let a=n.ownerMemberId||i?.ownerMemberId||i?.actor||(e.type.startsWith(`run.`)?n.actor:null);return{kind:`Agent`,name:`Agent · 所属人:${t.members.find(e=>e.id===a&&e.role!==`agent`)?.name||`未记录`}`}}function xd({label:e,before:t,after:n}){let r=Array.from(t),i=Array.from(n),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a++;let o=0;for(;o<r.length-a&&o<i.length-a&&r[r.length-1-o]===i[i.length-1-o];)o++;let s=r.slice(0,a).join(``),c=o?r.slice(r.length-o).join(``):``,l=r.slice(a,r.length-o).join(``),u=i.slice(a,i.length-o).join(``);return(0,A.jsxs)(`div`,{className:`activity-change`,children:[(0,A.jsx)(`b`,{children:e}),(0,A.jsxs)(`div`,{className:`activity-change-line`,children:[(0,A.jsx)(`span`,{className:`change-label`,children:`修改前`}),(0,A.jsx)(`div`,{children:t?(0,A.jsxs)(A.Fragment,{children:[s,(0,A.jsx)(`del`,{children:l}),c]}):(0,A.jsx)(`span`,{className:`muted`,children:`空`})})]}),(0,A.jsxs)(`div`,{className:`activity-change-line`,children:[(0,A.jsx)(`span`,{className:`change-label`,children:`修改后`}),(0,A.jsx)(`div`,{children:n?(0,A.jsxs)(A.Fragment,{children:[s,(0,A.jsx)(`ins`,{children:u}),c]}):(0,A.jsx)(`span`,{className:`muted`,children:`空`})})]})]})}var Sd=`wiki/index.md`,Cd=[[`成交链路诊断 · 整理近期流量、转化与销售数据`,`近三场直播累计约 3,600 次观看、432 次商品点击、26 笔成交。商品点击率约 12%,点击后成交率约 6%。`,`下一轮按参考前后拆分点击与成交,重点观察折叠动作是否带动商品点击。`],[`成交链路诊断 · 对比历史表现和主要竞品`,`参考回看显示,先参考折叠和展开的场次,商品点击率比先讲规格的场次高约 3 个百分点。`,`下一场把折叠参考提前到开场,价格、优惠和投放保持一致,便于比较。`],[`优化目标 · 确认本轮要改善的核心指标`,`本轮优先验证商品点击率,参考基线为 12%,试验目标为 15%。同步记录点击后成交率,观察点击质量。`,`使用成交链路诊断的两份结论作为对照,测试完成后回填实测结果。`]];function wd(e,t){return`[${e.replace(/[\\[\]]/g,`\\$&`)}](<${t.split(`/`).map(encodeURIComponent).join(`/`)}>)`}var Td=`wiki/raw/README.md`,Ed=`wiki/queries/README.md`,Dd=`wiki/raw/近三场直播数据摘录.md`,Od=`wiki/queries/直播间商品点击率如何改善.md`;function kd(e,t,n){return{id:e,path:e,title:t,content:n,version:1,generated:!0}}function Ad(e){let t=(t,n)=>{let r=e.find(e=>e.taskTitle===Cd[t][0]);return r?wd(n,r.path):`${n}(当前尚无可归档结论)`};return{raw:[kd(Td,`README.md · 来源索引`,[`# 原始资料索引`,`> 本目录展示参考来源。入库后保留来源原件,按采集批次追加。`,`| 来源 | 采集方式 | 范围 | 用途 |\n| --- | --- | --- | --- |\n| ${wd(`近三场直播数据摘录`,Dd)} | 参考抖店导出及回看标注 | 三场直播 | 成交链路诊断、优化目标 | `].join(`
|
|
36
|
-
|
|
37
|
-
`)),kd(Dd,`近三场直播数据摘录.md`,[`# 近三场直播数据摘录`,`> 参考原始记录。场次、统计数和回看标注均为虚构。`,`| 场次 | 观看次数 | 商品点击 | 成交订单 | 回看标注 |
|
|
38
|
-
| --- | ---: | ---: | ---: | --- |
|
|
39
|
-
| A | 1,200 | 126 | 7 | 先讲规格 |
|
|
40
|
-
| B | 1,200 | 138 | 8 | 先讲规格 |
|
|
41
|
-
| C | 1,200 | 168 | 11 | 先参考折叠 |`,`统计口径为每场直播开始至结束。观看和点击均为次数。`,wd(`返回来源索引`,Td)].join(`
|
|
42
|
-
|
|
43
|
-
`))],queries:[kd(Od,`直播间商品点击率如何改善.md`,[`# 直播间商品点击率如何改善?`,`> 参考查询。用下面的路径核对现状、判断依据和下一轮验证目标。`,`1. 看现状。 ${t(0,`流量、点击与成交结论`)}。\n2. 找线索。 ${t(1,`历史场次与参考顺序对比`)}。\n3. 看怎么验证。 ${t(2,`本轮优化指标与目标`)}。\n4. 回查证据。 ${wd(`近三场直播数据摘录`,Dd)}。`,`比较场次时同时关注价格、优惠和投放条件。三场参考记录只用于提出待验证假设。`].join(`
|
|
44
|
-
|
|
45
|
-
`))]}}function jd(e,t){let n=new Map(e.map(e=>[e.path,e])),r=(t,n)=>{let r=new Map(n.map(e=>[e.path,e]));for(let n of e)n.path.startsWith(t)&&r.set(n.path,n);return[...r.values()]},i=(e,t,n,r)=>kd(e,t,[`# ${t}`,n.length?n.map(e=>`- ${wd(e.title,e.path)}`).join(`
|
|
46
|
-
`):r].join(`
|
|
47
|
-
|
|
48
|
-
`)),a=r(`wiki/raw/`,t?.raw||[]).filter(e=>e.path!==Td),o=r(`wiki/queries/`,t?.queries||[]).filter(e=>e.path!==Ed);return{raw:[n.get(Td)||t?.raw[0]||i(Td,`原始资料索引`,a,`暂无原始资料。入库时登记来源、采集时间及对应任务。`),...a],queries:[n.get(Ed)||i(Ed,`常用查询索引`,o,`暂无常用查询。将可复用的问题整理为查询页,并链接对应结论和证据。`),...o],maintenance:[n.get(`wiki/log.md`)||kd(`wiki/log.md`,`log.md · 维护日志`,[`# Wiki 维护日志`,t?`- 2026-11-07 · 按 SOP 节点组织任务结论,并建立节点索引。`:`当前目录和节点索引按项目 SOP 自动生成。`,t?`- 2026-11-07 · 增加 ${wd(`直播数据样例`,Dd)} 和 ${wd(`商品点击率查询入口`,Od)},供参考结论追溯。`:`暂无单独登记的来源入库或结论修订记录。`].join(`
|
|
49
|
-
|
|
50
|
-
`)),n.get(`wiki/SCHEMA.md`)||kd(`wiki/SCHEMA.md`,`SCHEMA.md · 结构规范`,[`# 项目 Wiki 结构规范`,`- 项目索引按 SOP 顺序导航。各节点维护自己的索引和任务结论。`,`- 任务完成且已有结论时归入对应节点。一项任务对应一份 Markdown,注明结论、依据、数据口径和后续动作。`,`- 原始资料按批次存入 raw/,在 README.md 登记来源、采集时间、范围和对应任务。`,`- 可复用问题放入 queries/,以链接关联结论和证据。`,`- log.md 记录来源入库、结论更替及索引维护。参考资料须显式标注。`].join(`
|
|
51
|
-
|
|
52
|
-
`))]}}function Md(e,t,n){if(!e)return null;let r=e.wikiLayout===`sop-example`,i=n.find(e=>e.path===Sd),a=e.stages.map((i,a)=>{let o=String(a+1).padStart(2,`0`),s=`${o}-${i.replace(/[\\/#?]/g,`-`)}`,c=`wiki/${s}`,l=t.filter(e=>!e.deletedAt&&e.stage===i),u=l.filter(e=>e.status===`已完成`),d=u.flatMap(e=>{let t=n.find(t=>t.path===e.wikiPath&&t.substantive);if(!t)return[];let a=e.title.startsWith(`${i} · `)?e.title.slice(i.length+3):e.title,o=`${a.replace(/[\\/#?]/g,`-`)}-${e.id}.md`,s=r&&t.content.includes(`> 参考结论,数据仅用于参考。`)?Dd:void 0;return[{...t,path:`${c}/${o}`,sourcePath:t.path,taskTitle:e.title,title:a,filename:o,evidencePath:s}]}),f=e.nodeDetails?.[e.nodeIds?.[i]],p=d.length?d.map(e=>`- ${wd(e.title,e.filename)}`).join(`
|
|
53
|
-
`):`这个节点还没有可归档的任务结论。`,m=u.length-d.length,h=[`# ${o} ${i}`,wd(`返回项目索引`,`../index.md`),f?.description,f?.output&&`**节点交付** ${f.output}`,`已完成 ${u.length} / ${l.length} 项任务 · 已归档 ${d.length} 份结论`,`## 任务结论\n\n${p}`,m>0&&`另有 ${m} 项已完成任务等待补充结论。`].filter(Boolean).join(`
|
|
54
|
-
|
|
55
|
-
`);return{name:s,path:c+`/`,index:kd(`${c}/index.md`,`index.md · 节点索引`,h),results:d}}),o=a.flatMap(e=>e.results),s=jd(n,r?Ad(o):null),c=new Set([Sd,...s.raw.map(e=>e.path),...s.queries.map(e=>e.path),...s.maintenance.map(e=>e.path)]),l=new Set(o.map(e=>e.sourcePath)),u=n.filter(e=>!c.has(e.path)&&!l.has(e.path));i&&u.unshift({...i,path:`wiki/_overview/项目概览.md`,sourcePath:Sd});let d=a.map(e=>`- ${wd(e.name,`${e.name}/index.md`)} · ${e.results.length} 份结论`).join(`
|
|
56
|
-
`),f=kd(Sd,`index.md · 项目索引`,[`# ${e.name} · 项目 Wiki`,r&&`> 参考项目。直播记录和示例结论均为参考资料。`,e.goal,`## SOP 节点\n\n${d||`暂无节点。`}`,`## 查资料与查问题\n\n- ${wd(`原始资料与来源索引`,Td)}\n- ${wd(`常用查询`,Ed)}`,`## Wiki 维护\n\n- ${wd(`维护日志`,`log.md`)}\n- ${wd(`结构规范`,`SCHEMA.md`)}`,i&&wd(`原项目概览`,`wiki/_overview/项目概览.md`),u.some(e=>e.sourcePath!==Sd)&&`另有工作记录及其他文档,可在左侧目录展开查看。`].filter(Boolean).join(`
|
|
57
|
-
|
|
58
|
-
`));return{index:f,folders:a,extra:u,references:s,documents:[f,...a.flatMap(e=>[e.index,...e.results]),...u,...s.raw,...s.queries,...s.maintenance]}}function Nd(e,t){if(/^(?:[a-z][a-z\d+.-]*:|\/\/|#)/i.test(e))return null;let n=`https://workspace.invalid/`,r=new URL(e,e.startsWith(`wiki/`)?n:new URL(t,n)),i;try{i=decodeURIComponent(r.pathname.slice(1))}catch{return null}return!i.startsWith(`wiki/`)||!i.endsWith(`.md`)||i.split(`/`).some(e=>e===`.`||e===`..`)?null:i}function Pd({open:e=!1,size:t=`small`}){return(0,A.jsx)($,{name:e?`folderOpen`:`folder`,size:t})}function Fd({size:e=`small`}){return(0,A.jsx)($,{name:`project`,size:e})}function Id({task:e}){let t=[...new Set((Array.isArray(e.skills)?e.skills:e.skill?[e.skill]:[]).filter(Boolean))];return(0,A.jsxs)(`div`,{className:`task-skill-label`,"aria-label":`关联 Skill:${t.join(`、`)||`未关联`}`,children:[(0,A.jsx)(`span`,{children:`Skill`}),(0,A.jsx)(`span`,{children:t.join(`、`)||`未关联`})]})}function Ld(){try{let e=JSON.parse(localStorage.getItem(`projects.collaboration.collapsed-project-groups`)||`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function Rd(){let{fetch:e,platformIdentity:t}=fe(),{onDirty:n,onBusy:r}=ee(),{dialog:i,settle:s,confirmDialog:c,informDialog:l,showDocument:u}=md(),[d,f]=(0,k.useState)(()=>{try{return localStorage.getItem(`projects.collaboration.proawork-project-home-view`)===`cards`?`cards`:`list`}catch{return`list`}});function p(e){f(e);try{localStorage.setItem(`projects.collaboration.proawork-project-home-view`,e)}catch{}}let[m,h]=(0,k.useState)(`board`),[g,_]=(0,k.useState)(null),[y,b]=(0,k.useState)(!1),[x,S]=(0,k.useState)(null),[C,w]=(0,k.useState)(!1),E=(0,k.useRef)(null),D=(0,k.useRef)(null),te=(0,k.useRef)(0),ne=(0,k.useRef)(``),re=(0,k.useRef)(null),ie=(0,k.useRef)(!1),O=(0,k.useRef)(null),ae=(0,k.useRef)(new Set),oe=(0,k.useRef)(new URLSearchParams(location.search).get(`project`)),se=(0,k.useRef)(new URLSearchParams(location.search).get(`page`)),ce=(0,k.useRef)(null),le=(0,k.useRef)(!1),j=(0,k.useRef)(null);(0,k.useEffect)(()=>()=>{te.current++,D.current?.cancel()},[]);async function ue(e,t,n){let r=++te.current;D.current?.cancel();let i=E.current;if(!t||!i?.animate||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){e();return}let a=i.animate([{opacity:1,transform:`translateX(0)`},{opacity:0,transform:`translateX(${n*16}px)`}],{duration:110,easing:`ease-in`,fill:`forwards`});D.current=a;try{await a.finished}catch{return}if(r!==te.current)return;(0,Eu.flushSync)(e),a.cancel();let o=i.animate([{opacity:0,transform:`translateX(${-n*20}px)`},{opacity:1,transform:`translateX(0)`}],{duration:210,easing:`cubic-bezier(0.2, 0.7, 0.2, 1)`});D.current=o;try{await o.finished}catch{return}r===te.current&&(D.current=null)}let[M,pe]=(0,k.useState)(null),[N,me]=(0,k.useState)(null),[P,he]=T(`projects.collaboration.project`,``),[ge,_e]=T(`projects.collaboration.tab`,`看板`),[ve,ye]=(0,k.useState)(t().memberId),[be,F]=(0,k.useState)(``),[I,xe]=(0,k.useState)(null),[Se,L]=(0,k.useState)([]),[R,Ce]=(0,k.useState)(!1),[z,B]=(0,k.useState)(`待开始`),[V,we]=(0,k.useState)(`wiki/index.md`),[H,Te]=(0,k.useState)(null),[Ee,De]=(0,k.useState)(!1),[Oe,ke]=(0,k.useState)(!1),[Ae,je]=(0,k.useState)(``),[Me,Ne]=(0,k.useState)([]),[U,Pe]=(0,k.useState)(!1),[Fe,Ie]=(0,k.useState)(`全部`),[Le,Re]=(0,k.useState)(null),[ze,Be]=(0,k.useState)(null),[Ve,He]=(0,k.useState)(null),[Ue,We]=(0,k.useState)(``),[Ge,Ke]=(0,k.useState)(``),[qe,Je]=(0,k.useState)(``),[Ye,Xe]=(0,k.useState)(!1),[Ze,Qe]=(0,k.useState)(!1),[$e,et]=(0,k.useState)(null),[tt,nt]=(0,k.useState)(``),[rt,it]=(0,k.useState)(null),[at,ot]=(0,k.useState)(``),[st,ct]=(0,k.useState)(!1),[lt,ut]=(0,k.useState)(``),[dt,ft]=(0,k.useState)(null),[pt,mt]=(0,k.useState)(null),[ht,gt]=(0,k.useState)(``),[_t,vt]=(0,k.useState)(!1),[yt,bt]=(0,k.useState)(``),[xt,St]=(0,k.useState)(null),[Ct,wt]=(0,k.useState)(null),[Tt,Et]=(0,k.useState)(``),[Dt,Ot]=(0,k.useState)(``),[kt,At]=(0,k.useState)([``]),[jt,Mt]=(0,k.useState)(null),[Nt,Pt]=(0,k.useState)(null),[Ft,It]=(0,k.useState)(null),[Lt,Rt]=(0,k.useState)(null),[zt,Bt]=T(`projects.collaboration.home`,!0),[W,Vt]=T(`projects.collaboration.directory`,null),[Ht,Ut]=(0,k.useState)(``),[Wt,Gt]=(0,k.useState)(`all`),[Kt,qt]=(0,k.useState)(!1),[Jt,Yt]=(0,k.useState)([]),[Xt,Zt]=(0,k.useState)(`completed`),[G,Qt]=(0,k.useState)(null),[$t,en]=(0,k.useState)(null),[tn,nn]=(0,k.useState)(``),[rn,an]=(0,k.useState)(localStorage.getItem(`projects.collaboration.project-directory-collapsed`)===`true`),[on,sn]=(0,k.useState)(Ld),[K,cn]=(0,k.useState)(()=>{let e=Number(localStorage.getItem(`projects.collaboration.menu-width`));return Number.isFinite(e)&&e>=190&&e<=420?e:208});(0,k.useEffect)(()=>{let e=M&&!M.authenticated?{state:`error`,message:M.authenticationMessage||`请返回 山海 · OMNI 登录后重试。`}:N?{state:`ready`,message:``}:be?{state:`error`,message:`项目加载失败,请重新加载。`}:{state:`loading`,message:M?`正在读取项目与工作进度…`:`正在确认登录与企业身份…`},t=()=>{window.parent!==window&&window.parent.postMessage({type:`proawork:workbench-startup`,...e},window.location.origin)},n=e=>{e.origin===window.location.origin&&e.source===window.parent&&e.data?.type===`proawork:workbench-startup-request`&&t()};return window.addEventListener(`message`,n),t(),()=>window.removeEventListener(`message`,n)},[M,N,be]),ku(g?``:i?`app-dialog:${i.id}`:Ve?`stage-edit`:$e?`share`:rt?`quick-create`:G?`restore`:st?`delete`:Ct?`move`:xt?`rename`:Ze?``:I?`task:${I.id}`:``,()=>{if(i){s(null);return}U||(Ve?He(null):$e?et(null):rt?it(null):G?Qt(null):st?ct(!1):Ct?wt(null):xt||Ze?pr():Nn())}),(0,k.useEffect)(()=>{Ie(`全部`),Re(null),Je(``)},[P]),(0,k.useEffect)(()=>{Le&&(ce.current?.scrollIntoView({block:`nearest`,inline:`end`,behavior:`instant`}),ce.current?.focus({preventScroll:!0}),ce.current?.select())},[Le]);function ln(){if(le.current)return;let e=N.projects.find(e=>e.id===P);e&&_({kind:`node`,project:e})}(0,k.useEffect)(()=>{if(!ze)return;let e=e=>{e.target.closest(`.stage-action-menu, .stage-menu-trigger`)||Be(null)},t=()=>Be(null),n=e=>{e.key===`Escape`&&(t(),ze.trigger?.focus())};return window.addEventListener(`pointerdown`,e),window.addEventListener(`scroll`,t,!0),window.addEventListener(`resize`,t),window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`scroll`,t,!0),window.removeEventListener(`resize`,t),window.removeEventListener(`keydown`,n)}},[ze]);async function un(){!Ve||U||!Ue.trim()||await X(async()=>{let e=await J(`/v1/projects/${Ve.projectId}/node-create-context`),t={previousName:Ve.name,name:Ue.trim(),contextToken:e.contextToken},n=await J(`/v1/projects/${Ve.projectId}/nodes/rename-preview`,`POST`,t);if(await J(`/v1/projects/${Ve.projectId}/nodes/name`,`PATCH`,{...t,impactHash:n.impactHash},{"idempotency-key":crypto.randomUUID()}),!(await J(`/v1/projects/${Ve.projectId}/node-create-context`)).nodes.some(e=>e.name===t.name))throw Error(`阶段名称未能确认,请刷新后查看。`);He(null)})}async function dn(){if(!Le||!Ge.trim()||le.current)return;let e=Le,t=Ge.trim();le.current=!0,Xe(!0),Je(``);try{if(j.current?.name!==t||j.current?.projectId!==e){let n={contextToken:(await J(`/v1/projects/${e}/node-create-context`)).contextToken,name:t};await J(`/v1/projects/${e}/nodes/preview`,`POST`,n),j.current={projectId:e,name:t,body:n,key:crypto.randomUUID()}}await J(`/v1/projects/${e}/nodes`,`POST`,j.current.body,{"idempotency-key":j.current.key}),Re(null),await Y()}catch(e){Je(e.message),e.code===`PROJECT_STATE_CHANGED`&&(j.current=null)}finally{le.current=!1,Xe(!1)}}function fn(e,t){if(e===`node`){ln();return}if(e===`task`){Pn(t||Z?.stages[0]||``);return}F(``),ot(``),it({kind:e,stage:t})}async function q(){if(!rt||!at.trim()||U)return;let e=at.trim();await X(async()=>{if(rt.kind===`node`){let t={contextToken:(await J(`/v1/projects/${P}/node-create-context`)).contextToken,name:e};await J(`/v1/projects/${P}/nodes/preview`,`POST`,t),await J(`/v1/projects/${P}/nodes`,`POST`,t,{"idempotency-key":crypto.randomUUID()})}else if(rt.kind===`task`)await J(`/tasks`,`POST`,{projectId:P,title:e,stage:rt.stage,owner:ve});else{let t=`wiki/${Date.now()}-${e.replace(/[\\/]/g,`-`)}.md`;await J(`/projects/${P}/wiki`,`PUT`,{path:t,title:e,content:`# ${e}\n\n`}),we(t)}it(null)})}(0,k.useEffect)(()=>(n(Oe||!!I||!!Ve||!!Ze),()=>n(!1)),[Oe,I,Ve,Ze,n]),(0,k.useEffect)(()=>(r(U),()=>r(!1)),[U,r]),(0,k.useEffect)(()=>{let e=()=>{N&&o()&&Qe(!0)};return e(),a(e)},[N]);async function J(t,n=`GET`,r,i={}){let a=await e(`/api`+t,{method:n,headers:{"x-actor":ve,...r instanceof FormData?{}:{"content-type":`application/json`},...i},body:r===void 0?void 0:r instanceof FormData?r:JSON.stringify(r)}),o=await a.json();if(a.status===401&&pe({authenticated:!1,mode:`proawork`}),!o.ok)throw Object.assign(Error(o.error.message),{code:o.error.code});return o.data}async function Y(){let e=t();if(pe(e),!e.authenticated)return;ye(e.memberId);let n=await J(`/state`);if(me(n),oe.current){let e=oe.current;oe.current=null,n.projects.some(t=>t.id===e)?(he(e),Bt(!1),qt(!1),_e(se.current?`Wiki`:`看板`),se.current&&we(se.current),se.current=null):(Bt(!0),F(`分享的项目不存在、已删除或无法访问。`));let t=new URL(location.href);t.searchParams.delete(`project`),t.searchParams.delete(`page`),history.replaceState(history.state,``,t.pathname+t.search+t.hash)}else he(e=>n.projects.some(t=>t.id===e)?e:n.projects[0]?.id||``);xe(e=>e?.isNew?e:e?n.tasks.find(t=>t.id===e.id):null)}async function X(e){Pe(!0),F(``);try{await e(),await Y()}catch(e){F(e.message)}finally{Pe(!1)}}(0,k.useEffect)(()=>{ge===`提效验证`&&_e(`看板`),(ge===`Agent 运行`||ge===`消息`)&&_e(`活动记录`)},[ge]),(0,k.useEffect)(()=>{e(`/api/auth/session`,{headers:{"x-actor":ve}}).then(async e=>{let t=await e.json();if(!t.ok)throw Error(t.error.message);pe(t.data),t.data.authenticated&&(t.data.memberId&&ye(t.data.memberId),await Y())}).catch(e=>F(e.message))},[]),(0,k.useEffect)(()=>{if(!M?.authenticated||I||Ee)return;let e=()=>{Y().catch(()=>{}),P&&ge===`Wiki`&&J(`/projects/${P}/wiki?path=${encodeURIComponent(V)}`).then(Te).catch(()=>{})},t=t=>{t.key?.startsWith(`proawork-project-workbench:v1:`)&&e()},n=setInterval(e,5e3);return window.addEventListener(`storage`,t),()=>{clearInterval(n),window.removeEventListener(`storage`,t)}},[M?.authenticated,I,Ee,P,ge,V]),(0,k.useEffect)(()=>{localStorage.setItem(`projects.collaboration.menu-width`,String(K))},[K]),(0,k.useEffect)(()=>{localStorage.setItem(`projects.collaboration.project-directory-collapsed`,String(rn)),localStorage.setItem(`projects.collaboration.collapsed-project-groups`,JSON.stringify(on))},[rn,on]),(0,k.useEffect)(()=>{if(!jt)return;let e=document.activeElement,t=document.querySelector(`.project-context-menu`);t?.querySelector(`[role="menuitem"]`)?.focus();let n=()=>Mt(null),r=r=>{if(r.key===`Escape`&&(r.preventDefault(),n(),e?.focus()),![`ArrowDown`,`ArrowUp`].includes(r.key)||!t?.contains(document.activeElement))return;r.preventDefault();let i=Array.from(t.querySelectorAll(`[role="menuitem"]`)).filter(e=>e.getClientRects().length>0);i[(i.indexOf(document.activeElement)+(r.key===`ArrowDown`?1:-1)+i.length)%i.length]?.focus()};return window.addEventListener(`click`,n),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`click`,n),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`keydown`,r)}},[jt]),(0,k.useEffect)(()=>{P&&ge===`Wiki`&&J(`/projects/${P}/wiki?path=${encodeURIComponent(V)}`).then(e=>{Te(e),ke(!1),De(!1)}).catch(e=>{Te(null),F(e.message)})},[P,ge,V]);let Z=N?.projects.find(e=>e.id===P),pn=N?.tasks.filter(e=>e.projectId===P)||[],mn=N?.pages.filter(e=>e.projectId===P)||[],Q=e=>N?.members.find(t=>t.id===e)?.name||e,hn=ge===`Wiki`?Md(Z,pn,mn):null;N?.members.find(e=>e.id===(M?.mode===`development`?ve:M?.memberId)),M?.mode;let gn=[...N?.folders||[]].sort((e,t)=>Number(!!t.pinned)-Number(!!e.pinned)||(e.directoryOrder??2**53-1)-(t.directoryOrder??2**53-1)),_n=new Set(gn.map(e=>e.id)),vn=[...N?.projects||[]].sort((e,t)=>(e.directoryOrder??2**53-1)-(t.directoryOrder??2**53-1)),yn=[{id:`__pinned__`,name:`置顶`,pinned:!0},{id:``,name:`未归档`},...gn.map(e=>({id:e.id,name:e.name,folderPinned:!!e.pinned}))].map(e=>({...e,projects:vn.filter(t=>e.pinned?t.pinned:t.pinned?!1:e.id?t.folderId===e.id:!t.folderId||!_n.has(t.folderId))})).filter(e=>!e.pinned||e.projects.length>0),bn=[`root`,...yn.flatMap(e=>[`directory:${e.id}`,...e.projects.map(t=>`project:${e.id}:${t.id}`)]),`trash`];function xn(e){let t=ne.current;return t.endsWith(`:${e}`)&&bn.includes(t)?t:`project:${yn.find(t=>t.projects.some(t=>t.id===e))?.id||``}:${e}`}function Sn(e){let t=Kt?`trash`:zt?W===null?`root`:`directory:${W}`:xn(P),n=bn.indexOf(t),r=bn.indexOf(e);return n>=0&&r>=0&&r<n?1:-1}let Cn=e=>{let t=N?.tasks.filter(t=>t.projectId===e)||[],n=t.filter(e=>e.status===`已完成`).length;return{completed:n,total:t.length,percent:t.length?Math.round(n/t.length*100):0}},wn=W===null?vn:yn.find(e=>e.id===W)?.projects||[],Tn=W===null?`电商工作台`:yn.find(e=>e.id===W)?.name||`项目目录`,En=Z?.pinned?`__pinned__`:gn.some(e=>e.id===Z?.folderId)?Z.folderId:``,Dn=yn.find(e=>e.id===En)?.name||`未归档`,On=wn.filter(e=>(Wt!==`pinned`||e.pinned)&&`${e.name} ${e.goal||``}`.toLocaleLowerCase().includes(Ht.trim().toLocaleLowerCase())),kn=e=>e?new Date(e).toLocaleString(`zh-CN`,{hour12:!1}):`—`,An=e=>e===`已完成`?`完成`:e===`已阻塞`?`进行中`:e;async function jn(e){Oe&&!await c(`正文尚未保存,确认离开?`)||(ke(!1),_e(e))}function Mn(e){ie.current||(L([]),O.current=null,ae.current=new Set,F(``),xe(e),Ce(!1),B(e.status===`已阻塞`?`进行中`:e.status))}function Nn(){ie.current||(xe(null),Ce(!1))}function Pn(e){let t=N.projects.find(e=>e.id===P);t&&_({kind:`task`,project:t,stage:e})}async function Fn(e){if(g){await J(`/v1/projects/${g.project.id}/template-add`,`POST`,e),_(null);try{await Y()}catch{F(`创建内容已保存,请刷新工作台查看,勿重复添加。`)}}}function In(){Ln(null)}async function Ln(e){Oe&&!await c(`正文尚未保存,确认返回首页?`)||ue(()=>{Vt(e),Gt(`all`),Ut(``),ke(!1),xe(null),qt(!1),Bt(!0)},!zt||W!==e,Sn(e===null?`root`:`directory:${e}`))}async function Rn(){if(!(Oe&&!await c(`正文尚未保存,确认打开回收站?`))){ue(()=>{ke(!1),xe(null),Bt(!1),qt(!0)},!Kt,Sn(`trash`)),Pe(!0),F(``);try{Yt(await J(`/v1/trash`))}catch(e){F(e.message)}finally{Pe(!1)}}}async function zn(e){Pe(!0),F(``);try{let t=await J(`/v1/trash/${encodeURIComponent(e.id)}/restore-preview`,`POST`,{});if(!t.canRestore){await l(t.conflict?.type===`node`?`无法恢复:项目中已存在同名节点“${t.conflict.name}”。`:t.conflict?.type===`task`?`无法恢复:项目中已存在同名任务“${t.conflict.items.map(e=>e.title).join(`、`)}”。`:`无法恢复:项目中已存在同名任务“${t.conflict.title}”。`);return}Qt(e),en(t),nn(``)}catch(e){F(e.message)}finally{Pe(!1)}}async function Bn(){let e=G?.scopeType===`node`?G.nodeName:G?.taskTitle;if(!(!G||tn!==e)){Pe(!0),F(``);try{await J(`/v1/trash/${encodeURIComponent(G.id)}/restore`,`POST`,G.scopeType===`node`?{confirmNode:tn}:{confirmTask:tn},{"idempotency-key":crypto.randomUUID()}),await Y(),Yt(await J(`/v1/trash`)),Qt(null),en(null),nn(``)}catch(e){F(e.message)}finally{Pe(!1)}}}function Vn(e){sn(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}async function Hn(e){he((await J(`/v1/projects`,`POST`,{...e,type:`product`,mode:`agent`},{"idempotency-key":crypto.randomUUID()})).project.id),Bt(!1),qt(!1),_e(`看板`),we(`wiki/index.md`),Qe(!1);try{await Y()}catch{F(`项目已创建,请刷新工作台查看,勿重复创建。`)}}async function Un(){!dt||lt!==dt.name||await X(async()=>{await J(`/v1/projects/by-name`,`DELETE`,{expectedName:dt.name},{"idempotency-key":crypto.randomUUID()}),P===dt.id&&he(``),ct(!1),ut(``),ft(null)})}async function Wn(e){ft(e),ut(``),ct(!0)}let Gn=(0,k.useRef)(null),Kn=(0,k.useRef)(!1),qn=(0,k.useRef)(!1),Jn=(0,k.useRef)(null);function Yn(){Kn.current||(mt(null),bt(``),gt(``),qn.current=!1,Jn.current=null)}(0,k.useEffect)(()=>{if(!Nt)return;let e=e=>{e.target.closest(`.folder-action-menu, .folder-menu-trigger`)||Pt(null)},t=()=>Pt(null),n=e=>{e.key===`Escape`&&(e.preventDefault(),t(),Nt.trigger?.focus())};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,n),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,n),window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[Nt]);function Xn(e){pt||Kn.current||(an(!1),mt(e?gn.find(t=>t.id===e.id)||e:{id:null}),bt(e?.name||`新建分组`),gt(``),Jn.current=null,qn.current=!1)}async function Zn(e=!1){if(!pt||Kn.current)return;let t=yt.trim();if(!t){e?Yn():gt(`请输入分组名称`);return}let n=e=>e.trim().normalize(`NFKC`).replace(/\s+/g,` `).toLocaleLowerCase(`zh-CN`);if(gn.some(e=>e.id!==pt.id&&n(e.name)===n(t))||qn.current){e?Yn():(qn.current=!0,gt(`分组名称已存在,请修改名称`));return}if(pt.id&&t===pt.name){mt(null);return}let r=JSON.stringify([pt.id,t]);Jn.current?.signature!==r&&(Jn.current={signature:r,key:crypto.randomUUID()}),Kn.current=!0,vt(!0),gt(``);try{await J(pt.id?`/project-folders/${pt.id}`:`/project-folders`,pt.id?`PATCH`:`POST`,{name:t,updatedAt:pt.updatedAt},{"idempotency-key":Jn.current.key}),mt(null),await Y()}catch(t){qn.current=t.code===`FOLDER_NAME_CONFLICT`,e&&qn.current?(mt(null),bt(``),gt(``),Jn.current=null,qn.current=!1):gt(t.message)}finally{Kn.current=!1,vt(!1)}}(0,k.useEffect)(()=>{if(!pt)return;let e=e=>{Gn.current?.contains(e.target)||Zn(!0)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[pt,yt,N]);function Qn(){return(0,A.jsxs)(`div`,{className:`folder-inline-editor`,ref:Gn,children:[(0,A.jsxs)(`div`,{className:`folder-inline-row`,children:[(0,A.jsx)(Pd,{}),(0,A.jsx)(`input`,{"aria-label":`分组名称`,"aria-invalid":!!ht,autoFocus:!0,onFocus:e=>e.currentTarget.select(),value:yt,disabled:_t,onChange:e=>{bt(e.target.value),gt(``),qn.current=!1},onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Enter`&&(e.preventDefault(),Zn()),e.key===`Escape`&&(e.preventDefault(),Yn()))}}),(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`完成命名`,title:`完成`,disabled:_t,onClick:()=>void Zn(),children:(0,A.jsx)($,{name:`check`})}),(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`取消命名`,title:`取消`,disabled:_t,onClick:Yn,children:(0,A.jsx)($,{name:`close`})})]}),ht&&(0,A.jsx)(`small`,{role:`alert`,children:ht})]})}async function $n(e){let t=gn.find(t=>t.id===e.id);t&&await c(`删除分组「${e.name}」?其中的项目将移至未归档,不会删除项目。`)&&await X(async()=>{await J(`/project-folders/${e.id}`,`DELETE`,{updatedAt:t.updatedAt},{"idempotency-key":crypto.randomUUID()}),W===e.id&&Vt(null)})}async function er(e){try{let t=await J(`/v1/projects/${P}/nodes/${encodeURIComponent(e)}/delete-context`);if(t.impact.node.contentTaskCount>0&&!t.permissions.canDeleteWithContent){await l(`该节点包含已有产出的任务,请联系管理员执行可恢复删除。`);return}let n=`detach`;if(!await c(`确认删除节点“${e}”${t.impact.node.taskCount?`,同时归档其中 ${t.impact.node.taskCount} 个任务及其知识资料`:``}?删除后可在回收站恢复。`))return;let r=await J(`/v1/projects/${P}/nodes/${encodeURIComponent(e)}/delete-preview`,`POST`,{contextToken:t.contextToken,dependencyPolicy:n});await X(()=>J(`/v1/projects/${P}/nodes/${encodeURIComponent(e)}`,`DELETE`,{contextToken:t.contextToken,impactHash:r.impactHash,confirmNode:e,dependencyPolicy:n},{"idempotency-key":crypto.randomUUID()}))}catch(e){F(e.message)}}async function tr(e){try{let t=await J(`/v1/projects/${e.projectId}/tasks/${e.id}/delete-context`);if(e.contentStatus!==`empty`&&!t.permissions.canDeleteWithContent){await l(`该任务已有产出,请联系管理员执行可恢复删除。`);return}let n=`detach`,r=await J(`/v1/projects/${e.projectId}/tasks/${e.id}/delete-preview`,`POST`,{contextToken:t.contextToken,dependencyPolicy:n});if(!await c(`确定删除任务「${e.title}」吗?删除后可在回收站恢复。`))return;await X(async()=>{await J(`/v1/projects/${e.projectId}/tasks/${e.id}`,`DELETE`,{contextToken:t.contextToken,impactHash:r.impactHash,confirmTask:e.title,dependencyPolicy:n},{"idempotency-key":crypto.randomUUID()}),xe(null)})}catch(e){F(e.message)}}function nr(e){return Fe===`全部`?!0:Fe===`我的任务`?e.owner===ve:Fe===`完成`?e.status===`已完成`:Fe===e.status}function rr(e){return pn.map((e,t)=>({item:e,index:t})).filter(({item:t})=>t.stage===e).sort((e,t)=>(e.item.boardOrder??e.index)-(t.item.boardOrder??t.index)).map(({item:e})=>e)}function ir(){return Object.fromEntries(Z.stages.map(e=>[e,rr(e)]))}async function ar(e,t){await X(()=>J(`/projects/${P}/board/order`,`PUT`,{nodeOrder:e,tasks:e.flatMap(e=>(t[e]||[]).map(t=>({id:t.id,stage:e})))},{"idempotency-key":crypto.randomUUID()}))}function or(e,t){e.stopPropagation(),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`application/x-project-board`,JSON.stringify(t)),e.dataTransfer.setData(`text/plain`,JSON.stringify(t)),It(t),Rt(null)}function sr(){It(null),Rt(null)}async function cr(e,t){if(Ft?.kind!==`node`||Ft.stage===e){sr();return}let n=[...Z.stages],r=n.indexOf(Ft.stage);if(r<0)return sr();let[i]=n.splice(r,1),a=n.indexOf(e);n.splice(a+ +(t===`after`),0,i);let o=ir();sr(),await ar(n,o)}async function lr(e,t=``,n=`after`){if(Ft?.kind!==`task`||t&&Ft.id===t)return sr();let r=ir(),i=null;for(let e of Z.stages){let t=r[e].findIndex(e=>e.id===Ft.id);t>=0&&([i]=r[e].splice(t,1))}if(!i)return sr();let a=r[e],o=t?a.findIndex(e=>e.id===t):a.length;o<0?o=a.length:t&&n===`after`&&o++,a.splice(o,0,i),sr(),await ar(Z.stages,r)}async function ur(){!Ct||U||await X(async()=>{await J(`/v1/projects/${Ct.id}/folder`,`PATCH`,{folderId:Tt||null},{"idempotency-key":crypto.randomUUID()}),wt(null)})}async function dr(e){Mt(null),await X(()=>J(`/v1/projects/${e.id}/pin`,`PATCH`,{pinned:!e.pinned},{"idempotency-key":crypto.randomUUID()}))}function fr(e){Mt(null),F(``),St(e)}function pr(){U||(Qe(!1),St(null))}async function mr(e){if(!xt)return;await J(`/v1/projects/${xt.id}/details`,`PATCH`,{...e,contextToken:String(xt.version||0)},{"idempotency-key":crypto.randomUUID()});let t=xt.id;St(null);try{let e=await v({op:`workspace-sync`,resource:{namespace:`projects`,id:t}});Object.values(e.nameSync||{}).some(e=>e.status===`pending`)&&F(`项目已保存,Agent 项目名称将在连接恢复后同步。`)}catch{F(`项目已保存,Agent 项目名称将在连接恢复后同步。`)}try{await Y()}catch{F(`项目已保存,请刷新工作台查看。`)}}function hr(e){try{return JSON.parse(e.dataTransfer.getData(`application/x-project-directory`)||e.dataTransfer.getData(`text/plain`))}catch{return null}}async function gr(e,t){await X(()=>J(`/project-directory/order`,`PUT`,{folderIds:e.map(e=>e.id),projects:t.flatMap(e=>e.projects.map(e=>({id:e.id,pinned:!!e.pinned,folderId:e.folderId||null,pinnedFromFolderId:e.pinnedFromFolderId||null})))},{"idempotency-key":crypto.randomUUID()}))}async function _r(e,t,n=!1){if(e===t)return;let r=[...gn],i=r.findIndex(t=>t.id===e),a=r.findIndex(e=>e.id===t);if(i<0||a<0)return;let[o]=r.splice(i,1),s=r.findIndex(e=>e.id===t);if(!!o.pinned!=!!r[s].pinned){F(`请在相同置顶状态的文件夹间排序。`);return}r.splice(s+ +!!n,0,o),await gr(r,yn)}async function vr(e,t,n=``,r=!1){if(e===n)return;let i=yn.map(e=>({...e,projects:[...e.projects]})),a=null;for(let t of i){let n=t.projects.findIndex(t=>t.id===e);n>=0&&([a]=t.projects.splice(n,1))}let o=i.find(e=>e.id===t);if(!a||!o)return;a={...a,pinned:!!o.pinned,pinnedFromFolderId:o.pinned&&(a.pinnedFromFolderId||a.folderId)||null,folderId:o.pinned?a.folderId||a.pinnedFromFolderId||null:o.id||null};let s=n?o.projects.findIndex(e=>e.id===n):-1;o.projects.splice(s>=0?s+ +!!r:o.projects.length,0,a),await gr(gn,i)}async function yr(e,t){if(Oe&&!await c(`有未保存内容,确认切换?`))return;let n=t===void 0?xn(e.id):`project:${t}:${e.id}`;ue(()=>{ne.current=n,he(e.id),Bt(!1),qt(!1),we(`wiki/index.md`),xe(null),ke(!1)},zt||Kt||P!==e.id,Sn(n))}function br(e,t){Mt({project:e,...xr(t.clientX,t.clientY,224,210)})}function xr(e,t,n,r,i){let a=document.querySelector(`.project-collaboration`).getBoundingClientRect(),o=i!==void 0&&t+r>a.bottom-8?i-r-4:t;return{x:Math.max(8,Math.min(e-a.left,a.width-n-8)),y:Math.max(8,Math.min(o-a.top,a.height-r-8))}}function Sr(e){e.preventDefault();let t=e.clientX,n=K;document.querySelector(`.project-collaboration`)?.classList.add(`resizing-sidebar`);let r=e=>cn(Math.min(420,Math.max(190,n+e.clientX-t))),i=()=>{document.querySelector(`.project-collaboration`)?.classList.remove(`resizing-sidebar`),window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}async function Cr(e){Oe&&!await c(`正文尚未保存,确认切换?`)||(F(``),ke(!1),we(e),_e(`Wiki`),xe(null))}return M===null?(0,A.jsxs)(`div`,{className:`loading`,children:[`正在连接工作台…`,be]}):M.authenticated?N?(0,A.jsxs)(`div`,{className:`app ${zt||Kt?`portal-mode`:`project-mode`}`,style:{"--sidebar-width":`${K}px`},children:[(0,A.jsxs)(`aside`,{"aria-label":`工作空间导航与项目目录`,children:[(0,A.jsxs)(`div`,{className:`brand`,children:[(0,A.jsx)(`b`,{children:(0,A.jsx)(`img`,{className:`brand-mark`,src:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%20fill='none'%3e%3crect%20x='4'%20y='4'%20width='10'%20height='24'%20rx='3'%20fill='%23201E22'/%3e%3crect%20x='18'%20y='4'%20width='10'%20height='10'%20rx='3'%20fill='%236849E9'/%3e%3crect%20x='18'%20y='18'%20width='10'%20height='10'%20rx='3'%20fill='%23201E22'/%3e%3c/svg%3e`,``+import.meta.url).href,alt:``})}),(0,A.jsx)(`span`,{children:`项目`})]}),(0,A.jsx)(`button`,{className:`sidebar-create-project primary`,title:`新建项目`,"aria-label":`新建项目`,onClick:()=>{F(``),Qe(!0)},children:(0,A.jsx)(`span`,{children:`新建项目`})}),(0,A.jsxs)(`div`,{className:`tree-root ${zt&&W===null?`selected`:``}`,children:[(0,A.jsx)(`button`,{className:`tree-root-toggle`,"aria-expanded":!rn,"aria-label":rn?`展开全部项目`:`收起全部项目`,title:rn?`展开全部项目`:`收起全部项目`,onClick:()=>an(!rn),children:(0,A.jsx)($,{name:rn?`chevronRight`:`chevronDown`,size:`indicator`})}),(0,A.jsxs)(`button`,{className:`tree-root-select`,title:`全部项目`,"aria-label":`全部项目`,"aria-pressed":zt&&W===null,onClick:In,children:[(0,A.jsx)(Pd,{open:!rn}),(0,A.jsx)(`span`,{children:`全部项目`})]}),(0,A.jsx)(`button`,{className:`tree-root-create`,title:`创建目录`,"aria-label":`创建目录`,disabled:!!pt,onClick:()=>Xn(),children:(0,A.jsx)($,{name:`plus`})})]}),!rn&&(0,A.jsxs)(`div`,{className:`project-list tree-branches`,children:[pt&&!pt.id&&Qn(),yn.map(e=>{let t=e.id||`__unfiled__`,n=on.includes(t);return(0,A.jsxs)(`section`,{className:`project-group`,children:[pt?.id===e.id?Qn():(0,A.jsxs)(`div`,{className:`folder-title directory-row ${zt&&W===e.id?`selected`:``}`,draggable:!!(e.id&&!e.pinned),onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`application/x-project-directory`,JSON.stringify({type:`folder`,id:e.id})),t.dataTransfer.setData(`text/plain`,JSON.stringify({type:`folder`,id:e.id}))},onDragOver:e=>{e.preventDefault();let t=e.currentTarget.getBoundingClientRect();e.currentTarget.dataset.dropEdge=e.clientY<t.top+t.height/2?`before`:`after`},onDragLeave:e=>{delete e.currentTarget.dataset.dropEdge},onDragEnd:()=>document.querySelectorAll(`[data-drop-edge]`).forEach(e=>e.removeAttribute(`data-drop-edge`)),onDrop:t=>{t.preventDefault(),delete t.currentTarget.dataset.dropEdge;let n=hr(t);n?.type===`folder`&&e.id&&!e.pinned&&_r(n.id,e.id,t.clientY>t.currentTarget.getBoundingClientRect().top+t.currentTarget.getBoundingClientRect().height/2),n?.type===`project`&&vr(n.id,e.id)},children:[(0,A.jsx)(`button`,{"aria-expanded":!n,"aria-label":`${n?`展开`:`收起`}目录 ${e.name}`,title:`${n?`展开`:`收起`}目录 ${e.name}`,onClick:()=>Vn(t),children:(0,A.jsx)($,{name:n?`chevronRight`:`chevronDown`,size:`indicator`})}),(0,A.jsxs)(`button`,{className:`directory-select`,"aria-pressed":zt&&W===e.id,onClick:()=>Ln(e.id),children:[(0,A.jsx)(Pd,{open:!n}),(0,A.jsx)(`span`,{children:e.name}),e.folderPinned&&(0,A.jsx)(`span`,{className:`folder-pin-badge`,title:`文件夹已置顶`,children:(0,A.jsx)($,{name:`pin`,size:`indicator`})})]}),e.id&&!e.pinned&&(0,A.jsx)(`button`,{className:`folder-menu-trigger icon-button`,"aria-label":`管理分组 ${e.name}`,title:`分组操作`,"aria-haspopup":`menu`,"aria-expanded":Nt?.group.id===e.id,onClick:t=>{if(t.stopPropagation(),Nt?.group.id===e.id){Pt(null);return}let n=t.currentTarget.getBoundingClientRect();Mt(null),Pt({group:e,trigger:t.currentTarget,...xr(n.right-160,n.bottom+4,160,120,n.top)})},children:(0,A.jsx)($,{name:`more`})})]}),!n&&e.projects.map(t=>(0,A.jsxs)(`div`,{className:`project-row ${!zt&&!Kt&&P===t.id?`selected`:``}`,tabIndex:0,draggable:!0,onDragStart:e=>{e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`application/x-project-directory`,JSON.stringify({type:`project`,id:t.id})),e.dataTransfer.setData(`text/plain`,JSON.stringify({type:`project`,id:t.id}))},onDragOver:e=>{e.preventDefault();let t=e.currentTarget.getBoundingClientRect();e.currentTarget.dataset.dropEdge=e.clientY<t.top+t.height/2?`before`:`after`},onDragLeave:e=>{delete e.currentTarget.dataset.dropEdge},onDragEnd:()=>document.querySelectorAll(`[data-drop-edge]`).forEach(e=>e.removeAttribute(`data-drop-edge`)),onDrop:n=>{n.preventDefault(),n.stopPropagation(),delete n.currentTarget.dataset.dropEdge;let r=hr(n);r?.type===`project`&&vr(r.id,e.id,t.id,n.clientY>n.currentTarget.getBoundingClientRect().top+n.currentTarget.getBoundingClientRect().height/2)},onContextMenu:e=>{e.preventDefault(),br(t,e)},onKeyDown:e=>{if(e.key!==`ContextMenu`&&!(e.shiftKey&&e.key===`F10`))return;e.preventDefault();let n=e.currentTarget.getBoundingClientRect();br(t,{clientX:n.left+Math.min(n.width,180),clientY:n.top+n.height})},children:[(0,A.jsxs)(`button`,{className:`project-select`,draggable:!0,onDragStart:e=>{e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`application/x-project-directory`,JSON.stringify({type:`project`,id:t.id})),e.dataTransfer.setData(`text/plain`,JSON.stringify({type:`project`,id:t.id}))},onClick:()=>yr(t,e.id),title:t.name,"aria-current":!zt&&!Kt&&P===t.id?`page`:void 0,children:[(0,A.jsx)(Fd,{}),(0,A.jsx)(`span`,{children:t.name})]}),(0,A.jsx)(`button`,{className:`project-row-menu icon-button`,"aria-label":`管理项目 ${t.name}`,title:`项目操作`,onClick:e=>{e.stopPropagation();let n=e.currentTarget.getBoundingClientRect();br(t,{clientX:n.right,clientY:n.bottom})},children:(0,A.jsx)($,{name:`more`})})]},t.id))]},t)})]}),(0,A.jsxs)(`button`,{className:`home-link sidebar-ai-guide`,title:`让 AI 帮你做`,"aria-label":`让 AI 帮你做`,onClick:()=>w(!0),children:[(0,A.jsx)($,{name:`activity`}),(0,A.jsx)(`span`,{children:`让 AI 帮你做`})]}),(0,A.jsxs)(`button`,{className:`home-link sidebar-trash ${Kt?`active`:``}`,title:`回收站`,"aria-label":`回收站`,"aria-current":Kt?`page`:void 0,onClick:Rn,children:[(0,A.jsx)($,{name:`trash`}),(0,A.jsx)(`span`,{children:`回收站`})]}),(0,A.jsx)(`div`,{className:`sidebar-resizer`,role:`separator`,"aria-label":`调整项目目录宽度`,"aria-orientation":`vertical`,"aria-valuemin":190,"aria-valuemax":420,"aria-valuenow":K,tabIndex:0,onPointerDown:Sr,onKeyDown:e=>{e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||(e.preventDefault(),cn(t=>Math.min(420,Math.max(190,t+(e.key===`ArrowRight`?10:-10)))))}})]}),Nt&&(0,A.jsxs)(`div`,{className:`folder-action-menu`,role:`menu`,"aria-label":`管理分组 ${Nt.group.name}`,style:{left:Nt.x,top:Nt.y},onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Array.from(e.currentTarget.querySelectorAll(`button`)),n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},children:[(0,A.jsxs)(`button`,{autoFocus:!0,role:`menuitem`,onClick:()=>{let e=Nt.group;Pt(null),X(()=>J(`/project-folders/${e.id}/pin`,`PATCH`,{pinned:!e.folderPinned}))},children:[(0,A.jsx)($,{name:`pin`}),Nt.group.folderPinned?`取消置顶文件夹`:`置顶文件夹`]}),(0,A.jsxs)(`button`,{role:`menuitem`,onClick:()=>{let e=Nt.group;Pt(null),Xn(e)},children:[(0,A.jsx)($,{name:`edit`}),`编辑分组`]}),(0,A.jsxs)(`button`,{role:`menuitem`,className:`context-delete`,onClick:()=>{let e=Nt.group;Pt(null),$n(e)},children:[(0,A.jsx)($,{name:`trash`}),`删除分组`]})]}),(0,A.jsxs)(`main`,{ref:E,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsxs)(`div`,{className:`workspace-heading`,children:[(0,A.jsx)(`nav`,{className:`workspace-breadcrumb`,"aria-label":`项目层级`,children:(0,A.jsxs)(`ol`,{children:[(0,A.jsx)(`li`,{children:zt&&W===null?(0,A.jsx)(`h1`,{"aria-current":`page`,children:`全部项目`}):(0,A.jsx)(`button`,{onClick:In,children:`全部项目`})}),!zt&&!Kt&&Z&&(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,A.jsx)(`button`,{onClick:()=>Ln(En),title:Dn,children:Dn})]}),!(zt&&W===null)&&(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,A.jsx)(`h1`,{"aria-current":`page`,title:zt?Tn:Kt?`回收站`:Z?.name,children:zt?Tn:Kt?`回收站`:Z?.name||`项目空间`})]})]})}),zt&&(0,A.jsxs)(`p`,{children:[`共 `,wn.length,` 个项目`]})]}),!zt&&!Kt&&Z&&(0,A.jsxs)(`div`,{className:`project-header-actions`,children:[(0,A.jsx)(`button`,{onClick:()=>b(!0),children:`Agent 项目`}),(0,A.jsx)(`button`,{className:`primary`,onClick:()=>fr(Z),children:`编辑项目`})]})]}),!zt&&!Kt&&Z?.goal&&(0,A.jsxs)(`div`,{className:`project-goal-row`,children:[(0,A.jsx)(`span`,{className:`project-goal-label`,children:`项目目标`}),(0,A.jsx)(`p`,{children:Z.goal})]}),be&&(0,A.jsxs)(`div`,{role:`alert`,className:`error`,children:[be,(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`关闭错误提示`,title:`关闭错误提示`,onClick:()=>F(``),children:(0,A.jsx)($,{name:`close`})})]}),Kt?(0,A.jsxs)(`section`,{className:`trash-page`,children:[(0,A.jsxs)(`div`,{className:`trash-toolbar`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`small`,{children:`删除的节点、任务及产出可在保留期内恢复`})}),(0,A.jsxs)(`div`,{className:`view-switch`,"aria-label":`回收站筛选`,children:[(0,A.jsx)(`button`,{className:Xt===`completed`?`active`:``,onClick:()=>Zt(`completed`),children:`待恢复`}),(0,A.jsx)(`button`,{className:Xt===`all`?`active`:``,onClick:()=>Zt(`all`),children:`全部记录`})]})]}),Jt.filter(e=>Xt===`all`||e.state===`completed`).length?(0,A.jsx)(`div`,{className:`trash-list`,children:Jt.filter(e=>Xt===`all`||e.state===`completed`).map(e=>(0,A.jsxs)(`article`,{className:`trash-card`,children:[(0,A.jsxs)(`div`,{className:`trash-card-main`,children:[(0,A.jsxs)(`div`,{className:`trash-title-row`,children:[(0,A.jsx)(`span`,{className:`trash-state ${e.state===`completed`?`recoverable`:`restored`}`,children:e.state===`completed`?`可恢复`:`已恢复`}),(0,A.jsx)(`h2`,{children:e.displayName||e.taskTitle}),e.scopeType===`node`&&(0,A.jsx)(`span`,{className:`trash-content-tag`,children:`节点`}),e.contentStatus!==`empty`&&(0,A.jsx)(`span`,{className:`trash-content-tag`,children:`含任务产出`})]}),(0,A.jsxs)(`p`,{children:[(0,A.jsx)(`b`,{children:e.projectName}),e.scopeType===`node`?` / ${e.taskCount} 个任务`:e.taskStage?` / ${e.taskStage}`:``]}),(0,A.jsxs)(`div`,{className:`trash-meta`,children:[(0,A.jsxs)(`span`,{children:[`删除人:`,e.requestedByName]}),(0,A.jsxs)(`span`,{children:[`删除时间:`,kn(e.createdAt)]}),(0,A.jsxs)(`span`,{children:[`保留至:`,kn(e.retentionUntil)]})]}),(0,A.jsxs)(`div`,{className:`trash-impact`,children:[(0,A.jsxs)(`span`,{children:[`知识库/附件 `,e.impact.files]}),(0,A.jsxs)(`span`,{children:[`Agent 运行 `,e.impact.runs]}),(0,A.jsxs)(`span`,{children:[`交付物 `,e.impact.artifacts]}),(0,A.jsxs)(`span`,{children:[`活动记录 `,e.impact.events]}),e.impact.dependents>0&&(0,A.jsxs)(`span`,{children:[`下游任务 `,e.impact.dependents]})]})]}),(0,A.jsx)(`div`,{className:`trash-card-actions`,children:e.state===`completed`?(0,A.jsx)(`button`,{className:`primary`,disabled:U,onClick:()=>zn(e),children:e.scopeType===`node`?`恢复节点`:`恢复任务`}):(0,A.jsxs)(`small`,{children:[`恢复于 `,kn(e.restoredAt)]})})]},e.id))}):(0,A.jsxs)(`div`,{className:`home-empty trash-empty`,children:[(0,A.jsx)($,{name:`trash`,size:`display`}),(0,A.jsx)(`h2`,{children:`回收站是空的`}),(0,A.jsx)(`p`,{children:`删除的节点和任务会显示在这里。`})]})]}):zt?(0,A.jsxs)(`section`,{className:`project-home`,children:[(0,A.jsx)(`div`,{className:`home-toolbar`,children:(0,A.jsxs)(`div`,{className:`home-tools`,children:[(0,A.jsxs)(`div`,{className:`project-filter-segment`,role:`group`,"aria-label":`项目筛选`,children:[(0,A.jsx)(`button`,{className:Wt===`all`?`active`:``,"aria-pressed":Wt===`all`,onClick:()=>Gt(`all`),children:`全部`}),(0,A.jsx)(`button`,{className:Wt===`pinned`?`active`:``,"aria-pressed":Wt===`pinned`,onClick:()=>Gt(`pinned`),children:`置顶`})]}),(0,A.jsxs)(`div`,{className:`project-toolbar-actions`,children:[(0,A.jsxs)(`label`,{className:`search-field`,children:[(0,A.jsx)($,{name:`search`}),(0,A.jsx)(`input`,{type:`search`,"aria-label":`搜索项目`,placeholder:`搜索项目`,value:Ht,onChange:e=>Ut(e.target.value)})]}),(0,A.jsxs)(`div`,{className:`view-switch`,role:`group`,"aria-label":`项目视图`,children:[(0,A.jsx)(`button`,{className:d===`list`?`active`:``,title:`列表视图`,"aria-label":`列表视图`,"aria-pressed":d===`list`,onClick:()=>p(`list`),children:(0,A.jsx)($,{name:`list`})}),(0,A.jsx)(`button`,{className:d===`cards`?`active`:``,title:`卡片视图`,"aria-label":`卡片视图`,"aria-pressed":d===`cards`,onClick:()=>p(`cards`),children:(0,A.jsx)($,{name:`grid`})})]})]})]})}),On.length===0?(0,A.jsxs)(`div`,{className:`home-empty`,children:[(0,A.jsx)($,{name:Ht?`search`:`folderOpen`,size:`display`}),(0,A.jsx)(`h2`,{children:Ht?`没有找到匹配的项目`:Wt===`pinned`?`还没有置顶项目`:`还没有项目`}),(0,A.jsx)(`p`,{children:Ht?`试试其他关键词。`:Wt===`pinned`?`在项目菜单中置顶常用项目。`:`点击上方「创建项目」开始。`})]}):(0,A.jsxs)(`div`,{className:`home-projects ${d}`,children:[d===`list`&&(0,A.jsxs)(`div`,{className:`project-list-header`,"aria-hidden":`true`,children:[(0,A.jsx)(`span`,{children:`项目`}),(0,A.jsx)(`span`,{children:`项目分组`}),(0,A.jsx)(`span`,{children:`完成进度`}),(0,A.jsx)(`span`,{className:`project-updated-heading`,children:`最近更新`}),(0,A.jsx)(`span`,{})]}),On.map(e=>{let t=Cn(e.id),n=e.pinned?e.pinnedFromFolderId:e.folderId,r=gn.find(e=>e.id===n)?.name||`未归档`;return(0,A.jsxs)(`article`,{className:`home-project`,role:`link`,tabIndex:0,onClick:()=>yr(e),onContextMenu:t=>{t.preventDefault(),br(e,t)},onKeyDown:t=>{t.target===t.currentTarget&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),yr(e))},children:[(0,A.jsxs)(`div`,{className:`project-summary`,children:[(0,A.jsx)(Ku,{project:e}),(0,A.jsxs)(`div`,{className:`project-summary-text`,children:[(0,A.jsxs)(`div`,{className:`home-project-title`,children:[(0,A.jsx)(`h2`,{title:e.name,children:e.name}),e.pinned&&(0,A.jsx)(`span`,{className:`project-pin`,title:`已置顶`,children:(0,A.jsx)($,{name:`pin`})})]}),e.goal&&(0,A.jsx)(`p`,{title:e.goal,children:e.goal}),e.platforms?.length>0&&(0,A.jsxs)(`small`,{className:`project-business-meta`,children:[e.platforms.join(` / `),e.ownerMemberId?` · ${Q(e.ownerMemberId)}`:``]})]})]}),(0,A.jsxs)(`span`,{className:`project-group-cell`,title:r,children:[(0,A.jsx)(`span`,{className:`project-group-mobile-label`,children:`项目分组:`}),r]}),(0,A.jsxs)(`div`,{className:`project-progress`,title:`已完成 ${t.completed} 项,共 ${t.total} 项`,children:[(0,A.jsx)(`progress`,{value:t.percent,max:`100`,"aria-label":`${e.name}完成进度`}),(0,A.jsxs)(`span`,{className:`project-progress-count`,children:[t.percent,`%`]})]}),(0,A.jsxs)(`time`,{className:`project-updated`,dateTime:e.updatedAt||e.createdAt,title:kn(e.updatedAt||e.createdAt),children:[new Date(e.updatedAt||e.createdAt).toLocaleDateString(`zh-CN`),` 更新`]}),(0,A.jsx)(`button`,{className:`project-menu-trigger icon-button`,"aria-label":`管理项目 ${e.name}`,title:`项目操作`,onKeyDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();br(e,{clientX:n.right,clientY:n.bottom})},children:(0,A.jsx)($,{name:`more`})})]},e.id)})]})]}):Z?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`nav`,{"aria-label":`项目空间`,children:[`看板`,`Wiki`,`活动记录`].map(e=>(0,A.jsxs)(`button`,{className:ge===e||e===`活动记录`&&[`消息`,`Agent 运行`].includes(ge)?`active`:``,onClick:()=>jn(e),"aria-current":ge===e||e===`活动记录`&&[`消息`,`Agent 运行`].includes(ge)?`page`:void 0,children:[(0,A.jsx)($,{name:e===`看板`?`project`:e===`Wiki`?`document`:`activity`}),e===`看板`?`任务`:e===`Wiki`?`文档`:`动态`,e===`活动记录`&&N.notifications.filter(e=>e.projectId===P&&!e.readAt).length>0&&(0,A.jsx)(`em`,{children:N.notifications.filter(e=>e.projectId===P&&!e.readAt).length})]},e))}),ge===`看板`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`toolbar task-toolbar`,children:[(0,A.jsxs)(`div`,{className:`project-filter-segment task-filter-segment`,role:`group`,"aria-label":`任务视图`,children:[(0,A.jsx)(`button`,{className:m===`board`?`active`:``,"aria-pressed":m===`board`,onClick:()=>h(`board`),children:`看板`}),(0,A.jsx)(`button`,{className:m===`workflow`?`active`:``,"aria-pressed":m===`workflow`,onClick:()=>h(`workflow`),children:`思维导图`})]}),(0,A.jsx)(`div`,{className:`project-filter-segment task-filter-segment`,role:`group`,"aria-label":`筛选任务`,children:[`全部`,`我的任务`,`进行中`,`完成`].map(e=>(0,A.jsx)(`button`,{className:Fe===e?`active`:``,"aria-pressed":Fe===e,onClick:()=>Ie(e),children:e},e))}),(0,A.jsx)(`div`,{className:`task-completion`,children:(0,A.jsxs)(`b`,{children:[`已完成 `,pn.filter(e=>e.status===`已完成`).length,` / `,pn.length]})}),m===`board`&&(0,A.jsx)(`button`,{disabled:!!Le||Ye,onClick:ln,children:`添加节点`})]}),m===`workflow`&&Le!==P?(0,A.jsx)(ld,{getPurpose:e=>Z.nodeDetails?.[Z.nodeIds?.[e]]?.description??Iu.find(e=>e.id===Z.workflowTemplateId)?.nodes.find(t=>t.name===e)?.description??``,memberName:e=>N.members.find(t=>t.id===e)?.name||`未指定`,stages:Z.stages,getTasks:rr,isVisible:nr,openTask:Mn},P):(0,A.jsxs)(`section`,{className:`board`,children:[Z.stages.map((e,t)=>{let n=Z.nodeDetails?.[Z.nodeIds?.[e]]?.description??Iu.find(e=>e.id===Z.workflowTemplateId)?.nodes.find(t=>t.name===e)?.description,r=rr(e).filter(nr);return(0,A.jsxs)(`div`,{className:`column ${Lt?.kind===`node`&&Lt.stage===e?`node-drop-${Lt.edge}`:``}`,onDragOver:t=>{if(Ft)if(t.preventDefault(),t.dataTransfer.dropEffect=`move`,Ft.kind===`node`){let n=t.currentTarget.getBoundingClientRect();Rt({kind:`node`,stage:e,edge:t.clientX<n.left+n.width/2?`before`:`after`})}else Ft.kind===`task`&&Rt({kind:`task-end`,stage:e})},onDrop:t=>{t.preventDefault(),Ft?.kind===`node`?cr(e,Lt?.kind===`node`?Lt.edge:`after`):Ft?.kind===`task`&&lr(e)},children:[(0,A.jsxs)(`div`,{className:`column-title ${Ft?.kind===`node`&&Ft.stage===e?`dragging`:``}`,draggable:!0,onDragStart:t=>or(t,{kind:`node`,stage:e}),onDragEnd:sr,title:`拖拽调整节点位置`,children:[(0,A.jsx)(`span`,{className:`stage-order`,children:String(t+1).padStart(2,`0`)}),(0,A.jsx)(`strong`,{children:e}),(0,A.jsx)(`span`,{className:`column-count`,children:r.length}),(0,A.jsx)(`button`,{className:`icon-button stage-menu-trigger`,title:`阶段操作`,"aria-label":`管理阶段 ${e}`,"aria-haspopup":`menu`,"aria-expanded":ze?.name===e,onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),ze?.name===e){Be(null);return}let n=t.currentTarget.getBoundingClientRect();Be({name:e,projectId:P,trigger:t.currentTarget,...xr(n.right-160,n.bottom+4,160,88,n.top)})},children:(0,A.jsx)($,{name:`more`})})]}),n&&(0,A.jsx)(`p`,{className:`sop-column-purpose`,children:n}),r.map(t=>(0,A.jsxs)(`article`,{role:`button`,tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),Mn(t))},className:`card ${Ft?.kind===`task`&&Ft.id===t.id?`dragging`:``} ${Lt?.kind===`task`&&Lt.taskId===t.id?`task-drop-${Lt.edge}`:``}`,draggable:!0,onDragStart:e=>or(e,{kind:`task`,id:t.id}),onDragEnd:sr,onDragOver:n=>{if(Ft?.kind!==`task`)return;n.preventDefault(),n.stopPropagation();let r=n.currentTarget.getBoundingClientRect();Rt({kind:`task`,stage:e,taskId:t.id,edge:n.clientY<r.top+r.height/2?`before`:`after`})},onDrop:n=>{n.preventDefault(),n.stopPropagation(),lr(e,t.id,Lt?.kind===`task`?Lt.edge:`after`)},onClick:()=>Mn(t),children:[(0,A.jsxs)(`div`,{className:`card-top`,children:[(0,A.jsxs)(`span`,{className:`badge status-`+t.status,children:[An(t.status),t.status===`进行中`?` ${Number(t.progress||0)}%`:``]}),t.priority===`高`&&(0,A.jsx)(`small`,{children:`高优先级`})]}),(0,A.jsx)(`h3`,{children:t.title}),(0,A.jsx)(Id,{task:t}),t.status===`已阻塞`&&(0,A.jsx)(`div`,{className:`card-note`,children:t.blockReason||`已阻塞`}),(0,A.jsxs)(`div`,{className:`card-footer`,children:[(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`i`,{className:`avatar`,children:Q(t.owner).slice(0,1)}),Q(t.owner)]}),(0,A.jsxs)(`div`,{className:`task-card-actions`,children:[t.dueDate&&(0,A.jsx)(`small`,{children:t.dueDate}),t.status!==`已完成`&&(0,A.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),S({id:t.id,title:t.title})},children:`去完成`})]})]})]},t.id)),(0,A.jsxs)(`button`,{className:`add-card ${Lt?.kind===`task-end`&&Lt.stage===e?`task-drop-end`:``}`,onClick:()=>Pn(e),children:[(0,A.jsx)($,{name:`plus`}),`添加任务`]})]},Z.nodeIds?.[e]??e)}),Le===P&&(0,A.jsxs)(`div`,{className:`column node-draft-column`,children:[(0,A.jsxs)(`div`,{className:`node-draft-editor`,children:[(0,A.jsx)(`input`,{ref:ce,"aria-label":`新节点名称`,value:Ge,disabled:Ye,"aria-invalid":!!qe,onChange:e=>{Ke(e.target.value),Je(``)},onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Enter`&&(e.preventDefault(),dn()),e.key===`Escape`&&!le.current&&Re(null))}}),(0,A.jsx)(`button`,{className:`icon-button`,title:`完成`,"aria-label":`完成节点命名`,disabled:Ye||!Ge.trim(),onClick:()=>void dn(),children:(0,A.jsx)($,{name:`check`})}),(0,A.jsx)(`button`,{className:`icon-button`,title:`取消`,"aria-label":`取消新增节点`,disabled:Ye,onClick:()=>Re(null),children:(0,A.jsx)($,{name:`close`})})]}),qe&&(0,A.jsx)(`small`,{role:`alert`,className:`node-draft-error`,children:qe})]})]})]}),ge===`Wiki`&&(0,A.jsxs)(`section`,{className:`wiki`,children:[(0,A.jsxs)(`div`,{className:`wiki-tree`,children:[(0,A.jsxs)(`h3`,{children:[`文档`,` `,(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`创建文档`,title:`创建文档`,onClick:()=>fn(`document`),children:(0,A.jsx)($,{name:`plus`})})]}),(0,A.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),X(async()=>Ne(await J(`/projects/${P}/search?q=${encodeURIComponent(Ae)}`)))},children:(0,A.jsx)(`input`,{"aria-label":`搜索文档正文`,placeholder:`搜索正文,回车检索`,value:Ae,onChange:e=>je(e.target.value)})}),hn?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{className:V===hn.index.path?`current`:``,onClick:()=>Cr(hn.index.path),children:[(0,A.jsx)($,{name:`document`}),(0,A.jsx)(`span`,{children:hn.index.title})]}),hn.folders.map((e,t)=>(0,A.jsxs)(`details`,{className:`wiki-node-folder`,open:t===0||V.startsWith(e.path),children:[(0,A.jsxs)(`summary`,{title:e.name,children:[(0,A.jsx)($,{name:`chevronRight`,size:`indicator`}),(0,A.jsx)(Pd,{}),(0,A.jsx)(`span`,{children:e.name}),(0,A.jsx)(`small`,{children:e.results.length})]}),[e.index,...e.results].map(e=>(0,A.jsxs)(`button`,{className:V===e.path?`current`:``,title:e.filename||e.title,onClick:()=>Cr(e.path),children:[(0,A.jsx)($,{name:`document`}),(0,A.jsx)(`span`,{children:e.title})]},e.path))]},e.index.path)),hn.extra.length>0&&(0,A.jsxs)(`details`,{className:`wiki-node-folder`,open:hn.extra.some(e=>V===e.path),children:[(0,A.jsxs)(`summary`,{children:[(0,A.jsx)($,{name:`chevronRight`,size:`indicator`}),(0,A.jsx)(Pd,{}),(0,A.jsx)(`span`,{children:`工作记录与其他文档`})]}),hn.extra.map(e=>(0,A.jsxs)(`button`,{className:V===e.path?`current`:``,onClick:()=>Cr(e.path),children:[(0,A.jsx)($,{name:`document`}),(0,A.jsx)(`span`,{children:e.title})]},e.id))]}),(0,A.jsxs)(`div`,{className:`wiki-reference-section`,"aria-label":`资料与查询`,children:[[{name:`raw · 原始资料`,files:hn.references.raw},{name:`queries · 常用查询`,files:hn.references.queries}].map(e=>(0,A.jsxs)(`details`,{className:`wiki-node-folder`,open:e.files.some(e=>V===e.path),children:[(0,A.jsxs)(`summary`,{children:[(0,A.jsx)($,{name:`chevronRight`,size:`indicator`}),(0,A.jsx)(Pd,{}),(0,A.jsx)(`span`,{children:e.name})]}),e.files.map(e=>(0,A.jsxs)(`button`,{className:V===e.path?`current`:``,onClick:()=>Cr(e.path),children:[(0,A.jsx)($,{name:`document`}),(0,A.jsx)(`span`,{children:e.title})]},e.path))]},e.name)),(0,A.jsxs)(`details`,{className:`wiki-node-folder`,open:hn.references.maintenance.some(e=>V===e.path),children:[(0,A.jsxs)(`summary`,{children:[(0,A.jsx)($,{name:`chevronRight`,size:`indicator`}),(0,A.jsx)(`span`,{children:`Wiki 维护`})]}),hn.references.maintenance.map(e=>(0,A.jsxs)(`button`,{className:V===e.path?`current`:``,onClick:()=>Cr(e.path),children:[(0,A.jsx)($,{name:`document`}),(0,A.jsx)(`span`,{children:e.title})]},e.path))]})]})]}):null,Me.length>0&&(0,A.jsxs)(`div`,{className:`search-results`,children:[(0,A.jsx)(`h4`,{children:`检索结果`}),Me.map(e=>(0,A.jsxs)(`button`,{onClick:()=>Cr(e.path),children:[e.title,(0,A.jsx)(`small`,{children:e.excerpt})]},e.id))]})]}),(0,A.jsxs)(`article`,{className:`wiki-content`,children:[(0,A.jsxs)(`div`,{className:`wiki-top`,children:[(0,A.jsxs)(`div`,{className:`document-heading`,children:[H?.page?.title||`项目文档`,(0,A.jsxs)(`details`,{children:[(0,A.jsxs)(`summary`,{className:`trailing-disclosure`,children:[`文档信息`,(0,A.jsx)($,{name:`chevronRight`,size:`indicator`,className:`disclosure-icon`})]}),(0,A.jsxs)(`dl`,{className:`document-metadata`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:`路径:`}),(0,A.jsx)(`dd`,{children:V})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:`版本:`}),(0,A.jsx)(`dd`,{children:H?.page?.version||1})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:`更新人:`}),(0,A.jsx)(`dd`,{children:H?.page?.updatedBy?Q(H.page.updatedBy):`项目模板`})]})]})]})]}),(0,A.jsx)(`button`,{disabled:!H||H.page?.generated,title:H?.page?.generated?`此页面由系统生成,只读`:void 0,onClick:()=>De(!Ee),children:Ee?`预览`:`编辑`}),Ee&&(0,A.jsx)(`button`,{className:`primary`,disabled:U,onClick:()=>X(async()=>{let e=await J(`/projects/${P}/wiki`,`PUT`,{path:V,content:H.content,version:H.page?.version});Te({...H,page:e}),ke(!1),De(!1)}),children:`保存`})]}),H&&(Ee?(0,A.jsx)(`textarea`,{className:`editor`,"aria-label":`文档正文`,value:H.content,onChange:e=>{Te({...H,content:e.target.value}),ke(!0)}}):(0,A.jsx)(`div`,{className:`markdown`,onClick:e=>{let t=e.target.closest(`a`);if(t){let n=t.getAttribute(`href`),r=n?Nd(n,H.page?.sourcePath||V):null;r&&(e.preventDefault(),Cr(r))}},children:(0,A.jsx)(Xo,{remarkPlugins:[Tu],children:H.content})})),!Ee&&H?.page?.evidencePath&&(0,A.jsx)(`div`,{className:`markdown`,children:(0,A.jsx)(`a`,{href:H.page.evidencePath,onClick:e=>{e.preventDefault(),Cr(H.page.evidencePath)},children:`查看原始资料 · 近三场直播数据摘录`})}),H?.page?.history?.length>0&&(0,A.jsxs)(`details`,{children:[(0,A.jsxs)(`summary`,{className:`trailing-disclosure`,children:[`历史版本(`,H.page.history.length,`)`,(0,A.jsx)($,{name:`chevronRight`,size:`indicator`,className:`disclosure-icon`})]}),[...H.page.history].reverse().map(e=>(0,A.jsxs)(`button`,{onClick:()=>X(async()=>{await u((await J(`/projects/${P}/wiki?path=${encodeURIComponent(e.path)}`)).content,`历史版本 v${e.version} · ${kn(e.at)}`)}),children:[`v`,e.version,` · `,kn(e.at),` · 查看`]},e.path))]})]})]}),ge===`活动记录`&&(0,A.jsxs)(`section`,{className:`content timeline activity-content`,children:[!yd(N,P).length&&(0,A.jsx)(`p`,{className:`empty`,children:`暂无记录`}),yd(N,P).map(e=>{if(e.notification){let t=e.notification;return(0,A.jsx)(`article`,{className:`record activity-entry notification-entry`,children:(0,A.jsxs)(`div`,{className:`activity-entry-heading`,children:[(0,A.jsxs)(`div`,{className:`activity-heading-content`,children:[(0,A.jsx)(`span`,{className:`badge activity-type-notice`,children:`通知`}),(0,A.jsx)(`b`,{className:`activity-message-title`,title:t.message,children:t.message}),t.readAt?(0,A.jsx)(`small`,{children:`已读`}):(0,A.jsx)(`button`,{className:`notification-read-action`,disabled:U,onClick:()=>X(()=>J(`/notifications/${t.id}/read`,`POST`,{})),children:`标为已读`}),(0,A.jsxs)(`span`,{className:`activity-responsible`,children:[`接收人:`,Q(t.recipient||t.owner||t.recipientId)]})]}),(0,A.jsx)(`time`,{dateTime:t.createdAt,children:kn(t.createdAt)})]})},e.id)}let t=vd(e,N),n=bd(e,N);return(0,A.jsxs)(`details`,{className:`record activity-entry`,children:[(0,A.jsxs)(`summary`,{className:`activity-entry-heading`,children:[(0,A.jsxs)(`span`,{className:`activity-heading-content`,children:[(0,A.jsx)(`span`,{className:`badge ${n.kind===`Agent`?`activity-type-agent`:`activity-type-user`}`,children:n.kind}),(0,A.jsx)(`b`,{className:`activity-message-title`,children:t.title}),(0,A.jsx)(`span`,{className:`activity-responsible`,children:n.kind===`Agent`?n.name:`负责人:${n.name}`})]}),(0,A.jsx)(`time`,{dateTime:e.createdAt,children:kn(e.createdAt)}),(0,A.jsx)($,{name:`chevronRight`,size:`indicator`,className:`disclosure-icon`})]}),(0,A.jsxs)(`div`,{className:`activity-entry-body`,children:[(0,A.jsx)(`ul`,{className:`activity-changes`,children:t.lines.map((e,t)=>(0,A.jsx)(`li`,{children:e},t))}),t.changes.map((e,t)=>(0,A.jsx)(xd,{...e},t))]})]},e.id)})]}),ge===`提效验证`&&(0,A.jsxs)(`section`,{className:`content`,children:[(0,A.jsx)(`h2`,{children:`耗时统计`}),(0,A.jsx)(`p`,{className:`muted`,children:`建议使用相同事项、相同交付标准作对比;Agent 总耗时包含人工纠正时间。`}),(0,A.jsxs)(`form`,{className:`measure-form`,onSubmit:e=>{e.preventDefault();let t=e.currentTarget,n=Object.fromEntries(new FormData(t));X(async()=>{await J(`/measurements`,`POST`,{...n,projectId:P}),t.reset()})},children:[(0,A.jsx)(`input`,{name:`label`,required:!0,placeholder:`对比事项,例如市场调研`}),(0,A.jsxs)(`select`,{name:`mode`,children:[(0,A.jsx)(`option`,{value:`manual`,children:`人工基线`}),(0,A.jsx)(`option`,{value:`agent`,children:`Agent 协作`})]}),(0,A.jsx)(`input`,{name:`minutes`,type:`number`,min:`0`,step:`0.1`,required:!0,placeholder:`执行分钟`}),(0,A.jsx)(`input`,{name:`correctionMinutes`,type:`number`,min:`0`,step:`0.1`,placeholder:`纠正分钟`}),(0,A.jsx)(`input`,{name:`notes`,placeholder:`质量评价 / 说明`}),(0,A.jsx)(`button`,{className:`primary`,children:`记录`})]}),(0,A.jsxs)(`table`,{children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`th`,{children:`事项`}),(0,A.jsx)(`th`,{children:`方式`}),(0,A.jsx)(`th`,{children:`执行`}),(0,A.jsx)(`th`,{children:`纠正`}),(0,A.jsx)(`th`,{children:`合计(分钟)`}),(0,A.jsx)(`th`,{children:`说明`})]})}),(0,A.jsx)(`tbody`,{children:N.measurements.filter(e=>e.projectId===P).map(e=>(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`td`,{children:e.label}),(0,A.jsx)(`td`,{children:e.mode===`agent`?`Agent 协作`:`人工基线`}),(0,A.jsx)(`td`,{children:e.minutes}),(0,A.jsx)(`td`,{children:e.correctionMinutes}),(0,A.jsx)(`td`,{children:e.minutes+e.correctionMinutes}),(0,A.jsx)(`td`,{children:e.notes})]},e.id))})]}),(0,A.jsxs)(`div`,{className:`callout`,children:[`相同事项配对比较`,Array.from(new Set(N.measurements.filter(e=>e.projectId===P).map(e=>e.label))).map(e=>{let t=N.measurements.filter(t=>t.projectId===P&&t.label===e),n=e=>{let n=t.filter(t=>t.mode===e);return n.length?n.reduce((e,t)=>e+t.minutes+t.correctionMinutes,0)/n.length:null},r=n(`manual`),i=n(`agent`);return(0,A.jsxs)(`p`,{children:[e,`:`,r&&i!==null?`人工平均 ${r.toFixed(1)} 分钟 → Agent 平均 ${i.toFixed(1)} 分钟,耗时变化 ${((i/r-1)*100).toFixed(1)}%`:`待补充两组数据`]},e)})]})]})]}):(0,A.jsxs)(`section`,{className:`welcome`,children:[(0,A.jsx)(`div`,{className:`hero-icon`,children:(0,A.jsx)(Fd,{size:`display`})}),(0,A.jsx)(`h2`,{children:`选择一个项目`}),(0,A.jsx)(`p`,{children:`从左侧目录打开项目,或创建新项目。`}),(0,A.jsx)(`button`,{className:`primary`,onClick:()=>Qe(!0),children:`创建第一个项目`})]}),ze&&(0,A.jsxs)(`div`,{className:`folder-action-menu stage-action-menu`,role:`menu`,"aria-label":`管理阶段 ${ze.name}`,style:{left:ze.x,top:ze.y},children:[(0,A.jsx)(`button`,{autoFocus:!0,role:`menuitem`,onClick:()=>{He(ze),We(ze.name),F(``),Be(null)},children:`改名`}),(0,A.jsx)(`button`,{role:`menuitem`,className:`context-delete`,onClick:()=>{let e=ze.name;Be(null),er(e)},children:`删除阶段`})]}),Ve&&(0,A.jsx)(`div`,{className:`modal-backdrop`,onMouseDown:()=>{U||He(null)},children:(0,A.jsxs)(`form`,{className:`modal compact-modal folder-create-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`修改阶段名称`,onMouseDown:e=>e.stopPropagation(),onSubmit:e=>{e.preventDefault(),un()},children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`h2`,{children:`修改阶段名称`}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:U,"aria-label":`关闭`,title:`关闭`,onClick:()=>He(null),children:(0,A.jsx)($,{name:`close`})})]}),be&&(0,A.jsx)(`div`,{className:`error`,role:`alert`,children:be}),(0,A.jsxs)(`label`,{children:[`阶段名称`,(0,A.jsx)(`input`,{autoFocus:!0,required:!0,value:Ue,onFocus:e=>e.currentTarget.select(),onChange:e=>We(e.target.value)})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:U,onClick:()=>He(null),children:`取消`}),(0,A.jsx)(`button`,{className:`primary`,disabled:U||!Ue.trim()||Ue.trim()===Ve.name,children:`保存`})]})]})}),$e&&(0,A.jsx)(`div`,{className:`modal-backdrop`,onMouseDown:()=>et(null),children:(0,A.jsxs)(`section`,{className:`modal compact-modal share-project-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`分享项目`,onMouseDown:e=>e.stopPropagation(),children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`h2`,{children:`分享项目`}),(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`关闭分享项目`,title:`关闭分享项目`,onClick:()=>et(null),children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsx)(`p`,{className:`share-project-name`,children:$e.name}),(0,A.jsxs)(`label`,{children:[`项目地址`,(0,A.jsxs)(`div`,{className:`share-link-row`,children:[(0,A.jsx)(`input`,{readOnly:!0,"aria-label":`项目分享地址`,value:de($e.id),onFocus:e=>e.currentTarget.select()}),(0,A.jsx)(`button`,{className:`primary`,onClick:async()=>{try{await navigator.clipboard.writeText(de($e.id)),nt(`链接已复制`)}catch{nt(`复制失败,请选中地址手动复制。`)}},children:`复制链接`})]})]}),(0,A.jsx)(`p`,{className:`muted`,children:`企业内用户登录后可通过此链接访问项目。`}),[`localhost`,`127.0.0.1`,`[::1]`].includes(location.hostname)&&(0,A.jsx)(`p`,{className:`muted`,children:`当前是本机地址;分享给同事时需从企业部署地址打开工作台并复制链接。`}),(0,A.jsx)(`div`,{className:`share-feedback`,role:`status`,"aria-live":`polite`,children:tt})]})}),jt&&(0,A.jsxs)(`div`,{className:`project-context-menu`,role:`menu`,"aria-label":`管理项目 ${jt.project.name}`,style:{left:jt.x,top:jt.y,"--menu-top":`${jt.y}px`},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,A.jsx)(`div`,{className:`context-project-name`,title:jt.project.name,children:jt.project.name}),(0,A.jsx)(`button`,{role:`menuitem`,onClick:()=>dr(jt.project),children:(0,A.jsxs)(`span`,{children:[(0,A.jsx)($,{name:`pin`}),jt.project.pinned?`取消置顶`:`置顶`]})}),(0,A.jsx)(`button`,{role:`menuitem`,onClick:()=>fr(jt.project),children:(0,A.jsxs)(`span`,{children:[(0,A.jsx)($,{name:`edit`}),`编辑`]})}),(0,A.jsx)(`button`,{role:`menuitem`,"aria-haspopup":`dialog`,onClick:()=>{wt(jt.project),Et(jt.project.folderId||``),Ot(``),At([``]),F(``),Mt(null)},children:(0,A.jsxs)(`span`,{children:[(0,A.jsx)($,{name:`folder`}),`移动到目录`]})}),(0,A.jsx)(`div`,{className:`context-divider`}),(0,A.jsx)(`button`,{role:`menuitem`,className:`context-delete`,onClick:()=>{Mt(null),Wn(jt.project)},children:(0,A.jsxs)(`span`,{children:[(0,A.jsx)($,{name:`trash`}),`删除项目`]})})]}),Ct&&(0,A.jsx)(`div`,{className:`modal-backdrop`,onMouseDown:()=>{U||wt(null)},children:(0,A.jsxs)(`form`,{className:`modal compact-modal move-project-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`移动到目录`,onMouseDown:e=>e.stopPropagation(),onSubmit:e=>{e.preventDefault(),ur()},children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`h2`,{children:`移动到目录`}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`关闭移动目录`,title:`关闭移动目录`,disabled:U,onClick:()=>wt(null),children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsx)(`p`,{className:`move-project-name`,children:Ct.name}),be&&(0,A.jsx)(`div`,{className:`error`,role:`alert`,children:be}),(0,A.jsxs)(`label`,{className:`move-search`,children:[(0,A.jsx)($,{name:`search`}),(0,A.jsx)(`input`,{autoFocus:!0,type:`search`,"aria-label":`搜索目标目录`,placeholder:`搜索目录或项目`,value:Dt,onChange:e=>Ot(e.target.value)})]}),(0,A.jsxs)(`div`,{className:`move-tree`,"aria-label":`目标目录层级`,children:[(0,A.jsx)(`div`,{className:`move-tree-root`,children:`全部项目`}),[{id:``,name:`未归档`},...gn].map(e=>{let t=vn.filter(t=>(_n.has(t.folderId)?t.folderId:``)===e.id),n=Dt.trim().toLocaleLowerCase(),r=t.filter(e=>e.name.toLocaleLowerCase().includes(n));if(n&&!e.name.toLocaleLowerCase().includes(n)&&!r.length)return null;let i=kt.includes(e.id)||!!n,a=n&&!e.name.toLocaleLowerCase().includes(n)?r:t;return(0,A.jsxs)(`div`,{className:`move-tree-group`,children:[(0,A.jsxs)(`div`,{className:`move-tree-row ${Tt===e.id?`selected`:``}`,children:[(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:U,"aria-label":`${i?`收起`:`展开`}${e.name}`,title:`${i?`收起`:`展开`}${e.name}`,"aria-expanded":i,onClick:()=>At(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),children:(0,A.jsx)($,{name:i?`chevronDown`:`chevronRight`,size:`indicator`})}),(0,A.jsxs)(`button`,{type:`button`,className:`move-tree-select`,disabled:U,"aria-pressed":Tt===e.id,onClick:()=>Et(e.id),children:[(0,A.jsx)(Pd,{open:i}),(0,A.jsx)(`span`,{children:e.name}),(Ct.folderId||``)===e.id&&(0,A.jsx)(`small`,{children:`当前目录`}),Tt===e.id&&(0,A.jsx)($,{name:`check`})]})]}),i&&(0,A.jsx)(`div`,{className:`move-tree-children`,children:a.length?a.map(e=>(0,A.jsxs)(`div`,{className:`move-tree-project`,children:[(0,A.jsx)(Fd,{}),(0,A.jsx)(`span`,{children:e.name}),e.id===Ct.id&&(0,A.jsx)(`small`,{children:`当前项目`})]},e.id)):(0,A.jsx)(`p`,{children:`此目录暂无项目`})})]},e.id)}),Dt.trim()&&![{id:``,name:`未归档`},...gn].some(e=>e.name.toLocaleLowerCase().includes(Dt.trim().toLocaleLowerCase()))&&!vn.some(e=>e.name.toLocaleLowerCase().includes(Dt.trim().toLocaleLowerCase()))&&(0,A.jsx)(`p`,{className:`muted`,children:`未找到匹配的目录或项目`})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:U,onClick:()=>wt(null),children:`取消`}),(0,A.jsx)(`button`,{className:`primary`,disabled:U||Tt===(Ct.folderId||``),children:U?`移动中…`:`移动`})]})]})}),g&&(0,A.jsx)(Hu,{members:N.members,currentMember:ve,kind:g.kind,project:g.project,stage:g.stage,onClose:()=>_(null),onCreate:Fn}),rt&&(0,A.jsx)(`div`,{className:`modal-backdrop`,onMouseDown:()=>{U||it(null)},children:(0,A.jsxs)(`form`,{className:`modal compact-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`创建${rt.kind===`node`?`节点`:rt.kind===`task`?`任务`:`文档`}`,onMouseDown:e=>e.stopPropagation(),onSubmit:e=>{e.preventDefault(),q()},children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsxs)(`h2`,{children:[`创建`,rt.kind===`node`?`节点`:rt.kind===`task`?`任务`:`文档`]}),(0,A.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:U,"aria-label":`关闭`,title:`关闭`,onClick:()=>it(null),children:(0,A.jsx)($,{name:`close`})})]}),rt.stage&&(0,A.jsx)(`p`,{className:`muted`,children:rt.stage}),be&&(0,A.jsx)(`div`,{className:`error`,role:`alert`,children:be}),(0,A.jsxs)(`label`,{children:[`名称`,(0,A.jsx)(`input`,{autoFocus:!0,required:!0,value:at,onChange:e=>ot(e.target.value),placeholder:`输入名称`})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:U,onClick:()=>it(null),children:`取消`}),(0,A.jsx)(`button`,{className:`primary`,disabled:U||!at.trim(),children:U?`创建中…`:`创建`})]})]})}),Ze&&(0,A.jsx)(ed,{members:N.members,folders:gn,currentMember:ve,initialFolder:gn.some(e=>e.id===W)?W:``,onClose:()=>Qe(!1),onCreate:Hn}),xt&&(0,A.jsx)(ed,{project:xt,members:N.members,folders:gn,currentMember:ve,initialFolder:xt.pinned?xt.pinnedFromFolderId||``:xt.folderId||``,onClose:pr,onCreate:mr},xt.id),st&&dt&&(0,A.jsx)(`div`,{className:`modal-backdrop`,onMouseDown:()=>ct(!1),children:(0,A.jsxs)(`section`,{className:`modal danger-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`删除项目`,onMouseDown:e=>e.stopPropagation(),children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`h2`,{children:`删除项目`})}),(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`关闭删除项目`,title:`关闭删除项目`,onClick:()=>ct(!1),children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsx)(`p`,{children:`项目将从所有员工的项目清单中隐藏,数据和审计记录仍会保留,可由管理员恢复。`}),(0,A.jsxs)(`label`,{children:[`请输入项目完整名称以确认 `,(0,A.jsx)(`span`,{children:`*`}),(0,A.jsx)(`input`,{autoFocus:!0,value:lt,onChange:e=>ut(e.target.value),placeholder:dt.name})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`button`,{onClick:()=>ct(!1),children:`取消`}),(0,A.jsx)(`button`,{className:`danger`,disabled:U||lt!==dt.name,onClick:Un,children:`确认删除`})]})]})}),G&&$t&&(0,A.jsx)(`div`,{className:`modal-backdrop`,onMouseDown:()=>Qt(null),children:(0,A.jsxs)(`section`,{className:`modal compact-modal restore-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`恢复内容`,onMouseDown:e=>e.stopPropagation(),children:[(0,A.jsxs)(`div`,{className:`modal-head`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`h2`,{children:G.scopeType===`node`?`恢复节点`:`恢复任务`})}),(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`关闭恢复`,title:`关闭恢复`,onClick:()=>Qt(null),children:(0,A.jsx)($,{name:`close`})})]}),(0,A.jsxs)(`div`,{className:`restore-summary`,children:[(0,A.jsx)(`b`,{children:G.scopeType===`node`?G.nodeName:G.taskTitle}),(0,A.jsxs)(`p`,{children:[`将恢复到“`,$t.project.name,`”`,G.scopeType===`node`?` / 原位置第 ${Number($t.node.order)+1} 列`:G.taskStage?` / ${G.taskStage}`:``,`。`]}),(0,A.jsxs)(`span`,{children:[`同时恢复 `,$t.files.length,` 个知识库/附件文件`]})]}),(0,A.jsxs)(`label`,{children:[`请输入完整`,G.scopeType===`node`?`节点`:`任务`,`名称以确认 `,(0,A.jsx)(`span`,{children:`*`}),(0,A.jsx)(`input`,{autoFocus:!0,value:tn,onChange:e=>nn(e.target.value),placeholder:G.scopeType===`node`?G.nodeName:G.taskTitle})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`button`,{onClick:()=>Qt(null),children:`取消`}),(0,A.jsx)(`button`,{className:`primary`,disabled:U||tn!==(G.scopeType===`node`?G.nodeName:G.taskTitle),onClick:Bn,children:`确认恢复`})]})]})})]}),I&&(0,A.jsx)(`div`,{className:`overlay ${R?`task-overlay-expanded`:``}`,onClick:Nn,children:(0,A.jsxs)(`section`,{className:`drawer task-detail-drawer ${R?`expanded`:``}`,role:`dialog`,"aria-modal":`true`,"aria-label":I.isNew?`创建任务`:`任务详情`,onClick:e=>e.stopPropagation(),children:[(0,A.jsxs)(`div`,{className:`drawer-head`,children:[(0,A.jsxs)(`span`,{children:[I.stage,` / `,I.isNew?`创建任务`:`任务详情`]}),(0,A.jsxs)(`div`,{className:`drawer-head-actions`,children:[(0,A.jsx)(`button`,{className:`icon-button`,title:R?`还原`:`展开详情`,"aria-label":R?`还原`:`展开详情`,onClick:()=>Ce(!R),children:(0,A.jsx)($,{name:R?`collapse`:`expand`})}),(0,A.jsx)(`button`,{className:`icon-button`,"aria-label":`关闭任务详情`,title:`关闭`,onClick:Nn,children:(0,A.jsx)($,{name:`close`})})]})]}),(0,A.jsxs)(`div`,{className:`task-detail-scroll`,children:[be&&(0,A.jsx)(`div`,{className:`error`,role:`alert`,children:be}),(0,A.jsx)(`form`,{id:`task-settings-form`,onSubmit:async e=>{if(e.preventDefault(),ie.current)return;let t=new FormData(e.currentTarget);ie.current=!0;try{await X(async()=>{let e={...Object.fromEntries(t),skills:t.getAll(`skills`)},n=O.current;if(I.isNew&&!n){let t=JSON.stringify([I.projectId,e]);if(re.current?.signature!==t){let n=await J(`/v1/projects/${I.projectId}/task-create-context`),r={...e,contextToken:n.contextToken};await J(`/v1/projects/${I.projectId}/tasks/preview`,`POST`,r),re.current={signature:t,body:r,key:crypto.randomUUID()}}let r=await J(`/v1/projects/${I.projectId}/tasks`,`POST`,re.current.body,{"idempotency-key":re.current.key});n=r.task,O.current=n,await J(`/v1/projects/${I.projectId}/tasks/by-id/${r.task.id}`)}else n=await J(`/tasks/${n?.id||I.id}`,`PATCH`,{...e,version:n?.version??I.version}),O.current=n;for(let e of Se){if(ae.current.has(e.key))continue;let t=new FormData;t.append(`file`,e.file);try{await J(`/tasks/${n.id}/artifacts`,`POST`,t,{"idempotency-key":e.key}),ae.current.add(e.key)}catch{throw Error(`任务已保存,但部分附件上传失败。请再次保存以重试,勿重复创建任务。`)}}L([]),xe(null)})}finally{ie.current=!1}},children:(0,A.jsx)(pd,{task:I,members:N.members,stages:Z.stages,tasks:pn,pages:mn,artifacts:N.artifacts,skillOptions:Array.from(new Set([...N.tasks.flatMap(e=>Array.isArray(e.skills)?e.skills:e.skill?[e.skill]:[]),...N.runs.map(e=>e.skill).filter(Boolean)])),pendingFiles:Se,onFiles:L,busy:U,onOpenTask:async e=>{await c(`跳转将放弃未保存的表单修改,是否继续?`)&&Mn(e)},onOpenPage:async e=>{await c(`打开文档将放弃未保存的表单修改,是否继续?`)&&Cr(e)},executionControls:!I.isNew&&(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(`div`,{className:`task-field task-status-fields`,children:[(0,A.jsx)(`span`,{children:`执行状态`}),(0,A.jsx)(`input`,{type:`hidden`,name:`status`,value:z}),(0,A.jsx)(`div`,{className:`project-filter-segment task-status-segment`,role:`group`,"aria-label":`执行状态`,children:[`待开始`,`进行中`,`已完成`].map(e=>(0,A.jsx)(`button`,{type:`button`,disabled:U,"aria-pressed":z===e,className:z===e?`active`:``,onClick:()=>B(e),children:e===`已完成`?`完成`:e},e))})]})})})},I.id+`-`+I.version),I.blockReason&&I.status===`已阻塞`&&(0,A.jsxs)(`div`,{className:`error`,children:[`阻塞原因:`,I.blockReason]})]}),(0,A.jsxs)(`div`,{className:`drawer-footer`,children:[!I.isNew&&(0,A.jsx)(`button`,{className:`danger-outline delete-task`,disabled:U,title:`预演影响后执行可恢复删除`,onClick:()=>tr(I),children:`删除任务`}),(0,A.jsx)(`button`,{type:`button`,disabled:U,onClick:Nn,children:`取消`}),(0,A.jsx)(`button`,{className:`primary`,type:`submit`,form:`task-settings-form`,disabled:U,children:I.isNew?`创建任务`:`保存`})]})]})}),(y||x)&&(0,A.jsx)(fd,{projectId:Z?.id,task:x||void 0,onClose:()=>{b(!1),S(null),Y()}}),C&&(0,A.jsx)(nd,{onClose:()=>w(!1)}),i&&(0,A.jsx)(hd,{dialog:i,onClose:s},i.id)]}):(0,A.jsxs)(`div`,{className:`loading`,children:[`身份已验证 · 正在读取项目…`,be]}):(0,A.jsx)(`div`,{className:`loading`,children:M.authenticationMessage||`请返回 山海 · OMNI 登录后打开电商工作台。`})}function zd(){return(0,A.jsx)(`section`,{className:`project-collaboration`,children:(0,A.jsx)(`div`,{className:`collaboration-surface`,children:(0,A.jsx)(M,{children:(0,A.jsx)(Rd,{})})})})}var Bd=(0,k.lazy)(()=>C(()=>import(`./project-public-tKjd5rma.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));function Vd({section:e,project:t}){return t?(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(`p`,{role:`status`,children:`正在打开项目资料…`}),children:(0,A.jsx)(Bd,{section:e,project:t})}):e===`legacy`?(0,A.jsx)(i,{}):(0,A.jsx)(zd,{})}export{Vd as default};
|