hermesbuttons 1.1.2 → 1.1.3

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/dist/index.d.mts CHANGED
@@ -27,8 +27,6 @@ interface HermesButtonOptions {
27
27
  interface HermesSkillButtonOptions {
28
28
  /** The slash command to run in Hermes (e.g. "/research-assistant") */
29
29
  command: string;
30
- /** URL to a downloadable skill package (.zip, SKILL.md, or plugin.json) */
31
- skillUrl?: string;
32
30
  /** Theme variant. Default: 'branded' */
33
31
  theme?: Theme;
34
32
  /** Button size. Default: 'md' */
@@ -41,8 +39,6 @@ interface HermesSkillButtonOptions {
41
39
  popup?: boolean;
42
40
  /** Callback fired after the command is copied */
43
41
  onCopy?: (command: string) => void;
44
- /** Callback fired when the skill package is downloaded */
45
- onDownload?: (url: string) => void;
46
42
  /** Custom popup title */
47
43
  popupTitle?: string;
48
44
  /** Custom popup description */
@@ -55,7 +51,6 @@ interface PopupOptions {
55
51
  description?: string;
56
52
  command: string;
57
53
  fullCommand?: string;
58
- skillUrl?: string;
59
54
  onCopy?: (command: string) => void;
60
55
  onClose?: () => void;
61
56
  }
@@ -156,7 +151,6 @@ interface ButtonMetadata {
156
151
  platform: 'hermes' | 'hermes-skill';
157
152
  command: string;
158
153
  fullCommand?: string;
159
- skillUrl?: string;
160
154
  }
161
155
  declare function discoverButtons(): ButtonMetadata[];
162
156
  declare function generateStructuredData(): object;
@@ -184,7 +178,6 @@ interface HermesButtonAttributes {
184
178
 
185
179
  interface HermesSkillButtonAttributes {
186
180
  command?: string;
187
- 'skill-url'?: string;
188
181
  theme?: Theme;
189
182
  size?: Size;
190
183
  variant?: Variant;
package/dist/index.d.ts CHANGED
@@ -27,8 +27,6 @@ interface HermesButtonOptions {
27
27
  interface HermesSkillButtonOptions {
28
28
  /** The slash command to run in Hermes (e.g. "/research-assistant") */
29
29
  command: string;
30
- /** URL to a downloadable skill package (.zip, SKILL.md, or plugin.json) */
31
- skillUrl?: string;
32
30
  /** Theme variant. Default: 'branded' */
33
31
  theme?: Theme;
34
32
  /** Button size. Default: 'md' */
@@ -41,8 +39,6 @@ interface HermesSkillButtonOptions {
41
39
  popup?: boolean;
42
40
  /** Callback fired after the command is copied */
43
41
  onCopy?: (command: string) => void;
44
- /** Callback fired when the skill package is downloaded */
45
- onDownload?: (url: string) => void;
46
42
  /** Custom popup title */
47
43
  popupTitle?: string;
48
44
  /** Custom popup description */
@@ -55,7 +51,6 @@ interface PopupOptions {
55
51
  description?: string;
56
52
  command: string;
57
53
  fullCommand?: string;
58
- skillUrl?: string;
59
54
  onCopy?: (command: string) => void;
60
55
  onClose?: () => void;
61
56
  }
@@ -156,7 +151,6 @@ interface ButtonMetadata {
156
151
  platform: 'hermes' | 'hermes-skill';
157
152
  command: string;
158
153
  fullCommand?: string;
159
- skillUrl?: string;
160
154
  }
161
155
  declare function discoverButtons(): ButtonMetadata[];
162
156
  declare function generateStructuredData(): object;
@@ -184,7 +178,6 @@ interface HermesButtonAttributes {
184
178
 
185
179
  interface HermesSkillButtonAttributes {
186
180
  command?: string;
187
- 'skill-url'?: string;
188
181
  theme?: Theme;
189
182
  size?: Size;
190
183
  variant?: Variant;
@@ -1,4 +1,4 @@
1
- "use strict";var HermesButtons=(()=>{var P=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Z=(a,n)=>{for(var t in n)P(a,t,{get:n[t],enumerable:!0})},X=(a,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of Y(n))!J.call(a,e)&&e!==t&&P(a,e,{get:()=>n[e],enumerable:!(o=K(n,e))||o.enumerable});return a};var Q=a=>X(P({},"__esModule",{value:!0}),a);var it={};Z(it,{ALT_BRAND_COLOR:()=>m,BRAND_COLOR:()=>i,HERMES_ICON:()=>x,HERMES_SKILL_ICON:()=>k,HermesButton:()=>A,HermesPopupDialog:()=>T,HermesSkillButton:()=>_,createHermesButton:()=>j,createHermesSkillButton:()=>W,discoverButtons:()=>D,generateStructuredData:()=>I,injectStructuredData:()=>G,register:()=>nt,registerHermesButton:()=>R,registerHermesSkillButton:()=>S,resolveTheme:()=>p,showPopup:()=>C,themes:()=>y});var N="agentpreferences";function q(){return typeof document<"u"}function tt(){if(!q())return null;let a=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${N}=`));if(!a)return null;let n=a.slice(N.length+1);if(!n)return null;try{let t=decodeURIComponent(n),o=JSON.parse(t);return!o||typeof o!="object"||!Array.isArray(o.order)?null:{order:o.order.filter(r=>typeof r=="string"&&r.length>0)}}catch{return null}}function et(a){if(!q())return;let n=a.order.slice(0,24),t=JSON.stringify({order:n}),o=new Date;o.setFullYear(o.getFullYear()+1),document.cookie=`${N}=${encodeURIComponent(t)}; Path=/; SameSite=Lax; Expires=${o.toUTCString()}`}function f(a){if(!a||typeof a!="string")return;let t=tt()?.order.filter(o=>o!==a)??[];et({order:[a,...t]})}var x=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon">
1
+ "use strict";var HermesButtons=(()=>{var N=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Z=(a,n)=>{for(var t in n)N(a,t,{get:n[t],enumerable:!0})},X=(a,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Y(n))!J.call(a,o)&&o!==t&&N(a,o,{get:()=>n[o],enumerable:!(e=K(n,o))||e.enumerable});return a};var Q=a=>X(N({},"__esModule",{value:!0}),a);var it={};Z(it,{ALT_BRAND_COLOR:()=>m,BRAND_COLOR:()=>i,HERMES_ICON:()=>x,HERMES_SKILL_ICON:()=>k,HermesButton:()=>A,HermesPopupDialog:()=>F,HermesSkillButton:()=>_,createHermesButton:()=>U,createHermesSkillButton:()=>W,discoverButtons:()=>D,generateStructuredData:()=>I,injectStructuredData:()=>G,register:()=>nt,registerHermesButton:()=>T,registerHermesSkillButton:()=>$,resolveTheme:()=>p,showPopup:()=>w,themes:()=>y});var P="agentpreferences";function q(){return typeof document<"u"}function tt(){if(!q())return null;let a=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${P}=`));if(!a)return null;let n=a.slice(P.length+1);if(!n)return null;try{let t=decodeURIComponent(n),e=JSON.parse(t);return!e||typeof e!="object"||!Array.isArray(e.order)?null:{order:e.order.filter(r=>typeof r=="string"&&r.length>0)}}catch{return null}}function et(a){if(!q())return;let n=a.order.slice(0,24),t=JSON.stringify({order:n}),e=new Date;e.setFullYear(e.getFullYear()+1),document.cookie=`${P}=${encodeURIComponent(t)}; Path=/; SameSite=Lax; Expires=${e.toUTCString()}`}function f(a){if(!a||typeof a!="string")return;let t=tt()?.order.filter(e=>e!==a)??[];et({order:[a,...t]})}var x=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon">
2
2
  <!-- Wing helmet -->
3
3
  <path d="M12 2C8.5 2 6 4.5 6 7c0 1.5.5 2.8 1.5 3.8L6 14h12l-1.5-3.2C17.5 9.8 18 8.5 18 7c0-2.5-2.5-5-6-5z" fill="currentColor" opacity="0.2"/>
4
4
  <path d="M12 2C8.5 2 6 4.5 6 7c0 1.5.5 2.8 1.5 3.8L6 14h12l-1.5-3.2C17.5 9.8 18 8.5 18 7c0-2.5-2.5-5-6-5z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/>
@@ -23,14 +23,14 @@
23
23
  <!-- Sparkle -->
24
24
  <circle cx="8" cy="6" r="0.8" fill="currentColor"/>
25
25
  <circle cx="16" cy="6" r="0.8" fill="currentColor"/>
26
- </svg>`,$=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
26
+ </svg>`,R=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
27
27
  <rect x="5" y="5" width="8" height="8" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/>
28
28
  <path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
29
- </svg>`,U=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
29
+ </svg>`,V=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
30
30
  <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
31
- </svg>`;var V=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
31
+ </svg>`;var j=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
32
32
  <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
33
- </svg>`;var i="#2B8CFF",v="#1E7AEB",O="#186BD4",s="43, 140, 255",m="#8FA3E8",L="#7B91DC",B="#6B82CC",c="143, 163, 232",y={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},"branded-alt":{bg:m,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:m,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},dark:{bg:"#141C2E",text:"#F1F5F9",border:"#2A3F5C",surface:"#1A2740",surfaceText:"#F1F5F9",muted:"#94A3B8",primary:i,primaryText:"#FFFFFF",codeBg:"#0A0E18",codeText:"#F1F5F9"},light:{bg:"#FFFFFF",text:"#0F172A",border:"#CBD5E1",surface:"#F8FAFC",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"}};function p(a){return a!=="system"?y[a]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function w(a){return`
33
+ </svg>`;var i="#2B8CFF",v="#1E7AEB",S="#186BD4",d="43, 140, 255",m="#8FA3E8",O="#7B91DC",L="#6B82CC",c="143, 163, 232",y={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},"branded-alt":{bg:m,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:m,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},dark:{bg:"#141C2E",text:"#F1F5F9",border:"#2A3F5C",surface:"#1A2740",surfaceText:"#F1F5F9",muted:"#94A3B8",primary:i,primaryText:"#FFFFFF",codeBg:"#0A0E18",codeText:"#F1F5F9"},light:{bg:"#FFFFFF",text:"#0F172A",border:"#CBD5E1",surface:"#F8FAFC",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"}};function p(a){return a!=="system"?y[a]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function C(a){return`
34
34
  --hb-bg: ${a.bg};
35
35
  --hb-text: ${a.text};
36
36
  --hb-border: ${a.border};
@@ -41,7 +41,7 @@
41
41
  --hb-primary-text: ${a.primaryText};
42
42
  --hb-code-bg: ${a.codeBg};
43
43
  --hb-code-text: ${a.codeText};
44
- `}var H={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},M={sm:{height:"2rem",fontSize:"0.75rem",iconSize:"0.875rem",padding:"0 0.75rem",ccPadding:"0 0.5rem",gap:"0.375rem",radius:"0.375rem"},md:{height:"2.5rem",fontSize:"0.875rem",iconSize:"1.125rem",padding:"0 1rem",ccPadding:"0 0.75rem",gap:"0.5rem",radius:"0.5rem"},lg:{height:"3rem",fontSize:"1rem",iconSize:"1.375rem",padding:"0 1.25rem",ccPadding:"0 1rem",gap:"0.625rem",radius:"0.625rem"}};var ot=`
44
+ `}var B={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},H={sm:{height:"2rem",fontSize:"0.75rem",iconSize:"0.875rem",padding:"0 0.75rem",ccPadding:"0 0.5rem",gap:"0.375rem",radius:"0.375rem"},md:{height:"2.5rem",fontSize:"0.875rem",iconSize:"1.125rem",padding:"0 1rem",ccPadding:"0 0.75rem",gap:"0.5rem",radius:"0.5rem"},lg:{height:"3rem",fontSize:"1rem",iconSize:"1.375rem",padding:"0 1.25rem",ccPadding:"0 1rem",gap:"0.625rem",radius:"0.625rem"}};var ot=`
45
45
  :host {
46
46
  position: fixed;
47
47
  inset: 0;
@@ -318,21 +318,21 @@
318
318
  @supports (padding: env(safe-area-inset-bottom)) {
319
319
  .hb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
320
320
  }
321
- `,T=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this.attachShadow({mode:"open"})}set options(t){this._options=t,this.render()}get options(){return this._options}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}resolvePopupTokens(){let{theme:t}=this._options;if(t==="dark"||t==="light")return p(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?p("dark"):p("light");let e=o?p("dark"):p("light"),r=p(t);return{...e,primary:r.primary,primaryText:r.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:o,description:e,command:r,fullCommand:d,skillUrl:l}=this._options,h=this.resolvePopupTokens(),u=t==="hermes"?x:k,b=t==="hermes",E=d||r;this.shadowRoot.innerHTML=`
321
+ `,F=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this.attachShadow({mode:"open"})}set options(t){this._options=t,this.render()}get options(){return this._options}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}resolvePopupTokens(){let{theme:t}=this._options;if(t==="dark"||t==="light")return p(t);let e=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return e?p("dark"):p("light");let o=e?p("dark"):p("light"),r=p(t);return{...o,primary:r.primary,primaryText:r.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:e,description:o,command:r,fullCommand:s}=this._options,l=this.resolvePopupTokens(),h=t==="hermes"?x:k,b=t==="hermes",u=s||r;this.shadowRoot.innerHTML=`
322
322
  <style>${ot}</style>
323
- <div style="${w(h)}">
323
+ <div style="${C(l)}">
324
324
  <div class="hb-backdrop" data-action="close"></div>
325
325
  <div class="hb-dialog" role="dialog" aria-modal="true" aria-labelledby="hb-dialog-title">
326
326
  <div class="hb-dialog-header">
327
- <div class="hb-dialog-header-icon">${u}</div>
327
+ <div class="hb-dialog-header-icon">${h}</div>
328
328
  <div class="hb-dialog-header-text">
329
- <div class="hb-dialog-title" id="hb-dialog-title">${o}</div>
330
- ${e?`<div class="hb-dialog-description">${e}</div>`:""}
329
+ <div class="hb-dialog-title" id="hb-dialog-title">${e}</div>
330
+ ${o?`<div class="hb-dialog-description">${o}</div>`:""}
331
331
  </div>
332
- <button class="hb-dialog-close" data-action="close" aria-label="Close">${V}</button>
332
+ <button class="hb-dialog-close" data-action="close" aria-label="Close">${j}</button>
333
333
  </div>
334
334
  <div class="hb-dialog-body">
335
- ${b?this.renderHermesTerminalBody(E):this.renderHermesSkillBody(r,l)}
335
+ ${b?this.renderHermesTerminalBody(u):this.renderHermesSkillBody(r)}
336
336
  </div>
337
337
  <div class="hb-dialog-footer">
338
338
  ${b?`
@@ -350,7 +350,7 @@
350
350
  <div class="hb-step-label">Copy this command to your clipboard</div>
351
351
  <div class="hb-code-block">
352
352
  <div class="hb-code-text"><span class="hb-code-prefix">$</span>${this.escapeHtml(t)}</div>
353
- <button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${$}<span>Copy</span></button>
353
+ <button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${R}<span>Copy</span></button>
354
354
  </div>
355
355
  </div>
356
356
  </div>
@@ -360,41 +360,24 @@
360
360
  <div class="hb-step-label">Paste and run in your terminal</div>
361
361
  </div>
362
362
  </div>
363
- `}renderHermesSkillBody(t,o){let e="";if(o){let r=`Install the skill from ${o} and run ${t}`;e+=`
364
- <div class="hb-step">
365
- <div class="hb-step-num">1</div>
366
- <div class="hb-step-content">
367
- <div class="hb-step-label">Copy this prompt to your clipboard</div>
368
- <div class="hb-code-block">
369
- <div class="hb-code-text">${this.escapeHtml(r)}</div>
370
- <button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(r)}">${$}<span>Copy</span></button>
371
- </div>
372
- </div>
373
- </div>
374
- <div class="hb-step">
375
- <div class="hb-step-num">2</div>
376
- <div class="hb-step-content">
377
- <div class="hb-step-label">Paste into a Hermes session \u2014 the agent will fetch the skill and set it up for you</div>
378
- </div>
379
- </div>
380
- `}else e+=`
381
- <div class="hb-step">
382
- <div class="hb-step-num">1</div>
383
- <div class="hb-step-content">
384
- <div class="hb-step-label">Copy this command to your clipboard</div>
385
- <div class="hb-code-block">
386
- <div class="hb-code-text">${this.escapeHtml(t)}</div>
387
- <button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${$}<span>Copy</span></button>
388
- </div>
363
+ `}renderHermesSkillBody(t){return`
364
+ <div class="hb-step">
365
+ <div class="hb-step-num">1</div>
366
+ <div class="hb-step-content">
367
+ <div class="hb-step-label">Copy this command to your clipboard</div>
368
+ <div class="hb-code-block">
369
+ <div class="hb-code-text">${this.escapeHtml(t)}</div>
370
+ <button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${R}<span>Copy</span></button>
389
371
  </div>
390
372
  </div>
391
- <div class="hb-step">
392
- <div class="hb-step-num">2</div>
393
- <div class="hb-step-content">
394
- <div class="hb-step-label">Paste and send in your Hermes session</div>
395
- </div>
373
+ </div>
374
+ <div class="hb-step">
375
+ <div class="hb-step-num">2</div>
376
+ <div class="hb-step-content">
377
+ <div class="hb-step-label">Paste and send in your Hermes session</div>
396
378
  </div>
397
- `;return e}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",t=>{let o=t.target.closest("[data-action]");if(!o)return;let e=o.dataset.action;if(e==="close")this.close();else if(e==="copy"){let r=o.dataset.command||"";this.copyToClipboard(r,o)}}),this.shadowRoot.addEventListener("keydown",t=>{t.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let t=this._options.theme;if(!(t==="system"||t==="branded"||t==="branded-alt")||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>this.render();e.addEventListener("change",r),this._mqCleanup=()=>e.removeEventListener("change",r)}async copyToClipboard(t,o){try{await navigator.clipboard.writeText(t);let e=o.querySelector("span"),r=o;o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${U}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${$}<span>Copy</span>`},2e3)}catch{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this._options.onCopy?.(t)}}close(){let t=this.shadowRoot?.querySelector(".hb-dialog"),o=this.shadowRoot?.querySelector(".hb-backdrop");t&&(t.style.animation="hb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="hb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(t){let o=document.createElement("div");return o.textContent=t,o.innerHTML}escapeAttr(t){return t.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}};typeof customElements<"u"&&!customElements.get("hermes-popup-dialog")&&customElements.define("hermes-popup-dialog",T);function C(a){let n=document.createElement("hermes-popup-dialog");return n.options=a,document.body.appendChild(n),n}var at=`
379
+ </div>
380
+ `}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",t=>{let e=t.target.closest("[data-action]");if(!e)return;let o=e.dataset.action;if(o==="close")this.close();else if(o==="copy"){let r=e.dataset.command||"";this.copyToClipboard(r,e)}}),this.shadowRoot.addEventListener("keydown",t=>{t.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let t=this._options.theme;if(!(t==="system"||t==="branded"||t==="branded-alt")||typeof window>"u")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>this.render();o.addEventListener("change",r),this._mqCleanup=()=>o.removeEventListener("change",r)}async copyToClipboard(t,e){try{await navigator.clipboard.writeText(t);let o=e.querySelector("span"),r=e;e.setAttribute("data-copied","true"),o&&(o.textContent="Copied!"),r.innerHTML=`${V}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{e.setAttribute("data-copied","false"),r.innerHTML=`${R}<span>Copy</span>`},2e3)}catch{let o=document.createElement("textarea");o.value=t,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),this._options.onCopy?.(t)}}close(){let t=this.shadowRoot?.querySelector(".hb-dialog"),e=this.shadowRoot?.querySelector(".hb-backdrop");t&&(t.style.animation="hb-scale-in 0.15s ease-in reverse"),e&&(e.style.animation="hb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(t){let e=document.createElement("div");return e.textContent=t,e.innerHTML}escapeAttr(t){return t.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}};typeof customElements<"u"&&!customElements.get("hermes-popup-dialog")&&customElements.define("hermes-popup-dialog",F);function w(a){let n=document.createElement("hermes-popup-dialog");return n.options=a,document.body.appendChild(n),n}var at=`
398
381
  :host {
399
382
  display: inline-block;
400
383
  vertical-align: middle;
@@ -440,18 +423,18 @@
440
423
  }
441
424
  :host([data-variant="filled"][data-theme="branded"]) .hb-btn:hover {
442
425
  background: ${v};
443
- box-shadow: 0 2px 8px rgba(${s}, 0.35);
426
+ box-shadow: 0 2px 8px rgba(${d}, 0.35);
444
427
  }
445
428
  :host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
446
- background: ${O};
429
+ background: ${S};
447
430
  transform: scale(0.98);
448
431
  }
449
432
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
450
- background: ${L};
433
+ background: ${O};
451
434
  box-shadow: 0 2px 8px rgba(${c}, 0.35);
452
435
  }
453
436
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
454
- background: ${B};
437
+ background: ${L};
455
438
  transform: scale(0.98);
456
439
  }
457
440
 
@@ -488,11 +471,11 @@
488
471
  color: ${i};
489
472
  }
490
473
  :host([data-variant="outline"][data-theme="branded"]) .hb-btn:hover {
491
- background: rgba(${s}, 0.08);
492
- box-shadow: 0 2px 8px rgba(${s}, 0.15);
474
+ background: rgba(${d}, 0.08);
475
+ box-shadow: 0 2px 8px rgba(${d}, 0.15);
493
476
  }
494
477
  :host([data-variant="outline"][data-theme="branded"]) .hb-btn:active {
495
- background: rgba(${s}, 0.14);
478
+ background: rgba(${d}, 0.14);
496
479
  transform: scale(0.98);
497
480
  }
498
481
 
@@ -517,10 +500,10 @@
517
500
  }
518
501
  :host([data-variant="outline"][data-theme="dark"]) .hb-btn:hover {
519
502
  border-color: ${i};
520
- background: rgba(${s}, 0.08);
503
+ background: rgba(${d}, 0.08);
521
504
  }
522
505
  :host([data-variant="outline"][data-theme="dark"]) .hb-btn:active {
523
- background: rgba(${s}, 0.14);
506
+ background: rgba(${d}, 0.14);
524
507
  transform: scale(0.98);
525
508
  }
526
509
 
@@ -531,10 +514,10 @@
531
514
  }
532
515
  :host([data-variant="outline"][data-theme="light"]) .hb-btn:hover {
533
516
  border-color: ${i};
534
- background: rgba(${s}, 0.05);
517
+ background: rgba(${d}, 0.05);
535
518
  }
536
519
  :host([data-variant="outline"][data-theme="light"]) .hb-btn:active {
537
- background: rgba(${s}, 0.1);
520
+ background: rgba(${d}, 0.1);
538
521
  transform: scale(0.98);
539
522
  }
540
523
 
@@ -549,10 +532,10 @@
549
532
  color: ${i};
550
533
  }
551
534
  :host([data-variant="ghost"][data-theme="branded"]) .hb-btn:hover {
552
- background: rgba(${s}, 0.1);
535
+ background: rgba(${d}, 0.1);
553
536
  }
554
537
  :host([data-variant="ghost"][data-theme="branded"]) .hb-btn:active {
555
- background: rgba(${s}, 0.16);
538
+ background: rgba(${d}, 0.16);
556
539
  transform: scale(0.98);
557
540
  }
558
541
 
@@ -631,15 +614,15 @@
631
614
  .hb-btn-label {
632
615
  letter-spacing: -0.01em;
633
616
  }
634
- `,A=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0,promptFlag:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),o=this.getAttribute("theme"),e=this.getAttribute("size"),r=this.getAttribute("variant"),d=this.getAttribute("shape"),l=this.getAttribute("popup"),h=this.getAttribute("prompt-flag"),u=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");t!==null&&(this._options.command=t),o&&(this._options.theme=o),e&&(this._options.size=e),r&&(this._options.variant=r),d&&(this._options.shape=d),l!==null&&(this._options.popup=l!=="false"),h!==null&&(this._options.promptFlag=h!=="false"),u!==null&&(this._options.popupTitle=u),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:t}=this._options,o=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.href=`https://hermes.ai/run?command=${encodeURIComponent(o)}`,e.textContent=`Run on Hermes: ${t}`,e.setAttribute("data-platform","hermes"),e.setAttribute("data-command",t),e.setAttribute("data-full-command",o)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:t,promptFlag:o}=this._options;return o===!1?t:`hermes -p "${t}"`}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),o=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,e=this._options.variant||"filled",r=p(t),d=this._options.size||"md",l=this._options.shape||"rounded",h=M[d],u=H[l][d];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,E=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,z=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
617
+ `,A=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0,promptFlag:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),e=this.getAttribute("theme"),o=this.getAttribute("size"),r=this.getAttribute("variant"),s=this.getAttribute("shape"),l=this.getAttribute("popup"),h=this.getAttribute("prompt-flag"),b=this.getAttribute("popup-title"),u=this.getAttribute("popup-description");t!==null&&(this._options.command=t),e&&(this._options.theme=e),o&&(this._options.size=o),r&&(this._options.variant=r),s&&(this._options.shape=s),l!==null&&(this._options.popup=l!=="false"),h!==null&&(this._options.promptFlag=h!=="false"),b!==null&&(this._options.popupTitle=b),u!==null&&(this._options.popupDescription=u)}updateLightDOM(){let{command:t}=this._options,e=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let o=this.querySelector("a[data-hb-crawl]");o||(o=document.createElement("a"),o.setAttribute("data-hb-crawl",""),o.setAttribute("aria-hidden","true"),o.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(o)),o.href=`https://hermes.ai/run?command=${encodeURIComponent(e)}`,o.textContent=`Run on Hermes: ${t}`,o.setAttribute("data-platform","hermes"),o.setAttribute("data-command",t),o.setAttribute("data-full-command",e)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:t,promptFlag:e}=this._options;return e===!1?t:`hermes -p "${t}"`}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),e=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,o=this._options.variant||"filled",r=p(t),s=this._options.size||"md",l=this._options.shape||"rounded",h=H[s],b=B[l][s];this.setAttribute("data-theme",e),this.setAttribute("data-variant",o);let u=o!=="filled"?"transparent":r.bg,M=o==="ghost"?"transparent":o==="outline"?r.primary:r.border,z=o!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
635
618
  <style>${at}</style>
636
619
  <button
637
620
  class="hb-btn"
638
621
  type="button"
639
622
  style="
640
- ${w(r)}
641
- --hb-bg: ${b};
642
- --hb-border: ${E};
623
+ ${C(r)}
624
+ --hb-bg: ${u};
625
+ --hb-border: ${M};
643
626
  --hb-text: ${z};
644
627
  --hb-accent-color: ${r.primary};
645
628
  --hb-focus-color: ${r.primary};
@@ -648,14 +631,14 @@
648
631
  --hb-icon-size: ${h.iconSize};
649
632
  --hb-padding: ${h.ccPadding};
650
633
  --hb-gap: ${h.gap};
651
- --hb-radius: ${u};
634
+ --hb-radius: ${b};
652
635
  "
653
636
  aria-label="Run on Hermes: ${this._options.command.replace(/"/g,"&quot;")}"
654
637
  >
655
638
  <span class="hb-btn-icon" aria-hidden="true">${x}</span>
656
639
  <span class="hb-btn-label">Run on Hermes</span>
657
640
  </button>
658
- `;let F=this.shadowRoot.querySelector(".hb-btn");F.addEventListener("click",()=>this.handleClick()),F.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,d=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:d}})),t===!1){navigator.clipboard.writeText(d).then(()=>{this._options.onCopy?.(d),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:d}}))});return}C({variant:"hermes",theme:this.getResolvedTheme(),title:e||"Run on Hermes",description:r||"Execute this command in your terminal to get started with Hermes Agent.",command:o,fullCommand:d,onCopy:l=>{this._options.onCopy?.(l),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:l}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let t=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>this.render();t.addEventListener("change",o),this._mqCleanup=()=>t.removeEventListener("change",o)}};A.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function R(a="hermes-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,A)}R();function j(a){let n=document.createElement("hermes-button");return n.options=a,n}var rt=`
641
+ `;let E=this.shadowRoot.querySelector(".hb-btn");E.addEventListener("click",()=>this.handleClick()),E.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:e,popupTitle:o,popupDescription:r}=this._options,s=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:e,fullCommand:s}})),t===!1){navigator.clipboard.writeText(s).then(()=>{this._options.onCopy?.(s),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))});return}w({variant:"hermes",theme:this.getResolvedTheme(),title:o||"Run on Hermes",description:r||"Execute this command in your terminal to get started with Hermes Agent.",command:e,fullCommand:s,onCopy:l=>{this._options.onCopy?.(l),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:l}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>this.render();t.addEventListener("change",e),this._mqCleanup=()=>t.removeEventListener("change",e)}};A.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function T(a="hermes-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,A)}T();function U(a){let n=document.createElement("hermes-button");return n.options=a,n}var rt=`
659
642
  :host {
660
643
  display: inline-block;
661
644
  vertical-align: middle;
@@ -701,18 +684,18 @@
701
684
  }
702
685
  :host([data-variant="filled"][data-theme="branded"]) .hb-btn:hover {
703
686
  background: ${v};
704
- box-shadow: 0 2px 8px rgba(${s}, 0.35);
687
+ box-shadow: 0 2px 8px rgba(${d}, 0.35);
705
688
  }
706
689
  :host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
707
- background: ${O};
690
+ background: ${S};
708
691
  transform: scale(0.98);
709
692
  }
710
693
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
711
- background: ${L};
694
+ background: ${O};
712
695
  box-shadow: 0 2px 8px rgba(${c}, 0.35);
713
696
  }
714
697
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
715
- background: ${B};
698
+ background: ${L};
716
699
  transform: scale(0.98);
717
700
  }
718
701
 
@@ -749,11 +732,11 @@
749
732
  color: ${i};
750
733
  }
751
734
  :host([data-variant="outline"][data-theme="branded"]) .hb-btn:hover {
752
- background: rgba(${s}, 0.08);
753
- box-shadow: 0 2px 8px rgba(${s}, 0.15);
735
+ background: rgba(${d}, 0.08);
736
+ box-shadow: 0 2px 8px rgba(${d}, 0.15);
754
737
  }
755
738
  :host([data-variant="outline"][data-theme="branded"]) .hb-btn:active {
756
- background: rgba(${s}, 0.14);
739
+ background: rgba(${d}, 0.14);
757
740
  transform: scale(0.98);
758
741
  }
759
742
 
@@ -778,10 +761,10 @@
778
761
  }
779
762
  :host([data-variant="outline"][data-theme="dark"]) .hb-btn:hover {
780
763
  border-color: ${i};
781
- background: rgba(${s}, 0.08);
764
+ background: rgba(${d}, 0.08);
782
765
  }
783
766
  :host([data-variant="outline"][data-theme="dark"]) .hb-btn:active {
784
- background: rgba(${s}, 0.14);
767
+ background: rgba(${d}, 0.14);
785
768
  transform: scale(0.98);
786
769
  }
787
770
 
@@ -792,10 +775,10 @@
792
775
  }
793
776
  :host([data-variant="outline"][data-theme="light"]) .hb-btn:hover {
794
777
  border-color: ${i};
795
- background: rgba(${s}, 0.05);
778
+ background: rgba(${d}, 0.05);
796
779
  }
797
780
  :host([data-variant="outline"][data-theme="light"]) .hb-btn:active {
798
- background: rgba(${s}, 0.1);
781
+ background: rgba(${d}, 0.1);
799
782
  transform: scale(0.98);
800
783
  }
801
784
 
@@ -810,10 +793,10 @@
810
793
  color: ${i};
811
794
  }
812
795
  :host([data-variant="ghost"][data-theme="branded"]) .hb-btn:hover {
813
- background: rgba(${s}, 0.1);
796
+ background: rgba(${d}, 0.1);
814
797
  }
815
798
  :host([data-variant="ghost"][data-theme="branded"]) .hb-btn:active {
816
- background: rgba(${s}, 0.16);
799
+ background: rgba(${d}, 0.16);
817
800
  transform: scale(0.98);
818
801
  }
819
802
 
@@ -892,15 +875,15 @@
892
875
  .hb-btn-label {
893
876
  letter-spacing: -0.01em;
894
877
  }
895
- `,_=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),o=this.getAttribute("skill-url"),e=this.getAttribute("theme"),r=this.getAttribute("size"),d=this.getAttribute("variant"),l=this.getAttribute("shape"),h=this.getAttribute("popup"),u=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),d&&(this._options.variant=d),l&&(this._options.shape=l),h!==null&&(this._options.popup=h!=="false"),u!==null&&(this._options.popupTitle=u),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes Skills: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.textContent=`Run on Hermes Skills: ${t}`,e.setAttribute("data-platform","hermes-skill"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://hermes.ai/skills?command=${encodeURIComponent(t)}`,e.removeAttribute("data-skill-url"))}getResolvedTheme(){return this._options.theme||"branded"}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),o=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,e=this._options.variant||"filled",r=p(t),d=this._options.size||"md",l=this._options.shape||"rounded",h=M[d],u=H[l][d];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,E=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,z=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
878
+ `,_=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),e=this.getAttribute("theme"),o=this.getAttribute("size"),r=this.getAttribute("variant"),s=this.getAttribute("shape"),l=this.getAttribute("popup"),h=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");t!==null&&(this._options.command=t),e&&(this._options.theme=e),o&&(this._options.size=o),r&&(this._options.variant=r),s&&(this._options.shape=s),l!==null&&(this._options.popup=l!=="false"),h!==null&&(this._options.popupTitle=h),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:t}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes Skills: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.textContent=`Run on Hermes Skills: ${t}`,e.setAttribute("data-platform","hermes-skill"),e.setAttribute("data-command",t),e.href=`https://hermes.ai/skills?command=${encodeURIComponent(t)}`}getResolvedTheme(){return this._options.theme||"branded"}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),e=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,o=this._options.variant||"filled",r=p(t),s=this._options.size||"md",l=this._options.shape||"rounded",h=H[s],b=B[l][s];this.setAttribute("data-theme",e),this.setAttribute("data-variant",o);let u=o!=="filled"?"transparent":r.bg,M=o==="ghost"?"transparent":o==="outline"?r.primary:r.border,z=o!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
896
879
  <style>${rt}</style>
897
880
  <button
898
881
  class="hb-btn"
899
882
  type="button"
900
883
  style="
901
- ${w(r)}
902
- --hb-bg: ${b};
903
- --hb-border: ${E};
884
+ ${C(r)}
885
+ --hb-bg: ${u};
886
+ --hb-border: ${M};
904
887
  --hb-text: ${z};
905
888
  --hb-accent-color: ${r.primary};
906
889
  --hb-focus-color: ${r.primary};
@@ -909,12 +892,12 @@
909
892
  --hb-icon-size: ${h.iconSize};
910
893
  --hb-padding: ${h.padding};
911
894
  --hb-gap: ${h.gap};
912
- --hb-radius: ${u};
895
+ --hb-radius: ${b};
913
896
  "
914
897
  aria-label="Run on Hermes Skills: ${this._options.command.replace(/"/g,"&quot;")}"
915
898
  >
916
899
  <span class="hb-btn-icon" aria-hidden="true">${k}</span>
917
900
  <span class="hb-btn-label">Run on Hermes Skills</span>
918
901
  </button>
919
- `;let F=this.shadowRoot.querySelector(".hb-btn");F.addEventListener("click",()=>this.handleClick()),F.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:d}=this._options;if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}C({variant:"hermes-skill",theme:this.getResolvedTheme(),title:r||"Run on Hermes Skills",description:d||"Copy and paste into a Hermes session to get started.",command:o,skillUrl:e,onCopy:l=>{this._options.onCopy?.(l),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:l}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let t=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>this.render();t.addEventListener("change",o),this._mqCleanup=()=>t.removeEventListener("change",o)}};_.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description"];function S(a="hermes-skill-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,_)}S();function W(a){let n=document.createElement("hermes-skill-button");return n.options=a,n}function D(){if(typeof document>"u")return[];let a=[];return document.querySelectorAll("hermes-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`hermes -p "${t}"`:t;a.push({platform:"hermes",command:t,fullCommand:r})}),document.querySelectorAll("hermes-skill-button").forEach(n=>{let t=n.getAttribute("command")||"",o=n.getAttribute("skill-url")||void 0;a.push({platform:"hermes-skill",command:t,...o&&{skillUrl:o}})}),a}function I(){let a=D();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="hermes")return{"@type":"Action",name:`Run on Hermes: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://hermes.ai/run?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://hermes.ai/run"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Hermes Agent",text:t.fullCommand||t.command}};let o={"@type":"EntryPoint",actionPlatform:"https://hermes.ai/skills"};t.skillUrl?o.urlTemplate=t.skillUrl:o.urlTemplate=`https://hermes.ai/skills?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Hermes Skills: ${t.command}`,description:t.command,target:o};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Hermes Agent"}),e})}}function G(){if(typeof document>"u")return;let a=document.querySelector("script[data-hermesbuttons-jsonld]");a&&a.remove();let n=I();if(!n||!("potentialAction"in n))return;let t=document.createElement("script");t.type="application/ld+json",t.setAttribute("data-hermesbuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t)}function nt(){R(),S()}return Q(it);})();
902
+ `;let E=this.shadowRoot.querySelector(".hb-btn");E.addEventListener("click",()=>this.handleClick()),E.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:e,popupTitle:o,popupDescription:r}=this._options;if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:e}})),t===!1){navigator.clipboard.writeText(e).then(()=>{this._options.onCopy?.(e),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:e}}))});return}w({variant:"hermes-skill",theme:this.getResolvedTheme(),title:o||"Run on Hermes Skills",description:r||"Copy and paste into a Hermes session to get started.",command:e,onCopy:s=>{this._options.onCopy?.(s),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>this.render();t.addEventListener("change",e),this._mqCleanup=()=>t.removeEventListener("change",e)}};_.observedAttributes=["command","theme","size","variant","shape","popup","popup-title","popup-description"];function $(a="hermes-skill-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,_)}$();function W(a){let n=document.createElement("hermes-skill-button");return n.options=a,n}function D(){if(typeof document>"u")return[];let a=[];return document.querySelectorAll("hermes-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`hermes -p "${t}"`:t;a.push({platform:"hermes",command:t,fullCommand:r})}),document.querySelectorAll("hermes-skill-button").forEach(n=>{let t=n.getAttribute("command")||"";a.push({platform:"hermes-skill",command:t})}),a}function I(){let a=D();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="hermes")return{"@type":"Action",name:`Run on Hermes: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://hermes.ai/run?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://hermes.ai/run"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Hermes Agent",text:t.fullCommand||t.command}};let e={"@type":"EntryPoint",actionPlatform:"https://hermes.ai/skills",urlTemplate:`https://hermes.ai/skills?command=${encodeURIComponent(t.command)}`};return{"@type":"Action",name:`Run on Hermes Skills: ${t.command}`,description:t.command,target:e}})}}function G(){if(typeof document>"u")return;let a=document.querySelector("script[data-hermesbuttons-jsonld]");a&&a.remove();let n=I();if(!n||!("potentialAction"in n))return;let t=document.createElement("script");t.type="application/ld+json",t.setAttribute("data-hermesbuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t)}function nt(){T(),$()}return Q(it);})();
920
903
  //# sourceMappingURL=index.global.js.map