@openparachute/app 0.22.10 → 0.22.12

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/.parachute/info +1 -1
  3. package/dist/assets/{Account-DYfzZj5S.js → Account-CdkJMAPi.js} +1 -1
  4. package/dist/assets/Activity-DqsfIB-3.js +1 -0
  5. package/dist/assets/{AddVault-DKBqKeyq.js → AddVault-D1K_D6Y0.js} +1 -1
  6. package/dist/assets/{AddVaultChooser-BW2Q-Yue.js → AddVaultChooser-DCs3tJPw.js} +1 -1
  7. package/dist/assets/{AddVaultCreate-CtO9yrS5.js → AddVaultCreate-B3yMKaiU.js} +1 -1
  8. package/dist/assets/Calendar-DcVL4_q0.js +1 -0
  9. package/dist/assets/{CheckEmail-CIv1Gt1o.js → CheckEmail-taTm_0KJ.js} +1 -1
  10. package/dist/assets/{ConnectAI-BL20KQ5Y.js → ConnectAI-CsKHus0o.js} +1 -1
  11. package/dist/assets/DayView-BTm_sLsN.js +1 -0
  12. package/dist/assets/{Export-BynzqvGJ.js → Export-pVqCJjpd.js} +1 -1
  13. package/dist/assets/{Import-6SmwJlgO.js → Import-DDHJzkGw.js} +1 -1
  14. package/dist/assets/{NoteEditor-OPipzN_Z.js → NoteEditor-h3CHfMT1.js} +1 -1
  15. package/dist/assets/{NoteNew-Dy1AbHxm.js → NoteNew-DUVNgXN7.js} +2 -2
  16. package/dist/assets/{NoteRenderer-BXeTxHnB.js → NoteRenderer-BzRFYOTP.js} +1 -1
  17. package/dist/assets/NoteView-GsOFyCey.js +3 -0
  18. package/dist/assets/{OAuthCallback-D35vvyoO.js → OAuthCallback-BoeL9Unb.js} +1 -1
  19. package/dist/assets/{PinArchiveButtons-DyFdYBrq.js → PinArchiveButtons-DBJ9XC87.js} +1 -1
  20. package/dist/assets/{Settings-UmrOUQH_.js → Settings-C14K5QIf.js} +1 -1
  21. package/dist/assets/{TagPage-B7bGWyY4.js → TagPage-Dth86gwn.js} +1 -1
  22. package/dist/assets/{TagSchemaEditor-Bas3UMIJ.js → TagSchemaEditor-DrsKXHjg.js} +1 -1
  23. package/dist/assets/{Tags-CTF2n8-H.js → Tags-BAMUSxtu.js} +1 -1
  24. package/dist/assets/{VaultGraph-BLefh0Zh.js → VaultGraph-CUiB0dxf.js} +3 -3
  25. package/dist/assets/{Vaults-tXitT9QI.js → Vaults-YV2Gt5rq.js} +1 -1
  26. package/dist/assets/{ViewNew-DRZyYhEC.js → ViewNew--9bYKDKm.js} +1 -1
  27. package/dist/assets/ViewSurface-BhLi1m3l.js +1 -0
  28. package/dist/assets/Welcome-CG-4UtgI.js +1 -0
  29. package/dist/assets/{WizardShell-B0Fjh0Vt.js → WizardShell-BPt_HrH0.js} +1 -1
  30. package/dist/assets/{attachment-upload-B8YiOVGU.js → attachment-upload-DbV0j1WH.js} +1 -1
  31. package/dist/assets/{history-Ce29a331.js → history-Dwz434D-.js} +1 -1
  32. package/dist/assets/index-B9w7QdRL.css +1 -0
  33. package/dist/assets/index-CpyANXLa.js +66 -0
  34. package/dist/assets/{provenance-DDSHYRnT.js → provenance-O7CbiScI.js} +1 -1
  35. package/dist/assets/{react-force-graph-2d-G4yaBBi0.js → react-force-graph-2d-CQUSRInM.js} +1 -1
  36. package/dist/assets/{transcribe-default-B7i-j3pr.js → transcribe-default-DIcTpM6A.js} +1 -1
  37. package/dist/assets/{useAttachmentUploader-C78HTrMx.js → useAttachmentUploader-t5hlKCgS.js} +2 -2
  38. package/dist/index.html +2 -2
  39. package/dist/sw.js +1 -1
  40. package/meta.json +1 -1
  41. package/package.json +3 -2
  42. package/dist/assets/Activity-CKF0o1vW.js +0 -1
  43. package/dist/assets/Calendar-DFuh1M3x.js +0 -1
  44. package/dist/assets/DayView-Dr2pAVmN.js +0 -1
  45. package/dist/assets/NoteView-B0eNsUUX.js +0 -3
  46. package/dist/assets/ViewSurface-DzU1BogH.js +0 -1
  47. package/dist/assets/Welcome-yAs98HfO.js +0 -1
  48. package/dist/assets/index-H6VNro-x.js +0 -66
  49. package/dist/assets/index-rEtUY3V3.css +0 -1
@@ -1,4 +1,4 @@
1
- import{ac as fr,j as H,r as gn,a5 as ts,L as Wr}from"./index-H6VNro-x.js";function rs(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const is=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,as=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,os={};function Vr(e,n){return(os.jsx?as:is).test(e)}const ss=/[ \t\n\f\r]/g;function ls(e){return typeof e=="object"?e.type==="text"?Yr(e.value):!1:Yr(e)}function Yr(e){return e.replace(ss,"")===""}class Zn{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Zn.prototype.normal={};Zn.prototype.property={};Zn.prototype.space=void 0;function Xi(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Zn(t,r,n)}function nr(e){return e.toLowerCase()}class Le{constructor(n,t){this.attribute=t,this.property=n}}Le.prototype.attribute="";Le.prototype.booleanish=!1;Le.prototype.boolean=!1;Le.prototype.commaOrSpaceSeparated=!1;Le.prototype.commaSeparated=!1;Le.prototype.defined=!1;Le.prototype.mustUseProperty=!1;Le.prototype.number=!1;Le.prototype.overloadedBoolean=!1;Le.prototype.property="";Le.prototype.spaceSeparated=!1;Le.prototype.space=void 0;let cs=0;const Z=xn(),xe=xn(),tr=xn(),A=xn(),ge=xn(),yn=xn(),Ue=xn();function xn(){return 2**++cs}const rr=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:xe,commaOrSpaceSeparated:Ue,commaSeparated:yn,number:A,overloadedBoolean:tr,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),Dt=Object.keys(rr);class gr extends Le{constructor(n,t,r,i){let o=-1;if(super(n,t),Zr(this,"space",i),typeof r=="number")for(;++o<Dt.length;){const a=Dt[o];Zr(this,Dt[o],(r&rr[a])===rr[a])}}}gr.prototype.defined=!0;function Zr(e,n,t){t&&(e[n]=t)}function Rn(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new gr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[nr(r)]=r,t[nr(o.attribute)]=r}return new Zn(n,t,e.space)}const Qi=Rn({properties:{ariaActiveDescendant:null,ariaAtomic:xe,ariaAutoComplete:null,ariaBusy:xe,ariaChecked:xe,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:xe,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:xe,ariaFlowTo:ge,ariaGrabbed:xe,ariaHasPopup:null,ariaHidden:xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:A,ariaLive:null,ariaModal:xe,ariaMultiLine:xe,ariaMultiSelectable:xe,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:xe,ariaReadOnly:xe,ariaRelevant:null,ariaRequired:xe,ariaRoleDescription:ge,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:xe,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ji(e,n){return n in e?e[n]:n}function ea(e,n){return Ji(e,n.toLowerCase())}const us=Rn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:yn,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:ge,autoFocus:Z,autoPlay:Z,blocking:ge,capture:null,charSet:null,checked:Z,cite:null,className:ge,closedBy:null,colorSpace:null,cols:A,colSpan:A,command:null,commandFor:null,content:null,contentEditable:xe,controls:Z,controlsList:ge,coords:A|yn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:tr,draggable:xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:ge,height:A,hidden:tr,high:A,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:ge,itemRef:ge,itemScope:Z,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,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:Z,optimum:A,pattern:null,ping:ge,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:ge,required:Z,reversed:Z,rows:A,rowSpan:A,sandbox:ge,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:xe,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:xe,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:yn,part:ge,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:ea}),ds=Rn({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:Ue,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:ge,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:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,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:yn,g2:yn,glyphName:yn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:Ue,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,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:A,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:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ue,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ue,rev:Ue,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ue,requiredFeatures:Ue,requiredFonts:Ue,requiredFormats:Ue,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:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:Ue,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ue,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ue,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ji}),na=Rn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),ta=Rn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ea}),ra=Rn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),ps={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"},fs=/[A-Z]/g,jr=/-[a-z]/g,gs=/^data[-\w.:]+$/i;function ms(e,n){const t=nr(n);let r=n,i=Le;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&gs.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(jr,bs);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!jr.test(o)){let a=o.replace(fs,hs);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}i=gr}return new i(r,n)}function hs(e){return"-"+e.toLowerCase()}function bs(e){return e.charAt(1).toUpperCase()}const Es=Xi([Qi,us,na,ta,ra],"html"),mr=Xi([Qi,ds,na,ta,ra],"svg");function _s(e){return e.join(" ").trim()}var An={},Pt,Xr;function ys(){if(Xr)return Pt;Xr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
1
+ import{ae as fr,j as H,r as gn,a7 as ts,L as Wr}from"./index-CpyANXLa.js";function rs(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const is=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,as=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,os={};function Vr(e,n){return(os.jsx?as:is).test(e)}const ss=/[ \t\n\f\r]/g;function ls(e){return typeof e=="object"?e.type==="text"?Yr(e.value):!1:Yr(e)}function Yr(e){return e.replace(ss,"")===""}class Zn{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Zn.prototype.normal={};Zn.prototype.property={};Zn.prototype.space=void 0;function Xi(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Zn(t,r,n)}function nr(e){return e.toLowerCase()}class Le{constructor(n,t){this.attribute=t,this.property=n}}Le.prototype.attribute="";Le.prototype.booleanish=!1;Le.prototype.boolean=!1;Le.prototype.commaOrSpaceSeparated=!1;Le.prototype.commaSeparated=!1;Le.prototype.defined=!1;Le.prototype.mustUseProperty=!1;Le.prototype.number=!1;Le.prototype.overloadedBoolean=!1;Le.prototype.property="";Le.prototype.spaceSeparated=!1;Le.prototype.space=void 0;let cs=0;const Z=xn(),xe=xn(),tr=xn(),A=xn(),ge=xn(),yn=xn(),Ue=xn();function xn(){return 2**++cs}const rr=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:xe,commaOrSpaceSeparated:Ue,commaSeparated:yn,number:A,overloadedBoolean:tr,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),Dt=Object.keys(rr);class gr extends Le{constructor(n,t,r,i){let o=-1;if(super(n,t),Zr(this,"space",i),typeof r=="number")for(;++o<Dt.length;){const a=Dt[o];Zr(this,Dt[o],(r&rr[a])===rr[a])}}}gr.prototype.defined=!0;function Zr(e,n,t){t&&(e[n]=t)}function Rn(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new gr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[nr(r)]=r,t[nr(o.attribute)]=r}return new Zn(n,t,e.space)}const Qi=Rn({properties:{ariaActiveDescendant:null,ariaAtomic:xe,ariaAutoComplete:null,ariaBusy:xe,ariaChecked:xe,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:xe,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:xe,ariaFlowTo:ge,ariaGrabbed:xe,ariaHasPopup:null,ariaHidden:xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:A,ariaLive:null,ariaModal:xe,ariaMultiLine:xe,ariaMultiSelectable:xe,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:xe,ariaReadOnly:xe,ariaRelevant:null,ariaRequired:xe,ariaRoleDescription:ge,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:xe,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ji(e,n){return n in e?e[n]:n}function ea(e,n){return Ji(e,n.toLowerCase())}const us=Rn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:yn,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:ge,autoFocus:Z,autoPlay:Z,blocking:ge,capture:null,charSet:null,checked:Z,cite:null,className:ge,closedBy:null,colorSpace:null,cols:A,colSpan:A,command:null,commandFor:null,content:null,contentEditable:xe,controls:Z,controlsList:ge,coords:A|yn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:tr,draggable:xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:ge,height:A,hidden:tr,high:A,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:ge,itemRef:ge,itemScope:Z,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,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:Z,optimum:A,pattern:null,ping:ge,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:ge,required:Z,reversed:Z,rows:A,rowSpan:A,sandbox:ge,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:xe,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:xe,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:yn,part:ge,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:ea}),ds=Rn({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:Ue,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:ge,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:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,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:yn,g2:yn,glyphName:yn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:Ue,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,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:A,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:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ue,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ue,rev:Ue,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ue,requiredFeatures:Ue,requiredFonts:Ue,requiredFormats:Ue,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:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:Ue,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ue,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ue,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ji}),na=Rn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),ta=Rn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ea}),ra=Rn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),ps={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"},fs=/[A-Z]/g,jr=/-[a-z]/g,gs=/^data[-\w.:]+$/i;function ms(e,n){const t=nr(n);let r=n,i=Le;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&gs.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(jr,bs);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!jr.test(o)){let a=o.replace(fs,hs);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}i=gr}return new i(r,n)}function hs(e){return"-"+e.toLowerCase()}function bs(e){return e.charAt(1).toUpperCase()}const Es=Xi([Qi,us,na,ta,ra],"html"),mr=Xi([Qi,ds,na,ta,ra],"svg");function _s(e){return e.join(" ").trim()}var An={},Pt,Xr;function ys(){if(Xr)return Pt;Xr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
2
2
  `,c="/",u="*",d="",f="comment",p="declaration";function g(y,E){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];E=E||{};var S=1,w=1;function I(L){var v=L.match(n);v&&(S+=v.length);var j=L.lastIndexOf(l);w=~j?L.length-j:w+L.length}function R(){var L={line:S,column:w};return function(v){return v.position=new k(L),G(),v}}function k(L){this.start=L,this.end={line:S,column:w},this.source=E.source}k.prototype.content=y;function U(L){var v=new Error(E.source+":"+S+":"+w+": "+L);if(v.reason=L,v.filename=E.source,v.line=S,v.column=w,v.source=y,!E.silent)throw v}function $(L){var v=L.exec(y);if(v){var j=v[0];return I(j),y=y.slice(j.length),v}}function G(){$(t)}function x(L){var v;for(L=L||[];v=P();)v!==!1&&L.push(v);return L}function P(){var L=R();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var v=2;d!=y.charAt(v)&&(u!=y.charAt(v)||c!=y.charAt(v+1));)++v;if(v+=2,d===y.charAt(v-1))return U("End of comment missing");var j=y.slice(2,v-2);return w+=2,I(j),y=y.slice(v),w+=2,L({type:f,comment:j})}}function B(){var L=R(),v=$(r);if(v){if(P(),!$(i))return U("property missing ':'");var j=$(o),se=L({type:p,property:_(v[0].replace(e,d)),value:j?_(j[0].replace(e,d)):d});return $(a),se}}function ee(){var L=[];x(L);for(var v;v=B();)v!==!1&&(L.push(v),x(L));return L}return G(),ee()}function _(y){return y?y.replace(s,d):d}return Pt=g,Pt}var Qr;function ks(){if(Qr)return An;Qr=1;var e=An&&An.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(An,"__esModule",{value:!0}),An.default=t;const n=e(ys());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,n.default)(r),s=typeof i=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;s?i(c,u,l):u&&(o=o||{},o[c]=u)}),o}return An}var zn={},Jr;function xs(){if(Jr)return zn;Jr=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(c){return!c||t.test(c)||e.test(c)},a=function(c,u){return u.toUpperCase()},s=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),o(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,s):c=c.replace(r,s),c.replace(n,a))};return zn.camelCase=l,zn}var Un,ei;function ws(){if(ei)return Un;ei=1;var e=Un&&Un.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(ks()),t=xs();function r(i,o){var a={};return!i||typeof i!="string"||(0,n.default)(i,function(s,l){s&&l&&(a[(0,t.camelCase)(s,o)]=l)}),a}return r.default=r,Un=r,Un}var Ss=ws();const Ns=fr(Ss),ia=aa("end"),hr=aa("start");function aa(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ts(e){const n=hr(e),t=ia(e);if(n&&t)return{start:n,end:t}}function Kn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ni(e.position):"start"in e||"end"in e?ni(e):"line"in e||"column"in e?ir(e):""}function ir(e){return ti(e&&e.line)+":"+ti(e&&e.column)}function ni(e){return ir(e&&e.start)+"-"+ir(e&&e.end)}function ti(e){return e&&typeof e=="number"?e:1}class ve extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},a=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(a=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Kn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ve.prototype.file="";ve.prototype.name="";ve.prototype.reason="";ve.prototype.message="";ve.prototype.stack="";ve.prototype.column=void 0;ve.prototype.line=void 0;ve.prototype.ancestors=void 0;ve.prototype.cause=void 0;ve.prototype.fatal=void 0;ve.prototype.place=void 0;ve.prototype.ruleId=void 0;ve.prototype.source=void 0;const br={}.hasOwnProperty,As=new Map,vs=/[A-Z]/g,Cs=new Set(["table","tbody","thead","tfoot","tr"]),Is=new Set(["td","th"]),oa="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Os(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=zs(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Fs(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?mr:Es,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=sa(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function sa(e,n,t){if(n.type==="element")return Rs(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Ms(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ds(e,n,t);if(n.type==="mdxjsEsm")return Ls(e,n);if(n.type==="root")return Ps(e,n,t);if(n.type==="text")return Bs(e,n)}function Rs(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=mr,e.schema=i),e.ancestors.push(n);const o=ca(e,n.tagName,!1),a=Us(e,n);let s=_r(e,n);return Cs.has(n.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!ls(l):!0})),la(e,a,o,n),Er(a,s),e.ancestors.pop(),e.schema=r,e.create(n,o,a,t)}function Ms(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Vn(e,n.position)}function Ls(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Vn(e,n.position)}function Ds(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=mr,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:ca(e,n.name,!0),a=$s(e,n),s=_r(e,n);return la(e,a,o,n),Er(a,s),e.ancestors.pop(),e.schema=r,e.create(n,o,a,t)}function Ps(e,n,t){const r={};return Er(r,_r(e,n)),e.create(n,e.Fragment,r,t)}function Bs(e,n){return n.value}function la(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Er(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Fs(e,n,t){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?t:n;return s?c(o,a,s):c(o,a)}}function zs(e,n){return t;function t(r,i,o,a){const s=Array.isArray(o.children),l=hr(r);return n(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Us(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&br.call(n.properties,i)){const o=Hs(e,i,n.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Is.has(n.tagName)?r=s:t[a]=s}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function $s(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(t,e.evaluater.evaluateExpression(s.argument))}else Vn(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Vn(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function _r(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:As;for(;++r<n.children.length;){const o=n.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=sa(e,o,a);s!==void 0&&t.push(s)}return t}function Hs(e,n,t){const r=ms(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?rs(t):_s(t)),r.property==="style"){let i=typeof t=="object"?t:Gs(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Ks(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ps[r.property]||r.property:r.attribute,t]}}function Gs(e,n){try{return Ns(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ve("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=oa+"#cannot-parse-style-attribute",i}}function ca(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,a;for(;++o<i.length;){const s=Vr(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Vr(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return br.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vn(e)}function Vn(e,n){const t=new ve("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=oa+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Ks(e){const n={};let t;for(t in e)br.call(e,t)&&(n[qs(t)]=e[t]);return n}function qs(e){let n=e.replace(vs,Ws);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Ws(e){return"-"+e.toLowerCase()}const Bt={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"]},Vs={};function yr(e,n){const t=Vs,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return ua(e,r,i)}function ua(e,n,t){if(Ys(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ri(e.children,n,t)}return Array.isArray(e)?ri(e,n,t):""}function ri(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=ua(e[i],n,t);return r.join("")}function Ys(e){return!!(e&&typeof e=="object")}const ii=document.createElement("i");function kr(e){const n="&"+e+";";ii.innerHTML=n;const t=ii.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function $e(e,n,t,r){const i=e.length;let o=0,a;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);o<r.length;)a=r.slice(o,o+1e4),a.unshift(n,0),e.splice(...a),o+=1e4,n+=1e4}function Ge(e,n){return e.length>0?($e(e,e.length,0,n),e):n}const ai={}.hasOwnProperty;function da(e){const n={};let t=-1;for(;++t<e.length;)Zs(n,e[t]);return n}function Zs(e,n){let t;for(t in n){const i=(ai.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let a;if(o)for(a in o){ai.call(i,a)||(i[a]=[]);const s=o[a];js(i[a],Array.isArray(s)?s:s?[s]:[])}}}function js(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);$e(e,0,0,r)}function pa(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ve(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Re=mn(/[A-Za-z]/),Ae=mn(/[\dA-Za-z]/),Xs=mn(/[#-'*+\--9=?A-Z^-~]/);function ht(e){return e!==null&&(e<32||e===127)}const ar=mn(/\d/),Qs=mn(/[\dA-Fa-f]/),Js=mn(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function re(e){return e===-2||e===-1||e===32}const xt=mn(new RegExp("\\p{P}|\\p{S}","u")),kn=mn(/\s/);function mn(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Mn(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let a="";if(o===37&&Ae(e.charCodeAt(t+1))&&Ae(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(t+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+i+1,a=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function ae(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return re(l)?(e.enter(t),s(l)):n(l)}function s(l){return re(l)&&o++<i?(e.consume(l),s):(e.exit(t),n(l))}}const el={tokenize:nl};function nl(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ae(e,n,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return W(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const tl={tokenize:rl},oi={tokenize:il};function rl(e){const n=this,t=[];let r=0,i,o,a;return s;function s(w){if(r<t.length){const I=t[r];return n.containerState=I[1],e.attempt(I[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&S();const I=n.events.length;let R=I,k;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){k=n.events[R][1].end;break}E(r);let U=I;for(;U<n.events.length;)n.events[U][1].end={...k},U++;return $e(n.events,R+1,0,n.events.slice(I)),n.events.length=U,c(w)}return s(w)}function c(w){if(r===t.length){if(!i)return f(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(oi,u,d)(w)}function u(w){return i&&S(),E(r),f(w)}function d(w){return n.parser.lazy[n.now().line]=r!==t.length,a=n.now().offset,g(w)}function f(w){return n.containerState={},e.attempt(oi,p,g)(w)}function p(w){return r++,t.push([n.currentConstruct,n.containerState]),f(w)}function g(w){if(w===null){i&&S(),E(0),e.consume(w);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),_(w)}function _(w){if(w===null){y(e.exit("chunkFlow"),!0),E(0),e.consume(w);return}return W(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,n.interrupt=void 0,s):(e.consume(w),_)}function y(w,I){const R=n.sliceStream(w);if(I&&R.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(R),n.parser.lazy[w.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const U=n.events.length;let $=U,G,x;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(G){x=n.events[$][1].end;break}G=!0}for(E(r),k=U;k<n.events.length;)n.events[k][1].end={...x},k++;$e(n.events,$+1,0,n.events.slice(U)),n.events.length=k}}function E(w){let I=t.length;for(;I-- >w;){const R=t[I];n.containerState=R[1],R[0].exit.call(n,e)}t.length=w}function S(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function il(e,n,t){return ae(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function On(e){if(e===null||me(e)||kn(e))return 1;if(xt(e))return 2}function wt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const or={name:"attention",resolveAll:al,tokenize:ol};function al(e,n){let t=-1,r,i,o,a,s,l,c,u;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[t][1].start};si(d,-l),si(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:f},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[t][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ge(c,[["enter",e[r][1],n],["exit",e[r][1],n]])),c=Ge(c,[["enter",i,n],["enter",a,n],["exit",a,n],["enter",o,n]]),c=Ge(c,wt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),c=Ge(c,[["exit",o,n],["enter",s,n],["exit",s,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(u=2,c=Ge(c,[["enter",e[t][1],n],["exit",e[t][1],n]])):u=0,$e(e,r-1,t-r+3,c),t=r+c.length-u-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function ol(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=On(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),u=On(l),d=!u||u===2&&i||t.includes(l),f=!i||i===2&&u||t.includes(r);return c._open=!!(o===42?d:d&&(i||!f)),c._close=!!(o===42?f:f&&(u||!d)),n(l)}}function si(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const sl={name:"autolink",tokenize:ll};function ll(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Re(p)?(e.consume(p),a):p===64?t(p):c(p)}function a(p){return p===43||p===45||p===46||Ae(p)?(r=1,s(p)):c(p)}function s(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Ae(p))&&r++<32?(e.consume(p),s):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||ht(p)?t(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):Xs(p)?(e.consume(p),c):t(p)}function u(p){return Ae(p)?d(p):t(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):f(p)}function f(p){if((p===45||Ae(p))&&r++<63){const g=p===45?f:d;return e.consume(p),g}return t(p)}}const jn={partial:!0,tokenize:cl};function cl(e,n,t){return r;function r(o){return re(o)?ae(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||W(o)?n(o):t(o)}}const fa={continuation:{tokenize:dl},exit:pl,name:"blockQuote",tokenize:ul};function ul(e,n,t){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return t(a)}function o(a){return re(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(a))}}function dl(e,n,t){const r=this;return i;function i(a){return re(a)?ae(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(fa,n,t)(a)}}function pl(e){e.exit("blockQuote")}const ga={name:"characterEscape",tokenize:fl};function fl(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Js(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ma={name:"characterReference",tokenize:gl};function gl(e,n,t){const r=this;let i=0,o,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=Ae,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Qs,u):(e.enter("characterReferenceValue"),o=7,a=ar,u(d))}function u(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===Ae&&!kr(r.sliceSerialize(f))?t(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return a(d)&&i++<o?(e.consume(d),u):t(d)}}const li={partial:!0,tokenize:hl},ci={concrete:!0,name:"codeFenced",tokenize:ml};function ml(e,n,t){const r=this,i={partial:!0,tokenize:R};let o=0,a=0,s;return l;function l(k){return c(k)}function c(k){const U=r.events[r.events.length-1];return o=U&&U[1].type==="linePrefix"?U[2].sliceSerialize(U[1],!0).length:0,s=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===s?(a++,e.consume(k),u):a<3?t(k):(e.exit("codeFencedFenceSequence"),re(k)?ae(e,d,"whitespace")(k):d(k))}function d(k){return k===null||W(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(li,_,I)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||W(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):re(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ae(e,p,"whitespace")(k)):k===96&&k===s?t(k):(e.consume(k),f)}function p(k){return k===null||W(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||W(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===s?t(k):(e.consume(k),g)}function _(k){return e.attempt(i,I,y)(k)}function y(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),E}function E(k){return o>0&&re(k)?ae(e,S,"linePrefix",o+1)(k):S(k)}function S(k){return k===null||W(k)?e.check(li,_,I)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||W(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),w)}function I(k){return e.exit("codeFenced"),n(k)}function R(k,U,$){let G=0;return x;function x(v){return k.enter("lineEnding"),k.consume(v),k.exit("lineEnding"),P}function P(v){return k.enter("codeFencedFence"),re(v)?ae(k,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):B(v)}function B(v){return v===s?(k.enter("codeFencedFenceSequence"),ee(v)):$(v)}function ee(v){return v===s?(G++,k.consume(v),ee):G>=a?(k.exit("codeFencedFenceSequence"),re(v)?ae(k,L,"whitespace")(v):L(v)):$(v)}function L(v){return v===null||W(v)?(k.exit("codeFencedFence"),U(v)):$(v)}}}function hl(e,n,t){const r=this;return i;function i(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const Ft={name:"codeIndented",tokenize:El},bl={partial:!0,tokenize:_l};function El(e,n,t){const r=this;return i;function i(c){return e.enter("codeIndented"),ae(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):t(c)}function a(c){return c===null?l(c):W(c)?e.attempt(bl,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||W(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),n(c)}}function _l(e,n,t){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?t(a):W(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ae(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?n(a):W(a)?i(a):t(a)}}const yl={name:"codeText",previous:xl,resolve:kl,tokenize:wl};function kl(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||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),n-=r-i-2,r=i+2),i=void 0);return e}function xl(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wl(e,n,t){let r=0,i,o;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?t(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):W(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||W(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(d)):(o.type="codeTextData",c(d))}}class Sl{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$n(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),$n(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),$n(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);$n(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);$n(this.left,t.reverse())}}}function $n(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function ha(e){const n={};let t=-1,r,i,o,a,s,l,c;const u=new Sl(e);for(;++t<u.length;){for(;t in n;)t=n[t];if(r=u.get(t),t&&r[1].type==="chunkFlow"&&u.get(t-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Nl(u,t)),t=n[t],c=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(a=u.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,t),s.unshift(r),u.splice(i,t-i+1,s))}}return $e(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Nl(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let a=t._tokenizer;a||(a=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,f=-1,p=t,g=0,_=0;const y=[_];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=t;++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&&(_=f+1,y.push(_),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),f=y.length;f--;){const E=s.slice(y[f],y[f+1]),S=o.pop();l.push([S,S+E.length-1]),e.splice(S,2,E)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const Tl={resolve:vl,tokenize:Cl},Al={partial:!0,tokenize:Il};function vl(e){return ha(e),e}function Cl(e,n){let t;return r;function r(s){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):W(s)?e.check(Al,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),n(s)}function a(s){return e.consume(s),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Il(e,n,t){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ae(e,o,"linePrefix")}function o(a){if(a===null||W(a))return t(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function ba(e,n,t,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(E){return E===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(E),e.exit(o),f):E===null||E===32||E===41||ht(E)?t(E):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),_(E))}function f(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===62?(e.exit("chunkString"),e.exit(s),f(E)):E===null||E===60||W(E)?t(E):(e.consume(E),E===92?g:p)}function g(E){return E===60||E===62||E===92?(e.consume(E),p):p(E)}function _(E){return!u&&(E===null||E===41||me(E))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),n(E)):u<c&&E===40?(e.consume(E),u++,_):E===41?(e.consume(E),u--,_):E===null||E===32||E===40||ht(E)?t(E):(e.consume(E),E===92?y:_)}function y(E){return E===40||E===41||E===92?(e.consume(E),_):_(E)}}function Ea(e,n,t,r,i,o){const a=this;let s=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),u}function u(p){return s>999||p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?t(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):W(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||W(p)||s++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!re(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function _a(e,n,t,r,i,o){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):t(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),n):(e.enter(o),c(f))}function c(f){return f===a?(e.exit(o),l(a)):f===null?t(f):W(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ae(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===a||f===null||W(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===a||f===92?(e.consume(f),u):u(f)}}function qn(e,n){let t;return r;function r(i){return W(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):re(i)?ae(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Ol={name:"definition",tokenize:Ml},Rl={partial:!0,tokenize:Ll};function Ml(e,n,t){const r=this;let i;return o;function o(p){return e.enter("definition"),a(p)}function a(p){return Ea.call(r,e,s,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=Ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):t(p)}function l(p){return me(p)?qn(e,c)(p):c(p)}function c(p){return ba(e,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(Rl,d,d)(p)}function d(p){return re(p)?ae(e,f,"whitespace")(p):f(p)}function f(p){return p===null||W(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Ll(e,n,t){return r;function r(s){return me(s)?qn(e,i)(s):t(s)}function i(s){return _a(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return re(s)?ae(e,a,"whitespace")(s):a(s)}function a(s){return s===null||W(s)?n(s):t(s)}}const Dl={name:"hardBreakEscape",tokenize:Pl};function Pl(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return W(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const Bl={name:"headingAtx",resolve:Fl,tokenize:zl};function Fl(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},$e(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function zl(e,n,t){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||me(u)?(e.exit("atxHeadingSequence"),s(u)):t(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||W(u)?(e.exit("atxHeading"),n(u)):re(u)?ae(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||me(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const Ul=["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"],ui=["pre","script","style","textarea"],$l={concrete:!0,name:"htmlFlow",resolveTo:Kl,tokenize:ql},Hl={partial:!0,tokenize:Vl},Gl={partial:!0,tokenize:Wl};function Kl(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function ql(e,n,t){const r=this;let i,o,a,s,l;return c;function c(b){return u(b)}function u(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),d}function d(b){return b===33?(e.consume(b),f):b===47?(e.consume(b),o=!0,_):b===63?(e.consume(b),i=3,r.interrupt?n:m):Re(b)?(e.consume(b),a=String.fromCharCode(b),y):t(b)}function f(b){return b===45?(e.consume(b),i=2,p):b===91?(e.consume(b),i=5,s=0,g):Re(b)?(e.consume(b),i=4,r.interrupt?n:m):t(b)}function p(b){return b===45?(e.consume(b),r.interrupt?n:m):t(b)}function g(b){const Ce="CDATA[";return b===Ce.charCodeAt(s++)?(e.consume(b),s===Ce.length?r.interrupt?n:B:g):t(b)}function _(b){return Re(b)?(e.consume(b),a=String.fromCharCode(b),y):t(b)}function y(b){if(b===null||b===47||b===62||me(b)){const Ce=b===47,He=a.toLowerCase();return!Ce&&!o&&ui.includes(He)?(i=1,r.interrupt?n(b):B(b)):Ul.includes(a.toLowerCase())?(i=6,Ce?(e.consume(b),E):r.interrupt?n(b):B(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(b):o?S(b):w(b))}return b===45||Ae(b)?(e.consume(b),a+=String.fromCharCode(b),y):t(b)}function E(b){return b===62?(e.consume(b),r.interrupt?n:B):t(b)}function S(b){return re(b)?(e.consume(b),S):x(b)}function w(b){return b===47?(e.consume(b),x):b===58||b===95||Re(b)?(e.consume(b),I):re(b)?(e.consume(b),w):x(b)}function I(b){return b===45||b===46||b===58||b===95||Ae(b)?(e.consume(b),I):R(b)}function R(b){return b===61?(e.consume(b),k):re(b)?(e.consume(b),R):w(b)}function k(b){return b===null||b===60||b===61||b===62||b===96?t(b):b===34||b===39?(e.consume(b),l=b,U):re(b)?(e.consume(b),k):$(b)}function U(b){return b===l?(e.consume(b),l=null,G):b===null||W(b)?t(b):(e.consume(b),U)}function $(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||me(b)?R(b):(e.consume(b),$)}function G(b){return b===47||b===62||re(b)?w(b):t(b)}function x(b){return b===62?(e.consume(b),P):t(b)}function P(b){return b===null||W(b)?B(b):re(b)?(e.consume(b),P):t(b)}function B(b){return b===45&&i===2?(e.consume(b),j):b===60&&i===1?(e.consume(b),se):b===62&&i===4?(e.consume(b),ue):b===63&&i===3?(e.consume(b),m):b===93&&i===5?(e.consume(b),pe):W(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Hl,fe,ee)(b)):b===null||W(b)?(e.exit("htmlFlowData"),ee(b)):(e.consume(b),B)}function ee(b){return e.check(Gl,L,fe)(b)}function L(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),v}function v(b){return b===null||W(b)?ee(b):(e.enter("htmlFlowData"),B(b))}function j(b){return b===45?(e.consume(b),m):B(b)}function se(b){return b===47?(e.consume(b),a="",X):B(b)}function X(b){if(b===62){const Ce=a.toLowerCase();return ui.includes(Ce)?(e.consume(b),ue):B(b)}return Re(b)&&a.length<8?(e.consume(b),a+=String.fromCharCode(b),X):B(b)}function pe(b){return b===93?(e.consume(b),m):B(b)}function m(b){return b===62?(e.consume(b),ue):b===45&&i===2?(e.consume(b),m):B(b)}function ue(b){return b===null||W(b)?(e.exit("htmlFlowData"),fe(b)):(e.consume(b),ue)}function fe(b){return e.exit("htmlFlow"),n(b)}}function Wl(e,n,t){const r=this;return i;function i(a){return W(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):t(a)}function o(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function Vl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(jn,n,t)}}const Yl={name:"htmlText",tokenize:Zl};function Zl(e,n,t){const r=this;let i,o,a;return s;function s(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),l}function l(m){return m===33?(e.consume(m),c):m===47?(e.consume(m),R):m===63?(e.consume(m),w):Re(m)?(e.consume(m),$):t(m)}function c(m){return m===45?(e.consume(m),u):m===91?(e.consume(m),o=0,g):Re(m)?(e.consume(m),S):t(m)}function u(m){return m===45?(e.consume(m),p):t(m)}function d(m){return m===null?t(m):m===45?(e.consume(m),f):W(m)?(a=d,se(m)):(e.consume(m),d)}function f(m){return m===45?(e.consume(m),p):d(m)}function p(m){return m===62?j(m):m===45?f(m):d(m)}function g(m){const ue="CDATA[";return m===ue.charCodeAt(o++)?(e.consume(m),o===ue.length?_:g):t(m)}function _(m){return m===null?t(m):m===93?(e.consume(m),y):W(m)?(a=_,se(m)):(e.consume(m),_)}function y(m){return m===93?(e.consume(m),E):_(m)}function E(m){return m===62?j(m):m===93?(e.consume(m),E):_(m)}function S(m){return m===null||m===62?j(m):W(m)?(a=S,se(m)):(e.consume(m),S)}function w(m){return m===null?t(m):m===63?(e.consume(m),I):W(m)?(a=w,se(m)):(e.consume(m),w)}function I(m){return m===62?j(m):w(m)}function R(m){return Re(m)?(e.consume(m),k):t(m)}function k(m){return m===45||Ae(m)?(e.consume(m),k):U(m)}function U(m){return W(m)?(a=U,se(m)):re(m)?(e.consume(m),U):j(m)}function $(m){return m===45||Ae(m)?(e.consume(m),$):m===47||m===62||me(m)?G(m):t(m)}function G(m){return m===47?(e.consume(m),j):m===58||m===95||Re(m)?(e.consume(m),x):W(m)?(a=G,se(m)):re(m)?(e.consume(m),G):j(m)}function x(m){return m===45||m===46||m===58||m===95||Ae(m)?(e.consume(m),x):P(m)}function P(m){return m===61?(e.consume(m),B):W(m)?(a=P,se(m)):re(m)?(e.consume(m),P):G(m)}function B(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,ee):W(m)?(a=B,se(m)):re(m)?(e.consume(m),B):(e.consume(m),L)}function ee(m){return m===i?(e.consume(m),i=void 0,v):m===null?t(m):W(m)?(a=ee,se(m)):(e.consume(m),ee)}function L(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||me(m)?G(m):(e.consume(m),L)}function v(m){return m===47||m===62||me(m)?G(m):t(m)}function j(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function se(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),X}function X(m){return re(m)?ae(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),a(m)}}const xr={name:"labelEnd",resolveAll:Jl,resolveTo:ec,tokenize:nc},jl={tokenize:tc},Xl={tokenize:rc},Ql={tokenize:ic};function Jl(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&$e(e,0,e.length,t),e}function ec(e,n){let t=e.length,r=0,i,o,a,s;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=t);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,n],["enter",c,n]],s=Ge(s,e.slice(o+1,o+r+3)),s=Ge(s,[["enter",u,n]]),s=Ge(s,wt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),n)),s=Ge(s,[["exit",u,n],e[a-2],e[a-1],["exit",c,n]]),s=Ge(s,e.slice(a+1)),s=Ge(s,[["exit",l,n]]),$e(e,o,e.length,s),e}function nc(e,n,t){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(f){return o?o._inactive?d(f):(a=r.parser.defined.includes(Ve(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):t(f)}function l(f){return f===40?e.attempt(jl,u,a?u:d)(f):f===91?e.attempt(Xl,u,a?c:d)(f):a?u(f):d(f)}function c(f){return e.attempt(Ql,u,d)(f)}function u(f){return n(f)}function d(f){return o._balanced=!0,t(f)}}function tc(e,n,t){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return me(d)?qn(e,o)(d):o(d)}function o(d){return d===41?u(d):ba(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return me(d)?qn(e,l)(d):u(d)}function s(d){return t(d)}function l(d){return d===34||d===39||d===40?_a(e,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return me(d)?qn(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),n):t(d)}}function rc(e,n,t){const r=this;return i;function i(s){return Ea.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(s):t(s)}function a(s){return t(s)}}function ic(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ac={name:"labelStartImage",resolveAll:xr.resolveAll,tokenize:oc};function oc(e,n,t){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):t(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(s):n(s)}}const sc={name:"labelStartLink",resolveAll:xr.resolveAll,tokenize:lc};function lc(e,n,t){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const zt={name:"lineEnding",tokenize:cc};function cc(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ae(e,n,"linePrefix")}}const mt={name:"thematicBreak",tokenize:uc};function uc(e,n,t){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||W(c))?(e.exit("thematicBreak"),n(c)):t(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),re(c)?ae(e,s,"whitespace")(c):s(c))}}const Me={continuation:{tokenize:gc},exit:hc,name:"list",tokenize:fc},dc={partial:!0,tokenize:bc},pc={partial:!0,tokenize:mc};function fc(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:ar(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(mt,t,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return t(p)}function l(p){return ar(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):t(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(jn,r.interrupt?t:u,e.attempt(dc,f,d))}function u(p){return r.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return re(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):t(p)}function f(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function gc(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(jn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ae(e,n,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!re(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pc,n,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ae(e,e.attempt(Me,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function mc(e,n,t){const r=this;return ae(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(o):t(o)}}function hc(e){e.exit(this.containerState.type)}function bc(e,n,t){const r=this;return ae(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!re(o)&&a&&a[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const di={name:"setextUnderline",resolveTo:Ec,tokenize:_c};function Ec(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function _c(e,n,t){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):t(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),re(c)?ae(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||W(c)?(e.exit("setextHeadingLine"),n(c)):t(c)}}const yc={tokenize:kc};function kc(e){const n=this,t=e.attempt(jn,r,e.attempt(this.parser.constructs.flowInitial,i,ae(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Tl,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const xc={resolveAll:ka()},wc=ya("string"),Sc=ya("text");function ya(e){return{resolveAll:ka(e==="text"?Nc:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),l}function l(u){return c(u)?(t.exit("data"),o(u)):(t.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function ka(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function Nc(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(s=0),s){const c={type:t===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(t,0,["enter",c,n],["exit",c,n]),t+=2)}t++}return e}const Tc={42:Me,43:Me,45:Me,48:Me,49:Me,50:Me,51:Me,52:Me,53:Me,54:Me,55:Me,56:Me,57:Me,62:fa},Ac={91:Ol},vc={[-2]:Ft,[-1]:Ft,32:Ft},Cc={35:Bl,42:mt,45:[di,mt],60:$l,61:di,95:mt,96:ci,126:ci},Ic={38:ma,92:ga},Oc={[-5]:zt,[-4]:zt,[-3]:zt,33:ac,38:ma,42:or,60:[sl,Yl],91:sc,92:[Dl,ga],93:xr,95:or,96:yl},Rc={null:[or,xc]},Mc={null:[42,95]},Lc={null:[]},Dc=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Mc,contentInitial:Ac,disable:Lc,document:Tc,flow:Cc,flowInitial:vc,insideSpan:Rc,string:Ic,text:Oc},Symbol.toStringTag,{value:"Module"}));function Pc(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:U(R),check:U(k),consume:S,enter:w,exit:I,interrupt:U(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let u=n.tokenize.call(c,l);return n.resolveAll&&o.push(n),c;function d(P){return a=Ge(a,P),y(),a[a.length-1]!==null?[]:($(n,0),c.events=wt(o,c.events,c),c.events)}function f(P,B){return Fc(p(P),B)}function p(P){return Bc(a,P)}function g(){const{_bufferIndex:P,_index:B,line:ee,column:L,offset:v}=r;return{_bufferIndex:P,_index:B,line:ee,column:L,offset:v}}function _(P){i[P.line]=P.column,x()}function y(){let P;for(;r._index<a.length;){const B=a[r._index];if(typeof B=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<B.length;)E(B.charCodeAt(r._bufferIndex));else E(B)}}function E(P){u=u(P)}function S(P){W(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,x()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=P}function w(P,B){const ee=B||{};return ee.type=P,ee.start=g(),c.events.push(["enter",ee,c]),s.push(ee),ee}function I(P){const B=s.pop();return B.end=g(),c.events.push(["exit",B,c]),B}function R(P,B){$(P,B.from)}function k(P,B){B.restore()}function U(P,B){return ee;function ee(L,v,j){let se,X,pe,m;return Array.isArray(L)?fe(L):"tokenize"in L?fe([L]):ue(L);function ue(Ee){return Je;function Je(De){const en=De!==null&&Ee[De],Pe=De!==null&&Ee.null,ln=[...Array.isArray(en)?en:en?[en]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return fe(ln)(De)}}function fe(Ee){return se=Ee,X=0,Ee.length===0?j:b(Ee[X])}function b(Ee){return Je;function Je(De){return m=G(),pe=Ee,Ee.partial||(c.currentConstruct=Ee),Ee.name&&c.parser.constructs.disable.null.includes(Ee.name)?He():Ee.tokenize.call(B?Object.assign(Object.create(c),B):c,l,Ce,He)(De)}}function Ce(Ee){return P(pe,m),v}function He(Ee){return m.restore(),++X<se.length?b(se[X]):j}}}function $(P,B){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&$e(c.events,B,c.events.length-B,P.resolve(c.events.slice(B),c)),P.resolveTo&&(c.events=P.resolveTo(c.events,c))}function G(){const P=g(),B=c.previous,ee=c.currentConstruct,L=c.events.length,v=Array.from(s);return{from:L,restore:j};function j(){r=P,c.previous=B,c.currentConstruct=ee,c.events.length=L,s=v,x()}}function x(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Bc(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let a;if(t===i)a=[e[t].slice(r,o)];else{if(a=e.slice(t,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function Fc(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
3
3
  `;break}case-3:{a=`\r
4
4
  `;break}case-2:{a=n?" ":" ";break}case-1:{if(!n&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function zc(e){const r={constructs:da([Dc,...(e||{}).extensions||[]]),content:i(el),defined:[],document:i(tl),flow:i(yc),lazy:{},string:i(wc),text:i(Sc)};return r;function i(o){return a;function a(s){return Pc(r,o,s)}}}function Uc(e){for(;!ha(e););return e}const pi=/[\0\t\n\r]/g;function $c(){let e=1,n="",t=!0,r;return i;function i(o,a,s){const l=[];let c,u,d,f,p;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),d=0,n="",t&&(o.charCodeAt(0)===65279&&d++,t=void 0);d<o.length;){if(pi.lastIndex=d,c=pi.exec(o),f=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(f),!c){n=o.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(o.slice(d,f)),e+=f-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return s&&(r&&l.push(-5),n&&l.push(n),l.push(null)),l}}const Hc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Gc(e){return e.replace(Hc,Kc)}function Kc(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return pa(t.slice(o?2:1),o?16:10)}return kr(t)||e}const xa={}.hasOwnProperty;function qc(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),Wc(t)(Uc(zc(t).document().write($c()(e,n,!0))))}function Wc(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Nn),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(Sn),blockQuote:o(Pe),characterEscape:G,characterReference:G,codeFenced:o(ln),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(ln,a),codeText:o(Ln,a),codeTextData:G,data:G,codeFlowValue:G,definition:o(Dn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Pn),hardBreakEscape:o(oe),hardBreakTrailing:o(oe),htmlFlow:o(nn,a),htmlFlowData:G,htmlText:o(nn,a),htmlTextData:G,image:o(tn),label:a,link:o(Nn),listItem:o(At),listItemValue:f,listOrdered:o(Bn,d),listUnordered:o(Bn),paragraph:o(vt),reference:b,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Sn),strong:o(Jn),thematicBreak:o(et)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:en,autolinkProtocol:De,blockQuote:l(),characterEscapeValue:x,characterReferenceMarkerHexadecimal:He,characterReferenceMarkerNumeric:He,characterReferenceValue:Ee,characterReference:Je,codeFenced:l(y),codeFencedFence:_,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:x,codeIndented:l(E),codeText:l(v),codeTextData:x,data:x,definition:l(),definitionDestinationString:I,definitionLabelString:S,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(ee),htmlFlowData:x,htmlText:l(L),htmlTextData:x,image:l(se),label:pe,labelText:X,lineEnding:P,link:l(j),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ce,resourceDestinationString:m,resourceTitleString:ue,resource:fe,setextHeading:l($),setextHeadingLineSequence:U,setextHeadingText:k,strong:l(),thematicBreak:l()}};wa(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(N){let O={type:"root",children:[]};const V={stack:[O],tokenStack:[],config:n,enter:s,exit:c,buffer:a,resume:u,data:t},te=[];let le=-1;for(;++le<N.length;)if(N[le][1].type==="listOrdered"||N[le][1].type==="listUnordered")if(N[le][0]==="enter")te.push(le);else{const Be=te.pop();le=i(N,Be,le)}for(le=-1;++le<N.length;){const Be=n[N[le][0]];xa.call(Be,N[le][1].type)&&Be[N[le][1].type].call(Object.assign({sliceSerialize:N[le][2].sliceSerialize},V),N[le][1])}if(V.tokenStack.length>0){const Be=V.tokenStack[V.tokenStack.length-1];(Be[1]||fi).call(V,void 0,Be[0])}for(O.position={start:fn(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:fn(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++le<n.transforms.length;)O=n.transforms[le](O)||O;return O}function i(N,O,V){let te=O-1,le=-1,Be=!1,an,Ke,cn,hn;for(;++te<=V;){const Ie=N[te];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?le++:le--,hn=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(an&&!hn&&!le&&!cn&&(cn=te),hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hn=void 0}if(!le&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||le===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(an){let un=te;for(Ke=void 0;un--;){const Fe=N[un];if(Fe[1].type==="lineEnding"||Fe[1].type==="lineEndingBlank"){if(Fe[0]==="exit")continue;Ke&&(N[Ke][1].type="lineEndingBlank",Be=!0),Fe[1].type="lineEnding",Ke=un}else if(!(Fe[1].type==="linePrefix"||Fe[1].type==="blockQuotePrefix"||Fe[1].type==="blockQuotePrefixWhitespace"||Fe[1].type==="blockQuoteMarker"||Fe[1].type==="listItemIndent"))break}cn&&(!Ke||cn<Ke)&&(an._spread=!0),an.end=Object.assign({},Ke?N[Ke][1].start:Ie[1].end),N.splice(Ke||te,0,["exit",an,Ie[2]]),te++,V++}if(Ie[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};an=un,N.splice(te,0,["enter",un,Ie[2]]),te++,V++,cn=void 0,hn=!0}}}return N[O][1]._spread=Be,V}function o(N,O){return V;function V(te){s.call(this,N(te),te),O&&O.call(this,te)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(N,O,V){this.stack[this.stack.length-1].children.push(N),this.stack.push(N),this.tokenStack.push([O,V||void 0]),N.position={start:fn(O.start),end:void 0}}function l(N){return O;function O(V){N&&N.call(this,V),c.call(this,V)}}function c(N,O){const V=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==N.type&&(O?O.call(this,N,te[0]):(te[1]||fi).call(this,N,te[0]));else throw new Error("Cannot close `"+N.type+"` ("+Kn({start:N.start,end:N.end})+"): it’s not open");V.position.end=fn(N.end)}function u(){return yr(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(N){if(this.data.expectingFirstListItemValue){const O=this.stack[this.stack.length-2];O.start=Number.parseInt(this.sliceSerialize(N),10),this.data.expectingFirstListItemValue=void 0}}function p(){const N=this.resume(),O=this.stack[this.stack.length-1];O.lang=N}function g(){const N=this.resume(),O=this.stack[this.stack.length-1];O.meta=N}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N.replace(/(\r?\n|\r)$/g,"")}function S(N){const O=this.resume(),V=this.stack[this.stack.length-1];V.label=O,V.identifier=Ve(this.sliceSerialize(N)).toLowerCase()}function w(){const N=this.resume(),O=this.stack[this.stack.length-1];O.title=N}function I(){const N=this.resume(),O=this.stack[this.stack.length-1];O.url=N}function R(N){const O=this.stack[this.stack.length-1];if(!O.depth){const V=this.sliceSerialize(N).length;O.depth=V}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function U(N){const O=this.stack[this.stack.length-1];O.depth=this.sliceSerialize(N).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function G(N){const V=this.stack[this.stack.length-1].children;let te=V[V.length-1];(!te||te.type!=="text")&&(te=rn(),te.position={start:fn(N.start),end:void 0},V.push(te)),this.stack.push(te)}function x(N){const O=this.stack.pop();O.value+=this.sliceSerialize(N),O.position.end=fn(N.end)}function P(N){const O=this.stack[this.stack.length-1];if(this.data.atHardBreak){const V=O.children[O.children.length-1];V.position.end=fn(N.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(O.type)&&(G.call(this,N),x.call(this,N))}function B(){this.data.atHardBreak=!0}function ee(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N}function L(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N}function v(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N}function j(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const O=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=O,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function se(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const O=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=O,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function X(N){const O=this.sliceSerialize(N),V=this.stack[this.stack.length-2];V.label=Gc(O),V.identifier=Ve(O).toLowerCase()}function pe(){const N=this.stack[this.stack.length-1],O=this.resume(),V=this.stack[this.stack.length-1];if(this.data.inReference=!0,V.type==="link"){const te=N.children;V.children=te}else V.alt=O}function m(){const N=this.resume(),O=this.stack[this.stack.length-1];O.url=N}function ue(){const N=this.resume(),O=this.stack[this.stack.length-1];O.title=N}function fe(){this.data.inReference=void 0}function b(){this.data.referenceType="collapsed"}function Ce(N){const O=this.resume(),V=this.stack[this.stack.length-1];V.label=O,V.identifier=Ve(this.sliceSerialize(N)).toLowerCase(),this.data.referenceType="full"}function He(N){this.data.characterReferenceType=N.type}function Ee(N){const O=this.sliceSerialize(N),V=this.data.characterReferenceType;let te;V?(te=pa(O,V==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=kr(O);const le=this.stack[this.stack.length-1];le.value+=te}function Je(N){const O=this.stack.pop();O.position.end=fn(N.end)}function De(N){x.call(this,N);const O=this.stack[this.stack.length-1];O.url=this.sliceSerialize(N)}function en(N){x.call(this,N);const O=this.stack[this.stack.length-1];O.url="mailto:"+this.sliceSerialize(N)}function Pe(){return{type:"blockquote",children:[]}}function ln(){return{type:"code",lang:null,meta:null,value:""}}function Ln(){return{type:"inlineCode",value:""}}function Dn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pn(){return{type:"emphasis",children:[]}}function Sn(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function nn(){return{type:"html",value:""}}function tn(){return{type:"image",title:null,url:"",alt:null}}function Nn(){return{type:"link",title:null,url:"",children:[]}}function Bn(N){return{type:"list",ordered:N.type==="listOrdered",start:null,spread:N._spread,children:[]}}function At(N){return{type:"listItem",spread:N._spread,checked:null,children:[]}}function vt(){return{type:"paragraph",children:[]}}function Jn(){return{type:"strong",children:[]}}function rn(){return{type:"text",value:""}}function et(){return{type:"thematicBreak"}}}function fn(e){return{line:e.line,column:e.column,offset:e.offset}}function wa(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?wa(e,r):Vc(e,r)}}function Vc(e,n){let t;for(t in n)if(xa.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function fi(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Kn({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Kn({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Kn({start:n.start,end:n.end})+") is still open")}function Yc(e){const n=this;n.parser=t;function t(r){return qc(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Zc(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function jc(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-force-graph-2d-CQUSRInM.js","assets/index-CpyANXLa.js","assets/index-B9w7QdRL.css"])))=>i.map(i=>d[i]);
2
+ import{a7 as w,a as k,ax as U,r as d,aO as D,j as t,ah as F,aP as V,L as g,aQ as O,aR as _,aS as z,aT as H,aU as G,ag as W,aV as K,N as Q,a2 as q,y as b,a3 as X,aW as Y,ay as Z,ai as L,aX as J,aY as ee,aZ as te,a_ as se,ao as ne,a$ as re,E as ae,z as ie,b0 as $,A as P,$ as oe,b1 as le,V as ce,a9 as de}from"./index-CpyANXLa.js";import{P as ue,D as me}from"./PinArchiveButtons-DBJ9XC87.js";import{b as xe,N as he}from"./NoteRenderer-BzRFYOTP.js";function fe(e,n){const s=w(),r=k(u=>u.activeVaultId),i=U(),[l,a]=d.useState(!1),o=n&&!pe(n)?n.path:void 0;return d.useEffect(()=>{if(a(!1),!s||!r||!e||!o)return;let u=!0;const m=()=>{u&&i.invalidateQueries({queryKey:["note",r,e]})},c=ge(s,o,{onUpsert:m,onRemove:m,onStatus:h=>{u&&a(h==="open")}});return()=>{u=!1,a(!1),c()}},[s,r,e,o,i]),{isLive:l}}function pe(e){return D(e.id)}function ge(e,n,s){return e.subscribe({path:n},{onSnapshot:()=>{},onUpsert:()=>s.onUpsert(),onRemove:()=>s.onRemove(),onStatus:s.onStatus})}const be=1,je=3,Ne=1;function ve(e,n){const s=new Map,r=new Map;for(const l of n.values())for(const a of l.links??[]){if(a.sourceId===a.targetId||!n.has(a.sourceId)||!n.has(a.targetId))continue;const o=`${a.sourceId}|${a.targetId}|${a.relationship}`;s.has(o)||(s.set(o,{source:a.sourceId,target:a.targetId,relationship:a.relationship}),r.set(a.sourceId,(r.get(a.sourceId)??0)+1),r.set(a.targetId,(r.get(a.targetId)??0)+1))}return{nodes:[...n.values()].map(l=>{var a;return{id:l.id,path:l.path,tags:l.tags,summary:typeof((a=l.metadata)==null?void 0:a.summary)=="string"?l.metadata.summary:void 0,isAnchor:l.id===e,linkCount:r.get(l.id)??0}}),edges:[...s.values()]}}async function ye(e,n,s,r){const i=new Map;i.set(e.id,e);let l=[e];for(let a=1;a<=n;a++){const o=new Set;for(const c of l)for(const h of c.links??[]){const f=h.sourceId===c.id?h.targetId:h.sourceId;f!==c.id&&(i.has(f)||o.add(f))}if(o.size===0)break;const u=await Promise.all([...o].map(c=>s(c).catch(()=>null)));if(r!=null&&r.cancelled)return i;const m=[];for(const c of u)c&&!i.has(c.id)&&(i.set(c.id,c),m.push(c));l=m}return i}function we(e,n,s){const[r,i]=d.useState(null),[l,a]=d.useState(!1);return d.useEffect(()=>{if(!e||!n){i(null),a(!1);return}const o={cancelled:!1};return a(!0),ye(n,s,u=>e.getNote(u,{includeLinks:!0}),o).then(u=>{o.cancelled||(i(ve(n.id,u)),a(!1))}).catch(()=>{o.cancelled||a(!1)}),()=>{o.cancelled=!0}},[e,n,s]),{data:r,isLoading:l}}const ke=d.lazy(()=>_(()=>import("./react-force-graph-2d-CQUSRInM.js"),__vite__mapDeps([0,1,2])));function Ce({anchor:e}){const[n,s]=d.useState(!0),[r,i]=d.useState(Ne),l=w(),{data:a,isLoading:o}=we(l,n?e:void 0,r);return t.jsxs("section",{className:"mt-10 border-t border-border pt-6",children:[t.jsxs("header",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("button",{type:"button",onClick:()=>s(u=>!u),"aria-expanded":n,className:"font-serif text-xl text-fg hover:text-accent",children:[n?"▾":"▸"," Neighborhood"]}),n&&a?t.jsxs("span",{className:"text-xs text-fg-dim",children:[a.nodes.length," ",a.nodes.length===1?"note":"notes"]}):null]}),n?t.jsx(Ie,{depth:r,onChange:i}):null]}),n?t.jsx(Ee,{data:a,isLoading:o}):null]})}function Ie({depth:e,onChange:n}){const s=[];for(let r=be;r<=je;r++)s.push(r);return t.jsxs("fieldset",{className:"flex items-center gap-1 text-xs text-fg-dim",children:[t.jsx("legend",{className:"mr-1 inline-block",children:"Hops"}),s.map(r=>t.jsx("button",{type:"button","aria-pressed":r===e,onClick:()=>n(r),className:r===e?"rounded border border-accent bg-accent/10 px-2 py-0.5 text-accent":"rounded border border-border bg-card px-2 py-0.5 hover:text-accent",children:r},r))]})}function Ee({data:e,isLoading:n}){const[s,r]=d.useState(null),i=d.useRef(null);if(d.useEffect(()=>{s&&e&&!e.nodes.some(m=>m.id===s)&&r(null)},[e,s]),!e&&n)return t.jsx(B,{});if(!e)return null;if(e.nodes.length<=1)return t.jsx("div",{className:"rounded-md border border-border bg-card p-6 text-center text-sm text-fg-dim",children:"This note has no neighbors yet."});const l=e.nodes.filter(m=>!m.isAnchor),a=s?e.nodes.find(m=>m.id===s)??null:null,o=m=>{i.current=document.activeElement??null,r(m)},u=m=>{var c,h;r(null),m!=null&&m.restoreFocus&&((h=(c=i.current)==null?void 0:c.focus)==null||h.call(c))};return t.jsxs(t.Fragment,{children:[t.jsx(Pe,{data:e,onSelect:o}),a?t.jsx(Re,{node:a,onClose:u},a.id):null,t.jsx(Se,{neighbors:l,selectedId:s,onSelect:o})]})}function Se({neighbors:e,selectedId:n,onSelect:s}){return e.length===0?null:t.jsxs("div",{className:"mt-4",children:[t.jsx("h3",{className:"eyebrow mb-2",children:"Neighbors"}),t.jsx("ul",{className:"flex flex-wrap gap-2",children:e.map(r=>{const i=O(r.path??r.id);return t.jsx("li",{children:t.jsx("button",{type:"button",onClick:()=>s(r.id),"aria-haspopup":"dialog","aria-pressed":n===r.id,"aria-label":`Preview ${i}`,className:`btn btn-sm btn-touch max-w-full ${n===r.id?"btn-primary":"btn-secondary"}`,children:t.jsx("span",{className:"truncate",children:i})})},r.id)})})]})}function Re({node:e,onClose:n}){var a;const s=F(e.id),r=d.useRef(null);d.useEffect(()=>{var o;(o=r.current)==null||o.focus()},[]);const i=V({id:e.id,path:e.path,content:(a=s.data)==null?void 0:a.content}),l=Le(s.data);return t.jsxs("div",{role:"dialog",ref:r,"aria-label":"Note preview",tabIndex:-1,"data-testid":"neighbor-preview",onKeyDown:o=>{o.key==="Escape"&&n({restoreFocus:!0})},onBlur:o=>{o.currentTarget.contains(o.relatedTarget)||n()},className:"focus-ring card mt-3 p-4",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsx("h3",{className:"min-w-0 truncate font-serif text-lg text-fg",children:i}),t.jsx("button",{type:"button",onClick:()=>n({restoreFocus:!0}),"aria-label":"Close preview",className:"shrink-0 text-fg-dim hover:text-accent",children:"✕"})]}),e.tags&&e.tags.length>0?t.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:e.tags.map(o=>t.jsxs("span",{className:"chip chip-tag max-w-full break-all",children:["#",o]},o))}):null,t.jsx(Te,{isPaused:s.fetchStatus==="paused",isPending:s.isPending,isError:s.isError,snippet:l}),t.jsx("div",{className:"mt-3",children:t.jsx(g,{to:`/n/${encodeURIComponent(e.id)}`,className:"btn btn-primary btn-touch",children:"Open note"})})]})}function Te({isPaused:e,isPending:n,isError:s,snippet:r}){return e&&n?t.jsx("p",{className:"mt-2 text-sm text-fg-dim",children:"Preview unavailable offline."}):n?t.jsx("p",{className:"mt-2 text-sm text-fg-dim",children:"Loading preview…"}):s?t.jsx("p",{className:"mt-2 text-sm text-fg-dim",children:"Couldn't load preview."}):r?t.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:r}):t.jsx("p",{className:"mt-2 text-sm text-fg-dim",children:"No preview text."})}function Le(e){if(!e)return null;const n=(e.preview??z(e.content??"")).trim();return n?n.length>200?`${n.slice(0,200).trimEnd()}…`:n:null}function B(){return t.jsx("div",{"aria-busy":"true",className:"h-[24rem] w-full animate-pulse rounded-md border border-border bg-card"})}function Pe({data:e,onSelect:n}){const s=d.useRef(null),[r,i]=d.useState({w:600,h:384});d.useEffect(()=>{const a=s.current;if(!a)return;const o=()=>{const m=a.getBoundingClientRect();i({w:Math.max(320,Math.floor(m.width)),h:384})};o();const u=new ResizeObserver(o);return u.observe(a),()=>u.disconnect()},[]);const l=d.useMemo(()=>({nodes:e.nodes.map(a=>({...a})),links:e.edges.map(a=>({source:a.source,target:a.target,rel:a.relationship}))}),[e]);return t.jsx("div",{ref:s,"data-testid":"neighborhood-graph-canvas",className:"overflow-hidden rounded-md border border-border bg-card",children:t.jsx(d.Suspense,{fallback:t.jsx(B,{}),children:t.jsx(ke,{graphData:l,width:r.w,height:r.h,nodeLabel:a=>Ae(a),nodeVal:a=>{const o=a;return o.isAnchor?8:3+Math.min(o.linkCount,8)},nodeColor:a=>a.isAnchor?"#c9b170":"#8a9a7a",linkColor:()=>"rgba(160, 160, 160, 0.4)",linkDirectionalArrowLength:3,linkDirectionalArrowRelPos:1,cooldownTicks:80,onNodeClick:a=>{n(a.id)}})})})}function Ae(e){const n=[e.path??e.id];return e.tags&&e.tags.length>0&&n.push(`tags: ${e.tags.join(", ")}`),e.summary&&n.push(e.summary),n.join(`
3
+ `)}function Fe({content:e,attachments:n,onRetry:s,retrying:r=!1}){const i={content:e,attachments:n},l=H(i);if(l==="pending"){const a=G(i);return t.jsxs("output",{"aria-live":"polite",className:"mb-4 inline-flex items-center gap-2 rounded-md border border-sky-500/30 bg-sky-500/5 px-3 py-1.5 text-xs text-sky-300",children:[t.jsx("span",{"aria-hidden":!0,className:"inline-block h-2 w-2 animate-pulse rounded-full bg-sky-400"}),"Transcribing…",a?t.jsxs("span",{className:"text-sky-300/80",children:["part ",Math.min(a.done+1,a.total)," of ",a.total]}):null]})}return l==="failed"?t.jsxs("output",{className:"mb-4 inline-flex flex-wrap items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-1.5 text-xs text-amber-200",children:[t.jsx("span",{children:"Transcription unavailable — open the audio below and add a note by hand."}),s?t.jsx("button",{type:"button",onClick:s,disabled:r,className:"rounded border border-amber-500/40 px-2 py-0.5 font-medium text-amber-100 hover:bg-amber-500/15 disabled:opacity-50",children:r?"Retrying…":"Retry"}):null]}):l==="voice-limit"?t.jsx("output",{className:"mb-4 inline-flex items-center gap-2 rounded-md border border-border bg-bg/40 px-3 py-1.5 text-xs text-fg-muted",children:"Monthly voice limit reached — transcription resumes next month. The audio is saved below."}):null}function et(){const{id:e}=W(),n=k(r=>r.getActiveVault()),s=F(e);return fe(e,s.data),d.useEffect(()=>{n&&e&&K(n.id,e)},[n,e]),n?t.jsxs("div",{className:"page",children:[t.jsx("nav",{className:"mb-6 text-sm text-fg-dim",children:t.jsx(g,{to:"/notes",className:"focus-ring hover:text-accent",children:"← All notes"})}),s.isPending?t.jsx(Ge,{}):s.data?t.jsxs(t.Fragment,{children:[s.isError?t.jsx(q,{}):null,t.jsx($e,{note:s.data,cacheId:e})]}):s.isError?t.jsx(Xe,{error:s.error,retry:()=>s.refetch()}):t.jsx(qe,{id:e??""})]}):t.jsx(Q,{to:"/",replace:!0})}function $e({note:e,cacheId:n}){var R,T;const s=k(x=>x.getActiveVault()),{roles:r}=X((s==null?void 0:s.id)??null),i=Y(),{mirror:l}=Z(),a=l.state==="offline",o=e.contentEvicted===!0,u=d.useMemo(()=>xe(e),[e]),m=L(x=>x.on),c=L(x=>x.setOn);d.useEffect(()=>{if(!m)return;const x=y=>{y.key==="Escape"&&c(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[m,c]);const h=e.path??e.id,f=J(e.content),p=f!==null&&!ee(f,e)?f:null,j=p!==null?{kind:"title",text:p}:e.path?te(e.path):{kind:"title",text:e.id},C=d.useMemo(()=>p!==null?{...e,content:se(e.content??"")}:e,[e,p]),I=typeof((R=e.metadata)==null?void 0:R.summary)=="string"?e.metadata.summary:null,E=d.useMemo(()=>(e.links??[]).filter(x=>x.targetId===e.id&&x.sourceId!==e.id&&x.sourceNote),[e]),S=d.useMemo(()=>{const x=new Set,y=[];for(const N of e.links??[])N.sourceId!==e.id||N.targetId===e.id||N.targetNote&&(x.has(N.targetId)||(x.add(N.targetId),y.push(N)));return y},[e]);return t.jsxs("article",{className:"grid gap-10 lg:grid-cols-[minmax(0,1fr)_18rem]",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("header",{className:"mb-8 border-b border-border pb-5",children:[t.jsx("h1",{className:j.kind==="timestamp"?"page-title title-timestamp":"page-title",children:j.text}),a?t.jsx(Ke,{}):null,e.tags&&e.tags.length>0?t.jsx(Ue,{tags:e.tags}):null,I?t.jsx("p",{className:"mt-3 text-fg-muted",children:I}):null,t.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[t.jsx(g,{to:`/n/${encodeURIComponent(e.id)}/edit`,className:"btn btn-secondary btn-touch",children:"Edit"}),t.jsx(ue,{note:e,keyboard:!0}),t.jsx(me,{note:e}),t.jsxs("button",{type:"button",onClick:()=>c(!0),className:"btn btn-ghost btn-touch",title:"Focus (⌘.)",children:[t.jsx(ne,{width:16,height:16}),"Focus"]}),re(e,r.view)?t.jsx(g,{to:`/views/${encodeURIComponent(e.id)}`,className:"btn btn-secondary btn-touch",children:"Open as view"}):null]}),t.jsx(Ve,{value:h,isPath:!!e.path})]}),t.jsx(Fe,{content:e.content??"",attachments:e.attachments,onRetry:()=>i.mutate({cacheId:n??e.id,serverId:e.id}),retrying:i.isPending}),o?t.jsx(Qe,{preview:e.preview}):(T=C.content)!=null&&T.trim()?t.jsx(he,{note:C,resolve:u}):p===null?t.jsx(We,{noteId:e.id}):null,e.attachments&&e.attachments.length>0?t.jsxs("section",{className:"mt-10 border-t border-border pt-6",children:[t.jsx("h2",{className:"mb-3 font-serif text-xl",children:"Attachments"}),t.jsx("div",{className:"space-y-6",children:e.attachments.map(x=>t.jsx(Oe,{attachment:x},x.id))})]}):null,t.jsx(Ce,{anchor:e})]}),t.jsxs("aside",{className:"space-y-6 text-sm lg:sticky lg:top-24 lg:self-start",children:[t.jsx(Be,{note:e}),S.length>0?t.jsx(A,{title:"Outbound",links:S,peer:"target"}):null,E.length>0?t.jsx(A,{title:"Inbound",links:E,peer:"source"}):null]})]})}function Be({note:e}){const n=e.createdAt,s=e.updatedAt,r=Object.entries(e.metadata??{}).filter(([i])=>i!=="summary");return t.jsxs("section",{className:"card shadow-soft p-4",children:[t.jsx("h2",{className:"eyebrow mb-2",children:"Metadata"}),t.jsxs("dl",{className:"space-y-1.5 text-sm",children:[e.path?t.jsx(v,{label:"Title",value:t.jsx("span",{className:"font-mono text-xs break-all",children:e.path})}):null,t.jsx(v,{label:"ID",value:t.jsx("span",{className:"font-mono text-xs break-all",children:e.id})}),t.jsx(v,{label:"Created",value:t.jsx("time",{title:n,children:P(n)})}),s?t.jsx(v,{label:"Updated",value:t.jsx("time",{title:s,children:P(s)})}):null,e.path?t.jsx(v,{label:"Path",value:t.jsx(oe,{value:e.path,label:"note path",className:"mt-1"})}):null,r.map(([i,l])=>t.jsx(v,{label:i,value:t.jsx("span",{className:"break-all text-fg-muted",children:String(l)})},i))]}),e.path?t.jsx(Me,{path:e.path}):null,t.jsx(le,{note:e,variant:"detail",className:"mt-3"})]})}function Me({path:e}){const{copied:n,copy:s}=$();return t.jsx("button",{type:"button",onClick:()=>s(e),className:"btn btn-secondary btn-touch mt-3 w-full","aria-label":"Copy reference to this note",children:n?"Copied ✓":"Copy reference"})}function v({label:e,value:n}){return t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("dt",{className:"eyebrow",children:e}),t.jsx("dd",{children:n})]})}function Ue({tags:e}){return t.jsx("div",{className:"mt-2 flex flex-wrap gap-1","aria-label":"Tags",children:e.map(n=>t.jsxs(g,{to:`/tags/${encodeURIComponent(n)}`,className:"chip chip-tag focus-ring max-w-full break-all",children:["#",n]},n))})}function De(e){return t.jsxs("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[t.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),t.jsx("path",{d:"M5 15H4.5A1.5 1.5 0 0 1 3 13.5v-9A1.5 1.5 0 0 1 4.5 3h9A1.5 1.5 0 0 1 15 4.5V5"})]})}function Ve({value:e,isPath:n}){const{copied:s,copy:r}=$();return t.jsxs("button",{type:"button",onClick:()=>r(e),"aria-label":n?"Copy path":"Copy note id",className:"focus-ring group mt-4 flex max-w-full items-center gap-1.5 rounded text-fg-dim transition-colors hover:text-fg-muted",children:[t.jsx(De,{className:"shrink-0 opacity-70 transition-opacity group-hover:opacity-100"}),t.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:e}),s?t.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:"Copied"}):null]})}function A({title:e,links:n,peer:s}){return t.jsxs("section",{className:"card shadow-soft p-4",children:[t.jsxs("h2",{className:"eyebrow mb-2 tabular-nums",children:[e," (",n.length,")"]}),t.jsx("ul",{className:"space-y-1.5",children:n.map(r=>{var o;const i=s==="source"?r.sourceNote:r.targetNote;if(!i)return null;const l=i.path??i.id,a=typeof((o=i.metadata)==null?void 0:o.summary)=="string"?i.metadata.summary:null;return t.jsx("li",{children:t.jsxs(g,{to:`/n/${encodeURIComponent(i.id)}`,className:"block rounded px-1 py-0.5 hover:bg-bg/50",children:[t.jsx("div",{className:"truncate font-mono text-xs text-fg-muted hover:text-accent",children:l}),a?t.jsx("div",{className:"mt-0.5 line-clamp-2 text-xs text-fg-dim",children:a}):null]})},`${r.sourceId}->${r.targetId}:${r.relationship}`)})})]})}function Oe({attachment:e}){const n=e.filename;if(!n||!e.url)return t.jsx("figure",{className:"card shadow-soft p-3",children:t.jsx(M,{})});const s=(e.mimeType??"").toLowerCase();return t.jsxs("figure",{className:"card shadow-soft p-3",children:[t.jsxs("figcaption",{className:"mb-2 flex items-baseline justify-between gap-3",children:[t.jsx("span",{className:"truncate font-mono text-xs text-fg-muted",children:n}),typeof e.size=="number"?t.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:He(e.size)}):null]}),t.jsx(_e,{attachment:e,mime:s,filename:n})]})}function M(){return t.jsxs("div",{className:"flex items-center gap-2 text-sm text-fg-dim","aria-busy":"true",children:[t.jsx(b,{className:"h-4 w-32"}),t.jsx("span",{children:"Processing…"})]})}function _e({attachment:e,mime:n,filename:s}){const r=w(),[i,l]=d.useState(null),[a,o]=d.useState(null),u=ze(n,s),m=u!=="other",c=e.url;if(d.useEffect(()=>{if(!m||!c||!r)return;let f=!1,p=null;return o(null),r.fetchAttachmentBlob(c).then(j=>{f||(p=URL.createObjectURL(j),l(p))}).catch(j=>{f||o(j instanceof Error?j.message:"Failed to load attachment")}),()=>{f=!0,p&&URL.revokeObjectURL(p)}},[m,c,r]),!c)return t.jsx(M,{});if(a)return t.jsx("p",{className:"text-sm text-danger",children:a});if(m&&!i)return t.jsx(b,{className:"h-32 w-full"});const h=i??c;return u==="image"?t.jsx("img",{src:h,alt:s,className:"max-h-[32rem] rounded"}):u==="audio"?t.jsx("audio",{controls:!0,src:h,className:"w-full"}):u==="video"?t.jsx("video",{controls:!0,src:h,className:"w-full rounded"}):u==="pdf"?t.jsxs(t.Fragment,{children:[t.jsx("iframe",{src:h,title:s,className:"h-[40rem] w-full rounded border border-border"}),t.jsxs("a",{href:h,download:s,className:"mt-2 inline-block text-sm text-accent hover:underline",children:["Download ",s]})]}):t.jsxs("a",{href:h,download:s,className:"text-sm text-accent hover:underline",children:["Download ",s]})}function ze(e,n){if(e.startsWith("image/"))return"image";if(e.startsWith("audio/"))return"audio";if(e.startsWith("video/"))return"video";if(e==="application/pdf")return"pdf";const s=n.toLowerCase().split(".").pop()??"";return["png","jpg","jpeg","gif","webp","svg"].includes(s)?"image":["mp3","wav","ogg","m4a","flac"].includes(s)?"audio":["mp4","webm","mov"].includes(s)?"video":s==="pdf"?"pdf":"other"}function He(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function Ge(){return t.jsxs("div",{className:"grid gap-10 lg:grid-cols-[minmax(0,1fr)_18rem]","aria-busy":"true",children:[t.jsxs("div",{className:"min-w-0 space-y-3",children:[t.jsx(b,{className:"h-3 w-32"}),t.jsx(b,{className:"h-8 w-2/3"}),t.jsx(b,{className:"h-4 w-full"}),t.jsx("div",{className:"mt-6 space-y-2",children:[0,1,2,3,4,5].map(e=>t.jsx(b,{className:"h-3",width:`${70+e*13%25}%`},e))})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(b,{className:"h-32"}),t.jsx(b,{className:"h-24"})]})]})}function We({noteId:e}){return t.jsxs("p",{className:"my-8 font-serif text-lg italic text-fg-muted",children:["Nothing here yet."," ",t.jsx(g,{to:`/n/${encodeURIComponent(e)}/edit`,className:"not-italic text-accent hover:underline",children:"Start writing →"})]})}function Ke(){return t.jsx("p",{className:"mt-2",children:t.jsx("span",{className:"chip bg-bg-soft text-fg-muted",title:"Served from your offline copy",children:"Saved copy"})})}function Qe({preview:e}){return t.jsxs("div",{className:"my-8",children:[e?t.jsx("p",{className:"mb-4 text-fg-muted",children:e}):null,t.jsx("p",{className:"font-serif text-lg italic text-fg-muted",children:"Connect to load this note."})]})}function qe({id:e}){return t.jsx(ie,{title:t.jsx("span",{className:"font-serif text-xl text-fg",children:"Note not found"}),description:t.jsxs(t.Fragment,{children:["No note with id ",t.jsx("span",{className:"font-mono",children:e})," in this vault."]}),action:t.jsx(g,{to:"/notes",className:"text-sm text-accent hover:underline",children:"Back to all notes"})})}function Xe({error:e,retry:n}){const s=e instanceof ce,r=e instanceof de,i=s?"Session expired":r?"Note not found":"Could not load note",l=s?e.message:r?"Couldn't find this note. It may have been deleted, or the link may be wrong.":"Something went wrong loading this note. You can try again, or head back to your notes.";return t.jsx(ae,{title:i,message:t.jsxs(t.Fragment,{children:[l,s?null:t.jsxs("details",{className:"mt-3",children:[t.jsx("summary",{className:"cursor-pointer text-xs text-fg-dim hover:text-fg-muted",children:"Technical detail"}),t.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-xs text-fg-dim",children:e.message})]})]}),retry:s?void 0:n,action:s?t.jsx(g,{to:"/add",className:"btn btn-primary",children:"Reconnect vault"}):t.jsx(g,{to:"/notes",className:"btn btn-secondary btn-touch",children:"Back to notes"})})}export{et as NoteView};
@@ -1 +1 @@
1
- import{y as R,b as U,a as u,r as d,b0 as z,b1 as E,b2 as I,b3 as A,k as C,b4 as H,b5 as O,j as e,P as p}from"./index-H6VNro-x.js";import{W as m}from"./WizardShell-B0Fjh0Vt.js";import{s as P}from"./url-QSQwrjSV.js";import"./history-Ce29a331.js";function $(r){try{return new URL(r).host}catch{return"your hub"}}function W(){const[r]=R(),i=U(),h=u(s=>s.addVault),[n,l]=d.useState({kind:"working"}),f=d.useRef(!1);if(d.useEffect(()=>{if(f.current)return;f.current=!0;const s=r.get("code"),x=r.get("state"),b=r.get("error");if(b){const o=r.get("error_description");l({kind:"error",message:`Vault returned: ${b}${o?` — ${o}`:""}`});return}if(!s||!x){l({kind:"error",message:"Missing code or state in callback URL."});return}(async()=>{var o,g,v,j;try{const{pending:t,token:a}=await z(s,x),y=a.vault?`vault:${a.vault}`:void 0,N=(y?(g=(o=a.services)==null?void 0:o[y])==null?void 0:g.url:void 0)??((j=(v=a.services)==null?void 0:v.vault)==null?void 0:j.url)??t.issuerUrl,S=u.getState().activeVaultId,c=h({url:N,name:a.vault??t.issuer,issuer:t.issuer,tokenEndpoint:t.tokenEndpoint,clientId:t.clientId,scope:a.scope},E(a));a.services&&I(c,a.services);const k=A.getState();k.clearHalt(c),t.priorHaltedVaultId&&t.priorHaltedVaultId!==c&&k.clearHalt(t.priorHaltedVaultId);const V=P(t.redirect)??"/";if(c!==S){const w=u.getState().vaults[c];w&&C(H(w))}i(V,{replace:!0})}catch(t){if(t instanceof O){l({kind:"pending-approval",approveUrl:t.approveUrl});return}l({kind:"error",message:t.message})}})()},[r,i,h]),n.kind==="working")return e.jsxs(m,{escape:{kind:"none"},children:[e.jsx(p,{size:72,className:"mx-auto mb-4 animate-pulse"}),e.jsx("p",{className:"eyebrow mb-3",children:"One moment"}),e.jsxs("h1",{className:"hero-title mb-2",style:{fontSize:"clamp(1.8rem, 4vw, 2.3rem)"},children:["Connecting",e.jsx("span",{className:"accent-word",children:"…"})]}),e.jsx("output",{"aria-live":"polite",className:"font-round text-sm text-fg-muted",children:"Exchanging the authorization code with your vault."})]});if(n.kind==="pending-approval"){const s=$(n.approveUrl);return e.jsxs(m,{escape:{kind:"back",to:"/"},children:[e.jsx(p,{size:60,className:"mx-auto mb-6"}),e.jsx("p",{className:"eyebrow mb-3",children:"Redirected"}),e.jsxs("h1",{className:"hero-title mb-4",style:{fontSize:"clamp(1.6rem, 3.5vw, 2.1rem)"},children:["Approving Parachute on ",e.jsx("span",{className:"accent-word",children:s})]}),e.jsx("p",{className:"mx-auto mb-8 max-w-sm text-fg-muted",children:"Your hub admin needs to approve this app before sign-in can complete. Open the approval page in your hub, approve, then try again."}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[e.jsx("a",{href:n.approveUrl,target:"_blank",rel:"noopener noreferrer",className:"btn btn-primary btn-lg justify-center rounded-full px-6 shadow-soft",children:"Open approval page →"}),e.jsx("button",{type:"button",onClick:()=>i("/add",{replace:!0}),className:"font-round text-sm font-semibold text-fg-dim hover:text-accent",children:"Retry now"})]})]})}return e.jsxs(m,{escape:{kind:"back",to:"/"},children:[e.jsx(p,{size:60,className:"mx-auto mb-6"}),e.jsx("p",{className:"eyebrow mb-3",children:"Connection failed"}),e.jsxs("h1",{className:"hero-title mb-4",style:{fontSize:"clamp(1.6rem, 3.5vw, 2.1rem)"},children:["Something went ",e.jsx("span",{className:"accent-word",children:"sideways."})]}),e.jsx("p",{className:"mx-auto mb-8 max-w-sm text-fg-muted",children:n.message}),e.jsx("button",{type:"button",onClick:()=>i("/add",{replace:!0}),className:"btn btn-primary btn-lg justify-center rounded-full px-6 shadow-soft",children:"Try again →"})]})}export{W as OAuthCallback};
1
+ import{C as R,b as U,a as u,r as d,b3 as z,b4 as E,b5 as I,b6 as C,k as A,b7 as H,b8 as O,j as e,P as p}from"./index-CpyANXLa.js";import{W as m}from"./WizardShell-BPt_HrH0.js";import{s as P}from"./url-QSQwrjSV.js";import"./history-Dwz434D-.js";function $(r){try{return new URL(r).host}catch{return"your hub"}}function W(){const[r]=R(),i=U(),h=u(s=>s.addVault),[n,l]=d.useState({kind:"working"}),f=d.useRef(!1);if(d.useEffect(()=>{if(f.current)return;f.current=!0;const s=r.get("code"),x=r.get("state"),b=r.get("error");if(b){const o=r.get("error_description");l({kind:"error",message:`Vault returned: ${b}${o?` — ${o}`:""}`});return}if(!s||!x){l({kind:"error",message:"Missing code or state in callback URL."});return}(async()=>{var o,g,v,j;try{const{pending:t,token:a}=await z(s,x),k=a.vault?`vault:${a.vault}`:void 0,N=(k?(g=(o=a.services)==null?void 0:o[k])==null?void 0:g.url:void 0)??((j=(v=a.services)==null?void 0:v.vault)==null?void 0:j.url)??t.issuerUrl,S=u.getState().activeVaultId,c=h({url:N,name:a.vault??t.issuer,issuer:t.issuer,tokenEndpoint:t.tokenEndpoint,clientId:t.clientId,scope:a.scope},E(a));a.services&&I(c,a.services);const y=C.getState();y.clearHalt(c),t.priorHaltedVaultId&&t.priorHaltedVaultId!==c&&y.clearHalt(t.priorHaltedVaultId);const V=P(t.redirect)??"/";if(c!==S){const w=u.getState().vaults[c];w&&A(H(w))}i(V,{replace:!0})}catch(t){if(t instanceof O){l({kind:"pending-approval",approveUrl:t.approveUrl});return}l({kind:"error",message:t.message})}})()},[r,i,h]),n.kind==="working")return e.jsxs(m,{escape:{kind:"none"},children:[e.jsx(p,{size:72,className:"mx-auto mb-4 animate-pulse"}),e.jsx("p",{className:"eyebrow mb-3",children:"One moment"}),e.jsxs("h1",{className:"hero-title mb-2",style:{fontSize:"clamp(1.8rem, 4vw, 2.3rem)"},children:["Connecting",e.jsx("span",{className:"accent-word",children:"…"})]}),e.jsx("output",{"aria-live":"polite",className:"font-round text-sm text-fg-muted",children:"Exchanging the authorization code with your vault."})]});if(n.kind==="pending-approval"){const s=$(n.approveUrl);return e.jsxs(m,{escape:{kind:"back",to:"/"},children:[e.jsx(p,{size:60,className:"mx-auto mb-6"}),e.jsx("p",{className:"eyebrow mb-3",children:"Redirected"}),e.jsxs("h1",{className:"hero-title mb-4",style:{fontSize:"clamp(1.6rem, 3.5vw, 2.1rem)"},children:["Approving Parachute on ",e.jsx("span",{className:"accent-word",children:s})]}),e.jsx("p",{className:"mx-auto mb-8 max-w-sm text-fg-muted",children:"Your hub admin needs to approve this app before sign-in can complete. Open the approval page in your hub, approve, then try again."}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[e.jsx("a",{href:n.approveUrl,target:"_blank",rel:"noopener noreferrer",className:"btn btn-primary btn-lg justify-center rounded-full px-6 shadow-soft",children:"Open approval page →"}),e.jsx("button",{type:"button",onClick:()=>i("/add",{replace:!0}),className:"font-round text-sm font-semibold text-fg-dim hover:text-accent",children:"Retry now"})]})]})}return e.jsxs(m,{escape:{kind:"back",to:"/"},children:[e.jsx(p,{size:60,className:"mx-auto mb-6"}),e.jsx("p",{className:"eyebrow mb-3",children:"Connection failed"}),e.jsxs("h1",{className:"hero-title mb-4",style:{fontSize:"clamp(1.6rem, 3.5vw, 2.1rem)"},children:["Something went ",e.jsx("span",{className:"accent-word",children:"sideways."})]}),e.jsx("p",{className:"mx-auto mb-8 max-w-sm text-fg-muted",children:n.message}),e.jsx("button",{type:"button",onClick:()=>i("/add",{replace:!0}),className:"btn btn-primary btn-lg justify-center rounded-full px-6 shadow-soft",children:"Try again →"})]})}export{W as OAuthCallback};
@@ -1 +1 @@
1
- import{r as l,j as t,b as v,a6 as h,a$ as j,V as y,a as w,a1 as E,aj as N}from"./index-H6VNro-x.js";function P({note:a,className:d,label:c="Delete"}){const[r,o]=l.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>o(!0),className:d??"min-h-11 rounded-lg border border-red-500/40 bg-transparent px-3 py-1.5 text-sm text-red-400 hover:bg-red-500/10",title:"Delete this note",children:c}),r?t.jsx(k,{note:a,onClose:()=>o(!1)}):null]})}function k({note:a,onClose:d}){const c=v(),r=h(e=>e.push),o=j(),i=a.path??a.id,[f,p]=l.useState(""),[u,b]=l.useState(null),x=l.useRef(null),s=f===i&&!o.isPending;l.useEffect(()=>{var e;(e=x.current)==null||e.focus()},[]),l.useEffect(()=>{const e=m=>{m.key==="Escape"&&d()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[d]);const n=l.useCallback(()=>{s&&(b(null),o.mutate(a.id,{onSuccess:()=>{r(`Deleted ${i}`,"success"),c("/",{replace:!0})},onError:e=>{e instanceof y?b("Session expired. Reconnect to delete."):b(e instanceof Error?e.message:"Delete failed")}}))},[s,i,o,c,a.id,r]);return t.jsx("dialog",{open:!0,"aria-labelledby":"confirm-delete-title",className:"fixed inset-0 z-40 m-0 flex h-full max-h-full w-full max-w-full items-center justify-center bg-black/60 p-4",onMouseDown:e=>{e.target===e.currentTarget&&d()},children:t.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border bg-card p-6 shadow-lift",children:[t.jsx("h2",{id:"confirm-delete-title",className:"mb-2 font-serif text-xl text-red-400",children:"Delete this note?"}),t.jsx("p",{className:"mb-3 text-sm text-fg-muted",children:"This permanently removes the note, its tags, and its links. This cannot be undone."}),t.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:["Type"," ",t.jsx("span",{className:"rounded bg-bg/60 px-1 py-0.5 font-mono text-xs text-fg",children:i})," ","to confirm:"]}),t.jsx("input",{ref:x,type:"text",value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key==="Enter"&&s&&n()},"aria-label":"Type note path to confirm",className:"mb-3 w-full rounded-lg border border-border bg-bg/40 px-2.5 py-1.5 font-mono text-sm text-fg focus:border-red-400 focus:outline-none",placeholder:i,autoComplete:"off",spellCheck:!1}),u?t.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:u}):null,t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:d,className:"min-h-11 rounded-lg border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Cancel"}),t.jsx("button",{type:"button",onClick:n,disabled:!s,className:"btn btn-danger-solid btn-touch",children:o.isPending?"Deleting…":"Delete permanently"})]})]})})}function C({note:a,keyboard:d=!1}){var b,x;const c=w(s=>s.getActiveVault()),{roles:r}=E((c==null?void 0:c.id)??null),o=h(s=>s.push),i=N(a.id),f=((b=a.tags)==null?void 0:b.includes(r.pinned))??!1,p=((x=a.tags)==null?void 0:x.includes(r.archived))??!1,u=l.useCallback(s=>{var m;if(i.isPending)return;const n=r[s],e=((m=a.tags)==null?void 0:m.includes(n))??!1;i.mutate({tags:e?{remove:[n]}:{add:[n]}},{onSuccess:()=>{o(s==="pinned"?e?"Unpinned":"Pinned":e?"Unarchived":"Archived","success")},onError:g=>{g instanceof y?o("Session expired. Reconnect.","error"):o(g instanceof Error?g.message:"Update failed","error")}})},[i,a.tags,o,r]);return l.useEffect(()=>{if(!d)return;const s=n=>{if(n.defaultPrevented)return;const e=n.target;if(e){const m=e.tagName;if(m==="INPUT"||m==="TEXTAREA"||e.isContentEditable)return}n.metaKey||n.ctrlKey||n.altKey||(n.key==="p"||n.key==="P"?(n.preventDefault(),u("pinned")):(n.key==="a"||n.key==="A")&&(n.preventDefault(),u("archived")))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[d,u]),t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>u("pinned"),disabled:i.isPending,"aria-pressed":f,title:f?`Unpin (${r.pinned})`:`Pin as #${r.pinned} (P)`,className:f?"min-h-11 rounded-lg border border-accent/60 bg-accent/10 px-3 py-1.5 text-sm text-accent hover:bg-accent/20 disabled:opacity-40":"min-h-11 rounded-lg border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:f?"★ Pinned":"☆ Pin"}),t.jsx("button",{type:"button",onClick:()=>u("archived"),disabled:i.isPending,"aria-pressed":p,title:p?`Unarchive (${r.archived})`:`Archive as #${r.archived} (A)`,className:p?"min-h-11 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-1.5 text-sm text-amber-500 hover:bg-amber-500/20 disabled:opacity-40":"min-h-11 rounded-lg border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:p?"Archived":"Archive"})]})}export{P as D,C as P};
1
+ import{r as l,j as t,b as v,a8 as h,b2 as j,V as y,a as w,a3 as E,al as N}from"./index-CpyANXLa.js";function P({note:a,className:d,label:c="Delete"}){const[r,o]=l.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>o(!0),className:d??"min-h-11 rounded-lg border border-red-500/40 bg-transparent px-3 py-1.5 text-sm text-red-400 hover:bg-red-500/10",title:"Delete this note",children:c}),r?t.jsx(k,{note:a,onClose:()=>o(!1)}):null]})}function k({note:a,onClose:d}){const c=v(),r=h(e=>e.push),o=j(),i=a.path??a.id,[f,p]=l.useState(""),[u,b]=l.useState(null),x=l.useRef(null),s=f===i&&!o.isPending;l.useEffect(()=>{var e;(e=x.current)==null||e.focus()},[]),l.useEffect(()=>{const e=m=>{m.key==="Escape"&&d()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[d]);const n=l.useCallback(()=>{s&&(b(null),o.mutate(a.id,{onSuccess:()=>{r(`Deleted ${i}`,"success"),c("/",{replace:!0})},onError:e=>{e instanceof y?b("Session expired. Reconnect to delete."):b(e instanceof Error?e.message:"Delete failed")}}))},[s,i,o,c,a.id,r]);return t.jsx("dialog",{open:!0,"aria-labelledby":"confirm-delete-title",className:"fixed inset-0 z-40 m-0 flex h-full max-h-full w-full max-w-full items-center justify-center bg-black/60 p-4",onMouseDown:e=>{e.target===e.currentTarget&&d()},children:t.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border bg-card p-6 shadow-lift",children:[t.jsx("h2",{id:"confirm-delete-title",className:"mb-2 font-serif text-xl text-red-400",children:"Delete this note?"}),t.jsx("p",{className:"mb-3 text-sm text-fg-muted",children:"This permanently removes the note, its tags, and its links. This cannot be undone."}),t.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:["Type"," ",t.jsx("span",{className:"rounded bg-bg/60 px-1 py-0.5 font-mono text-xs text-fg",children:i})," ","to confirm:"]}),t.jsx("input",{ref:x,type:"text",value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key==="Enter"&&s&&n()},"aria-label":"Type note path to confirm",className:"mb-3 w-full rounded-lg border border-border bg-bg/40 px-2.5 py-1.5 font-mono text-sm text-fg focus:border-red-400 focus:outline-none",placeholder:i,autoComplete:"off",spellCheck:!1}),u?t.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:u}):null,t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:d,className:"min-h-11 rounded-lg border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Cancel"}),t.jsx("button",{type:"button",onClick:n,disabled:!s,className:"btn btn-danger-solid btn-touch",children:o.isPending?"Deleting…":"Delete permanently"})]})]})})}function C({note:a,keyboard:d=!1}){var b,x;const c=w(s=>s.getActiveVault()),{roles:r}=E((c==null?void 0:c.id)??null),o=h(s=>s.push),i=N(a.id),f=((b=a.tags)==null?void 0:b.includes(r.pinned))??!1,p=((x=a.tags)==null?void 0:x.includes(r.archived))??!1,u=l.useCallback(s=>{var m;if(i.isPending)return;const n=r[s],e=((m=a.tags)==null?void 0:m.includes(n))??!1;i.mutate({tags:e?{remove:[n]}:{add:[n]}},{onSuccess:()=>{o(s==="pinned"?e?"Unpinned":"Pinned":e?"Unarchived":"Archived","success")},onError:g=>{g instanceof y?o("Session expired. Reconnect.","error"):o(g instanceof Error?g.message:"Update failed","error")}})},[i,a.tags,o,r]);return l.useEffect(()=>{if(!d)return;const s=n=>{if(n.defaultPrevented)return;const e=n.target;if(e){const m=e.tagName;if(m==="INPUT"||m==="TEXTAREA"||e.isContentEditable)return}n.metaKey||n.ctrlKey||n.altKey||(n.key==="p"||n.key==="P"?(n.preventDefault(),u("pinned")):(n.key==="a"||n.key==="A")&&(n.preventDefault(),u("archived")))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[d,u]),t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>u("pinned"),disabled:i.isPending,"aria-pressed":f,title:f?`Unpin (${r.pinned})`:`Pin as #${r.pinned} (P)`,className:f?"min-h-11 rounded-lg border border-accent/60 bg-accent/10 px-3 py-1.5 text-sm text-accent hover:bg-accent/20 disabled:opacity-40":"min-h-11 rounded-lg border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:f?"★ Pinned":"☆ Pin"}),t.jsx("button",{type:"button",onClick:()=>u("archived"),disabled:i.isPending,"aria-pressed":p,title:p?`Unarchive (${r.archived})`:`Archive as #${r.archived} (A)`,className:p?"min-h-11 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-1.5 text-sm text-amber-500 hover:bg-amber-500/20 disabled:opacity-40":"min-h-11 rounded-lg border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:p?"Archived":"Archive"})]})}export{P as D,C as P};
@@ -1 +1 @@
1
- import{a as T,j as e,N as C,L as j,b6 as k,a6 as y,r as d,b7 as E,b8 as A,b9 as O,ba as R,bb as L,a1 as M,bc as P,bd as N,be as g,aw as $,bf as _,bg as I,x as D,bh as z,b as V,u as B,g as F,bi as G,bj as H,h as U,i as Y,bk as K}from"./index-H6VNro-x.js";import{u as q,a as Q,b as W,c as X}from"./transcribe-default-B7i-j3pr.js";import{r as Z,w as J}from"./editor-mode-D9fveTEx.js";import"./types-BaJkUfo6.js";function pe(){const t=T(a=>a.getActiveVault());return t?e.jsxs("div",{className:"page-prose",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:e.jsx(j,{to:"/",className:"focus-ring hover:text-accent",children:"← Home"})}),e.jsx("p",{className:"eyebrow mb-1",children:t.name}),e.jsx("h1",{className:"page-title",children:"Settings"}),e.jsx("p",{className:"mt-2 text-fg-muted",children:"Everything about this vault, in one calm place."})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(ee,{}),e.jsx(se,{}),e.jsx(ne,{vaultId:t.id}),e.jsx(ie,{}),e.jsx(re,{}),e.jsx(de,{vaultId:t.id}),e.jsx(ue,{vaultId:t.id}),e.jsx(le,{vaultId:t.id}),e.jsx(oe,{})]})]}):e.jsx(C,{to:"/",replace:!0})}function ee(){return e.jsxs("section",{"aria-label":"Manage",children:[e.jsx("h2",{className:"eyebrow mb-3",children:"Manage"}),e.jsxs("div",{className:"card divide-y divide-border rounded-xl shadow-soft",children:[e.jsx(b,{to:"/account",title:"Account",description:"Your plan, billing, hosted vaults, and sign-in — managed in the app."}),e.jsx(te,{}),e.jsx(b,{to:"/connect",title:"Connections",description:"Connect Claude, ChatGPT, or any MCP client to this vault."}),e.jsx(b,{to:"/vaults",title:"Vaults",description:"Add a vault, switch between them, or export."})]})]})}function te(){const t=V(),a=B(r=>r.identityEpoch),[n,s]=d.useState(null),[i,u]=d.useState(!1);if(d.useEffect(()=>{let r=!0;return F().then(o=>{r&&s(o.signed_in?{identity:o.email??o.username??null,csrf:o.csrf}:null)}).catch(()=>{r&&s(null)}),()=>{r=!1}},[a]),!n)return null;const{identity:c,csrf:h}=n;async function x(){u(!0);try{await U(h)}finally{Y(),t("/",{replace:!0})}}return e.jsxs("div",{className:"flex items-center justify-between gap-4 px-5 py-4",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsxs("span",{className:"block font-medium text-fg",children:["Signed in",c?` as ${c}`:""]}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:"Signing out ends your account session on this device. Vaults already connected here stay until you remove them."})]}),e.jsx("button",{type:"button",onClick:x,disabled:i,className:"btn btn-secondary btn-touch shrink-0",children:i?"Signing out…":"Sign out"})]})}function b({to:t,href:a,title:n,description:s}){const i=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-medium text-fg",children:n}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:s})]}),e.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-fg-dim",children:a?"↗":"→"})]}),u="focus-ring flex items-center justify-between gap-4 px-5 py-4 transition-colors hover:bg-bg-soft first:rounded-t-xl last:rounded-b-xl";return a?e.jsx("a",{href:a,className:u,children:i}):e.jsx(j,{to:t??"/",className:u,children:i})}function se(){return e.jsxs("section",{className:"card space-y-3 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Import notes"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Bring in an Obsidian vault zip or a folder of markdown files. Parsed in your browser; previewed before any note lands in the vault."})]}),e.jsx(j,{to:"/import",className:"btn btn-primary btn-touch",children:"Open importer"})]})}const ae=[{value:"keep",title:"Keep",help:"Recordings are stored with your notes; included wherever attachments are included."},{value:"until_transcribed",title:"Delete after transcribing",help:"Your words stay; the audio file is removed once the transcript lands."},{value:"never",title:"Never store",help:"Audio is removed even if transcription fails — the transcript is your only copy; failed transcriptions lose the audio."}];function ne({vaultId:t}){const a=k(),n=q(),s=Q(),{markMade:i}=W(t),{transcribeDefault:u,setTranscribeDefault:c}=X(t),h=y(r=>r.push);if((a==null?void 0:a.enabled)===!1)return null;const x=r=>{r===n.value||s.isPending||s.mutate(r,{onSuccess:()=>{i(),h("Voice recording setting saved.","success")},onError:o=>{h(o instanceof Error&&o.message?`Couldn't save: ${o.message}`:"Couldn't save the voice recording setting.","error")}})};return e.jsxs("section",{className:"card space-y-6 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Voice"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"How voice capture behaves in this vault."})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-fg",children:"Transcribe recordings by default"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"New voice notes start with transcription on — your words are added to the note. Turn it off for a single recording right where you capture. Applies on this device."})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":u,"aria-label":"Transcribe recordings by default","data-testid":"transcribe-default-toggle",onClick:()=>c(!u),className:`relative h-7 w-12 shrink-0 rounded-full transition-colors ${u?"bg-accent":"bg-border"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0 h-6 w-6 rounded-full bg-card shadow-sm transition-transform ${u?"translate-x-5":"translate-x-0.5"}`})})]}),e.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-fg",children:"Keep recordings"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"What happens to the audio file after a voice note is transcribed. Applies to this vault, from every device connected to it."})]}),n.isLoading?e.jsx("p",{className:"text-sm text-fg-dim",children:"Loading…"}):n.isError?e.jsx("p",{className:"text-sm text-fg-dim","data-testid":"retention-load-error",children:"Couldn't load this setting — check the vault connection."}):e.jsxs(e.Fragment,{children:[e.jsxs("fieldset",{className:"space-y-2",disabled:!n.supported||s.isPending,children:[e.jsx("legend",{className:"sr-only",children:"Voice recording retention"}),ae.map(r=>{const o=n.value===r.value;return e.jsxs("label",{className:`flex items-start gap-3 rounded-xl border p-3 transition-colors ${o?"border-accent bg-accent/5":"border-border hover:border-accent/40"}`,children:[e.jsx("input",{type:"radio",name:"audio-retention",value:r.value,checked:o,onChange:()=>x(r.value),className:"mt-1 accent-accent"}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium text-fg",children:r.title}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:r.help})]})]},r.value)})]}),n.supported?null:e.jsx("p",{className:"text-xs text-fg-dim","data-testid":"retention-unsupported",children:"This vault doesn't support changing this yet — recordings are kept. Update the vault to choose."})]})]})]})}function ie(){const[t,a]=d.useState(()=>Z()),n=s=>{a(s),J(s)};return e.jsx("section",{className:"card space-y-4 rounded-xl p-6 shadow-soft",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Live preview"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Formats your writing as you type — Markdown stays underneath. Turn off for the raw editor with a side-by-side preview."})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":"Live preview",onClick:()=>n(!t),className:`relative h-7 w-12 shrink-0 rounded-full transition-colors ${t?"bg-accent":"bg-border"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0 h-6 w-6 rounded-full bg-card shadow-sm transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})]})})}function re(){const[t,a]=d.useState(()=>E()),n=s=>{a(s),G(s),H(s)};return e.jsxs("section",{className:"card space-y-4 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Text size"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Affects the editor and rendered notes on this device. Your markdown isn't changed."})]}),e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"sr-only",children:"View text size"}),A.map(s=>{const i=t===s;return e.jsxs("label",{className:`flex items-center gap-3 rounded-xl border p-3 transition-colors ${i?"border-accent bg-accent/5":"border-border hover:border-accent/40"}`,children:[e.jsx("input",{type:"radio",name:"text-size",value:s,checked:i,onChange:()=>n(s),className:"accent-accent"}),e.jsx("span",{className:"font-medium text-fg",children:O(s)})]},s)})]})]})}function le({vaultId:t}){const{db:a,mirror:n}=$(),s=y(m=>m.push),[i,u]=d.useState(null),[c,h]=d.useState(null),x=d.useCallback(async()=>{if(!a)return;const[m,l]=await Promise.all([_(a,t),I(a,t)]);u({bytes:m,count:l})},[a,t]);if(d.useEffect(()=>{x()},[x]),!n.enabled)return null;const r=async()=>{if(!c){h("sync");try{await n.syncNow(),await x(),s("Synced offline copy.","success")}catch{s("Couldn't sync the offline copy right now.","error")}finally{h(null)}}},o=async()=>{if(!c&&confirm("Clear this vault's offline copy from this device? Un-synced changes are kept.")){h("clear");try{await n.clearOffline(),await x(),s("Offline copy cleared.","success")}catch{s("Couldn't clear the offline copy.","error")}finally{h(null)}}};return e.jsxs("section",{className:"card space-y-5 rounded-xl p-6 shadow-soft","aria-label":"Offline",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Offline"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"A copy of this vault is kept on this device so your notes open without a connection."})]}),e.jsxs("dl",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsx("dt",{className:"text-fg-muted",children:"Status"}),e.jsx("dd",{className:"text-fg",children:ce(n.state)})]}),e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsx("dt",{className:"text-fg-muted",children:"Last synced"}),e.jsx("dd",{className:"text-fg-muted",children:n.lastSyncedAt?D(new Date(n.lastSyncedAt).toISOString()):"never"})]}),e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsx("dt",{className:"text-fg-muted",children:"Saved on this device"}),e.jsx("dd",{className:"text-fg-muted tabular-nums","data-testid":"offline-usage",children:i?`${i.count} note${i.count===1?"":"s"} · ${w(i.bytes)} of ${w(K)}`:"—"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-1",children:[e.jsx("button",{type:"button",onClick:r,disabled:c!==null,className:"btn btn-secondary btn-touch",children:c==="sync"?"Syncing…":"Sync now"}),e.jsx("button",{type:"button",onClick:o,disabled:c!==null,className:"text-sm text-danger hover:underline disabled:opacity-60",children:c==="clear"?"Clearing…":"Clear offline copy"})]})]})}function ce(t){switch(t){case"hydrating":return"Saving your vault…";case"offline":return"Offline — showing your saved vault";case"error":return"Sync error";default:return"Saved for offline"}}function w(t){return t<1024*1024?`${(t/1024).toFixed(0)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function oe(){const[t,a]=d.useState(!1);return d.useEffect(()=>{a(z())},[]),t?e.jsx("section",{className:"card rounded-xl p-6 text-sm shadow-soft",children:e.jsxs("p",{className:"text-fg-muted",children:[e.jsx("span",{className:"mr-2 inline-block rounded-full bg-positive-soft px-2 py-0.5 text-xs font-medium text-positive",children:"Installed"}),"Parachute is running as an installed app on this device."]})}):null}const S={auto:{title:"Auto",help:"Show the tree only when the vault has enough folders to make it worth the space."},always:{title:"Always",help:"Always show the tree, even on a tag-flat vault."},never:{title:"Never",help:"Hide the tree. The path-prefix text input still works."}};function de({vaultId:t}){const{mode:a,setMode:n}=R(t);return e.jsxs("section",{className:"card space-y-4 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Folder tree (Notes sidebar)"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Controls the collapsible folder tree on the notes list page. Auto-detect renders the tree when the vault has at least five top-level folders or twenty notes in folders."})]}),e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"sr-only",children:"Path tree visibility"}),L.map(s=>{const i=a===s;return e.jsxs("label",{className:`flex items-start gap-3 rounded-xl border p-3 transition-colors ${i?"border-accent bg-accent/5":"border-border hover:border-accent/40"}`,children:[e.jsx("input",{type:"radio",name:"path-tree-mode",value:s,checked:i,onChange:()=>n(s),className:"mt-1 accent-accent"}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium text-fg",children:S[s].title}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:S[s].help})]})]},s)})]})]})}const v={pinned:{title:"Pinned",help:"Tag for notes you want at the top of views."},archived:{title:"Archived",help:"Tag for notes you've moved out of the way."},captureVoice:{title:"Voice capture",help:"Default tag for new voice memos."},captureText:{title:"Text capture",help:"Default tag for quick typed notes."},view:{title:"Saved view",help:"Tag the saved-view notes carry. Used to list them in the notes sidebar."}};function ue({vaultId:t}){const{roles:a,setRoles:n}=M(t),s=P(),i=y(l=>l.push),u=d.useId(),[c,h]=d.useState(a);d.useEffect(()=>h(a),[a]);const x=d.useMemo(()=>{const l=(s.data??[]).map(f=>f.name);return[...new Set(l)].sort((f,p)=>f.localeCompare(p))},[s.data]),r=N.some(l=>c[l].trim()!==a[l]),o=()=>{n(c),i("Tag roles saved.","success")},m=()=>{n(null),h(g),i("Tag roles reset to defaults.","success")};return e.jsxs("section",{className:"card space-y-5 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Tag roles"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Point each role at whatever tag your vault already uses. Changes apply to future notes only — existing notes keep their current tags."})]}),e.jsx("datalist",{id:u,children:x.map(l=>e.jsx("option",{value:l},l))}),e.jsx("div",{className:"space-y-4",children:N.map(l=>e.jsxs("label",{className:"block text-sm",children:[e.jsxs("span",{className:"mb-1.5 flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-fg",children:v[l].title}),e.jsxs("span",{className:"text-xs text-fg-dim",children:["default: #",g[l]]})]}),e.jsx("input",{type:"text",value:c[l],onChange:f=>h(p=>({...p,[l]:f.target.value})),list:u,placeholder:g[l],"aria-label":`${v[l].title} tag role`,spellCheck:!1,autoCapitalize:"none",autoCorrect:"off",className:"input input-on-bg"}),e.jsx("span",{className:"mt-1.5 block text-xs text-fg-dim",children:v[l].help})]},l))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 pt-1",children:[e.jsx("button",{type:"button",onClick:o,disabled:!r,className:"btn btn-primary btn-lg",children:"Save"}),e.jsx("button",{type:"button",onClick:m,className:"btn btn-ghost",children:"Reset to defaults"})]})]})}export{pe as Settings};
1
+ import{a as T,j as e,N as C,L as v,b9 as k,a8 as y,r as d,ba as E,bb as A,bc as O,bd as R,be as L,a3 as M,bf as P,bg as N,bh as g,ay as $,bi as _,bj as I,A as D,bk as V,b as z,u as B,g as F,bl as G,bm as H,h as U,i as Y,bn as K}from"./index-CpyANXLa.js";import{u as q,a as Q,b as W,c as X}from"./transcribe-default-DIcTpM6A.js";import{r as Z,w as J}from"./editor-mode-D9fveTEx.js";import"./types-BaJkUfo6.js";function pe(){const t=T(a=>a.getActiveVault());return t?e.jsxs("div",{className:"page-prose",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:e.jsx(v,{to:"/",className:"focus-ring hover:text-accent",children:"← Home"})}),e.jsx("p",{className:"eyebrow mb-1",children:t.name}),e.jsx("h1",{className:"page-title",children:"Settings"}),e.jsx("p",{className:"mt-2 text-fg-muted",children:"Everything about this vault, in one calm place."})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(ee,{}),e.jsx(se,{}),e.jsx(ne,{vaultId:t.id}),e.jsx(ie,{}),e.jsx(re,{}),e.jsx(de,{vaultId:t.id}),e.jsx(ue,{vaultId:t.id}),e.jsx(le,{vaultId:t.id}),e.jsx(oe,{})]})]}):e.jsx(C,{to:"/",replace:!0})}function ee(){return e.jsxs("section",{"aria-label":"Manage",children:[e.jsx("h2",{className:"eyebrow mb-3",children:"Manage"}),e.jsxs("div",{className:"card divide-y divide-border rounded-xl shadow-soft",children:[e.jsx(b,{to:"/account",title:"Account",description:"Your plan, billing, hosted vaults, and sign-in — managed in the app."}),e.jsx(te,{}),e.jsx(b,{to:"/connect",title:"Connections",description:"Connect Claude, ChatGPT, or any MCP client to this vault."}),e.jsx(b,{to:"/vaults",title:"Vaults",description:"Add a vault, switch between them, or export."})]})]})}function te(){const t=z(),a=B(r=>r.identityEpoch),[n,s]=d.useState(null),[i,u]=d.useState(!1);if(d.useEffect(()=>{let r=!0;return F().then(o=>{r&&s(o.signed_in?{identity:o.email??o.username??null,csrf:o.csrf}:null)}).catch(()=>{r&&s(null)}),()=>{r=!1}},[a]),!n)return null;const{identity:c,csrf:h}=n;async function x(){u(!0);try{await U(h)}finally{Y(),t("/",{replace:!0})}}return e.jsxs("div",{className:"flex items-center justify-between gap-4 px-5 py-4",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsxs("span",{className:"block font-medium text-fg",children:["Signed in",c?` as ${c}`:""]}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:"Signing out ends your account session on this device. Vaults already connected here stay until you remove them."})]}),e.jsx("button",{type:"button",onClick:x,disabled:i,className:"btn btn-secondary btn-touch shrink-0",children:i?"Signing out…":"Sign out"})]})}function b({to:t,href:a,title:n,description:s}){const i=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-medium text-fg",children:n}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:s})]}),e.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-fg-dim",children:a?"↗":"→"})]}),u="focus-ring flex items-center justify-between gap-4 px-5 py-4 transition-colors hover:bg-bg-soft first:rounded-t-xl last:rounded-b-xl";return a?e.jsx("a",{href:a,className:u,children:i}):e.jsx(v,{to:t??"/",className:u,children:i})}function se(){return e.jsxs("section",{className:"card space-y-3 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Import notes"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Bring in an Obsidian vault zip or a folder of markdown files. Parsed in your browser; previewed before any note lands in the vault."})]}),e.jsx(v,{to:"/import",className:"btn btn-primary btn-touch",children:"Open importer"})]})}const ae=[{value:"keep",title:"Keep",help:"Recordings are stored with your notes; included wherever attachments are included."},{value:"until_transcribed",title:"Delete after transcribing",help:"Your words stay; the audio file is removed once the transcript lands."},{value:"never",title:"Never store",help:"Audio is removed even if transcription fails — the transcript is your only copy; failed transcriptions lose the audio."}];function ne({vaultId:t}){const a=k(),n=q(),s=Q(),{markMade:i}=W(t),{transcribeDefault:u,setTranscribeDefault:c}=X(t),h=y(r=>r.push);if((a==null?void 0:a.enabled)===!1)return null;const x=r=>{r===n.value||s.isPending||s.mutate(r,{onSuccess:()=>{i(),h("Voice recording setting saved.","success")},onError:o=>{h(o instanceof Error&&o.message?`Couldn't save: ${o.message}`:"Couldn't save the voice recording setting.","error")}})};return e.jsxs("section",{className:"card space-y-6 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Voice"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"How voice capture behaves in this vault."})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-fg",children:"Transcribe recordings by default"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"New voice notes start with transcription on — your words are added to the note. Turn it off for a single recording right where you capture. Applies on this device."})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":u,"aria-label":"Transcribe recordings by default","data-testid":"transcribe-default-toggle",onClick:()=>c(!u),className:`relative h-7 w-12 shrink-0 rounded-full transition-colors ${u?"bg-accent":"bg-border"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0 h-6 w-6 rounded-full bg-card shadow-sm transition-transform ${u?"translate-x-5":"translate-x-0.5"}`})})]}),e.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-fg",children:"Keep recordings"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"What happens to the audio file after a voice note is transcribed. Applies to this vault, from every device connected to it."})]}),n.isLoading?e.jsx("p",{className:"text-sm text-fg-dim",children:"Loading…"}):n.isError?e.jsx("p",{className:"text-sm text-fg-dim","data-testid":"retention-load-error",children:"Couldn't load this setting — check the vault connection."}):e.jsxs(e.Fragment,{children:[e.jsxs("fieldset",{className:"space-y-2",disabled:!n.supported||s.isPending,children:[e.jsx("legend",{className:"sr-only",children:"Voice recording retention"}),ae.map(r=>{const o=n.value===r.value;return e.jsxs("label",{className:`flex items-start gap-3 rounded-xl border p-3 transition-colors ${o?"border-accent bg-accent/5":"border-border hover:border-accent/40"}`,children:[e.jsx("input",{type:"radio",name:"audio-retention",value:r.value,checked:o,onChange:()=>x(r.value),className:"mt-1 accent-accent"}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium text-fg",children:r.title}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:r.help})]})]},r.value)})]}),n.supported?null:e.jsx("p",{className:"text-xs text-fg-dim","data-testid":"retention-unsupported",children:"This vault doesn't support changing this yet — recordings are kept. Update the vault to choose."})]})]})]})}function ie(){const[t,a]=d.useState(()=>Z()),n=s=>{a(s),J(s)};return e.jsx("section",{className:"card space-y-4 rounded-xl p-6 shadow-soft",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Live preview"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Formats your writing as you type — Markdown stays underneath. Turn off for the raw editor with a side-by-side preview."})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":"Live preview",onClick:()=>n(!t),className:`relative h-7 w-12 shrink-0 rounded-full transition-colors ${t?"bg-accent":"bg-border"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0 h-6 w-6 rounded-full bg-card shadow-sm transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})]})})}function re(){const[t,a]=d.useState(()=>E()),n=s=>{a(s),G(s),H(s)};return e.jsxs("section",{className:"card space-y-4 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Text size"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Affects the editor and rendered notes on this device. Your markdown isn't changed."})]}),e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"sr-only",children:"View text size"}),A.map(s=>{const i=t===s;return e.jsxs("label",{className:`flex items-center gap-3 rounded-xl border p-3 transition-colors ${i?"border-accent bg-accent/5":"border-border hover:border-accent/40"}`,children:[e.jsx("input",{type:"radio",name:"text-size",value:s,checked:i,onChange:()=>n(s),className:"accent-accent"}),e.jsx("span",{className:"font-medium text-fg",children:O(s)})]},s)})]})]})}function le({vaultId:t}){const{db:a,mirror:n}=$(),s=y(m=>m.push),[i,u]=d.useState(null),[c,h]=d.useState(null),x=d.useCallback(async()=>{if(!a)return;const[m,l]=await Promise.all([_(a,t),I(a,t)]);u({bytes:m,count:l})},[a,t]);if(d.useEffect(()=>{x()},[x]),!n.enabled)return null;const r=async()=>{if(!c){h("sync");try{await n.syncNow(),await x(),s("Synced offline copy.","success")}catch{s("Couldn't sync the offline copy right now.","error")}finally{h(null)}}},o=async()=>{if(!c&&confirm("Clear this vault's offline copy from this device? Un-synced changes are kept.")){h("clear");try{await n.clearOffline(),await x(),s("Offline copy cleared.","success")}catch{s("Couldn't clear the offline copy.","error")}finally{h(null)}}};return e.jsxs("section",{className:"card space-y-5 rounded-xl p-6 shadow-soft","aria-label":"Offline",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Offline"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"A copy of this vault is kept on this device so your notes open without a connection."})]}),e.jsxs("dl",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsx("dt",{className:"text-fg-muted",children:"Status"}),e.jsx("dd",{className:"text-fg",children:ce(n.state)})]}),e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsx("dt",{className:"text-fg-muted",children:"Last synced"}),e.jsx("dd",{className:"text-fg-muted",children:n.lastSyncedAt?D(new Date(n.lastSyncedAt).toISOString()):"never"})]}),e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsx("dt",{className:"text-fg-muted",children:"Saved on this device"}),e.jsx("dd",{className:"text-fg-muted tabular-nums","data-testid":"offline-usage",children:i?`${i.count} note${i.count===1?"":"s"} · ${w(i.bytes)} of ${w(K)}`:"—"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-1",children:[e.jsx("button",{type:"button",onClick:r,disabled:c!==null,className:"btn btn-secondary btn-touch",children:c==="sync"?"Syncing…":"Sync now"}),e.jsx("button",{type:"button",onClick:o,disabled:c!==null,className:"text-sm text-danger hover:underline disabled:opacity-60",children:c==="clear"?"Clearing…":"Clear offline copy"})]})]})}function ce(t){switch(t){case"hydrating":return"Saving your vault…";case"offline":return"Offline — showing your saved vault";case"error":return"Sync error";default:return"Saved for offline"}}function w(t){return t<1024*1024?`${(t/1024).toFixed(0)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function oe(){const[t,a]=d.useState(!1);return d.useEffect(()=>{a(V())},[]),t?e.jsx("section",{className:"card rounded-xl p-6 text-sm shadow-soft",children:e.jsxs("p",{className:"text-fg-muted",children:[e.jsx("span",{className:"mr-2 inline-block rounded-full bg-positive-soft px-2 py-0.5 text-xs font-medium text-positive",children:"Installed"}),"Parachute is running as an installed app on this device."]})}):null}const S={auto:{title:"Auto",help:"Show the tree only when the vault has enough folders to make it worth the space."},always:{title:"Always",help:"Always show the tree, even on a tag-flat vault."},never:{title:"Never",help:"Hide the tree. The path-prefix text input still works."}};function de({vaultId:t}){const{mode:a,setMode:n}=R(t);return e.jsxs("section",{className:"card space-y-4 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Folder tree (Notes sidebar)"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Controls the collapsible folder tree on the notes list page. Auto-detect renders the tree when the vault has at least five top-level folders or twenty notes in folders."})]}),e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"sr-only",children:"Path tree visibility"}),L.map(s=>{const i=a===s;return e.jsxs("label",{className:`flex items-start gap-3 rounded-xl border p-3 transition-colors ${i?"border-accent bg-accent/5":"border-border hover:border-accent/40"}`,children:[e.jsx("input",{type:"radio",name:"path-tree-mode",value:s,checked:i,onChange:()=>n(s),className:"mt-1 accent-accent"}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium text-fg",children:S[s].title}),e.jsx("span",{className:"mt-0.5 block text-sm text-fg-muted",children:S[s].help})]})]},s)})]})]})}const j={pinned:{title:"Pinned",help:"Tag for notes you want at the top of views."},archived:{title:"Archived",help:"Tag for notes you've moved out of the way."},captureVoice:{title:"Voice capture",help:"Default tag for new voice memos."},captureText:{title:"Text capture",help:"Default tag for quick typed notes."},view:{title:"Saved view",help:"Tag that view notes carry. Used to list them in the Views band."}};function ue({vaultId:t}){const{roles:a,setRoles:n}=M(t),s=P(),i=y(l=>l.push),u=d.useId(),[c,h]=d.useState(a);d.useEffect(()=>h(a),[a]);const x=d.useMemo(()=>{const l=(s.data??[]).map(f=>f.name);return[...new Set(l)].sort((f,p)=>f.localeCompare(p))},[s.data]),r=N.some(l=>c[l].trim()!==a[l]),o=()=>{n(c),i("Tag roles saved.","success")},m=()=>{n(null),h(g),i("Tag roles reset to defaults.","success")};return e.jsxs("section",{className:"card space-y-5 rounded-xl p-6 shadow-soft",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Tag roles"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Point each role at whatever tag your vault already uses. Changes apply to future notes only — existing notes keep their current tags."})]}),e.jsx("datalist",{id:u,children:x.map(l=>e.jsx("option",{value:l},l))}),e.jsx("div",{className:"space-y-4",children:N.map(l=>e.jsxs("label",{className:"block text-sm",children:[e.jsxs("span",{className:"mb-1.5 flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-fg",children:j[l].title}),e.jsxs("span",{className:"text-xs text-fg-dim",children:["default: #",g[l]]})]}),e.jsx("input",{type:"text",value:c[l],onChange:f=>h(p=>({...p,[l]:f.target.value})),list:u,placeholder:g[l],"aria-label":`${j[l].title} tag role`,spellCheck:!1,autoCapitalize:"none",autoCorrect:"off",className:"input input-on-bg"}),e.jsx("span",{className:"mt-1.5 block text-xs text-fg-dim",children:j[l].help})]},l))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 pt-1",children:[e.jsx("button",{type:"button",onClick:o,disabled:!r,className:"btn btn-primary btn-lg",children:"Save"}),e.jsx("button",{type:"button",onClick:m,className:"btn btn-ghost",children:"Reset to defaults"})]})]})}export{pe as Settings};
@@ -1 +1 @@
1
- import{br as o,ae as x,a as l,bs as h,j as e,N as c,L as j,v as r,a1 as g,r as f}from"./index-H6VNro-x.js";import{ViewCanvas as m}from"./ViewSurface-DzU1BogH.js";import"./TagSchemaEditor-Bas3UMIJ.js";function v(t,s,a){const i=s!=null&&s.fields?Object.keys(s.fields).length:0,n={tag:t};return t!==a.archived&&(n.exclude_tags=[a.archived]),n.sort="desc",n.limit=o,{noteId:`derived:tag:${t}`,title:t,kind:i>=1?"table":"list",query:n,problems:[]}}function u(){return e.jsx("nav",{className:"mb-6 text-sm text-fg-dim",children:e.jsx(j,{to:"/tags",className:"focus-ring hover:text-accent",children:"← Tags"})})}function y(){const{name:t}=x(),s=l(i=>i.getActiveVault()),a=h(t??null);return s?t?a.isPending?e.jsxs("div",{className:"page",children:[e.jsx(u,{}),e.jsx(T,{})]}):e.jsx(p,{name:t,tag:a.data??null}):e.jsx(c,{to:"/tags",replace:!0}):e.jsx(c,{to:"/",replace:!0})}function p({name:t,tag:s}){const a=l(d=>d.getActiveVault()),{roles:i}=g((a==null?void 0:a.id)??null),n=f.useMemo(()=>v(t,s,i),[t,s,i]);return e.jsx(m,{def:n,backingNote:null,pageSize:o,total:s==null?void 0:s.count,nav:e.jsx(u,{})})}function T(){return e.jsxs("div",{className:"space-y-4","aria-busy":"true",children:[e.jsx(r,{height:32,width:"40%"}),e.jsx(r,{height:20,width:"60%"}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(r,{height:56}),e.jsx(r,{height:56}),e.jsx(r,{height:56})]})]})}export{y as TagPage};
1
+ import{bu as o,ag as x,a as l,bv as h,j as e,N as c,L as g,y as r,a3 as j,r as f}from"./index-CpyANXLa.js";import{ViewCanvas as m}from"./ViewSurface-BhLi1m3l.js";import"./TagSchemaEditor-DrsKXHjg.js";function v(t,s,a){const i=s!=null&&s.fields?Object.keys(s.fields).length:0,n={tag:t};return t!==a.archived&&(n.exclude_tags=[a.archived]),n.sort="desc",n.limit=o,{noteId:`derived:tag:${t}`,title:t,kind:i>=1?"table":"list",query:n,problems:[]}}function u(){return e.jsx("nav",{className:"mb-6 text-sm text-fg-dim",children:e.jsx(g,{to:"/tags",className:"focus-ring hover:text-accent",children:"← Tags"})})}function N(){const{name:t}=x(),s=l(i=>i.getActiveVault()),a=h(t??null);return s?t?a.isPending?e.jsxs("div",{className:"page",children:[e.jsx(u,{}),e.jsx(T,{})]}):e.jsx(p,{name:t,tag:a.data??null}):e.jsx(c,{to:"/tags",replace:!0}):e.jsx(c,{to:"/",replace:!0})}function p({name:t,tag:s}){const a=l(d=>d.getActiveVault()),{roles:i}=j((a==null?void 0:a.id)??null),n=f.useMemo(()=>v(t,s,i),[t,s,i]);return e.jsx(m,{def:n,backingNote:null,pageSize:o,total:s==null?void 0:s.count,nav:e.jsx(u,{})})}function T(){return e.jsxs("div",{className:"space-y-4","aria-busy":"true",children:[e.jsx(r,{height:32,width:"40%"}),e.jsx(r,{height:20,width:"60%"}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(r,{height:56}),e.jsx(r,{height:56}),e.jsx(r,{height:56})]})]})}export{N as TagPage};
@@ -1 +1 @@
1
- import{bs as V,c6 as _,r as u,j as e,V as K}from"./index-H6VNro-x.js";const q=["string","number","boolean","date"];let C=0;function g(){return C+=1,`row-${C}`}function z(s){return s?Object.entries(s).map(([n,l])=>{var i;return{rowId:g(),name:n,type:l.type||"string",values:((i=l.enum)==null?void 0:i.join(", "))??""}}):[]}function L(s){return s==="date"?{rowId:g(),name:"",type:"date"}:{rowId:g(),name:"",type:"string",values:""}}function B({tagName:s,intent:n,onSaved:l,onClose:i}){var I;const a=V(s),d=_(),[j,v]=u.useState(""),[f,x]=u.useState([]),[N,w]=u.useState(""),[k,T]=u.useState(!1),[E,p]=u.useState(null);u.useEffect(()=>{if(k||a.isPending)return;const t=a.data;let r=[];t&&(v(t.description??""),r=z(t.fields),w((t.parent_names??[]).join(", ")));const m=n==="date"?r.some(c=>c.type==="date"):r.length>0;n&&!m&&(r=[...r,L(n)]),x(r),T(!0)},[k,a.isPending,a.data,n]);const h=((I=a.data)==null?void 0:I.fields)??null,P=!M(h,S(f)),b=(t,r)=>{x(m=>m.map(c=>c.rowId===t?{...c,...r}:c))},D=()=>{x(t=>[...t,{rowId:g(),name:"",type:"string"}])},R=t=>{x(r=>r.filter(m=>m.rowId!==t))},A=async()=>{p(null);const t=f.map(o=>({...o,name:o.name.trim()}));if(t.filter(o=>o.name.length===0).length>0){p("Field names can't be blank. Remove the empty row or fill it in.");return}const m=new Set;for(const o of t){if(m.has(o.name)){p(`Duplicate field name "${o.name}". Each field needs a unique key.`);return}m.add(o.name)}const c=t.length>0?S(t):null,$=h!=null&&Object.keys(h).some(o=>!t.find(O=>O.name===o)),F=N.split(",").map(o=>o.trim()).filter(o=>o.length>0),y={description:j.trim()||null,parent_names:F.length>0?F:null};try{$?(await d.mutateAsync({name:s,payload:{...y,fields:null}}),c&&await d.mutateAsync({name:s,payload:{...y,fields:c}})):await d.mutateAsync({name:s,payload:{...y,fields:c}}),l==null||l(c??{}),i()}catch(o){if(o instanceof K){p("Session expired. Reconnect to save.");return}p(o instanceof Error?o.message:"Save failed")}};return e.jsx("dialog",{open:!0,"aria-modal":"true","aria-label":`Edit schema for #${s}`,className:"fixed inset-0 z-50 m-0 h-dvh w-screen max-h-none max-w-none overflow-y-auto bg-black/60 p-4 md:p-8",onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),i())},children:e.jsxs("div",{className:"mx-auto max-w-xl rounded-2xl border border-border bg-card p-5 text-fg shadow-lift md:p-6",children:[e.jsxs("header",{className:"mb-4 flex items-baseline justify-between gap-3",children:[e.jsxs("h2",{className:"font-serif text-lg",children:["Schema for ",e.jsxs("span",{className:"font-mono",children:["#",s]})]}),e.jsx("button",{type:"button",onClick:i,className:"text-sm text-fg-muted hover:text-accent","aria-label":"Close schema editor",children:"Close"})]}),a.isPending?e.jsx("p",{className:"text-sm text-fg-dim","aria-busy":"true",children:"Loading schema…"}):a.isError?e.jsxs("p",{role:"alert",className:"text-sm text-red-400",children:["Could not load schema: ",a.error.message]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:"A meta tag gives every note carrying it a shared shape — fields it can carry, and where it sits in your tag hierarchy."}),n?e.jsx("p",{className:"mb-4 rounded-md border border-accent/30 bg-accent/5 p-3 text-sm text-fg-muted",children:n==="group"?"Name a field to organize by, then give it a set of values — each value becomes a column on your board.":"Name a date field — the calendar plots notes on the day it holds, and lets you drag them between days."}):null,e.jsxs("label",{className:"mb-4 block",children:[e.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wider text-fg-dim",children:"Description"}),e.jsx("input",{type:"text",value:j,onChange:t=>v(t.target.value),placeholder:"What does this tag mean? Who uses it?","aria-label":"Tag description",className:"w-full rounded-lg border border-border bg-bg px-2.5 py-1.5 text-sm text-fg focus:border-accent focus:outline-none"})]}),e.jsxs("fieldset",{className:"mb-4",children:[e.jsx("legend",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:"Fields"}),e.jsxs("p",{className:"mb-2 text-xs text-fg-dim",children:["Each field is a key and a type — e.g."," ",e.jsx("span",{className:"font-mono",children:"status — string"}),","," ",e.jsx("span",{className:"font-mono",children:"meeting_date — date"}),"."]}),f.length===0?e.jsx("p",{className:"mb-2 text-xs text-fg-dim",children:"No fields declared yet. Add one to give notes carrying this tag a structured shape."}):e.jsx("ul",{className:"mb-2 space-y-2.5","aria-label":"Schema fields",children:f.map(t=>e.jsxs("li",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:t.name,onChange:r=>b(t.rowId,{name:r.target.value}),placeholder:"field_name","aria-label":"Field name",className:"flex-1 rounded-lg border border-border bg-bg px-2 py-1 font-mono text-xs text-fg focus:border-accent focus:outline-none"}),e.jsx("select",{value:t.type,onChange:r=>b(t.rowId,{type:r.target.value}),"aria-label":`Type for ${t.name||"new field"}`,className:"rounded-lg border border-border bg-bg px-2 py-1 text-xs text-fg focus:border-accent focus:outline-none",children:q.map(r=>e.jsx("option",{value:r,children:r},r))}),e.jsx("button",{type:"button",onClick:()=>R(t.rowId),"aria-label":`Remove field ${t.name||"new"}`,className:"text-fg-dim hover:text-red-400",children:"×"})]}),t.type==="string"?e.jsxs("div",{className:"pl-1",children:[e.jsx("input",{type:"text",value:t.values??"",onChange:r=>b(t.rowId,{values:r.target.value}),placeholder:"e.g. To do, In progress, Done","aria-label":`Values for ${t.name||"new field"}`,className:"w-full rounded-lg border border-border bg-bg px-2 py-1 text-xs text-fg focus:border-accent focus:outline-none"}),e.jsx("p",{className:"mt-1 text-2xs text-fg-dim",children:"Optional — comma-separated values become columns on a board."})]}):null]},t.rowId))}),e.jsx("button",{type:"button",onClick:D,className:"text-xs text-accent hover:text-accent-hover",children:"+ Add field"})]}),e.jsxs("label",{className:"mb-4 block",children:[e.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wider text-fg-dim",children:"Parent tags"}),e.jsx("input",{type:"text",value:N,onChange:t=>w(t.target.value),placeholder:"comma-separated (e.g. project, area)","aria-label":"Parent tags",className:"w-full rounded-lg border border-border bg-bg px-2.5 py-1.5 font-mono text-xs text-fg focus:border-accent focus:outline-none"}),e.jsx("p",{className:"mt-1 text-xs text-fg-dim",children:"Vault treats parents as a hierarchical relationship — children inherit semantics. Comma-separated; leave blank for a top-level tag."})]}),P?e.jsxs("div",{role:"alert",className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/5 p-3 text-xs text-amber-300",children:[e.jsx("strong",{className:"block font-medium",children:"Heads up."})," Editing this tag's schema doesn't retroactively update notes already tagged with"," ",e.jsxs("span",{className:"font-mono",children:["#",s]}),". The new schema applies to notes you create or update from here on. Existing notes keep their current shape until you edit them."]}):null,E?e.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:E}):null,e.jsxs("footer",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:i,className:"rounded-lg border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"}),e.jsx("button",{type:"button",onClick:A,disabled:d.isPending,className:"rounded-lg bg-accent px-4 py-1.5 text-sm font-medium text-(--color-on-accent) hover:bg-accent-hover disabled:opacity-40",children:d.isPending?"Saving…":"Save schema"})]})]})]})})}function W(s){if(!s)return[];const n=new Set,l=[];for(const i of s.split(/[,\n]/)){const a=i.trim();a&&!n.has(a)&&(n.add(a),l.push(a))}return l}function S(s){const n={};for(const l of s){const i=l.name.trim();if(!i)continue;const a={type:l.type};if(l.type==="string"){const d=W(l.values);d.length>0&&(a.enum=d)}n[i]=a}return n}function H(s,n){const l=s??[],i=n??[];return l.length!==i.length?!1:l.every((a,d)=>a===i[d])}function M(s,n){const l=s?Object.keys(s):[],i=n?Object.keys(n):[];if(l.length!==i.length)return!1;for(const a of l)if(!n||!n[a]||s[a].type!==n[a].type||!H(s[a].enum,n[a].enum))return!1;return!0}export{B as T};
1
+ import{bv as V,c9 as _,r as u,j as e,V as K}from"./index-CpyANXLa.js";const q=["string","number","boolean","date"];let C=0;function g(){return C+=1,`row-${C}`}function z(s){return s?Object.entries(s).map(([n,l])=>{var i;return{rowId:g(),name:n,type:l.type||"string",values:((i=l.enum)==null?void 0:i.join(", "))??""}}):[]}function L(s){return s==="date"?{rowId:g(),name:"",type:"date"}:{rowId:g(),name:"",type:"string",values:""}}function B({tagName:s,intent:n,onSaved:l,onClose:i}){var I;const a=V(s),d=_(),[j,v]=u.useState(""),[f,x]=u.useState([]),[N,w]=u.useState(""),[k,T]=u.useState(!1),[E,p]=u.useState(null);u.useEffect(()=>{if(k||a.isPending)return;const t=a.data;let r=[];t&&(v(t.description??""),r=z(t.fields),w((t.parent_names??[]).join(", ")));const m=n==="date"?r.some(c=>c.type==="date"):r.length>0;n&&!m&&(r=[...r,L(n)]),x(r),T(!0)},[k,a.isPending,a.data,n]);const h=((I=a.data)==null?void 0:I.fields)??null,P=!M(h,S(f)),b=(t,r)=>{x(m=>m.map(c=>c.rowId===t?{...c,...r}:c))},D=()=>{x(t=>[...t,{rowId:g(),name:"",type:"string"}])},R=t=>{x(r=>r.filter(m=>m.rowId!==t))},A=async()=>{p(null);const t=f.map(o=>({...o,name:o.name.trim()}));if(t.filter(o=>o.name.length===0).length>0){p("Field names can't be blank. Remove the empty row or fill it in.");return}const m=new Set;for(const o of t){if(m.has(o.name)){p(`Duplicate field name "${o.name}". Each field needs a unique key.`);return}m.add(o.name)}const c=t.length>0?S(t):null,$=h!=null&&Object.keys(h).some(o=>!t.find(O=>O.name===o)),F=N.split(",").map(o=>o.trim()).filter(o=>o.length>0),y={description:j.trim()||null,parent_names:F.length>0?F:null};try{$?(await d.mutateAsync({name:s,payload:{...y,fields:null}}),c&&await d.mutateAsync({name:s,payload:{...y,fields:c}})):await d.mutateAsync({name:s,payload:{...y,fields:c}}),l==null||l(c??{}),i()}catch(o){if(o instanceof K){p("Session expired. Reconnect to save.");return}p(o instanceof Error?o.message:"Save failed")}};return e.jsx("dialog",{open:!0,"aria-modal":"true","aria-label":`Edit schema for #${s}`,className:"fixed inset-0 z-50 m-0 h-dvh w-screen max-h-none max-w-none overflow-y-auto bg-black/60 p-4 md:p-8",onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),i())},children:e.jsxs("div",{className:"mx-auto max-w-xl rounded-2xl border border-border bg-card p-5 text-fg shadow-lift md:p-6",children:[e.jsxs("header",{className:"mb-4 flex items-baseline justify-between gap-3",children:[e.jsxs("h2",{className:"font-serif text-lg",children:["Schema for ",e.jsxs("span",{className:"font-mono",children:["#",s]})]}),e.jsx("button",{type:"button",onClick:i,className:"text-sm text-fg-muted hover:text-accent","aria-label":"Close schema editor",children:"Close"})]}),a.isPending?e.jsx("p",{className:"text-sm text-fg-dim","aria-busy":"true",children:"Loading schema…"}):a.isError?e.jsxs("p",{role:"alert",className:"text-sm text-red-400",children:["Could not load schema: ",a.error.message]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:"A meta tag gives every note carrying it a shared shape — fields it can carry, and where it sits in your tag hierarchy."}),n?e.jsx("p",{className:"mb-4 rounded-md border border-accent/30 bg-accent/5 p-3 text-sm text-fg-muted",children:n==="group"?"Name a field to organize by, then give it a set of values — each value becomes a column on your board.":"Name a date field — the calendar plots notes on the day it holds, and lets you drag them between days."}):null,e.jsxs("label",{className:"mb-4 block",children:[e.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wider text-fg-dim",children:"Description"}),e.jsx("input",{type:"text",value:j,onChange:t=>v(t.target.value),placeholder:"What does this tag mean? Who uses it?","aria-label":"Tag description",className:"w-full rounded-lg border border-border bg-bg px-2.5 py-1.5 text-sm text-fg focus:border-accent focus:outline-none"})]}),e.jsxs("fieldset",{className:"mb-4",children:[e.jsx("legend",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:"Fields"}),e.jsxs("p",{className:"mb-2 text-xs text-fg-dim",children:["Each field is a key and a type — e.g."," ",e.jsx("span",{className:"font-mono",children:"status — string"}),","," ",e.jsx("span",{className:"font-mono",children:"meeting_date — date"}),"."]}),f.length===0?e.jsx("p",{className:"mb-2 text-xs text-fg-dim",children:"No fields declared yet. Add one to give notes carrying this tag a structured shape."}):e.jsx("ul",{className:"mb-2 space-y-2.5","aria-label":"Schema fields",children:f.map(t=>e.jsxs("li",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:t.name,onChange:r=>b(t.rowId,{name:r.target.value}),placeholder:"field_name","aria-label":"Field name",className:"flex-1 rounded-lg border border-border bg-bg px-2 py-1 font-mono text-xs text-fg focus:border-accent focus:outline-none"}),e.jsx("select",{value:t.type,onChange:r=>b(t.rowId,{type:r.target.value}),"aria-label":`Type for ${t.name||"new field"}`,className:"rounded-lg border border-border bg-bg px-2 py-1 text-xs text-fg focus:border-accent focus:outline-none",children:q.map(r=>e.jsx("option",{value:r,children:r},r))}),e.jsx("button",{type:"button",onClick:()=>R(t.rowId),"aria-label":`Remove field ${t.name||"new"}`,className:"text-fg-dim hover:text-red-400",children:"×"})]}),t.type==="string"?e.jsxs("div",{className:"pl-1",children:[e.jsx("input",{type:"text",value:t.values??"",onChange:r=>b(t.rowId,{values:r.target.value}),placeholder:"e.g. To do, In progress, Done","aria-label":`Values for ${t.name||"new field"}`,className:"w-full rounded-lg border border-border bg-bg px-2 py-1 text-xs text-fg focus:border-accent focus:outline-none"}),e.jsx("p",{className:"mt-1 text-2xs text-fg-dim",children:"Optional — comma-separated values become columns on a board."})]}):null]},t.rowId))}),e.jsx("button",{type:"button",onClick:D,className:"text-xs text-accent hover:text-accent-hover",children:"+ Add field"})]}),e.jsxs("label",{className:"mb-4 block",children:[e.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wider text-fg-dim",children:"Parent tags"}),e.jsx("input",{type:"text",value:N,onChange:t=>w(t.target.value),placeholder:"comma-separated (e.g. project, area)","aria-label":"Parent tags",className:"w-full rounded-lg border border-border bg-bg px-2.5 py-1.5 font-mono text-xs text-fg focus:border-accent focus:outline-none"}),e.jsx("p",{className:"mt-1 text-xs text-fg-dim",children:"Vault treats parents as a hierarchical relationship — children inherit semantics. Comma-separated; leave blank for a top-level tag."})]}),P?e.jsxs("div",{role:"alert",className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/5 p-3 text-xs text-amber-300",children:[e.jsx("strong",{className:"block font-medium",children:"Heads up."})," Editing this tag's schema doesn't retroactively update notes already tagged with"," ",e.jsxs("span",{className:"font-mono",children:["#",s]}),". The new schema applies to notes you create or update from here on. Existing notes keep their current shape until you edit them."]}):null,E?e.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:E}):null,e.jsxs("footer",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:i,className:"rounded-lg border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"}),e.jsx("button",{type:"button",onClick:A,disabled:d.isPending,className:"rounded-lg bg-accent px-4 py-1.5 text-sm font-medium text-(--color-on-accent) hover:bg-accent-hover disabled:opacity-40",children:d.isPending?"Saving…":"Save schema"})]})]})]})})}function W(s){if(!s)return[];const n=new Set,l=[];for(const i of s.split(/[,\n]/)){const a=i.trim();a&&!n.has(a)&&(n.add(a),l.push(a))}return l}function S(s){const n={};for(const l of s){const i=l.name.trim();if(!i)continue;const a={type:l.type};if(l.type==="string"){const d=W(l.values);d.length>0&&(a.enum=d)}n[i]=a}return n}function H(s,n){const l=s??[],i=n??[];return l.length!==i.length?!1:l.every((a,d)=>a===i[d])}function M(s,n){const l=s?Object.keys(s):[],i=n?Object.keys(n):[];if(l.length!==i.length)return!1;for(const a of l)if(!n||!n[a]||s[a].type!==n[a].type||!H(s[a].enum,n[a].enum))return!1;return!0}export{B as T};