@godmode-team/godmode 1.7.2 → 1.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.
- package/LICENSE +94 -46
- package/README.md +195 -36
- package/assets/agent-roster/competitor-watch.md +40 -0
- package/assets/agent-roster/content-writer.md +35 -53
- package/assets/agent-roster/godmode-builder.md +2 -2
- package/assets/agent-roster/inbox-manager.md +38 -0
- package/assets/agent-roster/meeting-prep.md +40 -16
- package/assets/agent-roster/skill-optimizer.md +50 -0
- package/assets/agent-roster/weekly-review.md +42 -0
- package/assets/skills/autoresearch.md +1 -1
- package/assets/skills/pattern-scout.md +1 -1
- package/assets/skills/visual-qa.md +128 -0
- package/dist/godmode-ui/aeo.html +1 -1
- package/dist/godmode-ui/assets/brain-tab-B1CYwAJ7.js +402 -0
- package/dist/godmode-ui/assets/connections-tab-Cuv4eW0d.js +91 -0
- package/dist/godmode-ui/assets/ctrl-settings-COfcdhha.js +5 -0
- package/dist/godmode-ui/assets/dashboards-tab-7hHXzWPp.js +137 -0
- package/dist/godmode-ui/assets/index-DcYipcbm.js +1994 -0
- package/dist/godmode-ui/assets/index-DmEmOd0w.css +1 -0
- package/dist/godmode-ui/assets/lit-core-CTInmNPB.js +3 -0
- package/dist/godmode-ui/assets/markdown-i_gIkIP3.js +59 -0
- package/dist/godmode-ui/assets/second-brain-tab-DkFatLwl.js +350 -0
- package/dist/godmode-ui/assets/setup-BnLadXY9.js +1 -0
- package/dist/godmode-ui/assets/team-tab-Q3icI_Q-.js +296 -0
- package/dist/godmode-ui/assets/today-tab-C6lIMzgY.js +209 -0
- package/dist/godmode-ui/assets/views-settings-B2UFEtoi.js +4643 -0
- package/dist/godmode-ui/assets/work-tab-DwU559Bx.js +1 -0
- package/dist/godmode-ui/assets/workspaces-vzpIVgdl.js +718 -0
- package/dist/godmode-ui/index.html +11 -5
- package/dist/index.js +1658 -36092
- package/dist/mcp-entry.js +1272 -0
- package/dist/standalone.js +1917 -0
- package/openclaw.plugin.json +36 -7
- package/package.json +27 -13
- package/scripts/godmode-gateway.service +41 -0
- package/scripts/install-systemd.sh +99 -0
- package/skill-cards/adversarial-board.md +63 -0
- package/skill-cards/autoresearch.md +39 -0
- package/skill-cards/bill-review.md +26 -0
- package/skill-cards/calendar.md +32 -0
- package/skill-cards/code-quality.md +31 -0
- package/skill-cards/competitor-scan.md +26 -0
- package/skill-cards/content-generation.md +26 -0
- package/skill-cards/context-deep-dive.md +65 -0
- package/skill-cards/cron-workflows.md +33 -0
- package/skill-cards/dashboards.md +38 -0
- package/skill-cards/delegate.md +57 -0
- package/skill-cards/files.md +38 -0
- package/skill-cards/godmode-builder.md +58 -0
- package/skill-cards/inbox-sweep.md +26 -0
- package/skill-cards/integrations.md +40 -0
- package/skill-cards/life-admin.md +26 -0
- package/skill-cards/meetings.md +42 -0
- package/skill-cards/meta-problem-solver.md +52 -0
- package/skill-cards/people.md +39 -0
- package/skill-cards/personal-brand.md +71 -0
- package/skill-cards/project-orchestrator.md +97 -0
- package/skill-cards/project-pipeline.md +78 -0
- package/skill-cards/proof-editor.md +28 -0
- package/skill-cards/quality-gate.md +57 -0
- package/skill-cards/quarterly-review.md +26 -0
- package/skill-cards/queue.md +40 -0
- package/skill-cards/screenpipe.md +49 -0
- package/skill-cards/second-brain.md +46 -0
- package/skill-cards/standup-prep.md +26 -0
- package/skill-cards/tasks.md +34 -0
- package/skill-cards/visual-qa.md +56 -0
- package/skill-cards/workspace-memory.md +51 -0
- package/skill-cards/x-twitter.md +37 -0
- package/dist/godmode-ui/assets/dashboards-CrT3s0NG.js +0 -1
- package/dist/godmode-ui/assets/index-BtwTHiwI.js +0 -9353
- package/dist/godmode-ui/assets/index-xiAdnGJD.css +0 -1
- package/dist/godmode-ui/assets/options-QuHclvvX.js +0 -1
- package/dist/godmode-ui/assets/second-brain-ghSM5E6X.js +0 -1
- package/dist/godmode-ui/assets/setup-CWjMtnE4.js +0 -1
- package/dist/godmode-ui/consciousness-icon-64.png +0 -0
- package/dist/godmode-ui/consciousness-icon.png +0 -0
- package/dist/godmode-ui/godmode-logo.png +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const H=globalThis,G=H.ShadowRoot&&(H.ShadyCSS===void 0||H.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),et=new WeakMap;let At=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(G&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=et.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&et.set(e,t))}return t}toString(){return this.cssText}};const xt=i=>new At(typeof i=="string"?i:i+"",void 0,W),ce=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,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.")})(r)+i[n+1],i[0]);return new At(e,i,W)},wt=(i,t)=>{if(G)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=H.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},st=G?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return xt(e)})(i):i;const{is:St,defineProperty:Ct,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Mt,getOwnPropertySymbols:Ut,getPrototypeOf:Ot}=Object,D=globalThis,it=D.trustedTypes,Tt=it?it.emptyScript:"",Ht=D.reactiveElementPolyfillSupport,P=(i,t)=>i,k={toAttribute(i,t){switch(t){case Boolean:i=i?Tt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},Z=(i,t)=>!St(i,t),rt={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??=Symbol("metadata"),D.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Ct(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:n}=Pt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:r,set(o){const c=r?.call(this);n?.call(this,o),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=Ot(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,s=[...Mt(e),...Ut(e)];for(const r of s)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const r of s)e.unshift(st(r))}else t!==void 0&&e.push(st(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.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(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return wt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const n=(s.converter?.toAttribute!==void 0?s.converter:k).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const n=s.getPropertyOptions(r),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:k;this._$Em=r;const c=o.fromAttribute(e,n.type);this[r]=c??this._$Ej?.get(r)??c,this._$Em=null}}requestUpdate(t,e,s,r=!1,n){if(t!==void 0){const o=this.constructor;if(r===!1&&(n=this[t]),s??=o.getPropertyOptions(t),!((s.hasChanged??Z)(n,e)||s.useDefault&&s.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:n},o){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,n]of this._$Ep)this[r]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,n]of s){const{wrapped:o}=n,c=this[r];o!==!0||this._$AL.has(r)||c===void 0||this.C(r,void 0,n,c)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[P("elementProperties")]=new Map,E[P("finalized")]=new Map,Ht?.({ReactiveElement:E}),(D.reactiveElementVersions??=[]).push("2.1.2");const J=globalThis,nt=i=>i,R=J.trustedTypes,ot=R?R.createPolicy("lit-html",{createHTML:i=>i}):void 0,vt="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,bt="?"+A,Nt=`<${bt}>`,m=document,U=()=>m.createComment(""),O=i=>i===null||typeof i!="object"&&typeof i!="function",K=Array.isArray,kt=i=>K(i)||typeof i?.[Symbol.iterator]=="function",z=`[
|
|
2
|
+
\f\r]`,S=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ht=/-->/g,ct=/>/g,b=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,lt=/"/g,gt=/^(?:script|style|textarea|title)$/i,Rt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),le=Rt(1),v=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),ut=new WeakMap,y=m.createTreeWalker(m,129);function yt(i,t){if(!K(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ot!==void 0?ot.createHTML(t):t}const It=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":t===3?"<math>":"",o=S;for(let c=0;c<e;c++){const h=i[c];let u,$,a=-1,d=0;for(;d<h.length&&(o.lastIndex=d,$=o.exec(h),$!==null);)d=o.lastIndex,o===S?$[1]==="!--"?o=ht:$[1]!==void 0?o=ct:$[2]!==void 0?(gt.test($[2])&&(r=RegExp("</"+$[2],"g")),o=b):$[3]!==void 0&&(o=b):o===b?$[0]===">"?(o=r??S,a=-1):$[1]===void 0?a=-2:(a=o.lastIndex-$[2].length,u=$[1],o=$[3]===void 0?b:$[3]==='"'?lt:at):o===lt||o===at?o=b:o===ht||o===ct?o=S:(o=b,r=void 0);const l=o===b&&i[c+1].startsWith("/>")?" ":"";n+=o===S?h+Nt:a>=0?(s.push(u),h.slice(0,a)+vt+h.slice(a)+A+l):h+A+(a===-2?c:l)}return[yt(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class T{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,o=0;const c=t.length-1,h=this.parts,[u,$]=It(t,e);if(this.el=T.createElement(u,s),y.currentNode=this.el.content,e===2||e===3){const a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(r=y.nextNode())!==null&&h.length<c;){if(r.nodeType===1){if(r.hasAttributes())for(const a of r.getAttributeNames())if(a.endsWith(vt)){const d=$[o++],l=r.getAttribute(a).split(A),f=/([.?@])?(.*)/.exec(d);h.push({type:1,index:n,name:f[2],strings:l,ctor:f[1]==="."?Lt:f[1]==="?"?jt:f[1]==="@"?zt:L}),r.removeAttribute(a)}else a.startsWith(A)&&(h.push({type:6,index:n}),r.removeAttribute(a));if(gt.test(r.tagName)){const a=r.textContent.split(A),d=a.length-1;if(d>0){r.textContent=R?R.emptyScript:"";for(let l=0;l<d;l++)r.append(a[l],U()),y.nextNode(),h.push({type:2,index:++n});r.append(a[d],U())}}}else if(r.nodeType===8)if(r.data===bt)h.push({type:2,index:n});else{let a=-1;for(;(a=r.data.indexOf(A,a+1))!==-1;)h.push({type:7,index:n}),a+=A.length-1}n++}}static createElement(t,e){const s=m.createElement("template");return s.innerHTML=t,s}}function x(i,t,e=i,s){if(t===v)return t;let r=s!==void 0?e._$Co?.[s]:e._$Cl;const n=O(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(i),r._$AT(i,e,s)),s!==void 0?(e._$Co??=[])[s]=r:e._$Cl=r),r!==void 0&&(t=x(i,r._$AS(i,t.values),r,s)),t}class Dt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??m).importNode(e,!0);y.currentNode=r;let n=y.nextNode(),o=0,c=0,h=s[0];for(;h!==void 0;){if(o===h.index){let u;h.type===2?u=new w(n,n.nextSibling,this,t):h.type===1?u=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(u=new Bt(n,this,t)),this._$AV.push(u),h=s[++c]}o!==h?.index&&(n=y.nextNode(),o++)}return y.currentNode=m,r}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class w{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),O(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):kt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(m.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=T.createElement(yt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{const n=new Dt(r,this),o=n.u(this.options);n.p(e),this.T(o),this._$AH=n}}_$AC(t){let e=ut.get(t.strings);return e===void 0&&ut.set(t.strings,e=new T(t)),e}k(t){K(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const n of t)r===e.length?e.push(s=new w(this.O(U()),this.O(U()),this,this.options)):s=e[r],s._$AI(n),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const s=nt(t).nextSibling;nt(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class L{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,r){const n=this.strings;let o=!1;if(n===void 0)t=x(this,t,e,0),o=!O(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{const c=t;let h,u;for(t=n[0],h=0;h<n.length-1;h++)u=x(this,c[s+h],e,h),u===v&&(u=this._$AH[h]),o||=!O(u)||u!==this._$AH[h],u===p?t=p:t!==p&&(t+=(u??"")+n[h+1]),this._$AH[h]=u}o&&!r&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Lt extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class jt extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class zt extends L{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=x(this,t,e,0)??p)===v)return;const s=this._$AH,r=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==p&&(s===p||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Bt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){x(this,t)}}const qt={I:w},Vt=J.litHtmlPolyfillSupport;Vt?.(T,w),(J.litHtmlVersions??=[]).push("3.3.2");const Gt=(i,t,e)=>{const s=e?.renderBefore??t;let r=s._$litPart$;if(r===void 0){const n=e?.renderBefore??null;s._$litPart$=r=new w(t.insertBefore(U(),n),n,void 0,e??{})}return r._$AI(i),r};const Q=globalThis;let N=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Gt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return v}};N._$litElement$=!0,N.finalized=!0,Q.litElementHydrateSupport?.({LitElement:N});const Wt=Q.litElementPolyfillSupport;Wt?.({LitElement:N});(Q.litElementVersions??=[]).push("4.2.2");const de=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};const Zt={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:Z},Jt=(i=Zt,t,e)=>{const{kind:s,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(e.name,i),s==="accessor"){const{name:o}=e;return{set(c){const h=t.get.call(this);t.set.call(this,c),this.requestUpdate(o,h,i,!0,c)},init(c){return c!==void 0&&this.C(o,void 0,i,c),c}}}if(s==="setter"){const{name:o}=e;return function(c){const h=this[o];t.call(this,c),this.requestUpdate(o,h,i,!0,c)}}throw Error("Unsupported decorator location: "+s)};function Kt(i){return(t,e)=>typeof e=="object"?Jt(i,t,e):((s,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(r,n):void 0})(i,t,e)}function pe(i){return Kt({...i,state:!0,attribute:!1})}let mt=class extends Event{constructor(t,e,s,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=s,this.subscribe=r??!1}};function fe(i){return i}let dt=class{constructor(t,e,s,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const n=e;this.context=n.context,this.callback=n.callback,this.subscribe=n.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new mt(this.context,this.host,this.t,this.subscribe))}};let Qt=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const s=e||!Object.is(t,this.o);this.o=t,s&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:s}]of this.subscriptions)e(this.o,s)},t!==void 0&&(this.value=t)}addCallback(t,e,s){if(!s)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:r}=this.subscriptions.get(t);t(this.value,r)}clearCallbacks(){this.subscriptions.clear()}};let Ft=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},pt=class extends Qt{constructor(t,e,s){super(e.context!==void 0?e.initialValue:s),this.onContextRequest=r=>{if(r.context!==this.context)return;const n=r.contextTarget??r.composedPath()[0];n!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,n,r.subscribe))},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;const n=new Set;for(const[o,{consumerHost:c}]of this.subscriptions)n.has(o)||(n.add(o),c.dispatchEvent(new mt(this.context,c,o,!0)));r.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Ft(this.context,this.host))}};function ge({context:i}){return(t,e)=>{const s=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(r){return s.get(this).setValue(r),t.set.call(this,r)},init(r){return s.set(this,new pt(this,{context:i,initialValue:r})),r}};{t.constructor.addInitializer((o=>{s.set(o,new pt(o,{context:i}))}));const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get(){return o.get(this)},set(c){s.get(this).setValue(c),o.set(this,c)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set(c){s.get(this).setValue(c),o?.call(this,c)}}}return void Object.defineProperty(t,e,n)}}}function ye({context:i,subscribe:t}){return(e,s)=>{typeof s=="object"?s.addInitializer((function(){new dt(this,{context:i,callback:r=>{e.set.call(this,r)},subscribe:t})})):e.constructor.addInitializer((r=>{new dt(r,{context:i,callback:n=>{r[s]=n},subscribe:t})}))}}const F={CHILD:2},X=i=>(...t)=>({_$litDirective$:i,values:t});let Y=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};class V extends Y{constructor(t){if(super(t),this.it=p,t.type!==F.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===p||t==null)return this._t=void 0,this.it=t;if(t===v)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}V.directiveName="unsafeHTML",V.resultType=1;const Ee=X(V);const{I:Xt}=qt,$t=i=>i,Yt=i=>i.strings===void 0,ft=()=>document.createComment(""),C=(i,t,e)=>{const s=i._$AA.parentNode,r=t===void 0?i._$AB:t._$AA;if(e===void 0){const n=s.insertBefore(ft(),r),o=s.insertBefore(ft(),r);e=new Xt(n,o,i,i.options)}else{const n=e._$AB.nextSibling,o=e._$AM,c=o!==i;if(c){let h;e._$AQ?.(i),e._$AM=i,e._$AP!==void 0&&(h=i._$AU)!==o._$AU&&e._$AP(h)}if(n!==r||c){let h=e._$AA;for(;h!==n;){const u=$t(h).nextSibling;$t(s).insertBefore(h,r),h=u}}}return e},g=(i,t,e=i)=>(i._$AI(t,e),i),te={},ee=(i,t=te)=>i._$AH=t,se=i=>i._$AH,B=i=>{i._$AR(),i._$AA.remove()};const _t=(i,t,e)=>{const s=new Map;for(let r=t;r<=e;r++)s.set(i[r],r);return s},xe=X(class extends Y{constructor(i){if(super(i),i.type!==F.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,t,e){let s;e===void 0?e=t:t!==void 0&&(s=t);const r=[],n=[];let o=0;for(const c of i)r[o]=s?s(c,o):o,n[o]=e(c,o),o++;return{values:n,keys:r}}render(i,t,e){return this.dt(i,t,e).values}update(i,[t,e,s]){const r=se(i),{values:n,keys:o}=this.dt(t,e,s);if(!Array.isArray(r))return this.ut=o,n;const c=this.ut??=[],h=[];let u,$,a=0,d=r.length-1,l=0,f=n.length-1;for(;a<=d&&l<=f;)if(r[a]===null)a++;else if(r[d]===null)d--;else if(c[a]===o[l])h[l]=g(r[a],n[l]),a++,l++;else if(c[d]===o[f])h[f]=g(r[d],n[f]),d--,f--;else if(c[a]===o[f])h[f]=g(r[a],n[f]),C(i,h[f+1],r[a]),a++,f--;else if(c[d]===o[l])h[l]=g(r[d],n[l]),C(i,r[a],r[d]),d--,l++;else if(u===void 0&&(u=_t(o,l,f),$=_t(c,a,d)),u.has(c[a]))if(u.has(c[d])){const _=$.get(o[l]),j=_!==void 0?r[_]:null;if(j===null){const tt=C(i,r[a]);g(tt,n[l]),h[l]=tt}else h[l]=g(j,n[l]),C(i,r[a],j),r[_]=null;l++}else B(r[d]),d--;else B(r[a]),a++;for(;l<=f;){const _=C(i,h[f+1]);g(_,n[l]),h[l++]=_}for(;a<=d;){const _=r[a++];_!==null&&B(_)}return this.ut=o,ee(i,h),v}});const M=(i,t)=>{const e=i._$AN;if(e===void 0)return!1;for(const s of e)s._$AO?.(t,!1),M(s,t);return!0},I=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while(e?.size===0)},Et=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),ne(t)}};function ie(i){this._$AN!==void 0?(I(this),this._$AM=i,Et(this)):this._$AM=i}function re(i,t=!1,e=0){const s=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(s))for(let n=e;n<s.length;n++)M(s[n],!1),I(s[n]);else s!=null&&(M(s,!1),I(s));else M(this,i)}const ne=i=>{i.type==F.CHILD&&(i._$AP??=re,i._$AQ??=ie)};class oe extends Y{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Et(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(M(this,t),I(this))}setValue(t){if(Yt(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const q=new WeakMap,we=X(class extends oe{render(i){return p}update(i,[t]){const e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=i.options?.host,this.rt(this.ct=i.element)),p}rt(i){if(this.isConnected||(i=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=q.get(t);e===void 0&&(e=new WeakMap,q.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,i),i!==void 0&&this.G.call(this.ht,i)}else this.G.value=i}get lt(){return typeof this.G=="function"?q.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{p as A,Kt as a,le as b,xe as c,N as d,we as e,ge as f,ye as g,ce as i,fe as n,Ee as o,pe as r,de as t};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
function Q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R=Q();function se(n){R=n}var S={exec:()=>null};function p(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(x.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var be=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),x={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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},we=/^(?:[ \t]*(?:\n|$))+/,me=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ye=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Se=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,H=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,le=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ie=p(le).replace(/bull/g,H).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$e=p(le).replace(/bull/g,H).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),N=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Re=/^[^\n]+/,O=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Te=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",O).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ze=p(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,H).getRegex(),q="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",j=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ae=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\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",j).replace("tag",q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae=p(N).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex(),_e=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ae).getRegex(),G={blockquote:_e,code:me,def:Te,fences:ye,heading:Se,hr:P,html:Ae,lheading:ie,list:ze,newline:we,paragraph:ae,table:S,text:Re},V=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex(),Pe={...G,lheading:$e,table:V,paragraph:p(N).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",V).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex()},Ie={...G,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",j).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:S,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(N).replace("hr",P).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",ie).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Le=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Be=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,oe=/^( {2,}|\\)\n(?!\s*$)/,Ce=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,E=/[\p{P}\p{S}]/u,X=/[\s\p{P}\p{S}]/u,ce=/[^\s\p{P}\p{S}]/u,qe=p(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,X).getRegex(),he=/(?!~)[\p{P}\p{S}]/u,Ee=/(?!~)[\s\p{P}\p{S}]/u,ve=/(?:[^\s\p{P}\p{S}]|~)/u,pe=/(?![*_])[\p{P}\p{S}]/u,Ze=/(?![*_])[\s\p{P}\p{S}]/u,De=/(?:[^\s\p{P}\p{S}]|[*_])/u,Me=p(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",be?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ue=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Qe=p(ue,"u").replace(/punct/g,E).getRegex(),He=p(ue,"u").replace(/punct/g,he).getRegex(),ge="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ne=p(ge,"gu").replace(/notPunctSpace/g,ce).replace(/punctSpace/g,X).replace(/punct/g,E).getRegex(),Oe=p(ge,"gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,Ee).replace(/punct/g,he).getRegex(),je=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ce).replace(/punctSpace/g,X).replace(/punct/g,E).getRegex(),Ge=p(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,pe).getRegex(),Xe="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Fe=p(Xe,"gu").replace(/notPunctSpace/g,De).replace(/punctSpace/g,Ze).replace(/punct/g,pe).getRegex(),We=p(/\\(punct)/,"gu").replace(/punct/g,E).getRegex(),Ue=p(/^<(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(),Je=p(j).replace("(?:-->|$)","-->").getRegex(),Ke=p("^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",Je).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),L=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ve=p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",L).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ke=p(/^!?\[(label)\]\[(ref)\]/).replace("label",L).replace("ref",O).getRegex(),fe=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",O).getRegex(),Ye=p("reflink|nolink(?!\\()","g").replace("reflink",ke).replace("nolink",fe).getRegex(),Y=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,F={_backpedal:S,anyPunctuation:We,autolink:Ue,blockSkip:Me,br:oe,code:Be,del:S,delLDelim:S,delRDelim:S,emStrongLDelim:Qe,emStrongRDelimAst:Ne,emStrongRDelimUnd:je,escape:Le,link:Ve,nolink:fe,punctuation:qe,reflink:ke,reflinkSearch:Ye,tag:Ke,text:Ce,url:S},et={...F,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",L).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",L).getRegex()},Z={...F,emStrongRDelimAst:Oe,emStrongLDelim:He,delLDelim:Ge,delRDelim:Fe,url:p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Y).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:p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Y).getRegex()},tt={...Z,br:p(oe).replace("{2,}","*").getRegex(),text:p(Z.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},I={normal:G,gfm:Pe,pedantic:Ie},z={normal:F,gfm:Z,breaks:tt,pedantic:et},rt={"&":"&","<":"<",">":">",'"':""","'":"'"},ee=n=>rt[n];function m(n,e){if(e){if(x.escapeTest.test(n))return n.replace(x.escapeReplace,ee)}else if(x.escapeTestNoEncode.test(n))return n.replace(x.escapeReplaceNoEncode,ee);return n}function te(n){try{n=encodeURI(n).replace(x.percentDecode,"%")}catch{return null}return n}function re(n,e){let r=n.replace(x.findPipe,(i,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),s=r.split(x.splitPipe),t=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(;t<s.length;t++)s[t]=s[t].trim().replace(x.slashPipe,"|");return s}function A(n,e,r){let s=n.length;if(s===0)return"";let t=0;for(;t<s&&n.charAt(s-t-1)===e;)t++;return n.slice(0,s-t)}function nt(n,e){if(n.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function st(n,e=0){let r=e,s="";for(let t of n)if(t===" "){let i=4-r%4;s+=" ".repeat(i),r+=i}else s+=t,r++;return s}function ne(n,e,r,s,t){let i=e.href,l=e.title||null,o=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,a}function lt(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
|
|
3
|
+
`).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[o]=l;return o.length>=t.length?i.slice(t.length):i}).join(`
|
|
4
|
+
`)}var B=class{options;rules;lexer;constructor(n){this.options=n||R}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:A(r,`
|
|
5
|
+
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let r=e[0],s=lt(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=A(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:A(e[0],`
|
|
6
|
+
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let r=A(e[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),s="",t="",i=[];for(;r.length>0;){let l=!1,o=[],a;for(a=0;a<r.length;a++)if(this.rules.other.blockquoteStart.test(r[a]))o.push(r[a]),l=!0;else if(!l)o.push(r[a]);else break;r=r.slice(a);let h=o.join(`
|
|
9
|
+
`),c=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
11
|
+
${h}`:h,t=t?`${t}
|
|
12
|
+
${c}`:c;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=g,r.length===0)break;let u=i.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let d=u,f=d.raw+`
|
|
13
|
+
`+r.join(`
|
|
14
|
+
`),y=this.blockquote(f);i[i.length-1]=y,s=s.substring(0,s.length-d.raw.length)+y.raw,t=t.substring(0,t.length-d.text.length)+y.text;break}else if(u?.type==="list"){let d=u,f=d.raw+`
|
|
15
|
+
`+r.join(`
|
|
16
|
+
`),y=this.list(f);i[i.length-1]=y,s=s.substring(0,s.length-u.raw.length)+y.raw,t=t.substring(0,t.length-d.raw.length)+y.raw,r=f.substring(i.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:t}}}list(n){let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),s=r.length>1,t={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let i=this.rules.other.listItemRegex(r),l=!1;for(;n;){let a=!1,h="",c="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;h=e[0],n=n.substring(h.length);let g=st(e[2].split(`
|
|
18
|
+
`,1)[0],e[1].length),u=n.split(`
|
|
19
|
+
`,1)[0],d=!g.trim(),f=0;if(this.options.pedantic?(f=2,c=g.trimStart()):d?f=e[1].length+1:(f=g.search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=g.slice(f),f+=e[1].length),d&&this.rules.other.blankLine.test(u)&&(h+=u+`
|
|
20
|
+
`,n=n.substring(u.length+1),a=!0),!a){let y=this.rules.other.nextBulletRegex(f),U=this.rules.other.hrRegex(f),J=this.rules.other.fencesBeginRegex(f),K=this.rules.other.headingBeginRegex(f),de=this.rules.other.htmlBeginRegex(f),xe=this.rules.other.blockquoteBeginRegex(f);for(;n;){let v=n.split(`
|
|
21
|
+
`,1)[0],T;if(u=v,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),T=u):T=u.replace(this.rules.other.tabCharGlobal," "),J.test(u)||K.test(u)||de.test(u)||xe.test(u)||y.test(u)||U.test(u))break;if(T.search(this.rules.other.nonSpaceChar)>=f||!u.trim())c+=`
|
|
22
|
+
`+T.slice(f);else{if(d||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||J.test(g)||K.test(g)||U.test(g))break;c+=`
|
|
23
|
+
`+u}d=!u.trim(),h+=v+`
|
|
24
|
+
`,n=n.substring(v.length+1),g=T.slice(f)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),t.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),t.raw+=h}let o=t.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a of t.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(a.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};a.checked=c.checked,t.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=c.raw+a.tokens[0].raw,a.tokens[0].text=c.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(c)):a.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):a.tokens.unshift(c)}}if(!t.loose){let h=a.tokens.filter(g=>g.type==="space"),c=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));t.loose=c}}if(t.loose)for(let a of t.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return t}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let r=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"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:s,title:t}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=re(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of t)i.rows.push(re(l,i.header.length).map((o,a)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[a]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);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(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=A(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=nt(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],t=i[3])}else t=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(r)?s=s.slice(1):s=s.slice(1,-1)),ne(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return ne(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+t);(s=h.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){o+=l;continue}else if((s[5]||s[6])&&t%3&&!((t+l)%3)){a+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o+a);let c=[...s[0]][0].length,g=n.slice(0,t+s.index+c+l);if(Math.min(t,l)%2){let d=g.slice(1,-1);return{type:"em",raw:g,text:d,tokens:this.lexer.inlineTokens(d)}}let u=g.slice(2,-2);return{type:"strong",raw:g,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,r=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*n.length+t);(s=a.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(l=[...i].length,l!==t))continue;if(s[3]||s[4]){o+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o);let h=[...s[0]][0].length,c=n.slice(0,t+s.index+h+l),g=c.slice(t,-t);return{type:"del",raw:c,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},b=class D{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R,this.options.tokenizer=this.options.tokenizer||new B,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 r={other:x,block:I.normal,inline:z.normal};this.options.pedantic?(r.block=I.pedantic,r.inline=z.pedantic):this.options.gfm&&(r.block=I.gfm,this.options.breaks?r.inline=z.breaks:r.inline=z.gfm),this.tokenizer.rules=r}static get rules(){return{block:I,inline:z}}static lex(e,r){return new D(r).lex(e)}static lexInline(e,r){return new D(r).inlineTokens(e)}lex(e){e=e.replace(x.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){for(this.options.pedantic&&(e=e.replace(x.tabCharGlobal," ").replace(x.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(l=>(t=l.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let l=r.at(-1);t.raw.length===1&&l!==void 0?l.raw+=`
|
|
28
|
+
`:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
29
|
+
`)?"":`
|
|
30
|
+
`)+t.raw,l.text+=`
|
|
31
|
+
`+t.text,this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
32
|
+
`)?"":`
|
|
33
|
+
`)+t.raw,l.text+=`
|
|
34
|
+
`+t.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},r.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),r.push(t);continue}let i=e;if(this.options.extensions?.startBlock){let l=1/0,o=e.slice(1),a;this.options.extensions.startBlock.forEach(h=>{a=h.call({lexer:this},o),typeof a=="number"&&a>=0&&(l=Math.min(l,a))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(this.state.top&&(t=this.tokenizer.paragraph(i))){let l=r.at(-1);s&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+t.raw,l.text+=`
|
|
37
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t),s=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+t.raw,l.text+=`
|
|
40
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=t[2]?t[2].length:0,s=s.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let l=!1,o="";for(;e;){l||(o=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=r.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,s,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e,s,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,g=e.slice(1),u;this.options.extensions.startInline.forEach(d=>{u=d.call({lexer:this},g),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(h)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),l=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},C=class{options;parser;constructor(n){this.options=n||R}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(x.notSpaceStart)?.[0],t=n.replace(x.endingNewline,"")+`
|
|
41
|
+
`;return s?'<pre><code class="language-'+m(s)+'">'+(r?t:m(t,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(r?t:m(t,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(n)}</blockquote>
|
|
45
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
46
|
+
`}hr(n){return`<hr>
|
|
47
|
+
`}list(n){let e=n.ordered,r=n.start,s="";for(let l=0;l<n.items.length;l++){let o=n.items[l];s+=this.listitem(o)}let t=e?"ol":"ul",i=e&&r!==1?' start="'+r+'"':"";return"<"+t+i+`>
|
|
48
|
+
`+s+"</"+t+`>
|
|
49
|
+
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
50
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
51
|
+
`}table(n){let e="",r="";for(let t=0;t<n.header.length;t++)r+=this.tablecell(n.header[t]);e+=this.tablerow({text:r});let s="";for(let t=0;t<n.rows.length;t++){let i=n.rows[t];r="";for(let l=0;l<i.length;l++)r+=this.tablecell(i[l]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+e+`</thead>
|
|
54
|
+
`+s+`</table>
|
|
55
|
+
`}tablerow({text:n}){return`<tr>
|
|
56
|
+
${n}</tr>
|
|
57
|
+
`}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
|
|
58
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${m(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=te(n);if(t===null)return s;n=t;let i='<a href="'+n+'"';return e&&(i+=' title="'+m(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=te(n);if(t===null)return m(r);n=t;let i=`<img src="${n}" alt="${m(r)}"`;return e&&(i+=` title="${m(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:m(n.text)}},W=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},w=class M{options;renderer;textRenderer;constructor(e){this.options=e||R,this.options.renderer=this.options.renderer||new C,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new W}static parse(e,r){return new M(r).parse(e)}static parseInline(e,r){return new M(r).parseInline(e)}parse(e){let r="";for(let s=0;s<e.length;s++){let t=e[s];if(this.options.extensions?.renderers?.[t.type]){let l=t,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=o||"";continue}}let i=t;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){let s="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=o||"";continue}}let l=i;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"checkbox":{s+=r.checkbox(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},_=class{options;block;constructor(n){this.options=n||R}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?b.lex:b.lexInline}provideParser(){return this.block?w.parse:w.parseInline}},it=class{defaults=Q();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=w;Renderer=C;TextRenderer=W;Lexer=b;Tokenizer=B;Hooks=_;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let o=t.renderer.apply(this,l);return o===!1&&(o=i.apply(this,l)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new C(this.defaults);for(let i in r.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,o=r.renderer[l],a=t[l];t[l]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new B(this.defaults);for(let i in r.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,o=r.tokenizer[l],a=t[l];t[l]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new _;for(let i in r.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,o=r.hooks[l],a=t[l];_.passThroughHooks.has(i)?t[l]=h=>{if(this.defaults.async&&_.passThroughHooksRespectAsync.has(i))return(async()=>{let g=await o.call(t,h);return a.call(t,g)})();let c=o.call(t,h);return a.call(t,c)}:t[l]=(...h)=>{if(this.defaults.async)return(async()=>{let g=await o.apply(t,h);return g===!1&&(g=await a.apply(t,h)),g})();let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(l){let o=[];return o.push(i.call(this,l)),t&&(o=o.concat(t.call(this,l))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return b.lex(n,e??this.defaults)}parser(n,e){return w.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=n),t.async)return(async()=>{let l=t.hooks?await t.hooks.preprocess(e):e,o=await(t.hooks?await t.hooks.provideLexer():n?b.lex:b.lexInline)(l,t),a=t.hooks?await t.hooks.processAllTokens(o):o;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let h=await(t.hooks?await t.hooks.provideParser():n?w.parse:w.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(h):h})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let l=(t.hooks?t.hooks.provideLexer():n?b.lex:b.lexInline)(e,t);t.hooks&&(l=t.hooks.processAllTokens(l)),t.walkTokens&&this.walkTokens(l,t.walkTokens);let o=(t.hooks?t.hooks.provideParser():n?w.parse:w.parseInline)(l,t);return t.hooks&&(o=t.hooks.postprocess(o)),o}catch(l){return i(l)}}}onError(n,e){return r=>{if(r.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+m(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},$=new it;function k(n,e){return $.parse(n,e)}k.options=k.setOptions=function(n){return $.setOptions(n),k.defaults=$.defaults,se(k.defaults),k};k.getDefaults=Q;k.defaults=R;k.use=function(...n){return $.use(...n),k.defaults=$.defaults,se(k.defaults),k};k.walkTokens=function(n,e){return $.walkTokens(n,e)};k.parseInline=$.parseInline;k.Parser=w;k.parser=w.parse;k.Renderer=C;k.TextRenderer=W;k.Lexer=b;k.lexer=b.lex;k.Tokenizer=B;k.Hooks=_;k.parse=k;k.options;k.setOptions;k.use;k.walkTokens;k.parseInline;w.parse;b.lex;export{k as g};
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import{d as y,b as e,A as i,o as f,g as $,r as o,t as g}from"./lit-core-CTInmNPB.js";import{a as h,w as S}from"./index-DcYipcbm.js";import{a as _}from"./views-settings-B2UFEtoi.js";import{f as x}from"./ctrl-settings-COfcdhha.js";import"./markdown-i_gIkIP3.js";var w=Object.defineProperty,k=Object.getOwnPropertyDescriptor,l=(s,t,n,r)=>{for(var a=r>1?void 0:r?k(t,n):t,d=s.length-1,p;d>=0;d--)(p=s[d])&&(a=(r?p(t,n,a):p(a))||a);return r&&a&&w(t,n,a),a};function u(s){if(!s)return"";try{return x(new Date(s).getTime())}catch{return""}}function F(s){return e`<div class="sb-md-body">${f(_(s))}</div>`}const b={ready:"sb-dot--ready",degraded:"sb-dot--degraded",offline:"sb-dot--offline"},B={"vault-capture":"📝","identity-update":"👤","calendar-enrichment":"📅","thought-captured":"💭",search:"🔍","file-modified":"📄"},C={honcho:"🟣",vault:"📓",session:"💬",screenpipe:"📺"};function v(s){return!s||s==="personal"?e`<span class="sb-scope-badge sb-scope-badge--personal" title="Personal memory">\u{1F512} personal</span>`:e`<span class="sb-scope-badge sb-scope-badge--shared" title="Shared to ${s}">\u{2197}\u{FE0F} ${s}</span>`}let c=class extends y{constructor(){super(...arguments),this.loading=!1,this.error=null,this.pulse=null,this.activity=null,this.identity=null,this.memoryBank=null,this.fileTree=null,this.screenpipeStatus=null,this.ingestionStatus=null,this.searchQuery="",this.searchResults=null,this.searching=!1,this.browsingFolder=null,this.folderEntries=null,this.folderName=null,this.expandedPulseSystem=null,this._unsubs=[],this._searchTimer=null}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._unsubs.push(h.on("refresh-requested",s=>{s.target==="second-brain"&&this._loadAll()})),this._loadAll()}disconnectedCallback(){for(const s of this._unsubs)s();this._unsubs=[],this._searchTimer&&clearTimeout(this._searchTimer),super.disconnectedCallback()}async _loadAll(){if(!(!this.ctx.gateway||!this.ctx.connected)){this.loading=!0,this.error=null;try{const s=this.ctx.gateway,[t,n,r,a,d]=await Promise.all([s.request("secondBrain.memoryPulse",{}),s.request("secondBrain.activity",{limit:20}),s.request("secondBrain.identity",{}),s.request("secondBrain.memoryBank",{}),s.request("secondBrain.fileTree",{depth:3})]);this.pulse=t,this.activity=n,this.identity=r,this.memoryBank=a,this.fileTree=d.tree??[],Promise.all([s.request("ingestion.screenpipeStatus",{}).catch(()=>null),s.request("ingestion.status",{}).catch(()=>null)]).then(([p,m])=>{this.screenpipeStatus=p,this.ingestionStatus=m})}catch(s){console.error("[SecondBrain] Load failed:",s),this.error=s instanceof Error?s.message:"Failed to load"}finally{this.loading=!1}}}async _doSearch(s){if(!this.ctx.gateway||!this.ctx.connected||!s.trim()){this.searchResults=null,this.searching=!1;return}this.searching=!0;try{const t=await this.ctx.gateway.request("secondBrain.search",{query:s,limit:30});this.searchQuery===s&&(this.searchResults=t.results??[])}catch(t){console.error("[SecondBrain] Search failed:",t)}finally{this.searching=!1}}_onSearchInput(s){const t=s.target.value;if(this.searchQuery=t,this._searchTimer&&clearTimeout(this._searchTimer),!t.trim()){this.searchResults=null;return}this._searchTimer=setTimeout(()=>{this._doSearch(t)},300)}async _openFile(s){if(!(!this.ctx.gateway||!this.ctx.connected))try{const t=await this.ctx.gateway.request("secondBrain.memoryBankEntry",{path:s});if(t?.content){const n=s.endsWith(".html")||s.endsWith(".htm");this.ctx.openSidebar({content:t.content,mimeType:n?"text/html":"text/markdown",filePath:s,title:t.name||s.split("/").pop()||"File"})}}catch(t){console.error("[SecondBrain] Open file failed:",t),this.ctx.addToast("Failed to open file","error")}}async _browseFolder(s){if(!(!this.ctx.gateway||!this.ctx.connected))try{const t=await this.ctx.gateway.request("secondBrain.memoryBank",{folder:s});this.browsingFolder=t.folder,this.folderName=t.folderName,this.folderEntries=t.entries}catch(t){console.error("[SecondBrain] Browse folder failed:",t)}}_exitFolder(){this.browsingFolder=null,this.folderEntries=null,this.folderName=null}_chatNavigate(s){h.emit("chat-navigate",{sessionKey:"new",tab:"chat",message:s})}render(){return this.loading&&!this.pulse?e`<div class="sb-loading"><div class="sb-spinner"></div>Loading Second Brain...</div>`:this.error&&!this.pulse?e`<div class="sb-error">${this.error}</div>`:this.browsingFolder&&this.folderEntries?e`
|
|
2
|
+
<section class="sb-dashboard">
|
|
3
|
+
<button class="sb-back-btn" @click=${()=>this._exitFolder()}>
|
|
4
|
+
\u{2190} Back
|
|
5
|
+
</button>
|
|
6
|
+
<div class="sb-section">
|
|
7
|
+
<div class="sb-section-header">
|
|
8
|
+
<span class="sb-section-title">${this.folderName??"Folder"}</span>
|
|
9
|
+
<span class="sb-section-count">${this.folderEntries.length}</span>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="sb-entry-list">
|
|
12
|
+
${this.folderEntries.length>0?this.folderEntries.map(s=>this._renderEntry(s)):e`<div class="sb-empty-inline">Empty folder</div>`}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</section>
|
|
16
|
+
`:e`
|
|
17
|
+
<section class="sb-dashboard">
|
|
18
|
+
${this._renderMemoryPulse()}
|
|
19
|
+
${this._renderSearch()}
|
|
20
|
+
${this.searchQuery.trim()?i:e`
|
|
21
|
+
${this._renderActivityFeed()}
|
|
22
|
+
${this._renderIdentityCard()}
|
|
23
|
+
${this._renderPeopleEntities()}
|
|
24
|
+
${this._renderKnowledgeBrowser()}
|
|
25
|
+
${this._renderScreenpipePanel()}
|
|
26
|
+
${this._renderIngestionStatus()}
|
|
27
|
+
`}
|
|
28
|
+
</section>
|
|
29
|
+
`}_renderMemoryPulse(){return this.pulse?e`
|
|
30
|
+
<div class="sb-pulse">
|
|
31
|
+
<div class="sb-pulse-systems">
|
|
32
|
+
${this.pulse.systems.map(s=>e`
|
|
33
|
+
<button
|
|
34
|
+
class="sb-pulse-pill"
|
|
35
|
+
@click=${()=>{this.expandedPulseSystem=this.expandedPulseSystem===s.id?null:s.id}}
|
|
36
|
+
>
|
|
37
|
+
<span class="sb-dot ${b[s.status]??"sb-dot--offline"}"></span>
|
|
38
|
+
<span class="sb-pulse-name">${s.name}</span>
|
|
39
|
+
</button>
|
|
40
|
+
`)}
|
|
41
|
+
<span class="sb-pulse-summary">${this.pulse.readyCount}/${this.pulse.totalCount} systems</span>
|
|
42
|
+
</div>
|
|
43
|
+
${this.expandedPulseSystem?e`
|
|
44
|
+
<div class="sb-pulse-detail">
|
|
45
|
+
${this.pulse.systems.filter(s=>s.id===this.expandedPulseSystem).map(s=>e`
|
|
46
|
+
<div class="sb-pulse-detail-row">
|
|
47
|
+
<span class="sb-dot ${b[s.status]}"></span>
|
|
48
|
+
<strong>${s.name}</strong>
|
|
49
|
+
<span class="sb-muted">${s.detail}</span>
|
|
50
|
+
${s.count!=null?e`<span class="sb-badge">${s.count}</span>`:i}
|
|
51
|
+
</div>
|
|
52
|
+
`)}
|
|
53
|
+
</div>
|
|
54
|
+
`:i}
|
|
55
|
+
</div>
|
|
56
|
+
`:i}_renderSearch(){return e`
|
|
57
|
+
<div class="sb-search-container">
|
|
58
|
+
<div class="sb-search-bar">
|
|
59
|
+
<span class="sb-search-icon">\u{1F50D}</span>
|
|
60
|
+
<input
|
|
61
|
+
class="sb-search-input"
|
|
62
|
+
type="text"
|
|
63
|
+
placeholder="Search your memory \u2014 Honcho, Vault, Sessions, Screenpipe..."
|
|
64
|
+
.value=${this.searchQuery}
|
|
65
|
+
@input=${s=>this._onSearchInput(s)}
|
|
66
|
+
/>
|
|
67
|
+
${this.searching?e`<div class="sb-spinner sb-spinner--sm"></div>`:i}
|
|
68
|
+
</div>
|
|
69
|
+
${this.searchResults?e`
|
|
70
|
+
<div class="sb-search-results">
|
|
71
|
+
<div class="sb-section-header">
|
|
72
|
+
<span class="sb-section-title">Results</span>
|
|
73
|
+
<span class="sb-section-count">${this.searchResults.length}</span>
|
|
74
|
+
</div>
|
|
75
|
+
${this.searchResults.length>0?e`<div class="sb-entry-list">
|
|
76
|
+
${this.searchResults.map(s=>e`
|
|
77
|
+
<div class="sb-entry" @click=${()=>this._openFile(s.path)}>
|
|
78
|
+
<div class="sb-entry-icon">\u{1F4C4}</div>
|
|
79
|
+
<div class="sb-entry-body">
|
|
80
|
+
<div class="sb-entry-name">
|
|
81
|
+
${s.name}
|
|
82
|
+
${s.source?e`<span class="sb-source-tag">${C[s.source]??""} ${s.source}</span>`:i}
|
|
83
|
+
${s.scope?v(s.scope):i}
|
|
84
|
+
</div>
|
|
85
|
+
${s.matchContext??s.excerpt?e`<div class="sb-entry-excerpt">${s.matchContext??s.excerpt}</div>`:i}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
`)}
|
|
89
|
+
</div>`:e`<div class="sb-empty-inline">No results for "${this.searchQuery}"</div>`}
|
|
90
|
+
</div>
|
|
91
|
+
`:i}
|
|
92
|
+
</div>
|
|
93
|
+
`}_renderActivityFeed(){return!this.activity||this.activity.events.length===0?e`
|
|
94
|
+
<div class="sb-section">
|
|
95
|
+
<div class="sb-section-header">
|
|
96
|
+
<span class="sb-section-title">Recent Activity</span>
|
|
97
|
+
</div>
|
|
98
|
+
<div class="sb-empty-block">
|
|
99
|
+
<div class="sb-empty-hint">No memory activity yet. As your ally learns, activity will appear here.</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
`:e`
|
|
103
|
+
<div class="sb-section">
|
|
104
|
+
<div class="sb-section-header">
|
|
105
|
+
<span class="sb-section-title">Recent Activity</span>
|
|
106
|
+
<span class="sb-section-count">${this.activity.total} events</span>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="sb-activity-feed">
|
|
109
|
+
${this.activity.events.slice(0,15).map(s=>e`
|
|
110
|
+
<div class="sb-activity-item">
|
|
111
|
+
<span class="sb-activity-icon">${B[s.type]??"•"}</span>
|
|
112
|
+
<div class="sb-activity-body">
|
|
113
|
+
<span class="sb-activity-title">${s.title}</span>
|
|
114
|
+
${s.detail?e`<span class="sb-activity-detail">${s.detail}</span>`:i}
|
|
115
|
+
</div>
|
|
116
|
+
${s.scope?v(s.scope):i}
|
|
117
|
+
<span class="sb-activity-time">${u(s.timestamp)}</span>
|
|
118
|
+
</div>
|
|
119
|
+
`)}
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
`}_renderIdentityCard(){return!this.identity||this.identity.files.length===0?e`
|
|
123
|
+
<div class="sb-section">
|
|
124
|
+
<div class="sb-section-header">
|
|
125
|
+
<span class="sb-section-title">Identity</span>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="sb-empty-block">
|
|
128
|
+
<div class="sb-empty-hint">Tell your ally about yourself to build your identity profile.</div>
|
|
129
|
+
<button class="sb-action-btn" @click=${()=>this._chatNavigate("I want to build my identity profile. Ask me about my values, principles, vision, and communication style.")}>Tell your ally about you</button>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
`:e`
|
|
133
|
+
<div class="sb-section">
|
|
134
|
+
<div class="sb-section-header">
|
|
135
|
+
<span class="sb-section-title">Identity</span>
|
|
136
|
+
<button class="sb-action-btn sb-action-btn--sm" @click=${()=>this._chatNavigate("I want to update my identity profile. Ask me what I'd like to change.")}>Edit via Chat</button>
|
|
137
|
+
</div>
|
|
138
|
+
<div class="sb-identity-grid">
|
|
139
|
+
${this.identity.files.map(s=>e`
|
|
140
|
+
<div class="sb-identity-card" @click=${()=>this._openFile(s.key)}>
|
|
141
|
+
<div class="sb-identity-label">${s.label}</div>
|
|
142
|
+
<div class="sb-identity-excerpt">${s.content.slice(0,100).replace(/[#\n]+/g," ").trim()}\u{2026}</div>
|
|
143
|
+
${s.updatedAt?e`<div class="sb-identity-time">${u(s.updatedAt)}</div>`:i}
|
|
144
|
+
</div>
|
|
145
|
+
`)}
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
`}_renderPeopleEntities(){if(!this.memoryBank)return i;const s=this.memoryBank.sections.find(a=>a.key==="people"),t=this.memoryBank.sections.find(a=>a.key==="companies"),n=(s?.entries.length??0)>0,r=(t?.entries.length??0)>0;return!n&&!r?e`
|
|
149
|
+
<div class="sb-section">
|
|
150
|
+
<div class="sb-section-header">
|
|
151
|
+
<span class="sb-section-title">People & Companies</span>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="sb-empty-block">
|
|
154
|
+
<div class="sb-empty-hint">Your ally will build profiles for people and companies as you mention them.</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
`:e`
|
|
158
|
+
<div class="sb-section">
|
|
159
|
+
<div class="sb-section-header">
|
|
160
|
+
<span class="sb-section-title">People & Companies</span>
|
|
161
|
+
<span class="sb-section-count">${(s?.entries.length??0)+(t?.entries.length??0)}</span>
|
|
162
|
+
</div>
|
|
163
|
+
<div class="sb-people-grid">
|
|
164
|
+
${(s?.entries??[]).map(a=>e`
|
|
165
|
+
<div class="sb-person-card" @click=${()=>this._openFile(a.path)}>
|
|
166
|
+
<div class="sb-person-icon">\u{1F464}</div>
|
|
167
|
+
<div class="sb-person-body">
|
|
168
|
+
<div class="sb-person-name">${a.name}</div>
|
|
169
|
+
${a.excerpt?e`<div class="sb-person-excerpt">${a.excerpt}</div>`:i}
|
|
170
|
+
</div>
|
|
171
|
+
${a.updatedAt?e`<div class="sb-person-time">${u(a.updatedAt)}</div>`:i}
|
|
172
|
+
</div>
|
|
173
|
+
`)}
|
|
174
|
+
${(t?.entries??[]).map(a=>e`
|
|
175
|
+
<div class="sb-person-card" @click=${()=>this._openFile(a.path)}>
|
|
176
|
+
<div class="sb-person-icon">\u{1F3E2}</div>
|
|
177
|
+
<div class="sb-person-body">
|
|
178
|
+
<div class="sb-person-name">${a.name}</div>
|
|
179
|
+
${a.excerpt?e`<div class="sb-person-excerpt">${a.excerpt}</div>`:i}
|
|
180
|
+
</div>
|
|
181
|
+
${a.updatedAt?e`<div class="sb-person-time">${u(a.updatedAt)}</div>`:i}
|
|
182
|
+
</div>
|
|
183
|
+
`)}
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
`}_renderKnowledgeBrowser(){const s=this.memoryBank?.sections.find(d=>d.key==="projects"),t=(s?.entries.length??0)>0,n=!!this.memoryBank?.curated,r=(this.memoryBank?.extraFiles.length??0)>0,a=(this.fileTree?.length??0)>0;return!t&&!n&&!r&&!a?i:e`
|
|
187
|
+
<div class="sb-section">
|
|
188
|
+
<div class="sb-section-header">
|
|
189
|
+
<span class="sb-section-title">Knowledge</span>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
${t?e`
|
|
193
|
+
<details class="sb-collapsible">
|
|
194
|
+
<summary class="sb-collapsible-header">
|
|
195
|
+
<span>\u{1F4C2} Projects</span>
|
|
196
|
+
<span class="sb-section-count">${s.entries.length}</span>
|
|
197
|
+
</summary>
|
|
198
|
+
<div class="sb-entry-list">
|
|
199
|
+
${s.entries.map(d=>this._renderEntry(d))}
|
|
200
|
+
</div>
|
|
201
|
+
</details>
|
|
202
|
+
`:i}
|
|
203
|
+
|
|
204
|
+
${n?e`
|
|
205
|
+
<details class="sb-collapsible">
|
|
206
|
+
<summary class="sb-collapsible-header">
|
|
207
|
+
<span>\u{2B50} Curated Facts</span>
|
|
208
|
+
</summary>
|
|
209
|
+
<div class="sb-card">${F(this.memoryBank.curated.content)}</div>
|
|
210
|
+
</details>
|
|
211
|
+
`:i}
|
|
212
|
+
|
|
213
|
+
${r?e`
|
|
214
|
+
<details class="sb-collapsible">
|
|
215
|
+
<summary class="sb-collapsible-header">
|
|
216
|
+
<span>\u{1F4CB} Reference Files</span>
|
|
217
|
+
<span class="sb-section-count">${this.memoryBank.extraFiles.length}</span>
|
|
218
|
+
</summary>
|
|
219
|
+
<div class="sb-entry-list">
|
|
220
|
+
${this.memoryBank.extraFiles.map(d=>this._renderEntry(d))}
|
|
221
|
+
</div>
|
|
222
|
+
</details>
|
|
223
|
+
`:i}
|
|
224
|
+
|
|
225
|
+
${a?e`
|
|
226
|
+
<details class="sb-collapsible">
|
|
227
|
+
<summary class="sb-collapsible-header">
|
|
228
|
+
<span>\u{1F5C2}\uFE0F Browse All Files</span>
|
|
229
|
+
</summary>
|
|
230
|
+
${this._renderFileTree(this.fileTree,0)}
|
|
231
|
+
</details>
|
|
232
|
+
`:i}
|
|
233
|
+
</div>
|
|
234
|
+
`}_renderScreenpipePanel(){const s=this.screenpipeStatus;return e`
|
|
235
|
+
<div class="sb-section">
|
|
236
|
+
<div class="sb-section-header">
|
|
237
|
+
<span class="sb-section-title">\u{1F4FA} Ambient Memory (Screenpipe)</span>
|
|
238
|
+
${s?e`
|
|
239
|
+
<span class="sb-dot ${s.available?"sb-dot--ready":"sb-dot--offline"}"></span>
|
|
240
|
+
`:i}
|
|
241
|
+
</div>
|
|
242
|
+
${s?s.available?e`
|
|
243
|
+
<div class="sb-screenpipe-active">
|
|
244
|
+
<div class="sb-screenpipe-row">
|
|
245
|
+
<span class="sb-screenpipe-label">Status</span>
|
|
246
|
+
<span class="sb-screenpipe-value">${s.enabled?"Active — capturing":"Connected but not enabled"}</span>
|
|
247
|
+
</div>
|
|
248
|
+
<div class="sb-screenpipe-row">
|
|
249
|
+
<span class="sb-screenpipe-label">Blocked Apps</span>
|
|
250
|
+
<span class="sb-screenpipe-value">${s.blockedApps?.length??0} apps filtered</span>
|
|
251
|
+
</div>
|
|
252
|
+
<div class="sb-screenpipe-actions">
|
|
253
|
+
${s.enabled?e`
|
|
254
|
+
<button class="sb-action-btn sb-action-btn--muted" @click=${()=>this._toggleScreenpipe(!1)}>Pause</button>
|
|
255
|
+
`:e`
|
|
256
|
+
<button class="sb-action-btn" @click=${()=>this._toggleScreenpipe(!0)}>Enable Ambient Memory</button>
|
|
257
|
+
`}
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
`:e`
|
|
261
|
+
<div class="sb-screenpipe-setup">
|
|
262
|
+
<div class="sb-setup-message">
|
|
263
|
+
Screenpipe captures what's on your screen and in your audio, locally. Your ally uses it to recall context you've seen.
|
|
264
|
+
</div>
|
|
265
|
+
<div class="sb-setup-steps">
|
|
266
|
+
<div class="sb-setup-step">
|
|
267
|
+
<span class="sb-setup-num">1</span>
|
|
268
|
+
<span>Install: <code>brew install screenpipe</code></span>
|
|
269
|
+
</div>
|
|
270
|
+
<div class="sb-setup-step">
|
|
271
|
+
<span class="sb-setup-num">2</span>
|
|
272
|
+
<span>Grant accessibility permissions when prompted</span>
|
|
273
|
+
</div>
|
|
274
|
+
<div class="sb-setup-step">
|
|
275
|
+
<span class="sb-setup-num">3</span>
|
|
276
|
+
<span>Run: <code>screenpipe</code> (keeps running in background)</span>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
<button class="sb-action-btn" @click=${()=>this._testScreenpipe()}>Check Connection</button>
|
|
280
|
+
</div>
|
|
281
|
+
`:e`
|
|
282
|
+
<div class="sb-empty-block">
|
|
283
|
+
<div class="sb-empty-hint">Loading Screenpipe status...</div>
|
|
284
|
+
</div>
|
|
285
|
+
`}
|
|
286
|
+
</div>
|
|
287
|
+
`}async _testScreenpipe(){if(!(!this.ctx.gateway||!this.ctx.connected))try{const s=await this.ctx.gateway.request("ingestion.screenpipeStatus",{});this.screenpipeStatus=s,s.available?this.ctx.addToast("Screenpipe connected!","success"):this.ctx.addToast("Screenpipe not running. Start it with `screenpipe`.","error")}catch{this.ctx.addToast("Could not check Screenpipe status","error")}}async _toggleScreenpipe(s){if(!(!this.ctx.gateway||!this.ctx.connected))try{await this.ctx.gateway.request("ingestion.screenpipeConfigure",{enabled:s}),this.screenpipeStatus&&(this.screenpipeStatus={...this.screenpipeStatus,enabled:s}),this.ctx.addToast(s?"Ambient memory enabled":"Ambient memory paused","success")}catch{this.ctx.addToast("Failed to update Screenpipe config","error")}}_renderIngestionStatus(){const s=this.ingestionStatus;if(!s)return i;const t=s.pipelines.filter(r=>r.configured),n=s.pipelines.filter(r=>!r.configured);return e`
|
|
288
|
+
<div class="sb-section">
|
|
289
|
+
<div class="sb-section-header">
|
|
290
|
+
<span class="sb-section-title">\u{1F504} Data Sources</span>
|
|
291
|
+
<span class="sb-section-count">${t.length}/${s.pipelines.length} connected</span>
|
|
292
|
+
</div>
|
|
293
|
+
${t.length>0?e`
|
|
294
|
+
<div class="sb-ingestion-list">
|
|
295
|
+
${t.map(r=>e`
|
|
296
|
+
<div class="sb-ingestion-item sb-ingestion-item--active">
|
|
297
|
+
<span class="sb-dot sb-dot--ready"></span>
|
|
298
|
+
<span class="sb-ingestion-name">${r.name}</span>
|
|
299
|
+
<span class="sb-ingestion-badge">Connected</span>
|
|
300
|
+
</div>
|
|
301
|
+
`)}
|
|
302
|
+
</div>
|
|
303
|
+
`:i}
|
|
304
|
+
${n.length>0?e`
|
|
305
|
+
<details class="sb-collapsible">
|
|
306
|
+
<summary class="sb-collapsible-header">
|
|
307
|
+
<span>Available Sources</span>
|
|
308
|
+
<span class="sb-section-count">${n.length}</span>
|
|
309
|
+
</summary>
|
|
310
|
+
<div class="sb-ingestion-list">
|
|
311
|
+
${n.map(r=>e`
|
|
312
|
+
<div class="sb-ingestion-item">
|
|
313
|
+
<span class="sb-dot sb-dot--offline"></span>
|
|
314
|
+
<span class="sb-ingestion-name">${r.name}</span>
|
|
315
|
+
<span class="sb-muted">${r.envVar}</span>
|
|
316
|
+
</div>
|
|
317
|
+
`)}
|
|
318
|
+
</div>
|
|
319
|
+
</details>
|
|
320
|
+
`:i}
|
|
321
|
+
</div>
|
|
322
|
+
`}_renderEntry(s){const t=s.isDirectory;return e`
|
|
323
|
+
<div class="sb-entry" @click=${()=>{t?this._browseFolder(s.path):this._openFile(s.path)}}>
|
|
324
|
+
<div class="sb-entry-icon ${t?"sb-entry-icon--folder":""}">${t?"📁":"📄"}</div>
|
|
325
|
+
<div class="sb-entry-body">
|
|
326
|
+
<div class="sb-entry-name">${s.name}${t?"/":""}</div>
|
|
327
|
+
${s.excerpt?e`<div class="sb-entry-excerpt">${s.excerpt}</div>`:i}
|
|
328
|
+
</div>
|
|
329
|
+
${s.updatedAt?e`<div class="sb-entry-meta">${u(s.updatedAt)}</div>`:i}
|
|
330
|
+
</div>
|
|
331
|
+
`}_renderFileTree(s,t){return e`
|
|
332
|
+
<div class="sb-file-tree" style="padding-left: ${t*16}px">
|
|
333
|
+
${s.map(n=>n.type==="folder"?e`
|
|
334
|
+
<details class="sb-tree-folder">
|
|
335
|
+
<summary class="sb-tree-item sb-tree-folder-name">
|
|
336
|
+
<span class="sb-file-icon">\u{1F4C1}</span>
|
|
337
|
+
<span>${n.name}</span>
|
|
338
|
+
${n.childCount!=null?e`<span class="sb-tree-count">${n.childCount}</span>`:i}
|
|
339
|
+
</summary>
|
|
340
|
+
${n.children?this._renderFileTree(n.children,t+1):i}
|
|
341
|
+
</details>
|
|
342
|
+
`:e`
|
|
343
|
+
<button class="sb-tree-item sb-tree-file" @click=${()=>this._openFile(n.path)}>
|
|
344
|
+
<span class="sb-file-icon">\u{1F4C4}</span>
|
|
345
|
+
<span class="sb-file-name">${n.name}</span>
|
|
346
|
+
${n.size!=null?e`<span class="sb-tree-size">${n.size<1024?`${n.size}B`:`${(n.size/1024).toFixed(1)}K`}</span>`:i}
|
|
347
|
+
</button>
|
|
348
|
+
`)}
|
|
349
|
+
</div>
|
|
350
|
+
`}};l([$({context:S,subscribe:!0})],c.prototype,"ctx",2);l([o()],c.prototype,"loading",2);l([o()],c.prototype,"error",2);l([o()],c.prototype,"pulse",2);l([o()],c.prototype,"activity",2);l([o()],c.prototype,"identity",2);l([o()],c.prototype,"memoryBank",2);l([o()],c.prototype,"fileTree",2);l([o()],c.prototype,"screenpipeStatus",2);l([o()],c.prototype,"ingestionStatus",2);l([o()],c.prototype,"searchQuery",2);l([o()],c.prototype,"searchResults",2);l([o()],c.prototype,"searching",2);l([o()],c.prototype,"browsingFolder",2);l([o()],c.prototype,"folderEntries",2);l([o()],c.prototype,"folderName",2);l([o()],c.prototype,"expandedPulseSystem",2);c=l([g("gm-second-brain")],c);function I(){return i}export{c as GmSecondBrain,I as renderSecondBrain};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function s(e){if(!e.client||!e.connected)return;const t=e;try{const a=await e.client.request("onboarding.setupProgress",{});t.setupProgress=a}catch{}}async function c(e){if(e.client)try{await e.client.request("onboarding.setupDismiss",{});const t=e;t.setupBarDismissed=!0,e.showToast("Setup hidden — continue anytime from Settings.","success",3e3)}catch{r(e)}}async function n(e){if(!e.client||!e.connected)return;const t=e;t.setupCapabilitiesLoading=!0;try{const a=await e.client.request("onboarding.capabilities",{});t.setupCapabilities=a}catch{t.setupCapabilities=null}finally{t.setupCapabilitiesLoading=!1}}async function o(e){if(!e.client||!e.connected)return;const t=e;try{const a=await e.client.request("onboarding.status",{});t.onboardingData=a,t.showSetupTab=!a.completedAt,t.setupQuickDone=!!a.identity?.name}catch{}}async function u(e,t){if(!e.client)return!1;try{const a=await e.client.request("onboarding.quickSetup",{name:t}),i=e;return i.onboardingData=a.state,i.setupQuickDone=!0,i.onboardingActive=!1,t&&(e.userName=t,e.applySettings({...e.settings,userName:t})),e.showToast(`Welcome, ${t}!`,"success",3e3),!0}catch(a){const i=a instanceof Error?a.message:"Setup failed";return e.showToast(i,"error"),console.error("[Setup] quickSetup error:",a),!1}}async function l(e,t){if(e.client)switch(t){case"identity":e.wizardActive=!0;break;case"daily-brief":try{await e.client.request("godmode.options.set",{key:"dailyBrief.enabled",value:!0}),e.setTab("today"),e.showToast("Daily Brief enabled!","success",3e3)}catch{e.showToast("Failed to enable Daily Brief","error")}break;case"google-calendar":case"github":try{e.showToast("Setting up...","success",2e3),await e.client.request("integrations.autoInstall",{integrationId:t}),e.showToast("Connected!","success",3e3),n(e)}catch(a){const i=a instanceof Error?a.message:"Setup failed";e.showToast(i,"error")}break;case"obsidian-vault":e.setTab("memory");break;default:e.showToast("Coming soon!","success",2e3)}}async function r(e){if(e.client)try{await e.client.request("godmode.options.set",{key:"onboarding.hidden",value:!0});const t=e;t.showSetupTab=!1,e.showToast("Setup hidden. Re-enable in Lab.","success",3e3)}catch(t){e.showToast("Failed to hide setup","error"),console.error("[Setup] hideSetup error:",t)}}export{l as capabilityAction,c as dismissSetupBar,r as hideSetup,n as loadCapabilities,o as loadOnboardingStatus,s as loadSetupProgress,u as quickSetup};
|