mcp-memory-bucket 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,23 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(i){if(i.ep)return;i.ep=!0;const n=t(i);fetch(i.href,n)}})();const Ot="modulepreload",Mt=function(r){return"/"+r},Fe={},dt=function(e,t,s){let i=Promise.resolve();if(t&&t.length>0){let o=function(c){return Promise.all(c.map(p=>Promise.resolve(p).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=o(t.map(c=>{if(c=Mt(c),c in Fe)return;Fe[c]=!0;const p=c.endsWith(".css"),d=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=p?"stylesheet":Ot,p||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),p)return new Promise((v,b)=>{f.addEventListener("load",v),f.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function n(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&n(a.reason);return e().catch(n)})};/**
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(i){if(i.ep)return;i.ep=!0;const n=t(i);fetch(i.href,n)}})();const Ft="modulepreload",qt=function(r){return"/"+r},Ne={},ut=function(e,t,s){let i=Promise.resolve();if(t&&t.length>0){let o=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=o(t.map(h=>{if(h=qt(h),h in Ne)return;Ne[h]=!0;const p=h.endsWith(".css"),d=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${d}`))return;const f=document.createElement("link");if(f.rel=p?"stylesheet":Ft,p||(f.as="script"),f.crossOrigin="",f.href=h,l&&f.setAttribute("nonce",l),document.head.appendChild(f),p)return new Promise((v,b)=>{f.addEventListener("load",v),f.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${h}`)))})}))}function n(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&n(a.reason);return e().catch(n)})};/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const ee=globalThis,$e=ee.ShadowRoot&&(ee.ShadyCSS===void 0||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,we=Symbol(),Ne=new WeakMap;let pt=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==we)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if($e&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=Ne.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Ne.set(t,e))}return e}toString(){return this.cssText}};const Ft=r=>new pt(typeof r=="string"?r:r+"",void 0,we),O=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((s,i,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[n+1],r[0]);return new pt(t,r,we)},Nt=(r,e)=>{if($e)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),i=ee.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=t.cssText,r.appendChild(s)}},qe=$e?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return Ft(t)})(r):r;/**
5
+ */const ee=globalThis,$e=ee.ShadowRoot&&(ee.ShadyCSS===void 0||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,we=Symbol(),Fe=new WeakMap;let ft=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==we)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if($e&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=Fe.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Fe.set(t,e))}return e}toString(){return this.cssText}};const Ut=r=>new ft(typeof r=="string"?r:r+"",void 0,we),R=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((s,i,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[n+1],r[0]);return new ft(t,r,we)},jt=(r,e)=>{if($e)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),i=ee.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=t.cssText,r.appendChild(s)}},qe=$e?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return Ut(t)})(r):r;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:qt,defineProperty:Ut,getOwnPropertyDescriptor:jt,getOwnPropertyNames:Ht,getOwnPropertySymbols:Bt,getPrototypeOf:Kt}=Object,oe=globalThis,Ue=oe.trustedTypes,Zt=Ue?Ue.emptyScript:"",Wt=oe.reactiveElementPolyfillSupport,W=(r,e)=>r,ge={toAttribute(r,e){switch(e){case Boolean:r=r?Zt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},ut=(r,e)=>!qt(r,e),je={attribute:!0,type:String,converter:ge,reflect:!1,useDefault:!1,hasChanged:ut};Symbol.metadata??=Symbol("metadata"),oe.litPropertyMetadata??=new WeakMap;let N=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=je){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&Ut(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:n}=jt(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){const a=i?.call(this);n?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??je}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;const e=Kt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){const t=this.properties,s=[...Ht(t),...Bt(t)];for(const i of s)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,i]of t)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)t.unshift(qe(i))}else e!==void 0&&t.push(qe(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Nt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const n=(s.converter?.toAttribute!==void 0?s.converter:ge).toAttribute(t,s.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:ge;this._$Em=i;const a=o.fromAttribute(t,n.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,t,s,i=!1,n){if(e!==void 0){const o=this.constructor;if(i===!1&&(n=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??ut)(n,t)||s.useDefault&&s.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,n]of s){const{wrapped:o}=n,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,n,a)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[W("elementProperties")]=new Map,N[W("finalized")]=new Map,Wt?.({ReactiveElement:N}),(oe.reactiveElementVersions??=[]).push("2.1.2");/**
9
+ */const{is:Ht,defineProperty:Bt,getOwnPropertyDescriptor:Kt,getOwnPropertyNames:Zt,getOwnPropertySymbols:Wt,getPrototypeOf:Vt}=Object,ae=globalThis,Ue=ae.trustedTypes,Qt=Ue?Ue.emptyScript:"",Yt=ae.reactiveElementPolyfillSupport,W=(r,e)=>r,be={toAttribute(r,e){switch(e){case Boolean:r=r?Qt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},gt=(r,e)=>!Ht(r,e),je={attribute:!0,type:String,converter:be,reflect:!1,useDefault:!1,hasChanged:gt};Symbol.metadata??=Symbol("metadata"),ae.litPropertyMetadata??=new WeakMap;let F=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=je){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&Bt(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:n}=Kt(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){const a=i?.call(this);n?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??je}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;const e=Vt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){const t=this.properties,s=[...Zt(t),...Wt(t)];for(const i of s)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,i]of t)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)t.unshift(qe(i))}else e!==void 0&&t.push(qe(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const n=(s.converter?.toAttribute!==void 0?s.converter:be).toAttribute(t,s.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:be;this._$Em=i;const a=o.fromAttribute(t,n.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,t,s,i=!1,n){if(e!==void 0){const o=this.constructor;if(i===!1&&(n=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??gt)(n,t)||s.useDefault&&s.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,n]of s){const{wrapped:o}=n,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,n,a)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};F.elementStyles=[],F.shadowRootOptions={mode:"open"},F[W("elementProperties")]=new Map,F[W("finalized")]=new Map,Yt?.({ReactiveElement:F}),(ae.reactiveElementVersions??=[]).push("2.1.2");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const _e=globalThis,He=r=>r,te=_e.trustedTypes,Be=te?te.createPolicy("lit-html",{createHTML:r=>r}):void 0,ft="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,gt="?"+E,Qt=`<${gt}>`,L=document,Q=()=>L.createComment(""),V=r=>r===null||typeof r!="object"&&typeof r!="function",Se=Array.isArray,Vt=r=>Se(r)||typeof r?.[Symbol.iterator]=="function",de=`[
14
- \f\r]`,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ke=/-->/g,Ze=/>/g,R=RegExp(`>|${de}(?:([^\\s"'>=/]+)(${de}*=${de}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),We=/'/g,Qe=/"/g,bt=/^(?:script|style|textarea|title)$/i,Yt=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),h=Yt(1),I=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),Ve=new WeakMap,z=L.createTreeWalker(L,129);function mt(r,e){if(!Se(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Be!==void 0?Be.createHTML(e):e}const Jt=(r,e)=>{const t=r.length-1,s=[];let i,n=e===2?"<svg>":e===3?"<math>":"",o=B;for(let a=0;a<t;a++){const l=r[a];let c,p,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,p=o.exec(l),p!==null);)f=o.lastIndex,o===B?p[1]==="!--"?o=Ke:p[1]!==void 0?o=Ze:p[2]!==void 0?(bt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=R):p[3]!==void 0&&(o=R):o===R?p[0]===">"?(o=i??B,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?R:p[3]==='"'?Qe:We):o===Qe||o===We?o=R:o===Ke||o===Ze?o=B:(o=R,i=void 0);const v=o===R&&r[a+1].startsWith("/>")?" ":"";n+=o===B?l+Qt:d>=0?(s.push(c),l.slice(0,d)+ft+l.slice(d)+E+v):l+E+(d===-2?a:v)}return[mt(r,n+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let be=class xt{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let n=0,o=0;const a=e.length-1,l=this.parts,[c,p]=Jt(e,t);if(this.el=xt.createElement(c,s),z.currentNode=this.el.content,t===2||t===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=z.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(ft)){const f=p[o++],v=i.getAttribute(d).split(E),b=/([.?@])?(.*)/.exec(f);l.push({type:1,index:n,name:b[2],strings:v,ctor:b[1]==="."?Xt:b[1]==="?"?es:b[1]==="@"?ts:ae}),i.removeAttribute(d)}else d.startsWith(E)&&(l.push({type:6,index:n}),i.removeAttribute(d));if(bt.test(i.tagName)){const d=i.textContent.split(E),f=d.length-1;if(f>0){i.textContent=te?te.emptyScript:"";for(let v=0;v<f;v++)i.append(d[v],Q()),z.nextNode(),l.push({type:2,index:++n});i.append(d[f],Q())}}}else if(i.nodeType===8)if(i.data===gt)l.push({type:2,index:n});else{let d=-1;for(;(d=i.data.indexOf(E,d+1))!==-1;)l.push({type:7,index:n}),d+=E.length-1}n++}}static createElement(e,t){const s=L.createElement("template");return s.innerHTML=e,s}};function q(r,e,t=r,s){if(e===I)return e;let i=s!==void 0?t._$Co?.[s]:t._$Cl;const n=V(e)?void 0:e._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,t,s)),s!==void 0?(t._$Co??=[])[s]=i:t._$Cl=i),i!==void 0&&(e=q(r,i._$AS(r,e.values),i,s)),e}let Gt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=(e?.creationScope??L).importNode(t,!0);z.currentNode=i;let n=z.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Y(n,n.nextSibling,this,e):l.type===1?c=new l.ctor(n,l.name,l.strings,this,e):l.type===6&&(c=new ss(n,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(n=z.nextNode(),o++)}return z.currentNode=L,i}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}};class Y{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=q(this,e,t),V(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==I&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Vt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==m&&V(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=be.createElement(mt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(t);else{const n=new Gt(i,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=Ve.get(e.strings);return t===void 0&&Ve.set(e.strings,t=new be(e)),t}k(e){Se(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const n of e)i===t.length?t.push(s=new Y(this.O(Q()),this.O(Q()),this,this.options)):s=t[i],s._$AI(n),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const s=He(e).nextSibling;He(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}let ae=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,n){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(e,t=this,s,i){const n=this.strings;let o=!1;if(n===void 0)e=q(this,e,t,0),o=!V(e)||e!==this._$AH&&e!==I,o&&(this._$AH=e);else{const a=e;let l,c;for(e=n[0],l=0;l<n.length-1;l++)c=q(this,a[s+l],t,l),c===I&&(c=this._$AH[l]),o||=!V(c)||c!==this._$AH[l],c===m?e=m:e!==m&&(e+=(c??"")+n[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Xt=class extends ae{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},es=class extends ae{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},ts=class extends ae{constructor(e,t,s,i,n){super(e,t,s,i,n),this.type=5}_$AI(e,t=this){if((e=q(this,e,t,0)??m)===I)return;const s=this._$AH,i=e===m&&s!==m||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==m&&(s===m||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ss=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){q(this,e)}};const is=_e.litHtmlPolyfillSupport;is?.(be,Y),(_e.litHtmlVersions??=[]).push("3.3.3");const rs=(r,e,t)=>{const s=t?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const n=t?.renderBefore??null;s._$litPart$=i=new Y(e.insertBefore(Q(),n),n,void 0,t??{})}return i._$AI(r),i};/**
13
+ */const _e=globalThis,He=r=>r,se=_e.trustedTypes,Be=se?se.createPolicy("lit-html",{createHTML:r=>r}):void 0,bt="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+E,Jt=`<${mt}>`,I=document,V=()=>I.createComment(""),Q=r=>r===null||typeof r!="object"&&typeof r!="function",Se=Array.isArray,Gt=r=>Se(r)||typeof r?.[Symbol.iterator]=="function",pe=`[
14
+ \f\r]`,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ke=/-->/g,Ze=/>/g,z=RegExp(`>|${pe}(?:([^\\s"'>=/]+)(${pe}*=${pe}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),We=/'/g,Ve=/"/g,xt=/^(?:script|style|textarea|title)$/i,Xt=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),c=Xt(1),D=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),Qe=new WeakMap,L=I.createTreeWalker(I,129);function vt(r,e){if(!Se(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Be!==void 0?Be.createHTML(e):e}const es=(r,e)=>{const t=r.length-1,s=[];let i,n=e===2?"<svg>":e===3?"<math>":"",o=B;for(let a=0;a<t;a++){const l=r[a];let h,p,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,p=o.exec(l),p!==null);)f=o.lastIndex,o===B?p[1]==="!--"?o=Ke:p[1]!==void 0?o=Ze:p[2]!==void 0?(xt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=z):p[3]!==void 0&&(o=z):o===z?p[0]===">"?(o=i??B,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,h=p[1],o=p[3]===void 0?z:p[3]==='"'?Ve:We):o===Ve||o===We?o=z:o===Ke||o===Ze?o=B:(o=z,i=void 0);const v=o===z&&r[a+1].startsWith("/>")?" ":"";n+=o===B?l+Jt:d>=0?(s.push(h),l.slice(0,d)+bt+l.slice(d)+E+v):l+E+(d===-2?a:v)}return[vt(r,n+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let me=class yt{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let n=0,o=0;const a=e.length-1,l=this.parts,[h,p]=es(e,t);if(this.el=yt.createElement(h,s),L.currentNode=this.el.content,t===2||t===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=L.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(bt)){const f=p[o++],v=i.getAttribute(d).split(E),b=/([.?@])?(.*)/.exec(f);l.push({type:1,index:n,name:b[2],strings:v,ctor:b[1]==="."?ss:b[1]==="?"?is:b[1]==="@"?rs:le}),i.removeAttribute(d)}else d.startsWith(E)&&(l.push({type:6,index:n}),i.removeAttribute(d));if(xt.test(i.tagName)){const d=i.textContent.split(E),f=d.length-1;if(f>0){i.textContent=se?se.emptyScript:"";for(let v=0;v<f;v++)i.append(d[v],V()),L.nextNode(),l.push({type:2,index:++n});i.append(d[f],V())}}}else if(i.nodeType===8)if(i.data===mt)l.push({type:2,index:n});else{let d=-1;for(;(d=i.data.indexOf(E,d+1))!==-1;)l.push({type:7,index:n}),d+=E.length-1}n++}}static createElement(e,t){const s=I.createElement("template");return s.innerHTML=e,s}};function q(r,e,t=r,s){if(e===D)return e;let i=s!==void 0?t._$Co?.[s]:t._$Cl;const n=Q(e)?void 0:e._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,t,s)),s!==void 0?(t._$Co??=[])[s]=i:t._$Cl=i),i!==void 0&&(e=q(r,i._$AS(r,e.values),i,s)),e}let ts=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=(e?.creationScope??I).importNode(t,!0);L.currentNode=i;let n=L.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let h;l.type===2?h=new Y(n,n.nextSibling,this,e):l.type===1?h=new l.ctor(n,l.name,l.strings,this,e):l.type===6&&(h=new ns(n,this,e)),this._$AV.push(h),l=s[++a]}o!==l?.index&&(n=L.nextNode(),o++)}return L.currentNode=I,i}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}};class Y{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=q(this,e,t),Q(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==D&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Gt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==m&&Q(this._$AH)?this._$AA.nextSibling.data=e:this.T(I.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=me.createElement(vt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(t);else{const n=new ts(i,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=Qe.get(e.strings);return t===void 0&&Qe.set(e.strings,t=new me(e)),t}k(e){Se(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const n of e)i===t.length?t.push(s=new Y(this.O(V()),this.O(V()),this,this.options)):s=t[i],s._$AI(n),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const s=He(e).nextSibling;He(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}let le=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,n){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(e,t=this,s,i){const n=this.strings;let o=!1;if(n===void 0)e=q(this,e,t,0),o=!Q(e)||e!==this._$AH&&e!==D,o&&(this._$AH=e);else{const a=e;let l,h;for(e=n[0],l=0;l<n.length-1;l++)h=q(this,a[s+l],t,l),h===D&&(h=this._$AH[l]),o||=!Q(h)||h!==this._$AH[l],h===m?e=m:e!==m&&(e+=(h??"")+n[l+1]),this._$AH[l]=h}o&&!i&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ss=class extends le{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},is=class extends le{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},rs=class extends le{constructor(e,t,s,i,n){super(e,t,s,i,n),this.type=5}_$AI(e,t=this){if((e=q(this,e,t,0)??m)===D)return;const s=this._$AH,i=e===m&&s!==m||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==m&&(s===m||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ns=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){q(this,e)}};const os=_e.litHtmlPolyfillSupport;os?.(me,Y),(_e.litHtmlVersions??=[]).push("3.3.3");const as=(r,e,t)=>{const s=t?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const n=t?.renderBefore??null;s._$litPart$=i=new Y(e.insertBefore(V(),n),n,void 0,t??{})}return i._$AI(r),i};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */const Ce=globalThis;let _=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=rs(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}};_._$litElement$=!0,_.finalized=!0,Ce.litElementHydrateSupport?.({LitElement:_});const ns=Ce.litElementPolyfillSupport;ns?.({LitElement:_});(Ce.litElementVersions??=[]).push("4.2.2");var vt;let pe=0;const Ye=new Set;function os(r){pe++;try{r()}finally{pe--,pe===0&&as()}}function as(){const r=new Set(Ye);Ye.clear();for(const e of r)e()}function ls(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function cs(r){return r&&typeof r.deref=="function"}class Ae{static#e=0;#t;#s;#n=new Set;#r=vt.#e++;name;constructor(e,t){this.#t=e,this.#s=e,this.name=t}_get(){return u.activeConsumer&&u.activeConsumer.track(this),this.#t}_set(e){return ls(e,this.#t)?(this.#s=this.#t,this.#t=e,this._notify(),!0):!1}subscribe(e,t=!1){let s=e;return t&&(s=new WeakRef(e)),this.#n.add(s),()=>this.#n.delete(s)}_notify(){const e=[...this.#n];for(const t of e){let s;if(cs(t)){if(s=t.deref(),!s){this.#n.delete(t);continue}}else s=t;s()}}get id(){return this.#r}get previousValue(){return this.#s}toString(){return this.name?`${this.constructor.name}(${this.name})`:`${this.constructor.name}#${this.id}`}}vt=Ae;class u extends Ae{static#e=[];constructor(e,t){super(e,t)}static get activeConsumer(){return this.#e[this.#e.length-1]}static push(e){this.#e.push(e)}static pop(){this.#e.pop()}get(){return this._get()}set(e){os(()=>{this._set(e)})}get value(){return this.get()}set value(e){this.set(e)}update(e){this.set(e(this.get()))}}class hs extends Ae{#e;#t=!0;#s=!1;#n=new Map;_debugParent;#r;#g=()=>{this.#t||(this.#t=!0,this._notify())};constructor(e,t,s){super(void 0,t),this.#e=e,this.#r=s?.weak??!0}track(e){if(this.#n.has(e))return;const t=e.subscribe(this.#g,this.#r);this.#n.set(e,t)}dispose(){this.#l()}#l(){for(const e of this.#n.values())e();this.#n.clear()}get(){if(u.activeConsumer&&u.activeConsumer.track(this),!this.#t)return this._get();if(this.#s)throw new Error(`Cycle detected in ${this}
20
- ↳ while computing ${this._debugParent??"root"}`);this.#s=!0,this.#l(),u.push(this);try{const e=this.#e();this._set(e)}finally{u.pop(),this.#t=!1,this.#s=!1}return this._get()}get value(){return this.get()}set value(e){throw new Error(`Cannot set value of Computed ${this}. Computed values are read-only.`)}subscribe(e,t=!1){const s=super.subscribe(e,t);return u.activeConsumer||this.get(),s}}class le{#e;#t=new Map;_debugParent;constructor(e){this.#e=e,e.addController(this);const t=e,s=t.update,i=this;t.update=function(n){u.push(i);try{s.call(this,n)}finally{u.pop()}}}track(e){this.#t.has(e)||this.#t.set(e,e.subscribe(this.#s,!0))}#s=()=>{this.#e.requestUpdate()};hostUpdate(){for(const e of this.#t.values())e();this.#t.clear()}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}toString(){const e=this.#e;return`SignalWatcher(${e?.localName??e?.tagName??e?.constructor?.name??"unknown"})`}}const ds=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"});function ps(r){if(!r)return"unknown age";const e=new Date(r);return Number.isNaN(e.getTime())?"unknown age":ds.format(e)}function us(r){const e=[],t=new Map,s=[];for(const n of r){if(n._table!=="memory_docs"){s.push(n);continue}t.has(n.name)||(t.set(n.name,[]),e.push(n.name)),t.get(n.name).push(n)}const i=e.map(n=>({key:n,items:t.get(n)}));return s.length>0&&i.push({key:null,items:s}),i}class fs extends _{static{this.properties={results:{attribute:!1},showFolder:{attribute:!1},onSelect:{attribute:!1},selectedIds:{attribute:!1},onToggleSelect:{attribute:!1},onKeyClick:{attribute:!1}}}static{this.styles=O`
19
+ */const Ce=globalThis;let $=class extends F{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=as(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return D}};$._$litElement$=!0,$.finalized=!0,Ce.litElementHydrateSupport?.({LitElement:$});const ls=Ce.litElementPolyfillSupport;ls?.({LitElement:$});(Ce.litElementVersions??=[]).push("4.2.2");var kt;let ue=0;const Ye=new Set;function cs(r){ue++;try{r()}finally{ue--,ue===0&&hs()}}function hs(){const r=new Set(Ye);Ye.clear();for(const e of r)e()}function ds(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function ps(r){return r&&typeof r.deref=="function"}class Ae{static#e=0;#t;#s;#n=new Set;#r=kt.#e++;name;constructor(e,t){this.#t=e,this.#s=e,this.name=t}_get(){return u.activeConsumer&&u.activeConsumer.track(this),this.#t}_set(e){return ds(e,this.#t)?(this.#s=this.#t,this.#t=e,this._notify(),!0):!1}subscribe(e,t=!1){let s=e;return t&&(s=new WeakRef(e)),this.#n.add(s),()=>this.#n.delete(s)}_notify(){const e=[...this.#n];for(const t of e){let s;if(ps(t)){if(s=t.deref(),!s){this.#n.delete(t);continue}}else s=t;s()}}get id(){return this.#r}get previousValue(){return this.#s}toString(){return this.name?`${this.constructor.name}(${this.name})`:`${this.constructor.name}#${this.id}`}}kt=Ae;class u extends Ae{static#e=[];constructor(e,t){super(e,t)}static get activeConsumer(){return this.#e[this.#e.length-1]}static push(e){this.#e.push(e)}static pop(){this.#e.pop()}get(){return this._get()}set(e){cs(()=>{this._set(e)})}get value(){return this.get()}set value(e){this.set(e)}update(e){this.set(e(this.get()))}}class us extends Ae{#e;#t=!0;#s=!1;#n=new Map;_debugParent;#r;#g=()=>{this.#t||(this.#t=!0,this._notify())};constructor(e,t,s){super(void 0,t),this.#e=e,this.#r=s?.weak??!0}track(e){if(this.#n.has(e))return;const t=e.subscribe(this.#g,this.#r);this.#n.set(e,t)}dispose(){this.#a()}#a(){for(const e of this.#n.values())e();this.#n.clear()}get(){if(u.activeConsumer&&u.activeConsumer.track(this),!this.#t)return this._get();if(this.#s)throw new Error(`Cycle detected in ${this}
20
+ ↳ while computing ${this._debugParent??"root"}`);this.#s=!0,this.#a(),u.push(this);try{const e=this.#e();this._set(e)}finally{u.pop(),this.#t=!1,this.#s=!1}return this._get()}get value(){return this.get()}set value(e){throw new Error(`Cannot set value of Computed ${this}. Computed values are read-only.`)}subscribe(e,t=!1){const s=super.subscribe(e,t);return u.activeConsumer||this.get(),s}}class ce{#e;#t=new Map;_debugParent;constructor(e){this.#e=e,e.addController(this);const t=e,s=t.update,i=this;t.update=function(n){u.push(i);try{s.call(this,n)}finally{u.pop()}}}track(e){this.#t.has(e)||this.#t.set(e,e.subscribe(this.#s,!0))}#s=()=>{this.#e.requestUpdate()};hostUpdate(){for(const e of this.#t.values())e();this.#t.clear()}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}toString(){const e=this.#e;return`SignalWatcher(${e?.localName??e?.tagName??e?.constructor?.name??"unknown"})`}}const fs=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"});function gs(r){if(!r)return"unknown age";const e=new Date(r);return Number.isNaN(e.getTime())?"unknown age":fs.format(e)}function bs(r){const e=[],t=new Map,s=[];for(const n of r){if(n._table!=="memory_docs"){s.push(n);continue}t.has(n.name)||(t.set(n.name,[]),e.push(n.name)),t.get(n.name).push(n)}const i=e.map(n=>({key:n,items:t.get(n)}));return s.length>0&&i.push({key:null,items:s}),i}class ms extends ${static{this.properties={results:{attribute:!1},showFolder:{attribute:!1},onSelect:{attribute:!1},selectedIds:{attribute:!1},onToggleSelect:{attribute:!1},onKeyClick:{attribute:!1}}}static{this.styles=R`
21
21
  :host { display: block; }
22
22
  .count-header {
23
23
  padding: 8px 14px;
@@ -72,10 +72,10 @@
72
72
  color: var(--accent); background: var(--accent-tint); border-radius: 4px; padding: 0 4px;
73
73
  }
74
74
  .empty { padding: 24px; opacity: 0.6; font-size: 13px; }
75
- `}render(){return!this.results||this.results.length===0?h`<div class="empty">No results.</div>`:h`
75
+ `}render(){return!this.results||this.results.length===0?c`<div class="empty">No results.</div>`:c`
76
76
  <div class="count-header">${this.results.length} result${this.results.length===1?"":"s"}</div>
77
- ${us(this.results).map(e=>h`
78
- ${e.key?h`<div class="key-group-header">
77
+ ${bs(this.results).map(e=>c`
78
+ ${e.key?c`<div class="key-group-header">
79
79
  🔑
80
80
  <button
81
81
  class="key-group-link"
@@ -88,7 +88,7 @@
88
88
  </div>`:""}
89
89
  ${e.items.map(t=>this.#e(t))}
90
90
  `)}
91
- `}#e(e){const t=e._table==="skills"&&e.folder==="builtin";return h`
91
+ `}#e(e){const t=e._table==="skills"&&e.folder==="builtin";return c`
92
92
  <div class="row ${e.deprecated?"deprecated":""} ${e.paused?"paused":""}" @click=${()=>this.onSelect(e)}>
93
93
  <input
94
94
  type="checkbox"
@@ -101,64 +101,64 @@
101
101
  <div class="row-body">
102
102
  <div class="top">
103
103
  <span class="name">${e.name}</span>
104
- <span class="meta">${ps(e.created_at)} · ${e.owner??"—"} · ${e.status}</span>
104
+ <span class="meta">${gs(e.created_at)} · ${e.owner??"—"} · ${e.status}</span>
105
105
  </div>
106
106
  <div class="desc">${e.description}</div>
107
107
  <div class="tags">
108
108
  <span class="type-badge">${e._table==="skills"?"skill":"memory"}</span>
109
- ${this.showFolder&&e.folder?h`<span class="folder-badge">📁 ${e.folder}</span>`:""}
110
- ${e.deprecated?h`<span class="deprecated-badge">deprecated</span>`:""}
111
- ${e.paused?h`<span class="paused-badge">paused</span>`:""}
112
- ${e.tags.map(s=>h`<span class="tag">${s}</span>`)}
109
+ ${this.showFolder&&e.folder?c`<span class="folder-badge">📁 ${e.folder}</span>`:""}
110
+ ${e.deprecated?c`<span class="deprecated-badge">deprecated</span>`:""}
111
+ ${e.paused?c`<span class="paused-badge">paused</span>`:""}
112
+ ${e.tags.map(s=>c`<span class="tag">${s}</span>`)}
113
113
  </div>
114
114
  </div>
115
115
  </div>
116
- `}}customElements.define("result-list",fs);function Te(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var M=Te();function kt(r){M=r}var P={exec:()=>null};function F(r){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),i=e[s];return i||(i=r(s),e[s]=i),i}}function g(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(i,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(k.caret,"$1"),t=t.replace(i,o),s},getRegex:()=>new RegExp(t,e)};return s}var gs=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),k={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:F(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:F(r=>new RegExp(`^ {0,${r}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:F(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:F(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:F(r=>new RegExp(`^ {0,${r}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:F(r=>new RegExp(`^ {0,${r}}>`))},bs=/^(?:[ \t]*(?:\n|$))+/,ms=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,J=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ee=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,yt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,$t=g(yt).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ks=g(yt).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Re=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ys=/^[^\n]+/,Pe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$s=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Pe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ws=g(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ee).getRegex(),ce="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ze=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_s=g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ze).replace("tag",ce).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wt=r=>g(Re).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",r).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),Ss=wt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Cs=wt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),As=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Cs).getRegex(),Le={blockquote:As,code:ms,def:$s,fences:xs,heading:vs,hr:J,html:_s,lheading:$t,list:ws,newline:bs,paragraph:Ss,table:P,text:ys},Je=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),Ts={...Le,lheading:ks,table:Je,paragraph:g(Re).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex()},Es={...Le,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ze).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(Re).replace("hr",J).replace("heading",` *#{1,6} *[^
117
- ]`).replace("lheading",$t).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Rs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ps=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_t=/^( {2,}|\\)\n(?!\s*$)/,zs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,A=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,G=/[^\s\p{P}\p{S}]/u,Ls=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),Is=/[\p{Pi}\p{Ps}"']/u,St=/(?!~)[\p{P}\p{S}]/u,Ds=/(?!~)[\s\p{P}\p{S}]/u,Os=/(?:[^\s\p{P}\p{S}]|~)/u,Ms=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",gs?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ct=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Fs=g(Ct,"u").replace(/punct/g,A).getRegex(),Ns=g(Ct,"u").replace(/punct/g,St).getRegex(),qs=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Us=g(qs,"u").replace(/openQuote/g,Is).replace(/punct/g,A).getRegex(),At="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",js=g(At,"gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Hs=g(At,"gu").replace(/notPunctSpace/g,Os).replace(/punctSpace/g,Ds).replace(/punct/g,St).getRegex(),Bs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Ks=g(Bs,"gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Zs=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Ws="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Qs=g(Ws,"gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Vs=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,A).getRegex(),Ys="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Js=g(Ys,"gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Gs=g(/\\(punct)/,"gu").replace(/punct/g,A).getRegex(),Xs=g(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ei=g(ze).replace("(?:-->|$)","-->").getRegex(),ti=g("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ei).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),se=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,si=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",se).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Tt=g(/^!?\[(label)\]\[(ref)\]/).replace("label",se).replace("ref",Pe).getRegex(),Et=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",Pe).getRegex(),ii=g("reflink|nolink(?!\\()","g").replace("reflink",Tt).replace("nolink",Et).getRegex(),Ge=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ie={_backpedal:P,anyPunctuation:Gs,autolink:Xs,blockSkip:Ms,br:_t,code:Ps,del:P,delLDelim:P,delRDelim:P,emStrongLDelim:Fs,emStrongRDelimAst:js,emStrongRDelimUnd:Zs,escape:Rs,link:si,nolink:Et,punctuation:Ls,reflink:Tt,reflinkSearch:ii,tag:ti,text:zs,url:P},ri={...Ie,emStrongLDelim:Us,emStrongRDelimAst:Ks,emStrongRDelimUnd:Qs,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",se).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se).getRegex()},me={...Ie,emStrongRDelimAst:Hs,emStrongLDelim:Ns,delLDelim:Vs,delRDelim:Js,url:g(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ge).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:g(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ge).getRegex()},ni={...me,br:g(_t).replace("{2,}","*").getRegex(),text:g(me.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:Le,gfm:Ts,pedantic:Es},K={normal:Ie,gfm:me,breaks:ni,pedantic:ri},oi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xe=r=>oi[r];function C(r,e){if(e){if(k.escapeTest.test(r))return r.replace(k.escapeReplace,Xe)}else if(k.escapeTestNoEncode.test(r))return r.replace(k.escapeReplaceNoEncode,Xe);return r}function et(r){try{r=encodeURI(r).replace(k.percentDecode,"%")}catch{return null}return r}function tt(r,e){let t=r.replace(k.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=t.split(k.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(k.slashPipe,"|");return s}function T(r,e,t){let s=r.length;if(s===0)return"";let i=0;for(;i<s&&r.charAt(s-i-1)===e;)i++;return r.slice(0,s-i)}function st(r){let e=r.split(`
118
- `),t=e.length-1;for(;t>=0&&k.blankLine.test(e[t]);)t--;return e.length-t<=2?r:e.slice(0,t+1).join(`
119
- `)}function ai(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function li(r,e=0){let t=e,s="";for(let i of r)if(i===" "){let n=4-t%4;s+=" ".repeat(n),t+=n}else s+=i,t++;return s}function it(r,e,t,s,i){let n=e.href,o=e.title||null,a=r[1].replace(i.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:n,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function ci(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
116
+ `}}customElements.define("result-list",ms);function Te(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var M=Te();function $t(r){M=r}var P={exec:()=>null};function N(r){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),i=e[s];return i||(i=r(s),e[s]=i),i}}function g(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(i,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(y.caret,"$1"),t=t.replace(i,o),s},getRegex:()=>new RegExp(t,e)};return s}var xs=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),y={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:N(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:N(r=>new RegExp(`^ {0,${r}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:N(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:N(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:N(r=>new RegExp(`^ {0,${r}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:N(r=>new RegExp(`^ {0,${r}}>`))},vs=/^(?:[ \t]*(?:\n|$))+/,ys=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ks=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,J=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$s=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ee=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,wt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_t=g(wt).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ws=g(wt).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Re=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,_s=/^[^\n]+/,ze=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ss=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ze).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Cs=g(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ee).getRegex(),he="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Pe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,As=g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Pe).replace("tag",he).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),St=r=>g(Re).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",r).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex(),Ts=St(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Es=St(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Rs=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Es).getRegex(),Le={blockquote:Rs,code:ys,def:Ss,fences:ks,heading:$s,hr:J,html:As,lheading:_t,list:Cs,newline:vs,paragraph:Ts,table:P,text:_s},Je=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex(),zs={...Le,lheading:ws,table:Je,paragraph:g(Re).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex()},Ps={...Le,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Pe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(Re).replace("hr",J).replace("heading",` *#{1,6} *[^
117
+ ]`).replace("lheading",_t).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ls=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Is=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ct=/^( {2,}|\\)\n(?!\s*$)/,Ds=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,A=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,G=/[^\s\p{P}\p{S}]/u,Os=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),Ms=/[\p{Pi}\p{Ps}"']/u,At=/(?!~)[\p{P}\p{S}]/u,Ns=/(?!~)[\s\p{P}\p{S}]/u,Fs=/(?:[^\s\p{P}\p{S}]|~)/u,qs=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",xs?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Tt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Us=g(Tt,"u").replace(/punct/g,A).getRegex(),js=g(Tt,"u").replace(/punct/g,At).getRegex(),Hs=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Bs=g(Hs,"u").replace(/openQuote/g,Ms).replace(/punct/g,A).getRegex(),Et="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ks=g(Et,"gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Zs=g(Et,"gu").replace(/notPunctSpace/g,Fs).replace(/punctSpace/g,Ns).replace(/punct/g,At).getRegex(),Ws="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Vs=g(Ws,"gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Qs=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Ys="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Js=g(Ys,"gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Gs=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,A).getRegex(),Xs="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ei=g(Xs,"gu").replace(/notPunctSpace/g,G).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),ti=g(/\\(punct)/,"gu").replace(/punct/g,A).getRegex(),si=g(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ii=g(Pe).replace("(?:-->|$)","-->").getRegex(),ri=g("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ii).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ie=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ni=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ie).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rt=g(/^!?\[(label)\]\[(ref)\]/).replace("label",ie).replace("ref",ze).getRegex(),zt=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",ze).getRegex(),oi=g("reflink|nolink(?!\\()","g").replace("reflink",Rt).replace("nolink",zt).getRegex(),Ge=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ie={_backpedal:P,anyPunctuation:ti,autolink:si,blockSkip:qs,br:Ct,code:Is,del:P,delLDelim:P,delRDelim:P,emStrongLDelim:Us,emStrongRDelimAst:Ks,emStrongRDelimUnd:Qs,escape:Ls,link:ni,nolink:zt,punctuation:Os,reflink:Rt,reflinkSearch:oi,tag:ri,text:Ds,url:P},ai={...Ie,emStrongLDelim:Bs,emStrongRDelimAst:Vs,emStrongRDelimUnd:Js,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",ie).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ie).getRegex()},xe={...Ie,emStrongRDelimAst:Zs,emStrongLDelim:js,delLDelim:Gs,delRDelim:ei,url:g(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ge).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:g(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ge).getRegex()},li={...xe,br:g(Ct).replace("{2,}","*").getRegex(),text:g(xe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:Le,gfm:zs,pedantic:Ps},K={normal:Ie,gfm:xe,breaks:li,pedantic:ai},ci={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xe=r=>ci[r];function C(r,e){if(e){if(y.escapeTest.test(r))return r.replace(y.escapeReplace,Xe)}else if(y.escapeTestNoEncode.test(r))return r.replace(y.escapeReplaceNoEncode,Xe);return r}function et(r){try{r=encodeURI(r).replace(y.percentDecode,"%")}catch{return null}return r}function tt(r,e){let t=r.replace(y.findPipe,(n,o,a)=>{let l=!1,h=o;for(;--h>=0&&a[h]==="\\";)l=!l;return l?"|":" |"}),s=t.split(y.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(y.slashPipe,"|");return s}function T(r,e,t){let s=r.length;if(s===0)return"";let i=0;for(;i<s&&r.charAt(s-i-1)===e;)i++;return r.slice(0,s-i)}function st(r){let e=r.split(`
118
+ `),t=e.length-1;for(;t>=0&&y.blankLine.test(e[t]);)t--;return e.length-t<=2?r:e.slice(0,t+1).join(`
119
+ `)}function hi(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function di(r,e=0){let t=e,s="";for(let i of r)if(i===" "){let n=4-t%4;s+=" ".repeat(n),t+=n}else s+=i,t++;return s}function it(r,e,t,s,i){let n=e.href,o=e.title||null,a=r[1].replace(i.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:n,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function pi(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
120
120
  `).map(n=>{let o=n.match(t.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=i.length?n.slice(i.length):n}).join(`
121
- `)}var ie=class{options;rules;lexer;constructor(r){this.options=r||M}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=this.options.pedantic?e[0]:st(e[0]),s=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:s}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=ci(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=T(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:T(e[0],`
121
+ `)}var re=class{options;rules;lexer;constructor(r){this.options=r||M}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=this.options.pedantic?e[0]:st(e[0]),s=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:s}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=pi(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=T(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:T(e[0],`
122
122
  `),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:T(e[0],`
123
123
  `)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=T(e[0],`
124
124
  `).split(`
125
- `),s="",i="",n=[];for(;t.length>0;){let o=!1,a=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))a.push(t[l]),o=!0;else if(!o)a.push(t[l]);else break;t=t.slice(l);let c=a.join(`
126
- `),p=c.replace(this.rules.other.blockquoteSetextReplace,`
125
+ `),s="",i="",n=[];for(;t.length>0;){let o=!1,a=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))a.push(t[l]),o=!0;else if(!o)a.push(t[l]);else break;t=t.slice(l);let h=a.join(`
126
+ `),p=h.replace(this.rules.other.blockquoteSetextReplace,`
127
127
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
128
- ${c}`:c,i=i?`${i}
128
+ ${h}`:h,i=i?`${i}
129
129
  ${p}`:p;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,n,!0),this.lexer.state.top=d,t.length===0)break;let f=n.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let v=f,b=t.join(`
130
130
  `),S=v.raw+`
131
131
  `+b.replace(this.rules.other.blockquoteSetextReplace2,""),j=this.blockquote(S);n[n.length-1]=j,s=`${s}
132
132
  ${b}`,i=i.substring(0,i.length-v.text.length)+j.text;break}else if(f?.type==="list"){let v=f,b=v.raw+`
133
133
  `+t.join(`
134
134
  `),S=this.list(b);n[n.length-1]=S,s=s.substring(0,s.length-f.raw.length)+S.raw,i=i.substring(0,i.length-v.raw.length)+S.raw,t=b.substring(n.at(-1).raw.length).split(`
135
- `);continue}}return{type:"blockquote",raw:s,tokens:n,text:i}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,i={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let n=this.rules.other.listItemRegex(t),o=!1;for(;r;){let l=!1,c="",p="";if(!(e=n.exec(r))||this.rules.block.hr.test(r))break;c=e[0],r=r.substring(c.length);let d=li(e[2].split(`
135
+ `);continue}}return{type:"blockquote",raw:s,tokens:n,text:i}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,i={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let n=this.rules.other.listItemRegex(t),o=!1;for(;r;){let l=!1,h="",p="";if(!(e=n.exec(r))||this.rules.block.hr.test(r))break;h=e[0],r=r.substring(h.length);let d=di(e[2].split(`
136
136
  `,1)[0],e[1].length),f=r.split(`
137
- `,1)[0],v=!d.trim(),b=0;if(this.options.pedantic?(b=2,p=d.trimStart()):v?b=e[1].length+1:(b=d.search(this.rules.other.nonSpaceChar),b=b>4?1:b,p=d.slice(b),b+=e[1].length),v&&this.rules.other.blankLine.test(f)&&(c+=f+`
138
- `,r=r.substring(f.length+1),l=!0),!l){let S=this.rules.other.nextBulletRegex(b),j=this.rules.other.hrRegex(b),Oe=this.rules.other.fencesBeginRegex(b),Me=this.rules.other.headingBeginRegex(b),It=this.rules.other.htmlBeginRegex(b),Dt=this.rules.other.blockquoteBeginRegex(b);for(;r;){let he=r.split(`
139
- `,1)[0],H;if(f=he,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),H=f):H=f.replace(this.rules.other.tabCharGlobal," "),Oe.test(f)||Me.test(f)||It.test(f)||Dt.test(f)||S.test(f)||j.test(f))break;if(H.search(this.rules.other.nonSpaceChar)>=b||!f.trim())p+=`
137
+ `,1)[0],v=!d.trim(),b=0;if(this.options.pedantic?(b=2,p=d.trimStart()):v?b=e[1].length+1:(b=d.search(this.rules.other.nonSpaceChar),b=b>4?1:b,p=d.slice(b),b+=e[1].length),v&&this.rules.other.blankLine.test(f)&&(h+=f+`
138
+ `,r=r.substring(f.length+1),l=!0),!l){let S=this.rules.other.nextBulletRegex(b),j=this.rules.other.hrRegex(b),Oe=this.rules.other.fencesBeginRegex(b),Me=this.rules.other.headingBeginRegex(b),Mt=this.rules.other.htmlBeginRegex(b),Nt=this.rules.other.blockquoteBeginRegex(b);for(;r;){let de=r.split(`
139
+ `,1)[0],H;if(f=de,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),H=f):H=f.replace(this.rules.other.tabCharGlobal," "),Oe.test(f)||Me.test(f)||Mt.test(f)||Nt.test(f)||S.test(f)||j.test(f))break;if(H.search(this.rules.other.nonSpaceChar)>=b||!f.trim())p+=`
140
140
  `+H.slice(b);else{if(v||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Oe.test(d)||Me.test(d)||j.test(d))break;p+=`
141
- `+f}v=!f.trim(),c+=he+`
142
- `,r=r.substring(he.length+1),d=H.slice(b)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=c}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=p}for(let l of i.items){let c=l.tokens[0];if(l.task&&(c?.type==="text"||c?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(r){let e=this.rules.block.html.exec(r);if(e){let t=st(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:T(e[0],`
141
+ `+f}v=!f.trim(),h+=de+`
142
+ `,r=r.substring(de.length+1),d=H.slice(b)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0)),i.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=h}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let h=l.tokens.filter(d=>d.type==="space"),p=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=p}for(let l of i.items){let h=l.tokens[0];if(l.task&&(h?.type==="text"||h?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return i}}html(r){let e=this.rules.block.html.exec(r);if(e){let t=st(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:T(e[0],`
143
143
  `),href:s,title:i}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=tt(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
144
144
  `):[],n={type:"table",raw:T(e[0],`
145
145
  `),header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<t.length;o++)n.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:n.align[o]});for(let o of i)n.rows.push(tt(o,n.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:n.align[l]})));return n}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e){let t=e[1].trim();return{type:"heading",raw:T(e[0],`
146
146
  `),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
147
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let n=T(t.slice(0,-1),"\\");if((t.length-n.length)%2===0)return}else{let n=ai(e[2],"()");if(n===-2)return;if(n>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],i="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(s);n&&(s=n[1],i=n[3])}else i=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),it(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[s.toLowerCase()];if(!i){let n=t[0].charAt(0);return{type:"text",raw:n,text:n}}return it(t,i,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let i=[...s[0]].length-1,n,o,a=i,l=0,c=s[0][0],p=t===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*r.length+i);(s=d.exec(e))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n)continue;if(o=[...n].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let f=[...s[0]][0].length,v=r.slice(0,i+s.index+f+o);if(Math.min(i,o)%2){let S=v.slice(1,-1);return{type:"em",raw:v,text:S,tokens:this.lexer.inlineTokens(S)}}let b=v.slice(2,-2);return{type:"strong",raw:v,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,t=""){let s=this.rules.inline.delLDelim.exec(r);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let i=[...s[0]].length-1,n,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*r.length+i);(s=l.exec(e))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n||(o=[...n].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...s[0]][0].length,p=r.slice(0,i+s.index+c+o),d=p.slice(i,-i);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},$=class xe{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||M,this.options.tokenizer=this.options.tokenizer||new ie,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:k,block:X.normal,inline:K.normal};this.options.pedantic?(t.block=X.pedantic,t.inline=K.pedantic):this.options.gfm&&(t.block=X.gfm,this.options.breaks?t.inline=K.breaks:t.inline=K.gfm),this.tokenizer.rules=t}static get rules(){return{block:X,inline:K}}static lex(e,t){return new xe(t).lex(e)}static lexInline(e,t){return new xe(t).inlineTokens(e)}lex(e){e=e.replace(k.carriageReturn,`
148
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(k.tabCharGlobal," ").replace(k.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let n;if(this.options.extensions?.block?.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let a=t.at(-1);n.raw.length===1&&a!==void 0?a.raw+=`
147
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let n=T(t.slice(0,-1),"\\");if((t.length-n.length)%2===0)return}else{let n=hi(e[2],"()");if(n===-2)return;if(n>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],i="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(s);n&&(s=n[1],i=n[3])}else i=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),it(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[s.toLowerCase()];if(!i){let n=t[0].charAt(0);return{type:"text",raw:n,text:n}}return it(t,i,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let i=[...s[0]].length-1,n,o,a=i,l=0,h=s[0][0],p=t===h,d=h==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*r.length+i);(s=d.exec(e))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n)continue;if(o=[...n].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let f=[...s[0]][0].length,v=r.slice(0,i+s.index+f+o);if(Math.min(i,o)%2){let S=v.slice(1,-1);return{type:"em",raw:v,text:S,tokens:this.lexer.inlineTokens(S)}}let b=v.slice(2,-2);return{type:"strong",raw:v,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,t=""){let s=this.rules.inline.delLDelim.exec(r);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let i=[...s[0]].length-1,n,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*r.length+i);(s=l.exec(e))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n||(o=[...n].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let h=[...s[0]][0].length,p=r.slice(0,i+s.index+h+o),d=p.slice(i,-i);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},w=class ve{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||M,this.options.tokenizer=this.options.tokenizer||new re,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:y,block:X.normal,inline:K.normal};this.options.pedantic?(t.block=X.pedantic,t.inline=K.pedantic):this.options.gfm&&(t.block=X.gfm,this.options.breaks?t.inline=K.breaks:t.inline=K.gfm),this.tokenizer.rules=t}static get rules(){return{block:X,inline:K}}static lex(e,t){return new ve(t).lex(e)}static lexInline(e,t){return new ve(t).inlineTokens(e)}lex(e){e=e.replace(y.carriageReturn,`
148
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(y.tabCharGlobal," ").replace(y.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let n;if(this.options.extensions?.block?.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let a=t.at(-1);n.raw.length===1&&a!==void 0?a.raw+=`
149
149
  `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
150
150
  `)?"":`
151
151
  `)+n.raw,a.text+=`
152
152
  `+n.text,this.inlineQueue.at(-1).src=a.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
153
153
  `)?"":`
154
154
  `)+n.raw,a.text+=`
155
- `+n.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),c;this.options.extensions.startBlock.forEach(p=>{c=p.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){let a=t.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
155
+ `+n.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),h;this.options.extensions.startBlock.forEach(p=>{h=p.call({lexer:this},l),typeof h=="number"&&h>=0&&(a=Math.min(a,h))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){let a=t.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
156
156
  `)?"":`
157
157
  `)+n.raw,a.text+=`
158
158
  `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
159
159
  `)?"":`
160
160
  `)+n.raw,a.text+=`
161
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(n);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e;if(this.tokens.links){let a=Object.keys(this.tokens.links);a.length>0&&(s=s.replace(this.tokenizer.rules.inline.reflinkSearch,l=>a.includes(l.slice(l.lastIndexOf("[")+1,-1))?"["+"a".repeat(l.length-2)+"]":l))}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,n="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(n=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,n)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e,s,n)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(n=a.raw.slice(-1)),i=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},re=class{options;parser;constructor(r){this.options=r||M}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(k.notSpaceStart)?.[0],i=r.replace(k.endingNewline,"")+`
161
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(n);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e;if(this.tokens.links){let a=Object.keys(this.tokens.links);a.length>0&&(s=s.replace(this.tokenizer.rules.inline.reflinkSearch,l=>a.includes(l.slice(l.lastIndexOf("[")+1,-1))?"["+"a".repeat(l.length-2)+"]":l))}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,h)=>{let p=h?h.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,n="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(n=""),i=!1;let a;if(this.options.extensions?.inline?.some(h=>(a=h.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let h=t.at(-1);a.type==="text"&&h?.type==="text"?(h.raw+=a.raw,h.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,n)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e,s,n)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let h=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},p),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(l=e.substring(0,h+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(n=a.raw.slice(-1)),i=!0;let h=t.at(-1);h?.type==="text"?(h.raw+=a.raw,h.text+=a.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},ne=class{options;parser;constructor(r){this.options=r||M}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(y.notSpaceStart)?.[0],i=r.replace(y.endingNewline,"")+`
162
162
  `;return s?'<pre><code class="language-'+C(s)+'">'+(t?i:C(i,!0))+`</code></pre>
163
163
  `:"<pre><code>"+(t?i:C(i,!0))+`</code></pre>
164
164
  `}blockquote({tokens:r}){return`<blockquote>
@@ -176,16 +176,16 @@ ${this.parser.parse(r)}</blockquote>
176
176
  `}tablerow({text:r}){return`<tr>
177
177
  ${r}</tr>
178
178
  `}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
179
- `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${C(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),i=et(r);if(i===null)return s;r=i;let n='<a href="'+r+'"';return e&&(n+=' title="'+C(e)+'"'),n+=">"+s+"</a>",n}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let i=et(r);if(i===null)return C(t);r=i;let n=`<img src="${r}" alt="${C(t)}"`;return e&&(n+=` title="${C(e)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:C(r.text)}},De=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},w=class ve{options;renderer;textRenderer;constructor(e){this.options=e||M,this.options.renderer=this.options.renderer||new re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new De}static parse(e,t){return new ve(t).parse(e)}static parseInline(e,t){return new ve(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){t+=a||"";continue}}let n=i;switch(n.type){case"space":{t+=this.renderer.space(n);break}case"hr":{t+=this.renderer.hr(n);break}case"heading":{t+=this.renderer.heading(n);break}case"code":{t+=this.renderer.code(n);break}case"table":{t+=this.renderer.table(n);break}case"blockquote":{t+=this.renderer.blockquote(n);break}case"list":{t+=this.renderer.list(n);break}case"checkbox":{t+=this.renderer.checkbox(n);break}case"html":{t+=this.renderer.html(n);break}case"def":{t+=this.renderer.def(n);break}case"paragraph":{t+=this.renderer.paragraph(n);break}case"text":{t+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let n=e[i];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(n.type)){s+=a||"";continue}}let o=n;switch(o.type){case"escape":{s+=t.text(o);break}case"html":{s+=t.html(o);break}case"link":{s+=t.link(o);break}case"image":{s+=t.image(o);break}case"checkbox":{s+=t.checkbox(o);break}case"strong":{s+=t.strong(o);break}case"em":{s+=t.em(o);break}case"codespan":{s+=t.codespan(o);break}case"br":{s+=t.br(o);break}case"del":{s+=t.del(o);break}case"text":{s+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},Z=class{options;block;constructor(r){this.options=r||M}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?$.lex:$.lexInline}provideParser(r=this.block){return r?w.parse:w.parseInline}},hi=class{defaults=Te();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=w;Renderer=re;TextRenderer=De;Lexer=$;Tokenizer=ie;Hooks=Z;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let n of i.header)t=t.concat(this.walkTokens(n.tokens,e));for(let n of i.rows)for(let o of n)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;t=t.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let o=i[n].flat(1/0);t=t.concat(this.walkTokens(o,e))}):i.tokens&&(t=t.concat(this.walkTokens(i.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let n=e.renderers[i.name];n?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=e[i.level];n?n.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),t.renderer){let i=this.defaults.renderer||new re(this.defaults);for(let n in t.renderer){if(!(n in i))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=t.renderer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p||""}}s.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new ie(this.defaults);for(let n in t.tokenizer){if(!(n in i))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=t.tokenizer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new Z;for(let n in t.hooks){if(!(n in i))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=t.hooks[o],l=i[o];Z.passThroughHooks.has(n)?i[o]=c=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(n))return(async()=>{let d=await a.call(i,c);return l.call(i,d)})();let p=a.call(i,c);return l.call(i,p)}:i[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,c);return d===!1&&(d=await l.apply(i,c)),d})();let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,n=t.walkTokens;s.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return $.lex(r,e??this.defaults)}parser(r,e){return w.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},i={...this.defaults,...s},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=r),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(r):r?$.lex:$.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(r):r?w.parse:w.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(n);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(r):r?$.lex:$.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(r):r?w.parse:w.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(r,e){return t=>{if(t.message+=`
180
- Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+C(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},D=new hi;function x(r,e){return D.parse(r,e)}x.options=x.setOptions=function(r){return D.setOptions(r),x.defaults=D.defaults,kt(x.defaults),x};x.getDefaults=Te;x.defaults=M;function di(...r){return D.use(...r),x.defaults=D.defaults,kt(x.defaults),x}x.use=di;x.walkTokens=function(r,e){return D.walkTokens(r,e)};x.parseInline=D.parseInline;x.Parser=w;x.parser=w.parse;x.Renderer=re;x.TextRenderer=De;x.Lexer=$;x.lexer=$.lex;x.Tokenizer=ie;x.Hooks=Z;x.parse=x;x.options;x.setOptions;x.walkTokens;x.parseInline;w.parse;$.lex;/**
179
+ `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${C(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),i=et(r);if(i===null)return s;r=i;let n='<a href="'+r+'"';return e&&(n+=' title="'+C(e)+'"'),n+=">"+s+"</a>",n}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let i=et(r);if(i===null)return C(t);r=i;let n=`<img src="${r}" alt="${C(t)}"`;return e&&(n+=` title="${C(e)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:C(r.text)}},De=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},_=class ye{options;renderer;textRenderer;constructor(e){this.options=e||M,this.options.renderer=this.options.renderer||new ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new De}static parse(e,t){return new ye(t).parse(e)}static parseInline(e,t){return new ye(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){t+=a||"";continue}}let n=i;switch(n.type){case"space":{t+=this.renderer.space(n);break}case"hr":{t+=this.renderer.hr(n);break}case"heading":{t+=this.renderer.heading(n);break}case"code":{t+=this.renderer.code(n);break}case"table":{t+=this.renderer.table(n);break}case"blockquote":{t+=this.renderer.blockquote(n);break}case"list":{t+=this.renderer.list(n);break}case"checkbox":{t+=this.renderer.checkbox(n);break}case"html":{t+=this.renderer.html(n);break}case"def":{t+=this.renderer.def(n);break}case"paragraph":{t+=this.renderer.paragraph(n);break}case"text":{t+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let n=e[i];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(n.type)){s+=a||"";continue}}let o=n;switch(o.type){case"escape":{s+=t.text(o);break}case"html":{s+=t.html(o);break}case"link":{s+=t.link(o);break}case"image":{s+=t.image(o);break}case"checkbox":{s+=t.checkbox(o);break}case"strong":{s+=t.strong(o);break}case"em":{s+=t.em(o);break}case"codespan":{s+=t.codespan(o);break}case"br":{s+=t.br(o);break}case"del":{s+=t.del(o);break}case"text":{s+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},Z=class{options;block;constructor(r){this.options=r||M}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?w.lex:w.lexInline}provideParser(r=this.block){return r?_.parse:_.parseInline}},ui=class{defaults=Te();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=_;Renderer=ne;TextRenderer=De;Lexer=w;Tokenizer=re;Hooks=Z;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let n of i.header)t=t.concat(this.walkTokens(n.tokens,e));for(let n of i.rows)for(let o of n)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;t=t.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let o=i[n].flat(1/0);t=t.concat(this.walkTokens(o,e))}):i.tokens&&(t=t.concat(this.walkTokens(i.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let n=e.renderers[i.name];n?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=e[i.level];n?n.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),t.renderer){let i=this.defaults.renderer||new ne(this.defaults);for(let n in t.renderer){if(!(n in i))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=t.renderer[o],l=i[o];i[o]=(...h)=>{let p=a.apply(i,h);return p===!1&&(p=l.apply(i,h)),p||""}}s.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new re(this.defaults);for(let n in t.tokenizer){if(!(n in i))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=t.tokenizer[o],l=i[o];i[o]=(...h)=>{let p=a.apply(i,h);return p===!1&&(p=l.apply(i,h)),p}}s.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new Z;for(let n in t.hooks){if(!(n in i))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=t.hooks[o],l=i[o];Z.passThroughHooks.has(n)?i[o]=h=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(n))return(async()=>{let d=await a.call(i,h);return l.call(i,d)})();let p=a.call(i,h);return l.call(i,p)}:i[o]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,h);return d===!1&&(d=await l.apply(i,h)),d})();let p=a.apply(i,h);return p===!1&&(p=l.apply(i,h)),p}}s.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,n=t.walkTokens;s.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return w.lex(r,e??this.defaults)}parser(r,e){return _.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},i={...this.defaults,...s},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=r),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(r):r?w.lex:w.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let h=await(i.hooks?await i.hooks.provideParser(r):r?_.parse:_.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(h):h})().catch(n);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(r):r?w.lex:w.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(r):r?_.parse:_.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(r,e){return t=>{if(t.message+=`
180
+ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+C(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},O=new ui;function x(r,e){return O.parse(r,e)}x.options=x.setOptions=function(r){return O.setOptions(r),x.defaults=O.defaults,$t(x.defaults),x};x.getDefaults=Te;x.defaults=M;function fi(...r){return O.use(...r),x.defaults=O.defaults,$t(x.defaults),x}x.use=fi;x.walkTokens=function(r,e){return O.walkTokens(r,e)};x.parseInline=O.parseInline;x.Parser=_;x.parser=_.parse;x.Renderer=ne;x.TextRenderer=De;x.Lexer=w;x.lexer=w.lex;x.Tokenizer=re;x.Hooks=Z;x.parse=x;x.options;x.setOptions;x.walkTokens;x.parseInline;_.parse;w.lex;/**
181
181
  * @license
182
182
  * Copyright 2017 Google LLC
183
183
  * SPDX-License-Identifier: BSD-3-Clause
184
- */const pi={CHILD:2},ui=r=>(...e)=>({_$litDirective$:r,values:e});class fi{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
184
+ */const gi={CHILD:2},bi=r=>(...e)=>({_$litDirective$:r,values:e});class mi{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
185
185
  * @license
186
186
  * Copyright 2017 Google LLC
187
187
  * SPDX-License-Identifier: BSD-3-Clause
188
- */class ke extends fi{constructor(e){if(super(e),this.it=m,e.type!==pi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===m||e==null)return this._t=void 0,this.it=e;if(e===I)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}ke.directiveName="unsafeHTML",ke.resultType=1;const gi=ui(ke);let rt=0;class bi extends _{static{this.properties={tags:{attribute:!1},active:{attribute:!1},onToggle:{attribute:!1},allowCreate:{attribute:!1},width:{attribute:!1}}}#e=new u("");#t=new u(!1);#s=new u(-1);#n;#r;static{this.styles=O`
188
+ */class ke extends mi{constructor(e){if(super(e),this.it=m,e.type!==gi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===m||e==null)return this._t=void 0,this.it=e;if(e===D)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}ke.directiveName="unsafeHTML",ke.resultType=1;const xi=bi(ke);let rt=0;class vi extends ${static{this.properties={tags:{attribute:!1},active:{attribute:!1},onToggle:{attribute:!1},allowCreate:{attribute:!1},width:{attribute:!1}}}#e=new u("");#t=new u(!1);#s=new u(-1);#n;#r;static{this.styles=R`
189
189
  :host {
190
190
  display: inline-block;
191
191
  position: relative;
@@ -299,10 +299,10 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
299
299
  .option input { margin: 0; pointer-events: none; }
300
300
  .empty { padding: 6px 8px; opacity: 0.6; font-style: italic; font-size: 12px; }
301
301
  .create-option { color: var(--accent); font-style: italic; }
302
- `}constructor(){super(),new le(this),this.tags=[],this.active=[],this.onToggle=()=>{},this.allowCreate=!1,this.#n=`--tag-multiselect-${++rt}`,this.#r=`tag-multiselect-listbox-${rt}`}willUpdate(){this.style.width=this.width??""}#g=e=>{e.composedPath().includes(this)||this.#c()};connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#g)}disconnectedCallback(){document.removeEventListener("click",this.#g),super.disconnectedCallback()}get#l(){const e=this.#e.value.trim().toLowerCase();return e?this.tags.filter(t=>t.toLowerCase().includes(e)):this.tags}#i(){this.#t.set(!0),this.updateComplete.then(()=>{this.renderRoot.querySelector(".menu")?.showPopover()})}#c(){this.#t.set(!1),this.#s.set(-1),this.renderRoot.querySelector(".menu")?.hidePopover()}#u(){this.#t.value?this.#c():(this.#i(),this.renderRoot.querySelector(".input")?.focus())}#h(e){this.#e.set(e.target.value),this.#s.set(-1),this.#i()}#d(e){this.onToggle(e),this.#e.set(""),this.#s.set(-1)}get#o(){if(!this.allowCreate)return!1;const e=this.#e.value.trim();return e.length>0&&!this.tags.includes(e)&&!this.active.includes(e)}#f(e){e.stopPropagation(),this.active.forEach(t=>this.onToggle(t)),this.#e.set(""),this.renderRoot.querySelector(".input")?.focus(),this.#i()}#b(e){const t=this.#l;if(e.key==="ArrowDown")e.preventDefault(),this.#i(),t.length&&this.#s.set((this.#s.value+1)%t.length);else if(e.key==="ArrowUp")e.preventDefault(),this.#i(),t.length&&this.#s.set((this.#s.value-1+t.length)%t.length);else if(e.key==="Enter"||this.allowCreate&&e.key===","){const s=t[this.#s.value];s!==void 0?(e.preventDefault(),this.#d(s)):this.#o&&(e.preventDefault(),this.#d(this.#e.value.trim()))}else if(e.key==="Backspace"&&!this.#e.value&&this.active.length>0){const s=this.active[this.active.length-1];s!==void 0&&this.onToggle(s)}else e.key==="Escape"&&this.#c()}render(){const e=this.active,t=this.#l,s=this.#t.value,i=this.#s.value;return h`
302
+ `}constructor(){super(),new ce(this),this.tags=[],this.active=[],this.onToggle=()=>{},this.allowCreate=!1,this.#n=`--tag-multiselect-${++rt}`,this.#r=`tag-multiselect-listbox-${rt}`}willUpdate(){this.style.width=this.width??""}#g=e=>{e.composedPath().includes(this)||this.#l()};connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#g)}disconnectedCallback(){document.removeEventListener("click",this.#g),super.disconnectedCallback()}get#a(){const e=this.#e.value.trim().toLowerCase();return e?this.tags.filter(t=>t.toLowerCase().includes(e)):this.tags}#i(){this.#t.set(!0),this.updateComplete.then(()=>{this.renderRoot.querySelector(".menu")?.showPopover()})}#l(){this.#t.set(!1),this.#s.set(-1),this.renderRoot.querySelector(".menu")?.hidePopover()}#u(){this.#t.value?this.#l():(this.#i(),this.renderRoot.querySelector(".input")?.focus())}#h(e){this.#e.set(e.target.value),this.#s.set(-1),this.#i()}#d(e){this.onToggle(e),this.#e.set(""),this.#s.set(-1)}get#o(){if(!this.allowCreate)return!1;const e=this.#e.value.trim();return e.length>0&&!this.tags.includes(e)&&!this.active.includes(e)}#f(e){e.stopPropagation(),this.active.forEach(t=>this.onToggle(t)),this.#e.set(""),this.renderRoot.querySelector(".input")?.focus(),this.#i()}#b(e){const t=this.#a;if(e.key==="ArrowDown")e.preventDefault(),this.#i(),t.length&&this.#s.set((this.#s.value+1)%t.length);else if(e.key==="ArrowUp")e.preventDefault(),this.#i(),t.length&&this.#s.set((this.#s.value-1+t.length)%t.length);else if(e.key==="Enter"||this.allowCreate&&e.key===","){const s=t[this.#s.value];s!==void 0?(e.preventDefault(),this.#d(s)):this.#o&&(e.preventDefault(),this.#d(this.#e.value.trim()))}else if(e.key==="Backspace"&&!this.#e.value&&this.active.length>0){const s=this.active[this.active.length-1];s!==void 0&&this.onToggle(s)}else e.key==="Escape"&&this.#l()}render(){const e=this.active,t=this.#a,s=this.#t.value,i=this.#s.value;return c`
303
303
  <div class="field" style=${`anchor-name: ${this.#n}`}>
304
304
  <div class="chips-and-input">
305
- ${e.map(n=>h`
305
+ ${e.map(n=>c`
306
306
  <span class="selected-chip">
307
307
  ${n}
308
308
  <span class="remove" @click=${()=>this.onToggle(n)}>✕</span>
@@ -323,7 +323,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
323
323
  @keydown=${n=>this.#b(n)}
324
324
  />
325
325
  </div>
326
- ${e.length>0?h`<button class="clear-btn" tabindex="-1" @mousedown=${n=>n.preventDefault()} @click=${n=>this.#f(n)}>✕</button>`:""}
326
+ ${e.length>0?c`<button class="clear-btn" tabindex="-1" @mousedown=${n=>n.preventDefault()} @click=${n=>this.#f(n)}>✕</button>`:""}
327
327
  <button
328
328
  class="chevron-btn ${s?"open":""}"
329
329
  tabindex="-1"
@@ -342,7 +342,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
342
342
  popover="manual"
343
343
  style=${`position-anchor: ${this.#n}`}
344
344
  >
345
- ${t.length?t.map((n,o)=>h`
345
+ ${t.length?t.map((n,o)=>c`
346
346
  <li
347
347
  id=${`${this.#r}-opt-${o}`}
348
348
  role="option"
@@ -354,7 +354,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
354
354
  <input type="checkbox" .checked=${e.includes(n)} tabindex="-1" />
355
355
  ${n}
356
356
  </li>
357
- `):this.#o?h`
357
+ `):this.#o?c`
358
358
  <li
359
359
  class="option create-option"
360
360
  @mousedown=${n=>n.preventDefault()}
@@ -362,9 +362,9 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
362
362
  >
363
363
  No match. Create '${this.#e.value.trim()}'
364
364
  </li>
365
- `:h`<li class="empty">${this.allowCreate?"Type to create a tag":"No matches"}</li>`}
365
+ `:c`<li class="empty">${this.allowCreate?"Type to create a tag":"No matches"}</li>`}
366
366
  </ul>
367
- `}}customElements.define("tag-multiselect",bi);let nt=0;class mi extends _{static{this.properties={options:{attribute:!1},value:{attribute:!1},onChange:{attribute:!1}}}#e=new u("");#t=new u(!1);#s=new u(-1);#n;#r;static{this.styles=O`
367
+ `}}customElements.define("tag-multiselect",vi);let nt=0;class yi extends ${static{this.properties={options:{attribute:!1},value:{attribute:!1},onChange:{attribute:!1}}}#e=new u("");#t=new u(!1);#s=new u(-1);#n;#r;static{this.styles=R`
368
368
  :host {
369
369
  display: inline-block;
370
370
  position: relative;
@@ -451,7 +451,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
451
451
  .option.selected { font-weight: 600; }
452
452
  .empty { padding: 6px 8px; opacity: 0.6; font-style: italic; font-size: 12px; }
453
453
  .create-option { color: var(--accent); font-style: italic; }
454
- `}constructor(){super(),new le(this),this.options=[],this.value="",this.onChange=()=>{},this.#n=`--status-select-${++nt}`,this.#r=`status-select-listbox-${nt}`}#g=e=>{e.composedPath().includes(this)||this.#c()};connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#g)}disconnectedCallback(){document.removeEventListener("click",this.#g),super.disconnectedCallback()}get#l(){const e=this.#e.value.trim().toLowerCase();return!e||e===this.value.trim().toLowerCase()?this.options:this.options.filter(t=>t.toLowerCase().includes(e))}#i(){this.#e.set(this.value),this.#t.set(!0),this.updateComplete.then(()=>{this.renderRoot.querySelector(".menu")?.showPopover()})}#c(){this.#t.set(!1),this.#s.set(-1),this.#e.set(this.value),this.renderRoot.querySelector(".menu")?.hidePopover()}#u(){this.#t.value?this.#c():(this.#i(),this.renderRoot.querySelector(".input")?.focus())}#h(e){this.#e.set(e.target.value),this.#s.set(-1),this.#t.value||this.#i()}#d(e){return e.trim().toLowerCase().replace(/\s+/g,"-")}#o(e){const t=this.#d(e);if(!t)return this.#c();this.onChange(t),this.#e.set(t),this.#s.set(-1),this.#c()}get#f(){const e=this.#d(this.#e.value);return e.length>0&&!this.options.some(t=>t.toLowerCase()===e)}get#b(){return this.#l.length+(this.#f?1:0)}#y(e){const t=this.#b;if(e.key==="ArrowDown")e.preventDefault(),this.#i(),t&&this.#s.set((this.#s.value+1)%t);else if(e.key==="ArrowUp")e.preventDefault(),this.#i(),t&&this.#s.set((this.#s.value-1+t)%t);else if(e.key==="Enter"){e.preventDefault();const s=this.#l,i=s[this.#s.value];i!==void 0?this.#o(i):this.#s.value===s.length&&this.#f?this.#o(this.#e.value):this.#e.value.trim()&&this.#o(this.#e.value)}else e.key==="Escape"&&(e.preventDefault(),this.#c())}render(){const e=this.value,t=this.#l,s=this.#t.value,i=this.#s.value;return h`
454
+ `}constructor(){super(),new ce(this),this.options=[],this.value="",this.onChange=()=>{},this.#n=`--status-select-${++nt}`,this.#r=`status-select-listbox-${nt}`}#g=e=>{e.composedPath().includes(this)||this.#l()};connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#g)}disconnectedCallback(){document.removeEventListener("click",this.#g),super.disconnectedCallback()}get#a(){const e=this.#e.value.trim().toLowerCase();return!e||e===this.value.trim().toLowerCase()?this.options:this.options.filter(t=>t.toLowerCase().includes(e))}#i(){this.#e.set(this.value),this.#t.set(!0),this.updateComplete.then(()=>{this.renderRoot.querySelector(".menu")?.showPopover()})}#l(){this.#t.set(!1),this.#s.set(-1),this.#e.set(this.value),this.renderRoot.querySelector(".menu")?.hidePopover()}#u(){this.#t.value?this.#l():(this.#i(),this.renderRoot.querySelector(".input")?.focus())}#h(e){this.#e.set(e.target.value),this.#s.set(-1),this.#t.value||this.#i()}#d(e){return e.trim().toLowerCase().replace(/\s+/g,"-")}#o(e){const t=this.#d(e);if(!t)return this.#l();this.onChange(t),this.#e.set(t),this.#s.set(-1),this.#l()}get#f(){const e=this.#d(this.#e.value);return e.length>0&&!this.options.some(t=>t.toLowerCase()===e)}get#b(){return this.#a.length+(this.#f?1:0)}#k(e){const t=this.#b;if(e.key==="ArrowDown")e.preventDefault(),this.#i(),t&&this.#s.set((this.#s.value+1)%t);else if(e.key==="ArrowUp")e.preventDefault(),this.#i(),t&&this.#s.set((this.#s.value-1+t)%t);else if(e.key==="Enter"){e.preventDefault();const s=this.#a,i=s[this.#s.value];i!==void 0?this.#o(i):this.#s.value===s.length&&this.#f?this.#o(this.#e.value):this.#e.value.trim()&&this.#o(this.#e.value)}else e.key==="Escape"&&(e.preventDefault(),this.#l())}render(){const e=this.value,t=this.#a,s=this.#t.value,i=this.#s.value;return c`
455
455
  <div class="field" style=${`anchor-name: ${this.#n}`}>
456
456
  <input
457
457
  class="input"
@@ -464,8 +464,8 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
464
464
  @input=${n=>this.#h(n)}
465
465
  @focus=${()=>this.#i()}
466
466
  @click=${()=>this.#i()}
467
- @keydown=${n=>this.#y(n)}
468
- @blur=${()=>{this.#t.value&&this.#e.value.trim()&&this.#d(this.#e.value)!==e?this.#o(this.#e.value):this.#c()}}
467
+ @keydown=${n=>this.#k(n)}
468
+ @blur=${()=>{this.#t.value&&this.#e.value.trim()&&this.#d(this.#e.value)!==e?this.#o(this.#e.value):this.#l()}}
469
469
  />
470
470
  <button
471
471
  class="chevron-btn ${s?"open":""}"
@@ -484,7 +484,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
484
484
  popover="manual"
485
485
  style=${`position-anchor: ${this.#n}`}
486
486
  >
487
- ${t.map((n,o)=>h`
487
+ ${t.map((n,o)=>c`
488
488
  <li
489
489
  id=${`${this.#r}-opt-${o}`}
490
490
  role="option"
@@ -496,7 +496,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
496
496
  ${n}
497
497
  </li>
498
498
  `)}
499
- ${this.#f?h`
499
+ ${this.#f?c`
500
500
  <li
501
501
  id=${`${this.#r}-opt-${t.length}`}
502
502
  role="option"
@@ -507,9 +507,9 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
507
507
  ${t.length?"Create":"No match. Create"} '${this.#d(this.#e.value)}'
508
508
  </li>
509
509
  `:""}
510
- ${!t.length&&!this.#f?h`<li class="empty">No options</li>`:""}
510
+ ${!t.length&&!this.#f?c`<li class="empty">No options</li>`:""}
511
511
  </ul>
512
- `}}customElements.define("status-select",mi);let xi=0;const vi={top:"top: auto; bottom: anchor(top); left: anchor(center); right: auto; translate: -50% 0; margin-top: 0; margin-bottom: 6px;",bottom:"top: anchor(bottom); bottom: auto; left: anchor(center); right: auto; translate: -50% 0; margin-top: 6px; margin-bottom: 0;",left:"top: anchor(center); bottom: auto; left: auto; right: anchor(left); translate: 0 -50%; margin-right: 6px;",right:"top: anchor(center); bottom: auto; left: anchor(right); right: auto; translate: 0 -50%; margin-left: 6px;"},ki=["top","bottom","left","right"];class yi extends _{static{this.properties={text:{attribute:!1},placement:{attribute:!1}}}#e;#t=null;static{this.styles=O`
512
+ `}}customElements.define("status-select",yi);let ki=0;const $i={top:"top: auto; bottom: anchor(top); left: anchor(center); right: auto; translate: -50% 0; margin-top: 0; margin-bottom: 6px;",bottom:"top: anchor(bottom); bottom: auto; left: anchor(center); right: auto; translate: -50% 0; margin-top: 6px; margin-bottom: 0;",left:"top: anchor(center); bottom: auto; left: auto; right: anchor(left); translate: 0 -50%; margin-right: 6px;",right:"top: anchor(center); bottom: auto; left: anchor(right); right: auto; translate: 0 -50%; margin-left: 6px;"},wi=["top","bottom","left","right"];class _i extends ${static{this.properties={text:{attribute:!1},placement:{attribute:!1}}}#e;#t=null;static{this.styles=R`
513
513
  :host {
514
514
  display: inline-flex;
515
515
  position: relative;
@@ -593,7 +593,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
593
593
  translate: 0 -50%;
594
594
  margin: 0 0 0 6px;
595
595
  }
596
- `}constructor(){super(),this.text="",this.placement="top",this.#e=`--help-tooltip-${++xi}`}get#s(){const e=ki.filter(t=>t!==this.placement);return[this.placement,...e].map(t=>`--bubble-${t}`).join(", ")}disconnectedCallback(){this.#t&&clearTimeout(this.#t),super.disconnectedCallback()}#n(){this.#t&&(clearTimeout(this.#t),this.#t=null);const e=this.renderRoot.querySelector(".bubble");e&&!e.matches(":popover-open")&&e.showPopover()}#r(){this.#t=setTimeout(()=>{this.renderRoot.querySelector(".bubble")?.hidePopover()},100)}render(){return h`
596
+ `}constructor(){super(),this.text="",this.placement="top",this.#e=`--help-tooltip-${++ki}`}get#s(){const e=wi.filter(t=>t!==this.placement);return[this.placement,...e].map(t=>`--bubble-${t}`).join(", ")}disconnectedCallback(){this.#t&&clearTimeout(this.#t),super.disconnectedCallback()}#n(){this.#t&&(clearTimeout(this.#t),this.#t=null);const e=this.renderRoot.querySelector(".bubble");e&&!e.matches(":popover-open")&&e.showPopover()}#r(){this.#t=setTimeout(()=>{this.renderRoot.querySelector(".bubble")?.hidePopover()},100)}render(){return c`
597
597
  <button
598
598
  type="button"
599
599
  class="icon"
@@ -609,13 +609,13 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
609
609
  role="tooltip"
610
610
  class="bubble"
611
611
  popover="manual"
612
- style=${`position-anchor: ${this.#e}; position-try-fallbacks: ${this.#s}; ${vi[this.placement]}`}
612
+ style=${`position-anchor: ${this.#e}; position-try-fallbacks: ${this.#s}; ${$i[this.placement]}`}
613
613
  @mouseenter=${()=>this.#n()}
614
614
  @mouseleave=${()=>this.#r()}
615
615
  >
616
616
  ${this.text}
617
617
  </div>
618
- `}}customElements.define("help-tooltip",yi);const ot="mem-bucket-detail-view-mode";function $i(r){return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(r))}const wi=["stable","beta","unreviewed"],_i=["active","shipped","abandoned"],at=["plan","spec","sql","testing-todo","discovery","session-summary","other"],Si=["ticket","freeform"],y={description:"What this doc is / does, shown in search results and list views. For skills, this is also the only thing an agent sees before deciding whether to load the full body — so state both what it does and when to use it.",tags:"Free-form keywords used to filter and search. Not the only thing matched during full-text search, but the fastest way to narrow a list view.",status:`Lifecycle state — stable/beta/unreviewed for skills, active/shipped/abandoned for memory docs. Skills default to "unreviewed" if left unset, so low-trust content doesn't read as equivalent to a reviewed pattern.`,name:"The skill's identifier — becomes its containing folder name on disk. Lowercase letters, numbers, and hyphens only.",owner:"Who authored or maintains this skill — a person or team name, free text.",extends:"Name of another skill this one builds on or specializes, if any. Leave blank if it doesn't extend anything.",trigger_phrases:"Extra keyword phrases beyond the description that should surface this skill in search — phrasings a user might type that don't literally appear in the description text.",key:"The lookup handle for this memory doc — usually a ticket ID, sometimes a free-form name. One key can have several docs attached (a plan, a spec, session notes) all retrievable together.",key_type:'"ticket" if the key is a real ticket ID, "freeform" for a name like "Spot Chart Design".',doc_type:"What kind of content this is — shapes how it should be read (a plan reads differently than raw SQL or a session summary).",related_to:"Another key this doc relates to, if any — free text, not validated against existing keys."};function lt(r){return{description:r.description??"",tags:r.tags??[],status:r.status??"",name:r.name??"",owner:r.owner??"",extends:r.extends??"",trigger_phrases:r.trigger_phrases??[],key:r.key??"",key_type:r.key_type??"",doc_type:r.doc_type??"",related_to:r.related_to??""}}class Ci extends _{constructor(){super(...arguments),this._viewMode=localStorage.getItem(ot)??"markdown",this._editing=!1,this._draft=null,this._addingFrontmatter=!1,this._renaming=!1,this._renameValue=""}static{this.properties={selected:{attribute:!1},onChanged:{attribute:!1},facets:{attribute:!1},onTagClick:{attribute:!1},onFolderClick:{attribute:!1},onDateClick:{attribute:!1},onKeyClick:{attribute:!1},_doc:{state:!0},_viewMode:{state:!0},_editing:{state:!0},_draft:{state:!0},_addingFrontmatter:{state:!0},_renaming:{state:!0},_renameValue:{state:!0}}}static{this.styles=O`
618
+ `}}customElements.define("help-tooltip",_i);const ot="mem-bucket-detail-view-mode";function Si(r){return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(r))}const Ci=["stable","beta","unreviewed"],Ai=["active","shipped","abandoned"],at=["plan","spec","sql","testing-todo","discovery","session-summary","other"],Ti=["ticket","freeform"],k={description:"What this doc is / does, shown in search results and list views. For skills, this is also the only thing an agent sees before deciding whether to load the full body — so state both what it does and when to use it.",tags:"Free-form keywords used to filter and search. Not the only thing matched during full-text search, but the fastest way to narrow a list view.",status:`Lifecycle state — stable/beta/unreviewed for skills, active/shipped/abandoned for memory docs. Skills default to "unreviewed" if left unset, so low-trust content doesn't read as equivalent to a reviewed pattern.`,name:"The skill's identifier — becomes its containing folder name on disk. Lowercase letters, numbers, and hyphens only.",owner:"Who authored or maintains this skill — a person or team name, free text.",extends:"Name of another skill this one builds on or specializes, if any. Leave blank if it doesn't extend anything.",trigger_phrases:"Extra keyword phrases beyond the description that should surface this skill in search — phrasings a user might type that don't literally appear in the description text.",key:"The lookup handle for this memory doc — usually a ticket ID, sometimes a free-form name. One key can have several docs attached (a plan, a spec, session notes) all retrievable together.",key_type:'"ticket" if the key is a real ticket ID, "freeform" for a name like "Spot Chart Design".',doc_type:"What kind of content this is — shapes how it should be read (a plan reads differently than raw SQL or a session summary).",related_to:"Another key this doc relates to, if any — free text, not validated against existing keys."};function lt(r){return{description:r.description??"",tags:r.tags??[],status:r.status??"",name:r.name??"",owner:r.owner??"",extends:r.extends??"",trigger_phrases:r.trigger_phrases??[],key:r.key??"",key_type:r.key_type??"",doc_type:r.doc_type??"",related_to:r.related_to??""}}class Ei extends ${constructor(){super(...arguments),this._viewMode=localStorage.getItem(ot)??"markdown",this._editing=!1,this._draft=null,this._addingFrontmatter=!1,this._renaming=!1,this._renameValue=""}static{this.properties={selected:{attribute:!1},onChanged:{attribute:!1},facets:{attribute:!1},onTagClick:{attribute:!1},onFolderClick:{attribute:!1},onDateClick:{attribute:!1},onKeyClick:{attribute:!1},_doc:{state:!0},_viewMode:{state:!0},_editing:{state:!0},_draft:{state:!0},_addingFrontmatter:{state:!0},_renaming:{state:!0},_renameValue:{state:!0}}}static{this.styles=R`
619
619
  :host { display: block; padding: 16px; }
620
620
  h2 { margin: 0 0 4px; font-size: 16px; }
621
621
  .title-row {
@@ -902,35 +902,35 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
902
902
  color: inherit;
903
903
  }
904
904
  .hint { font-size: 11px; opacity: 0.6; }
905
- `}updated(e){e.has("selected")&&this.selected&&(this._editing=!1,this._addingFrontmatter=!1,this._renaming=!1,this.#e(),this.scrollTop=0)}async#e(){const{table:e,id:t}=this.selected,s=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`);this._doc=s.ok?await s.json():null,await this.updateComplete,this.shadowRoot?.querySelector(".markdown-body")?.scrollTo(0,0),this.shadowRoot?.querySelector("pre")?.scrollTo(0,0)}async refresh(){if(!this.selected||this._editing||this._addingFrontmatter||this._renaming)return;const{table:e,id:t}=this.selected,s=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`);if(!s.ok)return;const n=(this.shadowRoot?.querySelector(".markdown-body")??this.shadowRoot?.querySelector("pre"))?.scrollTop??0;this._doc=await s.json(),await this.updateComplete;const o=this.shadowRoot?.querySelector(".markdown-body")??this.shadowRoot?.querySelector("pre");o&&(o.scrollTop=n)}#t(){this._doc?.source_path&&navigator.clipboard?.writeText(this._doc.source_path)}#s(e){this._viewMode=e,localStorage.setItem(ot,e)}async#n(){const{table:e,id:t}=this.selected,s=!this._doc?.deprecated;await fetch(`/api/entries/${e}/${encodeURIComponent(t)}/deprecated`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({deprecated:s})}),await this.#e(),this.onChanged?.()}async#r(){const{table:e,id:t}=this.selected,s=!this._doc?.paused;await fetch(`/api/entries/${e}/${encodeURIComponent(t)}/paused`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paused:s})}),await this.#e(),this.onChanged?.()}async#g(){if(!window.confirm("Delete this doc? This can't be undone."))return;const{table:e,id:t}=this.selected;await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`,{method:"DELETE"}),this._doc=null,this.onChanged?.()}#l(){this._doc&&(this._draft=lt(this._doc),this._editing=!0,this._addingFrontmatter=!1)}#i(){this._doc&&(this._draft=lt(this._doc),this._addingFrontmatter=!0,this._editing=!1)}#c(e){this._draft&&(this._draft={...this._draft,doc_type:e},this._addingFrontmatter=!1,this._editing=!0)}#u(){this._editing=!1,this._addingFrontmatter=!1,this._draft=null}#h(e){this._draft&&(this._draft={...this._draft,...e})}#d(e){if(!this._draft)return;const t=this._draft.tags.includes(e)?this._draft.tags.filter(s=>s!==e):[...this._draft.tags,e];this.#h({tags:t})}#o(e){if(!this._draft)return;const t=this._draft.trigger_phrases.includes(e)?this._draft.trigger_phrases.filter(s=>s!==e):[...this._draft.trigger_phrases,e];this.#h({trigger_phrases:t})}async#f(){if(!this._draft||!this.selected)return;const{table:e,id:t}=this.selected,s=e==="skills",i={description:this._draft.description,tags:this._draft.tags,status:this._draft.status};s?(i.owner=this._draft.owner||null,i.extends=this._draft.extends||null,i.trigger_phrases=this._draft.trigger_phrases):(i.key=this._draft.key,i.key_type=this._draft.key_type,i.doc_type=this._draft.doc_type,i.related_to=this._draft.related_to||null);const n=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({frontmatter:i})});if(!n.ok){const o=await n.json().catch(()=>({}));window.alert(`Save failed: ${o.error??n.statusText}`);return}this._editing=!1,this._draft=null,await this.#e(),this.onChanged?.()}async#b(){if(!this.selected||!this._doc||this.selected.table!=="memory_docs")return;const{table:e,id:t}=this.selected;if(!window.confirm(`Delete frontmatter for "${this._doc.key}"?
905
+ `}updated(e){e.has("selected")&&this.selected&&(this._editing=!1,this._addingFrontmatter=!1,this._renaming=!1,this.#e(),this.scrollTop=0)}async#e(){const{table:e,id:t}=this.selected,s=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`);this._doc=s.ok?await s.json():null,await this.updateComplete,this.shadowRoot?.querySelector(".markdown-body")?.scrollTo(0,0),this.shadowRoot?.querySelector("pre")?.scrollTo(0,0)}async refresh(){if(!this.selected||this._editing||this._addingFrontmatter||this._renaming)return;const{table:e,id:t}=this.selected,s=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`);if(!s.ok)return;const n=(this.shadowRoot?.querySelector(".markdown-body")??this.shadowRoot?.querySelector("pre"))?.scrollTop??0;this._doc=await s.json(),await this.updateComplete;const o=this.shadowRoot?.querySelector(".markdown-body")??this.shadowRoot?.querySelector("pre");o&&(o.scrollTop=n)}#t(){this._doc?.source_path&&navigator.clipboard?.writeText(this._doc.source_path)}#s(e){this._viewMode=e,localStorage.setItem(ot,e)}async#n(){const{table:e,id:t}=this.selected,s=!this._doc?.deprecated;await fetch(`/api/entries/${e}/${encodeURIComponent(t)}/deprecated`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({deprecated:s})}),await this.#e(),this.onChanged?.()}async#r(){const{table:e,id:t}=this.selected,s=!this._doc?.paused;await fetch(`/api/entries/${e}/${encodeURIComponent(t)}/paused`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paused:s})}),await this.#e(),this.onChanged?.()}async#g(){if(!window.confirm("Delete this doc? This can't be undone."))return;const{table:e,id:t}=this.selected;await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`,{method:"DELETE"}),this._doc=null,this.onChanged?.()}#a(){this._doc&&(this._draft=lt(this._doc),this._editing=!0,this._addingFrontmatter=!1)}#i(){this._doc&&(this._draft=lt(this._doc),this._addingFrontmatter=!0,this._editing=!1)}#l(e){this._draft&&(this._draft={...this._draft,doc_type:e},this._addingFrontmatter=!1,this._editing=!0)}#u(){this._editing=!1,this._addingFrontmatter=!1,this._draft=null}#h(e){this._draft&&(this._draft={...this._draft,...e})}#d(e){if(!this._draft)return;const t=this._draft.tags.includes(e)?this._draft.tags.filter(s=>s!==e):[...this._draft.tags,e];this.#h({tags:t})}#o(e){if(!this._draft)return;const t=this._draft.trigger_phrases.includes(e)?this._draft.trigger_phrases.filter(s=>s!==e):[...this._draft.trigger_phrases,e];this.#h({trigger_phrases:t})}async#f(){if(!this._draft||!this.selected)return;const{table:e,id:t}=this.selected,s=e==="skills",i={description:this._draft.description,tags:this._draft.tags,status:this._draft.status};s?(i.owner=this._draft.owner||null,i.extends=this._draft.extends||null,i.trigger_phrases=this._draft.trigger_phrases):(i.key=this._draft.key,i.key_type=this._draft.key_type,i.doc_type=this._draft.doc_type,i.related_to=this._draft.related_to||null);const n=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({frontmatter:i})});if(!n.ok){const o=await n.json().catch(()=>({}));window.alert(`Save failed: ${o.error??n.statusText}`);return}this._editing=!1,this._draft=null,await this.#e(),this.onChanged?.()}async#b(){if(!this.selected||!this._doc||this.selected.table!=="memory_docs")return;const{table:e,id:t}=this.selected;if(!window.confirm(`Delete frontmatter for "${this._doc.key}"?
906
906
 
907
- This removes the doc's key, tags, and status — it drops out of key-based lookup and full-text search, and becomes a plain unmanaged file, until frontmatter is added again.`))return;const i=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}/frontmatter`,{method:"DELETE"});if(!i.ok){const n=await i.json().catch(()=>({}));window.alert(`Delete failed: ${n.error??i.statusText}`);return}this._doc=null,this.selected=null,this.onChanged?.()}#y(){this._doc&&(this._renameValue=this._doc.name??"",this._renaming=!0)}async#x(){if(!this._doc||!this._renameValue.trim())return;const e=this._renameValue.trim();if(e===this._doc.name){this._renaming=!1;return}const t=await fetch(`/api/entries/skills/${encodeURIComponent(this._doc.name)}/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({new_name:e})});if(!t.ok){const s=await t.json().catch(()=>({}));window.alert(`Rename failed: ${s.error??t.statusText}`);return}this._renaming=!1,this.selected={table:"skills",id:e},await this.#e(),this.onChanged?.()}#k(){return h`
907
+ This removes the doc's key, tags, and status — it drops out of key-based lookup and full-text search, and becomes a plain unmanaged file, until frontmatter is added again.`))return;const i=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}/frontmatter`,{method:"DELETE"});if(!i.ok){const n=await i.json().catch(()=>({}));window.alert(`Delete failed: ${n.error??i.statusText}`);return}this._doc=null,this.selected=null,this.onChanged?.()}#k(){this._doc&&(this._renameValue=this._doc.name??"",this._renaming=!0)}async#x(){if(!this._doc||!this._renameValue.trim())return;const e=this._renameValue.trim();if(e===this._doc.name){this._renaming=!1;return}const t=await fetch(`/api/entries/skills/${encodeURIComponent(this._doc.name)}/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({new_name:e})});if(!t.ok){const s=await t.json().catch(()=>({}));window.alert(`Rename failed: ${s.error??t.statusText}`);return}this._renaming=!1,this.selected={table:"skills",id:e},await this.#e(),this.onChanged?.()}#y(){return c`
908
908
  <div class="edit-form">
909
909
  <div class="hint">What kind of doc is this? This shapes which fields apply next.</div>
910
910
  <div class="field">
911
- <label>doc_type <help-tooltip .text=${y.doc_type}></help-tooltip></label>
911
+ <label>doc_type <help-tooltip .text=${k.doc_type}></help-tooltip></label>
912
912
  <select
913
- @change=${e=>this.#c(e.target.value)}
913
+ @change=${e=>this.#l(e.target.value)}
914
914
  >
915
915
  <option value="" selected disabled>Choose…</option>
916
- ${at.map(e=>h`<option value=${e}>${e}</option>`)}
916
+ ${at.map(e=>c`<option value=${e}>${e}</option>`)}
917
917
  </select>
918
918
  </div>
919
919
  <div class="form-actions">
920
920
  <button class="cancel" @click=${()=>this.#u()}>Cancel</button>
921
921
  </div>
922
922
  </div>
923
- `}#v(e){const t=this._draft,s=this.facets;return h`
923
+ `}#v(e){const t=this._draft,s=this.facets;return c`
924
924
  <div class="edit-form">
925
- ${e?h`
925
+ ${e?c`
926
926
  <div class="field">
927
- <label>name <help-tooltip .text=${y.name}></help-tooltip></label>
927
+ <label>name <help-tooltip .text=${k.name}></help-tooltip></label>
928
928
  <div class="hint">Renaming moves the skill's folder on disk — kept as a separate action.</div>
929
929
  </div>
930
- `:h`
930
+ `:c`
931
931
  <div class="field-row">
932
932
  <div class="field">
933
- <label>key <help-tooltip .text=${y.key}></help-tooltip></label>
933
+ <label>key <help-tooltip .text=${k.key}></help-tooltip></label>
934
934
  <input
935
935
  type="text"
936
936
  .value=${t.key}
@@ -938,34 +938,34 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
938
938
  />
939
939
  </div>
940
940
  <div class="field">
941
- <label>key_type <help-tooltip .text=${y.key_type}></help-tooltip></label>
941
+ <label>key_type <help-tooltip .text=${k.key_type}></help-tooltip></label>
942
942
  <select
943
943
  .value=${t.key_type}
944
944
  @change=${i=>this.#h({key_type:i.target.value})}
945
945
  >
946
- ${Si.map(i=>h`<option value=${i} ?selected=${i===t.key_type}>${i}</option>`)}
946
+ ${Ti.map(i=>c`<option value=${i} ?selected=${i===t.key_type}>${i}</option>`)}
947
947
  </select>
948
948
  </div>
949
949
  </div>
950
950
  <div class="field">
951
- <label>doc_type <help-tooltip .text=${y.doc_type}></help-tooltip></label>
951
+ <label>doc_type <help-tooltip .text=${k.doc_type}></help-tooltip></label>
952
952
  <select
953
953
  .value=${t.doc_type}
954
954
  @change=${i=>this.#h({doc_type:i.target.value})}
955
955
  >
956
- ${at.map(i=>h`<option value=${i} ?selected=${i===t.doc_type}>${i}</option>`)}
956
+ ${at.map(i=>c`<option value=${i} ?selected=${i===t.doc_type}>${i}</option>`)}
957
957
  </select>
958
958
  </div>
959
959
  `}
960
960
  <div class="field">
961
- <label>description <help-tooltip .text=${y.description}></help-tooltip></label>
961
+ <label>description <help-tooltip .text=${k.description}></help-tooltip></label>
962
962
  <textarea
963
963
  .value=${t.description}
964
964
  @input=${i=>this.#h({description:i.target.value})}
965
965
  ></textarea>
966
966
  </div>
967
967
  <div class="field">
968
- <label>tags <help-tooltip .text=${y.tags}></help-tooltip></label>
968
+ <label>tags <help-tooltip .text=${k.tags}></help-tooltip></label>
969
969
  <tag-multiselect
970
970
  .tags=${s?.tags??[]}
971
971
  .active=${t.tags}
@@ -974,17 +974,17 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
974
974
  ></tag-multiselect>
975
975
  </div>
976
976
  <div class="field">
977
- <label>status <help-tooltip .text=${y.status}></help-tooltip></label>
977
+ <label>status <help-tooltip .text=${k.status}></help-tooltip></label>
978
978
  <status-select
979
- .options=${[...new Set([...e?wi:_i,...s?.statuses??[]])]}
979
+ .options=${[...new Set([...e?Ci:Ai,...s?.statuses??[]])]}
980
980
  .value=${t.status}
981
981
  .onChange=${i=>this.#h({status:i})}
982
982
  ></status-select>
983
983
  </div>
984
- ${e?h`
984
+ ${e?c`
985
985
  <div class="field-row">
986
986
  <div class="field">
987
- <label>owner <help-tooltip .text=${y.owner}></help-tooltip></label>
987
+ <label>owner <help-tooltip .text=${k.owner}></help-tooltip></label>
988
988
  <input
989
989
  type="text"
990
990
  .value=${t.owner}
@@ -992,7 +992,7 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
992
992
  />
993
993
  </div>
994
994
  <div class="field">
995
- <label>extends <help-tooltip .text=${y.extends}></help-tooltip></label>
995
+ <label>extends <help-tooltip .text=${k.extends}></help-tooltip></label>
996
996
  <input
997
997
  type="text"
998
998
  .value=${t.extends}
@@ -1001,7 +1001,7 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1001
1001
  </div>
1002
1002
  </div>
1003
1003
  <div class="field">
1004
- <label>trigger_phrases <help-tooltip .text=${y.trigger_phrases}></help-tooltip></label>
1004
+ <label>trigger_phrases <help-tooltip .text=${k.trigger_phrases}></help-tooltip></label>
1005
1005
  <tag-multiselect
1006
1006
  .tags=${[]}
1007
1007
  .active=${t.trigger_phrases}
@@ -1009,9 +1009,9 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1009
1009
  .onToggle=${i=>this.#o(i)}
1010
1010
  ></tag-multiselect>
1011
1011
  </div>
1012
- `:h`
1012
+ `:c`
1013
1013
  <div class="field">
1014
- <label>related_to <help-tooltip .text=${y.related_to}></help-tooltip></label>
1014
+ <label>related_to <help-tooltip .text=${k.related_to}></help-tooltip></label>
1015
1015
  <input
1016
1016
  type="text"
1017
1017
  .value=${t.related_to}
@@ -1024,10 +1024,10 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1024
1024
  <button class="cancel" @click=${()=>this.#u()}>Cancel</button>
1025
1025
  </div>
1026
1026
  </div>
1027
- `}#m(e,t){const s=t?void 0:e.key;return h`
1027
+ `}#m(e,t){const s=t?void 0:e.key;return c`
1028
1028
  <div class="title-row">
1029
1029
  <h2>
1030
- ${s?h`<button class="title-link" title="Search for key '${s}'" @click=${()=>this.onKeyClick?.(s)}>
1030
+ ${s?c`<button class="title-link" title="Search for key '${s}'" @click=${()=>this.onKeyClick?.(s)}>
1031
1031
  ${e.name??s??e.id}
1032
1032
  </button>`:e.name??e.key??e.id}
1033
1033
  </h2>
@@ -1035,33 +1035,33 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1035
1035
  📁 ${e.folder}
1036
1036
  </button>
1037
1037
  </div>
1038
- `}#p(e,t){const s=e.created_at?$i(e.created_at):null;return h`
1038
+ `}#p(e,t){const s=e.created_at?Si(e.created_at):null;return c`
1039
1039
  <dl class="info-grid">
1040
1040
  <dt>Description</dt>
1041
1041
  <dd class="description">${e.description||"—"}</dd>
1042
1042
 
1043
1043
  <dt>Tags</dt>
1044
1044
  <dd>
1045
- ${e.tags?.length?e.tags.map(i=>h`<button class="pill tag-pill" @click=${()=>this.onTagClick?.(i)}>${i}</button>`):h`<span class="hint">no tags</span>`}
1045
+ ${e.tags?.length?e.tags.map(i=>c`<button class="pill tag-pill" @click=${()=>this.onTagClick?.(i)}>${i}</button>`):c`<span class="hint">no tags</span>`}
1046
1046
  </dd>
1047
1047
 
1048
1048
  <dt>Status</dt>
1049
1049
  <dd>${e.status}</dd>
1050
1050
 
1051
- ${e.deprecated||e.paused?h`
1051
+ ${e.deprecated||e.paused?c`
1052
1052
  <dt>Flags</dt>
1053
1053
  <dd>
1054
- ${e.deprecated?h`<span class="pill warn-pill">deprecated</span>`:m}
1055
- ${e.paused?h`<span class="pill muted-pill">paused</span>`:m}
1054
+ ${e.deprecated?c`<span class="pill warn-pill">deprecated</span>`:m}
1055
+ ${e.paused?c`<span class="pill muted-pill">paused</span>`:m}
1056
1056
  </dd>
1057
1057
  `:m}
1058
1058
 
1059
- ${t?h`
1060
- ${e.owner?h`<dt>Owner</dt>
1059
+ ${t?c`
1060
+ ${e.owner?c`<dt>Owner</dt>
1061
1061
  <dd>${e.owner}</dd>`:m}
1062
- ${e.extends?h`<dt>Extends</dt>
1062
+ ${e.extends?c`<dt>Extends</dt>
1063
1063
  <dd>${e.extends}</dd>`:m}
1064
- `:h`
1064
+ `:c`
1065
1065
  <dt>Key</dt>
1066
1066
  <dd>
1067
1067
  <button class="key-link" title="Search for this key" @click=${()=>e.key&&this.onKeyClick?.(e.key)}>
@@ -1075,22 +1075,22 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1075
1075
  <dt>Doc type</dt>
1076
1076
  <dd>${e.doc_type}</dd>
1077
1077
 
1078
- ${e.related_to?h`<dt>Related to</dt>
1078
+ ${e.related_to?c`<dt>Related to</dt>
1079
1079
  <dd>${e.related_to}</dd>`:m}
1080
1080
  `}
1081
1081
 
1082
1082
  <dt>Created</dt>
1083
1083
  <dd>
1084
- ${s?h`<span class="date-value" title="Filter to this day" @click=${()=>this.onDateClick?.(s)}
1084
+ ${s?c`<span class="date-value" title="Filter to this day" @click=${()=>this.onDateClick?.(s)}
1085
1085
  >${s}</span
1086
- >`:h`<span class="hint">unknown</span>`}
1086
+ >`:c`<span class="hint">unknown</span>`}
1087
1087
  </dd>
1088
1088
  </dl>
1089
- `}#$(e,t){const s=new x.Renderer,i=s.link.bind(s);return s.link=n=>{if(typeof n.href=="string"&&n.href.startsWith("attachment://")){const o=n.href.slice(13);return i({...n,href:`/api/entries/${e}/${encodeURIComponent(t)}/attachments/${encodeURIComponent(o)}`})}return i(n)},s}#w(e,t){return e.attachments?.length?h`
1089
+ `}#$(e,t){const s=new x.Renderer,i=s.link.bind(s);return s.link=n=>{if(typeof n.href=="string"&&n.href.startsWith("attachment://")){const o=n.href.slice(13);return i({...n,href:`/api/entries/${e}/${encodeURIComponent(t)}/attachments/${encodeURIComponent(o)}`})}return i(n)},s}#w(e,t){return e.attachments?.length?c`
1090
1090
  <div class="attachments-section">
1091
1091
  <h4>Attachments</h4>
1092
1092
  <ul>
1093
- ${e.attachments.map(s=>h`
1093
+ ${e.attachments.map(s=>c`
1094
1094
  <li>
1095
1095
  <a href="/api/entries/${t}/${encodeURIComponent(e.id)}/attachments/${encodeURIComponent(s.filename)}/view" target="_blank" rel="noopener"
1096
1096
  >${s.filename}</a
@@ -1106,21 +1106,21 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1106
1106
  `)}
1107
1107
  </ul>
1108
1108
  </div>
1109
- `:m}render(){if(!this.selected)return h`<div class="empty">Select an entry to view its details.</div>`;if(!this._doc)return m;const e=this._doc,t=this.selected.table==="skills",s=t&&e.folder==="builtin",i=!t&&e.has_frontmatter===!1;return this._addingFrontmatter?h`${this.#m(e,t)}${this.#k()}`:this._editing&&this._draft?h`${this.#m(e,t)}${this.#v(t)}`:h`
1109
+ `:m}render(){if(!this.selected)return c`<div class="empty">Select an entry to view its details.</div>`;if(!this._doc)return m;const e=this._doc,t=this.selected.table==="skills",s=t&&e.folder==="builtin",i=!t&&e.has_frontmatter===!1;return this._addingFrontmatter?c`${this.#m(e,t)}${this.#y()}`:this._editing&&this._draft?c`${this.#m(e,t)}${this.#v(t)}`:c`
1110
1110
  ${this.#m(e,t)}
1111
- ${i?h`<div class="bare-notice">No frontmatter — this is a plain, unmanaged file.</div>`:this.#p(e,t)}
1112
- ${s?m:h`
1111
+ ${i?c`<div class="bare-notice">No frontmatter — this is a plain, unmanaged file.</div>`:this.#p(e,t)}
1112
+ ${s?m:c`
1113
1113
  <div class="actions">
1114
- ${i?h`<button class="primary" @click=${()=>this.#i()}>Add frontmatter</button>`:h`
1115
- <button @click=${()=>this.#l()}>Edit</button>
1116
- ${t?h`<button @click=${()=>this.#y()}>Rename</button>`:m}
1114
+ ${i?c`<button class="primary" @click=${()=>this.#i()}>Add frontmatter</button>`:c`
1115
+ <button @click=${()=>this.#a()}>Edit</button>
1116
+ ${t?c`<button @click=${()=>this.#k()}>Rename</button>`:m}
1117
1117
  <button @click=${()=>this.#n()}>${e.deprecated?"Un-deprecate":"Mark deprecated"}</button>
1118
1118
  <button @click=${()=>this.#r()}>${e.paused?"Resume":"Pause"}</button>
1119
- ${t?m:h`<button class="danger" @click=${()=>this.#b()}>Delete frontmatter</button>`}
1119
+ ${t?m:c`<button class="danger" @click=${()=>this.#b()}>Delete frontmatter</button>`}
1120
1120
  `}
1121
1121
  <button class="danger" @click=${()=>this.#g()}>Delete</button>
1122
1122
  </div>
1123
- ${this._renaming?h`
1123
+ ${this._renaming?c`
1124
1124
  <div class="rename-row">
1125
1125
  <input
1126
1126
  type="text"
@@ -1148,9 +1148,9 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1148
1148
  Raw
1149
1149
  </button>
1150
1150
  </div>
1151
- ${this._viewMode==="markdown"?h`<div class="markdown-body">${gi(x.parse(e.body??"",{async:!1,renderer:this.#$(this.selected.table,e.id)}))}</div>`:h`<pre>${e.raw_file??e.body}</pre>`}
1151
+ ${this._viewMode==="markdown"?c`<div class="markdown-body">${xi(x.parse(e.body??"",{async:!1,renderer:this.#$(this.selected.table,e.id)}))}</div>`:c`<pre>${e.raw_file??e.body}</pre>`}
1152
1152
  <div class="source-path" title="click to copy" @click=${()=>this.#t()}>${e.source_path}</div>
1153
- `}}customElements.define("detail-panel",Ci);const ne="membkt";let ue;function ye(){return ue||(ue=fetch("/api/config").then(r=>r.json()).catch(()=>({folderfooMode:"off",folderfooHost:null}))),ue}class Ai extends _{static{this.properties={defaultKind:{attribute:!1},lockKind:{attribute:!1},onAdded:{attribute:!1},onCancel:{attribute:!1}}}#e=new u("skill");#t=new u("local");#s=new u("");#n=new u([]);#r=new u(null);#g=new u("");#l=new u("");#i=new u("");#c=new u(!1);#u=new u(!1);#h=new u(!1);#d=new u("");#o=new u("");#f=new u(!1);#b=new u("");#y=new u(!1);#x=new u("");#k=new u(!1);#v=new u(!1);#m=new u([]);#p=new u("");#$=new u(!1);#w;static{this.styles=O`
1153
+ `}}customElements.define("detail-panel",Ei);const oe="membkt";let fe;function te(){return fe||(fe=fetch("/api/config").then(r=>r.json()).catch(()=>({folderfooMode:"off",folderfooHost:null}))),fe}class Ri extends ${static{this.properties={defaultKind:{attribute:!1},lockKind:{attribute:!1},onAdded:{attribute:!1},onCancel:{attribute:!1}}}#e=new u("skill");#t=new u("local");#s=new u("");#n=new u([]);#r=new u(null);#g=new u("");#a=new u("");#i=new u("");#l=new u(!1);#u=new u(!1);#h=new u(!1);#d=new u("");#o=new u("");#f=new u(!1);#b=new u("");#k=new u(!1);#x=new u("");#y=new u(!1);#v=new u(!1);#m=new u([]);#p=new u("");#$=new u(!1);#w;static{this.styles=R`
1154
1154
  :host { display: block; }
1155
1155
  .backdrop {
1156
1156
  position: fixed; inset: 0; background: var(--overlay);
@@ -1253,106 +1253,106 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1253
1253
  .ff-folder-entry.selected { background: var(--accent); color: var(--accent-fg); }
1254
1254
  .ff-empty { padding: 12px; opacity: 0.6; font-size: 13px; }
1255
1255
  .ff-widget-slot { display: flex; }
1256
- `}constructor(){super(),new le(this),this.defaultKind="skill",this.lockKind=!1}connectedCallback(){super.connectedCallback(),this.#e.set(this.defaultKind),this.#_()}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this.#w)}async#_(e){const t=new URLSearchParams;e&&t.set("path",e),this.#u.value&&t.set("hidden","1");const s=await fetch(`/api/fs/list?${t.toString()}`);if(!s.ok){this.#i.set((await s.json()).error??"failed to list directory");return}const i=await s.json();this.#s.set(i.path),this.#r.set(i.parent),this.#n.set(i.entries),this.#i.set(""),this.renderRoot.querySelector(".browser")?.scrollTo(0,0)}#R(){this.#u.set(!this.#u.value),this.#_(this.#s.value)}#I(){this.#d.set(""),this.#h.set(!0)}#P(){this.#h.set(!1),this.#d.set("")}async#z(){const e=this.#d.value.trim();if(e){this.#i.set("");try{const t=await fetch("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:this.#s.value,name:e})}),s=await t.json();if(!t.ok){this.#i.set(s.error??"failed to create folder");return}this.#h.set(!1),this.#d.set(""),await this.#_(this.#s.value)}catch(t){this.#i.set(t.message)}}}#D(){this.#g.set(this.#s.value),this.#l.value||this.#l.set(this.#s.value.split("/").filter(Boolean).pop()??"")}async#O(){const e=this.#g.value||this.#s.value;if(e){this.#c.set(!0),this.#i.set("");try{const t=await fetch("/api/folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:this.#e.value,name:this.#l.value||void 0,path:e})}),s=await t.json();if(!t.ok){this.#i.set(s.error??"failed to add folder");return}this.onAdded()}finally{this.#c.set(!1)}}}async#M(){if(this.#k.value)return;const{folderfooMode:e,folderfooHost:t}=await ye();if(e==="off"||!t)return;let s=null;try{s=localStorage.getItem("folderfoo_token")}catch{}s&&(this.#o.set(t),this.#x.set(ne),this.#y.set(!0),this.#A(s))}async#L(){if(!this.#o.value){this.#i.set("enter a server URL first");return}this.#i.set("");try{await dt(()=>import(`${this.#o.value}/elements/folderfoo-profile-circle.js`),[]),this.#f.set(!0),this.#b.set(""),await this.updateComplete;const e=this.renderRoot.querySelector(".ff-widget-slot");if(e&&!e.querySelector("folderfoo-profile-circle")){const t=document.createElement("folderfoo-profile-circle");t.setAttribute("app-name","Memory Bucket"),e.appendChild(t)}this.#w=setInterval(()=>this.#S(),800),this.#S()}catch(e){this.#b.set(e.message)}}#S(){let e=null;try{e=localStorage.getItem("folderfoo_token")}catch{}!e||this.#k.value||(clearInterval(this.#w),this.#A(e))}async#A(e){this.#v.set(!0),this.#i.set("");try{const t=await fetch("/api/folderfoo/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({server:this.#o.value,token:e})}),s=await t.json();if(!t.ok){this.#i.set(s.error??"failed to persist folderfoo session");return}this.#k.set(!0),this.#x.set(ne),await this.#F()}finally{this.#v.set(!1)}}async#F(){this.#$.set(!0),this.#i.set("");try{const e=new URLSearchParams({server:this.#o.value,tenantId:this.#x.value}),t=await fetch(`/api/folderfoo/folders?${e.toString()}`),s=await t.json();if(!t.ok){this.#i.set(s.error??"failed to list folderfoo folders");return}this.#m.set(s)}finally{this.#$.set(!1)}}#N(e){this.#p.set(e),this.#l.value||this.#l.set(e.split("/").filter(Boolean).pop()??this.#x.value)}async#T(){if(this.#p.value){this.#c.set(!0),this.#i.set("");try{const e=await fetch("/api/remote-folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:this.#e.value,name:this.#l.value||void 0,server:this.#o.value,tenantId:this.#x.value,folderPath:this.#p.value})}),t=await e.json();if(!e.ok){this.#i.set(t.error??"failed to connect folder");return}this.onAdded()}finally{this.#c.set(!1)}}}#q(){const e=this.#n.value;return h`
1256
+ `}constructor(){super(),new ce(this),this.defaultKind="skill",this.lockKind=!1}connectedCallback(){super.connectedCallback(),this.#e.set(this.defaultKind),this.#_()}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this.#w)}async#_(e){const t=new URLSearchParams;e&&t.set("path",e),this.#u.value&&t.set("hidden","1");const s=await fetch(`/api/fs/list?${t.toString()}`);if(!s.ok){this.#i.set((await s.json()).error??"failed to list directory");return}const i=await s.json();this.#s.set(i.path),this.#r.set(i.parent),this.#n.set(i.entries),this.#i.set(""),this.renderRoot.querySelector(".browser")?.scrollTo(0,0)}#z(){this.#u.set(!this.#u.value),this.#_(this.#s.value)}#C(){this.#d.set(""),this.#h.set(!0)}#R(){this.#h.set(!1),this.#d.set("")}async#A(){const e=this.#d.value.trim();if(e){this.#i.set("");try{const t=await fetch("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:this.#s.value,name:e})}),s=await t.json();if(!t.ok){this.#i.set(s.error??"failed to create folder");return}this.#h.set(!1),this.#d.set(""),await this.#_(this.#s.value)}catch(t){this.#i.set(t.message)}}}#P(){this.#g.set(this.#s.value),this.#a.value||this.#a.set(this.#s.value.split("/").filter(Boolean).pop()??"")}async#L(){const e=this.#g.value||this.#s.value;if(e){this.#l.set(!0),this.#i.set("");try{const t=await fetch("/api/folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:this.#e.value,name:this.#a.value||void 0,path:e})}),s=await t.json();if(!t.ok){this.#i.set(s.error??"failed to add folder");return}this.onAdded()}finally{this.#l.set(!1)}}}async#N(){if(this.#y.value)return;const{folderfooMode:e,folderfooHost:t}=await te();if(e==="off"||!t)return;let s=null;try{s=localStorage.getItem("folderfoo_token")}catch{}s&&(this.#o.set(t),this.#x.set(oe),this.#k.set(!0),this.#O(s))}async#I(){if(!this.#o.value){this.#i.set("enter a server URL first");return}this.#i.set("");try{await ut(()=>import(`${this.#o.value}/elements/folderfoo-profile-circle.js`),[]),this.#f.set(!0),this.#b.set(""),await this.updateComplete;const e=this.renderRoot.querySelector(".ff-widget-slot");if(e&&!e.querySelector("folderfoo-profile-circle")){const t=document.createElement("folderfoo-profile-circle");t.setAttribute("app-name","Memory Bucket"),e.appendChild(t)}this.#w=setInterval(()=>this.#D(),800),this.#D()}catch(e){this.#b.set(e.message)}}#D(){let e=null;try{e=localStorage.getItem("folderfoo_token")}catch{}!e||this.#y.value||(clearInterval(this.#w),this.#O(e))}async#O(e){this.#v.set(!0),this.#i.set("");try{const t=await fetch("/api/folderfoo/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({server:this.#o.value,token:e})}),s=await t.json();if(!t.ok){this.#i.set(s.error??"failed to persist folderfoo session");return}this.#y.set(!0),this.#x.set(oe),await this.#F()}finally{this.#v.set(!1)}}async#F(){this.#$.set(!0),this.#i.set("");try{const e=new URLSearchParams({server:this.#o.value,tenantId:this.#x.value}),t=await fetch(`/api/folderfoo/folders?${e.toString()}`),s=await t.json();if(!t.ok){this.#i.set(s.error??"failed to list folderfoo folders");return}this.#m.set(s)}finally{this.#$.set(!1)}}#q(e){this.#p.set(e),this.#a.value||this.#a.set(e.split("/").filter(Boolean).pop()??this.#x.value)}async#U(){if(this.#p.value){this.#l.set(!0),this.#i.set("");try{const e=await fetch("/api/remote-folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:this.#e.value,name:this.#a.value||void 0,server:this.#o.value,tenantId:this.#x.value,folderPath:this.#p.value})}),t=await e.json();if(!e.ok){this.#i.set(t.error??"failed to connect folder");return}this.onAdded()}finally{this.#l.set(!1)}}}#T(){const e=this.#n.value;return c`
1257
1257
  <div class="breadcrumb-row">
1258
1258
  <div class="breadcrumb">${this.#s.value}</div>
1259
- <button class="new-folder-btn" @click=${()=>this.#I()}>+ New folder</button>
1259
+ <button class="new-folder-btn" @click=${()=>this.#C()}>+ New folder</button>
1260
1260
  <label class="hidden-toggle">
1261
- <input type="checkbox" .checked=${this.#u.value} @change=${()=>this.#R()} />
1261
+ <input type="checkbox" .checked=${this.#u.value} @change=${()=>this.#z()} />
1262
1262
  Show hidden
1263
1263
  </label>
1264
1264
  </div>
1265
- ${this.#h.value?h`
1265
+ ${this.#h.value?c`
1266
1266
  <div class="new-folder-row">
1267
1267
  <input
1268
1268
  type="text"
1269
1269
  placeholder="Folder name"
1270
1270
  .value=${this.#d.value}
1271
1271
  @input=${t=>this.#d.set(t.target.value)}
1272
- @keydown=${t=>{t.key==="Enter"&&this.#z(),t.key==="Escape"&&this.#P()}}
1272
+ @keydown=${t=>{t.key==="Enter"&&this.#A(),t.key==="Escape"&&this.#R()}}
1273
1273
  />
1274
- <button @click=${()=>this.#z()}>Create</button>
1275
- <button @click=${()=>this.#P()}>Cancel</button>
1274
+ <button @click=${()=>this.#A()}>Create</button>
1275
+ <button @click=${()=>this.#R()}>Cancel</button>
1276
1276
  </div>
1277
1277
  `:""}
1278
1278
  <div class="browser">
1279
- ${this.#r.value?h`<div class="entry up" @click=${()=>this.#_(this.#r.value)}>
1279
+ ${this.#r.value?c`<div class="entry up" @click=${()=>this.#_(this.#r.value)}>
1280
1280
  <span class="icon">📁</span> ..
1281
1281
  </div>`:""}
1282
- ${e.length===0&&!this.#r.value?h`<div class="empty">No subdirectories here.</div>`:e.map(t=>h`<div class="entry" @click=${()=>this.#_(t.path)}>
1282
+ ${e.length===0&&!this.#r.value?c`<div class="empty">No subdirectories here.</div>`:e.map(t=>c`<div class="entry" @click=${()=>this.#_(t.path)}>
1283
1283
  <span class="icon">📁</span> ${t.name}
1284
1284
  </div>`)}
1285
1285
  </div>
1286
1286
  <div class="footer">
1287
- <button class="secondary" @click=${()=>this.#D()}>
1287
+ <button class="secondary" @click=${()=>this.#P()}>
1288
1288
  Select this folder
1289
1289
  </button>
1290
- ${this.#g.value?h`<div class="selected-row">Selected: <span class="path">${this.#g.value}</span></div>`:""}
1290
+ ${this.#g.value?c`<div class="selected-row">Selected: <span class="path">${this.#g.value}</span></div>`:""}
1291
1291
  <div>
1292
1292
  <label>Folder name</label>
1293
1293
  <input
1294
1294
  type="text"
1295
- .value=${this.#l.value}
1295
+ .value=${this.#a.value}
1296
1296
  placeholder="e.g. personal, company"
1297
- @input=${t=>this.#l.set(t.target.value)}
1297
+ @input=${t=>this.#a.set(t.target.value)}
1298
1298
  />
1299
1299
  </div>
1300
- ${this.#i.value?h`<div class="error">${this.#i.value}</div>`:""}
1300
+ ${this.#i.value?c`<div class="error">${this.#i.value}</div>`:""}
1301
1301
  <div class="actions">
1302
1302
  <button class="secondary" @click=${()=>this.onCancel()}>Cancel</button>
1303
1303
  <button
1304
1304
  class="primary"
1305
- ?disabled=${!this.#g.value||this.#c.value}
1306
- @click=${()=>this.#O()}
1305
+ ?disabled=${!this.#g.value||this.#l.value}
1306
+ @click=${()=>this.#L()}
1307
1307
  >
1308
- ${this.#c.value?"Adding…":"Add folder"}
1308
+ ${this.#l.value?"Adding…":"Add folder"}
1309
1309
  </button>
1310
1310
  </div>
1311
1311
  </div>
1312
- `}#a(){const e=this.#m.value;return this.#y.value&&!this.#k.value?h`
1312
+ `}#M(){const e=this.#m.value;return this.#k.value&&!this.#y.value?c`
1313
1313
  <div class="ff-body">
1314
1314
  <div class="ff-connected-row"><span class="ff-connected-dot"></span> Already signed in to ${this.#o.value} — connecting…</div>
1315
- ${this.#i.value?h`<div class="error">${this.#i.value}</div>`:""}
1315
+ ${this.#i.value?c`<div class="error">${this.#i.value}</div>`:""}
1316
1316
  <div class="actions">
1317
1317
  <button class="secondary" @click=${()=>this.onCancel()}>Cancel</button>
1318
1318
  </div>
1319
1319
  </div>
1320
- `:this.#k.value?h`
1320
+ `:this.#y.value?c`
1321
1321
  <div class="ff-body">
1322
1322
  <div class="ff-connected-row"><span class="ff-connected-dot"></span> Connected to ${this.#o.value}</div>
1323
- ${e.length>0?h`
1323
+ ${e.length>0?c`
1324
1324
  <div class="ff-folder-list">
1325
- ${e.map(t=>h`<div
1325
+ ${e.map(t=>c`<div
1326
1326
  class="ff-folder-entry ${this.#p.value===t.path?"selected":""}"
1327
- @click=${()=>this.#N(t.path)}
1327
+ @click=${()=>this.#q(t.path)}
1328
1328
  >
1329
1329
  ${t.path}
1330
1330
  </div>`)}
1331
1331
  </div>
1332
- `:this.#$.value?h`<div class="ff-hint">Loading folders…</div>`:h`<div class="ff-empty">No folders found.</div>`}
1333
- ${this.#p.value?h`<div class="selected-row">Selected: <span class="path">${this.#p.value}</span></div>`:""}
1332
+ `:this.#$.value?c`<div class="ff-hint">Loading folders…</div>`:c`<div class="ff-empty">No folders found.</div>`}
1333
+ ${this.#p.value?c`<div class="selected-row">Selected: <span class="path">${this.#p.value}</span></div>`:""}
1334
1334
  <div>
1335
1335
  <label>Folder name</label>
1336
1336
  <input
1337
1337
  type="text"
1338
- .value=${this.#l.value}
1338
+ .value=${this.#a.value}
1339
1339
  placeholder="e.g. team-qa"
1340
- @input=${t=>this.#l.set(t.target.value)}
1340
+ @input=${t=>this.#a.set(t.target.value)}
1341
1341
  />
1342
1342
  </div>
1343
- ${this.#i.value?h`<div class="error">${this.#i.value}</div>`:""}
1343
+ ${this.#i.value?c`<div class="error">${this.#i.value}</div>`:""}
1344
1344
  <div class="actions">
1345
1345
  <button class="secondary" @click=${()=>this.onCancel()}>Cancel</button>
1346
1346
  <button
1347
1347
  class="primary"
1348
- ?disabled=${!this.#p.value||this.#c.value}
1349
- @click=${()=>this.#T()}
1348
+ ?disabled=${!this.#p.value||this.#l.value}
1349
+ @click=${()=>this.#U()}
1350
1350
  >
1351
- ${this.#c.value?"Connecting…":"Connect folder"}
1351
+ ${this.#l.value?"Connecting…":"Connect folder"}
1352
1352
  </button>
1353
1353
  </div>
1354
1354
  </div>
1355
- `:h`
1355
+ `:c`
1356
1356
  <div class="ff-body">
1357
1357
  <div class="ff-hint">
1358
1358
  Sign in to a folderfoo server to mount one of your folders (or a folder shared with you) as a
@@ -1367,29 +1367,29 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1367
1367
  placeholder="https://folderfoo.example.com"
1368
1368
  ?disabled=${this.#f.value}
1369
1369
  @input=${t=>this.#o.set(t.target.value)}
1370
- @keydown=${t=>t.key==="Enter"&&this.#L()}
1370
+ @keydown=${t=>t.key==="Enter"&&this.#I()}
1371
1371
  />
1372
1372
  </div>
1373
- ${this.#f.value?h`
1373
+ ${this.#f.value?c`
1374
1374
  <div class="ff-hint">Sign in below (this is folderfoo's own login widget, same one every folderfoo app uses):</div>
1375
1375
  <div class="ff-widget-slot"></div>
1376
- ${this.#v.value?h`<div class="ff-hint">Finishing connection…</div>`:""}
1377
- `:h`
1376
+ ${this.#v.value?c`<div class="ff-hint">Finishing connection…</div>`:""}
1377
+ `:c`
1378
1378
  <div class="actions" style="justify-content: flex-start; margin-top: 0;">
1379
- <button class="secondary" @click=${()=>this.#L()}>Continue</button>
1379
+ <button class="secondary" @click=${()=>this.#I()}>Continue</button>
1380
1380
  </div>
1381
1381
  `}
1382
- ${this.#b.value?h`<div class="error">${this.#b.value}</div>`:""}
1383
- ${this.#i.value?h`<div class="error">${this.#i.value}</div>`:""}
1382
+ ${this.#b.value?c`<div class="error">${this.#b.value}</div>`:""}
1383
+ ${this.#i.value?c`<div class="error">${this.#i.value}</div>`:""}
1384
1384
  <div class="actions">
1385
1385
  <button class="secondary" @click=${()=>this.onCancel()}>Cancel</button>
1386
1386
  </div>
1387
1387
  </div>
1388
- `}render(){return h`
1388
+ `}render(){return c`
1389
1389
  <div class="backdrop" @click=${e=>e.target===e.currentTarget&&this.onCancel()}>
1390
1390
  <div class="modal">
1391
1391
  <div class="header"><h2>Add a folder</h2></div>
1392
- ${this.lockKind?h``:h`
1392
+ ${this.lockKind?c``:c`
1393
1393
  <div class="kind-toggle">
1394
1394
  <button
1395
1395
  class=${this.#e.value==="skill"?"active":""}
@@ -1411,21 +1411,108 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1411
1411
  </button>
1412
1412
  <button
1413
1413
  class=${this.#t.value==="folderfoo"?"active":""}
1414
- @click=${()=>{this.#t.set("folderfoo"),this.#M()}}
1414
+ @click=${()=>{this.#t.set("folderfoo"),this.#N()}}
1415
1415
  >
1416
1416
  Connect folderfoo
1417
1417
  </button>
1418
1418
  </div>
1419
- ${this.#t.value==="local"?this.#q():this.#a()}
1419
+ ${this.#t.value==="local"?this.#T():this.#M()}
1420
1420
  </div>
1421
1421
  </div>
1422
- `}}customElements.define("add-folder-modal",Ai);function Ti(r){const e=r.split(":");if(e.length===1)return{folderPath:"",name:e[0]};if(e.length===2){const[n,o]=e;return n.includes("/")?{folderPath:n,name:o}:{owner:n,folderPath:"",name:o}}const[t,s,...i]=e;return{owner:t===""?void 0:t,folderPath:s,name:i.join(":")}}const Ei=[{value:"all",label:"All"},{value:"skill",label:"Skills"},{value:"memory",label:"Memories"}],ct=[{value:"all",label:"Show all"},{value:"hide",label:"Hide"},{value:"only",label:"Only"}],Ri={tags:[],statuses:[],owners:[],doc_types:[],key_types:[],folders:[]},Pi={skill:[],memory:[]},Rt="mem-bucket-split-pct",Pt=20,zt=80;function zi(){const r=Number(localStorage.getItem(Rt));return Number.isFinite(r)&&r>=Pt&&r<=zt?r:40}const Lt="mem-bucket-theme",fe=["system","light","dark"],Li={system:"◐",light:"☀",dark:"☾"},Ii={system:"Auto",light:"Light",dark:"Dark"};function Di(){const r=localStorage.getItem(Lt);return r==="light"||r==="dark"?r:"system"}function ht(r){r==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",r)}function Oi(){const r=location.hash.slice(1);if(!r)return{};const e=new URLSearchParams(r),t={},s=e.get("q");s&&(t.query=s);const i=e.get("type");(i==="skill"||i==="memory"||i==="all")&&(t.typeFilter=i);const n=e.getAll("tag");n.length&&(t.activeTags=n);const o=e.getAll("folder");o.length&&(t.activeFolders=o);const a=e.get("sort");a&&(t.sort=a);const l=e.get("deprecated");l==="0"?t.deprecatedFilter="hide":l==="1"&&(t.deprecatedFilter="only");const c=e.get("paused");c==="0"?t.pausedFilter="hide":c==="1"&&(t.pausedFilter="only");const p=e.get("date_from");p&&(t.dateFrom=p);const d=e.get("date_to");return d&&(t.dateTo=d),t}class Mi extends _{static{this.styles=O`
1422
+ `}}customElements.define("add-folder-modal",Ri);function ct(r){const e=Date.now()-r,t=Math.floor(e/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;const s=Math.floor(t/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}class zi extends ${static{this.properties={channels:{attribute:!1},selected:{attribute:!1},detail:{attribute:!1},loading:{attribute:!1},onSelect:{attribute:!1},onRefresh:{attribute:!1}}}static{this.styles=R`
1423
+ :host { display: flex; flex: 1 1 auto; min-height: 0; }
1424
+ .nav {
1425
+ flex: 0 0 260px;
1426
+ overflow-y: auto;
1427
+ border-right: 1px solid var(--border);
1428
+ display: flex;
1429
+ flex-direction: column;
1430
+ }
1431
+ .nav-header {
1432
+ padding: 10px 14px;
1433
+ padding-top: 46px;
1434
+ font-size: 11px;
1435
+ font-weight: 600;
1436
+ text-transform: uppercase;
1437
+ opacity: 0.6;
1438
+ background: var(--bg);
1439
+ border-bottom: 1px solid var(--border);
1440
+ display: flex;
1441
+ align-items: center;
1442
+ justify-content: space-between;
1443
+ }
1444
+ .refresh-btn {
1445
+ border: none; background: none; color: inherit; cursor: pointer; opacity: 0.6;
1446
+ font-size: 12px; padding: 2px 4px; border-radius: 4px;
1447
+ }
1448
+ .refresh-btn:hover { opacity: 1; background: var(--hover); }
1449
+ .channel-row {
1450
+ padding: 10px 14px;
1451
+ border-bottom: 1px solid var(--border);
1452
+ cursor: pointer;
1453
+ display: flex;
1454
+ flex-direction: column;
1455
+ gap: 2px;
1456
+ }
1457
+ .channel-row:hover { background: var(--hover); }
1458
+ .channel-row.active { background: var(--accent-tint); border-left: 3px solid var(--accent); padding-left: 11px; }
1459
+ .channel-name { font-size: 13px; font-weight: 600; font-family: ui-monospace, monospace; }
1460
+ .channel-meta { font-size: 11px; opacity: 0.6; }
1461
+ .empty { padding: 24px; opacity: 0.6; font-size: 13px; }
1462
+ .content-pane { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 16px 20px; padding-top: 46px; }
1463
+ .content-header {
1464
+ display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
1465
+ margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
1466
+ }
1467
+ .content-title { font-size: 15px; font-weight: 700; font-family: ui-monospace, monospace; }
1468
+ .content-meta { font-size: 12px; opacity: 0.6; }
1469
+ .content-body {
1470
+ white-space: pre-wrap;
1471
+ word-break: break-word;
1472
+ font-family: ui-monospace, monospace;
1473
+ font-size: 13px;
1474
+ line-height: 1.5;
1475
+ }
1476
+ .no-selection {
1477
+ flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
1478
+ opacity: 0.5; font-size: 13px; padding-top: 46px;
1479
+ }
1480
+ .placeholder-empty { opacity: 0.5; font-style: italic; }
1481
+ `}#e(){return!this.channels||this.channels.length===0?c`<div class="empty">No live channels right now. Channels appear here once an agent posts to one with memory_channel_post — they're ephemeral and disappear after a long idle period or server restart.</div>`:[...this.channels].sort((t,s)=>s.lastActivityAt-t.lastActivityAt).map(t=>c`
1482
+ <div
1483
+ class="channel-row ${this.selected===t.name?"active":""}"
1484
+ @click=${()=>this.onSelect(t.name)}
1485
+ >
1486
+ <span class="channel-name">${t.name}</span>
1487
+ <span class="channel-meta">${ct(t.lastActivityAt)}</span>
1488
+ </div>
1489
+ `)}#t(){return this.selected?this.loading?c`<div class="content-pane"><div class="content-meta">Loading…</div></div>`:this.detail?c`
1490
+ <div class="content-pane">
1491
+ <div class="content-header">
1492
+ <span class="content-title">${this.detail.name}</span>
1493
+ <span class="content-meta">last activity ${ct(this.detail.lastActivityAt)}</span>
1494
+ </div>
1495
+ ${this.detail.content?c`<div class="content-body">${this.detail.content}</div>`:c`<div class="placeholder-empty">Channel exists but nothing has been posted yet.</div>`}
1496
+ </div>
1497
+ `:c`<div class="content-pane"><div class="content-meta">Channel not found — it may have gone idle and been swept.</div></div>`:c`<div class="no-selection">Select a channel to view its content.</div>`}render(){return c`
1498
+ <div class="nav">
1499
+ <div class="nav-header">
1500
+ <span>Live channels</span>
1501
+ <button class="refresh-btn" title="Refresh" @click=${()=>this.onRefresh()}>⟳</button>
1502
+ </div>
1503
+ ${this.#e()}
1504
+ </div>
1505
+ ${this.#t()}
1506
+ `}}customElements.define("channel-view",zi);function Pi(r){const e=r.split(":");if(e.length===1)return{folderPath:"",name:e[0]};if(e.length===2){const[n,o]=e;return n.includes("/")?{folderPath:n,name:o}:{owner:n,folderPath:"",name:o}}const[t,s,...i]=e;return{owner:t===""?void 0:t,folderPath:s,name:i.join(":")}}const Pt=new u({mode:"off",username:null});let ht=!1;function Li(){if(ht)return;ht=!0;const r=new EventSource("/api/folderfoo/identity-stream");r.onmessage=e=>{try{Pt.set(JSON.parse(e.data))}catch{}}}const Ii=[{value:"all",label:"All"},{value:"skill",label:"Skills"},{value:"memory",label:"Memories"}],dt=[{value:"all",label:"Show all"},{value:"hide",label:"Hide"},{value:"only",label:"Only"}],Di={tags:[],statuses:[],owners:[],doc_types:[],key_types:[],folders:[]},Oi={skill:[],memory:[]},Lt="mem-bucket-split-pct",It=20,Dt=80;function Mi(){const r=Number(localStorage.getItem(Lt));return Number.isFinite(r)&&r>=It&&r<=Dt?r:40}const Ot="mem-bucket-theme",ge=["system","light","dark"],Ni={system:"◐",light:"☀",dark:"☾"},Fi={system:"Auto",light:"Light",dark:"Dark"};function qi(){const r=localStorage.getItem(Ot);return r==="light"||r==="dark"?r:"system"}function pt(r){r==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",r)}function Ui(){const r=location.hash.slice(1);if(!r)return{};const e=new URLSearchParams(r),t={},s=e.get("q");s&&(t.query=s);const i=e.get("type");(i==="skill"||i==="memory"||i==="all")&&(t.typeFilter=i);const n=e.getAll("tag");n.length&&(t.activeTags=n);const o=e.getAll("folder");o.length&&(t.activeFolders=o);const a=e.get("sort");a&&(t.sort=a);const l=e.get("deprecated");l==="0"?t.deprecatedFilter="hide":l==="1"&&(t.deprecatedFilter="only");const h=e.get("paused");h==="0"?t.pausedFilter="hide":h==="1"&&(t.pausedFilter="only");const p=e.get("date_from");p&&(t.dateFrom=p);const d=e.get("date_to");return d&&(t.dateTo=d),t}class ji extends ${static{this.styles=R`
1423
1507
  :host { display: flex; flex-direction: column; height: 100vh; }
1424
- .theme-toggle {
1425
- position: fixed;
1426
- top: 10px;
1427
- right: 12px;
1428
- z-index: 10;
1508
+ .toolbar {
1509
+ display: flex;
1510
+ align-items: center;
1511
+ gap: 6px;
1512
+ margin-left: auto;
1513
+ flex-shrink: 0;
1514
+ }
1515
+ .theme-toggle, .reindex-toggle {
1429
1516
  width: 28px;
1430
1517
  height: 28px;
1431
1518
  border: 1px solid var(--border-strong);
@@ -1440,30 +1527,28 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1440
1527
  justify-content: center;
1441
1528
  opacity: 0.75;
1442
1529
  }
1443
- .theme-toggle:hover { opacity: 1; background: var(--hover); }
1444
- .reindex-toggle {
1445
- position: fixed;
1446
- top: 10px;
1447
- right: 46px;
1448
- z-index: 10;
1449
- width: 28px;
1530
+ .theme-toggle:hover, .reindex-toggle:hover { opacity: 1; background: var(--hover); }
1531
+ .folderfoo-slot { display: contents; }
1532
+ .reindex-toggle:disabled { cursor: default; opacity: 0.4; }
1533
+ .reindex-toggle.spinning { animation: reindex-spin 0.8s linear infinite; }
1534
+ @keyframes reindex-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
1535
+ .channels-toggle {
1450
1536
  height: 28px;
1537
+ padding: 0 12px;
1451
1538
  border: 1px solid var(--border-strong);
1452
- border-radius: 50%;
1539
+ border-radius: 14px;
1453
1540
  background: var(--bg);
1454
1541
  color: inherit;
1455
1542
  cursor: pointer;
1456
- font-size: 14px;
1543
+ font-size: 12px;
1457
1544
  line-height: 1;
1458
1545
  display: flex;
1459
1546
  align-items: center;
1460
- justify-content: center;
1547
+ gap: 5px;
1461
1548
  opacity: 0.75;
1462
1549
  }
1463
- .reindex-toggle:hover { opacity: 1; background: var(--hover); }
1464
- .reindex-toggle:disabled { cursor: default; opacity: 0.4; }
1465
- .reindex-toggle.spinning { animation: reindex-spin 0.8s linear infinite; }
1466
- @keyframes reindex-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
1550
+ .channels-toggle:hover { opacity: 1; background: var(--hover); }
1551
+ .channels-toggle.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); opacity: 1; }
1467
1552
  .filters {
1468
1553
  padding: 12px 16px;
1469
1554
  border-bottom: 1px solid var(--border);
@@ -1575,15 +1660,32 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1575
1660
  border-bottom: 1px solid var(--border);
1576
1661
  background: var(--bg-subtle);
1577
1662
  }
1663
+ .folders-bar .folder-chips {
1664
+ display: flex;
1665
+ gap: 6px;
1666
+ align-items: center;
1667
+ flex-wrap: wrap;
1668
+ flex: 1 1 auto;
1669
+ min-width: 0;
1670
+ }
1671
+ .toolbar-bar {
1672
+ display: flex;
1673
+ align-items: center;
1674
+ padding: 10px 16px;
1675
+ border-bottom: 1px solid var(--border);
1676
+ background: var(--bg-subtle);
1677
+ }
1578
1678
  .folder-chip {
1579
1679
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 8px 3px 10px; font-size: 12px;
1580
1680
  cursor: pointer; background: none; color: inherit; display: inline-flex; align-items: center; gap: 6px;
1581
1681
  }
1582
- .folder-chip.active { background: var(--purple-tint); border-color: var(--purple); color: var(--purple-fg); }
1682
+ /* Active chips invert to a solid white fill with dark text in both themes, so they read
1683
+ clearly against remote chips' accent outline instead of blending into a similar tint. */
1684
+ .folder-chip.active { background: #ffffff; border-color: var(--purple); color: #111111; }
1583
1685
  /* Remote (folderfoo) folders get the accent color instead of the default border, so they're
1584
1686
  visually distinct from local folders at a glance — active-state purple still wins when both apply. */
1585
1687
  .folder-chip.remote { border-color: var(--accent); color: var(--accent); }
1586
- .folder-chip.remote.active { background: var(--purple-tint); border-color: var(--purple); color: var(--purple-fg); }
1688
+ .folder-chip.remote.active { background: #ffffff; border-color: var(--purple); color: #111111; }
1587
1689
  .folder-chip .remote-dot {
1588
1690
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
1589
1691
  }
@@ -1643,27 +1745,52 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1643
1745
  cursor: pointer;
1644
1746
  }
1645
1747
  .bulk-bar button.danger { border-color: var(--danger); color: var(--danger); }
1646
- `}#e=Oi();#t=new u(this.#e.query??"");#s=new u(this.#e.typeFilter??"all");#n=new u(this.#e.activeTags??[]);#r=new u(this.#e.activeFolders??[]);#g=new u([]);#l=new u(Ri);#i=new u(null);#c=new u(Pi);#u=new u(!1);#h=new u("");#d=new u(!1);#o=new u(zi());#f=new u("");#b=new u(!1);#y=new u(this.#e.sort??"mtime_desc");#x=new u(this.#e.deprecatedFilter??"all");#k=new u(this.#e.pausedFilter??"all");#v=new u(this.#e.dateFrom??"");#m=new u(this.#e.dateTo??"");#p=new u(new Set);#$=new u(Di());#w=new u(!1);#_=e=>this.#O(e);#R=()=>this.#M();constructor(){super(),new le(this),ht(this.#$.value)}#I(e){this.#$.set(e),localStorage.setItem(Lt,e),ht(e)}#P(){const e=fe[(fe.indexOf(this.#$.value)+1)%fe.length];this.#I(e)}async#z(){if(!this.#w.value){this.#w.set(!0);try{await fetch("/api/rebuild-cache",{method:"POST"}),await Promise.all([this.#E(),this.#C(),this.#a()])}finally{this.#w.set(!1)}}}#D(e){e.preventDefault(),this.#b.set(!0),document.addEventListener("pointermove",this.#_),document.addEventListener("pointerup",this.#R)}#O(e){const t=this.renderRoot.querySelector(".body-region");if(!t)return;const s=t.getBoundingClientRect(),i=(e.clientX-s.left)/s.width*100;this.#o.set(Math.min(zt,Math.max(Pt,i)))}#M(){this.#b.set(!1),document.removeEventListener("pointermove",this.#_),document.removeEventListener("pointerup",this.#R),localStorage.setItem(Rt,String(this.#o.value))}#L=new hs(()=>{const e=new URLSearchParams;this.#s.value!=="all"&&e.set("type",this.#s.value),this.#t.value.trim()&&e.set("q",this.#t.value.trim());for(const t of this.#n.value)e.append("tag",t);for(const t of this.#r.value)e.append("folder",t);return this.#y.value!=="mtime_desc"&&e.set("sort",this.#y.value),this.#x.value==="hide"?e.set("deprecated","0"):this.#x.value==="only"&&e.set("deprecated","1"),this.#k.value==="hide"?e.set("paused","0"):this.#k.value==="only"&&e.set("paused","1"),this.#v.value&&e.set("date_from",this.#v.value),this.#m.value&&e.set("date_to",this.#m.value),e.toString()});#S=()=>this.#q();#A=e=>this.#F(e);connectedCallback(){super.connectedCallback(),this.#a(),this.#C(),this.#E(),window.addEventListener("focus",this.#S),document.addEventListener("visibilitychange",this.#S),document.addEventListener("folderfoo-file-open",this.#A),this.#N()}async#F(e){const t=e.detail?.name;if(!t)return;const s=Ti(t);if(s.owner){this.#f.set(`"${s.name}" is from a shared folder — opening shared files here isn't supported yet.`);return}const{folderfooMode:i,folderfooHost:n}=await ye();if(!(i==="off"||!n))try{const o=await fetch("/api/folderfoo/resolve-open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({server:n,tenantId:ne,folderPath:s.folderPath,name:s.name})}),a=await o.json();if(!o.ok){this.#f.set(a.error??`couldn't open "${s.name}"`);return}this.#f.set(""),this.#i.set({table:a.table,id:a.id})}catch(o){this.#f.set(o.message)}}async#N(){if(document.querySelector("folderfoo-profile-circle"))return;const{folderfooMode:e,folderfooHost:t}=await ye();e==="off"||!t||dt(()=>import(`${t}/elements/folderfoo-profile-circle.js`),[]).then(()=>{const s=document.createElement("folderfoo-profile-circle");s.setAttribute("app-name","Memory Bucket"),s.setAttribute("tenant-id",ne),document.body.appendChild(s)}).catch(s=>{console.warn("folderfoo-profile-circle unavailable:",s.message)})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("focus",this.#S),document.removeEventListener("visibilitychange",this.#S),document.removeEventListener("folderfoo-file-open",this.#A)}#T=!1;async#q(){if(document.visibilityState==="visible"){if(this.#H().some(e=>e.remote)&&!this.#T){this.#T=!0;try{await fetch("/api/remote-folders/resync-all",{method:"POST"})}catch{}finally{this.#T=!1}}this.#a(),this.#C(),this.#E(),this.renderRoot.querySelector("detail-panel")?.refresh?.()}}async#a(){const e=this.#L.value;history.replaceState(null,"",e?`#${e}`:location.pathname+location.search);const t=await fetch(`/api/entries?${e}`);this.#g.set(await t.json()),this.renderRoot.querySelector("result-list")?.scrollTo(0,0)}async#C(){const e=this.#s.value==="all"?"":`?type=${this.#s.value}`,t=await fetch(`/api/facets${e}`);this.#l.set(await t.json())}async#E(){const e=await fetch("/api/folders");this.#c.set(await e.json()),this.#d.set(!0)}#Q(e){const t=this.#r.value;this.#r.set(t.includes(e)?t.filter(s=>s!==e):[...t,e]),this.#a()}async#V(e,t){if(t.stopPropagation(),window.prompt(`Type "${e.name}" to remove this ${e.kind} folder (files on disk are untouched):`)===e.name){this.#h.set(e.name);try{await fetch(`/api/folders/${e.kind}/${encodeURIComponent(e.name)}`,{method:"DELETE"}),this.#r.set(this.#r.value.filter(i=>i!==e.name)),await Promise.all([this.#E(),this.#C(),this.#a()])}finally{this.#h.set("")}}}#j(){this.#u.set(!1),this.#E(),this.#C(),this.#a()}#H(){return[...this.#c.value.skill,...this.#c.value.memory]}#Y(e){this.#s.set(e),this.#n.set([]),this.#C(),this.#a()}#J(e){const t=this.#n.value;this.#n.set(t.includes(e)?t.filter(s=>s!==e):[...t,e]),this.#a()}#G(e){this.#n.value.includes(e)||this.#n.set([...this.#n.value,e]),this.#a()}#X(e){this.#r.value.includes(e)||this.#r.set([...this.#r.value,e]),this.#a()}#ee(e){this.#v.set(e),this.#m.set(e),this.#a()}#te(e){this.#t.set(e.target.value),this.#a()}#B(e){this.#t.set(e),this.#a()}#se(){this.#t.set(""),this.#a()}#ie(e){this.#i.set({table:e._table,id:e.id})}#re(e){this.#y.set(e.target.value),this.#a()}#ne(e){this.#x.set(e.target.value),this.#a()}#oe(e){this.#k.set(e.target.value),this.#a()}#ae(e){this.#v.set(e.target.value),this.#a()}#le(e){this.#m.set(e.target.value),this.#a()}#ce(){this.#v.set(""),this.#m.set(""),this.#a()}#he(e){const t=new Set(this.#p.value);t.has(e.id)?t.delete(e.id):t.add(e.id),this.#p.set(t)}#de(){return new Map(this.#g.value.map(e=>[e.id,e]))}#U(){const e=new Map,t=this.#de();for(const s of this.#p.value){const i=t.get(s);if(!i)continue;const n=e.get(i._table)??[];n.push(s),e.set(i._table,n)}return e}async#K(e){const t=this.#U();await Promise.all([...t.entries()].map(([s,i])=>fetch(`/api/entries/${s}/bulk/deprecated`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:i,deprecated:e})}))),this.#p.set(new Set),await this.#a()}async#Z(e){const t=this.#U();await Promise.all([...t.entries()].map(([s,i])=>fetch(`/api/entries/${s}/bulk/paused`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:i,paused:e})}))),this.#p.set(new Set),await this.#a()}async#pe(){if(!window.confirm(`Delete ${this.#p.value.size} doc(s)? This can't be undone.`))return;const e=this.#U();await Promise.all([...e.entries()].map(([t,s])=>fetch(`/api/entries/${t}/bulk/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:s})}))),this.#p.set(new Set),await this.#a()}#W(){const e=this.#$.value;return h`
1748
+ `}#e=Ui();#t=new u(this.#e.query??"");#s=new u(this.#e.typeFilter??"all");#n=new u(this.#e.activeTags??[]);#r=new u(this.#e.activeFolders??[]);#g=new u([]);#a=new u(Di);#i=new u(null);#l=new u(Oi);#u=new u(!1);#h=new u("");#d=new u(!1);#o=new u(Mi());#f=new u("");#b=new u(!1);#k=new u(this.#e.sort??"mtime_desc");#x=new u(this.#e.deprecatedFilter??"all");#y=new u(this.#e.pausedFilter??"all");#v=new u(this.#e.dateFrom??"");#m=new u(this.#e.dateTo??"");#p=new u(new Set);#$=new u(qi());#w=new u(!1);#_=new u("entries");#z=new u([]);#C=new u(null);#R=new u(null);#A=new u(!1);#P=e=>this.#F(e);#L=()=>this.#q();constructor(){super(),new ce(this),pt(this.#$.value)}#N(e){this.#$.set(e),localStorage.setItem(Ot,e),pt(e)}#I(){const e=ge[(ge.indexOf(this.#$.value)+1)%ge.length];this.#N(e)}async#D(){if(!this.#w.value){this.#w.set(!0);try{await fetch("/api/rebuild-cache",{method:"POST"}),await Promise.all([this.#E(),this.#S(),this.#c()])}finally{this.#w.set(!1)}}}#O(e){e.preventDefault(),this.#b.set(!0),document.addEventListener("pointermove",this.#P),document.addEventListener("pointerup",this.#L)}#F(e){const t=this.renderRoot.querySelector(".body-region");if(!t)return;const s=t.getBoundingClientRect(),i=(e.clientX-s.left)/s.width*100;this.#o.set(Math.min(Dt,Math.max(It,i)))}#q(){this.#b.set(!1),document.removeEventListener("pointermove",this.#P),document.removeEventListener("pointerup",this.#L),localStorage.setItem(Lt,String(this.#o.value))}#U=new us(()=>{const e=new URLSearchParams;this.#s.value!=="all"&&e.set("type",this.#s.value),this.#t.value.trim()&&e.set("q",this.#t.value.trim());for(const t of this.#n.value)e.append("tag",t);for(const t of this.#r.value)e.append("folder",t);return this.#k.value!=="mtime_desc"&&e.set("sort",this.#k.value),this.#x.value==="hide"?e.set("deprecated","0"):this.#x.value==="only"&&e.set("deprecated","1"),this.#y.value==="hide"?e.set("paused","0"):this.#y.value==="only"&&e.set("paused","1"),this.#v.value&&e.set("date_from",this.#v.value),this.#m.value&&e.set("date_to",this.#m.value),e.toString()});#T=()=>this.#ie();#M=e=>this.#te(e);#K=()=>this.#W();#Z;connectedCallback(){super.connectedCallback(),this.#c(),this.#S(),this.#E(),window.addEventListener("focus",this.#T),document.addEventListener("visibilitychange",this.#T),document.addEventListener("folderfoo-file-open",this.#M),window.addEventListener("folderfoo-auth-change",this.#K),this.#se(),this.#W(),Li(),this.#Z=Pt.subscribe(()=>this.#E())}async#te(e){const t=e.detail?.name;if(!t)return;const s=Pi(t);if(s.owner){this.#f.set(`"${s.name}" is from a shared folder — opening shared files here isn't supported yet.`);return}const{folderfooMode:i,folderfooHost:n}=await te();if(!(i==="off"||!n))try{const o=await fetch("/api/folderfoo/resolve-open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({server:n,tenantId:oe,folderPath:s.folderPath,name:s.name})}),a=await o.json();if(!o.ok){this.#f.set(a.error??`couldn't open "${s.name}"`);return}this.#f.set(""),this.#i.set({table:a.table,id:a.id})}catch(o){this.#f.set(o.message)}}async#se(){if(this.shadowRoot?.querySelector("folderfoo-profile-circle"))return;const{folderfooMode:e,folderfooHost:t}=await te();e==="off"||!t||ut(()=>import(`${t}/elements/folderfoo-profile-circle.js`),[]).then(async()=>{await this.updateComplete;const s=document.createElement("folderfoo-profile-circle");s.setAttribute("app-name","Memory Bucket"),s.setAttribute("tenant-id",oe),s.style.zoom="0.875",this.shadowRoot?.querySelector(".folderfoo-slot")?.appendChild(s)}).catch(s=>{console.warn("folderfoo-profile-circle unavailable:",s.message)})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("focus",this.#T),document.removeEventListener("visibilitychange",this.#T),document.removeEventListener("folderfoo-file-open",this.#M),window.removeEventListener("folderfoo-auth-change",this.#K),this.#Z?.()}async#W(){let e=null;try{e=localStorage.getItem("folderfoo_token")}catch{return}if(!e){fetch("/api/folderfoo/logout",{method:"POST"}).catch(()=>{});return}const{folderfooMode:t,folderfooHost:s}=await te();t==="off"||!s||fetch("/api/folderfoo/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({server:s,token:e})}).catch(()=>{})}#j=!1;async#ie(){if(document.visibilityState==="visible"){if(this.#J().some(e=>e.remote)&&!this.#j){this.#j=!0;try{await fetch("/api/remote-folders/resync-all",{method:"POST"})}catch{}finally{this.#j=!1}}this.#c(),this.#S(),this.#E(),this.renderRoot.querySelector("detail-panel")?.refresh?.()}}async#c(){const e=this.#U.value;history.replaceState(null,"",e?`#${e}`:location.pathname+location.search);const t=await fetch(`/api/entries?${e}`);this.#g.set(await t.json()),this.renderRoot.querySelector("result-list")?.scrollTo(0,0)}async#S(){const e=this.#s.value==="all"?"":`?type=${this.#s.value}`,t=await fetch(`/api/facets${e}`);this.#a.set(await t.json())}async#E(){const t=await(await fetch("/api/folders")).json();this.#l.set(t),this.#d.set(!0);const s=new Set([...t.skill,...t.memory].map(n=>n.name)),i=this.#r.value.filter(n=>s.has(n));i.length!==this.#r.value.length&&(this.#r.set(i),this.#c())}#re(e){this.#_.set(e),e==="channels"&&this.#V()}async#V(){const e=await fetch("/api/channels");this.#z.set(await e.json()),this.#C.value&&this.#Q(this.#C.value)}async#Q(e){this.#C.set(e),this.#A.set(!0);try{const t=await fetch(`/api/channels/${encodeURIComponent(e)}`);this.#R.set(t.ok?await t.json():null)}finally{this.#A.set(!1)}}#ne(e){const t=this.#r.value;this.#r.set(t.includes(e)?t.filter(s=>s!==e):[...t,e]),this.#c()}async#oe(e,t){if(t.stopPropagation(),window.prompt(`Type "${e.name}" to remove this ${e.kind} folder (files on disk are untouched):`)===e.name){this.#h.set(e.name);try{await fetch(`/api/folders/${e.kind}/${encodeURIComponent(e.name)}`,{method:"DELETE"}),this.#r.set(this.#r.value.filter(i=>i!==e.name)),await Promise.all([this.#E(),this.#S(),this.#c()])}finally{this.#h.set("")}}}#Y(){this.#u.set(!1),this.#E(),this.#S(),this.#c()}#J(){return[...this.#l.value.skill,...this.#l.value.memory].sort((e,t)=>Number(e.remote)-Number(t.remote))}#ae(e){this.#s.set(e),this.#n.set([]),this.#S(),this.#c()}#le(e){const t=this.#n.value;this.#n.set(t.includes(e)?t.filter(s=>s!==e):[...t,e]),this.#c()}#ce(e){this.#n.value.includes(e)||this.#n.set([...this.#n.value,e]),this.#c()}#he(e){this.#r.value.includes(e)||this.#r.set([...this.#r.value,e]),this.#c()}#de(e){this.#v.set(e),this.#m.set(e),this.#c()}#pe(e){this.#t.set(e.target.value),this.#c()}#G(e){this.#t.set(e),this.#c()}#ue(){this.#t.set(""),this.#c()}#fe(e){this.#i.set({table:e._table,id:e.id})}#ge(e){this.#k.set(e.target.value),this.#c()}#be(e){this.#x.set(e.target.value),this.#c()}#me(e){this.#y.set(e.target.value),this.#c()}#xe(e){this.#v.set(e.target.value),this.#c()}#ve(e){this.#m.set(e.target.value),this.#c()}#ye(){this.#v.set(""),this.#m.set(""),this.#c()}#ke(e){const t=new Set(this.#p.value);t.has(e.id)?t.delete(e.id):t.add(e.id),this.#p.set(t)}#$e(){return new Map(this.#g.value.map(e=>[e.id,e]))}#H(){const e=new Map,t=this.#$e();for(const s of this.#p.value){const i=t.get(s);if(!i)continue;const n=e.get(i._table)??[];n.push(s),e.set(i._table,n)}return e}async#X(e){const t=this.#H();await Promise.all([...t.entries()].map(([s,i])=>fetch(`/api/entries/${s}/bulk/deprecated`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:i,deprecated:e})}))),this.#p.set(new Set),await this.#c()}async#ee(e){const t=this.#H();await Promise.all([...t.entries()].map(([s,i])=>fetch(`/api/entries/${s}/bulk/paused`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:i,paused:e})}))),this.#p.set(new Set),await this.#c()}async#we(){if(!window.confirm(`Delete ${this.#p.value.size} doc(s)? This can't be undone.`))return;const e=this.#H();await Promise.all([...e.entries()].map(([t,s])=>fetch(`/api/entries/${t}/bulk/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:s})}))),this.#p.set(new Set),await this.#c()}#_e(){const e=this.#$.value;return c`
1647
1749
  <button
1648
1750
  class="theme-toggle"
1649
- title=${`Theme: ${Ii[e]} (click to change)`}
1751
+ title=${`Theme: ${Fi[e]} (click to change)`}
1650
1752
  aria-label="Toggle color theme"
1651
- @click=${()=>this.#P()}
1753
+ @click=${()=>this.#I()}
1754
+ >
1755
+ ${Ni[e]}
1756
+ </button>
1757
+ `}#Se(){const e=this.#_.value==="channels";return c`
1758
+ <button
1759
+ class="channels-toggle ${e?"active":""}"
1760
+ title="Live memory channels"
1761
+ @click=${()=>this.#re(e?"entries":"channels")}
1652
1762
  >
1653
- ${Li[e]}
1763
+ ⛓ Channels
1654
1764
  </button>
1655
- `}#ue(){const e=this.#w.value;return h`
1765
+ `}#Ce(){const e=this.#w.value;return c`
1656
1766
  <button
1657
1767
  class=${`reindex-toggle${e?" spinning":""}`}
1658
1768
  title=${e?"Reindexing…":"Rebuild cache from disk"}
1659
1769
  aria-label="Rebuild cache from disk"
1660
1770
  ?disabled=${e}
1661
- @click=${()=>this.#z()}
1771
+ @click=${()=>this.#D()}
1662
1772
  >
1663
1773
 
1664
1774
  </button>
1665
- `}render(){const e=this.#l.value,t=this.#H();return this.#d.value&&t.length===0&&!this.#u.value?h`
1666
- ${this.#W()}
1775
+ `}#B(e){return c`
1776
+ <div class="toolbar">
1777
+ ${e?this.#Ce():""}
1778
+ ${this.#Se()}
1779
+ ${this.#_e()}
1780
+ <div class="folderfoo-slot"></div>
1781
+ </div>
1782
+ `}render(){const e=this.#a.value,t=this.#J();return this.#_.value==="channels"?c`
1783
+ <div class="toolbar-bar">${this.#B(!1)}</div>
1784
+ <channel-view
1785
+ .channels=${this.#z.value}
1786
+ .selected=${this.#C.value}
1787
+ .detail=${this.#R.value}
1788
+ .loading=${this.#A.value}
1789
+ .onSelect=${s=>this.#Q(s)}
1790
+ .onRefresh=${()=>this.#V()}
1791
+ ></channel-view>
1792
+ `:this.#d.value&&t.length===0&&!this.#u.value?c`
1793
+ <div class="toolbar-bar">${this.#B(!1)}</div>
1667
1794
  <div class="first-run">
1668
1795
  <h1>No folders configured yet</h1>
1669
1796
  <p>
@@ -1672,36 +1799,37 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1672
1799
  </p>
1673
1800
  <button class="add-folder-btn" @click=${()=>this.#u.set(!0)}>+ Add your first folder</button>
1674
1801
  </div>
1675
- ${this.#u.value?h`<add-folder-modal
1802
+ ${this.#u.value?c`<add-folder-modal
1676
1803
  .defaultKind=${"skill"}
1677
1804
  .lockKind=${!1}
1678
- .onAdded=${()=>this.#j()}
1805
+ .onAdded=${()=>this.#Y()}
1679
1806
  .onCancel=${()=>this.#u.set(!1)}
1680
1807
  ></add-folder-modal>`:""}
1681
- `:h`
1682
- ${this.#ue()}
1683
- ${this.#W()}
1808
+ `:c`
1684
1809
  <div class="folders-bar">
1685
1810
  <span class="filter-label">Folders:</span>
1686
- ${t.map(s=>h`
1687
- <button
1688
- class="folder-chip ${s.remote?"remote":""} ${this.#r.value.includes(s.name)?"active":""}"
1689
- title=${s.remote?`${s.path} (remote — folderfoo)`:s.path}
1690
- @click=${()=>this.#Q(s.name)}
1691
- >
1692
- ${s.remote?h`<span class="remote-dot"></span>`:"📁"} ${s.name}
1693
- <span class="kind">(${s.kind==="skill"?"s":"m"})</span>
1694
- <span
1695
- class="remove"
1696
- title="Remove folder"
1697
- @click=${i=>this.#V(s,i)}
1698
- >${this.#h.value===s.name?"…":"✕"}</span
1811
+ <div class="folder-chips">
1812
+ ${t.map(s=>c`
1813
+ <button
1814
+ class="folder-chip ${s.remote?"remote":""} ${this.#r.value.includes(s.name)?"active":""}"
1815
+ title=${s.remote?`${s.path} (remote — folderfoo)`:s.path}
1816
+ @click=${()=>this.#ne(s.name)}
1699
1817
  >
1700
- </button>
1701
- `)}
1702
- <button class="add-folder-btn" @click=${()=>this.#u.set(!0)}>+ Add folder</button>
1818
+ ${s.remote?c`<span class="remote-dot"></span>`:"📁"} ${s.name}
1819
+ <span class="kind">(${s.kind==="skill"?"s":"m"})</span>
1820
+ <span
1821
+ class="remove"
1822
+ title="Remove folder"
1823
+ @click=${i=>this.#oe(s,i)}
1824
+ >${this.#h.value===s.name?"…":"✕"}</span
1825
+ >
1826
+ </button>
1827
+ `)}
1828
+ <button class="add-folder-btn" @click=${()=>this.#u.set(!0)}>+ Add folder</button>
1829
+ </div>
1830
+ ${this.#B(!0)}
1703
1831
  </div>
1704
- ${this.#f.value?h`
1832
+ ${this.#f.value?c`
1705
1833
  <div class="folderfoo-open-banner">
1706
1834
  ${this.#f.value}
1707
1835
  <button class="dismiss" @click=${()=>this.#f.set("")}>✕</button>
@@ -1714,34 +1842,34 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1714
1842
  type="search"
1715
1843
  placeholder="Search descriptions, bodies, tags..."
1716
1844
  .value=${this.#t.value}
1717
- @input=${s=>this.#te(s)}
1845
+ @input=${s=>this.#pe(s)}
1718
1846
  />
1719
- ${this.#t.value?h`
1847
+ ${this.#t.value?c`
1720
1848
  <button
1721
1849
  class="search-clear-btn"
1722
1850
  title="Clear search"
1723
1851
  aria-label="Clear search"
1724
- @click=${()=>this.#se()}
1852
+ @click=${()=>this.#ue()}
1725
1853
  >
1726
1854
 
1727
1855
  </button>
1728
1856
  `:""}
1729
1857
  </div>
1730
1858
  <div class="row type-toggle">
1731
- ${Ei.map(s=>h`
1859
+ ${Ii.map(s=>c`
1732
1860
  <button
1733
1861
  class=${this.#s.value===s.value?"active":""}
1734
- @click=${()=>this.#Y(s.value)}
1862
+ @click=${()=>this.#ae(s.value)}
1735
1863
  >
1736
1864
  ${s.label}
1737
1865
  </button>
1738
1866
  `)}
1739
1867
  </div>
1740
- ${e.tags.length===0?h`<span class="filter-label">Tags:</span> <label class="small">no tags yet</label>`:h`
1868
+ ${e.tags.length===0?c`<span class="filter-label">Tags:</span> <label class="small">no tags yet</label>`:c`
1741
1869
  <tag-multiselect
1742
1870
  .tags=${e.tags}
1743
1871
  .active=${this.#n.value}
1744
- .onToggle=${s=>this.#J(s)}
1872
+ .onToggle=${s=>this.#le(s)}
1745
1873
  .width=${"260px"}
1746
1874
  ></tag-multiselect>
1747
1875
  `}
@@ -1751,51 +1879,51 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1751
1879
  type="date"
1752
1880
  aria-label="From date"
1753
1881
  .value=${this.#v.value}
1754
- @change=${s=>this.#ae(s)}
1882
+ @change=${s=>this.#xe(s)}
1755
1883
  />
1756
1884
  <span class="date-range-sep">–</span>
1757
1885
  <input
1758
1886
  type="date"
1759
1887
  aria-label="To date"
1760
1888
  .value=${this.#m.value}
1761
- @change=${s=>this.#le(s)}
1889
+ @change=${s=>this.#ve(s)}
1762
1890
  />
1763
- ${this.#v.value||this.#m.value?h`
1891
+ ${this.#v.value||this.#m.value?c`
1764
1892
  <button
1765
1893
  class="date-range-clear"
1766
1894
  title="Clear date range"
1767
1895
  aria-label="Clear date range"
1768
- @click=${()=>this.#ce()}
1896
+ @click=${()=>this.#ye()}
1769
1897
  >
1770
1898
 
1771
1899
  </button>
1772
1900
  `:""}
1773
1901
  </div>
1774
1902
  <span class="filter-label">Sort:</span>
1775
- <select .value=${this.#y.value} @change=${s=>this.#re(s)}>
1903
+ <select .value=${this.#k.value} @change=${s=>this.#ge(s)}>
1776
1904
  <option value="mtime_desc">Recently touched</option>
1777
1905
  <option value="mtime_asc">Least recently touched</option>
1778
1906
  <option value="created_at_asc">Oldest first</option>
1779
1907
  <option value="name_asc">Name</option>
1780
1908
  </select>
1781
1909
  <span class="filter-label">Deprecated:</span>
1782
- <select .value=${this.#x.value} @change=${s=>this.#ne(s)}>
1783
- ${ct.map(s=>h`<option value=${s.value}>${s.label}</option>`)}
1910
+ <select .value=${this.#x.value} @change=${s=>this.#be(s)}>
1911
+ ${dt.map(s=>c`<option value=${s.value}>${s.label}</option>`)}
1784
1912
  </select>
1785
1913
  <span class="filter-label">Paused:</span>
1786
- <select .value=${this.#k.value} @change=${s=>this.#oe(s)}>
1787
- ${ct.map(s=>h`<option value=${s.value}>${s.label}</option>`)}
1914
+ <select .value=${this.#y.value} @change=${s=>this.#me(s)}>
1915
+ ${dt.map(s=>c`<option value=${s.value}>${s.label}</option>`)}
1788
1916
  </select>
1789
1917
  </div>
1790
1918
  </div>
1791
- ${this.#p.value.size>0?h`
1919
+ ${this.#p.value.size>0?c`
1792
1920
  <div class="bulk-bar">
1793
1921
  <span>${this.#p.value.size} selected</span>
1794
- <button @click=${()=>this.#K(!0)}>Mark deprecated</button>
1795
- <button @click=${()=>this.#K(!1)}>Un-deprecate</button>
1796
- <button @click=${()=>this.#Z(!0)}>Pause</button>
1797
- <button @click=${()=>this.#Z(!1)}>Resume</button>
1798
- <button class="danger" @click=${()=>this.#pe()}>Delete</button>
1922
+ <button @click=${()=>this.#X(!0)}>Mark deprecated</button>
1923
+ <button @click=${()=>this.#X(!1)}>Un-deprecate</button>
1924
+ <button @click=${()=>this.#ee(!0)}>Pause</button>
1925
+ <button @click=${()=>this.#ee(!1)}>Resume</button>
1926
+ <button class="danger" @click=${()=>this.#we()}>Delete</button>
1799
1927
  <button @click=${()=>this.#p.set(new Set)}>Clear</button>
1800
1928
  </div>
1801
1929
  `:""}
@@ -1804,29 +1932,29 @@ This removes the doc's key, tags, and status — it drops out of key-based looku
1804
1932
  style=${`width: ${this.#o.value}%; border-right: 1px solid var(--border);`}
1805
1933
  .results=${this.#g.value}
1806
1934
  .showFolder=${t.length>1}
1807
- .onSelect=${s=>this.#ie(s)}
1935
+ .onSelect=${s=>this.#fe(s)}
1808
1936
  .selectedIds=${this.#p.value}
1809
- .onToggleSelect=${s=>this.#he(s)}
1810
- .onKeyClick=${s=>this.#B(s)}
1937
+ .onToggleSelect=${s=>this.#ke(s)}
1938
+ .onKeyClick=${s=>this.#G(s)}
1811
1939
  ></result-list>
1812
1940
  <div
1813
1941
  class="splitter ${this.#b.value?"dragging":""}"
1814
- @pointerdown=${s=>this.#D(s)}
1942
+ @pointerdown=${s=>this.#O(s)}
1815
1943
  ></div>
1816
1944
  <detail-panel
1817
1945
  .selected=${this.#i.value}
1818
1946
  .facets=${e}
1819
- .onChanged=${()=>{this.#a(),this.#C()}}
1820
- .onTagClick=${s=>this.#G(s)}
1821
- .onFolderClick=${s=>this.#X(s)}
1822
- .onDateClick=${s=>this.#ee(s)}
1823
- .onKeyClick=${s=>this.#B(s)}
1947
+ .onChanged=${()=>{this.#c(),this.#S()}}
1948
+ .onTagClick=${s=>this.#ce(s)}
1949
+ .onFolderClick=${s=>this.#he(s)}
1950
+ .onDateClick=${s=>this.#de(s)}
1951
+ .onKeyClick=${s=>this.#G(s)}
1824
1952
  ></detail-panel>
1825
1953
  </div>
1826
- ${this.#u.value?h`<add-folder-modal
1954
+ ${this.#u.value?c`<add-folder-modal
1827
1955
  .defaultKind=${"skill"}
1828
1956
  .lockKind=${!1}
1829
- .onAdded=${()=>this.#j()}
1957
+ .onAdded=${()=>this.#Y()}
1830
1958
  .onCancel=${()=>this.#u.set(!1)}
1831
1959
  ></add-folder-modal>`:""}
1832
- `}}customElements.define("mem-bucket-app",Mi);
1960
+ `}}customElements.define("mem-bucket-app",ji);