@dubusoft/toodo-linux-arm64 1.3.3-dev.39 → 1.3.3-dev.41
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/bin/toodo +0 -0
- package/bin/toodo-server +0 -0
- package/package.json +1 -1
- package/web/assets/{details-sheet-BWS6ccAQ.js → details-sheet-BoMHn9cx.js} +1 -1
- package/web/assets/index-BHH1bFqT.js +16 -0
- package/web/assets/{markdown-CT1Xj_d_.js → markdown-CtfSGjCn.js} +1 -1
- package/web/assets/{offline-screen-DiQd-lnA.js → offline-screen-n4YFbFOj.js} +1 -1
- package/web/assets/{review-DUb-ox8c.js → review-kWiC3o8A.js} +1 -1
- package/web/assets/{server-access-BfPQvKo3.js → server-access-cweGdu3a.js} +1 -1
- package/web/assets/status-styles-afrLUTav.js +1 -0
- package/web/assets/task-details-DthIZ1lf.js +4 -0
- package/web/assets/{task-graph-NTqnLqwa.js → task-graph-DGDPhaFM.js} +3 -3
- package/web/assets/{workspace-list-CoCw30hU.js → workspace-list-CMTBXXSj.js} +1 -1
- package/web/index.html +3 -3
- package/web/sw.js +2 -2
- package/web/assets/index-Zmn5kL0P.js +0 -16
- package/web/assets/status-styles-DBWBMQLY.js +0 -1
- package/web/assets/task-details-DKfHFIWc.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./dist-ZmB2kPfR.js";import{Et as s}from"./index-Zmn5kL0P.js";import{t as c}from"./opener-DWhHPoCL.js";var l={name:`square-check`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-square-2`]};l.node;var u=n(l);function d(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var f=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,p=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,m={};function h(e,t){return((t||m).jsx?p:f).test(e)}var g=/[ \t\n\f\r]/g;function _(e){return typeof e==`object`?e.type===`text`&&v(e.value):v(e)}function v(e){return e.replace(g,``)===``}var y=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};y.prototype.normal={},y.prototype.property={},y.prototype.space=void 0;function b(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new y(n,r,t)}function x(e){return e.toLowerCase()}var S=class{constructor(e,t){this.attribute=t,this.property=e}};S.prototype.attribute=``,S.prototype.booleanish=!1,S.prototype.boolean=!1,S.prototype.commaOrSpaceSeparated=!1,S.prototype.commaSeparated=!1,S.prototype.defined=!1,S.prototype.mustUseProperty=!1,S.prototype.number=!1,S.prototype.overloadedBoolean=!1,S.prototype.property=``,S.prototype.spaceSeparated=!1,S.prototype.space=void 0;var C=r({boolean:()=>T,booleanish:()=>E,commaOrSpaceSeparated:()=>j,commaSeparated:()=>A,number:()=>O,overloadedBoolean:()=>D,spaceSeparated:()=>k}),w=0,T=M(),E=M(),D=M(),O=M(),k=M(),A=M(),j=M();function M(){return 2**++w}var N=Object.keys(C),P=class extends S{constructor(e,t,n,r){let i=-1;if(super(e,t),ee(this,`space`,r),typeof n==`number`)for(;++i<N.length;){let e=N[i];ee(this,N[i],(n&C[e])===C[e])}}};P.prototype.defined=!0;function ee(e,t,n){n&&(e[t]=n)}function F(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new P(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[x(r)]=r,n[x(a.attribute)]=r}return new y(t,n,e.space)}var te=F({properties:{ariaActiveDescendant:null,ariaAtomic:E,ariaAutoComplete:null,ariaBusy:E,ariaChecked:E,ariaColCount:O,ariaColIndex:O,ariaColSpan:O,ariaControls:k,ariaCurrent:null,ariaDescribedBy:k,ariaDetails:null,ariaDisabled:E,ariaDropEffect:k,ariaErrorMessage:null,ariaExpanded:E,ariaFlowTo:k,ariaGrabbed:E,ariaHasPopup:null,ariaHidden:E,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:k,ariaLevel:O,ariaLive:null,ariaModal:E,ariaMultiLine:E,ariaMultiSelectable:E,ariaOrientation:null,ariaOwns:k,ariaPlaceholder:null,ariaPosInSet:O,ariaPressed:E,ariaReadOnly:E,ariaRelevant:null,ariaRequired:E,ariaRoleDescription:k,ariaRowCount:O,ariaRowIndex:O,ariaRowSpan:O,ariaSelected:E,ariaSetSize:O,ariaSort:null,ariaValueMax:O,ariaValueMin:O,ariaValueNow:O,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ne(e,t){return t in e?e[t]:t}function re(e,t){return ne(e,t.toLowerCase())}var ie=F({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:A,acceptCharset:k,accessKey:k,action:null,allow:null,allowFullScreen:T,allowPaymentRequest:T,allowUserMedia:T,alpha:T,alt:null,as:null,async:T,autoCapitalize:null,autoComplete:k,autoFocus:T,autoPlay:T,blocking:k,capture:null,charSet:null,checked:T,cite:null,className:k,closedBy:null,colorSpace:null,cols:O,colSpan:O,command:null,commandFor:null,content:null,contentEditable:E,controls:T,controlsList:k,coords:O|A,crossOrigin:null,data:null,dateTime:null,decoding:null,default:T,defer:T,dir:null,dirName:null,disabled:T,download:D,draggable:E,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:T,formTarget:null,headers:k,height:O,hidden:D,high:O,href:null,hrefLang:null,htmlFor:k,httpEquiv:k,id:null,imageSizes:null,imageSrcSet:null,inert:T,inputMode:null,integrity:null,is:null,isMap:T,itemId:null,itemProp:k,itemRef:k,itemScope:T,itemType:k,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:T,low:O,manifest:null,max:null,maxLength:O,media:null,method:null,min:null,minLength:O,multiple:T,muted:T,name:null,nonce:null,noModule:T,noValidate:T,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:T,optimum:O,pattern:null,ping:k,placeholder:null,playsInline:T,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:T,referrerPolicy:null,rel:k,required:T,reversed:T,rows:O,rowSpan:O,sandbox:k,scope:null,scoped:T,seamless:T,selected:T,shadowRootClonable:T,shadowRootCustomElementRegistry:T,shadowRootDelegatesFocus:T,shadowRootMode:null,shadowRootSerializable:T,shape:null,size:O,sizes:null,slot:null,span:O,spellCheck:E,src:null,srcDoc:null,srcLang:null,srcSet:null,start:O,step:null,style:null,tabIndex:O,target:null,title:null,translate:null,type:null,typeMustMatch:T,useMap:null,value:E,width:O,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:k,axis:null,background:null,bgColor:null,border:O,borderColor:null,bottomMargin:O,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:T,declare:T,event:null,face:null,frame:null,frameBorder:null,hSpace:O,leftMargin:O,link:null,longDesc:null,lowSrc:null,marginHeight:O,marginWidth:O,noResize:T,noHref:T,noShade:T,noWrap:T,object:null,profile:null,prompt:null,rev:null,rightMargin:O,rules:null,scheme:null,scrolling:E,standby:null,summary:null,text:null,topMargin:O,valueType:null,version:null,vAlign:null,vLink:null,vSpace:O,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:T,disablePictureInPicture:T,disableRemotePlayback:T,exportParts:A,part:k,prefix:null,property:null,results:O,security:null,unselectable:null},space:`html`,transform:re}),ae=F({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:j,accentHeight:O,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:O,amplitude:O,arabicForm:null,ascent:O,attributeName:null,attributeType:null,azimuth:O,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:O,by:null,calcMode:null,capHeight:O,className:k,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:O,diffuseConstant:O,direction:null,display:null,dur:null,divisor:O,dominantBaseline:null,download:T,dx:null,dy:null,edgeMode:null,editable:null,elevation:O,enableBackground:null,end:null,event:null,exponent:O,externalResourcesRequired:null,fill:null,fillOpacity:O,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:A,g2:A,glyphName:A,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:O,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:O,horizOriginX:O,horizOriginY:O,id:null,ideographic:O,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:O,k:O,k1:O,k2:O,k3:O,k4:O,kernelMatrix:j,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:O,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:O,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:O,overlineThickness:O,paintOrder:null,panose1:null,path:null,pathLength:O,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:k,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:O,pointsAtY:O,pointsAtZ:O,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:j,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:j,rev:j,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:j,requiredFeatures:j,requiredFonts:j,requiredFormats:j,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:O,specularExponent:O,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:O,strikethroughThickness:O,string:null,stroke:null,strokeDashArray:j,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:O,strokeOpacity:O,strokeWidth:null,style:null,surfaceScale:O,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:j,tabIndex:O,tableValues:null,target:null,targetX:O,targetY:O,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:j,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:O,underlineThickness:O,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:O,values:null,vAlphabetic:O,vMathematical:O,vectorEffect:null,vHanging:O,vIdeographic:O,version:null,vertAdvY:O,vertOriginX:O,vertOriginY:O,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:O,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ne}),oe=F({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()}}),se=F({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:re}),ce=F({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),le={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`},ue=/[A-Z]/g,de=/-[a-z]/g,fe=/^data[-\w.:]+$/i;function pe(e,t){let n=x(t),r=t,i=S;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&fe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(de,he);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!de.test(e)){let n=e.replace(ue,me);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=P}return new i(r,t)}function me(e){return`-`+e.toLowerCase()}function he(e){return e.charAt(1).toUpperCase()}var ge=b([te,ie,oe,se,ce],`html`),_e=b([te,ae,oe,se,ce],`svg`);function ve(e){return e.join(` `).trim()}var ye=e(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./dist-ZmB2kPfR.js";import{Et as s}from"./index-BHH1bFqT.js";import{t as c}from"./opener-DWhHPoCL.js";var l={name:`square-check`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-square-2`]};l.node;var u=n(l);function d(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var f=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,p=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,m={};function h(e,t){return((t||m).jsx?p:f).test(e)}var g=/[ \t\n\f\r]/g;function _(e){return typeof e==`object`?e.type===`text`&&v(e.value):v(e)}function v(e){return e.replace(g,``)===``}var y=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};y.prototype.normal={},y.prototype.property={},y.prototype.space=void 0;function b(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new y(n,r,t)}function x(e){return e.toLowerCase()}var S=class{constructor(e,t){this.attribute=t,this.property=e}};S.prototype.attribute=``,S.prototype.booleanish=!1,S.prototype.boolean=!1,S.prototype.commaOrSpaceSeparated=!1,S.prototype.commaSeparated=!1,S.prototype.defined=!1,S.prototype.mustUseProperty=!1,S.prototype.number=!1,S.prototype.overloadedBoolean=!1,S.prototype.property=``,S.prototype.spaceSeparated=!1,S.prototype.space=void 0;var C=r({boolean:()=>T,booleanish:()=>E,commaOrSpaceSeparated:()=>j,commaSeparated:()=>A,number:()=>O,overloadedBoolean:()=>D,spaceSeparated:()=>k}),w=0,T=M(),E=M(),D=M(),O=M(),k=M(),A=M(),j=M();function M(){return 2**++w}var N=Object.keys(C),P=class extends S{constructor(e,t,n,r){let i=-1;if(super(e,t),ee(this,`space`,r),typeof n==`number`)for(;++i<N.length;){let e=N[i];ee(this,N[i],(n&C[e])===C[e])}}};P.prototype.defined=!0;function ee(e,t,n){n&&(e[t]=n)}function F(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new P(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[x(r)]=r,n[x(a.attribute)]=r}return new y(t,n,e.space)}var te=F({properties:{ariaActiveDescendant:null,ariaAtomic:E,ariaAutoComplete:null,ariaBusy:E,ariaChecked:E,ariaColCount:O,ariaColIndex:O,ariaColSpan:O,ariaControls:k,ariaCurrent:null,ariaDescribedBy:k,ariaDetails:null,ariaDisabled:E,ariaDropEffect:k,ariaErrorMessage:null,ariaExpanded:E,ariaFlowTo:k,ariaGrabbed:E,ariaHasPopup:null,ariaHidden:E,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:k,ariaLevel:O,ariaLive:null,ariaModal:E,ariaMultiLine:E,ariaMultiSelectable:E,ariaOrientation:null,ariaOwns:k,ariaPlaceholder:null,ariaPosInSet:O,ariaPressed:E,ariaReadOnly:E,ariaRelevant:null,ariaRequired:E,ariaRoleDescription:k,ariaRowCount:O,ariaRowIndex:O,ariaRowSpan:O,ariaSelected:E,ariaSetSize:O,ariaSort:null,ariaValueMax:O,ariaValueMin:O,ariaValueNow:O,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ne(e,t){return t in e?e[t]:t}function re(e,t){return ne(e,t.toLowerCase())}var ie=F({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:A,acceptCharset:k,accessKey:k,action:null,allow:null,allowFullScreen:T,allowPaymentRequest:T,allowUserMedia:T,alpha:T,alt:null,as:null,async:T,autoCapitalize:null,autoComplete:k,autoFocus:T,autoPlay:T,blocking:k,capture:null,charSet:null,checked:T,cite:null,className:k,closedBy:null,colorSpace:null,cols:O,colSpan:O,command:null,commandFor:null,content:null,contentEditable:E,controls:T,controlsList:k,coords:O|A,crossOrigin:null,data:null,dateTime:null,decoding:null,default:T,defer:T,dir:null,dirName:null,disabled:T,download:D,draggable:E,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:T,formTarget:null,headers:k,height:O,hidden:D,high:O,href:null,hrefLang:null,htmlFor:k,httpEquiv:k,id:null,imageSizes:null,imageSrcSet:null,inert:T,inputMode:null,integrity:null,is:null,isMap:T,itemId:null,itemProp:k,itemRef:k,itemScope:T,itemType:k,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:T,low:O,manifest:null,max:null,maxLength:O,media:null,method:null,min:null,minLength:O,multiple:T,muted:T,name:null,nonce:null,noModule:T,noValidate:T,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:T,optimum:O,pattern:null,ping:k,placeholder:null,playsInline:T,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:T,referrerPolicy:null,rel:k,required:T,reversed:T,rows:O,rowSpan:O,sandbox:k,scope:null,scoped:T,seamless:T,selected:T,shadowRootClonable:T,shadowRootCustomElementRegistry:T,shadowRootDelegatesFocus:T,shadowRootMode:null,shadowRootSerializable:T,shape:null,size:O,sizes:null,slot:null,span:O,spellCheck:E,src:null,srcDoc:null,srcLang:null,srcSet:null,start:O,step:null,style:null,tabIndex:O,target:null,title:null,translate:null,type:null,typeMustMatch:T,useMap:null,value:E,width:O,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:k,axis:null,background:null,bgColor:null,border:O,borderColor:null,bottomMargin:O,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:T,declare:T,event:null,face:null,frame:null,frameBorder:null,hSpace:O,leftMargin:O,link:null,longDesc:null,lowSrc:null,marginHeight:O,marginWidth:O,noResize:T,noHref:T,noShade:T,noWrap:T,object:null,profile:null,prompt:null,rev:null,rightMargin:O,rules:null,scheme:null,scrolling:E,standby:null,summary:null,text:null,topMargin:O,valueType:null,version:null,vAlign:null,vLink:null,vSpace:O,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:T,disablePictureInPicture:T,disableRemotePlayback:T,exportParts:A,part:k,prefix:null,property:null,results:O,security:null,unselectable:null},space:`html`,transform:re}),ae=F({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:j,accentHeight:O,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:O,amplitude:O,arabicForm:null,ascent:O,attributeName:null,attributeType:null,azimuth:O,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:O,by:null,calcMode:null,capHeight:O,className:k,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:O,diffuseConstant:O,direction:null,display:null,dur:null,divisor:O,dominantBaseline:null,download:T,dx:null,dy:null,edgeMode:null,editable:null,elevation:O,enableBackground:null,end:null,event:null,exponent:O,externalResourcesRequired:null,fill:null,fillOpacity:O,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:A,g2:A,glyphName:A,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:O,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:O,horizOriginX:O,horizOriginY:O,id:null,ideographic:O,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:O,k:O,k1:O,k2:O,k3:O,k4:O,kernelMatrix:j,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:O,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:O,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:O,overlineThickness:O,paintOrder:null,panose1:null,path:null,pathLength:O,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:k,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:O,pointsAtY:O,pointsAtZ:O,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:j,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:j,rev:j,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:j,requiredFeatures:j,requiredFonts:j,requiredFormats:j,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:O,specularExponent:O,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:O,strikethroughThickness:O,string:null,stroke:null,strokeDashArray:j,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:O,strokeOpacity:O,strokeWidth:null,style:null,surfaceScale:O,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:j,tabIndex:O,tableValues:null,target:null,targetX:O,targetY:O,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:j,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:O,underlineThickness:O,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:O,values:null,vAlphabetic:O,vMathematical:O,vectorEffect:null,vHanging:O,vIdeographic:O,version:null,vertAdvY:O,vertOriginX:O,vertOriginY:O,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:O,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ne}),oe=F({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()}}),se=F({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:re}),ce=F({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),le={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`},ue=/[A-Z]/g,de=/-[a-z]/g,fe=/^data[-\w.:]+$/i;function pe(e,t){let n=x(t),r=t,i=S;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&fe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(de,he);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!de.test(e)){let n=e.replace(ue,me);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=P}return new i(r,t)}function me(e){return`-`+e.toLowerCase()}function he(e){return e.charAt(1).toUpperCase()}var ge=b([te,ie,oe,se,ce],`html`),_e=b([te,ae,oe,se,ce],`svg`);function ve(e){return e.join(` `).trim()}var ye=e(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
2
2
|
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),be=e((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(ye());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),xe=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Se=e(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(be()),r=xe();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Ce=Te(`end`),we=Te(`start`);function Te(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 Ee(e){let t=we(e),n=Ce(e);if(t&&n)return{start:t,end:n}}function De(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ke(e.position):`start`in e||`end`in e?ke(e):`line`in e||`column`in e?Oe(e):``}function Oe(e){return Ae(e&&e.line)+`:`+Ae(e&&e.column)}function ke(e){return Oe(e&&e.start)+`-`+Oe(e&&e.end)}function Ae(e){return e&&typeof e==`number`?e:1}var I=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&&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=De(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}};I.prototype.file=``,I.prototype.name=``,I.prototype.reason=``,I.prototype.message=``,I.prototype.stack=``,I.prototype.column=void 0,I.prototype.line=void 0,I.prototype.ancestors=void 0,I.prototype.cause=void 0,I.prototype.fatal=void 0,I.prototype.place=void 0,I.prototype.ruleId=void 0,I.prototype.source=void 0;var je=a(Se(),1),Me={}.hasOwnProperty,Ne=new Map,Pe=/[A-Z]/g,Fe=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ie=new Set([`td`,`th`]),Le=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Re(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=Ye(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=Je(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`?_e:ge,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ze(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ze(e,t,n){if(t.type===`element`)return Be(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ve(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ue(e,t,n);if(t.type===`mdxjsEsm`)return He(e,t);if(t.type===`root`)return We(e,t,n);if(t.type===`text`)return Ge(e,t)}function Be(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=_e,e.schema=i),e.ancestors.push(t);let a=tt(e,t.tagName,!1),o=Xe(e,t),s=Qe(e,t);return Fe.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!_(e)})),Ke(e,o,a,t),qe(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ve(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)}nt(e,t.position)}function He(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);nt(e,t.position)}function Ue(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=_e,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:tt(e,t.name,!0),o=Ze(e,t),s=Qe(e,t);return Ke(e,o,a,t),qe(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function We(e,t,n){let r={};return qe(r,Qe(e,t)),e.create(t,e.Fragment,r,n)}function Ge(e,t){return t.value}function Ke(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qe(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Je(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 Ye(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=we(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 Xe(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Me.call(t.properties,i)){let a=$e(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ie.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 Ze(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 nt(e,t.position)}else{let i=r.name,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 nt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Qe(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ne;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=ze(e,a,o);s!==void 0&&n.push(s)}return n}function $e(e,t,n){let r=pe(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?d(n):ve(n)),r.property===`style`){let t=typeof n==`object`?n:et(e,String(n));return e.stylePropertyNameCase===`css`&&(t=rt(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?le[r.property]||r.property:r.attribute,n]}}function et(e,t){try{return(0,je.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new I("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=Le+`#cannot-parse-style-attribute`,r}}function tt(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=h(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=h(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Me.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);nt(e)}function nt(e,t){let n=new I("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=Le+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function rt(e){let t={},n;for(n in e)Me.call(e,n)&&(t[it(n)]=e[n]);return t}function it(e){let t=e.replace(Pe,at);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function at(e){return`-`+e.toLowerCase()}var ot={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`]},st={};function ct(e,t){let n=t||st;return lt(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function lt(e,t,n){if(dt(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 ut(e.children,t,n)}return Array.isArray(e)?ut(e,t,n):``}function ut(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=lt(e[i],t,n);return r.join(``)}function dt(e){return!!(e&&typeof e==`object`)}var ft=document.createElement(`i`);function pt(e){let t=`&`+e+`;`;ft.innerHTML=t;let n=ft.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function L(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 R(e,t){return e.length>0?(L(e,e.length,0,t),e):t}var mt={}.hasOwnProperty;function ht(e){let t={},n=-1;for(;++n<e.length;)gt(t,e[n]);return t}function gt(e,t){let n;for(n in t){let r=(mt.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){mt.call(r,a)||(r[a]=[]);let e=i[a];_t(r[a],Array.isArray(e)?e:e?[e]:[])}}}function _t(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);L(e,0,0,r)}function vt(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 z(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var B=K(/[A-Za-z]/),V=K(/[\dA-Za-z]/),yt=K(/[#-'*+\--9=?A-Z^-~]/);function bt(e){return e!==null&&(e<32||e===127)}var xt=K(/\d/),St=K(/[\dA-Fa-f]/),Ct=K(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function U(e){return e!==null&&(e<0||e===32)}function W(e){return e===-2||e===-1||e===32}var wt=K(/\p{P}|\p{S}/u),G=K(/\s/);function K(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Tt(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&V(e.charCodeAt(n+1))&&V(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 W(r)?(e.enter(n),s(r)):t(r)}function s(r){return W(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Et(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&W(t)?(e.enter(r),c(t)):l(t)}function c(t){return W(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Dt={tokenize:Ot};function Ot(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),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);else return H(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var kt=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){At(this,e,t,n,!1)}addBefore(e,t,n){At(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 At(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 jt={tokenize:Nt},Mt={tokenize:Pt};function Nt(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 kt;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(Mt,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(Mt,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return H(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 kt;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 Pt(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 Ft(e){if(e===null||U(e)||G(e))return 1;if(wt(e))return 2}function It(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 Lt={name:`attention`,resolveAll:Rt,tokenize:zt};function Rt(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};Bt(o,-a),Bt(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=R(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=R(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=R(r,It(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=R(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=R(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),L(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 zt(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ft(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=Ft(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 Bt(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Vt={name:`autolink`,tokenize:Ht};function Ht(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 B(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||V(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||V(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||bt(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):yt(t)?(e.consume(t),l):n(t)}function u(e){return V(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||V(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Ut={partial:!0,tokenize:Wt};function Wt(e,t,n){return r;function r(t){return W(t)?q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||H(e)?t(e):n(e)}}var Gt={continuation:{tokenize:qt},exit:Jt,name:`blockQuote`,tokenize:Kt};function Kt(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 W(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function qt(e,t,n){let r=this;return i;function i(t){return W(t)?q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Gt,t,n)(r)}}function Jt(e){e.exit(`blockQuote`)}var Yt={name:`characterEscape`,tokenize:Xt};function Xt(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 Ct(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Zt={name:`characterReference`,tokenize:Qt};function Qt(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=V,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=St,u):(e.enter(`characterReferenceValue`),a=7,o=xt,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===V&&!pt(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 $t={partial:!0,tokenize:en};function en(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 tn={concrete:!0,name:`codeFenced`,tokenize:nn};function nn(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`),W(t)?q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||H(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check($t,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):W(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||H(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||H(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&&W(t)?q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||H(t)?e.check($t,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||H(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`),W(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`),W(t)?q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||H(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var rn={name:`codeIndented`,tokenize:on},an={partial:!0,tokenize:sn};function on(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Et(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):H(t)?e.attempt(an,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||H(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function sn(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):H(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Et(e,t,a,`linePrefix`,4,4)(o)}function a(e){return H(e)?i(e):n(e)}}var cn={name:`codeText`,previous:un,resolve:ln,tokenize:dn};function ln(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 un(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function dn(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)):H(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||H(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 fn=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&&pn(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),pn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),pn(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);pn(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);pn(this.left,t.reverse())}}}};function pn(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 mn(e){let t={},n=-1,r,i,a,o,s,c,l,u=new fn(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,hn(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 L(e,0,1/0,u.slice(0)),!l}function hn(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 gn={resolve:vn,tokenize:yn},_n={partial:!0,tokenize:bn};function vn(e){return mn(e),e}function yn(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):H(t)?e.check(_n,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 bn(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||H(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 xn(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||bt(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||H(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||U(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||bt(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 Sn(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):H(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||H(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!W(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Cn(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):H(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||H(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 wn(e,t){let n;return r;function r(i){return H(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):W(i)?q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Tn={name:`definition`,tokenize:Dn},En={partial:!0,tokenize:On};function Dn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Sn.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=z(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 U(t)?wn(e,l)(t):l(t)}function l(t){return xn(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(En,d,d)(t)}function d(t){return W(t)?q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||H(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function On(e,t,n){return r;function r(t){return U(t)?wn(e,i)(t):n(t)}function i(t){return Cn(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return W(t)?q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||H(e)?t(e):n(e)}}var kn={name:`hardBreakEscape`,tokenize:An};function An(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return H(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var jn={name:`headingAtx`,resolve:Mn,tokenize:Nn};function Mn(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`};L(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Nn(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||U(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||H(n)?(e.exit(`atxHeading`),t(n)):W(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||U(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Pn=`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(`.`),Fn=[`pre`,`script`,`style`,`textarea`],In={concrete:!0,name:`htmlFlow`,resolveTo:Rn,tokenize:zn},Ln={partial:!0,tokenize:Bn};function Rn(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 zn(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:F):B(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):B(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return B(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||U(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Fn.includes(l)?(i=1,r.interrupt?t(s):O(s)):Pn.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||V(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return W(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||B(t)?(e.consume(t),b):W(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||V(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):W(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):W(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||H(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||U(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||W(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||H(t)?O(t):W(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),ee):H(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Ln,ne,k)(t)):t===null||H(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check($t,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||H(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Fn.includes(n)?(e.consume(t),te):O(t)}return B(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function ee(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),F):O(t)}function te(t){return t===null||H(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function Bn(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Ut,t,n)}}var Vn={name:`htmlText`,tokenize:Hn};function Hn(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):B(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):B(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):H(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):H(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):H(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):H(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return B(t)?(e.consume(t),S):n(t)}function S(t){return t===45||V(t)?(e.consume(t),S):C(t)}function C(t){return H(t)?(o=C,N(t)):W(t)?(e.consume(t),C):M(t)}function w(t){return t===45||V(t)?(e.consume(t),w):t===47||t===62||U(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||B(t)?(e.consume(t),E):H(t)?(o=T,N(t)):W(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||V(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):H(t)?(o=D,N(t)):W(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):H(t)?(o=O,N(t)):W(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):H(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||U(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||U(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return W(t)?q(e,ee,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ee(t)}function ee(t){return e.enter(`htmlTextData`),o(t)}}var Un={name:`labelEnd`,resolveAll:qn,resolveTo:Jn,tokenize:Yn},Wn={tokenize:Xn},Gn={tokenize:Zn},Kn={tokenize:Qn};function qn(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&&L(e,0,e.length,n),e}function Jn(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=R(o,e.slice(i+1,i+r+3)),o=R(o,[[`enter`,l,t]]),o=R(o,It(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=R(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=R(o,e.slice(a+1)),o=R(o,[[`exit`,s,t]]),L(e,i,e.length,o),e}function Yn(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(z(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(Wn,u,o?u:d)(t):t===91?e.attempt(Gn,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Kn,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Xn(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 U(t)?wn(e,a)(t):a(t)}function a(t){return t===41?u(t):xn(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return U(t)?wn(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Cn(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return U(t)?wn(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 Zn(e,t,n){let r=this;return i;function i(t){return Sn.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(z(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Qn(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 $n={name:`labelStartImage`,resolveAll:Un.resolveAll,tokenize:er};function er(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 tr={name:`labelStartLink`,resolveAll:Un.resolveAll,tokenize:nr};function nr(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 rr={name:`lineEnding`,tokenize:ir};function ir(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),q(e,t,`linePrefix`)}}var ar={name:`thematicBreak`,tokenize:or};function or(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||H(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),W(t)?q(e,s,`whitespace`)(t):s(t))}}var J={continuation:{tokenize:ur},exit:fr,name:`list`,tokenize:lr},sr={partial:!0,tokenize:pr},cr={partial:!0,tokenize:dr};function lr(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:xt(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(ar,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 xt(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(Ut,r.interrupt?n:u,e.attempt(sr,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return W(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 ur(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ut,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||!W(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(cr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,q(e,e.attempt(J,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function dr(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 fr(e){e.exit(this.containerState.type)}function pr(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!W(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var mr={name:`setextUnderline`,resolveTo:hr,tokenize:gr};function hr(e,t){let n=new kt,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 gr(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`),W(t)?q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||H(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var _r={tokenize:vr};function vr(e){let t=this,n=e.attempt(Ut,r,e.attempt(this.parser.constructs.flowInitial,i,q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(gn,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var yr={resolveAll:Cr()},br=Sr(`string`),xr=Sr(`text`);function Sr(e){return{resolveAll:Cr(e===`text`?wr:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Cr(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 wr(e,t){let n=new kt,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 Tr=r({attentionMarkers:()=>Nr,contentInitial:()=>Dr,disable:()=>Pr,document:()=>Er,flow:()=>kr,flowInitial:()=>Or,insideSpan:()=>Mr,string:()=>Ar,text:()=>jr}),Er={42:J,43:J,45:J,48:J,49:J,50:J,51:J,52:J,53:J,54:J,55:J,56:J,57:J,62:Gt},Dr={91:Tn},Or={[-2]:rn,[-1]:rn,32:rn},kr={35:jn,42:ar,45:[mr,ar],60:In,61:mr,95:ar,96:tn,126:tn},Ar={38:Zt,92:Yt},jr={[-5]:rr,[-4]:rr,[-3]:rr,33:$n,38:Zt,42:Lt,60:[Vt,Vn],91:tr,92:[kn,Yt],93:Un,95:Lt,96:cn},Mr={null:[Lt,yr]},Nr={null:[42,95]},Pr={null:[]};function Fr(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=R(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=It(a,l.events,l),l.events):[]}function f(e,t){return Lr(p(e),t)}function p(e){return Ir(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){H(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&L(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ir(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 Lr(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=`
|
|
3
3
|
`;break;case-3:o=`\r
|
|
4
4
|
`;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 Rr(e){let t={constructs:ht([Tr,...(e||{}).extensions||[]]),content:n(Dt),defined:[],document:n(jt),flow:n(_r),lazy:{},string:n(br),text:n(xr)};return t;function n(e){return n;function n(n){return Fr(t,e,n)}}}function zr(e){for(;!mn(e););return e}var Br=/[\0\t\n\r]/g;function Vr(){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;){Br.lastIndex=c;let n=Br.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 Hr=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ur(e){return e.replace(Hr,Wr)}function Wr(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return vt(n.slice(t?2:1),t?16:10)}return pt(n)||e}var Gr={}.hasOwnProperty;function Kr(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),qr(n)(zr(Rr(n).document().write(Vr()(e,t,!0))))}function qr(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(be),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(ge),blockQuote:o(de),characterEscape:E,characterReference:E,codeFenced:o(fe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(fe,s),codeText:o(pe,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(me),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(he),hardBreakEscape:o(_e),hardBreakTrailing:o(_e),htmlFlow:o(ve,s),htmlFlowData:E,htmlText:o(ve,s),htmlTextData:E,image:o(ye),label:s,link:o(be),listItem:o(Se),listItemValue:p,listOrdered:o(xe,f),listUnordered:o(xe),paragraph:o(Ce),reference:ie,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ge),strong:o(we),thematicBreak:o(Ee)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ue,autolinkProtocol:le,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:se,characterReference:ce,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:F,labelText:ee,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:te,resourceTitleString:ne,resource:re,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};Jr(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]),Gr.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]||Xr).call(o,void 0,e[0])}for(r.position={start:Y(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Y(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:Y(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+"` ("+De({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Xr).call(this,e,r[0])),n.position.end=Y(e.end)}function d(){return ct(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=z(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Te(),n.position={start:Y(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Y(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Y(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ur(t),n.identifier=z(t).toLowerCase()}function F(){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 te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function ie(){this.data.referenceType=`collapsed`}function ae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=z(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function oe(e){this.data.characterReferenceType=e.type}function se(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=vt(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=pt(t);let i=this.stack[this.stack.length-1];i.value+=r}function ce(e){let t=this.stack.pop();t.position.end=Y(e.end)}function le(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function de(){return{type:`blockquote`,children:[],position:void 0}}function fe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function pe(){return{type:`inlineCode`,value:``,position:void 0}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function he(){return{type:`emphasis`,children:[],position:void 0}}function ge(){return{type:`heading`,depth:0,children:[],position:void 0}}function _e(){return{type:`break`,position:void 0}}function ve(){return{type:`html`,value:``,position:void 0}}function ye(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function be(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function Se(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Ce(){return{type:`paragraph`,children:[],position:void 0}}function we(){return{type:`strong`,children:[],position:void 0}}function Te(){return{type:`text`,value:``,position:void 0}}function Ee(){return{type:`thematicBreak`,position:void 0}}}function Y(e){return{line:e.line,column:e.column,offset:e.offset}}function Jr(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Jr(e,r):Yr(e,r)}}function Yr(e,t){let n;for(n in t)if(Gr.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 Xr(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+De({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+De({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+De({start:t.start,end:t.end})+`) is still open`)}function Zr(e){let t=this;t.parser=n;function n(n){return Kr(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Qr(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 $r(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,s as r}from"./dist-ZmB2kPfR.js";import{
|
|
1
|
+
import{i as e,n as t,r as n,s as r}from"./dist-ZmB2kPfR.js";import{Bn as i,g as a,zt as o}from"./status-styles-afrLUTav.js";import{d as s,f as c,h as l,m as u}from"./event-DMqRNLc_.js";import{W as d}from"./index-BHH1bFqT.js";var f={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};f.node;var p=t(f),m=r(e(),1),h=n();function g({children:e}){let t=(0,m.useSyncExternalStore)(u,s),n=t===`unreachable`||t===`retrying`;return(0,h.jsxs)(h.Fragment,{children:[n&&(0,h.jsx)(_,{retrying:t===`retrying`}),e,n&&(0,h.jsx)(`div`,{"aria-hidden":!0,className:`h-40`})]})}function _({retrying:e}){let t=navigator.onLine?l():`This device is offline.`,n=i().getQueryState(a.tasks)?.dataUpdatedAt;return(0,h.jsxs)(`div`,{role:`alert`,className:`fixed inset-x-2 bottom-2 z-50 mx-auto flex max-w-xl flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border border-amber-500 bg-amber-100 p-3 text-sm text-amber-950 shadow-md dark:bg-amber-950 dark:text-amber-100`,children:[(0,h.jsx)(p,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`font-medium`,children:`Can't reach the Toodo server`}),(0,h.jsxs)(`p`,{className:`text-xs`,children:[t,` `,n?(0,h.jsxs)(h.Fragment,{children:[`Read-only: the tasks shown were loaded `,(0,h.jsx)(d,{at:Math.floor(n/1e3)}),` and may be out of date.`]}):`What you see may be out of date.`,` `,`Changes are paused. Toodo reconnects on its own as soon as the server answers.`]})]}),(0,h.jsx)(o,{size:`sm`,variant:`outline`,disabled:e,onClick:c,children:e?`Trying...`:`Retry now`})]})}export{g as ConnectionGate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,s as r,t as i}from"./dist-ZmB2kPfR.js";import{Rt as a,d as o,o as s,ot as c,s as l,wt as ee}from"./status-styles-DBWBMQLY.js";import{g as u,h as d,s as f}from"./workspace-list-CoCw30hU.js";import{A as te,At as p,B as m,C as h,D as g,E as _,F as v,I as y,L as b,M as x,N as S,O as C,P as w,R as T,S as E,St as D,T as O,U as k,V as A,W as j,X as M,_ as N,b as P,g as F,h as I,j as L,k as R,m as z,p as B,s as V,v as H,w as U,x as W,y as G,z as K}from"./index-Zmn5kL0P.js";import{t as q}from"./opener-DWhHPoCL.js";var J={name:`calendar-check`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]};J.node;var Y=t(J),X=r(e(),1),Z=n(),ne={completed:o.success,opened_for_review:o.review,started:o.progress,worked_on:o.progress,planned:o.neutral},re=i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,s.neutral),Q=[{kind:`week`,label:`Week`},{kind:`month`,label:`Month`},{kind:`quarter`,label:`Quarter`},{kind:`year`,label:`Year`},{kind:`custom`,label:`Custom`}];function ie(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}function ae({disabled:e,children:t}){let[n,r]=(0,X.useState)(!1),i=(0,X.useRef)(null);return(0,X.useEffect)(()=>{if(!n)return;let e=e=>{i.current?.contains(e.target)||r(!1)},t=e=>e.key===`Escape`&&r(!1);return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]),(0,Z.jsxs)(`div`,{ref:i,className:`relative`,children:[(0,Z.jsxs)(a,{size:`sm`,"aria-haspopup":`menu`,"aria-expanded":n,disabled:e,onClick:()=>r(!n),children:[(0,Z.jsx)(p,{}),(0,Z.jsx)(`span`,{className:`max-md:sr-only`,children:`Export`})]}),n&&(0,Z.jsx)(`div`,{role:`menu`,"aria-label":`Export review`,className:`absolute right-0 z-10 mt-1 flex w-48 flex-col rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:t(()=>r(!1))})]})}function $({onSelect:e,children:t}){return(0,Z.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:e,className:`rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted max-md:min-h-11`,children:t})}function oe({onShowTask:e}){let[t,n]=(0,X.useState)(()=>g(`week`,D(Date.now()/1e3))),[r,o]=(0,X.useState)(null),[l,p]=(0,X.useState)(U),{start:h,end:x}=_(t),S=c(h,x),A=ee(),N=new Map(A.data?.map(e=>[e.id,e.name])),P=S.data&&F(S.data,l),I=y(S.data??[]);l.label!==null&&!I.includes(l.label)&&I.push(l.label);let L=[l.workspaceId===null?`across all workspaces`:`in ${N.get(l.workspaceId)??`workspace ${l.workspaceId}`}`,l.label!==null&&`labelled ${l.label}`].filter(Boolean).join(`, `),z=R[t.kind];function H(e){o(null),n(e)}function W(e){e!==t.kind&&H(e===`custom`?{...t,kind:e}:g(e,t.from))}async function G(e){try{await navigator.clipboard.writeText(b(t,e,A.data??[],Date.now()/1e3)),o(`Copied as Markdown.`)}catch(e){o(`Could not copy: ${String(e)}`)}}function K(e,n){let r=A.data??[],i=e===`csv`?w(n,r,Date.now()/1e3):b(t,n,r,Date.now()/1e3),a=v(t,e);ie(a,i,e===`csv`?`text/csv`:`text/markdown`),o(`Downloaded ${a}`)}return(0,Z.jsxs)(`section`,{"aria-labelledby":`review-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h2`,{id:`review-heading`,className:`text-xl font-semibold tracking-tight`,children:te[t.kind]}),(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Work recorded from `,t.from,` to `,t.to,` `,L,`.`]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 print:hidden`,children:[(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Review period`,className:`flex rounded-md border p-0.5 max-md:w-full`,children:Q.map(({kind:e,label:n})=>(0,Z.jsx)(a,{size:`sm`,variant:t.kind===e?`default`:`ghost`,"aria-pressed":t.kind===e,onClick:()=>W(e),children:n},e))}),t.kind===`week`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{htmlFor:`week-start`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`Week starting`}),(0,Z.jsx)(`input`,{id:`week-start`,type:`date`,required:!0,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40 max-md:w-0 max-md:min-w-0 max-md:flex-1`),value:t.from,onChange:e=>e.target.value&&H(m(e.target.value))})]}),t.kind===`custom`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{htmlFor:`review-from`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`From`}),(0,Z.jsx)(`input`,{id:`review-from`,type:`date`,required:!0,max:t.to,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.from,onChange:e=>e.target.value&&e.target.value<=t.to&&H({...t,from:e.target.value})}),(0,Z.jsx)(`label`,{htmlFor:`review-to`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`To`}),(0,Z.jsx)(`input`,{id:`review-to`,type:`date`,required:!0,min:t.from,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.to,onChange:e=>e.target.value&&e.target.value>=t.from&&H({...t,to:e.target.value})})]}),t.kind!==`week`&&t.kind!==`custom`&&(0,Z.jsx)(`span`,{className:`px-1 text-sm font-medium`,children:C(t)}),(0,Z.jsx)(a,{size:`icon-sm`,variant:`outline`,"aria-label":`Previous ${z}`,title:`Previous ${z}`,onClick:()=>H(T(t,-1)),children:(0,Z.jsx)(d,{})}),(0,Z.jsx)(a,{size:`icon-sm`,variant:`outline`,"aria-label":`Next ${z}`,title:`Next ${z}`,onClick:()=>H(T(t,1)),children:(0,Z.jsx)(u,{})}),t.kind!==`custom`&&(0,Z.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:()=>H(g(t.kind,D(Date.now()/1e3))),children:[(0,Z.jsx)(Y,{className:`md:hidden`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`max-md:sr-only`,children:[`This `,z]})]}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(ae,{disabled:!P,children:e=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{onSelect:()=>{e(),P&&G(P)},children:`Copy as Markdown`}),(0,Z.jsx)($,{onSelect:()=>{e(),P&&K(`md`,P)},children:`Save as Markdown`}),(0,Z.jsx)($,{onSelect:()=>{e(),P&&K(`csv`,P)},children:`Save as CSV`}),(0,Z.jsx)($,{onSelect:()=>{e(),window.print()},children:`Print or save as PDF`})]})})})]}),(0,Z.jsxs)(`div`,{role:`group`,"aria-label":`Review filters`,className:`flex flex-wrap items-center gap-2 print:hidden`,children:[(0,Z.jsxs)(`select`,{"aria-label":`Workspace`,className:i(f,`w-auto max-md:min-w-0 max-md:flex-1`),value:l.workspaceId??``,onChange:e=>p({...l,workspaceId:e.target.value===``?null:Number(e.target.value)}),children:[(0,Z.jsx)(`option`,{value:``,children:`All workspaces`}),A.data?.map(e=>(0,Z.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,Z.jsxs)(`select`,{"aria-label":`Label`,className:i(f,`w-auto max-md:min-w-0 max-md:flex-1`),value:l.label??``,onChange:e=>p({...l,label:e.target.value===``?null:e.target.value}),children:[(0,Z.jsx)(`option`,{value:``,children:I.length===0?`No labels in this period`:`Any label`}),I.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(l.workspaceId!==null||l.label!==null)&&(0,Z.jsx)(a,{size:`sm`,variant:`ghost`,onClick:()=>p(U),children:`Clear filters`})]}),r&&(0,Z.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground print:hidden`,children:r}),(0,Z.jsx)(`p`,{role:`status`,className:i(`text-sm text-muted-foreground`,!S.isPending&&`sr-only`),children:S.isPending?`Loading the review...`:P?`Showing ${P.length} ${P.length===1?`task`:`tasks`} with activity in this ${z}.`:``}),S.isError&&(0,Z.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load the review: `,S.error.message]}),P?.length===0&&(0,Z.jsx)(V,{title:S.data?.length===0?`No recorded activity in this ${z}.`:`No recorded activity in this ${z} matches the filters.`,hint:`Pick another period or change the filters to look at other work.`,action:(0,Z.jsxs)(a,{size:`sm`,variant:`outline`,onClick:()=>H(T(t,-1)),children:[`Show the `,z,` before`]})}),P&&P.length>0&&(0,Z.jsx)(ue,{period:t,entries:P,workspaces:A.data??[]}),P&&(0,Z.jsx)(le,{period:t,entries:P}),t.kind===`year`&&P&&(0,Z.jsx)(ce,{entries:P}),P&&E(P).map(t=>(0,Z.jsxs)(`section`,{"aria-label":O[t.outcome],className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`h3`,{className:i(`text-sm font-semibold`,ne[t.outcome]),children:[O[t.outcome],` `,(0,Z.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.entries.length,`)`]})]}),(0,Z.jsx)(`ul`,{className:`flex flex-col divide-y rounded-lg border`,children:t.entries.map(({task:t,at:n,commits:r})=>(0,Z.jsxs)(`li`,{className:`flex flex-col gap-1 px-3 py-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(k,{type:t.taskType}),(0,Z.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[`#`,t.id]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Open #${t.id} ${t.title}`,title:t.title,onClick:()=>e?.(t.id),className:`min-w-0 flex-1 truncate text-left text-sm font-medium hover:underline max-md:min-h-11`,children:t.title}),t.resolution===`not_adopted`&&(0,Z.jsx)(`span`,{className:re,children:`Not adopted`}),t.resolution===`completed`&&(0,Z.jsx)(`span`,{className:i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,s.success),children:`Completed`}),t.pullRequestUrl&&(0,Z.jsx)(se,{url:t.pullRequestUrl,stats:t.pullRequest}),(0,Z.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground max-md:hidden print:inline`,children:[N.get(t.workspaceId)??`Workspace ${t.workspaceId}`,` · `,(0,Z.jsx)(j,{at:n})]})]}),(0,Z.jsx)(M,{task:t}),t.completionNote&&(0,Z.jsx)(`p`,{"aria-label":`Completion note of #${t.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:t.completionNote}),r.length>0&&(0,Z.jsx)(`ul`,{"aria-label":`Commits of #${t.id} this ${z}`,className:`flex flex-col gap-0.5`,children:r.map(e=>(0,Z.jsxs)(`li`,{className:`flex gap-2 text-xs`,title:e.author,children:[(0,Z.jsx)(`code`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}),(0,Z.jsx)(`span`,{className:`truncate`,children:B(e.message)})]},e.sha))})]},t.id))})]},t.outcome))]})}function se({url:e,stats:t}){let n=x(e),r=t=>{t.preventDefault(),q(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,Z.jsx)(`a`,{href:e,title:t?`${e} \u00b7 ${S(t)}`:e,"aria-label":n?`Pull request #${n}`:`Pull request`,onClick:r,onAuxClick:r,className:`shrink-0 text-xs text-primary underline underline-offset-2 hover:no-underline max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:n?`#${n}`:`PR`})}function ce({entries:e}){let t=A(e);return t===null?null:(0,Z.jsxs)(`section`,{"aria-labelledby":`year-in-review-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,Z.jsx)(`h3`,{id:`year-in-review-heading`,className:`text-sm font-semibold`,children:`Year in review`}),t.pullRequests&&(0,Z.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Merged pull requests`}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.pullRequests})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Lines changed`}),(0,Z.jsxs)(`dd`,{className:`text-lg font-semibold`,children:[(0,Z.jsxs)(`span`,{children:[`+`,t.pullRequests.additions]}),(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,Z.jsxs)(`span`,{children:[`-`,t.pullRequests.deletions]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Files changed`}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.changedFiles})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Reviews`}),(0,Z.jsxs)(`dd`,{className:`text-lg font-semibold`,title:W(t.pullRequests),children:[t.pullRequests.reviews,(0,Z.jsxs)(`span`,{className:`ml-1 text-xs font-normal text-muted-foreground`,children:[`on `,t.pullRequests.reviewed,` of `,t.pullRequests.pullRequests]})]})]})]}),t.largest.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest pull requests`}),(0,Z.jsx)(`ol`,{"aria-label":`Largest pull requests`,className:`flex flex-col gap-1`,children:t.largest.map(({task:e,pullRequest:t})=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,Z.jsx)(k,{type:e.taskType}),(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,Z.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:S(t)})]},e.id))})]}),t.research.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Research conclusions`}),(0,Z.jsx)(`ul`,{"aria-label":`Research conclusions`,className:`flex flex-col divide-y rounded-md border`,children:t.research.map(({task:e,at:t,adopted:n})=>(0,Z.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,Z.jsx)(`span`,{className:i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,n?s.success:s.neutral),children:n?`Adopted`:`Not adopted`}),(0,Z.jsx)(j,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,at:t})]}),(0,Z.jsx)(`p`,{"aria-label":`Research conclusion of #${e.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:e.completionNote??(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`No conclusion written.`})})]},e.id))})]}),t.overruns.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest estimate overruns`}),(0,Z.jsx)(`ol`,{"aria-label":`Largest estimate overruns`,className:`flex flex-col gap-1`,children:t.overruns.map(({task:e,estimated:t,actual:n})=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,Z.jsx)(k,{type:e.taskType}),(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,Z.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:[`estimated `,G(t),`, `,G(n),` active`]})]},e.id))})]})]})}function le({period:e,entries:t}){let n=L(e,t,Date.now()/1e3);return n===null?null:(0,Z.jsxs)(`section`,{"aria-labelledby":`plan-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,Z.jsx)(`h3`,{id:`plan-heading`,className:`text-sm font-semibold`,children:`Plan vs actual`}),(0,Z.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Estimate vs active time`}),(0,Z.jsx)(`dd`,{children:n.time?P(n.time):`No completed task had an estimate`})]}),(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Due dates met`}),(0,Z.jsx)(`dd`,{children:n.dueDates?H(n.dueDates):`No completed task had a due date`})]})]}),n.late.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Late tasks`}),(0,Z.jsx)(`ul`,{"aria-label":`Late tasks`,className:`flex flex-col gap-1`,children:n.late.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 max-w-full items-center gap-2`,children:[(0,Z.jsx)(k,{type:e.task.taskType}),(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.task.title})]}),(0,Z.jsx)(`span`,{className:i(`ml-auto shrink-0 text-xs`,o.danger),children:h(e)})]},e.task.id))})]})]})}function ue({period:e,entries:t,workspaces:n}){let r=K(e,t,n),a=Math.max(1,...(r.completedPerMonth??[]).map(({count:e})=>e));return(0,Z.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,Z.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[r.outcomes.map(({outcome:e,count:t})=>(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:O[e]}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:t})]},e)),r.notAdopted>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Not adopted`}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.notAdopted})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Commits`}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.commits})]})]}),(0,Z.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[z.map(e=>{let t=r[e];return(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:I[e]}),(0,Z.jsx)(`dd`,{children:t===null?`No data`:`${G(t.median)} (${t.tasks} ${t.tasks===1?`task`:`tasks`})`})]},e)}),r.changes&&(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Changes in completed pull requests`}),(0,Z.jsx)(`dd`,{children:N(r.changes)})]}),r.completedByType.length>0&&(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by type`}),(0,Z.jsx)(`dd`,{children:r.completedByType.map(({taskType:e,count:t})=>`${e} ${t}`).join(`, `)})]}),r.completedByWorkspace.length>0&&(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by workspace`}),(0,Z.jsx)(`dd`,{children:r.completedByWorkspace.map(({workspace:e,count:t})=>`${e} ${t}`).join(`, `)})]})]}),r.completedPerMonth&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Completed per month`}),(0,Z.jsx)(`ul`,{"aria-label":`Completed per month`,className:`flex flex-col gap-0.5`,children:r.completedPerMonth.map(({month:e,count:t})=>(0,Z.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,Z.jsx)(`span`,{className:`w-16 shrink-0 font-mono text-muted-foreground`,children:e}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:i(`h-2 rounded-sm`,l.success),style:{width:`${t/a*60}%`,minWidth:t>0?4:0}}),(0,Z.jsx)(`span`,{children:t})]},e))})]})]})}export{oe as Review};
|
|
1
|
+
import{i as e,n as t,r as n,s as r,t as i}from"./dist-ZmB2kPfR.js";import{Tt as a,d as o,o as s,s as c,st as l,zt as u}from"./status-styles-afrLUTav.js";import{g as d,h as f,s as p}from"./workspace-list-CMTBXXSj.js";import{A as ee,At as m,B as h,C as g,D as _,E as v,F as y,I as b,L as x,M as S,N as C,O as w,P as T,R as E,S as D,St as O,T as k,U as A,V as j,W as M,X as N,_ as P,b as F,g as te,h as I,j as L,k as R,m as z,p as B,s as V,v as H,w as U,x as W,y as G,z as K}from"./index-BHH1bFqT.js";import{t as q}from"./opener-DWhHPoCL.js";var J={name:`calendar-check`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]};J.node;var Y=t(J),X=r(e(),1),Z=n(),ne={completed:o.success,opened_for_review:o.review,started:o.progress,worked_on:o.progress,planned:o.neutral},re=i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,s.neutral),Q=[{kind:`week`,label:`Week`},{kind:`month`,label:`Month`},{kind:`quarter`,label:`Quarter`},{kind:`year`,label:`Year`},{kind:`custom`,label:`Custom`}];function ie(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}function ae({disabled:e,children:t}){let[n,r]=(0,X.useState)(!1),i=(0,X.useRef)(null);return(0,X.useEffect)(()=>{if(!n)return;let e=e=>{i.current?.contains(e.target)||r(!1)},t=e=>e.key===`Escape`&&r(!1);return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]),(0,Z.jsxs)(`div`,{ref:i,className:`relative`,children:[(0,Z.jsxs)(u,{size:`sm`,"aria-haspopup":`menu`,"aria-expanded":n,disabled:e,onClick:()=>r(!n),children:[(0,Z.jsx)(m,{}),(0,Z.jsx)(`span`,{className:`max-md:sr-only`,children:`Export`})]}),n&&(0,Z.jsx)(`div`,{role:`menu`,"aria-label":`Export review`,className:`absolute right-0 z-10 mt-1 flex w-48 flex-col rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:t(()=>r(!1))})]})}function $({onSelect:e,children:t}){return(0,Z.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:e,className:`rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted max-md:min-h-11`,children:t})}function oe({onShowTask:e}){let[t,n]=(0,X.useState)(()=>_(`week`,O(Date.now()/1e3))),[r,o]=(0,X.useState)(null),[c,m]=(0,X.useState)(U),{start:g,end:S}=v(t),C=l(g,S),j=a(),P=new Map(j.data?.map(e=>[e.id,e.name])),F=C.data&&te(C.data,c),I=b(C.data??[]);c.label!==null&&!I.includes(c.label)&&I.push(c.label);let L=[c.workspaceId===null?`across all workspaces`:`in ${P.get(c.workspaceId)??`workspace ${c.workspaceId}`}`,c.label!==null&&`labelled ${c.label}`].filter(Boolean).join(`, `),z=R[t.kind];function H(e){o(null),n(e)}function W(e){e!==t.kind&&H(e===`custom`?{...t,kind:e}:_(e,t.from))}async function G(e){try{await navigator.clipboard.writeText(x(t,e,j.data??[],Date.now()/1e3)),o(`Copied as Markdown.`)}catch(e){o(`Could not copy: ${String(e)}`)}}function K(e,n){let r=j.data??[],i=e===`csv`?T(n,r,Date.now()/1e3):x(t,n,r,Date.now()/1e3),a=y(t,e);ie(a,i,e===`csv`?`text/csv`:`text/markdown`),o(`Downloaded ${a}`)}return(0,Z.jsxs)(`section`,{"aria-labelledby":`review-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h2`,{id:`review-heading`,className:`text-xl font-semibold tracking-tight`,children:ee[t.kind]}),(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Work recorded from `,t.from,` to `,t.to,` `,L,`.`]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 print:hidden`,children:[(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Review period`,className:`flex rounded-md border p-0.5 max-md:w-full`,children:Q.map(({kind:e,label:n})=>(0,Z.jsx)(u,{size:`sm`,variant:t.kind===e?`default`:`ghost`,"aria-pressed":t.kind===e,onClick:()=>W(e),children:n},e))}),t.kind===`week`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{htmlFor:`week-start`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`Week starting`}),(0,Z.jsx)(`input`,{id:`week-start`,type:`date`,required:!0,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40 max-md:w-0 max-md:min-w-0 max-md:flex-1`),value:t.from,onChange:e=>e.target.value&&H(h(e.target.value))})]}),t.kind===`custom`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{htmlFor:`review-from`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`From`}),(0,Z.jsx)(`input`,{id:`review-from`,type:`date`,required:!0,max:t.to,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.from,onChange:e=>e.target.value&&e.target.value<=t.to&&H({...t,from:e.target.value})}),(0,Z.jsx)(`label`,{htmlFor:`review-to`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`To`}),(0,Z.jsx)(`input`,{id:`review-to`,type:`date`,required:!0,min:t.from,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.to,onChange:e=>e.target.value&&e.target.value>=t.from&&H({...t,to:e.target.value})})]}),t.kind!==`week`&&t.kind!==`custom`&&(0,Z.jsx)(`span`,{className:`px-1 text-sm font-medium`,children:w(t)}),(0,Z.jsx)(u,{size:`icon-sm`,variant:`outline`,"aria-label":`Previous ${z}`,title:`Previous ${z}`,onClick:()=>H(E(t,-1)),children:(0,Z.jsx)(f,{})}),(0,Z.jsx)(u,{size:`icon-sm`,variant:`outline`,"aria-label":`Next ${z}`,title:`Next ${z}`,onClick:()=>H(E(t,1)),children:(0,Z.jsx)(d,{})}),t.kind!==`custom`&&(0,Z.jsxs)(u,{size:`sm`,variant:`ghost`,onClick:()=>H(_(t.kind,O(Date.now()/1e3))),children:[(0,Z.jsx)(Y,{className:`md:hidden`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`max-md:sr-only`,children:[`This `,z]})]}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(ae,{disabled:!F,children:e=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{onSelect:()=>{e(),F&&G(F)},children:`Copy as Markdown`}),(0,Z.jsx)($,{onSelect:()=>{e(),F&&K(`md`,F)},children:`Save as Markdown`}),(0,Z.jsx)($,{onSelect:()=>{e(),F&&K(`csv`,F)},children:`Save as CSV`}),(0,Z.jsx)($,{onSelect:()=>{e(),window.print()},children:`Print or save as PDF`})]})})})]}),(0,Z.jsxs)(`div`,{role:`group`,"aria-label":`Review filters`,className:`flex flex-wrap items-center gap-2 print:hidden`,children:[(0,Z.jsxs)(`select`,{"aria-label":`Workspace`,className:i(p,`w-auto max-md:min-w-0 max-md:flex-1`),value:c.workspaceId??``,onChange:e=>m({...c,workspaceId:e.target.value===``?null:Number(e.target.value)}),children:[(0,Z.jsx)(`option`,{value:``,children:`All workspaces`}),j.data?.map(e=>(0,Z.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,Z.jsxs)(`select`,{"aria-label":`Label`,className:i(p,`w-auto max-md:min-w-0 max-md:flex-1`),value:c.label??``,onChange:e=>m({...c,label:e.target.value===``?null:e.target.value}),children:[(0,Z.jsx)(`option`,{value:``,children:I.length===0?`No labels in this period`:`Any label`}),I.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(c.workspaceId!==null||c.label!==null)&&(0,Z.jsx)(u,{size:`sm`,variant:`ghost`,onClick:()=>m(U),children:`Clear filters`})]}),r&&(0,Z.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground print:hidden`,children:r}),(0,Z.jsx)(`p`,{role:`status`,className:i(`text-sm text-muted-foreground`,!C.isPending&&`sr-only`),children:C.isPending?`Loading the review...`:F?`Showing ${F.length} ${F.length===1?`task`:`tasks`} with activity in this ${z}.`:``}),C.isError&&(0,Z.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load the review: `,C.error.message]}),F?.length===0&&(0,Z.jsx)(V,{title:C.data?.length===0?`No recorded activity in this ${z}.`:`No recorded activity in this ${z} matches the filters.`,hint:`Pick another period or change the filters to look at other work.`,action:(0,Z.jsxs)(u,{size:`sm`,variant:`outline`,onClick:()=>H(E(t,-1)),children:[`Show the `,z,` before`]})}),F&&F.length>0&&(0,Z.jsx)(ue,{period:t,entries:F,workspaces:j.data??[]}),F&&(0,Z.jsx)(le,{period:t,entries:F}),t.kind===`year`&&F&&(0,Z.jsx)(ce,{entries:F}),F&&D(F).map(t=>(0,Z.jsxs)(`section`,{"aria-label":k[t.outcome],className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`h3`,{className:i(`text-sm font-semibold`,ne[t.outcome]),children:[k[t.outcome],` `,(0,Z.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.entries.length,`)`]})]}),(0,Z.jsx)(`ul`,{className:`flex flex-col divide-y rounded-lg border`,children:t.entries.map(({task:t,at:n,commits:r})=>(0,Z.jsxs)(`li`,{className:`flex flex-col gap-1 px-3 py-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(A,{type:t.taskType}),(0,Z.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[`#`,t.id]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Open #${t.id} ${t.title}`,title:t.title,onClick:()=>e?.(t.id),className:`min-w-0 flex-1 truncate text-left text-sm font-medium hover:underline max-md:min-h-11`,children:t.title}),t.resolution===`not_adopted`&&(0,Z.jsx)(`span`,{className:re,children:`Not adopted`}),t.resolution===`completed`&&(0,Z.jsx)(`span`,{className:i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,s.success),children:`Completed`}),t.pullRequestUrl&&(0,Z.jsx)(se,{url:t.pullRequestUrl,stats:t.pullRequest}),(0,Z.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground max-md:hidden print:inline`,children:[P.get(t.workspaceId)??`Workspace ${t.workspaceId}`,` · `,(0,Z.jsx)(M,{at:n})]})]}),(0,Z.jsx)(N,{task:t}),t.completionNote&&(0,Z.jsx)(`p`,{"aria-label":`Completion note of #${t.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:t.completionNote}),r.length>0&&(0,Z.jsx)(`ul`,{"aria-label":`Commits of #${t.id} this ${z}`,className:`flex flex-col gap-0.5`,children:r.map(e=>(0,Z.jsxs)(`li`,{className:`flex gap-2 text-xs`,title:e.author,children:[(0,Z.jsx)(`code`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}),(0,Z.jsx)(`span`,{className:`truncate`,children:B(e.message)})]},e.sha))})]},t.id))})]},t.outcome))]})}function se({url:e,stats:t}){let n=S(e),r=t=>{t.preventDefault(),q(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,Z.jsx)(`a`,{href:e,title:t?`${e} \u00b7 ${C(t)}`:e,"aria-label":n?`Pull request #${n}`:`Pull request`,onClick:r,onAuxClick:r,className:`shrink-0 text-xs text-primary underline underline-offset-2 hover:no-underline max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:n?`#${n}`:`PR`})}function ce({entries:e}){let t=j(e);return t===null?null:(0,Z.jsxs)(`section`,{"aria-labelledby":`year-in-review-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,Z.jsx)(`h3`,{id:`year-in-review-heading`,className:`text-sm font-semibold`,children:`Year in review`}),t.pullRequests&&(0,Z.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Merged pull requests`}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.pullRequests})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Lines changed`}),(0,Z.jsxs)(`dd`,{className:`text-lg font-semibold`,children:[(0,Z.jsxs)(`span`,{children:[`+`,t.pullRequests.additions]}),(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,Z.jsxs)(`span`,{children:[`-`,t.pullRequests.deletions]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Files changed`}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.changedFiles})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Reviews`}),(0,Z.jsxs)(`dd`,{className:`text-lg font-semibold`,title:W(t.pullRequests),children:[t.pullRequests.reviews,(0,Z.jsxs)(`span`,{className:`ml-1 text-xs font-normal text-muted-foreground`,children:[`on `,t.pullRequests.reviewed,` of `,t.pullRequests.pullRequests]})]})]})]}),t.largest.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest pull requests`}),(0,Z.jsx)(`ol`,{"aria-label":`Largest pull requests`,className:`flex flex-col gap-1`,children:t.largest.map(({task:e,pullRequest:t})=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,Z.jsx)(A,{type:e.taskType}),(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,Z.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:C(t)})]},e.id))})]}),t.research.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Research conclusions`}),(0,Z.jsx)(`ul`,{"aria-label":`Research conclusions`,className:`flex flex-col divide-y rounded-md border`,children:t.research.map(({task:e,at:t,adopted:n})=>(0,Z.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,Z.jsx)(`span`,{className:i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,n?s.success:s.neutral),children:n?`Adopted`:`Not adopted`}),(0,Z.jsx)(M,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,at:t})]}),(0,Z.jsx)(`p`,{"aria-label":`Research conclusion of #${e.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:e.completionNote??(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`No conclusion written.`})})]},e.id))})]}),t.overruns.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest estimate overruns`}),(0,Z.jsx)(`ol`,{"aria-label":`Largest estimate overruns`,className:`flex flex-col gap-1`,children:t.overruns.map(({task:e,estimated:t,actual:n})=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,Z.jsx)(A,{type:e.taskType}),(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,Z.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:[`estimated `,G(t),`, `,G(n),` active`]})]},e.id))})]})]})}function le({period:e,entries:t}){let n=L(e,t,Date.now()/1e3);return n===null?null:(0,Z.jsxs)(`section`,{"aria-labelledby":`plan-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,Z.jsx)(`h3`,{id:`plan-heading`,className:`text-sm font-semibold`,children:`Plan vs actual`}),(0,Z.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Estimate vs active time`}),(0,Z.jsx)(`dd`,{children:n.time?F(n.time):`No completed task had an estimate`})]}),(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Due dates met`}),(0,Z.jsx)(`dd`,{children:n.dueDates?H(n.dueDates):`No completed task had a due date`})]})]}),n.late.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Late tasks`}),(0,Z.jsx)(`ul`,{"aria-label":`Late tasks`,className:`flex flex-col gap-1`,children:n.late.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 max-w-full items-center gap-2`,children:[(0,Z.jsx)(A,{type:e.task.taskType}),(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.task.title})]}),(0,Z.jsx)(`span`,{className:i(`ml-auto shrink-0 text-xs`,o.danger),children:g(e)})]},e.task.id))})]})]})}function ue({period:e,entries:t,workspaces:n}){let r=K(e,t,n),a=Math.max(1,...(r.completedPerMonth??[]).map(({count:e})=>e));return(0,Z.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,Z.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[r.outcomes.map(({outcome:e,count:t})=>(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:k[e]}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:t})]},e)),r.notAdopted>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Not adopted`}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.notAdopted})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Commits`}),(0,Z.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.commits})]})]}),(0,Z.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[z.map(e=>{let t=r[e];return(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:I[e]}),(0,Z.jsx)(`dd`,{children:t===null?`No data`:`${G(t.median)} (${t.tasks} ${t.tasks===1?`task`:`tasks`})`})]},e)}),r.changes&&(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Changes in completed pull requests`}),(0,Z.jsx)(`dd`,{children:P(r.changes)})]}),r.completedByType.length>0&&(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by type`}),(0,Z.jsx)(`dd`,{children:r.completedByType.map(({taskType:e,count:t})=>`${e} ${t}`).join(`, `)})]}),r.completedByWorkspace.length>0&&(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by workspace`}),(0,Z.jsx)(`dd`,{children:r.completedByWorkspace.map(({workspace:e,count:t})=>`${e} ${t}`).join(`, `)})]})]}),r.completedPerMonth&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Completed per month`}),(0,Z.jsx)(`ul`,{"aria-label":`Completed per month`,className:`flex flex-col gap-0.5`,children:r.completedPerMonth.map(({month:e,count:t})=>(0,Z.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,Z.jsx)(`span`,{className:`w-16 shrink-0 font-mono text-muted-foreground`,children:e}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:i(`h-2 rounded-sm`,c.success),style:{width:`${t/a*60}%`,minWidth:t>0?4:0}}),(0,Z.jsx)(`span`,{children:t})]},e))})]})]})}export{oe as Review};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./dist-ZmB2kPfR.js";import{
|
|
1
|
+
import{i as e,r as t,s as n}from"./dist-ZmB2kPfR.js";import{zt as r}from"./status-styles-afrLUTav.js";import{s as i}from"./workspace-list-CMTBXXSj.js";import{c as a,l as o,s}from"./event-DMqRNLc_.js";import{a as c,i as l,n as u,o as d,r as f}from"./index-BHH1bFqT.js";var p=n(e(),1),m=t();function h({children:e}){return(0,p.useSyncExternalStore)(o,s)===null?(0,m.jsx)(g,{}):e}function g(){let[e,t]=(0,p.useState)(``),[n,o]=(0,p.useState)(()=>c(navigator.userAgent)),[s,h]=(0,p.useState)(u.scope),[g,_]=(0,p.useState)(String(u.expiresInDays)),[v,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(!1),[S,C]=(0,p.useState)(!1),w=(0,p.useRef)(null),T=(0,p.useId)(),E=`${T}-help`,D=`${T}-rejected`;async function O(t){t.preventDefault(),C(!0),y(null),x(!1);try{let t=g===`never`?null:Number(g);a(await d(e.trim(),n.trim(),{scope:s,expiresInDays:t}))}catch(e){e instanceof l?(x(!0),w.current?.focus(),w.current?.select()):e instanceof TypeError?y(`Could not reach the server: ${String(e)}`):y(e instanceof Error?e.message:String(e))}finally{C(!1)}}return(0,m.jsx)(`main`,{className:`flex min-h-svh flex-col items-center justify-center gap-4 p-6`,children:(0,m.jsxs)(`form`,{onSubmit:O,"aria-label":`Server access`,className:`flex w-full max-w-sm flex-col gap-3 rounded-lg border p-5`,children:[(0,m.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Toodo server`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sign in with the server's access token. This browser then gets a token of its own, which you can revoke under Devices.`}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`label`,{htmlFor:`${T}-token`,className:`text-xs text-muted-foreground`,children:`Access token`}),(0,m.jsx)(`input`,{ref:w,id:`${T}-token`,className:`${i} aria-invalid:border-destructive`,type:`password`,autoComplete:`current-password`,value:e,onChange:e=>{t(e.target.value),x(!1)},"aria-invalid":b||void 0,"aria-describedby":b?`${D} ${E}`:E,required:!0}),b&&(0,m.jsxs)(`p`,{id:D,role:`alert`,className:`text-xs text-destructive`,children:[`The server did not accept this token. Paste the whole contents of`,` `,(0,m.jsx)(`code`,{className:`text-xs`,children:`web-token`}),` again; a device token stops working once it is revoked.`]}),(0,m.jsxs)(`p`,{id:E,className:`text-xs text-muted-foreground`,children:[`Copy it from `,(0,m.jsx)(`code`,{className:`text-xs`,children:`web-token`}),` in the server's data directory.`]})]}),(0,m.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Device name`,(0,m.jsx)(`input`,{className:i,maxLength:80,value:n,onChange:e=>o(e.target.value),required:!0})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,m.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Access`,(0,m.jsxs)(`select`,{className:i,value:s,onChange:e=>h(e.target.value),children:[(0,m.jsx)(`option`,{value:`full`,children:`Full access`}),(0,m.jsx)(`option`,{value:`read`,children:`Read-only`})]})]}),(0,m.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Token expires after`,(0,m.jsx)(`select`,{className:i,value:g,onChange:e=>_(e.target.value),children:f.map(({label:e,days:t})=>(0,m.jsx)(`option`,{value:t===null?`never`:String(t),children:e},e))})]})]}),(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Applies when you sign in with `,(0,m.jsx)(`code`,{className:`text-xs`,children:`web-token`}),`. When the token expires, sign in again.`]}),v&&(0,m.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:v}),(0,m.jsx)(r,{type:`submit`,disabled:S||!e.trim()||!n.trim(),children:S?`Checking...`:`Continue`})]})})}export{h as ServerAccess};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n,t as r}from"./dist-ZmB2kPfR.js";import{d as i,i as a,m as o,n as s,o as c,p as l,r as u,s as d}from"./event-DMqRNLc_.js";var f=n(e(),1),p=t(),m=f.createContext(void 0),h=e=>{let t=f.useContext(m);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},g=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,p.jsx)(m.Provider,{value:e,children:t})),_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},v=new class{#e=_;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ee(e){setTimeout(e,0)}var te=typeof window>`u`||`Deno`in globalThis;function y(){}function ne(e,t){return typeof e==`function`?e(t):e}function re(e){return typeof e==`number`&&e>=0&&e!==1/0}function ie(e,t){return Math.max(e+(t||0)-Date.now(),0)}function b(e,t){return typeof e==`function`?e(t):e}function ae(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==se(o,t.options))return!1}else if(!S(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function oe(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(a))return!1}else if(!S(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function se(e,t){return(t?.queryKeyHashFn||x)(e)}function x(e){return JSON.stringify(e,(e,t)=>de(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function S(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!S(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!S(e[r],t[r]))return!1;return!0}return!1}var ce=Object.prototype.hasOwnProperty;function le(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ue(e)&&ue(t);if(!r&&!(de(e)&&de(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ce.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=le(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function C(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ue(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function de(e){if(!fe(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!fe(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function fe(e){return Object.prototype.toString.call(e)===`[object Object]`}function pe(e){return new Promise(t=>{v.setTimeout(t,e)})}function me(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:le(e,t)}function he(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ge(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var _e=Symbol();function ve(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===_e?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ye(e,t){return typeof e==`function`?e(...t):!!e}function be(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var xe=()=>te,Se=()=>xe(),w=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ce=new class extends w{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},we=ee;function Te(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=we,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var T=Te(),Ee=new class extends w{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function De(e){return Math.min(1e3*2**e,3e4)}function Oe(e){return(e??`online`)!==`online`||Ee.isOnline()}var ke=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ae(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(y);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new ke(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ce.isFocused()&&(e.networkMode===`always`||Ee.isOnline())&&e.canRun(),p=()=>Oe(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Se()?0:3),a=e.retryDelay??De,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),pe(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var je=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),re(this.gcTime)&&(this.#e=v.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Se()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(v.clearTimeout(this.#e),this.#e=void 0)}};function Me(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{be(e,()=>t.signal,()=>n=!0)},u=ve(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ge:he;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Pe:Ne,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ne(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ne(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Pe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Fe(e,t){return t?Ne(e,t)!=null:!1}function Ie(e,t){return!t||!e.getPreviousPageParam?!1:Pe(e,t)!=null}var Le=class extends je{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Be(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Be(this.options);e.data!==void 0&&(this.setState(ze(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=me(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(y).catch(y):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_e||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>b(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ie(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ve(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Me(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Ae({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ke&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ke){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Re(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ze(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),T.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Re(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Oe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ze(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Be(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ve=class extends w{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ue(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return We(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return We(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof b(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!C(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ge(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||b(this.options.staleTime,this.#t)!==b(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return C(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(y)),t}#h(e){return!Se()&&b(this.options.enabled,this.#t)!==!1&&re(e)}#g(){this.#b();let e=b(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=ie(this.#r.dataUpdatedAt,e)+1;this.#u=v.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return b(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=v.setInterval(()=>{(this.options.refetchIntervalInBackground||Ce.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(v.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(v.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ue(e,t),o=i&&Ge(e,n,t,r);(a||o)&&(l={...l,...Re(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=me(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=me(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,ee=_&&g,te=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:ee,isLoading:ee,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!te,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&te,isStale:Ke(e,t),refetch:this.refetch,isEnabled:b(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),C(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();T.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function He(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||b(t.retryOnMount,e)!==!1)}function Ue(e,t){return He(e,t)||e.state.data!==void 0&&We(e,t,t.refetchOnMount)}function We(e,t,n){if(b(t.enabled,e)!==!1&&b(t.staleTime,e)!==`static`){let r=b(n,e);return r===`always`||r!==!1&&Ke(e,t)}return!1}function Ge(e,t,n,r){return(e!==t||b(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ke(e,n)}function Ke(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(b(t.staleTime,e))}var qe=class extends Ve{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Fe(t,n.data),hasPreviousPage:Ie(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Je=class extends je{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ye(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Ae({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),T.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ye(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Xe=class extends w{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),C(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&x(t.mutationKey)!==x(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ye();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){T.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ze=f.createContext(!1),Qe=()=>f.useContext(Ze);Ze.Provider;function $e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var et=f.createContext($e()),tt=()=>f.useContext(et),nt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ye(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},rt=e=>{f.useEffect(()=>{e.clearReset()},[e])},it=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ye(n,[e.error,r])),at=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ot=(e,t)=>e?.suspense&&t.isPending,st=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ct(e,t,n){let r=Qe(),i=tt(),a=h(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,at(o),nt(o,i,s),rt(i);let[l]=f.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(f.useSyncExternalStore(f.useCallback(e=>{let t=d?l.subscribe(T.batchCalls(e)):y;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o)},[o,l]),ot(o,u))throw st(o,l,i);if(it({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function E(e,t){return ct(e,Ve,t)}function D(e,t){let n=h(t),[r]=f.useState(()=>new Xe(n,e));f.useEffect(()=>{r.setOptions(e)},[r,e]);let i=f.useSyncExternalStore(f.useCallback(e=>r.subscribe(T.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=f.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(y)},[r]);if(i.error&&ye(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function lt(e,t){return ct(e,qe,t)}function O(){return typeof window<`u`}function k(e){return dt(e)?(e.nodeName||``).toLowerCase():`#document`}function A(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ut(e){return((dt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function dt(e){return O()?e instanceof Node||e instanceof A(e).Node:!1}function ft(e){return O()?e instanceof Element||e instanceof A(e).Element:!1}function j(e){return O()?e instanceof HTMLElement||e instanceof A(e).HTMLElement:!1}function pt(e){return!O()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof A(e).ShadowRoot}function mt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ht(e){return/^(table|td|th)$/.test(k(e))}function gt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _t=/transform|translate|scale|rotate|perspective|filter/,vt=/paint|layout|strict|content/,M=e=>!!e&&e!==`none`,yt;function bt(e){let t=ft(e)?wt(e):e;return M(t.transform)||M(t.translate)||M(t.scale)||M(t.rotate)||M(t.perspective)||!St()&&(M(t.backdropFilter)||M(t.filter))||_t.test(t.willChange||``)||vt.test(t.contain||``)}function xt(e){let t=N(e);for(;j(t)&&!Ct(t);){if(bt(t))return t;if(gt(t))return null;t=N(t)}return null}function St(){return yt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),yt}function Ct(e){return/^(html|body|#document)$/.test(k(e))}function wt(e){return A(e).getComputedStyle(e)}function Tt(e){return ft(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function N(e){if(k(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||pt(e)&&e.host||ut(e);return pt(t)?t.host:t}function Et(e){let t=N(e);return Ct(t)?(e.ownerDocument||e).body:j(t)&&mt(t)?t:Et(t)}function Dt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Et(e),i=r===e.ownerDocument?.body,a=A(r);if(i){let e=Ot(a);return t.concat(a,a.visualViewport||[],mt(r)?r:[],e&&n?Dt(e):[])}return t.concat(r,Dt(r,[],n))}function Ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var P={...f},kt={};function F(e,t){let n=f.useRef(kt);return n.current===kt&&(n.current=e(t)),n}var At=P.useInsertionEffect,jt=At&&At!==P.useLayoutEffect?At:e=>e();function Mt(e){let t=F(Nt).current;return t.next=e,jt(t.effect),t.trampoline}function Nt(){let e={next:void 0,callback:Pt,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Pt(){}var Ft=typeof document<`u`?f.useLayoutEffect:()=>{};function It(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Lt={};function I(e,t,n,r,i){if(!n&&!r&&!i&&!e)return L(t);let a=L(e);return t&&(a=R(a,t)),n&&(a=R(a,n)),r&&(a=R(a,r)),i&&(a=R(a,i)),a}function Rt(e){if(e.length===0)return Lt;if(e.length===1)return L(e[0]);let t=L(e[0]);for(let n=1;n<e.length;n+=1)t=R(t,e[n]);return t}function L(e){return Ht(e)?{...e(Lt)}:zt(e)}function R(e,t){return Ht(t)?t(e):Bt(e,t)}function zt(e){let t={...e};for(let e in t){let n=t[e];Vt(e,n)&&(t[e]=Wt(n))}return t}function Bt(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=It(e.style,r);break;case`className`:e[n]=Gt(e.className,r);break;default:e[n]=Vt(n,r)?Ut(e[n],r):r}}return e}function Vt(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Ht(e){return typeof e==`function`}function Ut(e,t){return t?e?(...n)=>{let r=n[0];if(Kt(r)){let i=r;z(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Wt(t):e}function Wt(e){return e&&((...t)=>{let n=t[0];return Kt(n)&&z(n),e(...t)})}function z(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Gt(e,t){return t?e?t+` `+e:t:e}function Kt(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function qt(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Jt=qt(`https://base-ui.com/production-error`,`Base UI`),Yt=f.createContext(void 0);function Xt(e=!1){let t=f.useContext(Yt);if(t===void 0&&!e)throw Error(Jt(16));return t}function Zt(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:f.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function B(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(A(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Qt(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=f.useRef(null),s=Xt(!0),c=a??s!==void 0,{props:l}=Zt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=f.useCallback(()=>{let e=o.current;$t(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Ft(u,[u]),{getButtonProps:f.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return I({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(z(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=$t(r),s=!i&&en(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),B(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),B(r,e)))},onKeyUp(e){t||(z(e),a?.(e),e.target===e.currentTarget&&i&&c&&$t(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),B(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Mt(e=>{o.current=e,u()})}}function $t(e){return j(e)&&e.tagName===`BUTTON`}function en(e){return j(e)&&e.tagName===`A`&&!!e.href}function tn(e,t,n,r){let i=F(rn).current;return an(i,e,t,n,r)&&sn(i,[e,t,n,r]),i.callback}function nn(e){let t=F(rn).current;return on(t,e)&&sn(t,e),t.callback}function rn(){return{callback:null,cleanup:null,refs:[]}}function an(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function on(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function sn(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var cn=19;function ln(e){return cn>=e}function un(e){if(!f.isValidElement(e))return null;let t=e,n=t.props;return(ln(19)?n?.ref:t.ref)??null}function dn(){}var fn=Object.freeze([]),V=Object.freeze({});function pn(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function mn(e,t){return typeof e==`function`?e(t):e}function hn(e,t){return typeof e==`function`?e(t):e}function gn(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=bn(r));let i=_n(t,n,r);if(n.enabled===!1)return null;let a=n.state??V;return xn(e,r,i,a)}function _n(e,t,n){let{className:r,style:i}=e,{state:a=V,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?mn(r,a):void 0,d=l?hn(i,a):void 0,f=l?pn(a,c):V,p=l&&s?vn(s):void 0,m=l?It(f,p)??{}:V;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?nn([m.ref,un(n),...o]):tn(m.ref,un(n),o):tn(null,null)),l?(u!==void 0&&(m.className=Gt(m.className,u)),d!==void 0&&(m.style=It(m.style,d)),m):V}function vn(e){return Array.isArray(e)?Rt(e):I(void 0,e)}var yn=Symbol.for(`react.lazy`);function bn(e){if(e?.$$typeof!==yn)return e;let t=f.Children.toArray(e)[0];return f.isValidElement(t)?t:e}function xn(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=I(n,t.props);return e.ref=n.ref,f.cloneElement(t,e)}return Sn(e,n)}function Sn(e,t){return e===`button`?(0,f.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,f.createElement)(`img`,{alt:``,...t,key:t.key}):f.createElement(e,t)}var Cn=f.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Qt({disabled:i,focusableWhenDisabled:a,native:o});return gn(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function wn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=wn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Tn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=wn(e))&&(r&&(r+=` `),r+=t);return r}var En=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Dn=Tn,On=((e,t)=>n=>{if(t?.variants==null)return Dn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=En(t)||En(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Dn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 motion-safe:active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:text-muted-foreground aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 max-md:min-h-11 max-md:min-w-11`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80 disabled:bg-muted`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/10 dark:hover:bg-input/20`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground disabled:bg-muted`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 disabled:bg-muted focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] max-md:text-sm in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function kn({className:e,variant:t=`default`,size:n=`default`,autoFocus:a,changesData:s,disabled:c,...l}){let u=(0,f.useSyncExternalStore)(o,i),d=u===`unreachable`||u===`retrying`,m=s??l.type===`submit`,h=(0,f.useRef)(null);return(0,f.useEffect)(()=>{a&&h.current?.focus()},[]),(0,p.jsx)(Cn,{ref:h,"data-slot":`button`,disabled:c||m&&d,className:r(On({variant:t,size:n,className:e})),...l})}function An(e){return typeof e==`object`&&!!e&&typeof e.kind==`string`&&typeof e.code==`string`&&typeof e.message==`string`}async function H(e,t={}){let n=d();if(n===null)throw Error(`No access token for the Toodo server.`);let r=await l(`/api/rpc/${encodeURIComponent(e)}`,{method:`POST`,headers:{...a(n),"Content-Type":`application/json`},body:JSON.stringify(t)});if(r.status===401)throw c(),Error(`The Toodo server did not accept the access token.`);let i=await r.text();if(r.ok)return i?JSON.parse(i):null;let o=null;try{o=JSON.parse(i)}catch{}throw An(o)?o:Error(i||`${r.status} ${r.statusText}`)}var U={appInfo:()=>H(`app_info`),listWorkspaces:()=>G(H(`list_workspaces`)),getWorkspace:e=>G(H(`get_workspace`,{id:e})),createWorkspace:e=>G(H(`create_workspace`,{workspace:e})),updateWorkspace:e=>G(H(`update_workspace`,{workspace:e})),moveWorkspace:(e,t)=>G(H(`move_workspace`,{id:e,location:t})),listWorkspaceBranches:e=>G(H(`list_workspace_branches`,{id:e})),createWorkspaceBaseBranch:(e,t,n)=>G(H(`create_workspace_base_branch`,{id:e,name:t,from:n})),deleteWorkspace:e=>G(H(`delete_workspace`,{id:e})),getMachineSettings:e=>G(H(`get_machine_settings`,{machine:e})),saveMachineSettings:e=>G(H(`save_machine_settings`,{settings:e})),listHerdrMachines:()=>G(H(`list_herdr_machines`)),listSshHosts:()=>G(H(`list_ssh_hosts`)),addSshHost:e=>G(H(`add_ssh_host`,{host:e})),listRemoteDirectories:(e,t)=>G(H(`list_remote_directories`,{machine:e,path:t})),listDirectories:(e,t)=>G(H(`list_directories`,{machine:e,path:t})),listTasks:e=>G(H(`list_tasks`,{filter:e})),listTaskRelations:()=>G(H(`list_task_relations`)),addTaskRelation:(e,t)=>G(H(`add_task_relation`,{taskId:e,relatedId:t})),removeTaskRelation:(e,t)=>G(H(`remove_task_relation`,{taskId:e,relatedId:t})),getTask:e=>G(H(`get_task`,{id:e})),createTask:e=>G(H(`create_task`,{task:e})),updateTask:e=>G(H(`update_task`,{task:e})),pauseTask:e=>G(H(`pause_task`,{id:e})),setCompletionNote:(e,t)=>G(H(`set_completion_note`,{id:e,note:t})),reopenTask:(e,t)=>G(H(`reopen_task`,{id:e,reason:t})),setTaskOutcome:(e,t,n)=>G(H(`set_task_outcome`,{id:e,resolution:t,note:n})),checkCriterion:(e,t,n,r)=>G(H(`check_criterion`,{taskId:e,criterionId:t,met:n,evidence:r})),deleteTask:(e,t)=>G(H(`delete_task`,{id:e,force:t})),addDependency:(e,t,n)=>G(H(`add_dependency`,{taskId:e,dependsOn:t,confirmPause:n})),removeDependency:(e,t)=>G(H(`remove_dependency`,{taskId:e,dependsOn:t})),listCommitRecords:e=>G(H(`list_commit_records`,{taskId:e})),listTaskActivity:e=>G(H(`list_task_activity`,{taskId:e})),listAgentStatusTransitions:e=>G(H(`list_agent_status_transitions`,{taskId:e})),herdrStatus:()=>G(H(`herdr_status`)),startTask:e=>G(H(`start_task`,{id:e})),ensureTaskWorkspace:e=>G(H(`ensure_task_workspace`,{id:e})),openTaskInHerdr:e=>G(H(`open_task_in_herdr`,{id:e})),focusAgentPane:e=>G(H(`focus_agent_pane`,{id:e})),restoreTaskWorktree:e=>G(H(`restore_task_worktree`,{id:e})),closeTaskWorkspace:e=>G(H(`close_task_workspace`,{id:e})),startPlainRun:(e,t,n,r)=>G(H(`start_plain_run`,{taskId:e,adapter:t,prompt:n,mcp:r})),listTaskRuns:e=>G(H(`list_task_runs`,{taskId:e})),getRunLog:(e,t)=>G(H(`get_run_log`,{runId:e,tailBytes:t})),stopRun:e=>G(H(`stop_run`,{runId:e})),reconcileRun:e=>G(H(`reconcile_run`,{runId:e})),runnerHealth:()=>G(H(`runner_health`)),refreshCommitRecords:e=>G(H(`refresh_commit_records`,{taskId:e})),openPullRequest:e=>G(H(`open_pull_request`,{id:e})),completeTask:e=>G(H(`complete_task`,{id:e})),concludeTask:(e,t)=>G(H(`conclude_task`,{id:e,note:t})),completeTaskMergedWith:(e,t,n)=>G(H(`complete_task_merged_with`,{id:e,mergedWithTask:t,pullRequestUrl:n})),branchFreshness:e=>G(H(`branch_freshness`,{id:e})),listPullRequestStatuses:()=>H(`list_pull_request_statuses`),linkIssue:(e,t)=>G(H(`link_issue`,{id:e,number:t})),createIssue:e=>G(H(`create_issue`,{id:e})),listAgentStatuses:()=>H(`list_agent_statuses`),mcpServerInfo:()=>H(`mcp_server_info`),listMcpTunnels:()=>H(`list_mcp_tunnels`),listConnectedApps:()=>G(H(`list_connected_apps`)),revokeConnectedApp:e=>G(H(`revoke_connected_app`,{grantId:e})),reviewPeriod:(e,t)=>G(H(`review_period`,{start:e,end:t})),getBackupSettings:()=>H(`get_backup_settings`),saveBackupSettings:e=>G(H(`save_backup_settings`,{settings:e})),listBackups:()=>G(H(`list_backups`)),restoreBackup:e=>G(H(`restore_backup`,{name:e}))},W={tasksChanged:K(`tasks-changed`),workspacesChanged:K(`workspaces-changed`),agentStatusesChanged:K(`agent-statuses-changed`),pullRequestStatusesChanged:K(`pull-request-statuses-changed`)};async function G(e){try{return{status:`ok`,data:await e}}catch(e){if(e instanceof Error)throw e;return{status:`error`,error:e}}}function K(e){return{listen:t=>s(e,t)}}function jn(e){switch(e.code){case`unknownCommand`:case`invalidArguments`:return`This page is out of date with the Toodo server. Reload the page, then try again.`;case`commandPanicked`:return`Something went wrong on the Toodo server. Try again; if it keeps failing, look for "a command panicked" in the toodo-server log.`;case`storageFailed`:return`The Toodo server could not use its database (${e.message}). Try again; if it keeps failing, check the toodo-server log.`;default:return e.message}}function Mn(e,t){return/filename="([^"]+)"/.exec(e.headers.get(`Content-Disposition`)??``)?.[1]??t}function Nn(e,t){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),URL.revokeObjectURL(n)}async function Pn(){let e=await u(`/api/backups/export`),t=Mn(e,`toodo-backup.sqlite3`);return Nn(t,await e.blob()),t}async function Fn(e){return Nn(e,await(await u(`/api/backups/${encodeURIComponent(e)}`)).blob()),e}async function In(e){return await(await u(`/api/backups/restore`,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e})).json()}var Ln=`toodo-install-dismissed`;function Rn(){let{userAgent:e,maxTouchPoints:t}=navigator;return/iPhone|iPad|iPod/.test(e)||e.includes(`Macintosh`)&&t>1}function zn(){return matchMedia(`(display-mode: standalone)`).matches||`standalone`in navigator&&navigator.standalone===!0}var q=null,Bn=!1,Vn=new Set;function J(){Vn.forEach(e=>e())}function Hn(e){return Vn.add(e),()=>Vn.delete(e)}function Un(){return Bn||zn()||localStorage.getItem(Ln)!==null?`none`:q===null?Rn()?`home-screen`:`none`:`prompt`}function Wn(){localStorage.setItem(Ln,`1`),J()}async function Gn(){let e=q;if(e===null)return;q=null,await e.prompt();let{outcome:t}=await e.userChoice;t===`dismissed`?Wn():J()}function Kn(){addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),q=e,J()}),addEventListener(`appinstalled`,()=>{q=null,Bn=!0,J()})}function qn(){return`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window?`supported`:Rn()&&!zn()?`needs-install`:`unsupported`}var Y=null,Jn={agent:[`Agent needs input`,`Agent finished`],pullRequests:[`CI failed`,`CI passed`,`Changes requested`,`Pull request approved`],completion:[`Task awaiting completion`]};function Yn(e){return Y!==null&&Object.keys(Jn).some(t=>Y?.[t]===!0&&Jn[t].includes(e))}function Xn(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t.padEnd(Math.ceil(t.length/4)*4,`=`);return Uint8Array.from(atob(n),e=>e.charCodeAt(0))}function Zn(e,t){let n=e.options.applicationServerKey;return n===null||n.byteLength===t.length&&new Uint8Array(n).every((e,n)=>e===t[n])}function Qn(){return navigator.serviceWorker.getRegistration()}async function $n(e){let t=await(await Qn())?.pushManager.getSubscription()??null;return t===null||Zn(t,e)?t:(await t.unsubscribe(),null)}async function er(e){return await(await u(`/api/push/subscription`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e.toJSON())})).json()}async function tr(){let e=await(await u(`/api/push`)).json(),t=await $n(Xn(e.publicKey)),n=t===null?null:t.endpoint===e.subscription?.endpoint?e.subscription:await er(t);return Y=n?.settings??null,{publicKey:e.publicKey,permission:Notification.permission,subscription:n}}async function nr(e,t){if(await e!==`granted`)throw Error(`Notifications were not allowed.`);if(await Qn()===void 0)throw Error(`Notifications need the service worker, which only the built app installs.`);let{pushManager:n}=await navigator.serviceWorker.ready,r=Xn(t),i=await $n(r)??await n.subscribe({userVisibleOnly:!0,applicationServerKey:r});try{let e=await er(i);return Y=e.settings,e}catch(e){throw await i.unsubscribe(),e}}async function rr(){await(await(await Qn())?.pushManager.getSubscription())?.unsubscribe(),Y=null,await u(`/api/push/subscription`,{method:`DELETE`})}async function ir(e){let t=await(await u(`/api/push/settings`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json();return Y=t.settings,t}async function ar(){await u(`/api/push/test`,{method:`POST`})}var or=`toodo-open-task`;function sr(e){if(!(`serviceWorker`in navigator))return()=>{};let t=navigator.serviceWorker,n=({data:t})=>{typeof t==`object`&&t&&`type`in t&&t.type===or&&`taskId`in t&&typeof t.taskId==`number`&&e(t.taskId)};return t.addEventListener(`message`,n),()=>t.removeEventListener(`message`,n)}async function cr(){return`Notification`in window&&Notification.permission===`granted`}async function lr(){return`Notification`in window?Notification.requestPermission():`denied`}function ur(e){Yn(e.title)||new Notification(e.title,{body:e.body})}var dr={planned:`Planned`,in_progress:`In progress`,in_review:`Awaiting completion`,done:`Done`};function fr(e){return e.status===`done`&&e.resolution===`completed`?`Completed`:e.status===`done`&&e.resolution===`not_adopted`?`Not adopted`:dr[e.status]}function pr(e,t){switch(t.status){case`in_progress`:return`Task started`;case`in_review`:return`Task awaiting completion`;case`done`:return t.resolution===`not_adopted`?`Task concluded without merging`:`Task done`;case`planned`:return e===`in_progress`?`Task paused`:`Task status changed`}}function mr(e,t){let n=new Map(e.map(e=>[e.id,e.status])),r=new Map(t.map(e=>[e.id,e]));return t.flatMap(e=>{let t=n.get(e.id);if(t===void 0||t===e.status)return[];let i=e.dependsOn.some(e=>r.get(e)?.status!==`done`);return t===`in_progress`&&e.status===`planned`&&i&&e.herdrWorkspaceId!==null?[{title:`Task paused by a new prerequisite`,body:`#${e.id} ${e.title}: close its herdr workspace?`}]:[{title:pr(t,e),body:`#${e.id} ${e.title}: ${dr[t]} -> ${fr(e)}`}]})}function hr(e,t,n){let r=new Map(e.map(e=>[e.taskId,e.status]));return t.flatMap(({taskId:e,status:t})=>{let i=r.get(e);if(i===void 0||i===t||t!==`blocked`)return[];let a=n.find(t=>t.id===e);return[{title:`Agent needs input`,body:a?`#${e} ${a.title}`:`#${e}`}]})}function gr(e,t,n){let r=new Map(e.map(e=>[e.taskId,e]));return t.flatMap(({taskId:e,checks:t,review:i})=>{let a=r.get(e);if(a===void 0)return[];let o=n.find(t=>t.id===e),s=o?`#${e} ${o.title}`:`#${e}`,c=[];return t===`failing`&&a.checks!==`failing`&&c.push({title:`CI failed`,body:s}),i===`changes_requested`&&a.review!==`changes_requested`&&c.push({title:`Changes requested`,body:s}),c})}async function _r(e){if(e.length!==0&&(await cr()||await lr()===`granted`))for(let t of e)ur(t)}var vr=class extends Error{kind;code;constructor(e){super(jn(e)),this.name=`CommandFailure`,this.kind=e.kind,this.code=e.code}};async function X(e){let t=await e;if(t.status===`error`)throw new vr(t.error);return t.data}var Z={workspaces:[`workspaces`],tasks:[`task-list`,`pages`],taskRelations:[`tasks`,`relations`],herdrStatus:[`herdr-status`],runnerHealth:[`runner-health`],agentStatuses:[`agent-statuses`],pullRequestStatuses:[`pull-request-statuses`],machineSettings:e=>[`machine-settings`,e],branches:e=>[`branches`,e],commitRecords:e=>[`tasks`,e,`commit-records`],taskActivity:e=>[`tasks`,e,`activity`],branchFreshness:e=>[`tasks`,e,`branch-freshness`],taskRuns:e=>[`tasks`,e,`runs`],agentStatusTransitions:e=>[`agent-status-transitions`,e],runLog:e=>[`run-log`,e],herdrMachines:[`herdr-machines`],backups:[`backups`],backupSettings:[`backup-settings`],mcpServerInfo:[`mcp-server-info`],mcpTunnels:[`mcp-tunnels`],review:(e,t)=>[`review`,e,t],directories:(e,t)=>[`directories`,e,t]};function yr(){return E({queryKey:Z.mcpServerInfo,queryFn:()=>U.mcpServerInfo(),refetchInterval:5e3})}function br(){return E({queryKey:Z.mcpTunnels,queryFn:()=>U.listMcpTunnels(),refetchInterval:3e3})}function xr(){return E({queryKey:Z.backups,queryFn:()=>X(U.listBackups())})}function Sr(){return E({queryKey:Z.backupSettings,queryFn:()=>U.getBackupSettings()})}function Cr(){let e=h();return D({mutationFn:e=>X(U.saveBackupSettings(e)),onSuccess:t=>(e.setQueryData(Z.backupSettings,t),e.invalidateQueries({queryKey:Z.backups}))})}function wr(){let e=h();return D({mutationFn:e=>X(U.restoreBackup(e)),onSuccess:()=>e.invalidateQueries()})}function Tr(){return D({mutationFn:Pn})}function Er(){return D({mutationFn:Fn})}function Dr(){let e=h();return D({mutationFn:In,onSuccess:()=>e.invalidateQueries()})}function Or(){return E({queryKey:Z.herdrMachines,queryFn:()=>X(U.listHerdrMachines())})}function kr(e,t){return E({queryKey:Z.directories(e,t),queryFn:()=>X(U.listDirectories(e,t)),enabled:t!==null,retry:!1})}function Ar(e){return E({queryKey:[`home-directory`,e],queryFn:async()=>(await X(U.listDirectories(e,null))).path,staleTime:1/0,retry:!1})}function jr(e){return e.kind===`local`?{kind:`local`}:{kind:`ssh`,label:e.machine}}function Mr(){return E({queryKey:Z.workspaces,queryFn:()=>X(U.listWorkspaces())})}function Nr(){let e=h();return D({mutationFn:e=>X(U.createWorkspace(e)),onSuccess:()=>e.invalidateQueries({queryKey:Z.workspaces})})}function Pr(){let e=h();return D({mutationFn:e=>X(U.updateWorkspace(e)),onSuccess:()=>e.invalidateQueries({queryKey:Z.workspaces,exact:!0})})}function Fr(){let e=h();return D({mutationFn:({id:e,location:t})=>X(U.moveWorkspace(e,t)),onSuccess:()=>{e.invalidateQueries()}})}function Ir(e,t){return E({queryKey:Z.branches(e),queryFn:()=>X(U.listWorkspaceBranches(e)),enabled:t,staleTime:0})}function Lr(e,t){return E({queryKey:Z.branchFreshness(e),queryFn:()=>X(U.branchFreshness(e)),enabled:t,staleTime:6e4,refetchInterval:3e5,retry:!1})}function Rr(){let e=h();return D({mutationFn:({workspace:e,name:t,from:n})=>X(U.createWorkspaceBaseBranch(e,t,n)),onSuccess:t=>Promise.all([e.invalidateQueries({queryKey:Z.workspaces,exact:!0}),e.invalidateQueries({queryKey:Z.branches(t.id)})])})}function zr(){let e=h();return D({mutationFn:e=>X(U.deleteWorkspace(e)),onSuccess:()=>Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:Z.workspaces,exact:!0})])})}var Br=[`planned`,`in_progress`,`in_review`];function Q(e){return X(U.listTasks(e))}async function Vr(e){let t=Q({statuses:[`done`],before:e,limit:100}),n=e=>e.length<100?null:Math.min(...e.map(e=>e.id));if(e!==null){let e=await t;return{tasks:e,olderBefore:n(e)}}let[r,i]=await Promise.all([Q({statuses:Br}),t]),a=new Set([...r,...i].map(e=>e.id)),o=[...new Set(r.flatMap(e=>e.dependsOn))].filter(e=>!a.has(e)),s=[];for(let e=0;e<o.length;e+=100)s.push(o.slice(e,e+100));let c=await Promise.all(s.map(e=>Q({ids:e})));return{tasks:[...r,...i,...c.flat()],olderBefore:n(i)}}function Hr(e){let t=new Map;for(let n of e.pages)for(let e of n.tasks)t.set(e.id,e);return[...t.values()].sort((e,t)=>e.id-t.id)}function Ur(e){let t=e.getQueryData(Z.tasks);return t===void 0?void 0:Hr(t)}function Wr(e=[]){let t=lt({queryKey:Z.tasks,queryFn:({pageParam:e})=>Vr(e),initialPageParam:null,getNextPageParam:e=>e.olderBefore,select:Hr}),n=t.data,r=new Set(n?.map(e=>e.id)),i=[...new Set(e.filter(e=>e!=null&&!r.has(e)))].sort((e,t)=>e-t),a=E({queryKey:[...Z.tasks,`by-id`,i],queryFn:()=>Q({ids:i}),enabled:n!==void 0&&i.length>0}),o=i.length===0?[]:a.data??[];return n===void 0||o.length===0?t:{...t,data:[...n,...o].sort((e,t)=>e.id-t.id)}}function Gr(e,t){return E({queryKey:Z.review(e,t),queryFn:()=>X(U.reviewPeriod(e,t))})}function Kr(){return E({queryKey:Z.herdrStatus,queryFn:()=>X(U.herdrStatus())})}function qr(){return E({queryKey:Z.runnerHealth,queryFn:()=>X(U.runnerHealth()),refetchInterval:6e4})}function Jr(){return E({queryKey:Z.agentStatuses,queryFn:()=>U.listAgentStatuses()})}function Yr(){return E({queryKey:Z.pullRequestStatuses,queryFn:()=>U.listPullRequestStatuses()})}function Xr(){let e=h();(0,f.useEffect)(()=>{function t(t,n,r){let i=e.getQueryData(t);e.setQueryData(t,n),!(i===void 0||document.hasFocus())&&_r(r(i,n,Ur(e)??[])).catch(e=>console.error(`toodo: failed to show notifications`,e))}let n=[W.tasksChanged.listen(async()=>{let t=Ur(e);await Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:[`tasks`]})]),!(t===void 0||document.hasFocus())&&_r(mr(t,Ur(e)??[])).catch(e=>console.error(`toodo: failed to show status notifications`,e))}),W.workspacesChanged.listen(()=>e.invalidateQueries({queryKey:Z.workspaces,exact:!0})),W.agentStatusesChanged.listen(({payload:n})=>{t(Z.agentStatuses,n.statuses,hr),e.invalidateQueries({queryKey:[`agent-status-transitions`]})}),W.pullRequestStatusesChanged.listen(({payload:e})=>t(Z.pullRequestStatuses,e.statuses,gr))];return()=>{for(let e of n)e.then(e=>e())}},[e])}function Zr(e){return E({queryKey:Z.machineSettings(e),queryFn:()=>X(U.getMachineSettings(e))})}function Qr(){let e=h();return D({mutationFn:e=>X(U.saveMachineSettings(e)),onSuccess:t=>e.setQueryData(Z.machineSettings(t.machine),t)})}function $r(){let e=h();return D({mutationFn:e=>X(U.startTask(e)),onSuccess:()=>e.invalidateQueries({queryKey:Z.tasks})})}function ei(){return D({mutationFn:e=>X(U.openTaskInHerdr(e))})}function ti(){return D({mutationFn:e=>X(U.focusAgentPane(e))})}function ni(e,t){return E({queryKey:Z.commitRecords(e),queryFn:()=>X(U.listCommitRecords(e)),enabled:t})}function ri(e,t){return E({queryKey:Z.taskActivity(e),queryFn:()=>X(U.listTaskActivity(e)),enabled:t})}function ii(e,t){return E({queryKey:Z.agentStatusTransitions(e),queryFn:()=>X(U.listAgentStatusTransitions(e)),enabled:t})}var ai=3e3;function oi(e){return e===`reserved`||e===`running`}function si(e){return E({queryKey:Z.taskRuns(e),queryFn:()=>X(U.listTaskRuns(e)),refetchInterval:e=>e.state.data?.some(e=>oi(e.state))?ai:!1})}function ci(e){return E({queryKey:Z.runLog(e),queryFn:()=>X(U.getRunLog(e,null)),enabled:e!==null,refetchInterval:e=>e.state.data&&oi(e.state.data.run.state)?ai:!1})}function li(){let e=h();return D({mutationFn:({taskId:e,adapter:t,mcp:n})=>X(U.startPlainRun(e,t,null,n)),onSettled:(t,n,{taskId:r})=>e.invalidateQueries({queryKey:Z.taskRuns(r)})})}function ui(){let e=h();return D({mutationFn:e=>X(U.stopRun(e.id)),onSettled:(t,n,r)=>Promise.all([e.invalidateQueries({queryKey:Z.taskRuns(r.taskId)}),e.invalidateQueries({queryKey:Z.runLog(r.id)})])})}function di(){let e=h();return D({mutationFn:e=>X(U.reconcileRun(e.id)),onSettled:(t,n,r)=>Promise.all([e.invalidateQueries({queryKey:Z.taskRuns(r.taskId)}),e.invalidateQueries({queryKey:Z.runLog(r.id)})])})}function fi(){let e=h();return D({mutationFn:e=>X(U.refreshCommitRecords(e)),onSuccess:(t,n)=>e.setQueryData(Z.commitRecords(n),t)})}function pi(){let e=h();return D({mutationFn:e=>X(U.openPullRequest(e)),onSuccess:t=>Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:Z.commitRecords(t.id)})])})}function mi(){let e=h();return D({mutationFn:e=>X(U.completeTask(e)),onSuccess:t=>Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:Z.commitRecords(t.id)}),e.invalidateQueries({queryKey:Z.taskActivity(t.id)})])})}function hi(){let e=h();return D({mutationFn:({id:e,note:t})=>X(U.concludeTask(e,t)),onSuccess:t=>Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:Z.commitRecords(t.id)}),e.invalidateQueries({queryKey:[`review`]})])})}function gi(){let e=h();return D({mutationFn:({id:e,note:t})=>X(U.setCompletionNote(e,t)),onSuccess:()=>Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:[`review`]})])})}function _i(){let e=h();return D({mutationFn:({id:e,reason:t})=>X(U.reopenTask(e,t)),onSuccess:()=>Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:[`review`]})])})}function vi(){let e=h();return D({mutationFn:({id:e,resolution:t,note:n})=>X(U.setTaskOutcome(e,t,n)),onSuccess:()=>Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:[`review`]})])})}function yi(){let e=h();return D({mutationFn:({id:e,mergedWithTask:t,pullRequestUrl:n})=>X(U.completeTaskMergedWith(e,t,n)),onSuccess:t=>Promise.all([e.invalidateQueries({queryKey:Z.tasks}),e.invalidateQueries({queryKey:Z.commitRecords(t.id)}),e.invalidateQueries({queryKey:[`review`]})])})}function bi(){let e=h();return D({mutationFn:e=>X(U.restoreTaskWorktree(e)),onSuccess:()=>e.invalidateQueries({queryKey:Z.tasks})})}function xi(){let e=h();return D({mutationFn:e=>X(U.updateTask(e)),onSuccess:()=>e.invalidateQueries({queryKey:Z.tasks})})}function $(e){let t=h();return D({mutationFn:e,onSuccess:()=>t.invalidateQueries({queryKey:Z.tasks})})}function Si(){return $(e=>X(U.pauseTask(e)))}function Ci(){return $(e=>X(U.closeTaskWorkspace(e)))}function wi(){return $(({taskId:e,criterionId:t,met:n,evidence:r})=>X(U.checkCriterion(e,t,n,r)))}function Ti(){return $(({id:e,force:t})=>X(U.deleteTask(e,t)))}function Ei(){return $(({id:e,dependsOn:t,confirmPause:n})=>X(U.addDependency(e,t,n)))}function Di(){return $(({id:e,dependsOn:t})=>X(U.removeDependency(e,t)))}function Oi(){return E({queryKey:Z.taskRelations,queryFn:()=>X(U.listTaskRelations())})}function ki(e){let t=h();return D({mutationFn:e,onSuccess:()=>t.invalidateQueries({queryKey:Z.taskRelations})})}function Ai(){return ki(({taskId:e,relatedId:t})=>X(U.addTaskRelation(e,t)))}function ji(){return ki(({taskId:e,relatedId:t})=>X(U.removeTaskRelation(e,t)))}function Mi(){return $(({id:e,number:t})=>X(U.linkIssue(e,t)))}function Ni(){return $(e=>X(U.createIssue(e)))}var Pi=class extends Error{constructor(e,t,n){super(`Task #${e} was added, but issue #${t} could not be linked: ${n}`),this.name=`IssueLinkFailure`}};function Fi(){let e=h();return D({mutationFn:async({issue:e,...t})=>{let n=await X(U.createTask(t));if(e===null)return n;try{return await X(U.linkIssue(n.id,e))}catch(t){throw new Pi(n.id,e,t instanceof Error?t.message:String(t))}},onSettled:()=>e.invalidateQueries({queryKey:Z.tasks})})}var Ii={planned:`Blocked`,ready:`Ready`,paused:`Paused`,in_progress:`In progress`,in_review:`Awaiting completion`,done:`Done`,not_adopted:`Not adopted`},Li=`Planned on`,Ri={neutral:`bg-muted text-foreground/70`,info:`bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200`,progress:`bg-blue-100 text-blue-800 dark:bg-blue-950 dark:text-blue-200`,review:`bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200`,success:`bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200`,attention:`bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-200`,danger:`bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200`},zi={neutral:`text-muted-foreground`,info:`text-sky-700 dark:text-sky-300`,progress:`text-blue-700 dark:text-blue-300`,review:`text-violet-700 dark:text-violet-300`,success:`text-emerald-700 dark:text-emerald-300`,attention:`text-amber-700 dark:text-amber-300`,danger:`text-rose-700 dark:text-rose-300`},Bi={neutral:`border-border text-muted-foreground`,info:`border-sky-300 text-sky-700 dark:border-sky-800 dark:text-sky-300`,progress:`border-blue-300 text-blue-700 dark:border-blue-800 dark:text-blue-300`,review:`border-violet-300 text-violet-700 dark:border-violet-800 dark:text-violet-300`,success:`border-emerald-300 text-emerald-700 dark:border-emerald-800 dark:text-emerald-300`,attention:`border-amber-300 text-amber-700 dark:border-amber-800 dark:text-amber-300`,danger:`border-rose-300 text-rose-700 dark:border-rose-800 dark:text-rose-300`},Vi=`border-input text-foreground/70`,Hi={info:`border border-sky-300 bg-sky-50 text-sky-900 dark:border-sky-800 dark:bg-sky-950 dark:text-sky-100`,attention:`border border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100`,danger:`border border-rose-300 bg-rose-50 text-rose-900 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-100`},Ui={neutral:`bg-neutral-400`,info:`bg-sky-500`,progress:`bg-blue-500`,review:`bg-violet-500`,success:`bg-emerald-500`,attention:`bg-amber-500`,danger:`bg-rose-500`},Wi={neutral:`border-muted-foreground`,info:`border-sky-500`,progress:`border-blue-500`,review:`border-violet-500`,success:`border-emerald-500`,attention:`border-amber-500`,danger:`border-rose-500 dark:border-rose-400`},Gi={done:`border-emerald-500 bg-emerald-100 dark:bg-emerald-950`,ready:`border-amber-500 shadow-none`,blocked:`border-dashed border-muted-foreground shadow-none`,paused:`border-dashed border-muted-foreground bg-muted shadow-none`,behindDue:`border-2 border-rose-500 dark:border-rose-400`},Ki=`border-foreground/70`,qi=`text-foreground`;export{Yr as $,Ft as $t,hi as A,ne as An,qn as At,ti as B,h as Bn,On as Bt,xr as C,E as Cn,Dr as Ct,ni as D,T as Dn,nr as Dt,Ci as E,Ee as En,rr as Et,Ti as F,y as Fn,Un as Ft,Mi as G,dn as Gt,Or as H,gn as Ht,zr as I,S as In,Hn as It,br as J,Qt as Jt,Zr as K,ln as Kt,kr as L,b as Ln,Kn as Lt,Ni as M,se as Mn,ar as Mt,Fi as N,oe as Nn,Wn as Nt,mi as O,Ce as On,tr as Ot,Nr as P,ae as Pn,Gn as Pt,Si as Q,I as Qt,Er as R,_e as Rn,U as Rt,Sr as S,D as Sn,Pr as St,wi as T,Le as Tn,Mr as Tt,Kr as U,fn as Ut,Xr as V,bn as Vt,Ar as W,V as Wt,pi as X,Xt,Fr as Y,B as Yt,ei as Z,Jt as Zt,X as _,mt as _n,ri as _t,Ii as a,ut as an,wr as at,ii as b,gt as bn,Wr as bt,Wi as c,Tt as cn,ci as ct,zi as d,A as dn,Qr as dt,Mt as en,di as et,Vi as f,bt as fn,gi as ft,Z as g,dt as gn,ui as gt,jr as h,Ct as hn,$r as ht,Li as i,xt as in,_i as it,Rr as j,x as jn,ir as jt,yi as k,w as kn,sr as kt,Bi as l,Dt as ln,qr as lt,Pi as m,j as mn,li as mt,qi as n,P as nn,Di as nt,Ri as o,Ot as on,bi as ot,vr as p,ft as pn,vi as pt,yr as q,tn as qt,Ki as r,wt as rn,ji as rt,Ui as s,k as sn,Gr as st,Gi as t,F as tn,fi as tt,Hi as u,N as un,Cr as ut,Ei as v,pt as vn,Oi as vt,Lr as w,Je as wn,Ir as wt,Jr as x,St as xn,xi as xt,Ai as y,ht as yn,si as yt,Tr as z,g as zn,kn as zt};
|