claudebuttons
Advanced tools
| var g=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Ears --> | ||
| <rect x="3.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <rect x="15.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <!-- Body --> | ||
| <rect x="2.5" y="5.5" width="19" height="13" rx="3" fill="currentColor"/> | ||
| <!-- Eyes --> | ||
| <ellipse cx="9" cy="11.5" rx="2" ry="2.5" fill="white" opacity="0.95"/> | ||
| <ellipse cx="15" cy="11.5" rx="2" ry="2.5" fill="white" opacity="0.95"/> | ||
| <!-- Pupils --> | ||
| <ellipse cx="9.6" cy="12" rx="1" ry="1.2" fill="#1C1917"/> | ||
| <ellipse cx="15.6" cy="12" rx="1" ry="1.2" fill="#1C1917"/> | ||
| <!-- Legs --> | ||
| <rect x="6.5" y="18.5" width="4" height="3.5" rx="1.5" fill="currentColor"/> | ||
| <rect x="13.5" y="18.5" width="4" height="3.5" rx="1.5" fill="currentColor"/> | ||
| </svg>`,f=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Lightning bolt --> | ||
| <path d="M13.5 2L5 13.5h5.5L9 22l10-12h-5.5L15.5 2h-2z" fill="currentColor"/> | ||
| <!-- Circuit path --> | ||
| <path d="M12.8 7.2L10.2 11.5l2.2 4" stroke="var(--cb-icon-accent, white)" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" fill="none"/> | ||
| <!-- Circuit nodes --> | ||
| <circle cx="12.8" cy="7.2" r="1.3" fill="var(--cb-icon-accent, white)"/> | ||
| <circle cx="10.2" cy="11.5" r="1.3" fill="var(--cb-icon-accent, white)"/> | ||
| <circle cx="12.4" cy="15.5" r="1.3" fill="var(--cb-icon-accent, white)"/> | ||
| </svg>`,s=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <rect x="5" y="5" width="8" height="8" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/> | ||
| <path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`,v=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
| </svg>`;var y=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`;var l=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| <rect x="4" y="5" width="16" height="11" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/> | ||
| <path d="M4 8.5h16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| <circle cx="6.5" cy="7" r="0.65" fill="currentColor"/> | ||
| <circle cx="8.5" cy="7" r="0.65" fill="currentColor"/> | ||
| <path d="M9 19.5h6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| <path d="M8 16.5h8v3H8v-3z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/> | ||
| </svg>`;var c="#D4795C",b="#C06A4E",$="#B35E43",P="#F0B8A8",d={branded:{bg:c,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:c,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:c,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:c,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function n(r){return r!=="system"?d[r]:typeof window>"u"?d.light:window.matchMedia("(prefers-color-scheme: dark)").matches?d.dark:d.light}function w(r){return` | ||
| --cb-bg: ${r.bg}; | ||
| --cb-text: ${r.text}; | ||
| --cb-border: ${r.border}; | ||
| --cb-surface: ${r.surface}; | ||
| --cb-surface-text: ${r.surfaceText}; | ||
| --cb-muted: ${r.muted}; | ||
| --cb-primary: ${r.primary}; | ||
| --cb-primary-text: ${r.primaryText}; | ||
| --cb-code-bg: ${r.codeBg}; | ||
| --cb-code-text: ${r.codeText}; | ||
| `}var S={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},D={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"}};function A(){if(typeof navigator>"u")return!0;let r=navigator.userAgent||"";return!!(!r.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(r)||/Twitter for (iPhone|Android)/i.test(r)||/; wv\)/.test(r)||/Opera Mini|OPiOS/i.test(r))}function _(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function k(){return!(!_()||A())}var M=` | ||
| :host { | ||
| position: fixed; | ||
| inset: 0; | ||
| z-index: 999999; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; | ||
| } | ||
| * { box-sizing: border-box; margin: 0; padding: 0; } | ||
| .cb-backdrop { | ||
| position: absolute; | ||
| inset: 0; | ||
| background: rgba(0, 0, 0, 0.5); | ||
| backdrop-filter: blur(4px); | ||
| -webkit-backdrop-filter: blur(4px); | ||
| animation: cb-fade-in 0.15s ease-out; | ||
| } | ||
| .cb-dialog { | ||
| position: relative; | ||
| width: 90%; | ||
| max-width: 460px; | ||
| background: var(--cb-surface); | ||
| color: var(--cb-surface-text); | ||
| border-radius: 16px; | ||
| box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--cb-border); | ||
| overflow: hidden; | ||
| animation: cb-scale-in 0.2s ease-out; | ||
| } | ||
| .cb-dialog-header { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 12px; | ||
| padding: 20px 24px 16px; | ||
| border-bottom: 1px solid var(--cb-border); | ||
| } | ||
| .cb-dialog-header-icon { | ||
| width: 36px; | ||
| height: 36px; | ||
| color: var(--cb-primary); | ||
| flex-shrink: 0; | ||
| } | ||
| .cb-dialog-header-text { | ||
| flex: 1; | ||
| min-width: 0; | ||
| } | ||
| .cb-dialog-title { | ||
| font-size: 16px; | ||
| font-weight: 600; | ||
| line-height: 1.3; | ||
| color: var(--cb-surface-text); | ||
| } | ||
| .cb-dialog-description { | ||
| font-size: 13px; | ||
| color: var(--cb-muted); | ||
| margin-top: 2px; | ||
| line-height: 1.4; | ||
| } | ||
| .cb-dialog-close { | ||
| width: 32px; | ||
| height: 32px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| border: none; | ||
| background: transparent; | ||
| color: var(--cb-muted); | ||
| cursor: pointer; | ||
| border-radius: 8px; | ||
| flex-shrink: 0; | ||
| transition: background 0.15s, color 0.15s; | ||
| } | ||
| .cb-dialog-close:hover { | ||
| background: var(--cb-border); | ||
| color: var(--cb-surface-text); | ||
| } | ||
| .cb-dialog-close svg { width: 14px; height: 14px; } | ||
| .cb-dialog-body { padding: 20px 24px; } | ||
| .cb-step { | ||
| display: flex; | ||
| gap: 12px; | ||
| margin-bottom: 16px; | ||
| } | ||
| .cb-step:last-child { margin-bottom: 0; } | ||
| .cb-step-num { | ||
| width: 24px; | ||
| height: 24px; | ||
| border-radius: 50%; | ||
| background: var(--cb-primary); | ||
| color: var(--cb-primary-text); | ||
| font-size: 12px; | ||
| font-weight: 600; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| flex-shrink: 0; | ||
| margin-top: 1px; | ||
| } | ||
| .cb-step-content { | ||
| flex: 1; | ||
| min-width: 0; | ||
| } | ||
| .cb-step-label { | ||
| font-size: 13px; | ||
| font-weight: 500; | ||
| color: var(--cb-surface-text); | ||
| margin-bottom: 8px; | ||
| line-height: 1.4; | ||
| } | ||
| .cb-code-block { | ||
| display: flex; | ||
| align-items: center; | ||
| background: var(--cb-code-bg); | ||
| color: var(--cb-code-text); | ||
| border-radius: 10px; | ||
| padding: 2px 2px 2px 14px; | ||
| font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace; | ||
| font-size: 13px; | ||
| line-height: 1.5; | ||
| gap: 8px; | ||
| overflow: hidden; | ||
| } | ||
| .cb-code-text { | ||
| flex: 1; | ||
| overflow-x: auto; | ||
| white-space: nowrap; | ||
| padding: 10px 0; | ||
| scrollbar-width: none; | ||
| } | ||
| .cb-code-text::-webkit-scrollbar { display: none; } | ||
| .cb-code-prefix { | ||
| color: var(--cb-muted); | ||
| user-select: none; | ||
| margin-right: 6px; | ||
| } | ||
| .cb-copy-btn { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 6px; | ||
| height: 36px; | ||
| min-width: 36px; | ||
| padding: 0 12px; | ||
| border: none; | ||
| background: var(--cb-primary); | ||
| color: var(--cb-primary-text); | ||
| cursor: pointer; | ||
| border-radius: 8px; | ||
| font-family: inherit; | ||
| font-size: 12px; | ||
| font-weight: 500; | ||
| flex-shrink: 0; | ||
| transition: background 0.15s, transform 0.1s; | ||
| white-space: nowrap; | ||
| } | ||
| .cb-copy-btn:hover { background: ${b}; } | ||
| .cb-copy-btn:active { transform: scale(0.96); } | ||
| .cb-copy-btn svg { width: 14px; height: 14px; } | ||
| .cb-copy-btn[data-copied="true"] { | ||
| background: #16a34a; | ||
| } | ||
| .cb-dialog-footer { | ||
| padding: 16px 24px 20px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 10px; | ||
| } | ||
| .cb-action-btn { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 8px; | ||
| width: 100%; | ||
| height: 44px; | ||
| border: none; | ||
| background: var(--cb-primary); | ||
| color: var(--cb-primary-text); | ||
| cursor: pointer; | ||
| border-radius: 10px; | ||
| font-family: inherit; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
| transition: background 0.15s, transform 0.1s; | ||
| } | ||
| .cb-action-btn:hover { background: ${b}; } | ||
| .cb-action-btn:active { transform: scale(0.98); } | ||
| .cb-action-btn svg { width: 16px; height: 16px; } | ||
| .cb-hint { | ||
| font-size: 12px; | ||
| color: var(--cb-muted); | ||
| text-align: center; | ||
| line-height: 1.4; | ||
| } | ||
| .cb-hint kbd { | ||
| display: inline-block; | ||
| padding: 1px 5px; | ||
| font-family: inherit; | ||
| font-size: 11px; | ||
| background: var(--cb-border); | ||
| border-radius: 4px; | ||
| border: 1px solid var(--cb-border); | ||
| } | ||
| .cb-launch-btn { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 10px; | ||
| width: 100%; | ||
| min-height: 48px; | ||
| padding: 12px 18px; | ||
| border-radius: 12px; | ||
| font-family: inherit; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
| letter-spacing: -0.02em; | ||
| text-decoration: none; | ||
| cursor: pointer; | ||
| transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease, color 0.2s ease; | ||
| -webkit-tap-highlight-color: transparent; | ||
| } | ||
| .cb-launch-btn:active:not(:disabled) { transform: scale(0.99); } | ||
| .cb-launch-btn .cb-launch-svg { | ||
| width: 22px; | ||
| height: 22px; | ||
| flex-shrink: 0; | ||
| } | ||
| .cb-launch-btn--desktop { | ||
| color: var(--cb-surface-text); | ||
| background: linear-gradient( | ||
| 165deg, | ||
| color-mix(in srgb, var(--cb-primary) 14%, var(--cb-surface)) 0%, | ||
| var(--cb-surface) 55% | ||
| ); | ||
| border: 1.5px solid color-mix(in srgb, var(--cb-primary) 38%, var(--cb-border)); | ||
| box-shadow: | ||
| 0 1px 0 color-mix(in srgb, white 55%, transparent) inset, | ||
| 0 4px 14px -4px color-mix(in srgb, var(--cb-primary) 35%, transparent); | ||
| } | ||
| .cb-launch-btn--desktop:hover:not(:disabled) { | ||
| border-color: color-mix(in srgb, var(--cb-primary) 72%, var(--cb-border)); | ||
| box-shadow: | ||
| 0 1px 0 color-mix(in srgb, white 45%, transparent) inset, | ||
| 0 8px 24px -6px color-mix(in srgb, var(--cb-primary) 45%, transparent); | ||
| } | ||
| .cb-launch-btn--desktop:focus-visible { | ||
| outline: 2px solid var(--cb-primary); | ||
| outline-offset: 2px; | ||
| } | ||
| .cb-launch-btn:disabled { | ||
| opacity: 0.55; | ||
| cursor: not-allowed; | ||
| filter: saturate(0.7); | ||
| box-shadow: none; | ||
| } | ||
| .cb-launch-btn--desktop:disabled { | ||
| background: var(--cb-border); | ||
| border-color: var(--cb-border); | ||
| color: var(--cb-muted); | ||
| } | ||
| .cb-launch-btn:disabled .cb-launch-svg { | ||
| opacity: 0.75; | ||
| } | ||
| .cb-launch-sub { | ||
| display: block; | ||
| margin-top: 6px; | ||
| font-size: 11px; | ||
| font-weight: 500; | ||
| color: var(--cb-muted); | ||
| line-height: 1.35; | ||
| text-align: center; | ||
| } | ||
| @keyframes cb-fade-in { | ||
| from { opacity: 0; } | ||
| to { opacity: 1; } | ||
| } | ||
| @keyframes cb-scale-in { | ||
| from { opacity: 0; transform: scale(0.95) translateY(8px); } | ||
| to { opacity: 1; transform: scale(1) translateY(0); } | ||
| } | ||
| @media (max-width: 480px) { | ||
| .cb-dialog { | ||
| width: 96%; | ||
| max-width: none; | ||
| border-radius: 14px; | ||
| max-height: 90dvh; | ||
| overflow-y: auto; | ||
| overscroll-behavior: contain; | ||
| } | ||
| .cb-dialog-header { padding: 16px 16px 12px; gap: 10px; } | ||
| .cb-dialog-header-icon { width: 28px; height: 28px; } | ||
| .cb-dialog-body { padding: 16px; } | ||
| .cb-dialog-footer { padding: 12px 16px 16px; } | ||
| .cb-step { gap: 10px; margin-bottom: 14px; } | ||
| .cb-step-num { width: 22px; height: 22px; font-size: 11px; } | ||
| .cb-step-label { font-size: 12px; margin-bottom: 6px; } | ||
| .cb-code-block { font-size: 12px; padding: 2px 2px 2px 10px; border-radius: 8px; } | ||
| .cb-copy-btn { height: 32px; padding: 0 10px; font-size: 11px; border-radius: 6px; } | ||
| .cb-action-btn { height: 40px; font-size: 13px; border-radius: 8px; } | ||
| .cb-launch-btn { min-height: 46px; padding: 10px 14px; font-size: 13px; border-radius: 10px; } | ||
| .cb-launch-btn .cb-launch-svg { width: 20px; height: 20px; } | ||
| .cb-launch-sub { font-size: 10px; } | ||
| .cb-hint { font-size: 11px; } | ||
| } | ||
| @media (max-width: 360px) { | ||
| .cb-dialog { width: 100%; border-radius: 12px 12px 0 0; align-self: flex-end; } | ||
| .cb-copy-btn span { display: none; } | ||
| .cb-copy-btn { min-width: 32px; padding: 0 8px; } | ||
| } | ||
| @supports (padding: env(safe-area-inset-bottom)) { | ||
| .cb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); } | ||
| } | ||
| `,u=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(e){this._autoLaunchConsumed=!1,this._options=e,this.render()}get options(){return this._options}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}resolvePopupTokens(){let{theme:e}=this._options;if(e==="dark"||e==="light")return n(e);let t=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(e==="system")return t?n("dark"):n("light");let o=t?n("dark"):n("light"),i=n(e);return{...o,primary:i.primary,primaryText:i.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:e,title:t,description:o,command:i,fullCommand:p,skillUrl:C,desktopLaunchUrl:F,autoLaunch:T}=this._options,O=this.resolvePopupTokens(),E=e==="claude-code"?g:f,h=e==="claude-code",L=p||i,x=F??"claude://",m=k();this.shadowRoot.innerHTML=` | ||
| <style>${M}</style> | ||
| <div style="${w(O)}"> | ||
| <div class="cb-backdrop" data-action="close"></div> | ||
| <div class="cb-dialog" role="dialog" aria-modal="true" aria-labelledby="cb-dialog-title"> | ||
| <div class="cb-dialog-header"> | ||
| <div class="cb-dialog-header-icon">${E}</div> | ||
| <div class="cb-dialog-header-text"> | ||
| <div class="cb-dialog-title" id="cb-dialog-title">${t}</div> | ||
| ${o?`<div class="cb-dialog-description">${o}</div>`:""} | ||
| </div> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${y}</button> | ||
| </div> | ||
| <div class="cb-dialog-body"> | ||
| ${h?this.renderClaudeCodeBody(L):this.renderCoworkBody(i,C)} | ||
| </div> | ||
| <div class="cb-dialog-footer"> | ||
| ${h?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(x),m)} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),T&&!this._autoLaunchConsumed&&e==="cowork"&&m&&(this._autoLaunchConsumed=!0,this.openDesktopAppLink(x))}openDesktopAppLink(e){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:!0,composed:!0,detail:{href:e}})),typeof document>"u")return;let t=document.createElement("a");t.href=e,t.rel="noopener noreferrer",t.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(t),t.click(),requestAnimationFrame(()=>t.remove())}renderClaudeCodeBody(e){return` | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">1</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Copy this command to your clipboard</div> | ||
| <div class="cb-code-block"> | ||
| <div class="cb-code-text"><span class="cb-code-prefix">$</span>${this.escapeHtml(e)}</div> | ||
| <button class="cb-copy-btn" data-action="copy" data-command="${this.escapeAttr(e)}">${s}<span>Copy</span></button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">2</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Paste and run in your terminal</div> | ||
| </div> | ||
| </div> | ||
| `}renderCoworkBody(e,t){let o="";if(t){let i=`Install the skill from ${t} and run ${e}`;o+=` | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">1</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Copy this prompt to your clipboard</div> | ||
| <div class="cb-code-block"> | ||
| <div class="cb-code-text">${this.escapeHtml(i)}</div> | ||
| <button class="cb-copy-btn" data-action="copy" data-command="${this.escapeAttr(i)}">${s}<span>Copy</span></button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">2</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Paste into a Cowork session \u2014 Claude will fetch the skill and set it up for you</div> | ||
| </div> | ||
| </div> | ||
| `}else o+=` | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">1</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Copy this command to your clipboard</div> | ||
| <div class="cb-code-block"> | ||
| <div class="cb-code-text">${this.escapeHtml(e)}</div> | ||
| <button class="cb-copy-btn" data-action="copy" data-command="${this.escapeAttr(e)}">${s}<span>Copy</span></button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">2</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Paste and send in your Cowork session</div> | ||
| </div> | ||
| </div> | ||
| `;return o}renderCoworkFooter(e,t){let o="Open this page in Safari, Chrome, Firefox, or Edge. In-app browsers usually block opening apps.",i=t?"Opens the Claude app through your system link handler\u2014then paste the prompt below into Cowork.":"App links aren\u2019t supported in your current browser (common inside social or chat apps). Open this page in a full browser, or launch Claude Desktop manually and paste below.";return` | ||
| ${t?` | ||
| <a | ||
| class="cb-launch-btn cb-launch-btn--desktop" | ||
| href="${e}" | ||
| data-action="launch-desktop" | ||
| rel="noopener noreferrer" | ||
| > | ||
| ${l} | ||
| <span>Open Claude Desktop</span> | ||
| </a>`:` | ||
| <button | ||
| type="button" | ||
| class="cb-launch-btn cb-launch-btn--desktop" | ||
| disabled | ||
| aria-disabled="true" | ||
| aria-label="Open Claude Desktop (unavailable in this browser)" | ||
| title="${this.escapeAttr(o)}" | ||
| > | ||
| ${l} | ||
| <span>Open Claude Desktop</span> | ||
| </button>`} | ||
| <span class="cb-launch-sub">${this.escapeHtml(i)}</span> | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your Cowork session to run</div> | ||
| `}renderClaudeCodeFooter(){return` | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div> | ||
| `}escapeHref(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",e=>{let t=e.target.closest("[data-action]");if(!t)return;let o=t.dataset.action;if(o==="close")this.close();else if(o==="copy"){let i=t.dataset.command||"";this.copyToClipboard(i,t)}else if(o==="launch-desktop"){e.preventDefault();let i=t.getAttribute("href")||"";this.openDesktopAppLink(i||t.href)}}),this.shadowRoot.addEventListener("keydown",e=>{e.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let e=this._options.theme;if(!(e==="system"||e==="branded"||e==="branded-alt")||typeof window>"u")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>this.render();o.addEventListener("change",i),this._mqCleanup=()=>o.removeEventListener("change",i)}async copyToClipboard(e,t){try{await navigator.clipboard.writeText(e);let o=t.querySelector("span"),i=t,p=i.querySelector(".cb-icon-sm")?.outerHTML||"";t.setAttribute("data-copied","true"),o&&(o.textContent="Copied!"),i.innerHTML=`${v}<span>Copied!</span>`,this._options.onCopy?.(e),setTimeout(()=>{t.setAttribute("data-copied","false"),i.innerHTML=`${s}<span>Copy</span>`},2e3)}catch{let o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),this._options.onCopy?.(e)}}close(){let e=this.shadowRoot?.querySelector(".cb-dialog"),t=this.shadowRoot?.querySelector(".cb-backdrop");e&&(e.style.animation="cb-scale-in 0.15s ease-in reverse"),t&&(t.style.animation="cb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}escapeAttr(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",u);function j(r){let a=document.createElement("claude-popup-dialog");return a.options=r,document.body.appendChild(a),a}export{g as a,f as b,c,b as d,$ as e,P as f,n as g,w as h,S as i,D as j,j as k}; | ||
| //# sourceMappingURL=chunk-ATQND4KB.mjs.map |
| {"version":3,"sources":["../src/icons.ts","../src/themes.ts","../src/launch-capabilities.ts","../src/popup-dialog.ts"],"sourcesContent":["export const CLAUDE_CODE_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon\">\n <!-- Ears -->\n <rect x=\"3.5\" y=\"1.5\" width=\"5\" height=\"5\" rx=\"1.5\" fill=\"currentColor\"/>\n <rect x=\"15.5\" y=\"1.5\" width=\"5\" height=\"5\" rx=\"1.5\" fill=\"currentColor\"/>\n <!-- Body -->\n <rect x=\"2.5\" y=\"5.5\" width=\"19\" height=\"13\" rx=\"3\" fill=\"currentColor\"/>\n <!-- Eyes -->\n <ellipse cx=\"9\" cy=\"11.5\" rx=\"2\" ry=\"2.5\" fill=\"white\" opacity=\"0.95\"/>\n <ellipse cx=\"15\" cy=\"11.5\" rx=\"2\" ry=\"2.5\" fill=\"white\" opacity=\"0.95\"/>\n <!-- Pupils -->\n <ellipse cx=\"9.6\" cy=\"12\" rx=\"1\" ry=\"1.2\" fill=\"#1C1917\"/>\n <ellipse cx=\"15.6\" cy=\"12\" rx=\"1\" ry=\"1.2\" fill=\"#1C1917\"/>\n <!-- Legs -->\n <rect x=\"6.5\" y=\"18.5\" width=\"4\" height=\"3.5\" rx=\"1.5\" fill=\"currentColor\"/>\n <rect x=\"13.5\" y=\"18.5\" width=\"4\" height=\"3.5\" rx=\"1.5\" fill=\"currentColor\"/>\n</svg>`;\n\nexport const COWORK_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon\">\n <!-- Lightning bolt -->\n <path d=\"M13.5 2L5 13.5h5.5L9 22l10-12h-5.5L15.5 2h-2z\" fill=\"currentColor\"/>\n <!-- Circuit path -->\n <path d=\"M12.8 7.2L10.2 11.5l2.2 4\" stroke=\"var(--cb-icon-accent, white)\" stroke-width=\"1.3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\"/>\n <!-- Circuit nodes -->\n <circle cx=\"12.8\" cy=\"7.2\" r=\"1.3\" fill=\"var(--cb-icon-accent, white)\"/>\n <circle cx=\"10.2\" cy=\"11.5\" r=\"1.3\" fill=\"var(--cb-icon-accent, white)\"/>\n <circle cx=\"12.4\" cy=\"15.5\" r=\"1.3\" fill=\"var(--cb-icon-accent, white)\"/>\n</svg>`;\n\nexport const COPY_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <rect x=\"5\" y=\"5\" width=\"8\" height=\"8\" rx=\"1.5\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M3 10V3.5A1.5 1.5 0 014.5 2H10\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const CHECK_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <path d=\"M3 8.5l3.5 3.5L13 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>`;\n\nexport const DOWNLOAD_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <path d=\"M8 2v8m0 0l-3-3m3 3l3-3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M3 12v1.5a1 1 0 001 1h8a1 1 0 001-1V12\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const CLOSE_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <path d=\"M4 4l8 8m0-8l-8 8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const TERMINAL_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <rect x=\"1\" y=\"2\" width=\"14\" height=\"12\" rx=\"2\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M4 6l3 2.5L4 11\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9 11h3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const DESKTOP_APP_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-launch-svg\">\n <rect x=\"4\" y=\"5\" width=\"16\" height=\"11\" rx=\"1.5\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M4 8.5h16\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <circle cx=\"6.5\" cy=\"7\" r=\"0.65\" fill=\"currentColor\"/>\n <circle cx=\"8.5\" cy=\"7\" r=\"0.65\" fill=\"currentColor\"/>\n <path d=\"M9 19.5h6\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <path d=\"M8 16.5h8v3H8v-3z\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linejoin=\"round\"/>\n</svg>`;\n","import type { ThemeTokens, Theme } from './types';\n\nexport const BRAND_COLOR = '#D4795C';\nexport const BRAND_COLOR_HOVER = '#C06A4E';\nexport const BRAND_COLOR_ACTIVE = '#B35E43';\n/** Slightly lighter for ghost/outline text on dark page backgrounds */\nexport const BRAND_COLOR_ON_DARK = '#F0B8A8';\n\nexport const themes: Record<Exclude<Theme, 'system'>, ThemeTokens> = {\n branded: {\n bg: BRAND_COLOR,\n text: '#FFFFFF',\n border: 'transparent',\n surface: '#FFFFFF',\n surfaceText: '#1C1917',\n muted: '#78716C',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#1C1917',\n codeText: '#F5F0EB',\n },\n 'branded-alt': {\n bg: '#6B5CE7',\n text: '#FFFFFF',\n border: 'transparent',\n surface: '#FFFFFF',\n surfaceText: '#1C1917',\n muted: '#78716C',\n primary: '#6B5CE7',\n primaryText: '#FFFFFF',\n codeBg: '#1C1917',\n codeText: '#F5F0EB',\n },\n dark: {\n bg: '#1C1917',\n text: '#F5F0EB',\n border: '#3D3530',\n surface: '#292524',\n surfaceText: '#F5F0EB',\n muted: '#A8A29E',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#0C0A09',\n codeText: '#F5F0EB',\n },\n light: {\n bg: '#FFFFFF',\n text: '#1C1917',\n border: '#E7E5E4',\n surface: '#FAFAF9',\n surfaceText: '#1C1917',\n muted: '#78716C',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#1C1917',\n codeText: '#F5F0EB',\n },\n};\n\nexport function resolveTheme(theme: Theme): ThemeTokens {\n if (theme !== 'system') return themes[theme];\n if (typeof window === 'undefined') return themes.light;\n return window.matchMedia('(prefers-color-scheme: dark)').matches\n ? themes.dark\n : themes.light;\n}\n\nexport function themeToCSS(tokens: ThemeTokens): string {\n return `\n --cb-bg: ${tokens.bg};\n --cb-text: ${tokens.text};\n --cb-border: ${tokens.border};\n --cb-surface: ${tokens.surface};\n --cb-surface-text: ${tokens.surfaceText};\n --cb-muted: ${tokens.muted};\n --cb-primary: ${tokens.primary};\n --cb-primary-text: ${tokens.primaryText};\n --cb-code-bg: ${tokens.codeBg};\n --cb-code-text: ${tokens.codeText};\n `;\n}\n\nexport const ALT_BRAND_COLOR = '#6B5CE7';\n\nexport const SHAPE_MAP = {\n rounded: { sm: '0.375rem', md: '0.5rem', lg: '0.625rem' },\n pill: { sm: '999px', md: '999px', lg: '999px' },\n square: { sm: '0', md: '0', lg: '0' },\n} as const;\n\nexport const SIZE_MAP = {\n sm: { height: '2rem', fontSize: '0.75rem', iconSize: '0.875rem', padding: '0 0.75rem', ccPadding: '0 0.5rem', gap: '0.375rem', radius: '0.375rem' },\n md: { height: '2.5rem', fontSize: '0.875rem', iconSize: '1.125rem', padding: '0 1rem', ccPadding: '0 0.75rem', gap: '0.5rem', radius: '0.5rem' },\n lg: { height: '3rem', fontSize: '1rem', iconSize: '1.375rem', padding: '0 1.25rem', ccPadding: '0 1rem', gap: '0.625rem', radius: '0.625rem' },\n};\n","/**\n * Heuristics for whether launch shortcuts are likely to work in the current\n * browser/OS. Custom schemes are unreliable in embedded WebViews.\n */\n\n/** In-app / embedded browsers where custom URL schemes often fail or are blocked. */\nexport function isRestrictedEmbeddedBrowser(): boolean {\n if (typeof navigator === 'undefined') return true;\n const ua = navigator.userAgent || '';\n if (!ua.trim()) return true;\n\n if (\n /\\bFBAN\\b|\\bFBAV\\b|FB_IAB|Instagram|Line\\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(ua)\n ) {\n return true;\n }\n\n if (/Twitter for (iPhone|Android)/i.test(ua)) return true;\n\n // Android WebView (not standalone Chrome)\n if (/; wv\\)/.test(ua)) return true;\n\n // Opera Mini / extreme proxies\n if (/Opera Mini|OPiOS/i.test(ua)) return true;\n\n return false;\n}\n\n/** Phones and tablets (including iPad with desktop UA). */\nexport function isMobileOrTabletDevice(): boolean {\n if (typeof navigator === 'undefined') return false;\n const ua = navigator.userAgent || '';\n const maxTouch = typeof navigator.maxTouchPoints === 'number' ? navigator.maxTouchPoints : 0;\n const platform = navigator.platform || '';\n\n if (/iPhone|iPod/i.test(ua)) return true;\n if (/iPad/i.test(ua)) return true;\n if (/Android/i.test(ua) && /Mobile/i.test(ua)) return true;\n if (/Android/i.test(ua) && !/Mobile/i.test(ua)) return true;\n if ((platform === 'MacIntel' || platform === 'MacARM') && maxTouch > 1) return true;\n\n if (/webOS|BlackBerry|IEMobile|Opera Mini/i.test(ua)) return true;\n\n return false;\n}\n\n/** Baseline APIs needed to show the dialog and trigger app links. */\nexport function hasLaunchBaselineApis(): boolean {\n return typeof window !== 'undefined'\n && typeof document !== 'undefined'\n && typeof document.createElement === 'function';\n}\n\n/**\n * \"Open Claude Desktop\" via claude:// — works in most standalone desktop & mobile browsers,\n * not in typical in-app WebViews.\n */\nexport function isDesktopAppLinkSupported(): boolean {\n if (!hasLaunchBaselineApis()) return false;\n if (isRestrictedEmbeddedBrowser()) return false;\n return true;\n}\n","import type { PopupOptions, ThemeTokens } from './types';\nimport {\n CLAUDE_CODE_ICON,\n COWORK_ICON,\n COPY_ICON,\n CHECK_ICON,\n CLOSE_ICON,\n DESKTOP_APP_ICON,\n} from './icons';\nimport { resolveTheme, themeToCSS, BRAND_COLOR, BRAND_COLOR_HOVER } from './themes';\nimport { isDesktopAppLinkSupported } from './launch-capabilities';\n\nconst POPUP_STYLES = `\n :host {\n position: fixed;\n inset: 0;\n z-index: 999999;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .cb-backdrop {\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n animation: cb-fade-in 0.15s ease-out;\n }\n\n .cb-dialog {\n position: relative;\n width: 90%;\n max-width: 460px;\n background: var(--cb-surface);\n color: var(--cb-surface-text);\n border-radius: 16px;\n box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--cb-border);\n overflow: hidden;\n animation: cb-scale-in 0.2s ease-out;\n }\n\n .cb-dialog-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px 24px 16px;\n border-bottom: 1px solid var(--cb-border);\n }\n\n .cb-dialog-header-icon {\n width: 36px;\n height: 36px;\n color: var(--cb-primary);\n flex-shrink: 0;\n }\n\n .cb-dialog-header-text {\n flex: 1;\n min-width: 0;\n }\n\n .cb-dialog-title {\n font-size: 16px;\n font-weight: 600;\n line-height: 1.3;\n color: var(--cb-surface-text);\n }\n\n .cb-dialog-description {\n font-size: 13px;\n color: var(--cb-muted);\n margin-top: 2px;\n line-height: 1.4;\n }\n\n .cb-dialog-close {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n background: transparent;\n color: var(--cb-muted);\n cursor: pointer;\n border-radius: 8px;\n flex-shrink: 0;\n transition: background 0.15s, color 0.15s;\n }\n\n .cb-dialog-close:hover {\n background: var(--cb-border);\n color: var(--cb-surface-text);\n }\n\n .cb-dialog-close svg { width: 14px; height: 14px; }\n\n .cb-dialog-body { padding: 20px 24px; }\n\n .cb-step {\n display: flex;\n gap: 12px;\n margin-bottom: 16px;\n }\n\n .cb-step:last-child { margin-bottom: 0; }\n\n .cb-step-num {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: var(--cb-primary);\n color: var(--cb-primary-text);\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin-top: 1px;\n }\n\n .cb-step-content {\n flex: 1;\n min-width: 0;\n }\n\n .cb-step-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--cb-surface-text);\n margin-bottom: 8px;\n line-height: 1.4;\n }\n\n .cb-code-block {\n display: flex;\n align-items: center;\n background: var(--cb-code-bg);\n color: var(--cb-code-text);\n border-radius: 10px;\n padding: 2px 2px 2px 14px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace;\n font-size: 13px;\n line-height: 1.5;\n gap: 8px;\n overflow: hidden;\n }\n\n .cb-code-text {\n flex: 1;\n overflow-x: auto;\n white-space: nowrap;\n padding: 10px 0;\n scrollbar-width: none;\n }\n\n .cb-code-text::-webkit-scrollbar { display: none; }\n\n .cb-code-prefix {\n color: var(--cb-muted);\n user-select: none;\n margin-right: 6px;\n }\n\n .cb-copy-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: 36px;\n min-width: 36px;\n padding: 0 12px;\n border: none;\n background: var(--cb-primary);\n color: var(--cb-primary-text);\n cursor: pointer;\n border-radius: 8px;\n font-family: inherit;\n font-size: 12px;\n font-weight: 500;\n flex-shrink: 0;\n transition: background 0.15s, transform 0.1s;\n white-space: nowrap;\n }\n\n .cb-copy-btn:hover { background: ${BRAND_COLOR_HOVER}; }\n .cb-copy-btn:active { transform: scale(0.96); }\n .cb-copy-btn svg { width: 14px; height: 14px; }\n\n .cb-copy-btn[data-copied=\"true\"] {\n background: #16a34a;\n }\n\n .cb-dialog-footer {\n padding: 16px 24px 20px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .cb-action-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: 44px;\n border: none;\n background: var(--cb-primary);\n color: var(--cb-primary-text);\n cursor: pointer;\n border-radius: 10px;\n font-family: inherit;\n font-size: 14px;\n font-weight: 600;\n transition: background 0.15s, transform 0.1s;\n }\n\n .cb-action-btn:hover { background: ${BRAND_COLOR_HOVER}; }\n .cb-action-btn:active { transform: scale(0.98); }\n .cb-action-btn svg { width: 16px; height: 16px; }\n\n .cb-hint {\n font-size: 12px;\n color: var(--cb-muted);\n text-align: center;\n line-height: 1.4;\n }\n\n .cb-hint kbd {\n display: inline-block;\n padding: 1px 5px;\n font-family: inherit;\n font-size: 11px;\n background: var(--cb-border);\n border-radius: 4px;\n border: 1px solid var(--cb-border);\n }\n\n .cb-launch-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n min-height: 48px;\n padding: 12px 18px;\n border-radius: 12px;\n font-family: inherit;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: -0.02em;\n text-decoration: none;\n cursor: pointer;\n transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease, color 0.2s ease;\n -webkit-tap-highlight-color: transparent;\n }\n\n .cb-launch-btn:active:not(:disabled) { transform: scale(0.99); }\n\n .cb-launch-btn .cb-launch-svg {\n width: 22px;\n height: 22px;\n flex-shrink: 0;\n }\n\n .cb-launch-btn--desktop {\n color: var(--cb-surface-text);\n background: linear-gradient(\n 165deg,\n color-mix(in srgb, var(--cb-primary) 14%, var(--cb-surface)) 0%,\n var(--cb-surface) 55%\n );\n border: 1.5px solid color-mix(in srgb, var(--cb-primary) 38%, var(--cb-border));\n box-shadow:\n 0 1px 0 color-mix(in srgb, white 55%, transparent) inset,\n 0 4px 14px -4px color-mix(in srgb, var(--cb-primary) 35%, transparent);\n }\n\n .cb-launch-btn--desktop:hover:not(:disabled) {\n border-color: color-mix(in srgb, var(--cb-primary) 72%, var(--cb-border));\n box-shadow:\n 0 1px 0 color-mix(in srgb, white 45%, transparent) inset,\n 0 8px 24px -6px color-mix(in srgb, var(--cb-primary) 45%, transparent);\n }\n\n .cb-launch-btn--desktop:focus-visible {\n outline: 2px solid var(--cb-primary);\n outline-offset: 2px;\n }\n\n .cb-launch-btn:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n filter: saturate(0.7);\n box-shadow: none;\n }\n\n .cb-launch-btn--desktop:disabled {\n background: var(--cb-border);\n border-color: var(--cb-border);\n color: var(--cb-muted);\n }\n\n .cb-launch-btn:disabled .cb-launch-svg {\n opacity: 0.75;\n }\n\n .cb-launch-sub {\n display: block;\n margin-top: 6px;\n font-size: 11px;\n font-weight: 500;\n color: var(--cb-muted);\n line-height: 1.35;\n text-align: center;\n }\n\n @keyframes cb-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes cb-scale-in {\n from { opacity: 0; transform: scale(0.95) translateY(8px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n }\n\n @media (max-width: 480px) {\n .cb-dialog {\n width: 96%;\n max-width: none;\n border-radius: 14px;\n max-height: 90dvh;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .cb-dialog-header { padding: 16px 16px 12px; gap: 10px; }\n .cb-dialog-header-icon { width: 28px; height: 28px; }\n .cb-dialog-body { padding: 16px; }\n .cb-dialog-footer { padding: 12px 16px 16px; }\n\n .cb-step { gap: 10px; margin-bottom: 14px; }\n .cb-step-num { width: 22px; height: 22px; font-size: 11px; }\n .cb-step-label { font-size: 12px; margin-bottom: 6px; }\n\n .cb-code-block { font-size: 12px; padding: 2px 2px 2px 10px; border-radius: 8px; }\n .cb-copy-btn { height: 32px; padding: 0 10px; font-size: 11px; border-radius: 6px; }\n .cb-action-btn { height: 40px; font-size: 13px; border-radius: 8px; }\n .cb-launch-btn { min-height: 46px; padding: 10px 14px; font-size: 13px; border-radius: 10px; }\n .cb-launch-btn .cb-launch-svg { width: 20px; height: 20px; }\n .cb-launch-sub { font-size: 10px; }\n .cb-hint { font-size: 11px; }\n }\n\n @media (max-width: 360px) {\n .cb-dialog { width: 100%; border-radius: 12px 12px 0 0; align-self: flex-end; }\n .cb-copy-btn span { display: none; }\n .cb-copy-btn { min-width: 32px; padding: 0 8px; }\n }\n\n @supports (padding: env(safe-area-inset-bottom)) {\n .cb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }\n }\n`;\n\nexport class ClaudePopupDialog extends HTMLElement {\n private _options!: PopupOptions;\n private _mqCleanup: (() => void) | null = null;\n /** Prevents auto-launch from firing on every theme re-render; reset when `options` is set. */\n private _autoLaunchConsumed = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n set options(opts: PopupOptions) {\n this._autoLaunchConsumed = false;\n this._options = opts;\n this.render();\n }\n\n get options() {\n return this._options;\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n private resolvePopupTokens(): ThemeTokens {\n const { theme } = this._options;\n\n if (theme === 'dark' || theme === 'light') return resolveTheme(theme);\n\n const prefersDark = typeof window !== 'undefined'\n && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (theme === 'system') {\n return prefersDark ? resolveTheme('dark') : resolveTheme('light');\n }\n\n const base = prefersDark ? resolveTheme('dark') : resolveTheme('light');\n const brand = resolveTheme(theme);\n return {\n ...base,\n primary: brand.primary,\n primaryText: brand.primaryText,\n };\n }\n\n private render() {\n if (!this.shadowRoot || !this._options) return;\n\n const { variant, title, description, command, fullCommand, skillUrl, desktopLaunchUrl, autoLaunch } = this._options;\n const tokens = this.resolvePopupTokens();\n const icon = variant === 'claude-code' ? CLAUDE_CODE_ICON : COWORK_ICON;\n\n const isClaudeCode = variant === 'claude-code';\n const displayCommand = fullCommand || command;\n const desktopHref = desktopLaunchUrl ?? 'claude://';\n const desktopLaunchOk = isDesktopAppLinkSupported();\n\n this.shadowRoot.innerHTML = `\n <style>${POPUP_STYLES}</style>\n <div style=\"${themeToCSS(tokens)}\">\n <div class=\"cb-backdrop\" data-action=\"close\"></div>\n <div class=\"cb-dialog\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"cb-dialog-title\">\n <div class=\"cb-dialog-header\">\n <div class=\"cb-dialog-header-icon\">${icon}</div>\n <div class=\"cb-dialog-header-text\">\n <div class=\"cb-dialog-title\" id=\"cb-dialog-title\">${title}</div>\n ${description ? `<div class=\"cb-dialog-description\">${description}</div>` : ''}\n </div>\n <button class=\"cb-dialog-close\" data-action=\"close\" aria-label=\"Close\">${CLOSE_ICON}</button>\n </div>\n <div class=\"cb-dialog-body\">\n ${isClaudeCode ? this.renderClaudeCodeBody(displayCommand) : this.renderCoworkBody(command, skillUrl)}\n </div>\n <div class=\"cb-dialog-footer\">\n ${isClaudeCode\n ? this.renderClaudeCodeFooter()\n : this.renderCoworkFooter(this.escapeHref(desktopHref), desktopLaunchOk)}\n </div>\n </div>\n </div>\n `;\n\n this.setupListeners();\n this.setupSystemThemeWatch();\n\n if (autoLaunch && !this._autoLaunchConsumed && variant === 'cowork' && desktopLaunchOk) {\n this._autoLaunchConsumed = true;\n this.openDesktopAppLink(desktopHref);\n }\n }\n\n /** Programmatic open (same as clicking the desktop launch control). */\n private openDesktopAppLink(href: string) {\n this.dispatchEvent(new CustomEvent('cb-launch-desktop', {\n bubbles: true,\n composed: true,\n detail: { href },\n }));\n if (typeof document === 'undefined') return;\n const a = document.createElement('a');\n a.href = href;\n a.rel = 'noopener noreferrer';\n a.style.cssText = 'position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none';\n document.body.appendChild(a);\n a.click();\n requestAnimationFrame(() => a.remove());\n }\n\n private renderClaudeCodeBody(command: string): string {\n return `\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">1</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Copy this command to your clipboard</div>\n <div class=\"cb-code-block\">\n <div class=\"cb-code-text\"><span class=\"cb-code-prefix\">$</span>${this.escapeHtml(command)}</div>\n <button class=\"cb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(command)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">2</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Paste and run in your terminal</div>\n </div>\n </div>\n `;\n }\n\n private renderCoworkBody(command: string, skillUrl?: string): string {\n let steps = '';\n\n if (skillUrl) {\n const fullPrompt = `Install the skill from ${skillUrl} and run ${command}`;\n steps += `\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">1</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Copy this prompt to your clipboard</div>\n <div class=\"cb-code-block\">\n <div class=\"cb-code-text\">${this.escapeHtml(fullPrompt)}</div>\n <button class=\"cb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(fullPrompt)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">2</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Paste into a Cowork session — Claude will fetch the skill and set it up for you</div>\n </div>\n </div>\n `;\n } else {\n steps += `\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">1</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Copy this command to your clipboard</div>\n <div class=\"cb-code-block\">\n <div class=\"cb-code-text\">${this.escapeHtml(command)}</div>\n <button class=\"cb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(command)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">2</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Paste and send in your Cowork session</div>\n </div>\n </div>\n `;\n }\n\n return steps;\n }\n\n private renderCoworkFooter(desktopHrefEscaped: string, enabled: boolean): string {\n const disabledTitle = 'Open this page in Safari, Chrome, Firefox, or Edge. In-app browsers usually block opening apps.';\n const sub = enabled\n ? 'Opens the Claude app through your system link handler—then paste the prompt below into Cowork.'\n : 'App links aren’t supported in your current browser (common inside social or chat apps). Open this page in a full browser, or launch Claude Desktop manually and paste below.';\n\n const control = enabled\n ? `\n <a\n class=\"cb-launch-btn cb-launch-btn--desktop\"\n href=\"${desktopHrefEscaped}\"\n data-action=\"launch-desktop\"\n rel=\"noopener noreferrer\"\n >\n ${DESKTOP_APP_ICON}\n <span>Open Claude Desktop</span>\n </a>`\n : `\n <button\n type=\"button\"\n class=\"cb-launch-btn cb-launch-btn--desktop\"\n disabled\n aria-disabled=\"true\"\n aria-label=\"Open Claude Desktop (unavailable in this browser)\"\n title=\"${this.escapeAttr(disabledTitle)}\"\n >\n ${DESKTOP_APP_ICON}\n <span>Open Claude Desktop</span>\n </button>`;\n\n return `\n ${control}\n <span class=\"cb-launch-sub\">${this.escapeHtml(sub)}</span>\n <div class=\"cb-hint\">Press <kbd>⌘</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your Cowork session to run</div>\n `;\n }\n\n private renderClaudeCodeFooter(): string {\n return `\n <div class=\"cb-hint\">Press <kbd>⌘</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div>\n `;\n }\n\n private escapeHref(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n }\n\n private setupListeners() {\n if (!this.shadowRoot) return;\n\n this.shadowRoot.addEventListener('click', (e) => {\n const target = (e.target as HTMLElement).closest('[data-action]') as HTMLElement | null;\n if (!target) return;\n\n const action = target.dataset.action;\n\n if (action === 'close') {\n this.close();\n } else if (action === 'copy') {\n const cmd = target.dataset.command || '';\n this.copyToClipboard(cmd, target);\n } else if (action === 'launch-desktop') {\n e.preventDefault();\n const raw = (target as HTMLAnchorElement).getAttribute('href') || '';\n this.openDesktopAppLink(raw || (target as HTMLAnchorElement).href);\n }\n });\n\n this.shadowRoot.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Escape') this.close();\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n const theme = this._options.theme;\n const needsWatch = theme === 'system' || theme === 'branded' || theme === 'branded-alt';\n if (!needsWatch || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n\n private async copyToClipboard(command: string, button: HTMLElement) {\n try {\n await navigator.clipboard.writeText(command);\n const label = button.querySelector('span');\n const iconContainer = button;\n const originalIcon = iconContainer.querySelector('.cb-icon-sm')?.outerHTML || '';\n\n button.setAttribute('data-copied', 'true');\n if (label) label.textContent = 'Copied!';\n iconContainer.innerHTML = `${CHECK_ICON}<span>Copied!</span>`;\n\n this._options.onCopy?.(command);\n\n setTimeout(() => {\n button.setAttribute('data-copied', 'false');\n iconContainer.innerHTML = `${COPY_ICON}<span>Copy</span>`;\n }, 2000);\n } catch {\n const textarea = document.createElement('textarea');\n textarea.value = command;\n textarea.style.position = 'fixed';\n textarea.style.opacity = '0';\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n\n this._options.onCopy?.(command);\n }\n }\n\n close() {\n const dialog = this.shadowRoot?.querySelector('.cb-dialog') as HTMLElement;\n const backdrop = this.shadowRoot?.querySelector('.cb-backdrop') as HTMLElement;\n\n if (dialog) {\n dialog.style.animation = 'cb-scale-in 0.15s ease-in reverse';\n }\n if (backdrop) {\n backdrop.style.animation = 'cb-fade-in 0.15s ease-in reverse';\n }\n\n setTimeout(() => {\n this._options.onClose?.();\n this.remove();\n }, 140);\n }\n\n private escapeHtml(str: string): string {\n const div = document.createElement('div');\n div.textContent = str;\n return div.innerHTML;\n }\n\n private escapeAttr(str: string): string {\n return str.replace(/\"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');\n }\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('claude-popup-dialog')) {\n customElements.define('claude-popup-dialog', ClaudePopupDialog);\n}\n\nexport function showPopup(options: PopupOptions): ClaudePopupDialog {\n const popup = document.createElement('claude-popup-dialog') as ClaudePopupDialog;\n popup.options = options;\n document.body.appendChild(popup);\n return popup;\n}\n"],"mappings":"AAAO,IAAMA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAiBnBC,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAWdC,EAAY;AAAA;AAAA;AAAA,QAKZC,EAAa;AAAA;QASnB,IAAMC,EAAa;AAAA;QAUnB,IAAMC,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;QClDzB,IAAMC,EAAc,UACdC,EAAoB,UACpBC,EAAqB,UAErBC,EAAsB,UAEtBC,EAAwD,CACnE,QAAS,CACP,GAAIJ,EACJ,KAAM,UACN,OAAQ,cACR,QAAS,UACT,YAAa,UACb,MAAO,UACP,QAASA,EACT,YAAa,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_COLOR_HOVER","BRAND_COLOR_ACTIVE","BRAND_COLOR_ON_DARK","themes","resolveTheme","theme","themeToCSS","tokens","SHAPE_MAP","SIZE_MAP","isRestrictedEmbeddedBrowser","ua","hasLaunchBaselineApis","isDesktopAppLinkSupported","isRestrictedEmbeddedBrowser","POPUP_STYLES","BRAND_COLOR_HOVER","ClaudePopupDialog","opts","theme","resolveTheme","prefersDark","base","brand","variant","title","description","command","fullCommand","skillUrl","desktopLaunchUrl","autoLaunch","tokens","icon","CLAUDE_CODE_ICON","COWORK_ICON","isClaudeCode","displayCommand","desktopHref","desktopLaunchOk","isDesktopAppLinkSupported","themeToCSS","CLOSE_ICON","href","a","COPY_ICON","steps","fullPrompt","desktopHrefEscaped","enabled","disabledTitle","sub","DESKTOP_APP_ICON","str","target","action","cmd","raw","mq","handler","button","label","iconContainer","originalIcon","CHECK_ICON","textarea","dialog","backdrop","div","showPopup","options","popup"]} |
| import{a as m,c as r,d as g,e as v,f,g as C,h as k,i as x,j as _,k as w}from"./chunk-ATQND4KB.mjs";var E=` | ||
| :host { | ||
| display: inline-block; | ||
| vertical-align: middle; | ||
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; | ||
| -webkit-tap-highlight-color: transparent; | ||
| } | ||
| * { box-sizing: border-box; margin: 0; padding: 0; } | ||
| .cb-btn { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: var(--cb-gap); | ||
| height: var(--cb-height); | ||
| min-height: 44px; | ||
| padding: var(--cb-padding); | ||
| border: 1.5px solid var(--cb-border); | ||
| background: var(--cb-bg); | ||
| color: var(--cb-text); | ||
| font-family: inherit; | ||
| font-size: var(--cb-font-size); | ||
| font-weight: 600; | ||
| line-height: 1; | ||
| border-radius: var(--cb-radius); | ||
| cursor: pointer; | ||
| user-select: none; | ||
| white-space: nowrap; | ||
| touch-action: manipulation; | ||
| transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease; | ||
| text-decoration: none; | ||
| -webkit-font-smoothing: antialiased; | ||
| } | ||
| @media (pointer: fine) { | ||
| .cb-btn { min-height: unset; } | ||
| } | ||
| /* \u2500\u2500\u2500 FILLED \u2500\u2500\u2500 */ | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn, | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn { | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:hover { | ||
| background: ${g}; | ||
| box-shadow: 0 2px 8px rgba(212, 121, 92, 0.35); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${v}; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: #5A4BD6; | ||
| box-shadow: 0 2px 8px rgba(107, 92, 231, 0.35); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: #4F41C8; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn { | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn:hover { | ||
| background: #292524; | ||
| border-color: #57534E; | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn:active { | ||
| background: #1C1917; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn { | ||
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: #D6D3D1; | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn:active { | ||
| background: #FAFAF9; | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 OUTLINE \u2500\u2500\u2500 */ | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: ${r}; | ||
| color: ${r}; | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| background: rgba(212, 121, 92, 0.08); | ||
| box-shadow: 0 2px 8px rgba(212, 121, 92, 0.15); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #6B5CE7; | ||
| color: #6B5CE7; | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: rgba(107, 92, 231, 0.08); | ||
| box-shadow: 0 2px 8px rgba(107, 92, 231, 0.15); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: rgba(107, 92, 231, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #57534E; | ||
| color: #F5F0EB; | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${r}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #D6D3D1; | ||
| color: #1C1917; | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${r}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.1); | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 GHOST \u2500\u2500\u2500 */ | ||
| :host([data-variant="ghost"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: transparent; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${f}; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| background: rgba(212, 121, 92, 0.1); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.16); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn { | ||
| color: #6B5CE7; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: rgba(107, 92, 231, 0.1); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: rgba(107, 92, 231, 0.16); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn { | ||
| color: #F5F0EB; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn:hover { | ||
| background: rgba(255, 255, 255, 0.06); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn:active { | ||
| background: rgba(255, 255, 255, 0.1); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn { | ||
| color: #1C1917; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn:hover { | ||
| background: rgba(0, 0, 0, 0.04); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn:active { | ||
| background: rgba(0, 0, 0, 0.08); | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 FOCUS \u2500\u2500\u2500 */ | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${r}); | ||
| outline-offset: 2px; | ||
| } | ||
| /* \u2500\u2500\u2500 ICON \u2500\u2500\u2500 */ | ||
| .cb-btn-icon { | ||
| width: var(--cb-icon-size); | ||
| height: var(--cb-icon-size); | ||
| flex-shrink: 0; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
| .cb-btn-icon svg { width: 100%; height: 100%; } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn-icon, | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn-icon { | ||
| color: #FFFFFF; | ||
| --cb-icon-accent: rgba(255,255,255,0.2); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| } | ||
| :host([data-variant="outline"]) .cb-btn-icon, | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| } | ||
| /* \u2500\u2500\u2500 LABEL \u2500\u2500\u2500 */ | ||
| .cb-btn-label { | ||
| letter-spacing: -0.01em; | ||
| } | ||
| `,h=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(e){this._options={...this._options,...e},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let e=this.getAttribute("command"),a=this.getAttribute("theme"),t=this.getAttribute("size"),o=this.getAttribute("variant"),n=this.getAttribute("shape"),s=this.getAttribute("popup"),i=this.getAttribute("prompt-flag"),c=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");e!==null&&(this._options.command=e),a&&(this._options.theme=a),t&&(this._options.size=t),o&&(this._options.variant=o),n&&(this._options.shape=n),s!==null&&(this._options.popup=s!=="false"),i!==null&&(this._options.promptFlag=i!=="false"),c!==null&&(this._options.popupTitle=c),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:e}=this._options,a=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Claude Code: ${e}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let t=this.querySelector("a[data-cb-crawl]");t||(t=document.createElement("a"),t.setAttribute("data-cb-crawl",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(t)),t.href=`https://claude.ai/code?command=${encodeURIComponent(a)}`,t.textContent=`Run on Claude Code: ${e}`,t.setAttribute("data-platform","claude-code"),t.setAttribute("data-command",e),t.setAttribute("data-full-command",a)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:e,promptFlag:a}=this._options;return a===!1?e:`claude -p "${e}"`}render(){if(!this.shadowRoot)return;let e=this.getResolvedTheme(),a=e==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,t=this._options.variant||"filled",o=C(e),n=this._options.size||"md",s=this._options.shape||"rounded",i=_[n],c=x[s][n];this.setAttribute("data-theme",a),this.setAttribute("data-variant",t);let b=t!=="filled"?"transparent":o.bg,y=t==="ghost"?"transparent":t==="outline"?o.primary:o.border,A=t!=="filled"?o.primary:o.text;this.shadowRoot.innerHTML=` | ||
| <style>${E}</style> | ||
| <button | ||
| class="cb-btn" | ||
| type="button" | ||
| style=" | ||
| ${k(o)} | ||
| --cb-bg: ${b}; | ||
| --cb-border: ${y}; | ||
| --cb-text: ${A}; | ||
| --cb-accent-color: ${o.primary}; | ||
| --cb-focus-color: ${o.primary}; | ||
| --cb-height: ${i.height}; | ||
| --cb-font-size: ${i.fontSize}; | ||
| --cb-icon-size: ${i.iconSize}; | ||
| --cb-padding: ${i.ccPadding}; | ||
| --cb-gap: ${i.gap}; | ||
| --cb-radius: ${c}; | ||
| " | ||
| aria-label="Run on Claude Code: ${this._options.command.replace(/"/g,""")}" | ||
| > | ||
| <span class="cb-btn-icon" aria-hidden="true">${m}</span> | ||
| <span class="cb-btn-label">Run on Claude Code</span> | ||
| </button> | ||
| `;let u=this.shadowRoot.querySelector(".cb-btn");u.addEventListener("click",()=>this.handleClick()),u.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:e,command:a,popupTitle:t,popupDescription:o}=this._options,n=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:a,fullCommand:n}})),e===!1){navigator.clipboard.writeText(n).then(()=>{this._options.onCopy?.(n),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:n}}))});return}w({variant:"claude-code",theme:this.getResolvedTheme(),title:t||"Run on Claude Code",description:o||"Execute this command in your terminal to get started.",command:a,fullCommand:n,onCopy:s=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}};h.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function $(d="claude-code-button"){typeof customElements>"u"||customElements.get(d)||customElements.define(d,h)}$();function R(d){let l=document.createElement("claude-code-button");return l.options=d,l}export{h as ClaudeCodeButton,R as createClaudeCodeButton,$ as registerClaudeCodeButton}; | ||
| //# sourceMappingURL=claude-code-button-B2PPY3KH.mjs.map |
| {"version":3,"sources":["../src/claude-code-button.ts"],"sourcesContent":["import type { ClaudeCodeButtonOptions, Theme, Size, Variant, Shape } from './types';\nimport { CLAUDE_CODE_ICON } from './icons';\nimport { resolveTheme, themeToCSS, SIZE_MAP, SHAPE_MAP, BRAND_COLOR, BRAND_COLOR_HOVER, BRAND_COLOR_ACTIVE, BRAND_COLOR_ON_DARK } from './themes';\nimport { showPopup } from './popup-dialog';\n\nconst BUTTON_STYLES = `\n :host {\n display: inline-block;\n vertical-align: middle;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-tap-highlight-color: transparent;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .cb-btn {\n display: inline-flex;\n align-items: center;\n gap: var(--cb-gap);\n height: var(--cb-height);\n min-height: 44px;\n padding: var(--cb-padding);\n border: 1.5px solid var(--cb-border);\n background: var(--cb-bg);\n color: var(--cb-text);\n font-family: inherit;\n font-size: var(--cb-font-size);\n font-weight: 600;\n line-height: 1;\n border-radius: var(--cb-radius);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n touch-action: manipulation;\n transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n }\n\n @media (pointer: fine) {\n .cb-btn { min-height: unset; }\n }\n\n /* ─── FILLED ─── */\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: ${BRAND_COLOR_HOVER};\n box-shadow: 0 2px 8px rgba(212, 121, 92, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn:active {\n background: ${BRAND_COLOR_ACTIVE};\n transform: scale(0.98);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: #5A4BD6;\n box-shadow: 0 2px 8px rgba(107, 92, 231, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: #4F41C8;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn:hover {\n background: #292524;\n border-color: #57534E;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn:active {\n background: #1C1917;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn:hover {\n border-color: #D6D3D1;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn:active {\n background: #FAFAF9;\n transform: scale(0.98);\n }\n\n /* ─── OUTLINE ─── */\n\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn {\n background: transparent;\n border-color: ${BRAND_COLOR};\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: rgba(212, 121, 92, 0.08);\n box-shadow: 0 2px 8px rgba(212, 121, 92, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn {\n background: transparent;\n border-color: #6B5CE7;\n color: #6B5CE7;\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: rgba(107, 92, 231, 0.08);\n box-shadow: 0 2px 8px rgba(107, 92, 231, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: rgba(107, 92, 231, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn {\n background: transparent;\n border-color: #57534E;\n color: #F5F0EB;\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(212, 121, 92, 0.08);\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn {\n background: transparent;\n border-color: #D6D3D1;\n color: #1C1917;\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(212, 121, 92, 0.05);\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.1);\n transform: scale(0.98);\n }\n\n /* ─── GHOST ─── */\n\n :host([data-variant=\"ghost\"]) .cb-btn {\n background: transparent;\n border-color: transparent;\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn {\n color: ${BRAND_COLOR_ON_DARK};\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: rgba(212, 121, 92, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn {\n color: #6B5CE7;\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: rgba(107, 92, 231, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: rgba(107, 92, 231, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn {\n color: #F5F0EB;\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn:hover {\n background: rgba(255, 255, 255, 0.06);\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn:active {\n background: rgba(255, 255, 255, 0.1);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn {\n color: #1C1917;\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn:active {\n background: rgba(0, 0, 0, 0.08);\n transform: scale(0.98);\n }\n\n /* ─── FOCUS ─── */\n\n .cb-btn:focus-visible {\n outline: 2px solid var(--cb-focus-color, ${BRAND_COLOR});\n outline-offset: 2px;\n }\n\n /* ─── ICON ─── */\n\n .cb-btn-icon {\n width: var(--cb-icon-size);\n height: var(--cb-icon-size);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .cb-btn-icon svg { width: 100%; height: 100%; }\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn-icon,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn-icon {\n color: #FFFFFF;\n --cb-icon-accent: rgba(255,255,255,0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n }\n\n :host([data-variant=\"outline\"]) .cb-btn-icon,\n :host([data-variant=\"ghost\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n }\n\n /* ─── LABEL ─── */\n\n .cb-btn-label {\n letter-spacing: -0.01em;\n }\n`;\n\nexport class ClaudeCodeButton extends HTMLElement {\n static observedAttributes = ['command', 'theme', 'size', 'variant', 'shape', 'popup', 'prompt-flag', 'popup-title', 'popup-description'];\n\n private _options: ClaudeCodeButtonOptions = {\n command: '',\n theme: 'branded',\n size: 'md',\n variant: 'filled',\n popup: true,\n promptFlag: true,\n };\n\n private _mqCleanup: (() => void) | null = null;\n private _rendered = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n attributeChangedCallback() {\n if (!this._rendered) return;\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n set options(opts: Partial<ClaudeCodeButtonOptions>) {\n this._options = { ...this._options, ...opts };\n this.render();\n this.updateLightDOM();\n }\n\n get options() {\n return this._options;\n }\n\n private syncFromAttributes() {\n const command = this.getAttribute('command');\n const theme = this.getAttribute('theme') as Theme | null;\n const size = this.getAttribute('size') as Size | null;\n const variant = this.getAttribute('variant') as Variant | null;\n const shape = this.getAttribute('shape') as Shape | null;\n const popup = this.getAttribute('popup');\n const promptFlag = this.getAttribute('prompt-flag');\n const popupTitle = this.getAttribute('popup-title');\n const popupDescription = this.getAttribute('popup-description');\n\n if (command !== null) this._options.command = command;\n if (theme) this._options.theme = theme;\n if (size) this._options.size = size;\n if (variant) this._options.variant = variant;\n if (shape) this._options.shape = shape;\n if (popup !== null) this._options.popup = popup !== 'false';\n if (promptFlag !== null) this._options.promptFlag = promptFlag !== 'false';\n if (popupTitle !== null) this._options.popupTitle = popupTitle;\n if (popupDescription !== null) this._options.popupDescription = popupDescription;\n }\n\n private updateLightDOM() {\n const { command } = this._options;\n const fullCommand = this.getFullCommand();\n\n this.setAttribute('role', 'button');\n this.setAttribute('tabindex', '0');\n this.setAttribute('aria-label', `Run on Claude Code: ${command}`);\n if (this._options.popup !== false) {\n this.setAttribute('aria-haspopup', 'dialog');\n } else {\n this.removeAttribute('aria-haspopup');\n }\n\n let link = this.querySelector('a[data-cb-crawl]') as HTMLAnchorElement | null;\n if (!link) {\n link = document.createElement('a');\n link.setAttribute('data-cb-crawl', '');\n link.setAttribute('aria-hidden', 'true');\n link.style.cssText = 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;';\n this.appendChild(link);\n }\n link.href = `https://claude.ai/code?command=${encodeURIComponent(fullCommand)}`;\n link.textContent = `Run on Claude Code: ${command}`;\n link.setAttribute('data-platform', 'claude-code');\n link.setAttribute('data-command', command);\n link.setAttribute('data-full-command', fullCommand);\n }\n\n private getResolvedTheme(): Theme {\n return this._options.theme || 'branded';\n }\n\n private getFullCommand(): string {\n const { command, promptFlag } = this._options;\n if (promptFlag === false) return command;\n return `claude -p \"${command}\"`;\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const theme = this.getResolvedTheme();\n const resolvedTheme = theme === 'system' ? (\n typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n ) : theme;\n const variant = this._options.variant || 'filled';\n\n const tokens = resolveTheme(theme);\n const size = this._options.size || 'md';\n const shape = this._options.shape || 'rounded';\n const sizeTokens = SIZE_MAP[size];\n const radius = SHAPE_MAP[shape][size];\n\n this.setAttribute('data-theme', resolvedTheme);\n this.setAttribute('data-variant', variant);\n\n const bgOverride = variant !== 'filled' ? 'transparent' : tokens.bg;\n const borderOverride = variant === 'ghost' ? 'transparent' :\n variant === 'outline' ? tokens.primary : tokens.border;\n const textOverride = variant !== 'filled' ? tokens.primary : tokens.text;\n\n this.shadowRoot.innerHTML = `\n <style>${BUTTON_STYLES}</style>\n <button\n class=\"cb-btn\"\n type=\"button\"\n style=\"\n ${themeToCSS(tokens)}\n --cb-bg: ${bgOverride};\n --cb-border: ${borderOverride};\n --cb-text: ${textOverride};\n --cb-accent-color: ${tokens.primary};\n --cb-focus-color: ${tokens.primary};\n --cb-height: ${sizeTokens.height};\n --cb-font-size: ${sizeTokens.fontSize};\n --cb-icon-size: ${sizeTokens.iconSize};\n --cb-padding: ${sizeTokens.ccPadding};\n --cb-gap: ${sizeTokens.gap};\n --cb-radius: ${radius};\n \"\n aria-label=\"Run on Claude Code: ${this._options.command.replace(/\"/g, '"')}\"\n >\n <span class=\"cb-btn-icon\" aria-hidden=\"true\">${CLAUDE_CODE_ICON}</span>\n <span class=\"cb-btn-label\">Run on Claude Code</span>\n </button>\n `;\n\n const btn = this.shadowRoot.querySelector('.cb-btn')!;\n btn.addEventListener('click', () => this.handleClick());\n btn.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Enter' || (e as KeyboardEvent).key === ' ') {\n e.preventDefault();\n this.handleClick();\n }\n });\n this._rendered = true;\n this.setupSystemThemeWatch();\n }\n\n private handleClick() {\n const { popup, command, popupTitle, popupDescription } = this._options;\n const fullCommand = this.getFullCommand();\n\n this.dispatchEvent(new CustomEvent('cb-open', {\n bubbles: true,\n composed: true,\n detail: { command, fullCommand },\n }));\n\n if (popup === false) {\n navigator.clipboard.writeText(fullCommand).then(() => {\n this._options.onCopy?.(fullCommand);\n this.dispatchEvent(new CustomEvent('cb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: fullCommand },\n }));\n });\n return;\n }\n\n showPopup({\n variant: 'claude-code',\n theme: this.getResolvedTheme(),\n title: popupTitle || 'Run on Claude Code',\n description: popupDescription || 'Execute this command in your terminal to get started.',\n command,\n fullCommand,\n onCopy: (cmd) => {\n this._options.onCopy?.(cmd);\n this.dispatchEvent(new CustomEvent('cb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: cmd },\n }));\n },\n onClose: () => {\n this.dispatchEvent(new CustomEvent('cb-close', {\n bubbles: true,\n composed: true,\n }));\n },\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n if (this.getResolvedTheme() !== 'system' || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n}\n\nexport function registerClaudeCodeButton(tagName = 'claude-code-button') {\n if (typeof customElements === 'undefined') return;\n if (!customElements.get(tagName)) {\n customElements.define(tagName, ClaudeCodeButton);\n }\n}\n\nregisterClaudeCodeButton();\n\nexport function createClaudeCodeButton(options: ClaudeCodeButtonOptions): ClaudeCodeButton {\n const el = document.createElement('claude-code-button') as ClaudeCodeButton;\n el.options = options;\n return el;\n}\n"],"mappings":"mGAKA,IAAMA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBA6CJC,CAAiB;AAAA;AAAA;AAAA;AAAA,kBAIjBC,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAyChBC,CAAW;AAAA,aA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AY,CACjC,CAAC,CAAC,CACJ,CAAC,EACD,MACF,CAEAgB,EAAU,CACR,QAAS,cACT,MAAO,KAAK,iBAAiB,EAC7B,MAAOlB,GAAc,qBACrB,YAAaC,GAAoB,wDACjC,QAAAR,EACA,YAAAS,EACA,OAASiB,GAAQ,CACf,KAAK,SAAS,SAASA,CAAG,EAC1B,KAAK,cAAc,IAAI,YAAY,UAAW,CAC5C,QAAS,GACT,SAAU,GACV,OAAQ,CAAE,QAASA,CAAI,CACzB,CAAC,CAAC,CACJ,EACA,QAAS,IAAM,CACb,KAAK,cAAc,IAAI,YAAY,WAAY,CAC7C,QAAS,GACT,SAAU,EACZ,CAAC,CAAC,CACJ,CACF,CAAC,CACH,CAEQ,uBAAwB,CAI9B,GAHA,KAAK,aAAa,EAClB,KAAK,WAAa,KAEd,KAAK,iBAAiB,IAAM,UAAY,OAAO,OAAW,IAAa,OAE3E,IAAMC,EAAK,OAAO,WAAW,8BAA8B,EACrDC,EAAU,IAAM,KAAK,OAAO,EAClCD,EAAG,iBAAiB,SAAUC,CAAO,EACrC,KAAK,WAAa,IAAMD,EAAG,oBAAoB,SAAUC,CAAO,CAClE,CACF,EAlOa9B,EACJ,mBAAqB,CAAC,UAAW,QAAS,OAAQ,UAAW,QAAS,QAAS,cAAe,cAAe,mBAAmB,EAmOlI,SAAS+B,EAAyBC,EAAU,qBAAsB,CACnE,OAAO,eAAmB,KACzB,eAAe,IAAIA,CAAO,GAC7B,eAAe,OAAOA,EAAShC,CAAgB,CAEnD,CAEA+B,EAAyB,EAElB,SAASE,EAAuBC,EAAoD,CACzF,IAAMC,EAAK,SAAS,cAAc,oBAAoB,EACtD,OAAAA,EAAG,QAAUD,EACNC,CACT","names":["BUTTON_STYLES","BRAND_COLOR_HOVER","BRAND_COLOR_ACTIVE","BRAND_COLOR","BRAND_COLOR_ON_DARK","ClaudeCodeButton","opts","command","theme","size","variant","shape","popup","promptFlag","popupTitle","popupDescription","fullCommand","link","resolvedTheme","tokens","resolveTheme","sizeTokens","SIZE_MAP","radius","SHAPE_MAP","bgOverride","borderOverride","textOverride","themeToCSS","CLAUDE_CODE_ICON","btn","e","showPopup","cmd","mq","handler","registerClaudeCodeButton","tagName","createClaudeCodeButton","options","el"]} |
| import{b as g,c as r,d as v,e as f,f as k,g as w,h as C,i as x,j as _,k as y}from"./chunk-ATQND4KB.mjs";var E=` | ||
| :host { | ||
| display: inline-block; | ||
| vertical-align: middle; | ||
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; | ||
| -webkit-tap-highlight-color: transparent; | ||
| } | ||
| * { box-sizing: border-box; margin: 0; padding: 0; } | ||
| .cb-btn { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: var(--cb-gap); | ||
| height: var(--cb-height); | ||
| min-height: 44px; | ||
| padding: var(--cb-padding); | ||
| border: 1.5px solid var(--cb-border); | ||
| background: var(--cb-bg); | ||
| color: var(--cb-text); | ||
| font-family: inherit; | ||
| font-size: var(--cb-font-size); | ||
| font-weight: 600; | ||
| line-height: 1; | ||
| border-radius: var(--cb-radius); | ||
| cursor: pointer; | ||
| user-select: none; | ||
| white-space: nowrap; | ||
| touch-action: manipulation; | ||
| transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease; | ||
| text-decoration: none; | ||
| -webkit-font-smoothing: antialiased; | ||
| } | ||
| @media (pointer: fine) { | ||
| .cb-btn { min-height: unset; } | ||
| } | ||
| /* \u2500\u2500\u2500 FILLED \u2500\u2500\u2500 */ | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn, | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn { | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:hover { | ||
| background: ${v}; | ||
| box-shadow: 0 2px 8px rgba(212, 121, 92, 0.35); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${f}; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: #5A4BD6; | ||
| box-shadow: 0 2px 8px rgba(107, 92, 231, 0.35); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: #4F41C8; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn { | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn:hover { | ||
| background: #292524; | ||
| border-color: #57534E; | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn:active { | ||
| background: #1C1917; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn { | ||
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: #D6D3D1; | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn:active { | ||
| background: #FAFAF9; | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 OUTLINE \u2500\u2500\u2500 */ | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: ${r}; | ||
| color: ${r}; | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| background: rgba(212, 121, 92, 0.08); | ||
| box-shadow: 0 2px 8px rgba(212, 121, 92, 0.15); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #6B5CE7; | ||
| color: #6B5CE7; | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: rgba(107, 92, 231, 0.08); | ||
| box-shadow: 0 2px 8px rgba(107, 92, 231, 0.15); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: rgba(107, 92, 231, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #57534E; | ||
| color: #F5F0EB; | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${r}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #D6D3D1; | ||
| color: #1C1917; | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${r}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.1); | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 GHOST \u2500\u2500\u2500 */ | ||
| :host([data-variant="ghost"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: transparent; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${k}; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| background: rgba(212, 121, 92, 0.1); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.16); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn { | ||
| color: #6B5CE7; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: rgba(107, 92, 231, 0.1); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: rgba(107, 92, 231, 0.16); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn { | ||
| color: #F5F0EB; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn:hover { | ||
| background: rgba(255, 255, 255, 0.06); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn:active { | ||
| background: rgba(255, 255, 255, 0.1); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn { | ||
| color: #1C1917; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn:hover { | ||
| background: rgba(0, 0, 0, 0.04); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn:active { | ||
| background: rgba(0, 0, 0, 0.08); | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 FOCUS \u2500\u2500\u2500 */ | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${r}); | ||
| outline-offset: 2px; | ||
| } | ||
| /* \u2500\u2500\u2500 ICON \u2500\u2500\u2500 */ | ||
| .cb-btn-icon { | ||
| width: var(--cb-icon-size); | ||
| height: var(--cb-icon-size); | ||
| flex-shrink: 0; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
| .cb-btn-icon svg { width: 100%; height: 100%; } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn-icon, | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn-icon { | ||
| color: #FFFFFF; | ||
| --cb-icon-accent: rgba(255,255,255,0.2); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| --cb-icon-accent: #1C1917; | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| --cb-icon-accent: #FFFFFF; | ||
| } | ||
| :host([data-variant="outline"]) .cb-btn-icon, | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| } | ||
| /* \u2500\u2500\u2500 LABEL \u2500\u2500\u2500 */ | ||
| .cb-btn-label { | ||
| letter-spacing: -0.01em; | ||
| } | ||
| `,l=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(e){this._options={...this._options,...e},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let e=this.getAttribute("command"),a=this.getAttribute("skill-url"),t=this.getAttribute("theme"),o=this.getAttribute("size"),i=this.getAttribute("variant"),s=this.getAttribute("shape"),n=this.getAttribute("popup"),c=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),h=this.getAttribute("auto-launch");e!==null&&(this._options.command=e),a!==null&&(this._options.skillUrl=a),t&&(this._options.theme=t),o&&(this._options.size=o),i&&(this._options.variant=i),s&&(this._options.shape=s),n!==null&&(this._options.popup=n!=="false"),c!==null&&(this._options.popupTitle=c),b!==null&&(this._options.popupDescription=b),h===null?delete this._options.autoLaunch:this._options.autoLaunch=h!=="false"}updateLightDOM(){let{command:e,skillUrl:a}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${e}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let t=this.querySelector("a[data-cb-crawl]");t||(t=document.createElement("a"),t.setAttribute("data-cb-crawl",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(t)),t.textContent=`Run on Cowork: ${e}`,t.setAttribute("data-platform","cowork"),t.setAttribute("data-command",e),a?(t.href=a,t.setAttribute("data-skill-url",a)):(t.href=`https://claude.ai/cowork?command=${encodeURIComponent(e)}`,t.removeAttribute("data-skill-url"))}getResolvedTheme(){return this._options.theme||"branded"}render(){if(!this.shadowRoot)return;let e=this.getResolvedTheme(),a=e==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,t=this._options.variant||"filled",o=w(e),i=this._options.size||"md",s=this._options.shape||"rounded",n=_[i],c=x[s][i];this.setAttribute("data-theme",a),this.setAttribute("data-variant",t);let b=t!=="filled"?"transparent":o.bg,h=t==="ghost"?"transparent":t==="outline"?o.primary:o.border,A=t!=="filled"?o.primary:o.text;this.shadowRoot.innerHTML=` | ||
| <style>${E}</style> | ||
| <button | ||
| class="cb-btn" | ||
| type="button" | ||
| style=" | ||
| ${C(o)} | ||
| --cb-bg: ${b}; | ||
| --cb-border: ${h}; | ||
| --cb-text: ${A}; | ||
| --cb-accent-color: ${o.primary}; | ||
| --cb-focus-color: ${o.primary}; | ||
| --cb-height: ${n.height}; | ||
| --cb-font-size: ${n.fontSize}; | ||
| --cb-icon-size: ${n.iconSize}; | ||
| --cb-padding: ${n.padding}; | ||
| --cb-gap: ${n.gap}; | ||
| --cb-radius: ${c}; | ||
| " | ||
| aria-label="Run on Cowork: ${this._options.command.replace(/"/g,""")}" | ||
| > | ||
| <span class="cb-btn-icon" aria-hidden="true">${g}</span> | ||
| <span class="cb-btn-label">Run on Cowork</span> | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:e,command:a,skillUrl:t,popupTitle:o,popupDescription:i,autoLaunch:s}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:a}})),e===!1){navigator.clipboard.writeText(a).then(()=>{this._options.onCopy?.(a),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:a}}))});return}y({variant:"cowork",theme:this.getResolvedTheme(),title:o||"Run on Cowork",description:i||"Copy and paste into a Cowork session to get started.",command:a,skillUrl:t,autoLaunch:s===!0,onCopy:n=>{this._options.onCopy?.(n),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:n}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}};l.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function O(d="cowork-button"){typeof customElements>"u"||customElements.get(d)||customElements.define(d,l)}O();function L(d){let p=document.createElement("cowork-button");return p.options=d,p}export{l as CoworkButton,L as createCoworkButton,O as registerCoworkButton}; | ||
| //# sourceMappingURL=cowork-button-JYKHXQT3.mjs.map |
| {"version":3,"sources":["../src/cowork-button.ts"],"sourcesContent":["import type { CoworkButtonOptions, Theme, Size, Variant, Shape } from './types';\nimport { COWORK_ICON } from './icons';\nimport { resolveTheme, themeToCSS, SIZE_MAP, SHAPE_MAP, BRAND_COLOR, BRAND_COLOR_HOVER, BRAND_COLOR_ACTIVE, BRAND_COLOR_ON_DARK } from './themes';\nimport { showPopup } from './popup-dialog';\n\nconst BUTTON_STYLES = `\n :host {\n display: inline-block;\n vertical-align: middle;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-tap-highlight-color: transparent;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .cb-btn {\n display: inline-flex;\n align-items: center;\n gap: var(--cb-gap);\n height: var(--cb-height);\n min-height: 44px;\n padding: var(--cb-padding);\n border: 1.5px solid var(--cb-border);\n background: var(--cb-bg);\n color: var(--cb-text);\n font-family: inherit;\n font-size: var(--cb-font-size);\n font-weight: 600;\n line-height: 1;\n border-radius: var(--cb-radius);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n touch-action: manipulation;\n transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n }\n\n @media (pointer: fine) {\n .cb-btn { min-height: unset; }\n }\n\n /* ─── FILLED ─── */\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: ${BRAND_COLOR_HOVER};\n box-shadow: 0 2px 8px rgba(212, 121, 92, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn:active {\n background: ${BRAND_COLOR_ACTIVE};\n transform: scale(0.98);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: #5A4BD6;\n box-shadow: 0 2px 8px rgba(107, 92, 231, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: #4F41C8;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn:hover {\n background: #292524;\n border-color: #57534E;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn:active {\n background: #1C1917;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn:hover {\n border-color: #D6D3D1;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn:active {\n background: #FAFAF9;\n transform: scale(0.98);\n }\n\n /* ─── OUTLINE ─── */\n\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn {\n background: transparent;\n border-color: ${BRAND_COLOR};\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: rgba(212, 121, 92, 0.08);\n box-shadow: 0 2px 8px rgba(212, 121, 92, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn {\n background: transparent;\n border-color: #6B5CE7;\n color: #6B5CE7;\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: rgba(107, 92, 231, 0.08);\n box-shadow: 0 2px 8px rgba(107, 92, 231, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: rgba(107, 92, 231, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn {\n background: transparent;\n border-color: #57534E;\n color: #F5F0EB;\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(212, 121, 92, 0.08);\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn {\n background: transparent;\n border-color: #D6D3D1;\n color: #1C1917;\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(212, 121, 92, 0.05);\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.1);\n transform: scale(0.98);\n }\n\n /* ─── GHOST ─── */\n\n :host([data-variant=\"ghost\"]) .cb-btn {\n background: transparent;\n border-color: transparent;\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn {\n color: ${BRAND_COLOR_ON_DARK};\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: rgba(212, 121, 92, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn {\n color: #6B5CE7;\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: rgba(107, 92, 231, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: rgba(107, 92, 231, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn {\n color: #F5F0EB;\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn:hover {\n background: rgba(255, 255, 255, 0.06);\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn:active {\n background: rgba(255, 255, 255, 0.1);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn {\n color: #1C1917;\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn:active {\n background: rgba(0, 0, 0, 0.08);\n transform: scale(0.98);\n }\n\n /* ─── FOCUS ─── */\n\n .cb-btn:focus-visible {\n outline: 2px solid var(--cb-focus-color, ${BRAND_COLOR});\n outline-offset: 2px;\n }\n\n /* ─── ICON ─── */\n\n .cb-btn-icon {\n width: var(--cb-icon-size);\n height: var(--cb-icon-size);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .cb-btn-icon svg { width: 100%; height: 100%; }\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn-icon,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn-icon {\n color: #FFFFFF;\n --cb-icon-accent: rgba(255,255,255,0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n --cb-icon-accent: #1C1917;\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n --cb-icon-accent: #FFFFFF;\n }\n\n :host([data-variant=\"outline\"]) .cb-btn-icon,\n :host([data-variant=\"ghost\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n }\n\n /* ─── LABEL ─── */\n\n .cb-btn-label {\n letter-spacing: -0.01em;\n }\n`;\n\nexport class CoworkButton extends HTMLElement {\n static observedAttributes = ['command', 'skill-url', 'theme', 'size', 'variant', 'shape', 'popup', 'popup-title', 'popup-description', 'auto-launch'];\n\n private _options: CoworkButtonOptions = {\n command: '',\n theme: 'branded',\n size: 'md',\n variant: 'filled',\n popup: true,\n };\n\n private _mqCleanup: (() => void) | null = null;\n private _rendered = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n attributeChangedCallback() {\n if (!this._rendered) return;\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n set options(opts: Partial<CoworkButtonOptions>) {\n this._options = { ...this._options, ...opts };\n this.render();\n this.updateLightDOM();\n }\n\n get options() {\n return this._options;\n }\n\n private syncFromAttributes() {\n const command = this.getAttribute('command');\n const skillUrl = this.getAttribute('skill-url');\n const theme = this.getAttribute('theme') as Theme | null;\n const size = this.getAttribute('size') as Size | null;\n const variant = this.getAttribute('variant') as Variant | null;\n const shape = this.getAttribute('shape') as Shape | null;\n const popup = this.getAttribute('popup');\n const popupTitle = this.getAttribute('popup-title');\n const popupDescription = this.getAttribute('popup-description');\n const autoLaunch = this.getAttribute('auto-launch');\n\n if (command !== null) this._options.command = command;\n if (skillUrl !== null) this._options.skillUrl = skillUrl;\n if (theme) this._options.theme = theme;\n if (size) this._options.size = size;\n if (variant) this._options.variant = variant;\n if (shape) this._options.shape = shape;\n if (popup !== null) this._options.popup = popup !== 'false';\n if (popupTitle !== null) this._options.popupTitle = popupTitle;\n if (popupDescription !== null) this._options.popupDescription = popupDescription;\n if (autoLaunch === null) {\n delete this._options.autoLaunch;\n } else {\n this._options.autoLaunch = autoLaunch !== 'false';\n }\n }\n\n private updateLightDOM() {\n const { command, skillUrl } = this._options;\n\n this.setAttribute('role', 'button');\n this.setAttribute('tabindex', '0');\n this.setAttribute('aria-label', `Run on Cowork: ${command}`);\n if (this._options.popup !== false) {\n this.setAttribute('aria-haspopup', 'dialog');\n } else {\n this.removeAttribute('aria-haspopup');\n }\n\n let link = this.querySelector('a[data-cb-crawl]') as HTMLAnchorElement | null;\n if (!link) {\n link = document.createElement('a');\n link.setAttribute('data-cb-crawl', '');\n link.setAttribute('aria-hidden', 'true');\n link.style.cssText = 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;';\n this.appendChild(link);\n }\n link.textContent = `Run on Cowork: ${command}`;\n link.setAttribute('data-platform', 'cowork');\n link.setAttribute('data-command', command);\n if (skillUrl) {\n link.href = skillUrl;\n link.setAttribute('data-skill-url', skillUrl);\n } else {\n link.href = `https://claude.ai/cowork?command=${encodeURIComponent(command)}`;\n link.removeAttribute('data-skill-url');\n }\n }\n\n private getResolvedTheme(): Theme {\n return this._options.theme || 'branded';\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const theme = this.getResolvedTheme();\n const resolvedTheme = theme === 'system' ? (\n typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n ) : theme;\n const variant = this._options.variant || 'filled';\n\n const tokens = resolveTheme(theme);\n const size = this._options.size || 'md';\n const shape = this._options.shape || 'rounded';\n const sizeTokens = SIZE_MAP[size];\n const radius = SHAPE_MAP[shape][size];\n\n this.setAttribute('data-theme', resolvedTheme);\n this.setAttribute('data-variant', variant);\n\n const bgOverride = variant !== 'filled' ? 'transparent' : tokens.bg;\n const borderOverride = variant === 'ghost' ? 'transparent' :\n variant === 'outline' ? tokens.primary : tokens.border;\n const textOverride = variant !== 'filled' ? tokens.primary : tokens.text;\n\n this.shadowRoot.innerHTML = `\n <style>${BUTTON_STYLES}</style>\n <button\n class=\"cb-btn\"\n type=\"button\"\n style=\"\n ${themeToCSS(tokens)}\n --cb-bg: ${bgOverride};\n --cb-border: ${borderOverride};\n --cb-text: ${textOverride};\n --cb-accent-color: ${tokens.primary};\n --cb-focus-color: ${tokens.primary};\n --cb-height: ${sizeTokens.height};\n --cb-font-size: ${sizeTokens.fontSize};\n --cb-icon-size: ${sizeTokens.iconSize};\n --cb-padding: ${sizeTokens.padding};\n --cb-gap: ${sizeTokens.gap};\n --cb-radius: ${radius};\n \"\n aria-label=\"Run on Cowork: ${this._options.command.replace(/\"/g, '"')}\"\n >\n <span class=\"cb-btn-icon\" aria-hidden=\"true\">${COWORK_ICON}</span>\n <span class=\"cb-btn-label\">Run on Cowork</span>\n </button>\n `;\n\n const btn = this.shadowRoot.querySelector('.cb-btn')!;\n btn.addEventListener('click', () => this.handleClick());\n btn.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Enter' || (e as KeyboardEvent).key === ' ') {\n e.preventDefault();\n this.handleClick();\n }\n });\n this._rendered = true;\n this.setupSystemThemeWatch();\n }\n\n private handleClick() {\n const { popup, command, skillUrl, popupTitle, popupDescription, autoLaunch } = this._options;\n\n this.dispatchEvent(new CustomEvent('cb-open', {\n bubbles: true,\n composed: true,\n detail: { command },\n }));\n\n if (popup === false) {\n navigator.clipboard.writeText(command).then(() => {\n this._options.onCopy?.(command);\n this.dispatchEvent(new CustomEvent('cb-copy', {\n bubbles: true,\n composed: true,\n detail: { command },\n }));\n });\n return;\n }\n\n showPopup({\n variant: 'cowork',\n theme: this.getResolvedTheme(),\n title: popupTitle || 'Run on Cowork',\n description: popupDescription || 'Copy and paste into a Cowork session to get started.',\n command,\n skillUrl,\n autoLaunch: autoLaunch === true,\n onCopy: (cmd) => {\n this._options.onCopy?.(cmd);\n this.dispatchEvent(new CustomEvent('cb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: cmd },\n }));\n },\n onClose: () => {\n this.dispatchEvent(new CustomEvent('cb-close', {\n bubbles: true,\n composed: true,\n }));\n },\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n if (this.getResolvedTheme() !== 'system' || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n}\n\nexport function registerCoworkButton(tagName = 'cowork-button') {\n if (typeof customElements === 'undefined') return;\n if (!customElements.get(tagName)) {\n customElements.define(tagName, CoworkButton);\n }\n}\n\nregisterCoworkButton();\n\nexport function createCoworkButton(options: CoworkButtonOptions): CoworkButton {\n const el = document.createElement('cowork-button') as CoworkButton;\n el.options = options;\n return el;\n}\n"],"mappings":"wGAKA,IAAMA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBA6CJC,CAAiB;AAAA;AAAA;AAAA;AAAA,kBAIjBC,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAyChBC,CAAW;AAAA,aAClBA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBA+BJA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAcXA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;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zB,CAAC,CAAC,CACJ,EACA,QAAS,IAAM,CACb,KAAK,cAAc,IAAI,YAAY,WAAY,CAC7C,QAAS,GACT,SAAU,EACZ,CAAC,CAAC,CACJ,CACF,CAAC,CACH,CAEQ,uBAAwB,CAI9B,GAHA,KAAK,aAAa,EAClB,KAAK,WAAa,KAEd,KAAK,iBAAiB,IAAM,UAAY,OAAO,OAAW,IAAa,OAE3E,IAAMC,EAAK,OAAO,WAAW,8BAA8B,EACrDC,EAAU,IAAM,KAAK,OAAO,EAClCD,EAAG,iBAAiB,SAAUC,CAAO,EACrC,KAAK,WAAa,IAAMD,EAAG,oBAAoB,SAAUC,CAAO,CAClE,CACF,EArOa9B,EACJ,mBAAqB,CAAC,UAAW,YAAa,QAAS,OAAQ,UAAW,QAAS,QAAS,cAAe,oBAAqB,aAAa,EAsO/I,SAAS+B,EAAqBC,EAAU,gBAAiB,CAC1D,OAAO,eAAmB,KACzB,eAAe,IAAIA,CAAO,GAC7B,eAAe,OAAOA,EAAShC,CAAY,CAE/C,CAEA+B,EAAqB,EAEd,SAASE,EAAmBC,EAA4C,CAC7E,IAAMC,EAAK,SAAS,cAAc,eAAe,EACjD,OAAAA,EAAG,QAAUD,EACNC,CACT","names":["BUTTON_STYLES","BRAND_COLOR_HOVER","BRAND_COLOR_ACTIVE","BRAND_COLOR","BRAND_COLOR_ON_DARK","CoworkButton","opts","command","skillUrl","theme","size","variant","shape","popup","popupTitle","popupDescription","autoLaunch","link","resolvedTheme","tokens","resolveTheme","sizeTokens","SIZE_MAP","radius","SHAPE_MAP","bgOverride","borderOverride","textOverride","themeToCSS","COWORK_ICON","btn","e","showPopup","cmd","mq","handler","registerCoworkButton","tagName","createCoworkButton","options","el"]} |
+3
-1
@@ -175,2 +175,4 @@ type Theme = 'branded' | 'branded-alt' | 'dark' | 'light' | 'system'; | ||
| declare const BRAND_COLOR = "#D4795C"; | ||
| /** Slightly lighter for ghost/outline text on dark page backgrounds */ | ||
| declare const BRAND_COLOR_ON_DARK = "#F0B8A8"; | ||
| declare const themes: Record<Exclude<Theme, 'system'>, ThemeTokens>; | ||
@@ -280,2 +282,2 @@ declare function resolveTheme(theme: Theme): ThemeTokens; | ||
| export { ALT_BRAND_COLOR, BRAND_COLOR, type ButtonMetadata, CLAUDE_CODE_ICON, COWORK_ICON, ClaudeCodeButton, type ClaudeCodeButtonOptions, ClaudePopupDialog, CoworkButton, type CoworkButtonOptions, type PopupOptions, type Shape, type Size, type Theme, type ThemeTokens, type Variant, createClaudeCodeButton, createCoworkButton, discoverButtons, generateStructuredData, injectStructuredData, isDesktopAppLinkSupported, isMobileOrTabletDevice, isRestrictedEmbeddedBrowser, register, registerClaudeCodeButton, registerCoworkButton, resolveTheme, showPopup, themes }; | ||
| export { ALT_BRAND_COLOR, BRAND_COLOR, BRAND_COLOR_ON_DARK, type ButtonMetadata, CLAUDE_CODE_ICON, COWORK_ICON, ClaudeCodeButton, type ClaudeCodeButtonOptions, ClaudePopupDialog, CoworkButton, type CoworkButtonOptions, type PopupOptions, type Shape, type Size, type Theme, type ThemeTokens, type Variant, createClaudeCodeButton, createCoworkButton, discoverButtons, generateStructuredData, injectStructuredData, isDesktopAppLinkSupported, isMobileOrTabletDevice, isRestrictedEmbeddedBrowser, register, registerClaudeCodeButton, registerCoworkButton, resolveTheme, showPopup, themes }; |
+3
-1
@@ -175,2 +175,4 @@ type Theme = 'branded' | 'branded-alt' | 'dark' | 'light' | 'system'; | ||
| declare const BRAND_COLOR = "#D4795C"; | ||
| /** Slightly lighter for ghost/outline text on dark page backgrounds */ | ||
| declare const BRAND_COLOR_ON_DARK = "#F0B8A8"; | ||
| declare const themes: Record<Exclude<Theme, 'system'>, ThemeTokens>; | ||
@@ -280,2 +282,2 @@ declare function resolveTheme(theme: Theme): ThemeTokens; | ||
| export { ALT_BRAND_COLOR, BRAND_COLOR, type ButtonMetadata, CLAUDE_CODE_ICON, COWORK_ICON, ClaudeCodeButton, type ClaudeCodeButtonOptions, ClaudePopupDialog, CoworkButton, type CoworkButtonOptions, type PopupOptions, type Shape, type Size, type Theme, type ThemeTokens, type Variant, createClaudeCodeButton, createCoworkButton, discoverButtons, generateStructuredData, injectStructuredData, isDesktopAppLinkSupported, isMobileOrTabletDevice, isRestrictedEmbeddedBrowser, register, registerClaudeCodeButton, registerCoworkButton, resolveTheme, showPopup, themes }; | ||
| export { ALT_BRAND_COLOR, BRAND_COLOR, BRAND_COLOR_ON_DARK, type ButtonMetadata, CLAUDE_CODE_ICON, COWORK_ICON, ClaudeCodeButton, type ClaudeCodeButtonOptions, ClaudePopupDialog, CoworkButton, type CoworkButtonOptions, type PopupOptions, type Shape, type Size, type Theme, type ThemeTokens, type Variant, createClaudeCodeButton, createCoworkButton, discoverButtons, generateStructuredData, injectStructuredData, isDesktopAppLinkSupported, isMobileOrTabletDevice, isRestrictedEmbeddedBrowser, register, registerClaudeCodeButton, registerCoworkButton, resolveTheme, showPopup, themes }; |
+26
-26
@@ -1,2 +0,2 @@ | ||
| "use strict";var ClaudeButtons=(()=>{var S=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var Z=(a,n)=>{for(var t in n)S(a,t,{get:n[t],enumerable:!0})},G=(a,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of K(n))!Y.call(a,e)&&e!==t&&S(a,e,{get:()=>n[e],enumerable:!(o=W(n,e))||o.enumerable});return a};var J=a=>G(S({},"__esModule",{value:!0}),a);var at={};Z(at,{ALT_BRAND_COLOR:()=>q,BRAND_COLOR:()=>i,CLAUDE_CODE_ICON:()=>f,COWORK_ICON:()=>x,ClaudeCodeButton:()=>w,ClaudePopupDialog:()=>_,CoworkButton:()=>A,createClaudeCodeButton:()=>U,createCoworkButton:()=>j,discoverButtons:()=>M,generateStructuredData:()=>z,injectStructuredData:()=>V,isDesktopAppLinkSupported:()=>O,isMobileOrTabletDevice:()=>I,isRestrictedEmbeddedBrowser:()=>R,register:()=>ot,registerClaudeCodeButton:()=>F,registerCoworkButton:()=>T,resolveTheme:()=>l,showPopup:()=>y,themes:()=>k});function R(){if(typeof navigator>"u")return!0;let a=navigator.userAgent||"";return!!(!a.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(a)||/Twitter for (iPhone|Android)/i.test(a)||/; wv\)/.test(a)||/Opera Mini|OPiOS/i.test(a))}function I(){if(typeof navigator>"u")return!1;let a=navigator.userAgent||"",n=typeof navigator.maxTouchPoints=="number"?navigator.maxTouchPoints:0,t=navigator.platform||"";return!!(/iPhone|iPod/i.test(a)||/iPad/i.test(a)||/Android/i.test(a)&&/Mobile/i.test(a)||/Android/i.test(a)&&!/Mobile/i.test(a)||(t==="MacIntel"||t==="MacARM")&&n>1||/webOS|BlackBerry|IEMobile|Opera Mini/i.test(a))}function Q(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function O(){return!(!Q()||R())}var f=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| "use strict";var ClaudeButtons=(()=>{var S=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.prototype.hasOwnProperty;var G=(a,n)=>{for(var t in n)S(a,t,{get:n[t],enumerable:!0})},J=(a,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of Y(n))!Z.call(a,e)&&e!==t&&S(a,e,{get:()=>n[e],enumerable:!(o=W(n,e))||o.enumerable});return a};var Q=a=>J(S({},"__esModule",{value:!0}),a);var rt={};G(rt,{ALT_BRAND_COLOR:()=>U,BRAND_COLOR:()=>i,BRAND_COLOR_ON_DARK:()=>C,CLAUDE_CODE_ICON:()=>f,COWORK_ICON:()=>x,ClaudeCodeButton:()=>A,ClaudePopupDialog:()=>F,CoworkButton:()=>_,createClaudeCodeButton:()=>j,createCoworkButton:()=>V,discoverButtons:()=>z,generateStructuredData:()=>P,injectStructuredData:()=>K,isDesktopAppLinkSupported:()=>L,isMobileOrTabletDevice:()=>I,isRestrictedEmbeddedBrowser:()=>D,register:()=>at,registerClaudeCodeButton:()=>O,registerCoworkButton:()=>T,resolveTheme:()=>l,showPopup:()=>w,themes:()=>k});function D(){if(typeof navigator>"u")return!0;let a=navigator.userAgent||"";return!!(!a.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(a)||/Twitter for (iPhone|Android)/i.test(a)||/; wv\)/.test(a)||/Opera Mini|OPiOS/i.test(a))}function I(){if(typeof navigator>"u")return!1;let a=navigator.userAgent||"",n=typeof navigator.maxTouchPoints=="number"?navigator.maxTouchPoints:0,t=navigator.platform||"";return!!(/iPhone|iPod/i.test(a)||/iPad/i.test(a)||/Android/i.test(a)&&/Mobile/i.test(a)||/Android/i.test(a)&&!/Mobile/i.test(a)||(t==="MacIntel"||t==="MacARM")&&n>1||/webOS|BlackBerry|IEMobile|Opera Mini/i.test(a))}function X(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function L(){return!(!X()||D())}var f=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Ears --> | ||
@@ -30,5 +30,5 @@ <rect x="3.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
| </svg>`;var N=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`;var q=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`;var D=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| </svg>`;var M=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| <rect x="4" y="5" width="16" height="11" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/> | ||
@@ -40,3 +40,3 @@ <path d="M4 8.5h16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| <path d="M8 16.5h8v3H8v-3z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/> | ||
| </svg>`;var i="#D4795C",g="#C06A4E",L="#B35E43",k={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:i,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:i,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:i,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function l(a){return a!=="system"?k[a]:typeof window>"u"?k.light:window.matchMedia("(prefers-color-scheme: dark)").matches?k.dark:k.light}function C(a){return` | ||
| </svg>`;var i="#D4795C",g="#C06A4E",$="#B35E43",C="#F0B8A8",k={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:i,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:i,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:i,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function l(a){return a!=="system"?k[a]:typeof window>"u"?k.light:window.matchMedia("(prefers-color-scheme: dark)").matches?k.dark:k.light}function y(a){return` | ||
| --cb-bg: ${a.bg}; | ||
@@ -52,3 +52,3 @@ --cb-text: ${a.text}; | ||
| --cb-code-text: ${a.codeText}; | ||
| `}var q="#6B5CE7",$={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},B={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 X=` | ||
| `}var U="#6B5CE7",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"}},R={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 tt=` | ||
| :host { | ||
@@ -412,5 +412,5 @@ position: fixed; | ||
| } | ||
| `,_=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(t){this._autoLaunchConsumed=!1,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 l(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?l("dark"):l("light");let e=o?l("dark"):l("light"),r=l(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:s,skillUrl:d,desktopLaunchUrl:c,autoLaunch:p}=this._options,b=this.resolvePopupTokens(),u=t==="claude-code"?f:x,v=t==="claude-code",m=s||r,h=c??"claude://",P=O();this.shadowRoot.innerHTML=` | ||
| <style>${X}</style> | ||
| <div style="${C(b)}"> | ||
| `,F=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(t){this._autoLaunchConsumed=!1,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 l(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?l("dark"):l("light");let e=o?l("dark"):l("light"),r=l(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:s,skillUrl:d,desktopLaunchUrl:c,autoLaunch:p}=this._options,b=this.resolvePopupTokens(),u=t==="claude-code"?f:x,v=t==="claude-code",m=s||r,h=c??"claude://",N=L();this.shadowRoot.innerHTML=` | ||
| <style>${tt}</style> | ||
| <div style="${y(b)}"> | ||
| <div class="cb-backdrop" data-action="close"></div> | ||
@@ -424,3 +424,3 @@ <div class="cb-dialog" role="dialog" aria-modal="true" aria-labelledby="cb-dialog-title"> | ||
| </div> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${N}</button> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${q}</button> | ||
| </div> | ||
@@ -431,7 +431,7 @@ <div class="cb-dialog-body"> | ||
| <div class="cb-dialog-footer"> | ||
| ${v?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(h),P)} | ||
| ${v?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(h),N)} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),p&&!this._autoLaunchConsumed&&t==="cowork"&&P&&(this._autoLaunchConsumed=!0,this.openDesktopAppLink(h))}openDesktopAppLink(t){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:!0,composed:!0,detail:{href:t}})),typeof document>"u")return;let o=document.createElement("a");o.href=t,o.rel="noopener noreferrer",o.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>o.remove())}renderClaudeCodeBody(t){return` | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),p&&!this._autoLaunchConsumed&&t==="cowork"&&N&&(this._autoLaunchConsumed=!0,this.openDesktopAppLink(h))}openDesktopAppLink(t){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:!0,composed:!0,detail:{href:t}})),typeof document>"u")return;let o=document.createElement("a");o.href=t,o.rel="noopener noreferrer",o.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>o.remove())}renderClaudeCodeBody(t){return` | ||
| <div class="cb-step"> | ||
@@ -495,3 +495,3 @@ <div class="cb-step-num">1</div> | ||
| > | ||
| ${D} | ||
| ${M} | ||
| <span>Open Claude Desktop</span> | ||
@@ -507,3 +507,3 @@ </a>`:` | ||
| > | ||
| ${D} | ||
| ${M} | ||
| <span>Open Claude Desktop</span> | ||
@@ -515,3 +515,3 @@ </button>`} | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div> | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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)}else if(e==="launch-desktop"){t.preventDefault();let r=o.getAttribute("href")||"";this.openDesktopAppLink(r||o.href)}}),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,s=r.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${H}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${E}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",_);function y(a){let n=document.createElement("claude-popup-dialog");return n.options=a,document.body.appendChild(n),n}var tt=` | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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)}else if(e==="launch-desktop"){t.preventDefault();let r=o.getAttribute("href")||"";this.openDesktopAppLink(r||o.href)}}),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,s=r.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${H}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${E}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",F);function w(a){let n=document.createElement("claude-popup-dialog");return n.options=a,document.body.appendChild(n),n}var et=` | ||
| :host { | ||
@@ -565,3 +565,3 @@ display: inline-block; | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${L}; | ||
| background: ${$}; | ||
| transform: scale(0.98); | ||
@@ -669,3 +669,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${i}; | ||
| color: ${C}; | ||
| } | ||
@@ -755,4 +755,4 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| } | ||
| `,w=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"),s=this.getAttribute("shape"),d=this.getAttribute("popup"),c=this.getAttribute("prompt-flag"),p=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),s&&(this._options.shape=s),d!==null&&(this._options.popup=d!=="false"),c!==null&&(this._options.promptFlag=c!=="false"),p!==null&&(this._options.popupTitle=p),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 Claude Code: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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:`claude -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=l(t),s=this._options.size||"md",d=this._options.shape||"rounded",c=B[s],p=$[d][s];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${tt}</style> | ||
| `,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"),s=this.getAttribute("shape"),d=this.getAttribute("popup"),c=this.getAttribute("prompt-flag"),p=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),s&&(this._options.shape=s),d!==null&&(this._options.popup=d!=="false"),c!==null&&(this._options.promptFlag=c!=="false"),p!==null&&(this._options.popupTitle=p),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 Claude Code: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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:`claude -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=l(t),s=this._options.size||"md",d=this._options.shape||"rounded",c=R[s],p=B[d][s];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${et}</style> | ||
| <button | ||
@@ -762,3 +762,3 @@ class="cb-btn" | ||
| style=" | ||
| ${C(r)} | ||
| ${y(r)} | ||
| --cb-bg: ${b}; | ||
@@ -781,3 +781,3 @@ --cb-border: ${u}; | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,s=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:s}})),t===!1){navigator.clipboard.writeText(s).then(()=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))});return}y({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:r||"Execute this command in your terminal to get started.",command:o,fullCommand:s,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:d}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};w.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function F(a="claude-code-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,w)}F();function U(a){let n=document.createElement("claude-code-button");return n.options=a,n}var et=` | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,s=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:s}})),t===!1){navigator.clipboard.writeText(s).then(()=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))});return}w({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:r||"Execute this command in your terminal to get started.",command:o,fullCommand:s,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:d}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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 O(a="claude-code-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,A)}O();function j(a){let n=document.createElement("claude-code-button");return n.options=a,n}var ot=` | ||
| :host { | ||
@@ -831,3 +831,3 @@ display: inline-block; | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${L}; | ||
| background: ${$}; | ||
| transform: scale(0.98); | ||
@@ -935,3 +935,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${i}; | ||
| color: ${C}; | ||
| } | ||
@@ -1023,4 +1023,4 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| } | ||
| `,A=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"),s=this.getAttribute("variant"),d=this.getAttribute("shape"),c=this.getAttribute("popup"),p=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),s&&(this._options.variant=s),d&&(this._options.shape=d),c!==null&&(this._options.popup=c!=="false"),p!==null&&(this._options.popupTitle=p),b!==null&&(this._options.popupDescription=b),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false"}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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=l(t),s=this._options.size||"md",d=this._options.shape||"rounded",c=B[s],p=$[d][s];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${et}</style> | ||
| `,_=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"),s=this.getAttribute("variant"),d=this.getAttribute("shape"),c=this.getAttribute("popup"),p=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),s&&(this._options.variant=s),d&&(this._options.shape=d),c!==null&&(this._options.popup=c!=="false"),p!==null&&(this._options.popupTitle=p),b!==null&&(this._options.popupDescription=b),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false"}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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=l(t),s=this._options.size||"md",d=this._options.shape||"rounded",c=R[s],p=B[d][s];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${ot}</style> | ||
| <button | ||
@@ -1030,3 +1030,3 @@ class="cb-btn" | ||
| style=" | ||
| ${C(r)} | ||
| ${y(r)} | ||
| --cb-bg: ${b}; | ||
@@ -1049,3 +1049,3 @@ --cb-border: ${u}; | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:s,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}y({variant:"cowork",theme:this.getResolvedTheme(),title:r||"Run on Cowork",description:s||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===!0,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:c}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function T(a="cowork-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,A)}T();function j(a){let n=document.createElement("cowork-button");return n.options=a,n}function M(){if(typeof document>"u")return[];let a=[];return document.querySelectorAll("claude-code-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`claude -p "${t}"`:t;a.push({platform:"claude-code",command:t,fullCommand:r})}),document.querySelectorAll("cowork-button").forEach(n=>{let t=n.getAttribute("command")||"",o=n.getAttribute("skill-url")||void 0;a.push({platform:"cowork",command:t,...o&&{skillUrl:o}})}),a}function z(){let a=M();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="claude-code")return{"@type":"Action",name:`Run on Claude Code: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://claude.ai/code?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://claude.ai/code"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Claude Code",text:t.fullCommand||t.command}};let o={"@type":"EntryPoint",actionPlatform:"https://claude.ai/cowork"};t.skillUrl?o.urlTemplate=t.skillUrl:o.urlTemplate=`https://claude.ai/cowork?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Cowork: ${t.command}`,description:t.command,target:o};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Claude Cowork"}),e})}}function V(){if(typeof document>"u")return;let a=document.querySelector("script[data-claudebuttons-jsonld]");a&&a.remove();let n=z();if(!n||!("potentialAction"in n))return;let t=document.createElement("script");t.type="application/ld+json",t.setAttribute("data-claudebuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t)}function ot(){F(),T()}return J(at);})(); | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:s,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}w({variant:"cowork",theme:this.getResolvedTheme(),title:r||"Run on Cowork",description:s||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===!0,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:c}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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","auto-launch"];function T(a="cowork-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,_)}T();function V(a){let n=document.createElement("cowork-button");return n.options=a,n}function z(){if(typeof document>"u")return[];let a=[];return document.querySelectorAll("claude-code-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`claude -p "${t}"`:t;a.push({platform:"claude-code",command:t,fullCommand:r})}),document.querySelectorAll("cowork-button").forEach(n=>{let t=n.getAttribute("command")||"",o=n.getAttribute("skill-url")||void 0;a.push({platform:"cowork",command:t,...o&&{skillUrl:o}})}),a}function P(){let a=z();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="claude-code")return{"@type":"Action",name:`Run on Claude Code: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://claude.ai/code?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://claude.ai/code"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Claude Code",text:t.fullCommand||t.command}};let o={"@type":"EntryPoint",actionPlatform:"https://claude.ai/cowork"};t.skillUrl?o.urlTemplate=t.skillUrl:o.urlTemplate=`https://claude.ai/cowork?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Cowork: ${t.command}`,description:t.command,target:o};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Claude Cowork"}),e})}}function K(){if(typeof document>"u")return;let a=document.querySelector("script[data-claudebuttons-jsonld]");a&&a.remove();let n=P();if(!n||!("potentialAction"in n))return;let t=document.createElement("script");t.type="application/ld+json",t.setAttribute("data-claudebuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t)}function at(){O(),T()}return Q(rt);})(); | ||
| //# sourceMappingURL=index.global.js.map |
+37
-37
@@ -1,2 +0,2 @@ | ||
| 'use strict';function D(){if(typeof navigator>"u")return true;let a=navigator.userAgent||"";return !!(!a.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(a)||/Twitter for (iPhone|Android)/i.test(a)||/; wv\)/.test(a)||/Opera Mini|OPiOS/i.test(a))}function H(){if(typeof navigator>"u")return false;let a=navigator.userAgent||"",n=typeof navigator.maxTouchPoints=="number"?navigator.maxTouchPoints:0,t=navigator.platform||"";return !!(/iPhone|iPod/i.test(a)||/iPad/i.test(a)||/Android/i.test(a)&&/Mobile/i.test(a)||/Android/i.test(a)&&!/Mobile/i.test(a)||(t==="MacIntel"||t==="MacARM")&&n>1||/webOS|BlackBerry|IEMobile|Opera Mini/i.test(a))}function N(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function B(){return !(!N()||D())}var x=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| 'use strict';function M(){if(typeof navigator>"u")return true;let a=navigator.userAgent||"";return !!(!a.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(a)||/Twitter for (iPhone|Android)/i.test(a)||/; wv\)/.test(a)||/Opera Mini|OPiOS/i.test(a))}function H(){if(typeof navigator>"u")return false;let a=navigator.userAgent||"",n=typeof navigator.maxTouchPoints=="number"?navigator.maxTouchPoints:0,t=navigator.platform||"";return !!(/iPhone|iPod/i.test(a)||/iPad/i.test(a)||/Android/i.test(a)&&/Mobile/i.test(a)||/Android/i.test(a)&&!/Mobile/i.test(a)||(t==="MacIntel"||t==="MacARM")&&n>1||/webOS|BlackBerry|IEMobile|Opera Mini/i.test(a))}function q(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function R(){return !(!q()||M())}var x=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Ears --> | ||
@@ -28,5 +28,5 @@ <rect x="3.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`,M=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`,z=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
| </svg>`;var z=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`;var P=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
@@ -40,3 +40,3 @@ </svg>`;var S=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| <path d="M8 16.5h8v3H8v-3z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/> | ||
| </svg>`;var i="#D4795C",g="#C06A4E",_="#B35E43",y={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:i,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:i,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:i,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function l(a){return a!=="system"?y[a]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function f(a){return ` | ||
| </svg>`;var s="#D4795C",g="#C06A4E",F="#B35E43",w="#F0B8A8",y={branded:{bg:s,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:s,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:s,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:s,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function l(a){return a!=="system"?y[a]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function f(a){return ` | ||
| --cb-bg: ${a.bg}; | ||
@@ -52,3 +52,3 @@ --cb-text: ${a.text}; | ||
| --cb-code-text: ${a.codeText}; | ||
| `}var q="#6B5CE7",F={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},T={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 U=` | ||
| `}var U="#6B5CE7",O={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},T={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 j=` | ||
| :host { | ||
@@ -412,4 +412,4 @@ position: fixed; | ||
| } | ||
| `,O=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=false;this.attachShadow({mode:"open"});}set options(t){this._autoLaunchConsumed=false,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 l(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?l("dark"):l("light");let e=o?l("dark"):l("light"),r=l(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:s,skillUrl:d,desktopLaunchUrl:c,autoLaunch:p}=this._options,b=this.resolvePopupTokens(),u=t==="claude-code"?x:k,v=t==="claude-code",m=s||r,h=c??"claude://",R=B();this.shadowRoot.innerHTML=` | ||
| <style>${U}</style> | ||
| `,L=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=false;this.attachShadow({mode:"open"});}set options(t){this._autoLaunchConsumed=false,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 l(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?l("dark"):l("light");let e=o?l("dark"):l("light"),r=l(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:i,skillUrl:d,desktopLaunchUrl:c,autoLaunch:p}=this._options,b=this.resolvePopupTokens(),u=t==="claude-code"?x:k,v=t==="claude-code",m=i||r,h=c??"claude://",D=R();this.shadowRoot.innerHTML=` | ||
| <style>${j}</style> | ||
| <div style="${f(b)}"> | ||
@@ -424,3 +424,3 @@ <div class="cb-backdrop" data-action="close"></div> | ||
| </div> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${z}</button> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${P}</button> | ||
| </div> | ||
@@ -431,7 +431,7 @@ <div class="cb-dialog-body"> | ||
| <div class="cb-dialog-footer"> | ||
| ${v?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(h),R)} | ||
| ${v?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(h),D)} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),p&&!this._autoLaunchConsumed&&t==="cowork"&&R&&(this._autoLaunchConsumed=true,this.openDesktopAppLink(h));}openDesktopAppLink(t){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:true,composed:true,detail:{href:t}})),typeof document>"u")return;let o=document.createElement("a");o.href=t,o.rel="noopener noreferrer",o.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>o.remove());}renderClaudeCodeBody(t){return ` | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),p&&!this._autoLaunchConsumed&&t==="cowork"&&D&&(this._autoLaunchConsumed=true,this.openDesktopAppLink(h));}openDesktopAppLink(t){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:true,composed:true,detail:{href:t}})),typeof document>"u")return;let o=document.createElement("a");o.href=t,o.rel="noopener noreferrer",o.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>o.remove());}renderClaudeCodeBody(t){return ` | ||
| <div class="cb-step"> | ||
@@ -513,3 +513,3 @@ <div class="cb-step-num">1</div> | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div> | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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);}else if(e==="launch-desktop"){t.preventDefault();let r=o.getAttribute("href")||"";this.openDesktopAppLink(r||o.href);}}),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,s=r.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${M}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${C}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",O);function w(a){let n=document.createElement("claude-popup-dialog");return n.options=a,document.body.appendChild(n),n}var j=` | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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);}else if(e==="launch-desktop"){t.preventDefault();let r=o.getAttribute("href")||"";this.openDesktopAppLink(r||o.href);}}),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,i=r.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${z}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${C}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",L);function A(a){let n=document.createElement("claude-popup-dialog");return n.options=a,document.body.appendChild(n),n}var V=` | ||
| :host { | ||
@@ -563,3 +563,3 @@ display: inline-block; | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${_}; | ||
| background: ${F}; | ||
| transform: scale(0.98); | ||
@@ -605,4 +605,4 @@ } | ||
| background: transparent; | ||
| border-color: ${i}; | ||
| color: ${i}; | ||
| border-color: ${s}; | ||
| color: ${s}; | ||
| } | ||
@@ -638,3 +638,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${i}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -653,3 +653,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${i}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -670,3 +670,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${i}; | ||
| color: ${w}; | ||
| } | ||
@@ -717,3 +717,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${i}); | ||
| outline: 2px solid var(--cb-focus-color, ${s}); | ||
| outline-offset: 2px; | ||
@@ -741,6 +741,6 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -750,3 +750,3 @@ | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -759,4 +759,4 @@ | ||
| } | ||
| `,A=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true,promptFlag:true};this._mqCleanup=null;this._rendered=false;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"),s=this.getAttribute("shape"),d=this.getAttribute("popup"),c=this.getAttribute("prompt-flag"),p=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),s&&(this._options.shape=s),d!==null&&(this._options.popup=d!=="false"),c!==null&&(this._options.promptFlag=c!=="false"),p!==null&&(this._options.popupTitle=p),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 Claude Code: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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===false?t:`claude -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=l(t),s=this._options.size||"md",d=this._options.shape||"rounded",c=T[s],p=F[d][s];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${j}</style> | ||
| `,_=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true,promptFlag:true};this._mqCleanup=null;this._rendered=false;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"),i=this.getAttribute("shape"),d=this.getAttribute("popup"),c=this.getAttribute("prompt-flag"),p=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),i&&(this._options.shape=i),d!==null&&(this._options.popup=d!=="false"),c!==null&&(this._options.promptFlag=c!=="false"),p!==null&&(this._options.popupTitle=p),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 Claude Code: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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===false?t:`claude -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=l(t),i=this._options.size||"md",d=this._options.shape||"rounded",c=T[i],p=O[d][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${V}</style> | ||
| <button | ||
@@ -784,3 +784,3 @@ class="cb-btn" | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick());}),this._rendered=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,s=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:true,composed:true,detail:{command:o,fullCommand:s}})),t===false){navigator.clipboard.writeText(s).then(()=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:s}}));});return}w({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:r||"Execute this command in your terminal to get started.",command:o,fullCommand:s,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:d}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:true,composed:true}));}});}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 L(a="claude-code-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,A);}L();function V(a){let n=document.createElement("claude-code-button");return n.options=a,n}var W=` | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick());}),this._rendered=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,i=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:true,composed:true,detail:{command:o,fullCommand:i}})),t===false){navigator.clipboard.writeText(i).then(()=>{this._options.onCopy?.(i),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:i}}));});return}A({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:r||"Execute this command in your terminal to get started.",command:o,fullCommand:i,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:d}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:true,composed:true}));}});}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","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function $(a="claude-code-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,_);}$();function K(a){let n=document.createElement("claude-code-button");return n.options=a,n}var W=` | ||
| :host { | ||
@@ -834,3 +834,3 @@ display: inline-block; | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${_}; | ||
| background: ${F}; | ||
| transform: scale(0.98); | ||
@@ -876,4 +876,4 @@ } | ||
| background: transparent; | ||
| border-color: ${i}; | ||
| color: ${i}; | ||
| border-color: ${s}; | ||
| color: ${s}; | ||
| } | ||
@@ -909,3 +909,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${i}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -924,3 +924,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${i}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -941,3 +941,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${i}; | ||
| color: ${w}; | ||
| } | ||
@@ -988,3 +988,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${i}); | ||
| outline: 2px solid var(--cb-focus-color, ${s}); | ||
| outline-offset: 2px; | ||
@@ -1012,7 +1012,7 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| --cb-icon-accent: #1C1917; | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| --cb-icon-accent: #FFFFFF; | ||
@@ -1023,3 +1023,3 @@ } | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -1032,3 +1032,3 @@ | ||
| } | ||
| `,E=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true};this._mqCleanup=null;this._rendered=false;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"),s=this.getAttribute("variant"),d=this.getAttribute("shape"),c=this.getAttribute("popup"),p=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),s&&(this._options.variant=s),d&&(this._options.shape=d),c!==null&&(this._options.popup=c!=="false"),p!==null&&(this._options.popupTitle=p),b!==null&&(this._options.popupDescription=b),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false";}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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=l(t),s=this._options.size||"md",d=this._options.shape||"rounded",c=T[s],p=F[d][s];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| `,E=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true};this._mqCleanup=null;this._rendered=false;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"),i=this.getAttribute("variant"),d=this.getAttribute("shape"),c=this.getAttribute("popup"),p=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),i&&(this._options.variant=i),d&&(this._options.shape=d),c!==null&&(this._options.popup=c!=="false"),p!==null&&(this._options.popupTitle=p),b!==null&&(this._options.popupDescription=b),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false";}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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=l(t),i=this._options.size||"md",d=this._options.shape||"rounded",c=T[i],p=O[d][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${W}</style> | ||
@@ -1057,4 +1057,4 @@ <button | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick());}),this._rendered=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:s,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:true,composed:true,detail:{command:o}})),t===false){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:o}}));});return}w({variant:"cowork",theme:this.getResolvedTheme(),title:r||"Run on Cowork",description:s||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===true,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:c}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:true,composed:true}));}});}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);}};E.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function $(a="cowork-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,E);}$();function K(a){let n=document.createElement("cowork-button");return n.options=a,n}function P(){if(typeof document>"u")return [];let a=[];return document.querySelectorAll("claude-code-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`claude -p "${t}"`:t;a.push({platform:"claude-code",command:t,fullCommand:r});}),document.querySelectorAll("cowork-button").forEach(n=>{let t=n.getAttribute("command")||"",o=n.getAttribute("skill-url")||void 0;a.push({platform:"cowork",command:t,...o&&{skillUrl:o}});}),a}function I(){let a=P();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="claude-code")return {"@type":"Action",name:`Run on Claude Code: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://claude.ai/code?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://claude.ai/code"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Claude Code",text:t.fullCommand||t.command}};let o={"@type":"EntryPoint",actionPlatform:"https://claude.ai/cowork"};t.skillUrl?o.urlTemplate=t.skillUrl:o.urlTemplate=`https://claude.ai/cowork?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Cowork: ${t.command}`,description:t.command,target:o};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Claude Cowork"}),e})}}function Y(){if(typeof document>"u")return;let a=document.querySelector("script[data-claudebuttons-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-claudebuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t);}function ut(){L(),$();} | ||
| exports.ALT_BRAND_COLOR=q;exports.BRAND_COLOR=i;exports.CLAUDE_CODE_ICON=x;exports.COWORK_ICON=k;exports.ClaudeCodeButton=A;exports.ClaudePopupDialog=O;exports.CoworkButton=E;exports.createClaudeCodeButton=V;exports.createCoworkButton=K;exports.discoverButtons=P;exports.generateStructuredData=I;exports.injectStructuredData=Y;exports.isDesktopAppLinkSupported=B;exports.isMobileOrTabletDevice=H;exports.isRestrictedEmbeddedBrowser=D;exports.register=ut;exports.registerClaudeCodeButton=L;exports.registerCoworkButton=$;exports.resolveTheme=l;exports.showPopup=w;exports.themes=y;//# sourceMappingURL=index.js.map | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick());}),this._rendered=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:i,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:true,composed:true,detail:{command:o}})),t===false){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:o}}));});return}A({variant:"cowork",theme:this.getResolvedTheme(),title:r||"Run on Cowork",description:i||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===true,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:c}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:true,composed:true}));}});}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);}};E.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function B(a="cowork-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,E);}B();function Y(a){let n=document.createElement("cowork-button");return n.options=a,n}function N(){if(typeof document>"u")return [];let a=[];return document.querySelectorAll("claude-code-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`claude -p "${t}"`:t;a.push({platform:"claude-code",command:t,fullCommand:r});}),document.querySelectorAll("cowork-button").forEach(n=>{let t=n.getAttribute("command")||"",o=n.getAttribute("skill-url")||void 0;a.push({platform:"cowork",command:t,...o&&{skillUrl:o}});}),a}function I(){let a=N();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="claude-code")return {"@type":"Action",name:`Run on Claude Code: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://claude.ai/code?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://claude.ai/code"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Claude Code",text:t.fullCommand||t.command}};let o={"@type":"EntryPoint",actionPlatform:"https://claude.ai/cowork"};t.skillUrl?o.urlTemplate=t.skillUrl:o.urlTemplate=`https://claude.ai/cowork?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Cowork: ${t.command}`,description:t.command,target:o};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Claude Cowork"}),e})}}function Z(){if(typeof document>"u")return;let a=document.querySelector("script[data-claudebuttons-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-claudebuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t);}function mt(){$(),B();} | ||
| exports.ALT_BRAND_COLOR=U;exports.BRAND_COLOR=s;exports.BRAND_COLOR_ON_DARK=w;exports.CLAUDE_CODE_ICON=x;exports.COWORK_ICON=k;exports.ClaudeCodeButton=_;exports.ClaudePopupDialog=L;exports.CoworkButton=E;exports.createClaudeCodeButton=K;exports.createCoworkButton=Y;exports.discoverButtons=N;exports.generateStructuredData=I;exports.injectStructuredData=Z;exports.isDesktopAppLinkSupported=R;exports.isMobileOrTabletDevice=H;exports.isRestrictedEmbeddedBrowser=M;exports.register=mt;exports.registerClaudeCodeButton=$;exports.registerCoworkButton=B;exports.resolveTheme=l;exports.showPopup=A;exports.themes=y;//# sourceMappingURL=index.js.map | ||
| //# sourceMappingURL=index.js.map |
+37
-37
@@ -1,2 +0,2 @@ | ||
| function D(){if(typeof navigator>"u")return true;let a=navigator.userAgent||"";return !!(!a.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(a)||/Twitter for (iPhone|Android)/i.test(a)||/; wv\)/.test(a)||/Opera Mini|OPiOS/i.test(a))}function H(){if(typeof navigator>"u")return false;let a=navigator.userAgent||"",n=typeof navigator.maxTouchPoints=="number"?navigator.maxTouchPoints:0,t=navigator.platform||"";return !!(/iPhone|iPod/i.test(a)||/iPad/i.test(a)||/Android/i.test(a)&&/Mobile/i.test(a)||/Android/i.test(a)&&!/Mobile/i.test(a)||(t==="MacIntel"||t==="MacARM")&&n>1||/webOS|BlackBerry|IEMobile|Opera Mini/i.test(a))}function N(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function B(){return !(!N()||D())}var x=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| function M(){if(typeof navigator>"u")return true;let a=navigator.userAgent||"";return !!(!a.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(a)||/Twitter for (iPhone|Android)/i.test(a)||/; wv\)/.test(a)||/Opera Mini|OPiOS/i.test(a))}function H(){if(typeof navigator>"u")return false;let a=navigator.userAgent||"",n=typeof navigator.maxTouchPoints=="number"?navigator.maxTouchPoints:0,t=navigator.platform||"";return !!(/iPhone|iPod/i.test(a)||/iPad/i.test(a)||/Android/i.test(a)&&/Mobile/i.test(a)||/Android/i.test(a)&&!/Mobile/i.test(a)||(t==="MacIntel"||t==="MacARM")&&n>1||/webOS|BlackBerry|IEMobile|Opera Mini/i.test(a))}function q(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function R(){return !(!q()||M())}var x=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Ears --> | ||
@@ -28,5 +28,5 @@ <rect x="3.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`,M=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`,z=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
| </svg>`;var z=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`;var P=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
@@ -40,3 +40,3 @@ </svg>`;var S=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| <path d="M8 16.5h8v3H8v-3z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/> | ||
| </svg>`;var i="#D4795C",g="#C06A4E",_="#B35E43",y={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:i,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:i,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:i,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function l(a){return a!=="system"?y[a]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function f(a){return ` | ||
| </svg>`;var s="#D4795C",g="#C06A4E",F="#B35E43",w="#F0B8A8",y={branded:{bg:s,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:s,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:s,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:s,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function l(a){return a!=="system"?y[a]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function f(a){return ` | ||
| --cb-bg: ${a.bg}; | ||
@@ -52,3 +52,3 @@ --cb-text: ${a.text}; | ||
| --cb-code-text: ${a.codeText}; | ||
| `}var q="#6B5CE7",F={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},T={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 U=` | ||
| `}var U="#6B5CE7",O={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},T={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 j=` | ||
| :host { | ||
@@ -412,4 +412,4 @@ position: fixed; | ||
| } | ||
| `,O=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=false;this.attachShadow({mode:"open"});}set options(t){this._autoLaunchConsumed=false,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 l(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?l("dark"):l("light");let e=o?l("dark"):l("light"),r=l(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:s,skillUrl:d,desktopLaunchUrl:c,autoLaunch:p}=this._options,b=this.resolvePopupTokens(),u=t==="claude-code"?x:k,v=t==="claude-code",m=s||r,h=c??"claude://",R=B();this.shadowRoot.innerHTML=` | ||
| <style>${U}</style> | ||
| `,L=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=false;this.attachShadow({mode:"open"});}set options(t){this._autoLaunchConsumed=false,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 l(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?l("dark"):l("light");let e=o?l("dark"):l("light"),r=l(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:i,skillUrl:d,desktopLaunchUrl:c,autoLaunch:p}=this._options,b=this.resolvePopupTokens(),u=t==="claude-code"?x:k,v=t==="claude-code",m=i||r,h=c??"claude://",D=R();this.shadowRoot.innerHTML=` | ||
| <style>${j}</style> | ||
| <div style="${f(b)}"> | ||
@@ -424,3 +424,3 @@ <div class="cb-backdrop" data-action="close"></div> | ||
| </div> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${z}</button> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${P}</button> | ||
| </div> | ||
@@ -431,7 +431,7 @@ <div class="cb-dialog-body"> | ||
| <div class="cb-dialog-footer"> | ||
| ${v?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(h),R)} | ||
| ${v?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(h),D)} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),p&&!this._autoLaunchConsumed&&t==="cowork"&&R&&(this._autoLaunchConsumed=true,this.openDesktopAppLink(h));}openDesktopAppLink(t){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:true,composed:true,detail:{href:t}})),typeof document>"u")return;let o=document.createElement("a");o.href=t,o.rel="noopener noreferrer",o.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>o.remove());}renderClaudeCodeBody(t){return ` | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),p&&!this._autoLaunchConsumed&&t==="cowork"&&D&&(this._autoLaunchConsumed=true,this.openDesktopAppLink(h));}openDesktopAppLink(t){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:true,composed:true,detail:{href:t}})),typeof document>"u")return;let o=document.createElement("a");o.href=t,o.rel="noopener noreferrer",o.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>o.remove());}renderClaudeCodeBody(t){return ` | ||
| <div class="cb-step"> | ||
@@ -513,3 +513,3 @@ <div class="cb-step-num">1</div> | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div> | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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);}else if(e==="launch-desktop"){t.preventDefault();let r=o.getAttribute("href")||"";this.openDesktopAppLink(r||o.href);}}),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,s=r.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${M}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${C}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",O);function w(a){let n=document.createElement("claude-popup-dialog");return n.options=a,document.body.appendChild(n),n}var j=` | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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);}else if(e==="launch-desktop"){t.preventDefault();let r=o.getAttribute("href")||"";this.openDesktopAppLink(r||o.href);}}),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,i=r.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${z}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${C}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",L);function A(a){let n=document.createElement("claude-popup-dialog");return n.options=a,document.body.appendChild(n),n}var V=` | ||
| :host { | ||
@@ -563,3 +563,3 @@ display: inline-block; | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${_}; | ||
| background: ${F}; | ||
| transform: scale(0.98); | ||
@@ -605,4 +605,4 @@ } | ||
| background: transparent; | ||
| border-color: ${i}; | ||
| color: ${i}; | ||
| border-color: ${s}; | ||
| color: ${s}; | ||
| } | ||
@@ -638,3 +638,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${i}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -653,3 +653,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${i}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -670,3 +670,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${i}; | ||
| color: ${w}; | ||
| } | ||
@@ -717,3 +717,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${i}); | ||
| outline: 2px solid var(--cb-focus-color, ${s}); | ||
| outline-offset: 2px; | ||
@@ -741,6 +741,6 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -750,3 +750,3 @@ | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -759,4 +759,4 @@ | ||
| } | ||
| `,A=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true,promptFlag:true};this._mqCleanup=null;this._rendered=false;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"),s=this.getAttribute("shape"),d=this.getAttribute("popup"),c=this.getAttribute("prompt-flag"),p=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),s&&(this._options.shape=s),d!==null&&(this._options.popup=d!=="false"),c!==null&&(this._options.promptFlag=c!=="false"),p!==null&&(this._options.popupTitle=p),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 Claude Code: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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===false?t:`claude -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=l(t),s=this._options.size||"md",d=this._options.shape||"rounded",c=T[s],p=F[d][s];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${j}</style> | ||
| `,_=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true,promptFlag:true};this._mqCleanup=null;this._rendered=false;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"),i=this.getAttribute("shape"),d=this.getAttribute("popup"),c=this.getAttribute("prompt-flag"),p=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),i&&(this._options.shape=i),d!==null&&(this._options.popup=d!=="false"),c!==null&&(this._options.promptFlag=c!=="false"),p!==null&&(this._options.popupTitle=p),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 Claude Code: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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===false?t:`claude -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=l(t),i=this._options.size||"md",d=this._options.shape||"rounded",c=T[i],p=O[d][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${V}</style> | ||
| <button | ||
@@ -784,3 +784,3 @@ class="cb-btn" | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick());}),this._rendered=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,s=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:true,composed:true,detail:{command:o,fullCommand:s}})),t===false){navigator.clipboard.writeText(s).then(()=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:s}}));});return}w({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:r||"Execute this command in your terminal to get started.",command:o,fullCommand:s,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:d}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:true,composed:true}));}});}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 L(a="claude-code-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,A);}L();function V(a){let n=document.createElement("claude-code-button");return n.options=a,n}var W=` | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick());}),this._rendered=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,i=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:true,composed:true,detail:{command:o,fullCommand:i}})),t===false){navigator.clipboard.writeText(i).then(()=>{this._options.onCopy?.(i),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:i}}));});return}A({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:r||"Execute this command in your terminal to get started.",command:o,fullCommand:i,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:d}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:true,composed:true}));}});}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","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function $(a="claude-code-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,_);}$();function K(a){let n=document.createElement("claude-code-button");return n.options=a,n}var W=` | ||
| :host { | ||
@@ -834,3 +834,3 @@ display: inline-block; | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${_}; | ||
| background: ${F}; | ||
| transform: scale(0.98); | ||
@@ -876,4 +876,4 @@ } | ||
| background: transparent; | ||
| border-color: ${i}; | ||
| color: ${i}; | ||
| border-color: ${s}; | ||
| color: ${s}; | ||
| } | ||
@@ -909,3 +909,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${i}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -924,3 +924,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${i}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -941,3 +941,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${i}; | ||
| color: ${w}; | ||
| } | ||
@@ -988,3 +988,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${i}); | ||
| outline: 2px solid var(--cb-focus-color, ${s}); | ||
| outline-offset: 2px; | ||
@@ -1012,7 +1012,7 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| --cb-icon-accent: #1C1917; | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| --cb-icon-accent: #FFFFFF; | ||
@@ -1023,3 +1023,3 @@ } | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${i}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -1032,3 +1032,3 @@ | ||
| } | ||
| `,E=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true};this._mqCleanup=null;this._rendered=false;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"),s=this.getAttribute("variant"),d=this.getAttribute("shape"),c=this.getAttribute("popup"),p=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),s&&(this._options.variant=s),d&&(this._options.shape=d),c!==null&&(this._options.popup=c!=="false"),p!==null&&(this._options.popupTitle=p),b!==null&&(this._options.popupDescription=b),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false";}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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=l(t),s=this._options.size||"md",d=this._options.shape||"rounded",c=T[s],p=F[d][s];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| `,E=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true};this._mqCleanup=null;this._rendered=false;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"),i=this.getAttribute("variant"),d=this.getAttribute("shape"),c=this.getAttribute("popup"),p=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),i&&(this._options.variant=i),d&&(this._options.shape=d),c!==null&&(this._options.popup=c!=="false"),p!==null&&(this._options.popupTitle=p),b!==null&&(this._options.popupDescription=b),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false";}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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=l(t),i=this._options.size||"md",d=this._options.shape||"rounded",c=T[i],p=O[d][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,v=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${W}</style> | ||
@@ -1057,4 +1057,4 @@ <button | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick());}),this._rendered=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:s,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:true,composed:true,detail:{command:o}})),t===false){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:o}}));});return}w({variant:"cowork",theme:this.getResolvedTheme(),title:r||"Run on Cowork",description:s||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===true,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:c}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:true,composed:true}));}});}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);}};E.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function $(a="cowork-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,E);}$();function K(a){let n=document.createElement("cowork-button");return n.options=a,n}function P(){if(typeof document>"u")return [];let a=[];return document.querySelectorAll("claude-code-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`claude -p "${t}"`:t;a.push({platform:"claude-code",command:t,fullCommand:r});}),document.querySelectorAll("cowork-button").forEach(n=>{let t=n.getAttribute("command")||"",o=n.getAttribute("skill-url")||void 0;a.push({platform:"cowork",command:t,...o&&{skillUrl:o}});}),a}function I(){let a=P();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="claude-code")return {"@type":"Action",name:`Run on Claude Code: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://claude.ai/code?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://claude.ai/code"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Claude Code",text:t.fullCommand||t.command}};let o={"@type":"EntryPoint",actionPlatform:"https://claude.ai/cowork"};t.skillUrl?o.urlTemplate=t.skillUrl:o.urlTemplate=`https://claude.ai/cowork?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Cowork: ${t.command}`,description:t.command,target:o};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Claude Cowork"}),e})}}function Y(){if(typeof document>"u")return;let a=document.querySelector("script[data-claudebuttons-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-claudebuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t);}function ut(){L(),$();} | ||
| export{q as ALT_BRAND_COLOR,i as BRAND_COLOR,x as CLAUDE_CODE_ICON,k as COWORK_ICON,A as ClaudeCodeButton,O as ClaudePopupDialog,E as CoworkButton,V as createClaudeCodeButton,K as createCoworkButton,P as discoverButtons,I as generateStructuredData,Y as injectStructuredData,B as isDesktopAppLinkSupported,H as isMobileOrTabletDevice,D as isRestrictedEmbeddedBrowser,ut as register,L as registerClaudeCodeButton,$ as registerCoworkButton,l as resolveTheme,w as showPopup,y as themes};//# sourceMappingURL=index.mjs.map | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick());}),this._rendered=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:i,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:true,composed:true,detail:{command:o}})),t===false){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:o}}));});return}A({variant:"cowork",theme:this.getResolvedTheme(),title:r||"Run on Cowork",description:i||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===true,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:true,composed:true,detail:{command:c}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:true,composed:true}));}});}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);}};E.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function B(a="cowork-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,E);}B();function Y(a){let n=document.createElement("cowork-button");return n.options=a,n}function N(){if(typeof document>"u")return [];let a=[];return document.querySelectorAll("claude-code-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`claude -p "${t}"`:t;a.push({platform:"claude-code",command:t,fullCommand:r});}),document.querySelectorAll("cowork-button").forEach(n=>{let t=n.getAttribute("command")||"",o=n.getAttribute("skill-url")||void 0;a.push({platform:"cowork",command:t,...o&&{skillUrl:o}});}),a}function I(){let a=N();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="claude-code")return {"@type":"Action",name:`Run on Claude Code: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://claude.ai/code?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://claude.ai/code"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Claude Code",text:t.fullCommand||t.command}};let o={"@type":"EntryPoint",actionPlatform:"https://claude.ai/cowork"};t.skillUrl?o.urlTemplate=t.skillUrl:o.urlTemplate=`https://claude.ai/cowork?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Cowork: ${t.command}`,description:t.command,target:o};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Claude Cowork"}),e})}}function Z(){if(typeof document>"u")return;let a=document.querySelector("script[data-claudebuttons-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-claudebuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t);}function mt(){$(),B();} | ||
| export{U as ALT_BRAND_COLOR,s as BRAND_COLOR,w as BRAND_COLOR_ON_DARK,x as CLAUDE_CODE_ICON,k as COWORK_ICON,_ as ClaudeCodeButton,L as ClaudePopupDialog,E as CoworkButton,K as createClaudeCodeButton,Y as createCoworkButton,N as discoverButtons,I as generateStructuredData,Z as injectStructuredData,R as isDesktopAppLinkSupported,H as isMobileOrTabletDevice,M as isRestrictedEmbeddedBrowser,mt as register,$ as registerClaudeCodeButton,B as registerCoworkButton,l as resolveTheme,A as showPopup,y as themes};//# sourceMappingURL=index.mjs.map | ||
| //# sourceMappingURL=index.mjs.map |
+43
-43
@@ -1,2 +0,2 @@ | ||
| "use strict";"use client";var W=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var st=Object.getOwnPropertyNames;var ct=Object.prototype.hasOwnProperty;var L=(a,n)=>()=>(a&&(n=a(a=0)),n);var j=(a,n)=>{for(var t in n)W(a,t,{get:n[t],enumerable:!0})},dt=(a,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of st(n))!ct.call(a,e)&&e!==t&&W(a,e,{get:()=>n[e],enumerable:!(o=it(n,e))||o.enumerable});return a};var lt=a=>dt(W({},"__esModule",{value:!0}),a);var M,D,B,G,J,K,z=L(()=>{"use strict";M=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| "use strict";"use client";var W=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var dt=Object.prototype.hasOwnProperty;var O=(a,n)=>()=>(a&&(n=a(a=0)),n);var j=(a,n)=>{for(var t in n)W(a,t,{get:n[t],enumerable:!0})},lt=(a,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of ct(n))!dt.call(a,e)&&e!==t&&W(a,e,{get:()=>n[e],enumerable:!(o=st(n,e))||o.enumerable});return a};var pt=a=>lt(W({},"__esModule",{value:!0}),a);var D,M,B,J,Q,Y,z=O(()=>{"use strict";D=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Ears --> | ||
@@ -16,3 +16,3 @@ <rect x="3.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <rect x="13.5" y="18.5" width="4" height="3.5" rx="1.5" fill="currentColor"/> | ||
| </svg>`,D=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| </svg>`,M=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Lightning bolt --> | ||
@@ -29,7 +29,7 @@ <path d="M13.5 2L5 13.5h5.5L9 22l10-12h-5.5L15.5 2h-2z" fill="currentColor"/> | ||
| <path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`,G=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`,J=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
| </svg>`,J=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`,Q=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`,K=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| </svg>`,Y=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| <rect x="4" y="5" width="16" height="11" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/> | ||
@@ -41,3 +41,3 @@ <path d="M4 8.5h16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| <path d="M8 16.5h8v3H8v-3z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/> | ||
| </svg>`});function C(a){return a!=="system"?P[a]:typeof window>"u"?P.light:window.matchMedia("(prefers-color-scheme: dark)").matches?P.dark:P.light}function O(a){return` | ||
| </svg>`});function C(a){return a!=="system"?P[a]:typeof window>"u"?P.light:window.matchMedia("(prefers-color-scheme: dark)").matches?P.dark:P.light}function L(a){return` | ||
| --cb-bg: ${a.bg}; | ||
@@ -53,3 +53,3 @@ --cb-text: ${a.text}; | ||
| --cb-code-text: ${a.codeText}; | ||
| `}var c,T,H,P,I,N,q=L(()=>{"use strict";c="#D4795C",T="#C06A4E",H="#B35E43",P={branded:{bg:c,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:c,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:c,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:c,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};I={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},N={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"}}});function pt(){if(typeof navigator>"u")return!0;let a=navigator.userAgent||"";return!!(!a.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(a)||/Twitter for (iPhone|Android)/i.test(a)||/; wv\)/.test(a)||/Opera Mini|OPiOS/i.test(a))}function bt(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function Q(){return!(!bt()||pt())}var X=L(()=>{"use strict"});function U(a){let n=document.createElement("claude-popup-dialog");return n.options=a,document.body.appendChild(n),n}var ht,Y,Z=L(()=>{"use strict";z();q();X();ht=` | ||
| `}var d,T,H,N,P,I,q,U=O(()=>{"use strict";d="#D4795C",T="#C06A4E",H="#B35E43",N="#F0B8A8",P={branded:{bg:d,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:d,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:d,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:d,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};I={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},q={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"}}});function bt(){if(typeof navigator>"u")return!0;let a=navigator.userAgent||"";return!!(!a.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(a)||/Twitter for (iPhone|Android)/i.test(a)||/; wv\)/.test(a)||/Opera Mini|OPiOS/i.test(a))}function ht(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function X(){return!(!ht()||bt())}var tt=O(()=>{"use strict"});function V(a){let n=document.createElement("claude-popup-dialog");return n.options=a,document.body.appendChild(n),n}var ut,Z,G=O(()=>{"use strict";z();U();tt();ut=` | ||
| :host { | ||
@@ -413,5 +413,5 @@ position: fixed; | ||
| } | ||
| `,Y=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(t){this._autoLaunchConsumed=!1,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 C(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?C("dark"):C("light");let e=o?C("dark"):C("light"),r=C(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:i,skillUrl:d,desktopLaunchUrl:s,autoLaunch:p}=this._options,b=this.resolvePopupTokens(),u=t==="claude-code"?M:D,g=t==="claude-code",m=i||r,h=s??"claude://",v=Q();this.shadowRoot.innerHTML=` | ||
| <style>${ht}</style> | ||
| <div style="${O(b)}"> | ||
| `,Z=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(t){this._autoLaunchConsumed=!1,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 C(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?C("dark"):C("light");let e=o?C("dark"):C("light"),r=C(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:i,skillUrl:c,desktopLaunchUrl:s,autoLaunch:p}=this._options,b=this.resolvePopupTokens(),u=t==="claude-code"?D:M,g=t==="claude-code",m=i||r,h=s??"claude://",v=X();this.shadowRoot.innerHTML=` | ||
| <style>${ut}</style> | ||
| <div style="${L(b)}"> | ||
| <div class="cb-backdrop" data-action="close"></div> | ||
@@ -425,6 +425,6 @@ <div class="cb-dialog" role="dialog" aria-modal="true" aria-labelledby="cb-dialog-title"> | ||
| </div> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${J}</button> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${Q}</button> | ||
| </div> | ||
| <div class="cb-dialog-body"> | ||
| ${g?this.renderClaudeCodeBody(m):this.renderCoworkBody(r,d)} | ||
| ${g?this.renderClaudeCodeBody(m):this.renderCoworkBody(r,c)} | ||
| </div> | ||
@@ -495,3 +495,3 @@ <div class="cb-dialog-footer"> | ||
| > | ||
| ${K} | ||
| ${Y} | ||
| <span>Open Claude Desktop</span> | ||
@@ -507,3 +507,3 @@ </a>`:` | ||
| > | ||
| ${K} | ||
| ${Y} | ||
| <span>Open Claude Desktop</span> | ||
@@ -515,3 +515,3 @@ </button>`} | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div> | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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)}else if(e==="launch-desktop"){t.preventDefault();let r=o.getAttribute("href")||"";this.openDesktopAppLink(r||o.href)}}),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,i=r.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${G}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${B}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",Y)});var et={};j(et,{ClaudeCodeButton:()=>R,createClaudeCodeButton:()=>mt,registerClaudeCodeButton:()=>tt});function tt(a="claude-code-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,R)}function mt(a){let n=document.createElement("claude-code-button");return n.options=a,n}var ut,R,ot=L(()=>{"use strict";z();q();Z();ut=` | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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)}else if(e==="launch-desktop"){t.preventDefault();let r=o.getAttribute("href")||"";this.openDesktopAppLink(r||o.href)}}),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,i=r.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${J}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${B}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",Z)});var ot={};j(ot,{ClaudeCodeButton:()=>R,createClaudeCodeButton:()=>gt,registerClaudeCodeButton:()=>et});function et(a="claude-code-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,R)}function gt(a){let n=document.createElement("claude-code-button");return n.options=a,n}var mt,R,at=O(()=>{"use strict";z();U();G();mt=` | ||
| :host { | ||
@@ -606,4 +606,4 @@ display: inline-block; | ||
| background: transparent; | ||
| border-color: ${c}; | ||
| color: ${c}; | ||
| border-color: ${d}; | ||
| color: ${d}; | ||
| } | ||
@@ -639,3 +639,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${c}; | ||
| border-color: ${d}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -654,3 +654,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${c}; | ||
| border-color: ${d}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -671,3 +671,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${c}; | ||
| color: ${N}; | ||
| } | ||
@@ -718,3 +718,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${c}); | ||
| outline: 2px solid var(--cb-focus-color, ${d}); | ||
| outline-offset: 2px; | ||
@@ -742,6 +742,6 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${c}); | ||
| color: var(--cb-accent-color, ${d}); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${c}); | ||
| color: var(--cb-accent-color, ${d}); | ||
| } | ||
@@ -751,3 +751,3 @@ | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${c}); | ||
| color: var(--cb-accent-color, ${d}); | ||
| } | ||
@@ -760,4 +760,4 @@ | ||
| } | ||
| `,R=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"),i=this.getAttribute("shape"),d=this.getAttribute("popup"),s=this.getAttribute("prompt-flag"),p=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),i&&(this._options.shape=i),d!==null&&(this._options.popup=d!=="false"),s!==null&&(this._options.promptFlag=s!=="false"),p!==null&&(this._options.popupTitle=p),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 Claude Code: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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:`claude -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=C(t),i=this._options.size||"md",d=this._options.shape||"rounded",s=N[i],p=I[d][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,g=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${ut}</style> | ||
| `,R=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"),i=this.getAttribute("shape"),c=this.getAttribute("popup"),s=this.getAttribute("prompt-flag"),p=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),i&&(this._options.shape=i),c!==null&&(this._options.popup=c!=="false"),s!==null&&(this._options.promptFlag=s!=="false"),p!==null&&(this._options.popupTitle=p),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 Claude Code: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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:`claude -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=C(t),i=this._options.size||"md",c=this._options.shape||"rounded",s=q[i],p=I[c][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,g=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${mt}</style> | ||
| <button | ||
@@ -767,3 +767,3 @@ class="cb-btn" | ||
| style=" | ||
| ${O(r)} | ||
| ${L(r)} | ||
| --cb-bg: ${b}; | ||
@@ -783,6 +783,6 @@ --cb-border: ${u}; | ||
| > | ||
| <span class="cb-btn-icon" aria-hidden="true">${M}</span> | ||
| <span class="cb-btn-icon" aria-hidden="true">${D}</span> | ||
| <span class="cb-btn-label">Run on Claude Code</span> | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,i=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:i}})),t===!1){navigator.clipboard.writeText(i).then(()=>{this._options.onCopy?.(i),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:i}}))});return}U({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:r||"Execute this command in your terminal to get started.",command:o,fullCommand:i,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:d}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};R.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];tt()});var rt={};j(rt,{CoworkButton:()=>S,createCoworkButton:()=>vt,registerCoworkButton:()=>at});function at(a="cowork-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,S)}function vt(a){let n=document.createElement("cowork-button");return n.options=a,n}var gt,S,nt=L(()=>{"use strict";z();q();Z();gt=` | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,i=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:i}})),t===!1){navigator.clipboard.writeText(i).then(()=>{this._options.onCopy?.(i),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:i}}))});return}V({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:r||"Execute this command in your terminal to get started.",command:o,fullCommand:i,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:c}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};R.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];et()});var nt={};j(nt,{CoworkButton:()=>S,createCoworkButton:()=>ft,registerCoworkButton:()=>rt});function rt(a="cowork-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,S)}function ft(a){let n=document.createElement("cowork-button");return n.options=a,n}var vt,S,it=O(()=>{"use strict";z();U();G();vt=` | ||
| :host { | ||
@@ -877,4 +877,4 @@ display: inline-block; | ||
| background: transparent; | ||
| border-color: ${c}; | ||
| color: ${c}; | ||
| border-color: ${d}; | ||
| color: ${d}; | ||
| } | ||
@@ -910,3 +910,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${c}; | ||
| border-color: ${d}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -925,3 +925,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${c}; | ||
| border-color: ${d}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -942,3 +942,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${c}; | ||
| color: ${N}; | ||
| } | ||
@@ -989,3 +989,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${c}); | ||
| outline: 2px solid var(--cb-focus-color, ${d}); | ||
| outline-offset: 2px; | ||
@@ -1013,7 +1013,7 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${c}); | ||
| color: var(--cb-accent-color, ${d}); | ||
| --cb-icon-accent: #1C1917; | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${c}); | ||
| color: var(--cb-accent-color, ${d}); | ||
| --cb-icon-accent: #FFFFFF; | ||
@@ -1024,3 +1024,3 @@ } | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${c}); | ||
| color: var(--cb-accent-color, ${d}); | ||
| } | ||
@@ -1033,4 +1033,4 @@ | ||
| } | ||
| `,S=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"),i=this.getAttribute("variant"),d=this.getAttribute("shape"),s=this.getAttribute("popup"),p=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),i&&(this._options.variant=i),d&&(this._options.shape=d),s!==null&&(this._options.popup=s!=="false"),p!==null&&(this._options.popupTitle=p),b!==null&&(this._options.popupDescription=b),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false"}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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=C(t),i=this._options.size||"md",d=this._options.shape||"rounded",s=N[i],p=I[d][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,g=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${gt}</style> | ||
| `,S=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"),i=this.getAttribute("variant"),c=this.getAttribute("shape"),s=this.getAttribute("popup"),p=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),i&&(this._options.variant=i),c&&(this._options.shape=c),s!==null&&(this._options.popup=s!=="false"),p!==null&&(this._options.popupTitle=p),b!==null&&(this._options.popupDescription=b),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false"}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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=C(t),i=this._options.size||"md",c=this._options.shape||"rounded",s=q[i],p=I[c][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,u=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,g=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=` | ||
| <style>${vt}</style> | ||
| <button | ||
@@ -1040,3 +1040,3 @@ class="cb-btn" | ||
| style=" | ||
| ${O(r)} | ||
| ${L(r)} | ||
| --cb-bg: ${b}; | ||
@@ -1056,6 +1056,6 @@ --cb-border: ${u}; | ||
| > | ||
| <span class="cb-btn-icon" aria-hidden="true">${D}</span> | ||
| <span class="cb-btn-icon" aria-hidden="true">${M}</span> | ||
| <span class="cb-btn-label">Run on Cowork</span> | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:i,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}U({variant:"cowork",theme:this.getResolvedTheme(),title:r||"Run on Cowork",description:i||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===!0,onCopy:s=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};S.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];at()});var kt={};j(kt,{ClaudeCodeButton:()=>xt,CoworkButton:()=>Ct});module.exports=lt(kt);var l=require("react");function ft(){let a=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{a.current=!0},[]),a}var xt=({command:a,theme:n="branded",size:t="md",variant:o="filled",shape:e="rounded",popup:r=!0,promptFlag:i=!0,onCopy:d,popupTitle:s,popupDescription:p,className:b,style:u,onCbCopy:g,onCbOpen:m,onCbClose:h})=>{let v=(0,l.useRef)(null),y=(0,l.useRef)(null),V=ft(),w=(0,l.useRef)(g);w.current=g;let E=(0,l.useRef)(m);E.current=m;let $=(0,l.useRef)(h);return $.current=h,(0,l.useEffect)(()=>{if(v.current)return Promise.resolve().then(()=>(ot(),et)).then(({ClaudeCodeButton:f})=>{if(!v.current||y.current)return;let x=document.createElement("claude-code-button");y.current=x,x.addEventListener("cb-copy",(_=>w.current?.(_))),x.addEventListener("cb-open",(_=>E.current?.(_))),x.addEventListener("cb-close",(_=>$.current?.(_))),v.current.appendChild(x)}),()=>{let f=y.current,x=v.current;f&&x?.contains(f)&&x.removeChild(f),y.current=null}},[]),(0,l.useEffect)(()=>{let f=y.current;!f||!("options"in f)||(f.options={command:a,theme:n,size:t,variant:o,shape:e,popup:r,promptFlag:i,onCopy:d,popupTitle:s,popupDescription:p})},[a,n,t,o,e,r,i,d,s,p]),(0,l.createElement)("div",{ref:v,className:b,style:{display:"inline-block",...u},suppressHydrationWarning:!0})},Ct=({command:a,skillUrl:n,theme:t="branded",size:o="md",variant:e="filled",shape:r="rounded",popup:i=!0,autoLaunch:d,onCopy:s,onDownload:p,popupTitle:b,popupDescription:u,className:g,style:m,onCbCopy:h,onCbDownload:v,onCbOpen:y,onCbClose:V})=>{let w=(0,l.useRef)(null),E=(0,l.useRef)(null),$=(0,l.useRef)(h);$.current=h;let f=(0,l.useRef)(v);f.current=v;let x=(0,l.useRef)(y);x.current=y;let _=(0,l.useRef)(V);return _.current=V,(0,l.useEffect)(()=>{if(w.current)return Promise.resolve().then(()=>(nt(),rt)).then(({CoworkButton:F})=>{if(!w.current||E.current)return;let k=document.createElement("cowork-button");E.current=k,k.addEventListener("cb-copy",(A=>$.current?.(A))),k.addEventListener("cb-download",(A=>f.current?.(A))),k.addEventListener("cb-open",(A=>x.current?.(A))),k.addEventListener("cb-close",(A=>_.current?.(A))),w.current.appendChild(k)}),()=>{let F=E.current,k=w.current;F&&k?.contains(F)&&k.removeChild(F),E.current=null}},[]),(0,l.useEffect)(()=>{let F=E.current;!F||!("options"in F)||(F.options={command:a,skillUrl:n,theme:t,size:o,variant:e,shape:r,popup:i,autoLaunch:d,onCopy:s,onDownload:p,popupTitle:b,popupDescription:u})},[a,n,t,o,e,r,i,d,s,p,b,u]),(0,l.createElement)("div",{ref:w,className:g,style:{display:"inline-block",...m},suppressHydrationWarning:!0})};0&&(module.exports={ClaudeCodeButton,CoworkButton}); | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:i,autoLaunch:c}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}V({variant:"cowork",theme:this.getResolvedTheme(),title:r||"Run on Cowork",description:i||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:c===!0,onCopy:s=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};S.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];rt()});var yt={};j(yt,{ClaudeCodeButton:()=>Ct,CoworkButton:()=>kt});module.exports=pt(yt);var l=require("react");function xt(){let a=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{a.current=!0},[]),a}var Ct=({command:a,theme:n="branded",size:t="md",variant:o="filled",shape:e="rounded",popup:r=!0,promptFlag:i=!0,onCopy:c,popupTitle:s,popupDescription:p,className:b,style:u,onCbCopy:g,onCbOpen:m,onCbClose:h})=>{let v=(0,l.useRef)(null),y=(0,l.useRef)(null),K=xt(),w=(0,l.useRef)(g);w.current=g;let E=(0,l.useRef)(m);E.current=m;let $=(0,l.useRef)(h);return $.current=h,(0,l.useEffect)(()=>{if(v.current)return Promise.resolve().then(()=>(at(),ot)).then(({ClaudeCodeButton:f})=>{if(!v.current||y.current)return;let x=document.createElement("claude-code-button");y.current=x,x.addEventListener("cb-copy",(_=>w.current?.(_))),x.addEventListener("cb-open",(_=>E.current?.(_))),x.addEventListener("cb-close",(_=>$.current?.(_))),v.current.appendChild(x)}),()=>{let f=y.current,x=v.current;f&&x?.contains(f)&&x.removeChild(f),y.current=null}},[]),(0,l.useEffect)(()=>{let f=y.current;!f||!("options"in f)||(f.options={command:a,theme:n,size:t,variant:o,shape:e,popup:r,promptFlag:i,onCopy:c,popupTitle:s,popupDescription:p})},[a,n,t,o,e,r,i,c,s,p]),(0,l.createElement)("div",{ref:v,className:b,style:{display:"inline-block",...u},suppressHydrationWarning:!0})},kt=({command:a,skillUrl:n,theme:t="branded",size:o="md",variant:e="filled",shape:r="rounded",popup:i=!0,autoLaunch:c,onCopy:s,onDownload:p,popupTitle:b,popupDescription:u,className:g,style:m,onCbCopy:h,onCbDownload:v,onCbOpen:y,onCbClose:K})=>{let w=(0,l.useRef)(null),E=(0,l.useRef)(null),$=(0,l.useRef)(h);$.current=h;let f=(0,l.useRef)(v);f.current=v;let x=(0,l.useRef)(y);x.current=y;let _=(0,l.useRef)(K);return _.current=K,(0,l.useEffect)(()=>{if(w.current)return Promise.resolve().then(()=>(it(),nt)).then(({CoworkButton:A})=>{if(!w.current||E.current)return;let k=document.createElement("cowork-button");E.current=k,k.addEventListener("cb-copy",(F=>$.current?.(F))),k.addEventListener("cb-download",(F=>f.current?.(F))),k.addEventListener("cb-open",(F=>x.current?.(F))),k.addEventListener("cb-close",(F=>_.current?.(F))),w.current.appendChild(k)}),()=>{let A=E.current,k=w.current;A&&k?.contains(A)&&k.removeChild(A),E.current=null}},[]),(0,l.useEffect)(()=>{let A=E.current;!A||!("options"in A)||(A.options={command:a,skillUrl:n,theme:t,size:o,variant:e,shape:r,popup:i,autoLaunch:c,onCopy:s,onDownload:p,popupTitle:b,popupDescription:u})},[a,n,t,o,e,r,i,c,s,p,b,u]),(0,l.createElement)("div",{ref:w,className:g,style:{display:"inline-block",...m},suppressHydrationWarning:!0})};0&&(module.exports={ClaudeCodeButton,CoworkButton}); | ||
| //# sourceMappingURL=react.js.map |
+1
-1
@@ -1,2 +0,2 @@ | ||
| "use client";import{useRef as e,useEffect as k,createElement as P}from"react";function M(){let o=e(!1);return k(()=>{o.current=!0},[]),o}var N=({command:o,theme:C="branded",size:v="md",variant:E="filled",shape:m="rounded",popup:f=!0,promptFlag:b=!0,onCopy:p,popupTitle:L,popupDescription:y,className:g,style:w,onCbCopy:O,onCbOpen:x,onCbClose:B})=>{let s=e(null),u=e(null),H=M(),c=e(O);c.current=O;let i=e(x);i.current=x;let R=e(B);return R.current=B,k(()=>{if(s.current)return import("./claude-code-button-3PCMIJKZ.mjs").then(({ClaudeCodeButton:t})=>{if(!s.current||u.current)return;let n=document.createElement("claude-code-button");u.current=n,n.addEventListener("cb-copy",(d=>c.current?.(d))),n.addEventListener("cb-open",(d=>i.current?.(d))),n.addEventListener("cb-close",(d=>R.current?.(d))),s.current.appendChild(n)}),()=>{let t=u.current,n=s.current;t&&n?.contains(t)&&n.removeChild(t),u.current=null}},[]),k(()=>{let t=u.current;!t||!("options"in t)||(t.options={command:o,theme:C,size:v,variant:E,shape:m,popup:f,promptFlag:b,onCopy:p,popupTitle:L,popupDescription:y})},[o,C,v,E,m,f,b,p,L,y]),P("div",{ref:s,className:g,style:{display:"inline-block",...w},suppressHydrationWarning:!0})},T=({command:o,skillUrl:C,theme:v="branded",size:E="md",variant:m="filled",shape:f="rounded",popup:b=!0,autoLaunch:p,onCopy:L,onDownload:y,popupTitle:g,popupDescription:w,className:O,style:x,onCbCopy:B,onCbDownload:s,onCbOpen:u,onCbClose:H})=>{let c=e(null),i=e(null),R=e(B);R.current=B;let t=e(s);t.current=s;let n=e(u);n.current=u;let d=e(H);return d.current=H,k(()=>{if(c.current)return import("./cowork-button-Y7T6EUQM.mjs").then(({CoworkButton:l})=>{if(!c.current||i.current)return;let r=document.createElement("cowork-button");i.current=r,r.addEventListener("cb-copy",(a=>R.current?.(a))),r.addEventListener("cb-download",(a=>t.current?.(a))),r.addEventListener("cb-open",(a=>n.current?.(a))),r.addEventListener("cb-close",(a=>d.current?.(a))),c.current.appendChild(r)}),()=>{let l=i.current,r=c.current;l&&r?.contains(l)&&r.removeChild(l),i.current=null}},[]),k(()=>{let l=i.current;!l||!("options"in l)||(l.options={command:o,skillUrl:C,theme:v,size:E,variant:m,shape:f,popup:b,autoLaunch:p,onCopy:L,onDownload:y,popupTitle:g,popupDescription:w})},[o,C,v,E,m,f,b,p,L,y,g,w]),P("div",{ref:c,className:O,style:{display:"inline-block",...x},suppressHydrationWarning:!0})};export{N as ClaudeCodeButton,T as CoworkButton}; | ||
| "use client";import{useRef as e,useEffect as k,createElement as P}from"react";function M(){let o=e(!1);return k(()=>{o.current=!0},[]),o}var N=({command:o,theme:C="branded",size:v="md",variant:E="filled",shape:m="rounded",popup:f=!0,promptFlag:b=!0,onCopy:p,popupTitle:L,popupDescription:y,className:g,style:w,onCbCopy:O,onCbOpen:x,onCbClose:B})=>{let s=e(null),u=e(null),H=M(),c=e(O);c.current=O;let i=e(x);i.current=x;let R=e(B);return R.current=B,k(()=>{if(s.current)return import("./claude-code-button-B2PPY3KH.mjs").then(({ClaudeCodeButton:t})=>{if(!s.current||u.current)return;let n=document.createElement("claude-code-button");u.current=n,n.addEventListener("cb-copy",(d=>c.current?.(d))),n.addEventListener("cb-open",(d=>i.current?.(d))),n.addEventListener("cb-close",(d=>R.current?.(d))),s.current.appendChild(n)}),()=>{let t=u.current,n=s.current;t&&n?.contains(t)&&n.removeChild(t),u.current=null}},[]),k(()=>{let t=u.current;!t||!("options"in t)||(t.options={command:o,theme:C,size:v,variant:E,shape:m,popup:f,promptFlag:b,onCopy:p,popupTitle:L,popupDescription:y})},[o,C,v,E,m,f,b,p,L,y]),P("div",{ref:s,className:g,style:{display:"inline-block",...w},suppressHydrationWarning:!0})},T=({command:o,skillUrl:C,theme:v="branded",size:E="md",variant:m="filled",shape:f="rounded",popup:b=!0,autoLaunch:p,onCopy:L,onDownload:y,popupTitle:g,popupDescription:w,className:O,style:x,onCbCopy:B,onCbDownload:s,onCbOpen:u,onCbClose:H})=>{let c=e(null),i=e(null),R=e(B);R.current=B;let t=e(s);t.current=s;let n=e(u);n.current=u;let d=e(H);return d.current=H,k(()=>{if(c.current)return import("./cowork-button-JYKHXQT3.mjs").then(({CoworkButton:l})=>{if(!c.current||i.current)return;let r=document.createElement("cowork-button");i.current=r,r.addEventListener("cb-copy",(a=>R.current?.(a))),r.addEventListener("cb-download",(a=>t.current?.(a))),r.addEventListener("cb-open",(a=>n.current?.(a))),r.addEventListener("cb-close",(a=>d.current?.(a))),c.current.appendChild(r)}),()=>{let l=i.current,r=c.current;l&&r?.contains(l)&&r.removeChild(l),i.current=null}},[]),k(()=>{let l=i.current;!l||!("options"in l)||(l.options={command:o,skillUrl:C,theme:v,size:E,variant:m,shape:f,popup:b,autoLaunch:p,onCopy:L,onDownload:y,popupTitle:g,popupDescription:w})},[o,C,v,E,m,f,b,p,L,y,g,w]),P("div",{ref:c,className:O,style:{display:"inline-block",...x},suppressHydrationWarning:!0})};export{N as ClaudeCodeButton,T as CoworkButton}; | ||
| //# sourceMappingURL=react.mjs.map |
+47
-47
@@ -1,2 +0,2 @@ | ||
| "use strict";var O=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var q=(r,c)=>{for(var t in c)O(r,t,{get:c[t],enumerable:!0})},U=(r,c,t,o)=>{if(c&&typeof c=="object"||typeof c=="function")for(let e of I(c))!N.call(r,e)&&e!==t&&O(r,e,{get:()=>c[e],enumerable:!(o=H(c,e))||o.enumerable});return r};var V=r=>U(O({},"__esModule",{value:!0}),r);var J={};q(J,{ClaudeButtonsPlugin:()=>P,default:()=>G});module.exports=V(J);var k=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| "use strict";var L=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var U=(r,c)=>{for(var t in c)L(r,t,{get:c[t],enumerable:!0})},V=(r,c,t,o)=>{if(c&&typeof c=="object"||typeof c=="function")for(let e of I(c))!q.call(r,e)&&e!==t&&L(r,e,{get:()=>c[e],enumerable:!(o=H(c,e))||o.enumerable});return r};var K=r=>V(L({},"__esModule",{value:!0}),r);var Q={};U(Q,{ClaudeButtonsPlugin:()=>N,default:()=>J});module.exports=K(Q);var k=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Ears --> | ||
@@ -30,5 +30,5 @@ <rect x="3.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
| </svg>`;var D=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`;var z=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`;var L=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| </svg>`;var $=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| <rect x="4" y="5" width="16" height="11" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/> | ||
@@ -40,3 +40,3 @@ <path d="M4 8.5h16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| <path d="M8 16.5h8v3H8v-3z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/> | ||
| </svg>`;var n="#D4795C",g="#C06A4E",w="#B35E43",y={branded:{bg:n,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:n,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:n,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:n,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function b(r){return r!=="system"?y[r]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function f(r){return` | ||
| </svg>`;var s="#D4795C",g="#C06A4E",w="#B35E43",_="#F0B8A8",y={branded:{bg:s,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:s,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:s,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:s,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function b(r){return r!=="system"?y[r]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function f(r){return` | ||
| --cb-bg: ${r.bg}; | ||
@@ -52,3 +52,3 @@ --cb-text: ${r.text}; | ||
| --cb-code-text: ${r.codeText}; | ||
| `}var E={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},_={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"}};function j(){if(typeof navigator>"u")return!0;let r=navigator.userAgent||"";return!!(!r.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(r)||/Twitter for (iPhone|Android)/i.test(r)||/; wv\)/.test(r)||/Opera Mini|OPiOS/i.test(r))}function K(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function z(){return!(!K()||j())}var W=` | ||
| `}var E={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},A={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"}};function j(){if(typeof navigator>"u")return!0;let r=navigator.userAgent||"";return!!(!r.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(r)||/Twitter for (iPhone|Android)/i.test(r)||/; wv\)/.test(r)||/Opera Mini|OPiOS/i.test(r))}function W(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function P(){return!(!W()||j())}var Y=` | ||
| :host { | ||
@@ -412,4 +412,4 @@ position: fixed; | ||
| } | ||
| `,$=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(t){this._autoLaunchConsumed=!1,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 b(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?b("dark"):b("light");let e=o?b("dark"):b("light"),a=b(t);return{...e,primary:a.primary,primaryText:a.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:o,description:e,command:a,fullCommand:i,skillUrl:d,desktopLaunchUrl:s,autoLaunch:l}=this._options,p=this.resolvePopupTokens(),u=t==="claude-code"?k:C,v=t==="claude-code",m=i||a,h=s??"claude://",R=z();this.shadowRoot.innerHTML=` | ||
| <style>${W}</style> | ||
| `,B=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(t){this._autoLaunchConsumed=!1,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 b(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?b("dark"):b("light");let e=o?b("dark"):b("light"),a=b(t);return{...e,primary:a.primary,primaryText:a.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:o,description:e,command:a,fullCommand:n,skillUrl:d,desktopLaunchUrl:i,autoLaunch:l}=this._options,p=this.resolvePopupTokens(),u=t==="claude-code"?k:C,v=t==="claude-code",m=n||a,h=i??"claude://",D=P();this.shadowRoot.innerHTML=` | ||
| <style>${Y}</style> | ||
| <div style="${f(p)}"> | ||
@@ -424,3 +424,3 @@ <div class="cb-backdrop" data-action="close"></div> | ||
| </div> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${D}</button> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${z}</button> | ||
| </div> | ||
@@ -431,7 +431,7 @@ <div class="cb-dialog-body"> | ||
| <div class="cb-dialog-footer"> | ||
| ${v?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(h),R)} | ||
| ${v?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(h),D)} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),l&&!this._autoLaunchConsumed&&t==="cowork"&&R&&(this._autoLaunchConsumed=!0,this.openDesktopAppLink(h))}openDesktopAppLink(t){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:!0,composed:!0,detail:{href:t}})),typeof document>"u")return;let o=document.createElement("a");o.href=t,o.rel="noopener noreferrer",o.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>o.remove())}renderClaudeCodeBody(t){return` | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),l&&!this._autoLaunchConsumed&&t==="cowork"&&D&&(this._autoLaunchConsumed=!0,this.openDesktopAppLink(h))}openDesktopAppLink(t){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:!0,composed:!0,detail:{href:t}})),typeof document>"u")return;let o=document.createElement("a");o.href=t,o.rel="noopener noreferrer",o.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>o.remove())}renderClaudeCodeBody(t){return` | ||
| <div class="cb-step"> | ||
@@ -495,3 +495,3 @@ <div class="cb-step-num">1</div> | ||
| > | ||
| ${L} | ||
| ${$} | ||
| <span>Open Claude Desktop</span> | ||
@@ -507,3 +507,3 @@ </a>`:` | ||
| > | ||
| ${L} | ||
| ${$} | ||
| <span>Open Claude Desktop</span> | ||
@@ -515,3 +515,3 @@ </button>`} | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div> | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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 a=o.dataset.command||"";this.copyToClipboard(a,o)}else if(e==="launch-desktop"){t.preventDefault();let a=o.getAttribute("href")||"";this.openDesktopAppLink(a||o.href)}}),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)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}async copyToClipboard(t,o){try{await navigator.clipboard.writeText(t);let e=o.querySelector("span"),a=o,i=a.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),a.innerHTML=`${M}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),a.innerHTML=`${x}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",$);function F(r){let c=document.createElement("claude-popup-dialog");return c.options=r,document.body.appendChild(c),c}var Y=` | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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 a=o.dataset.command||"";this.copyToClipboard(a,o)}else if(e==="launch-desktop"){t.preventDefault();let a=o.getAttribute("href")||"";this.openDesktopAppLink(a||o.href)}}),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)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}async copyToClipboard(t,o){try{await navigator.clipboard.writeText(t);let e=o.querySelector("span"),a=o,n=a.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),a.innerHTML=`${M}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),a.innerHTML=`${x}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",B);function F(r){let c=document.createElement("claude-popup-dialog");return c.options=r,document.body.appendChild(c),c}var Z=` | ||
| :host { | ||
@@ -606,4 +606,4 @@ display: inline-block; | ||
| background: transparent; | ||
| border-color: ${n}; | ||
| color: ${n}; | ||
| border-color: ${s}; | ||
| color: ${s}; | ||
| } | ||
@@ -639,3 +639,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${n}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -654,3 +654,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${n}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -671,3 +671,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${n}; | ||
| color: ${_}; | ||
| } | ||
@@ -718,3 +718,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${n}); | ||
| outline: 2px solid var(--cb-focus-color, ${s}); | ||
| outline-offset: 2px; | ||
@@ -742,6 +742,6 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -751,3 +751,3 @@ | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -760,4 +760,4 @@ | ||
| } | ||
| `,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"),a=this.getAttribute("variant"),i=this.getAttribute("shape"),d=this.getAttribute("popup"),s=this.getAttribute("prompt-flag"),l=this.getAttribute("popup-title"),p=this.getAttribute("popup-description");t!==null&&(this._options.command=t),o&&(this._options.theme=o),e&&(this._options.size=e),a&&(this._options.variant=a),i&&(this._options.shape=i),d!==null&&(this._options.popup=d!=="false"),s!==null&&(this._options.promptFlag=s!=="false"),l!==null&&(this._options.popupTitle=l),p!==null&&(this._options.popupDescription=p)}updateLightDOM(){let{command:t}=this._options,o=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Claude Code: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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:`claude -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",a=b(t),i=this._options.size||"md",d=this._options.shape||"rounded",s=_[i],l=E[d][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let p=e!=="filled"?"transparent":a.bg,u=e==="ghost"?"transparent":e==="outline"?a.primary:a.border,v=e!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=` | ||
| <style>${Y}</style> | ||
| `,T=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"),a=this.getAttribute("variant"),n=this.getAttribute("shape"),d=this.getAttribute("popup"),i=this.getAttribute("prompt-flag"),l=this.getAttribute("popup-title"),p=this.getAttribute("popup-description");t!==null&&(this._options.command=t),o&&(this._options.theme=o),e&&(this._options.size=e),a&&(this._options.variant=a),n&&(this._options.shape=n),d!==null&&(this._options.popup=d!=="false"),i!==null&&(this._options.promptFlag=i!=="false"),l!==null&&(this._options.popupTitle=l),p!==null&&(this._options.popupDescription=p)}updateLightDOM(){let{command:t}=this._options,o=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Claude Code: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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:`claude -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",a=b(t),n=this._options.size||"md",d=this._options.shape||"rounded",i=A[n],l=E[d][n];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let p=e!=="filled"?"transparent":a.bg,u=e==="ghost"?"transparent":e==="outline"?a.primary:a.border,v=e!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=` | ||
| <style>${Z}</style> | ||
| <button | ||
@@ -773,7 +773,7 @@ class="cb-btn" | ||
| --cb-focus-color: ${a.primary}; | ||
| --cb-height: ${s.height}; | ||
| --cb-font-size: ${s.fontSize}; | ||
| --cb-icon-size: ${s.iconSize}; | ||
| --cb-padding: ${s.ccPadding}; | ||
| --cb-gap: ${s.gap}; | ||
| --cb-height: ${i.height}; | ||
| --cb-font-size: ${i.fontSize}; | ||
| --cb-icon-size: ${i.iconSize}; | ||
| --cb-padding: ${i.ccPadding}; | ||
| --cb-gap: ${i.gap}; | ||
| --cb-radius: ${l}; | ||
@@ -786,3 +786,3 @@ " | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:a}=this._options,i=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:i}})),t===!1){navigator.clipboard.writeText(i).then(()=>{this._options.onCopy?.(i),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:i}}))});return}F({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:a||"Execute this command in your terminal to get started.",command:o,fullCommand:i,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:d}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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 B(r="claude-code-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,A)}B();var Z=` | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:a}=this._options,n=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:n}})),t===!1){navigator.clipboard.writeText(n).then(()=>{this._options.onCopy?.(n),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:n}}))});return}F({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:a||"Execute this command in your terminal to get started.",command:o,fullCommand:n,onCopy:d=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:d}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};T.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function R(r="claude-code-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,T)}R();var G=` | ||
| :host { | ||
@@ -877,4 +877,4 @@ display: inline-block; | ||
| background: transparent; | ||
| border-color: ${n}; | ||
| color: ${n}; | ||
| border-color: ${s}; | ||
| color: ${s}; | ||
| } | ||
@@ -910,3 +910,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${n}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -925,3 +925,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${n}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -942,3 +942,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${n}; | ||
| color: ${_}; | ||
| } | ||
@@ -989,3 +989,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${n}); | ||
| outline: 2px solid var(--cb-focus-color, ${s}); | ||
| outline-offset: 2px; | ||
@@ -1013,7 +1013,7 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| --cb-icon-accent: #1C1917; | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| --cb-icon-accent: #FFFFFF; | ||
@@ -1024,3 +1024,3 @@ } | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -1033,4 +1033,4 @@ | ||
| } | ||
| `,T=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"),a=this.getAttribute("size"),i=this.getAttribute("variant"),d=this.getAttribute("shape"),s=this.getAttribute("popup"),l=this.getAttribute("popup-title"),p=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),a&&(this._options.size=a),i&&(this._options.variant=i),d&&(this._options.shape=d),s!==null&&(this._options.popup=s!=="false"),l!==null&&(this._options.popupTitle=l),p!==null&&(this._options.popupDescription=p),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false"}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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",a=b(t),i=this._options.size||"md",d=this._options.shape||"rounded",s=_[i],l=E[d][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let p=e!=="filled"?"transparent":a.bg,u=e==="ghost"?"transparent":e==="outline"?a.primary:a.border,v=e!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=` | ||
| <style>${Z}</style> | ||
| `,O=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"),a=this.getAttribute("size"),n=this.getAttribute("variant"),d=this.getAttribute("shape"),i=this.getAttribute("popup"),l=this.getAttribute("popup-title"),p=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),a&&(this._options.size=a),n&&(this._options.variant=n),d&&(this._options.shape=d),i!==null&&(this._options.popup=i!=="false"),l!==null&&(this._options.popupTitle=l),p!==null&&(this._options.popupDescription=p),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false"}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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",a=b(t),n=this._options.size||"md",d=this._options.shape||"rounded",i=A[n],l=E[d][n];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let p=e!=="filled"?"transparent":a.bg,u=e==="ghost"?"transparent":e==="outline"?a.primary:a.border,v=e!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=` | ||
| <style>${G}</style> | ||
| <button | ||
@@ -1046,7 +1046,7 @@ class="cb-btn" | ||
| --cb-focus-color: ${a.primary}; | ||
| --cb-height: ${s.height}; | ||
| --cb-font-size: ${s.fontSize}; | ||
| --cb-icon-size: ${s.iconSize}; | ||
| --cb-padding: ${s.padding}; | ||
| --cb-gap: ${s.gap}; | ||
| --cb-height: ${i.height}; | ||
| --cb-font-size: ${i.fontSize}; | ||
| --cb-icon-size: ${i.iconSize}; | ||
| --cb-padding: ${i.padding}; | ||
| --cb-gap: ${i.gap}; | ||
| --cb-radius: ${l}; | ||
@@ -1059,3 +1059,3 @@ " | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:a,popupDescription:i,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}F({variant:"cowork",theme:this.getResolvedTheme(),title:a||"Run on Cowork",description:i||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===!0,onCopy:s=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};T.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function S(r="cowork-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,T)}S();var P={install(r){if(B(),S(),r.config?.compilerOptions){let c=r.config.compilerOptions.isCustomElement;r.config.compilerOptions.isCustomElement=t=>t==="claude-code-button"||t==="cowork-button"||t==="claude-popup-dialog"?!0:c?.(t)??!1}}},G=P;0&&(module.exports={ClaudeButtonsPlugin}); | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:a,popupDescription:n,autoLaunch:d}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}F({variant:"cowork",theme:this.getResolvedTheme(),title:a||"Run on Cowork",description:n||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:d===!0,onCopy:i=>{this._options.onCopy?.(i),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:i}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};O.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function S(r="cowork-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,O)}S();var N={install(r){if(R(),S(),r.config?.compilerOptions){let c=r.config.compilerOptions.isCustomElement;r.config.compilerOptions.isCustomElement=t=>t==="claude-code-button"||t==="cowork-button"||t==="claude-popup-dialog"?!0:c?.(t)??!1}}},J=N;0&&(module.exports={ClaudeButtonsPlugin}); | ||
| //# sourceMappingURL=vue.js.map |
+41
-41
@@ -28,7 +28,7 @@ var k=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`,R=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| </svg>`,D=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
| </svg>`;var M=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`;var O=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| </svg>`;var L=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| <rect x="4" y="5" width="16" height="11" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/> | ||
@@ -40,3 +40,3 @@ <path d="M4 8.5h16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| <path d="M8 16.5h8v3H8v-3z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/> | ||
| </svg>`;var n="#D4795C",g="#C06A4E",w="#B35E43",y={branded:{bg:n,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:n,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:n,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:n,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function p(r){return r!=="system"?y[r]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function f(r){return` | ||
| </svg>`;var s="#D4795C",g="#C06A4E",w="#B35E43",_="#F0B8A8",y={branded:{bg:s,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:s,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:s,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:s,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function p(r){return r!=="system"?y[r]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function f(r){return` | ||
| --cb-bg: ${r.bg}; | ||
@@ -52,3 +52,3 @@ --cb-text: ${r.text}; | ||
| --cb-code-text: ${r.codeText}; | ||
| `}var E={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},_={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"}};function z(){if(typeof navigator>"u")return!0;let r=navigator.userAgent||"";return!!(!r.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(r)||/Twitter for (iPhone|Android)/i.test(r)||/; wv\)/.test(r)||/Opera Mini|OPiOS/i.test(r))}function P(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function D(){return!(!P()||z())}var H=` | ||
| `}var E={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},A={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"}};function P(){if(typeof navigator>"u")return!0;let r=navigator.userAgent||"";return!!(!r.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(r)||/Twitter for (iPhone|Android)/i.test(r)||/; wv\)/.test(r)||/Opera Mini|OPiOS/i.test(r))}function N(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function z(){return!(!N()||P())}var H=` | ||
| :host { | ||
@@ -412,3 +412,3 @@ position: fixed; | ||
| } | ||
| `,L=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(t){this._autoLaunchConsumed=!1,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"),a=p(t);return{...e,primary:a.primary,primaryText:a.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:o,description:e,command:a,fullCommand:i,skillUrl:c,desktopLaunchUrl:s,autoLaunch:d}=this._options,l=this.resolvePopupTokens(),u=t==="claude-code"?k:C,v=t==="claude-code",m=i||a,b=s??"claude://",S=D();this.shadowRoot.innerHTML=` | ||
| `,$=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(t){this._autoLaunchConsumed=!1,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"),a=p(t);return{...e,primary:a.primary,primaryText:a.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:o,description:e,command:a,fullCommand:n,skillUrl:c,desktopLaunchUrl:i,autoLaunch:d}=this._options,l=this.resolvePopupTokens(),u=t==="claude-code"?k:C,v=t==="claude-code",m=n||a,b=i??"claude://",S=z();this.shadowRoot.innerHTML=` | ||
| <style>${H}</style> | ||
@@ -493,3 +493,3 @@ <div style="${f(l)}"> | ||
| > | ||
| ${O} | ||
| ${L} | ||
| <span>Open Claude Desktop</span> | ||
@@ -505,3 +505,3 @@ </a>`:` | ||
| > | ||
| ${O} | ||
| ${L} | ||
| <span>Open Claude Desktop</span> | ||
@@ -513,3 +513,3 @@ </button>`} | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div> | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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 a=o.dataset.command||"";this.copyToClipboard(a,o)}else if(e==="launch-desktop"){t.preventDefault();let a=o.getAttribute("href")||"";this.openDesktopAppLink(a||o.href)}}),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)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}async copyToClipboard(t,o){try{await navigator.clipboard.writeText(t);let e=o.querySelector("span"),a=o,i=a.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),a.innerHTML=`${R}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),a.innerHTML=`${x}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",L);function F(r){let h=document.createElement("claude-popup-dialog");return h.options=r,document.body.appendChild(h),h}var I=` | ||
| `}escapeHref(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}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 a=o.dataset.command||"";this.copyToClipboard(a,o)}else if(e==="launch-desktop"){t.preventDefault();let a=o.getAttribute("href")||"";this.openDesktopAppLink(a||o.href)}}),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)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}async copyToClipboard(t,o){try{await navigator.clipboard.writeText(t);let e=o.querySelector("span"),a=o,n=a.querySelector(".cb-icon-sm")?.outerHTML||"";o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),a.innerHTML=`${D}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),a.innerHTML=`${x}<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(".cb-dialog"),o=this.shadowRoot?.querySelector(".cb-backdrop");t&&(t.style.animation="cb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="cb-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,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",$);function F(r){let h=document.createElement("claude-popup-dialog");return h.options=r,document.body.appendChild(h),h}var I=` | ||
| :host { | ||
@@ -604,4 +604,4 @@ display: inline-block; | ||
| background: transparent; | ||
| border-color: ${n}; | ||
| color: ${n}; | ||
| border-color: ${s}; | ||
| color: ${s}; | ||
| } | ||
@@ -637,3 +637,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${n}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -652,3 +652,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${n}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -669,3 +669,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${n}; | ||
| color: ${_}; | ||
| } | ||
@@ -716,3 +716,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${n}); | ||
| outline: 2px solid var(--cb-focus-color, ${s}); | ||
| outline-offset: 2px; | ||
@@ -740,6 +740,6 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -749,3 +749,3 @@ | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -758,3 +758,3 @@ | ||
| } | ||
| `,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"),a=this.getAttribute("variant"),i=this.getAttribute("shape"),c=this.getAttribute("popup"),s=this.getAttribute("prompt-flag"),d=this.getAttribute("popup-title"),l=this.getAttribute("popup-description");t!==null&&(this._options.command=t),o&&(this._options.theme=o),e&&(this._options.size=e),a&&(this._options.variant=a),i&&(this._options.shape=i),c!==null&&(this._options.popup=c!=="false"),s!==null&&(this._options.promptFlag=s!=="false"),d!==null&&(this._options.popupTitle=d),l!==null&&(this._options.popupDescription=l)}updateLightDOM(){let{command:t}=this._options,o=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Claude Code: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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:`claude -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",a=p(t),i=this._options.size||"md",c=this._options.shape||"rounded",s=_[i],d=E[c][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let l=e!=="filled"?"transparent":a.bg,u=e==="ghost"?"transparent":e==="outline"?a.primary:a.border,v=e!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=` | ||
| `,T=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"),a=this.getAttribute("variant"),n=this.getAttribute("shape"),c=this.getAttribute("popup"),i=this.getAttribute("prompt-flag"),d=this.getAttribute("popup-title"),l=this.getAttribute("popup-description");t!==null&&(this._options.command=t),o&&(this._options.theme=o),e&&(this._options.size=e),a&&(this._options.variant=a),n&&(this._options.shape=n),c!==null&&(this._options.popup=c!=="false"),i!==null&&(this._options.promptFlag=i!=="false"),d!==null&&(this._options.popupTitle=d),l!==null&&(this._options.popupDescription=l)}updateLightDOM(){let{command:t}=this._options,o=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Claude Code: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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://claude.ai/code?command=${encodeURIComponent(o)}`,e.textContent=`Run on Claude Code: ${t}`,e.setAttribute("data-platform","claude-code"),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:`claude -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",a=p(t),n=this._options.size||"md",c=this._options.shape||"rounded",i=A[n],d=E[c][n];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let l=e!=="filled"?"transparent":a.bg,u=e==="ghost"?"transparent":e==="outline"?a.primary:a.border,v=e!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=` | ||
| <style>${I}</style> | ||
@@ -771,7 +771,7 @@ <button | ||
| --cb-focus-color: ${a.primary}; | ||
| --cb-height: ${s.height}; | ||
| --cb-font-size: ${s.fontSize}; | ||
| --cb-icon-size: ${s.iconSize}; | ||
| --cb-padding: ${s.ccPadding}; | ||
| --cb-gap: ${s.gap}; | ||
| --cb-height: ${i.height}; | ||
| --cb-font-size: ${i.fontSize}; | ||
| --cb-icon-size: ${i.iconSize}; | ||
| --cb-padding: ${i.ccPadding}; | ||
| --cb-gap: ${i.gap}; | ||
| --cb-radius: ${d}; | ||
@@ -784,3 +784,3 @@ " | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:a}=this._options,i=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:i}})),t===!1){navigator.clipboard.writeText(i).then(()=>{this._options.onCopy?.(i),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:i}}))});return}F({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:a||"Execute this command in your terminal to get started.",command:o,fullCommand:i,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:c}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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="claude-code-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,A)}$();var N=` | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:a}=this._options,n=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:n}})),t===!1){navigator.clipboard.writeText(n).then(()=>{this._options.onCopy?.(n),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:n}}))});return}F({variant:"claude-code",theme:this.getResolvedTheme(),title:e||"Run on Claude Code",description:a||"Execute this command in your terminal to get started.",command:o,fullCommand:n,onCopy:c=>{this._options.onCopy?.(c),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:c}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};T.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function B(r="claude-code-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,T)}B();var q=` | ||
| :host { | ||
@@ -875,4 +875,4 @@ display: inline-block; | ||
| background: transparent; | ||
| border-color: ${n}; | ||
| color: ${n}; | ||
| border-color: ${s}; | ||
| color: ${s}; | ||
| } | ||
@@ -908,3 +908,3 @@ :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${n}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
@@ -923,3 +923,3 @@ } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${n}; | ||
| border-color: ${s}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
@@ -940,3 +940,3 @@ } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${n}; | ||
| color: ${_}; | ||
| } | ||
@@ -987,3 +987,3 @@ :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${n}); | ||
| outline: 2px solid var(--cb-focus-color, ${s}); | ||
| outline-offset: 2px; | ||
@@ -1011,7 +1011,7 @@ } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| --cb-icon-accent: #1C1917; | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| --cb-icon-accent: #FFFFFF; | ||
@@ -1022,3 +1022,3 @@ } | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${n}); | ||
| color: var(--cb-accent-color, ${s}); | ||
| } | ||
@@ -1031,4 +1031,4 @@ | ||
| } | ||
| `,T=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"),a=this.getAttribute("size"),i=this.getAttribute("variant"),c=this.getAttribute("shape"),s=this.getAttribute("popup"),d=this.getAttribute("popup-title"),l=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),a&&(this._options.size=a),i&&(this._options.variant=i),c&&(this._options.shape=c),s!==null&&(this._options.popup=s!=="false"),d!==null&&(this._options.popupTitle=d),l!==null&&(this._options.popupDescription=l),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false"}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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",a=p(t),i=this._options.size||"md",c=this._options.shape||"rounded",s=_[i],d=E[c][i];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let l=e!=="filled"?"transparent":a.bg,u=e==="ghost"?"transparent":e==="outline"?a.primary:a.border,v=e!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=` | ||
| <style>${N}</style> | ||
| `,O=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"),a=this.getAttribute("size"),n=this.getAttribute("variant"),c=this.getAttribute("shape"),i=this.getAttribute("popup"),d=this.getAttribute("popup-title"),l=this.getAttribute("popup-description"),u=this.getAttribute("auto-launch");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),a&&(this._options.size=a),n&&(this._options.variant=n),c&&(this._options.shape=c),i!==null&&(this._options.popup=i!=="false"),d!==null&&(this._options.popupTitle=d),l!==null&&(this._options.popupDescription=l),u===null?delete this._options.autoLaunch:this._options.autoLaunch=u!=="false"}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-cb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-cb-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 Cowork: ${t}`,e.setAttribute("data-platform","cowork"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://claude.ai/cowork?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",a=p(t),n=this._options.size||"md",c=this._options.shape||"rounded",i=A[n],d=E[c][n];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let l=e!=="filled"?"transparent":a.bg,u=e==="ghost"?"transparent":e==="outline"?a.primary:a.border,v=e!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=` | ||
| <style>${q}</style> | ||
| <button | ||
@@ -1044,7 +1044,7 @@ class="cb-btn" | ||
| --cb-focus-color: ${a.primary}; | ||
| --cb-height: ${s.height}; | ||
| --cb-font-size: ${s.fontSize}; | ||
| --cb-icon-size: ${s.iconSize}; | ||
| --cb-padding: ${s.padding}; | ||
| --cb-gap: ${s.gap}; | ||
| --cb-height: ${i.height}; | ||
| --cb-font-size: ${i.fontSize}; | ||
| --cb-icon-size: ${i.iconSize}; | ||
| --cb-padding: ${i.padding}; | ||
| --cb-gap: ${i.gap}; | ||
| --cb-radius: ${d}; | ||
@@ -1057,3 +1057,3 @@ " | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:a,popupDescription:i,autoLaunch:c}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}F({variant:"cowork",theme:this.getResolvedTheme(),title:a||"Run on Cowork",description:i||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:c===!0,onCopy:s=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};T.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function B(r="cowork-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,T)}B();var q={install(r){if($(),B(),r.config?.compilerOptions){let h=r.config.compilerOptions.isCustomElement;r.config.compilerOptions.isCustomElement=t=>t==="claude-code-button"||t==="cowork-button"||t==="claude-popup-dialog"?!0:h?.(t)??!1}}},st=q;export{q as ClaudeButtonsPlugin,st as default}; | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:a,popupDescription:n,autoLaunch:c}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}F({variant:"cowork",theme:this.getResolvedTheme(),title:a||"Run on Cowork",description:n||"Copy and paste into a Cowork session to get started.",command:o,skillUrl:e,autoLaunch:c===!0,onCopy:i=>{this._options.onCopy?.(i),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:i}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-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)}};O.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function R(r="cowork-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,O)}R();var U={install(r){if(B(),R(),r.config?.compilerOptions){let h=r.config.compilerOptions.isCustomElement;r.config.compilerOptions.isCustomElement=t=>t==="claude-code-button"||t==="cowork-button"||t==="claude-popup-dialog"?!0:h?.(t)??!1}}},ct=U;export{U as ClaudeButtonsPlugin,ct as default}; | ||
| //# sourceMappingURL=vue.mjs.map |
+1
-1
| { | ||
| "name": "claudebuttons", | ||
| "version": "1.2.3", | ||
| "version": "1.2.4", | ||
| "description": "Drop-in \"Run on Claude Code\" and \"Run on Cowork\" buttons for any website or framework", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
| var g=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Ears --> | ||
| <rect x="3.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <rect x="15.5" y="1.5" width="5" height="5" rx="1.5" fill="currentColor"/> | ||
| <!-- Body --> | ||
| <rect x="2.5" y="5.5" width="19" height="13" rx="3" fill="currentColor"/> | ||
| <!-- Eyes --> | ||
| <ellipse cx="9" cy="11.5" rx="2" ry="2.5" fill="white" opacity="0.95"/> | ||
| <ellipse cx="15" cy="11.5" rx="2" ry="2.5" fill="white" opacity="0.95"/> | ||
| <!-- Pupils --> | ||
| <ellipse cx="9.6" cy="12" rx="1" ry="1.2" fill="#1C1917"/> | ||
| <ellipse cx="15.6" cy="12" rx="1" ry="1.2" fill="#1C1917"/> | ||
| <!-- Legs --> | ||
| <rect x="6.5" y="18.5" width="4" height="3.5" rx="1.5" fill="currentColor"/> | ||
| <rect x="13.5" y="18.5" width="4" height="3.5" rx="1.5" fill="currentColor"/> | ||
| </svg>`,f=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon"> | ||
| <!-- Lightning bolt --> | ||
| <path d="M13.5 2L5 13.5h5.5L9 22l10-12h-5.5L15.5 2h-2z" fill="currentColor"/> | ||
| <!-- Circuit path --> | ||
| <path d="M12.8 7.2L10.2 11.5l2.2 4" stroke="var(--cb-icon-accent, white)" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" fill="none"/> | ||
| <!-- Circuit nodes --> | ||
| <circle cx="12.8" cy="7.2" r="1.3" fill="var(--cb-icon-accent, white)"/> | ||
| <circle cx="10.2" cy="11.5" r="1.3" fill="var(--cb-icon-accent, white)"/> | ||
| <circle cx="12.4" cy="15.5" r="1.3" fill="var(--cb-icon-accent, white)"/> | ||
| </svg>`,s=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <rect x="5" y="5" width="8" height="8" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/> | ||
| <path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`,v=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
| </svg>`;var y=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-icon-sm"> | ||
| <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| </svg>`;var p=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="cb-launch-svg"> | ||
| <rect x="4" y="5" width="16" height="11" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/> | ||
| <path d="M4 8.5h16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| <circle cx="6.5" cy="7" r="0.65" fill="currentColor"/> | ||
| <circle cx="8.5" cy="7" r="0.65" fill="currentColor"/> | ||
| <path d="M9 19.5h6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> | ||
| <path d="M8 16.5h8v3H8v-3z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/> | ||
| </svg>`;var c="#D4795C",b="#C06A4E",$="#B35E43",d={branded:{bg:c,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:c,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},"branded-alt":{bg:"#6B5CE7",text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1C1917",muted:"#78716C",primary:"#6B5CE7",primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"},dark:{bg:"#1C1917",text:"#F5F0EB",border:"#3D3530",surface:"#292524",surfaceText:"#F5F0EB",muted:"#A8A29E",primary:c,primaryText:"#FFFFFF",codeBg:"#0C0A09",codeText:"#F5F0EB"},light:{bg:"#FFFFFF",text:"#1C1917",border:"#E7E5E4",surface:"#FAFAF9",surfaceText:"#1C1917",muted:"#78716C",primary:c,primaryText:"#FFFFFF",codeBg:"#1C1917",codeText:"#F5F0EB"}};function n(r){return r!=="system"?d[r]:typeof window>"u"?d.light:window.matchMedia("(prefers-color-scheme: dark)").matches?d.dark:d.light}function w(r){return` | ||
| --cb-bg: ${r.bg}; | ||
| --cb-text: ${r.text}; | ||
| --cb-border: ${r.border}; | ||
| --cb-surface: ${r.surface}; | ||
| --cb-surface-text: ${r.surfaceText}; | ||
| --cb-muted: ${r.muted}; | ||
| --cb-primary: ${r.primary}; | ||
| --cb-primary-text: ${r.primaryText}; | ||
| --cb-code-bg: ${r.codeBg}; | ||
| --cb-code-text: ${r.codeText}; | ||
| `}var P={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},S={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"}};function A(){if(typeof navigator>"u")return!0;let r=navigator.userAgent||"";return!!(!r.trim()||/\bFBAN\b|\bFBAV\b|FB_IAB|Instagram|Line\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(r)||/Twitter for (iPhone|Android)/i.test(r)||/; wv\)/.test(r)||/Opera Mini|OPiOS/i.test(r))}function _(){return typeof window<"u"&&typeof document<"u"&&typeof document.createElement=="function"}function k(){return!(!_()||A())}var M=` | ||
| :host { | ||
| position: fixed; | ||
| inset: 0; | ||
| z-index: 999999; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; | ||
| } | ||
| * { box-sizing: border-box; margin: 0; padding: 0; } | ||
| .cb-backdrop { | ||
| position: absolute; | ||
| inset: 0; | ||
| background: rgba(0, 0, 0, 0.5); | ||
| backdrop-filter: blur(4px); | ||
| -webkit-backdrop-filter: blur(4px); | ||
| animation: cb-fade-in 0.15s ease-out; | ||
| } | ||
| .cb-dialog { | ||
| position: relative; | ||
| width: 90%; | ||
| max-width: 460px; | ||
| background: var(--cb-surface); | ||
| color: var(--cb-surface-text); | ||
| border-radius: 16px; | ||
| box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--cb-border); | ||
| overflow: hidden; | ||
| animation: cb-scale-in 0.2s ease-out; | ||
| } | ||
| .cb-dialog-header { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 12px; | ||
| padding: 20px 24px 16px; | ||
| border-bottom: 1px solid var(--cb-border); | ||
| } | ||
| .cb-dialog-header-icon { | ||
| width: 36px; | ||
| height: 36px; | ||
| color: var(--cb-primary); | ||
| flex-shrink: 0; | ||
| } | ||
| .cb-dialog-header-text { | ||
| flex: 1; | ||
| min-width: 0; | ||
| } | ||
| .cb-dialog-title { | ||
| font-size: 16px; | ||
| font-weight: 600; | ||
| line-height: 1.3; | ||
| color: var(--cb-surface-text); | ||
| } | ||
| .cb-dialog-description { | ||
| font-size: 13px; | ||
| color: var(--cb-muted); | ||
| margin-top: 2px; | ||
| line-height: 1.4; | ||
| } | ||
| .cb-dialog-close { | ||
| width: 32px; | ||
| height: 32px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| border: none; | ||
| background: transparent; | ||
| color: var(--cb-muted); | ||
| cursor: pointer; | ||
| border-radius: 8px; | ||
| flex-shrink: 0; | ||
| transition: background 0.15s, color 0.15s; | ||
| } | ||
| .cb-dialog-close:hover { | ||
| background: var(--cb-border); | ||
| color: var(--cb-surface-text); | ||
| } | ||
| .cb-dialog-close svg { width: 14px; height: 14px; } | ||
| .cb-dialog-body { padding: 20px 24px; } | ||
| .cb-step { | ||
| display: flex; | ||
| gap: 12px; | ||
| margin-bottom: 16px; | ||
| } | ||
| .cb-step:last-child { margin-bottom: 0; } | ||
| .cb-step-num { | ||
| width: 24px; | ||
| height: 24px; | ||
| border-radius: 50%; | ||
| background: var(--cb-primary); | ||
| color: var(--cb-primary-text); | ||
| font-size: 12px; | ||
| font-weight: 600; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| flex-shrink: 0; | ||
| margin-top: 1px; | ||
| } | ||
| .cb-step-content { | ||
| flex: 1; | ||
| min-width: 0; | ||
| } | ||
| .cb-step-label { | ||
| font-size: 13px; | ||
| font-weight: 500; | ||
| color: var(--cb-surface-text); | ||
| margin-bottom: 8px; | ||
| line-height: 1.4; | ||
| } | ||
| .cb-code-block { | ||
| display: flex; | ||
| align-items: center; | ||
| background: var(--cb-code-bg); | ||
| color: var(--cb-code-text); | ||
| border-radius: 10px; | ||
| padding: 2px 2px 2px 14px; | ||
| font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace; | ||
| font-size: 13px; | ||
| line-height: 1.5; | ||
| gap: 8px; | ||
| overflow: hidden; | ||
| } | ||
| .cb-code-text { | ||
| flex: 1; | ||
| overflow-x: auto; | ||
| white-space: nowrap; | ||
| padding: 10px 0; | ||
| scrollbar-width: none; | ||
| } | ||
| .cb-code-text::-webkit-scrollbar { display: none; } | ||
| .cb-code-prefix { | ||
| color: var(--cb-muted); | ||
| user-select: none; | ||
| margin-right: 6px; | ||
| } | ||
| .cb-copy-btn { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 6px; | ||
| height: 36px; | ||
| min-width: 36px; | ||
| padding: 0 12px; | ||
| border: none; | ||
| background: var(--cb-primary); | ||
| color: var(--cb-primary-text); | ||
| cursor: pointer; | ||
| border-radius: 8px; | ||
| font-family: inherit; | ||
| font-size: 12px; | ||
| font-weight: 500; | ||
| flex-shrink: 0; | ||
| transition: background 0.15s, transform 0.1s; | ||
| white-space: nowrap; | ||
| } | ||
| .cb-copy-btn:hover { background: ${b}; } | ||
| .cb-copy-btn:active { transform: scale(0.96); } | ||
| .cb-copy-btn svg { width: 14px; height: 14px; } | ||
| .cb-copy-btn[data-copied="true"] { | ||
| background: #16a34a; | ||
| } | ||
| .cb-dialog-footer { | ||
| padding: 16px 24px 20px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 10px; | ||
| } | ||
| .cb-action-btn { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 8px; | ||
| width: 100%; | ||
| height: 44px; | ||
| border: none; | ||
| background: var(--cb-primary); | ||
| color: var(--cb-primary-text); | ||
| cursor: pointer; | ||
| border-radius: 10px; | ||
| font-family: inherit; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
| transition: background 0.15s, transform 0.1s; | ||
| } | ||
| .cb-action-btn:hover { background: ${b}; } | ||
| .cb-action-btn:active { transform: scale(0.98); } | ||
| .cb-action-btn svg { width: 16px; height: 16px; } | ||
| .cb-hint { | ||
| font-size: 12px; | ||
| color: var(--cb-muted); | ||
| text-align: center; | ||
| line-height: 1.4; | ||
| } | ||
| .cb-hint kbd { | ||
| display: inline-block; | ||
| padding: 1px 5px; | ||
| font-family: inherit; | ||
| font-size: 11px; | ||
| background: var(--cb-border); | ||
| border-radius: 4px; | ||
| border: 1px solid var(--cb-border); | ||
| } | ||
| .cb-launch-btn { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 10px; | ||
| width: 100%; | ||
| min-height: 48px; | ||
| padding: 12px 18px; | ||
| border-radius: 12px; | ||
| font-family: inherit; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
| letter-spacing: -0.02em; | ||
| text-decoration: none; | ||
| cursor: pointer; | ||
| transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease, color 0.2s ease; | ||
| -webkit-tap-highlight-color: transparent; | ||
| } | ||
| .cb-launch-btn:active:not(:disabled) { transform: scale(0.99); } | ||
| .cb-launch-btn .cb-launch-svg { | ||
| width: 22px; | ||
| height: 22px; | ||
| flex-shrink: 0; | ||
| } | ||
| .cb-launch-btn--desktop { | ||
| color: var(--cb-surface-text); | ||
| background: linear-gradient( | ||
| 165deg, | ||
| color-mix(in srgb, var(--cb-primary) 14%, var(--cb-surface)) 0%, | ||
| var(--cb-surface) 55% | ||
| ); | ||
| border: 1.5px solid color-mix(in srgb, var(--cb-primary) 38%, var(--cb-border)); | ||
| box-shadow: | ||
| 0 1px 0 color-mix(in srgb, white 55%, transparent) inset, | ||
| 0 4px 14px -4px color-mix(in srgb, var(--cb-primary) 35%, transparent); | ||
| } | ||
| .cb-launch-btn--desktop:hover:not(:disabled) { | ||
| border-color: color-mix(in srgb, var(--cb-primary) 72%, var(--cb-border)); | ||
| box-shadow: | ||
| 0 1px 0 color-mix(in srgb, white 45%, transparent) inset, | ||
| 0 8px 24px -6px color-mix(in srgb, var(--cb-primary) 45%, transparent); | ||
| } | ||
| .cb-launch-btn--desktop:focus-visible { | ||
| outline: 2px solid var(--cb-primary); | ||
| outline-offset: 2px; | ||
| } | ||
| .cb-launch-btn:disabled { | ||
| opacity: 0.55; | ||
| cursor: not-allowed; | ||
| filter: saturate(0.7); | ||
| box-shadow: none; | ||
| } | ||
| .cb-launch-btn--desktop:disabled { | ||
| background: var(--cb-border); | ||
| border-color: var(--cb-border); | ||
| color: var(--cb-muted); | ||
| } | ||
| .cb-launch-btn:disabled .cb-launch-svg { | ||
| opacity: 0.75; | ||
| } | ||
| .cb-launch-sub { | ||
| display: block; | ||
| margin-top: 6px; | ||
| font-size: 11px; | ||
| font-weight: 500; | ||
| color: var(--cb-muted); | ||
| line-height: 1.35; | ||
| text-align: center; | ||
| } | ||
| @keyframes cb-fade-in { | ||
| from { opacity: 0; } | ||
| to { opacity: 1; } | ||
| } | ||
| @keyframes cb-scale-in { | ||
| from { opacity: 0; transform: scale(0.95) translateY(8px); } | ||
| to { opacity: 1; transform: scale(1) translateY(0); } | ||
| } | ||
| @media (max-width: 480px) { | ||
| .cb-dialog { | ||
| width: 96%; | ||
| max-width: none; | ||
| border-radius: 14px; | ||
| max-height: 90dvh; | ||
| overflow-y: auto; | ||
| overscroll-behavior: contain; | ||
| } | ||
| .cb-dialog-header { padding: 16px 16px 12px; gap: 10px; } | ||
| .cb-dialog-header-icon { width: 28px; height: 28px; } | ||
| .cb-dialog-body { padding: 16px; } | ||
| .cb-dialog-footer { padding: 12px 16px 16px; } | ||
| .cb-step { gap: 10px; margin-bottom: 14px; } | ||
| .cb-step-num { width: 22px; height: 22px; font-size: 11px; } | ||
| .cb-step-label { font-size: 12px; margin-bottom: 6px; } | ||
| .cb-code-block { font-size: 12px; padding: 2px 2px 2px 10px; border-radius: 8px; } | ||
| .cb-copy-btn { height: 32px; padding: 0 10px; font-size: 11px; border-radius: 6px; } | ||
| .cb-action-btn { height: 40px; font-size: 13px; border-radius: 8px; } | ||
| .cb-launch-btn { min-height: 46px; padding: 10px 14px; font-size: 13px; border-radius: 10px; } | ||
| .cb-launch-btn .cb-launch-svg { width: 20px; height: 20px; } | ||
| .cb-launch-sub { font-size: 10px; } | ||
| .cb-hint { font-size: 11px; } | ||
| } | ||
| @media (max-width: 360px) { | ||
| .cb-dialog { width: 100%; border-radius: 12px 12px 0 0; align-self: flex-end; } | ||
| .cb-copy-btn span { display: none; } | ||
| .cb-copy-btn { min-width: 32px; padding: 0 8px; } | ||
| } | ||
| @supports (padding: env(safe-area-inset-bottom)) { | ||
| .cb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); } | ||
| } | ||
| `,u=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this._autoLaunchConsumed=!1;this.attachShadow({mode:"open"})}set options(e){this._autoLaunchConsumed=!1,this._options=e,this.render()}get options(){return this._options}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}resolvePopupTokens(){let{theme:e}=this._options;if(e==="dark"||e==="light")return n(e);let t=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(e==="system")return t?n("dark"):n("light");let o=t?n("dark"):n("light"),i=n(e);return{...o,primary:i.primary,primaryText:i.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:e,title:t,description:o,command:i,fullCommand:l,skillUrl:C,desktopLaunchUrl:F,autoLaunch:T}=this._options,E=this.resolvePopupTokens(),O=e==="claude-code"?g:f,h=e==="claude-code",L=l||i,x=F??"claude://",m=k();this.shadowRoot.innerHTML=` | ||
| <style>${M}</style> | ||
| <div style="${w(E)}"> | ||
| <div class="cb-backdrop" data-action="close"></div> | ||
| <div class="cb-dialog" role="dialog" aria-modal="true" aria-labelledby="cb-dialog-title"> | ||
| <div class="cb-dialog-header"> | ||
| <div class="cb-dialog-header-icon">${O}</div> | ||
| <div class="cb-dialog-header-text"> | ||
| <div class="cb-dialog-title" id="cb-dialog-title">${t}</div> | ||
| ${o?`<div class="cb-dialog-description">${o}</div>`:""} | ||
| </div> | ||
| <button class="cb-dialog-close" data-action="close" aria-label="Close">${y}</button> | ||
| </div> | ||
| <div class="cb-dialog-body"> | ||
| ${h?this.renderClaudeCodeBody(L):this.renderCoworkBody(i,C)} | ||
| </div> | ||
| <div class="cb-dialog-footer"> | ||
| ${h?this.renderClaudeCodeFooter():this.renderCoworkFooter(this.escapeHref(x),m)} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `,this.setupListeners(),this.setupSystemThemeWatch(),T&&!this._autoLaunchConsumed&&e==="cowork"&&m&&(this._autoLaunchConsumed=!0,this.openDesktopAppLink(x))}openDesktopAppLink(e){if(this.dispatchEvent(new CustomEvent("cb-launch-desktop",{bubbles:!0,composed:!0,detail:{href:e}})),typeof document>"u")return;let t=document.createElement("a");t.href=e,t.rel="noopener noreferrer",t.style.cssText="position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none",document.body.appendChild(t),t.click(),requestAnimationFrame(()=>t.remove())}renderClaudeCodeBody(e){return` | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">1</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Copy this command to your clipboard</div> | ||
| <div class="cb-code-block"> | ||
| <div class="cb-code-text"><span class="cb-code-prefix">$</span>${this.escapeHtml(e)}</div> | ||
| <button class="cb-copy-btn" data-action="copy" data-command="${this.escapeAttr(e)}">${s}<span>Copy</span></button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">2</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Paste and run in your terminal</div> | ||
| </div> | ||
| </div> | ||
| `}renderCoworkBody(e,t){let o="";if(t){let i=`Install the skill from ${t} and run ${e}`;o+=` | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">1</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Copy this prompt to your clipboard</div> | ||
| <div class="cb-code-block"> | ||
| <div class="cb-code-text">${this.escapeHtml(i)}</div> | ||
| <button class="cb-copy-btn" data-action="copy" data-command="${this.escapeAttr(i)}">${s}<span>Copy</span></button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">2</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Paste into a Cowork session \u2014 Claude will fetch the skill and set it up for you</div> | ||
| </div> | ||
| </div> | ||
| `}else o+=` | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">1</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Copy this command to your clipboard</div> | ||
| <div class="cb-code-block"> | ||
| <div class="cb-code-text">${this.escapeHtml(e)}</div> | ||
| <button class="cb-copy-btn" data-action="copy" data-command="${this.escapeAttr(e)}">${s}<span>Copy</span></button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="cb-step"> | ||
| <div class="cb-step-num">2</div> | ||
| <div class="cb-step-content"> | ||
| <div class="cb-step-label">Paste and send in your Cowork session</div> | ||
| </div> | ||
| </div> | ||
| `;return o}renderCoworkFooter(e,t){let o="Open this page in Safari, Chrome, Firefox, or Edge. In-app browsers usually block opening apps.",i=t?"Opens the Claude app through your system link handler\u2014then paste the prompt below into Cowork.":"App links aren\u2019t supported in your current browser (common inside social or chat apps). Open this page in a full browser, or launch Claude Desktop manually and paste below.";return` | ||
| ${t?` | ||
| <a | ||
| class="cb-launch-btn cb-launch-btn--desktop" | ||
| href="${e}" | ||
| data-action="launch-desktop" | ||
| rel="noopener noreferrer" | ||
| > | ||
| ${p} | ||
| <span>Open Claude Desktop</span> | ||
| </a>`:` | ||
| <button | ||
| type="button" | ||
| class="cb-launch-btn cb-launch-btn--desktop" | ||
| disabled | ||
| aria-disabled="true" | ||
| aria-label="Open Claude Desktop (unavailable in this browser)" | ||
| title="${this.escapeAttr(o)}" | ||
| > | ||
| ${p} | ||
| <span>Open Claude Desktop</span> | ||
| </button>`} | ||
| <span class="cb-launch-sub">${this.escapeHtml(i)}</span> | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your Cowork session to run</div> | ||
| `}renderClaudeCodeFooter(){return` | ||
| <div class="cb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div> | ||
| `}escapeHref(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",e=>{let t=e.target.closest("[data-action]");if(!t)return;let o=t.dataset.action;if(o==="close")this.close();else if(o==="copy"){let i=t.dataset.command||"";this.copyToClipboard(i,t)}else if(o==="launch-desktop"){e.preventDefault();let i=t.getAttribute("href")||"";this.openDesktopAppLink(i||t.href)}}),this.shadowRoot.addEventListener("keydown",e=>{e.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let e=this._options.theme;if(!(e==="system"||e==="branded"||e==="branded-alt")||typeof window>"u")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>this.render();o.addEventListener("change",i),this._mqCleanup=()=>o.removeEventListener("change",i)}async copyToClipboard(e,t){try{await navigator.clipboard.writeText(e);let o=t.querySelector("span"),i=t,l=i.querySelector(".cb-icon-sm")?.outerHTML||"";t.setAttribute("data-copied","true"),o&&(o.textContent="Copied!"),i.innerHTML=`${v}<span>Copied!</span>`,this._options.onCopy?.(e),setTimeout(()=>{t.setAttribute("data-copied","false"),i.innerHTML=`${s}<span>Copy</span>`},2e3)}catch{let o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),this._options.onCopy?.(e)}}close(){let e=this.shadowRoot?.querySelector(".cb-dialog"),t=this.shadowRoot?.querySelector(".cb-backdrop");e&&(e.style.animation="cb-scale-in 0.15s ease-in reverse"),t&&(t.style.animation="cb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}escapeAttr(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("claude-popup-dialog")&&customElements.define("claude-popup-dialog",u);function q(r){let a=document.createElement("claude-popup-dialog");return a.options=r,document.body.appendChild(a),a}export{g as a,f as b,c,b as d,$ as e,n as f,w as g,P as h,S as i,q as j}; | ||
| //# sourceMappingURL=chunk-WSDOXU6R.mjs.map |
| {"version":3,"sources":["../src/icons.ts","../src/themes.ts","../src/launch-capabilities.ts","../src/popup-dialog.ts"],"sourcesContent":["export const CLAUDE_CODE_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon\">\n <!-- Ears -->\n <rect x=\"3.5\" y=\"1.5\" width=\"5\" height=\"5\" rx=\"1.5\" fill=\"currentColor\"/>\n <rect x=\"15.5\" y=\"1.5\" width=\"5\" height=\"5\" rx=\"1.5\" fill=\"currentColor\"/>\n <!-- Body -->\n <rect x=\"2.5\" y=\"5.5\" width=\"19\" height=\"13\" rx=\"3\" fill=\"currentColor\"/>\n <!-- Eyes -->\n <ellipse cx=\"9\" cy=\"11.5\" rx=\"2\" ry=\"2.5\" fill=\"white\" opacity=\"0.95\"/>\n <ellipse cx=\"15\" cy=\"11.5\" rx=\"2\" ry=\"2.5\" fill=\"white\" opacity=\"0.95\"/>\n <!-- Pupils -->\n <ellipse cx=\"9.6\" cy=\"12\" rx=\"1\" ry=\"1.2\" fill=\"#1C1917\"/>\n <ellipse cx=\"15.6\" cy=\"12\" rx=\"1\" ry=\"1.2\" fill=\"#1C1917\"/>\n <!-- Legs -->\n <rect x=\"6.5\" y=\"18.5\" width=\"4\" height=\"3.5\" rx=\"1.5\" fill=\"currentColor\"/>\n <rect x=\"13.5\" y=\"18.5\" width=\"4\" height=\"3.5\" rx=\"1.5\" fill=\"currentColor\"/>\n</svg>`;\n\nexport const COWORK_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon\">\n <!-- Lightning bolt -->\n <path d=\"M13.5 2L5 13.5h5.5L9 22l10-12h-5.5L15.5 2h-2z\" fill=\"currentColor\"/>\n <!-- Circuit path -->\n <path d=\"M12.8 7.2L10.2 11.5l2.2 4\" stroke=\"var(--cb-icon-accent, white)\" stroke-width=\"1.3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\"/>\n <!-- Circuit nodes -->\n <circle cx=\"12.8\" cy=\"7.2\" r=\"1.3\" fill=\"var(--cb-icon-accent, white)\"/>\n <circle cx=\"10.2\" cy=\"11.5\" r=\"1.3\" fill=\"var(--cb-icon-accent, white)\"/>\n <circle cx=\"12.4\" cy=\"15.5\" r=\"1.3\" fill=\"var(--cb-icon-accent, white)\"/>\n</svg>`;\n\nexport const COPY_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <rect x=\"5\" y=\"5\" width=\"8\" height=\"8\" rx=\"1.5\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M3 10V3.5A1.5 1.5 0 014.5 2H10\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const CHECK_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <path d=\"M3 8.5l3.5 3.5L13 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>`;\n\nexport const DOWNLOAD_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <path d=\"M8 2v8m0 0l-3-3m3 3l3-3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M3 12v1.5a1 1 0 001 1h8a1 1 0 001-1V12\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const CLOSE_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <path d=\"M4 4l8 8m0-8l-8 8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const TERMINAL_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-icon-sm\">\n <rect x=\"1\" y=\"2\" width=\"14\" height=\"12\" rx=\"2\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M4 6l3 2.5L4 11\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9 11h3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const DESKTOP_APP_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"cb-launch-svg\">\n <rect x=\"4\" y=\"5\" width=\"16\" height=\"11\" rx=\"1.5\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M4 8.5h16\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <circle cx=\"6.5\" cy=\"7\" r=\"0.65\" fill=\"currentColor\"/>\n <circle cx=\"8.5\" cy=\"7\" r=\"0.65\" fill=\"currentColor\"/>\n <path d=\"M9 19.5h6\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <path d=\"M8 16.5h8v3H8v-3z\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linejoin=\"round\"/>\n</svg>`;\n","import type { ThemeTokens, Theme } from './types';\n\nexport const BRAND_COLOR = '#D4795C';\nexport const BRAND_COLOR_HOVER = '#C06A4E';\nexport const BRAND_COLOR_ACTIVE = '#B35E43';\n\nexport const themes: Record<Exclude<Theme, 'system'>, ThemeTokens> = {\n branded: {\n bg: BRAND_COLOR,\n text: '#FFFFFF',\n border: 'transparent',\n surface: '#FFFFFF',\n surfaceText: '#1C1917',\n muted: '#78716C',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#1C1917',\n codeText: '#F5F0EB',\n },\n 'branded-alt': {\n bg: '#6B5CE7',\n text: '#FFFFFF',\n border: 'transparent',\n surface: '#FFFFFF',\n surfaceText: '#1C1917',\n muted: '#78716C',\n primary: '#6B5CE7',\n primaryText: '#FFFFFF',\n codeBg: '#1C1917',\n codeText: '#F5F0EB',\n },\n dark: {\n bg: '#1C1917',\n text: '#F5F0EB',\n border: '#3D3530',\n surface: '#292524',\n surfaceText: '#F5F0EB',\n muted: '#A8A29E',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#0C0A09',\n codeText: '#F5F0EB',\n },\n light: {\n bg: '#FFFFFF',\n text: '#1C1917',\n border: '#E7E5E4',\n surface: '#FAFAF9',\n surfaceText: '#1C1917',\n muted: '#78716C',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#1C1917',\n codeText: '#F5F0EB',\n },\n};\n\nexport function resolveTheme(theme: Theme): ThemeTokens {\n if (theme !== 'system') return themes[theme];\n if (typeof window === 'undefined') return themes.light;\n return window.matchMedia('(prefers-color-scheme: dark)').matches\n ? themes.dark\n : themes.light;\n}\n\nexport function themeToCSS(tokens: ThemeTokens): string {\n return `\n --cb-bg: ${tokens.bg};\n --cb-text: ${tokens.text};\n --cb-border: ${tokens.border};\n --cb-surface: ${tokens.surface};\n --cb-surface-text: ${tokens.surfaceText};\n --cb-muted: ${tokens.muted};\n --cb-primary: ${tokens.primary};\n --cb-primary-text: ${tokens.primaryText};\n --cb-code-bg: ${tokens.codeBg};\n --cb-code-text: ${tokens.codeText};\n `;\n}\n\nexport const ALT_BRAND_COLOR = '#6B5CE7';\n\nexport const SHAPE_MAP = {\n rounded: { sm: '0.375rem', md: '0.5rem', lg: '0.625rem' },\n pill: { sm: '999px', md: '999px', lg: '999px' },\n square: { sm: '0', md: '0', lg: '0' },\n} as const;\n\nexport const SIZE_MAP = {\n sm: { height: '2rem', fontSize: '0.75rem', iconSize: '0.875rem', padding: '0 0.75rem', ccPadding: '0 0.5rem', gap: '0.375rem', radius: '0.375rem' },\n md: { height: '2.5rem', fontSize: '0.875rem', iconSize: '1.125rem', padding: '0 1rem', ccPadding: '0 0.75rem', gap: '0.5rem', radius: '0.5rem' },\n lg: { height: '3rem', fontSize: '1rem', iconSize: '1.375rem', padding: '0 1.25rem', ccPadding: '0 1rem', gap: '0.625rem', radius: '0.625rem' },\n};\n","/**\n * Heuristics for whether launch shortcuts are likely to work in the current\n * browser/OS. Custom schemes are unreliable in embedded WebViews.\n */\n\n/** In-app / embedded browsers where custom URL schemes often fail or are blocked. */\nexport function isRestrictedEmbeddedBrowser(): boolean {\n if (typeof navigator === 'undefined') return true;\n const ua = navigator.userAgent || '';\n if (!ua.trim()) return true;\n\n if (\n /\\bFBAN\\b|\\bFBAV\\b|FB_IAB|Instagram|Line\\/|MicroMessenger|Snapchat|TikTok|LinkedInApp|Pinterest/i.test(ua)\n ) {\n return true;\n }\n\n if (/Twitter for (iPhone|Android)/i.test(ua)) return true;\n\n // Android WebView (not standalone Chrome)\n if (/; wv\\)/.test(ua)) return true;\n\n // Opera Mini / extreme proxies\n if (/Opera Mini|OPiOS/i.test(ua)) return true;\n\n return false;\n}\n\n/** Phones and tablets (including iPad with desktop UA). */\nexport function isMobileOrTabletDevice(): boolean {\n if (typeof navigator === 'undefined') return false;\n const ua = navigator.userAgent || '';\n const maxTouch = typeof navigator.maxTouchPoints === 'number' ? navigator.maxTouchPoints : 0;\n const platform = navigator.platform || '';\n\n if (/iPhone|iPod/i.test(ua)) return true;\n if (/iPad/i.test(ua)) return true;\n if (/Android/i.test(ua) && /Mobile/i.test(ua)) return true;\n if (/Android/i.test(ua) && !/Mobile/i.test(ua)) return true;\n if ((platform === 'MacIntel' || platform === 'MacARM') && maxTouch > 1) return true;\n\n if (/webOS|BlackBerry|IEMobile|Opera Mini/i.test(ua)) return true;\n\n return false;\n}\n\n/** Baseline APIs needed to show the dialog and trigger app links. */\nexport function hasLaunchBaselineApis(): boolean {\n return typeof window !== 'undefined'\n && typeof document !== 'undefined'\n && typeof document.createElement === 'function';\n}\n\n/**\n * \"Open Claude Desktop\" via claude:// — works in most standalone desktop & mobile browsers,\n * not in typical in-app WebViews.\n */\nexport function isDesktopAppLinkSupported(): boolean {\n if (!hasLaunchBaselineApis()) return false;\n if (isRestrictedEmbeddedBrowser()) return false;\n return true;\n}\n","import type { PopupOptions, ThemeTokens } from './types';\nimport {\n CLAUDE_CODE_ICON,\n COWORK_ICON,\n COPY_ICON,\n CHECK_ICON,\n CLOSE_ICON,\n DESKTOP_APP_ICON,\n} from './icons';\nimport { resolveTheme, themeToCSS, BRAND_COLOR, BRAND_COLOR_HOVER } from './themes';\nimport { isDesktopAppLinkSupported } from './launch-capabilities';\n\nconst POPUP_STYLES = `\n :host {\n position: fixed;\n inset: 0;\n z-index: 999999;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .cb-backdrop {\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n animation: cb-fade-in 0.15s ease-out;\n }\n\n .cb-dialog {\n position: relative;\n width: 90%;\n max-width: 460px;\n background: var(--cb-surface);\n color: var(--cb-surface-text);\n border-radius: 16px;\n box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--cb-border);\n overflow: hidden;\n animation: cb-scale-in 0.2s ease-out;\n }\n\n .cb-dialog-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px 24px 16px;\n border-bottom: 1px solid var(--cb-border);\n }\n\n .cb-dialog-header-icon {\n width: 36px;\n height: 36px;\n color: var(--cb-primary);\n flex-shrink: 0;\n }\n\n .cb-dialog-header-text {\n flex: 1;\n min-width: 0;\n }\n\n .cb-dialog-title {\n font-size: 16px;\n font-weight: 600;\n line-height: 1.3;\n color: var(--cb-surface-text);\n }\n\n .cb-dialog-description {\n font-size: 13px;\n color: var(--cb-muted);\n margin-top: 2px;\n line-height: 1.4;\n }\n\n .cb-dialog-close {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n background: transparent;\n color: var(--cb-muted);\n cursor: pointer;\n border-radius: 8px;\n flex-shrink: 0;\n transition: background 0.15s, color 0.15s;\n }\n\n .cb-dialog-close:hover {\n background: var(--cb-border);\n color: var(--cb-surface-text);\n }\n\n .cb-dialog-close svg { width: 14px; height: 14px; }\n\n .cb-dialog-body { padding: 20px 24px; }\n\n .cb-step {\n display: flex;\n gap: 12px;\n margin-bottom: 16px;\n }\n\n .cb-step:last-child { margin-bottom: 0; }\n\n .cb-step-num {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: var(--cb-primary);\n color: var(--cb-primary-text);\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin-top: 1px;\n }\n\n .cb-step-content {\n flex: 1;\n min-width: 0;\n }\n\n .cb-step-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--cb-surface-text);\n margin-bottom: 8px;\n line-height: 1.4;\n }\n\n .cb-code-block {\n display: flex;\n align-items: center;\n background: var(--cb-code-bg);\n color: var(--cb-code-text);\n border-radius: 10px;\n padding: 2px 2px 2px 14px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace;\n font-size: 13px;\n line-height: 1.5;\n gap: 8px;\n overflow: hidden;\n }\n\n .cb-code-text {\n flex: 1;\n overflow-x: auto;\n white-space: nowrap;\n padding: 10px 0;\n scrollbar-width: none;\n }\n\n .cb-code-text::-webkit-scrollbar { display: none; }\n\n .cb-code-prefix {\n color: var(--cb-muted);\n user-select: none;\n margin-right: 6px;\n }\n\n .cb-copy-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: 36px;\n min-width: 36px;\n padding: 0 12px;\n border: none;\n background: var(--cb-primary);\n color: var(--cb-primary-text);\n cursor: pointer;\n border-radius: 8px;\n font-family: inherit;\n font-size: 12px;\n font-weight: 500;\n flex-shrink: 0;\n transition: background 0.15s, transform 0.1s;\n white-space: nowrap;\n }\n\n .cb-copy-btn:hover { background: ${BRAND_COLOR_HOVER}; }\n .cb-copy-btn:active { transform: scale(0.96); }\n .cb-copy-btn svg { width: 14px; height: 14px; }\n\n .cb-copy-btn[data-copied=\"true\"] {\n background: #16a34a;\n }\n\n .cb-dialog-footer {\n padding: 16px 24px 20px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .cb-action-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: 44px;\n border: none;\n background: var(--cb-primary);\n color: var(--cb-primary-text);\n cursor: pointer;\n border-radius: 10px;\n font-family: inherit;\n font-size: 14px;\n font-weight: 600;\n transition: background 0.15s, transform 0.1s;\n }\n\n .cb-action-btn:hover { background: ${BRAND_COLOR_HOVER}; }\n .cb-action-btn:active { transform: scale(0.98); }\n .cb-action-btn svg { width: 16px; height: 16px; }\n\n .cb-hint {\n font-size: 12px;\n color: var(--cb-muted);\n text-align: center;\n line-height: 1.4;\n }\n\n .cb-hint kbd {\n display: inline-block;\n padding: 1px 5px;\n font-family: inherit;\n font-size: 11px;\n background: var(--cb-border);\n border-radius: 4px;\n border: 1px solid var(--cb-border);\n }\n\n .cb-launch-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n min-height: 48px;\n padding: 12px 18px;\n border-radius: 12px;\n font-family: inherit;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: -0.02em;\n text-decoration: none;\n cursor: pointer;\n transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease, color 0.2s ease;\n -webkit-tap-highlight-color: transparent;\n }\n\n .cb-launch-btn:active:not(:disabled) { transform: scale(0.99); }\n\n .cb-launch-btn .cb-launch-svg {\n width: 22px;\n height: 22px;\n flex-shrink: 0;\n }\n\n .cb-launch-btn--desktop {\n color: var(--cb-surface-text);\n background: linear-gradient(\n 165deg,\n color-mix(in srgb, var(--cb-primary) 14%, var(--cb-surface)) 0%,\n var(--cb-surface) 55%\n );\n border: 1.5px solid color-mix(in srgb, var(--cb-primary) 38%, var(--cb-border));\n box-shadow:\n 0 1px 0 color-mix(in srgb, white 55%, transparent) inset,\n 0 4px 14px -4px color-mix(in srgb, var(--cb-primary) 35%, transparent);\n }\n\n .cb-launch-btn--desktop:hover:not(:disabled) {\n border-color: color-mix(in srgb, var(--cb-primary) 72%, var(--cb-border));\n box-shadow:\n 0 1px 0 color-mix(in srgb, white 45%, transparent) inset,\n 0 8px 24px -6px color-mix(in srgb, var(--cb-primary) 45%, transparent);\n }\n\n .cb-launch-btn--desktop:focus-visible {\n outline: 2px solid var(--cb-primary);\n outline-offset: 2px;\n }\n\n .cb-launch-btn:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n filter: saturate(0.7);\n box-shadow: none;\n }\n\n .cb-launch-btn--desktop:disabled {\n background: var(--cb-border);\n border-color: var(--cb-border);\n color: var(--cb-muted);\n }\n\n .cb-launch-btn:disabled .cb-launch-svg {\n opacity: 0.75;\n }\n\n .cb-launch-sub {\n display: block;\n margin-top: 6px;\n font-size: 11px;\n font-weight: 500;\n color: var(--cb-muted);\n line-height: 1.35;\n text-align: center;\n }\n\n @keyframes cb-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes cb-scale-in {\n from { opacity: 0; transform: scale(0.95) translateY(8px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n }\n\n @media (max-width: 480px) {\n .cb-dialog {\n width: 96%;\n max-width: none;\n border-radius: 14px;\n max-height: 90dvh;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .cb-dialog-header { padding: 16px 16px 12px; gap: 10px; }\n .cb-dialog-header-icon { width: 28px; height: 28px; }\n .cb-dialog-body { padding: 16px; }\n .cb-dialog-footer { padding: 12px 16px 16px; }\n\n .cb-step { gap: 10px; margin-bottom: 14px; }\n .cb-step-num { width: 22px; height: 22px; font-size: 11px; }\n .cb-step-label { font-size: 12px; margin-bottom: 6px; }\n\n .cb-code-block { font-size: 12px; padding: 2px 2px 2px 10px; border-radius: 8px; }\n .cb-copy-btn { height: 32px; padding: 0 10px; font-size: 11px; border-radius: 6px; }\n .cb-action-btn { height: 40px; font-size: 13px; border-radius: 8px; }\n .cb-launch-btn { min-height: 46px; padding: 10px 14px; font-size: 13px; border-radius: 10px; }\n .cb-launch-btn .cb-launch-svg { width: 20px; height: 20px; }\n .cb-launch-sub { font-size: 10px; }\n .cb-hint { font-size: 11px; }\n }\n\n @media (max-width: 360px) {\n .cb-dialog { width: 100%; border-radius: 12px 12px 0 0; align-self: flex-end; }\n .cb-copy-btn span { display: none; }\n .cb-copy-btn { min-width: 32px; padding: 0 8px; }\n }\n\n @supports (padding: env(safe-area-inset-bottom)) {\n .cb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }\n }\n`;\n\nexport class ClaudePopupDialog extends HTMLElement {\n private _options!: PopupOptions;\n private _mqCleanup: (() => void) | null = null;\n /** Prevents auto-launch from firing on every theme re-render; reset when `options` is set. */\n private _autoLaunchConsumed = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n set options(opts: PopupOptions) {\n this._autoLaunchConsumed = false;\n this._options = opts;\n this.render();\n }\n\n get options() {\n return this._options;\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n private resolvePopupTokens(): ThemeTokens {\n const { theme } = this._options;\n\n if (theme === 'dark' || theme === 'light') return resolveTheme(theme);\n\n const prefersDark = typeof window !== 'undefined'\n && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (theme === 'system') {\n return prefersDark ? resolveTheme('dark') : resolveTheme('light');\n }\n\n const base = prefersDark ? resolveTheme('dark') : resolveTheme('light');\n const brand = resolveTheme(theme);\n return {\n ...base,\n primary: brand.primary,\n primaryText: brand.primaryText,\n };\n }\n\n private render() {\n if (!this.shadowRoot || !this._options) return;\n\n const { variant, title, description, command, fullCommand, skillUrl, desktopLaunchUrl, autoLaunch } = this._options;\n const tokens = this.resolvePopupTokens();\n const icon = variant === 'claude-code' ? CLAUDE_CODE_ICON : COWORK_ICON;\n\n const isClaudeCode = variant === 'claude-code';\n const displayCommand = fullCommand || command;\n const desktopHref = desktopLaunchUrl ?? 'claude://';\n const desktopLaunchOk = isDesktopAppLinkSupported();\n\n this.shadowRoot.innerHTML = `\n <style>${POPUP_STYLES}</style>\n <div style=\"${themeToCSS(tokens)}\">\n <div class=\"cb-backdrop\" data-action=\"close\"></div>\n <div class=\"cb-dialog\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"cb-dialog-title\">\n <div class=\"cb-dialog-header\">\n <div class=\"cb-dialog-header-icon\">${icon}</div>\n <div class=\"cb-dialog-header-text\">\n <div class=\"cb-dialog-title\" id=\"cb-dialog-title\">${title}</div>\n ${description ? `<div class=\"cb-dialog-description\">${description}</div>` : ''}\n </div>\n <button class=\"cb-dialog-close\" data-action=\"close\" aria-label=\"Close\">${CLOSE_ICON}</button>\n </div>\n <div class=\"cb-dialog-body\">\n ${isClaudeCode ? this.renderClaudeCodeBody(displayCommand) : this.renderCoworkBody(command, skillUrl)}\n </div>\n <div class=\"cb-dialog-footer\">\n ${isClaudeCode\n ? this.renderClaudeCodeFooter()\n : this.renderCoworkFooter(this.escapeHref(desktopHref), desktopLaunchOk)}\n </div>\n </div>\n </div>\n `;\n\n this.setupListeners();\n this.setupSystemThemeWatch();\n\n if (autoLaunch && !this._autoLaunchConsumed && variant === 'cowork' && desktopLaunchOk) {\n this._autoLaunchConsumed = true;\n this.openDesktopAppLink(desktopHref);\n }\n }\n\n /** Programmatic open (same as clicking the desktop launch control). */\n private openDesktopAppLink(href: string) {\n this.dispatchEvent(new CustomEvent('cb-launch-desktop', {\n bubbles: true,\n composed: true,\n detail: { href },\n }));\n if (typeof document === 'undefined') return;\n const a = document.createElement('a');\n a.href = href;\n a.rel = 'noopener noreferrer';\n a.style.cssText = 'position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none';\n document.body.appendChild(a);\n a.click();\n requestAnimationFrame(() => a.remove());\n }\n\n private renderClaudeCodeBody(command: string): string {\n return `\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">1</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Copy this command to your clipboard</div>\n <div class=\"cb-code-block\">\n <div class=\"cb-code-text\"><span class=\"cb-code-prefix\">$</span>${this.escapeHtml(command)}</div>\n <button class=\"cb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(command)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">2</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Paste and run in your terminal</div>\n </div>\n </div>\n `;\n }\n\n private renderCoworkBody(command: string, skillUrl?: string): string {\n let steps = '';\n\n if (skillUrl) {\n const fullPrompt = `Install the skill from ${skillUrl} and run ${command}`;\n steps += `\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">1</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Copy this prompt to your clipboard</div>\n <div class=\"cb-code-block\">\n <div class=\"cb-code-text\">${this.escapeHtml(fullPrompt)}</div>\n <button class=\"cb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(fullPrompt)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">2</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Paste into a Cowork session — Claude will fetch the skill and set it up for you</div>\n </div>\n </div>\n `;\n } else {\n steps += `\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">1</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Copy this command to your clipboard</div>\n <div class=\"cb-code-block\">\n <div class=\"cb-code-text\">${this.escapeHtml(command)}</div>\n <button class=\"cb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(command)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"cb-step\">\n <div class=\"cb-step-num\">2</div>\n <div class=\"cb-step-content\">\n <div class=\"cb-step-label\">Paste and send in your Cowork session</div>\n </div>\n </div>\n `;\n }\n\n return steps;\n }\n\n private renderCoworkFooter(desktopHrefEscaped: string, enabled: boolean): string {\n const disabledTitle = 'Open this page in Safari, Chrome, Firefox, or Edge. In-app browsers usually block opening apps.';\n const sub = enabled\n ? 'Opens the Claude app through your system link handler—then paste the prompt below into Cowork.'\n : 'App links aren’t supported in your current browser (common inside social or chat apps). Open this page in a full browser, or launch Claude Desktop manually and paste below.';\n\n const control = enabled\n ? `\n <a\n class=\"cb-launch-btn cb-launch-btn--desktop\"\n href=\"${desktopHrefEscaped}\"\n data-action=\"launch-desktop\"\n rel=\"noopener noreferrer\"\n >\n ${DESKTOP_APP_ICON}\n <span>Open Claude Desktop</span>\n </a>`\n : `\n <button\n type=\"button\"\n class=\"cb-launch-btn cb-launch-btn--desktop\"\n disabled\n aria-disabled=\"true\"\n aria-label=\"Open Claude Desktop (unavailable in this browser)\"\n title=\"${this.escapeAttr(disabledTitle)}\"\n >\n ${DESKTOP_APP_ICON}\n <span>Open Claude Desktop</span>\n </button>`;\n\n return `\n ${control}\n <span class=\"cb-launch-sub\">${this.escapeHtml(sub)}</span>\n <div class=\"cb-hint\">Press <kbd>⌘</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your Cowork session to run</div>\n `;\n }\n\n private renderClaudeCodeFooter(): string {\n return `\n <div class=\"cb-hint\">Press <kbd>⌘</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div>\n `;\n }\n\n private escapeHref(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n }\n\n private setupListeners() {\n if (!this.shadowRoot) return;\n\n this.shadowRoot.addEventListener('click', (e) => {\n const target = (e.target as HTMLElement).closest('[data-action]') as HTMLElement | null;\n if (!target) return;\n\n const action = target.dataset.action;\n\n if (action === 'close') {\n this.close();\n } else if (action === 'copy') {\n const cmd = target.dataset.command || '';\n this.copyToClipboard(cmd, target);\n } else if (action === 'launch-desktop') {\n e.preventDefault();\n const raw = (target as HTMLAnchorElement).getAttribute('href') || '';\n this.openDesktopAppLink(raw || (target as HTMLAnchorElement).href);\n }\n });\n\n this.shadowRoot.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Escape') this.close();\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n const theme = this._options.theme;\n const needsWatch = theme === 'system' || theme === 'branded' || theme === 'branded-alt';\n if (!needsWatch || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n\n private async copyToClipboard(command: string, button: HTMLElement) {\n try {\n await navigator.clipboard.writeText(command);\n const label = button.querySelector('span');\n const iconContainer = button;\n const originalIcon = iconContainer.querySelector('.cb-icon-sm')?.outerHTML || '';\n\n button.setAttribute('data-copied', 'true');\n if (label) label.textContent = 'Copied!';\n iconContainer.innerHTML = `${CHECK_ICON}<span>Copied!</span>`;\n\n this._options.onCopy?.(command);\n\n setTimeout(() => {\n button.setAttribute('data-copied', 'false');\n iconContainer.innerHTML = `${COPY_ICON}<span>Copy</span>`;\n }, 2000);\n } catch {\n const textarea = document.createElement('textarea');\n textarea.value = command;\n textarea.style.position = 'fixed';\n textarea.style.opacity = '0';\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n\n this._options.onCopy?.(command);\n }\n }\n\n close() {\n const dialog = this.shadowRoot?.querySelector('.cb-dialog') as HTMLElement;\n const backdrop = this.shadowRoot?.querySelector('.cb-backdrop') as HTMLElement;\n\n if (dialog) {\n dialog.style.animation = 'cb-scale-in 0.15s ease-in reverse';\n }\n if (backdrop) {\n backdrop.style.animation = 'cb-fade-in 0.15s ease-in reverse';\n }\n\n setTimeout(() => {\n this._options.onClose?.();\n this.remove();\n }, 140);\n }\n\n private escapeHtml(str: string): string {\n const div = document.createElement('div');\n div.textContent = str;\n return div.innerHTML;\n }\n\n private escapeAttr(str: string): string {\n return str.replace(/\"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');\n }\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('claude-popup-dialog')) {\n customElements.define('claude-popup-dialog', ClaudePopupDialog);\n}\n\nexport function showPopup(options: PopupOptions): ClaudePopupDialog {\n const popup = document.createElement('claude-popup-dialog') as ClaudePopupDialog;\n popup.options = options;\n document.body.appendChild(popup);\n return popup;\n}\n"],"mappings":"AAAO,IAAMA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAiBnBC,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAWdC,EAAY;AAAA;AAAA;AAAA,QAKZC,EAAa;AAAA;QASnB,IAAMC,EAAa;AAAA;QAUnB,IAAMC,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;QClDzB,IAAMC,EAAc,UACdC,EAAoB,UACpBC,EAAqB,UAErBC,EAAwD,CACnE,QAAS,CACP,GAAIH,EACJ,KAAM,UACN,OAAQ,cACR,QAAS,UACT,YAAa,UACb,MAAO,UACP,QAASA,EACT,YAAa,UACb,OAAQ,UACR,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ND_COLOR_ACTIVE","themes","resolveTheme","theme","themeToCSS","tokens","SHAPE_MAP","SIZE_MAP","isRestrictedEmbeddedBrowser","ua","hasLaunchBaselineApis","isDesktopAppLinkSupported","isRestrictedEmbeddedBrowser","POPUP_STYLES","BRAND_COLOR_HOVER","ClaudePopupDialog","opts","theme","resolveTheme","prefersDark","base","brand","variant","title","description","command","fullCommand","skillUrl","desktopLaunchUrl","autoLaunch","tokens","icon","CLAUDE_CODE_ICON","COWORK_ICON","isClaudeCode","displayCommand","desktopHref","desktopLaunchOk","isDesktopAppLinkSupported","themeToCSS","CLOSE_ICON","href","a","COPY_ICON","steps","fullPrompt","desktopHrefEscaped","enabled","disabledTitle","sub","DESKTOP_APP_ICON","str","target","action","cmd","raw","mq","handler","button","label","iconContainer","originalIcon","CHECK_ICON","textarea","dialog","backdrop","div","showPopup","options","popup"]} |
| import{a as m,c as r,d as g,e as v,f,g as C,h as k,i as x,j as _}from"./chunk-WSDOXU6R.mjs";var E=` | ||
| :host { | ||
| display: inline-block; | ||
| vertical-align: middle; | ||
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; | ||
| -webkit-tap-highlight-color: transparent; | ||
| } | ||
| * { box-sizing: border-box; margin: 0; padding: 0; } | ||
| .cb-btn { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: var(--cb-gap); | ||
| height: var(--cb-height); | ||
| min-height: 44px; | ||
| padding: var(--cb-padding); | ||
| border: 1.5px solid var(--cb-border); | ||
| background: var(--cb-bg); | ||
| color: var(--cb-text); | ||
| font-family: inherit; | ||
| font-size: var(--cb-font-size); | ||
| font-weight: 600; | ||
| line-height: 1; | ||
| border-radius: var(--cb-radius); | ||
| cursor: pointer; | ||
| user-select: none; | ||
| white-space: nowrap; | ||
| touch-action: manipulation; | ||
| transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease; | ||
| text-decoration: none; | ||
| -webkit-font-smoothing: antialiased; | ||
| } | ||
| @media (pointer: fine) { | ||
| .cb-btn { min-height: unset; } | ||
| } | ||
| /* \u2500\u2500\u2500 FILLED \u2500\u2500\u2500 */ | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn, | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn { | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:hover { | ||
| background: ${g}; | ||
| box-shadow: 0 2px 8px rgba(212, 121, 92, 0.35); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${v}; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: #5A4BD6; | ||
| box-shadow: 0 2px 8px rgba(107, 92, 231, 0.35); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: #4F41C8; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn { | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn:hover { | ||
| background: #292524; | ||
| border-color: #57534E; | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn:active { | ||
| background: #1C1917; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn { | ||
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: #D6D3D1; | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn:active { | ||
| background: #FAFAF9; | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 OUTLINE \u2500\u2500\u2500 */ | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: ${r}; | ||
| color: ${r}; | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| background: rgba(212, 121, 92, 0.08); | ||
| box-shadow: 0 2px 8px rgba(212, 121, 92, 0.15); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #6B5CE7; | ||
| color: #6B5CE7; | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: rgba(107, 92, 231, 0.08); | ||
| box-shadow: 0 2px 8px rgba(107, 92, 231, 0.15); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: rgba(107, 92, 231, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #57534E; | ||
| color: #F5F0EB; | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${r}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #D6D3D1; | ||
| color: #1C1917; | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${r}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.1); | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 GHOST \u2500\u2500\u2500 */ | ||
| :host([data-variant="ghost"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: transparent; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${r}; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| background: rgba(212, 121, 92, 0.1); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.16); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn { | ||
| color: #6B5CE7; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: rgba(107, 92, 231, 0.1); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: rgba(107, 92, 231, 0.16); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn { | ||
| color: #F5F0EB; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn:hover { | ||
| background: rgba(255, 255, 255, 0.06); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn:active { | ||
| background: rgba(255, 255, 255, 0.1); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn { | ||
| color: #1C1917; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn:hover { | ||
| background: rgba(0, 0, 0, 0.04); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn:active { | ||
| background: rgba(0, 0, 0, 0.08); | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 FOCUS \u2500\u2500\u2500 */ | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${r}); | ||
| outline-offset: 2px; | ||
| } | ||
| /* \u2500\u2500\u2500 ICON \u2500\u2500\u2500 */ | ||
| .cb-btn-icon { | ||
| width: var(--cb-icon-size); | ||
| height: var(--cb-icon-size); | ||
| flex-shrink: 0; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
| .cb-btn-icon svg { width: 100%; height: 100%; } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn-icon, | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn-icon { | ||
| color: #FFFFFF; | ||
| --cb-icon-accent: rgba(255,255,255,0.2); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| } | ||
| :host([data-variant="outline"]) .cb-btn-icon, | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| } | ||
| /* \u2500\u2500\u2500 LABEL \u2500\u2500\u2500 */ | ||
| .cb-btn-label { | ||
| letter-spacing: -0.01em; | ||
| } | ||
| `,h=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(e){this._options={...this._options,...e},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let e=this.getAttribute("command"),a=this.getAttribute("theme"),t=this.getAttribute("size"),o=this.getAttribute("variant"),n=this.getAttribute("shape"),s=this.getAttribute("popup"),i=this.getAttribute("prompt-flag"),c=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");e!==null&&(this._options.command=e),a&&(this._options.theme=a),t&&(this._options.size=t),o&&(this._options.variant=o),n&&(this._options.shape=n),s!==null&&(this._options.popup=s!=="false"),i!==null&&(this._options.promptFlag=i!=="false"),c!==null&&(this._options.popupTitle=c),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:e}=this._options,a=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Claude Code: ${e}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let t=this.querySelector("a[data-cb-crawl]");t||(t=document.createElement("a"),t.setAttribute("data-cb-crawl",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(t)),t.href=`https://claude.ai/code?command=${encodeURIComponent(a)}`,t.textContent=`Run on Claude Code: ${e}`,t.setAttribute("data-platform","claude-code"),t.setAttribute("data-command",e),t.setAttribute("data-full-command",a)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:e,promptFlag:a}=this._options;return a===!1?e:`claude -p "${e}"`}render(){if(!this.shadowRoot)return;let e=this.getResolvedTheme(),a=e==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,t=this._options.variant||"filled",o=f(e),n=this._options.size||"md",s=this._options.shape||"rounded",i=x[n],c=k[s][n];this.setAttribute("data-theme",a),this.setAttribute("data-variant",t);let b=t!=="filled"?"transparent":o.bg,w=t==="ghost"?"transparent":t==="outline"?o.primary:o.border,y=t!=="filled"?o.primary:o.text;this.shadowRoot.innerHTML=` | ||
| <style>${E}</style> | ||
| <button | ||
| class="cb-btn" | ||
| type="button" | ||
| style=" | ||
| ${C(o)} | ||
| --cb-bg: ${b}; | ||
| --cb-border: ${w}; | ||
| --cb-text: ${y}; | ||
| --cb-accent-color: ${o.primary}; | ||
| --cb-focus-color: ${o.primary}; | ||
| --cb-height: ${i.height}; | ||
| --cb-font-size: ${i.fontSize}; | ||
| --cb-icon-size: ${i.iconSize}; | ||
| --cb-padding: ${i.ccPadding}; | ||
| --cb-gap: ${i.gap}; | ||
| --cb-radius: ${c}; | ||
| " | ||
| aria-label="Run on Claude Code: ${this._options.command.replace(/"/g,""")}" | ||
| > | ||
| <span class="cb-btn-icon" aria-hidden="true">${m}</span> | ||
| <span class="cb-btn-label">Run on Claude Code</span> | ||
| </button> | ||
| `;let u=this.shadowRoot.querySelector(".cb-btn");u.addEventListener("click",()=>this.handleClick()),u.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:e,command:a,popupTitle:t,popupDescription:o}=this._options,n=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:a,fullCommand:n}})),e===!1){navigator.clipboard.writeText(n).then(()=>{this._options.onCopy?.(n),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:n}}))});return}_({variant:"claude-code",theme:this.getResolvedTheme(),title:t||"Run on Claude Code",description:o||"Execute this command in your terminal to get started.",command:a,fullCommand:n,onCopy:s=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}};h.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function A(d="claude-code-button"){typeof customElements>"u"||customElements.get(d)||customElements.define(d,h)}A();function O(d){let l=document.createElement("claude-code-button");return l.options=d,l}export{h as ClaudeCodeButton,O as createClaudeCodeButton,A as registerClaudeCodeButton}; | ||
| //# sourceMappingURL=claude-code-button-3PCMIJKZ.mjs.map |
| {"version":3,"sources":["../src/claude-code-button.ts"],"sourcesContent":["import type { ClaudeCodeButtonOptions, Theme, Size, Variant, Shape } from './types';\nimport { CLAUDE_CODE_ICON } from './icons';\nimport { resolveTheme, themeToCSS, SIZE_MAP, SHAPE_MAP, BRAND_COLOR, BRAND_COLOR_HOVER, BRAND_COLOR_ACTIVE } from './themes';\nimport { showPopup } from './popup-dialog';\n\nconst BUTTON_STYLES = `\n :host {\n display: inline-block;\n vertical-align: middle;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-tap-highlight-color: transparent;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .cb-btn {\n display: inline-flex;\n align-items: center;\n gap: var(--cb-gap);\n height: var(--cb-height);\n min-height: 44px;\n padding: var(--cb-padding);\n border: 1.5px solid var(--cb-border);\n background: var(--cb-bg);\n color: var(--cb-text);\n font-family: inherit;\n font-size: var(--cb-font-size);\n font-weight: 600;\n line-height: 1;\n border-radius: var(--cb-radius);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n touch-action: manipulation;\n transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n }\n\n @media (pointer: fine) {\n .cb-btn { min-height: unset; }\n }\n\n /* ─── FILLED ─── */\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: ${BRAND_COLOR_HOVER};\n box-shadow: 0 2px 8px rgba(212, 121, 92, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn:active {\n background: ${BRAND_COLOR_ACTIVE};\n transform: scale(0.98);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: #5A4BD6;\n box-shadow: 0 2px 8px rgba(107, 92, 231, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: #4F41C8;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn:hover {\n background: #292524;\n border-color: #57534E;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn:active {\n background: #1C1917;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn:hover {\n border-color: #D6D3D1;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn:active {\n background: #FAFAF9;\n transform: scale(0.98);\n }\n\n /* ─── OUTLINE ─── */\n\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn {\n background: transparent;\n border-color: ${BRAND_COLOR};\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: rgba(212, 121, 92, 0.08);\n box-shadow: 0 2px 8px rgba(212, 121, 92, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn {\n background: transparent;\n border-color: #6B5CE7;\n color: #6B5CE7;\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: rgba(107, 92, 231, 0.08);\n box-shadow: 0 2px 8px rgba(107, 92, 231, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: rgba(107, 92, 231, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn {\n background: transparent;\n border-color: #57534E;\n color: #F5F0EB;\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(212, 121, 92, 0.08);\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn {\n background: transparent;\n border-color: #D6D3D1;\n color: #1C1917;\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(212, 121, 92, 0.05);\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.1);\n transform: scale(0.98);\n }\n\n /* ─── GHOST ─── */\n\n :host([data-variant=\"ghost\"]) .cb-btn {\n background: transparent;\n border-color: transparent;\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn {\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: rgba(212, 121, 92, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn {\n color: #6B5CE7;\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: rgba(107, 92, 231, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: rgba(107, 92, 231, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn {\n color: #F5F0EB;\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn:hover {\n background: rgba(255, 255, 255, 0.06);\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn:active {\n background: rgba(255, 255, 255, 0.1);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn {\n color: #1C1917;\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn:active {\n background: rgba(0, 0, 0, 0.08);\n transform: scale(0.98);\n }\n\n /* ─── FOCUS ─── */\n\n .cb-btn:focus-visible {\n outline: 2px solid var(--cb-focus-color, ${BRAND_COLOR});\n outline-offset: 2px;\n }\n\n /* ─── ICON ─── */\n\n .cb-btn-icon {\n width: var(--cb-icon-size);\n height: var(--cb-icon-size);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .cb-btn-icon svg { width: 100%; height: 100%; }\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn-icon,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn-icon {\n color: #FFFFFF;\n --cb-icon-accent: rgba(255,255,255,0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n }\n\n :host([data-variant=\"outline\"]) .cb-btn-icon,\n :host([data-variant=\"ghost\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n }\n\n /* ─── LABEL ─── */\n\n .cb-btn-label {\n letter-spacing: -0.01em;\n }\n`;\n\nexport class ClaudeCodeButton extends HTMLElement {\n static observedAttributes = ['command', 'theme', 'size', 'variant', 'shape', 'popup', 'prompt-flag', 'popup-title', 'popup-description'];\n\n private _options: ClaudeCodeButtonOptions = {\n command: '',\n theme: 'branded',\n size: 'md',\n variant: 'filled',\n popup: true,\n promptFlag: true,\n };\n\n private _mqCleanup: (() => void) | null = null;\n private _rendered = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n attributeChangedCallback() {\n if (!this._rendered) return;\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n set options(opts: Partial<ClaudeCodeButtonOptions>) {\n this._options = { ...this._options, ...opts };\n this.render();\n this.updateLightDOM();\n }\n\n get options() {\n return this._options;\n }\n\n private syncFromAttributes() {\n const command = this.getAttribute('command');\n const theme = this.getAttribute('theme') as Theme | null;\n const size = this.getAttribute('size') as Size | null;\n const variant = this.getAttribute('variant') as Variant | null;\n const shape = this.getAttribute('shape') as Shape | null;\n const popup = this.getAttribute('popup');\n const promptFlag = this.getAttribute('prompt-flag');\n const popupTitle = this.getAttribute('popup-title');\n const popupDescription = this.getAttribute('popup-description');\n\n if (command !== null) this._options.command = command;\n if (theme) this._options.theme = theme;\n if (size) this._options.size = size;\n if (variant) this._options.variant = variant;\n if (shape) this._options.shape = shape;\n if (popup !== null) this._options.popup = popup !== 'false';\n if (promptFlag !== null) this._options.promptFlag = promptFlag !== 'false';\n if (popupTitle !== null) this._options.popupTitle = popupTitle;\n if (popupDescription !== null) this._options.popupDescription = popupDescription;\n }\n\n private updateLightDOM() {\n const { command } = this._options;\n const fullCommand = this.getFullCommand();\n\n this.setAttribute('role', 'button');\n this.setAttribute('tabindex', '0');\n this.setAttribute('aria-label', `Run on Claude Code: ${command}`);\n if (this._options.popup !== false) {\n this.setAttribute('aria-haspopup', 'dialog');\n } else {\n this.removeAttribute('aria-haspopup');\n }\n\n let link = this.querySelector('a[data-cb-crawl]') as HTMLAnchorElement | null;\n if (!link) {\n link = document.createElement('a');\n link.setAttribute('data-cb-crawl', '');\n link.setAttribute('aria-hidden', 'true');\n link.style.cssText = 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;';\n this.appendChild(link);\n }\n link.href = `https://claude.ai/code?command=${encodeURIComponent(fullCommand)}`;\n link.textContent = `Run on Claude Code: ${command}`;\n link.setAttribute('data-platform', 'claude-code');\n link.setAttribute('data-command', command);\n link.setAttribute('data-full-command', fullCommand);\n }\n\n private getResolvedTheme(): Theme {\n return this._options.theme || 'branded';\n }\n\n private getFullCommand(): string {\n const { command, promptFlag } = this._options;\n if (promptFlag === false) return command;\n return `claude -p \"${command}\"`;\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const theme = this.getResolvedTheme();\n const resolvedTheme = theme === 'system' ? (\n typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n ) : theme;\n const variant = this._options.variant || 'filled';\n\n const tokens = resolveTheme(theme);\n const size = this._options.size || 'md';\n const shape = this._options.shape || 'rounded';\n const sizeTokens = SIZE_MAP[size];\n const radius = SHAPE_MAP[shape][size];\n\n this.setAttribute('data-theme', resolvedTheme);\n this.setAttribute('data-variant', variant);\n\n const bgOverride = variant !== 'filled' ? 'transparent' : tokens.bg;\n const borderOverride = variant === 'ghost' ? 'transparent' :\n variant === 'outline' ? tokens.primary : tokens.border;\n const textOverride = variant !== 'filled' ? tokens.primary : tokens.text;\n\n this.shadowRoot.innerHTML = `\n <style>${BUTTON_STYLES}</style>\n <button\n class=\"cb-btn\"\n type=\"button\"\n style=\"\n ${themeToCSS(tokens)}\n --cb-bg: ${bgOverride};\n --cb-border: ${borderOverride};\n --cb-text: ${textOverride};\n --cb-accent-color: ${tokens.primary};\n --cb-focus-color: ${tokens.primary};\n --cb-height: ${sizeTokens.height};\n --cb-font-size: ${sizeTokens.fontSize};\n --cb-icon-size: ${sizeTokens.iconSize};\n --cb-padding: ${sizeTokens.ccPadding};\n --cb-gap: ${sizeTokens.gap};\n --cb-radius: ${radius};\n \"\n aria-label=\"Run on Claude Code: ${this._options.command.replace(/\"/g, '"')}\"\n >\n <span class=\"cb-btn-icon\" aria-hidden=\"true\">${CLAUDE_CODE_ICON}</span>\n <span class=\"cb-btn-label\">Run on Claude Code</span>\n </button>\n `;\n\n const btn = this.shadowRoot.querySelector('.cb-btn')!;\n btn.addEventListener('click', () => this.handleClick());\n btn.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Enter' || (e as KeyboardEvent).key === ' ') {\n e.preventDefault();\n this.handleClick();\n }\n });\n this._rendered = true;\n this.setupSystemThemeWatch();\n }\n\n private handleClick() {\n const { popup, command, popupTitle, popupDescription } = this._options;\n const fullCommand = this.getFullCommand();\n\n this.dispatchEvent(new CustomEvent('cb-open', {\n bubbles: true,\n composed: true,\n detail: { command, fullCommand },\n }));\n\n if (popup === false) {\n navigator.clipboard.writeText(fullCommand).then(() => {\n this._options.onCopy?.(fullCommand);\n this.dispatchEvent(new CustomEvent('cb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: fullCommand },\n }));\n });\n return;\n }\n\n showPopup({\n variant: 'claude-code',\n theme: this.getResolvedTheme(),\n title: popupTitle || 'Run on Claude Code',\n description: popupDescription || 'Execute this command in your terminal to get started.',\n command,\n fullCommand,\n onCopy: (cmd) => {\n this._options.onCopy?.(cmd);\n this.dispatchEvent(new CustomEvent('cb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: cmd },\n }));\n },\n onClose: () => {\n this.dispatchEvent(new CustomEvent('cb-close', {\n bubbles: true,\n composed: true,\n }));\n },\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n if (this.getResolvedTheme() !== 'system' || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n}\n\nexport function registerClaudeCodeButton(tagName = 'claude-code-button') {\n if (typeof customElements === 'undefined') return;\n if (!customElements.get(tagName)) {\n customElements.define(tagName, ClaudeCodeButton);\n }\n}\n\nregisterClaudeCodeButton();\n\nexport function createClaudeCodeButton(options: ClaudeCodeButtonOptions): ClaudeCodeButton {\n const el = document.createElement('claude-code-button') as ClaudeCodeButton;\n el.options = options;\n return el;\n}\n"],"mappings":"4FAKA,IAAMA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBA6CJC,CAAiB;AAAA;AAAA;AAAA;AAAA,kBAIjBC,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAyChBC,CAAW;AAAA,aAClBA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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ACT,MAAO,KAAK,iBAAiB,EAC7B,MAAOlB,GAAc,qBACrB,YAAaC,GAAoB,wDACjC,QAAAR,EACA,YAAAS,EACA,OAASiB,GAAQ,CACf,KAAK,SAAS,SAASA,CAAG,EAC1B,KAAK,cAAc,IAAI,YAAY,UAAW,CAC5C,QAAS,GACT,SAAU,GACV,OAAQ,CAAE,QAASA,CAAI,CACzB,CAAC,CAAC,CACJ,EACA,QAAS,IAAM,CACb,KAAK,cAAc,IAAI,YAAY,WAAY,CAC7C,QAAS,GACT,SAAU,EACZ,CAAC,CAAC,CACJ,CACF,CAAC,CACH,CAEQ,uBAAwB,CAI9B,GAHA,KAAK,aAAa,EAClB,KAAK,WAAa,KAEd,KAAK,iBAAiB,IAAM,UAAY,OAAO,OAAW,IAAa,OAE3E,IAAMC,EAAK,OAAO,WAAW,8BAA8B,EACrDC,EAAU,IAAM,KAAK,OAAO,EAClCD,EAAG,iBAAiB,SAAUC,CAAO,EACrC,KAAK,WAAa,IAAMD,EAAG,oBAAoB,SAAUC,CAAO,CAClE,CACF,EAlOa9B,EACJ,mBAAqB,CAAC,UAAW,QAAS,OAAQ,UAAW,QAAS,QAAS,cAAe,cAAe,mBAAmB,EAmOlI,SAAS+B,EAAyBC,EAAU,qBAAsB,CACnE,OAAO,eAAmB,KACzB,eAAe,IAAIA,CAAO,GAC7B,eAAe,OAAOA,EAAShC,CAAgB,CAEnD,CAEA+B,EAAyB,EAElB,SAASE,EAAuBC,EAAoD,CACzF,IAAMC,EAAK,SAAS,cAAc,oBAAoB,EACtD,OAAAA,EAAG,QAAUD,EACNC,CACT","names":["BUTTON_STYLES","BRAND_COLOR_HOVER","BRAND_COLOR_ACTIVE","BRAND_COLOR","ClaudeCodeButton","opts","command","theme","size","variant","shape","popup","promptFlag","popupTitle","popupDescription","fullCommand","link","resolvedTheme","tokens","resolveTheme","sizeTokens","SIZE_MAP","radius","SHAPE_MAP","bgOverride","borderOverride","textOverride","themeToCSS","CLAUDE_CODE_ICON","btn","e","showPopup","cmd","mq","handler","registerClaudeCodeButton","tagName","createClaudeCodeButton","options","el"]} |
| import{b as g,c as r,d as v,e as f,f as k,g as w,h as C,i as x,j as _}from"./chunk-WSDOXU6R.mjs";var A=` | ||
| :host { | ||
| display: inline-block; | ||
| vertical-align: middle; | ||
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; | ||
| -webkit-tap-highlight-color: transparent; | ||
| } | ||
| * { box-sizing: border-box; margin: 0; padding: 0; } | ||
| .cb-btn { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: var(--cb-gap); | ||
| height: var(--cb-height); | ||
| min-height: 44px; | ||
| padding: var(--cb-padding); | ||
| border: 1.5px solid var(--cb-border); | ||
| background: var(--cb-bg); | ||
| color: var(--cb-text); | ||
| font-family: inherit; | ||
| font-size: var(--cb-font-size); | ||
| font-weight: 600; | ||
| line-height: 1; | ||
| border-radius: var(--cb-radius); | ||
| cursor: pointer; | ||
| user-select: none; | ||
| white-space: nowrap; | ||
| touch-action: manipulation; | ||
| transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease; | ||
| text-decoration: none; | ||
| -webkit-font-smoothing: antialiased; | ||
| } | ||
| @media (pointer: fine) { | ||
| .cb-btn { min-height: unset; } | ||
| } | ||
| /* \u2500\u2500\u2500 FILLED \u2500\u2500\u2500 */ | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn, | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn { | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:hover { | ||
| background: ${v}; | ||
| box-shadow: 0 2px 8px rgba(212, 121, 92, 0.35); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn:active { | ||
| background: ${f}; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: #5A4BD6; | ||
| box-shadow: 0 2px 8px rgba(107, 92, 231, 0.35); | ||
| } | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: #4F41C8; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn { | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn:hover { | ||
| background: #292524; | ||
| border-color: #57534E; | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn:active { | ||
| background: #1C1917; | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn { | ||
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: #D6D3D1; | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn:active { | ||
| background: #FAFAF9; | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 OUTLINE \u2500\u2500\u2500 */ | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: ${r}; | ||
| color: ${r}; | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn:hover { | ||
| background: rgba(212, 121, 92, 0.08); | ||
| box-shadow: 0 2px 8px rgba(212, 121, 92, 0.15); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #6B5CE7; | ||
| color: #6B5CE7; | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: rgba(107, 92, 231, 0.08); | ||
| box-shadow: 0 2px 8px rgba(107, 92, 231, 0.15); | ||
| } | ||
| :host([data-variant="outline"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: rgba(107, 92, 231, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #57534E; | ||
| color: #F5F0EB; | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:hover { | ||
| border-color: ${r}; | ||
| background: rgba(212, 121, 92, 0.08); | ||
| } | ||
| :host([data-variant="outline"][data-theme="dark"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.14); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: #D6D3D1; | ||
| color: #1C1917; | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:hover { | ||
| border-color: ${r}; | ||
| background: rgba(212, 121, 92, 0.05); | ||
| } | ||
| :host([data-variant="outline"][data-theme="light"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.1); | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 GHOST \u2500\u2500\u2500 */ | ||
| :host([data-variant="ghost"]) .cb-btn { | ||
| background: transparent; | ||
| border-color: transparent; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn { | ||
| color: ${r}; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:hover { | ||
| background: rgba(212, 121, 92, 0.1); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded"]) .cb-btn:active { | ||
| background: rgba(212, 121, 92, 0.16); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn { | ||
| color: #6B5CE7; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn:hover { | ||
| background: rgba(107, 92, 231, 0.1); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="branded-alt"]) .cb-btn:active { | ||
| background: rgba(107, 92, 231, 0.16); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn { | ||
| color: #F5F0EB; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn:hover { | ||
| background: rgba(255, 255, 255, 0.06); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="dark"]) .cb-btn:active { | ||
| background: rgba(255, 255, 255, 0.1); | ||
| transform: scale(0.98); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn { | ||
| color: #1C1917; | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn:hover { | ||
| background: rgba(0, 0, 0, 0.04); | ||
| } | ||
| :host([data-variant="ghost"][data-theme="light"]) .cb-btn:active { | ||
| background: rgba(0, 0, 0, 0.08); | ||
| transform: scale(0.98); | ||
| } | ||
| /* \u2500\u2500\u2500 FOCUS \u2500\u2500\u2500 */ | ||
| .cb-btn:focus-visible { | ||
| outline: 2px solid var(--cb-focus-color, ${r}); | ||
| outline-offset: 2px; | ||
| } | ||
| /* \u2500\u2500\u2500 ICON \u2500\u2500\u2500 */ | ||
| .cb-btn-icon { | ||
| width: var(--cb-icon-size); | ||
| height: var(--cb-icon-size); | ||
| flex-shrink: 0; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
| .cb-btn-icon svg { width: 100%; height: 100%; } | ||
| :host([data-variant="filled"][data-theme="branded"]) .cb-btn-icon, | ||
| :host([data-variant="filled"][data-theme="branded-alt"]) .cb-btn-icon { | ||
| color: #FFFFFF; | ||
| --cb-icon-accent: rgba(255,255,255,0.2); | ||
| } | ||
| :host([data-variant="filled"][data-theme="dark"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| --cb-icon-accent: #1C1917; | ||
| } | ||
| :host([data-variant="filled"][data-theme="light"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| --cb-icon-accent: #FFFFFF; | ||
| } | ||
| :host([data-variant="outline"]) .cb-btn-icon, | ||
| :host([data-variant="ghost"]) .cb-btn-icon { | ||
| color: var(--cb-accent-color, ${r}); | ||
| } | ||
| /* \u2500\u2500\u2500 LABEL \u2500\u2500\u2500 */ | ||
| .cb-btn-label { | ||
| letter-spacing: -0.01em; | ||
| } | ||
| `,l=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(e){this._options={...this._options,...e},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let e=this.getAttribute("command"),a=this.getAttribute("skill-url"),t=this.getAttribute("theme"),o=this.getAttribute("size"),i=this.getAttribute("variant"),s=this.getAttribute("shape"),n=this.getAttribute("popup"),c=this.getAttribute("popup-title"),b=this.getAttribute("popup-description"),h=this.getAttribute("auto-launch");e!==null&&(this._options.command=e),a!==null&&(this._options.skillUrl=a),t&&(this._options.theme=t),o&&(this._options.size=o),i&&(this._options.variant=i),s&&(this._options.shape=s),n!==null&&(this._options.popup=n!=="false"),c!==null&&(this._options.popupTitle=c),b!==null&&(this._options.popupDescription=b),h===null?delete this._options.autoLaunch:this._options.autoLaunch=h!=="false"}updateLightDOM(){let{command:e,skillUrl:a}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Cowork: ${e}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let t=this.querySelector("a[data-cb-crawl]");t||(t=document.createElement("a"),t.setAttribute("data-cb-crawl",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(t)),t.textContent=`Run on Cowork: ${e}`,t.setAttribute("data-platform","cowork"),t.setAttribute("data-command",e),a?(t.href=a,t.setAttribute("data-skill-url",a)):(t.href=`https://claude.ai/cowork?command=${encodeURIComponent(e)}`,t.removeAttribute("data-skill-url"))}getResolvedTheme(){return this._options.theme||"branded"}render(){if(!this.shadowRoot)return;let e=this.getResolvedTheme(),a=e==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,t=this._options.variant||"filled",o=k(e),i=this._options.size||"md",s=this._options.shape||"rounded",n=x[i],c=C[s][i];this.setAttribute("data-theme",a),this.setAttribute("data-variant",t);let b=t!=="filled"?"transparent":o.bg,h=t==="ghost"?"transparent":t==="outline"?o.primary:o.border,y=t!=="filled"?o.primary:o.text;this.shadowRoot.innerHTML=` | ||
| <style>${A}</style> | ||
| <button | ||
| class="cb-btn" | ||
| type="button" | ||
| style=" | ||
| ${w(o)} | ||
| --cb-bg: ${b}; | ||
| --cb-border: ${h}; | ||
| --cb-text: ${y}; | ||
| --cb-accent-color: ${o.primary}; | ||
| --cb-focus-color: ${o.primary}; | ||
| --cb-height: ${n.height}; | ||
| --cb-font-size: ${n.fontSize}; | ||
| --cb-icon-size: ${n.iconSize}; | ||
| --cb-padding: ${n.padding}; | ||
| --cb-gap: ${n.gap}; | ||
| --cb-radius: ${c}; | ||
| " | ||
| aria-label="Run on Cowork: ${this._options.command.replace(/"/g,""")}" | ||
| > | ||
| <span class="cb-btn-icon" aria-hidden="true">${g}</span> | ||
| <span class="cb-btn-label">Run on Cowork</span> | ||
| </button> | ||
| `;let m=this.shadowRoot.querySelector(".cb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:e,command:a,skillUrl:t,popupTitle:o,popupDescription:i,autoLaunch:s}=this._options;if(this.dispatchEvent(new CustomEvent("cb-open",{bubbles:!0,composed:!0,detail:{command:a}})),e===!1){navigator.clipboard.writeText(a).then(()=>{this._options.onCopy?.(a),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:a}}))});return}_({variant:"cowork",theme:this.getResolvedTheme(),title:o||"Run on Cowork",description:i||"Copy and paste into a Cowork session to get started.",command:a,skillUrl:t,autoLaunch:s===!0,onCopy:n=>{this._options.onCopy?.(n),this.dispatchEvent(new CustomEvent("cb-copy",{bubbles:!0,composed:!0,detail:{command:n}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("cb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}};l.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description","auto-launch"];function E(d="cowork-button"){typeof customElements>"u"||customElements.get(d)||customElements.define(d,l)}E();function O(d){let p=document.createElement("cowork-button");return p.options=d,p}export{l as CoworkButton,O as createCoworkButton,E as registerCoworkButton}; | ||
| //# sourceMappingURL=cowork-button-Y7T6EUQM.mjs.map |
| {"version":3,"sources":["../src/cowork-button.ts"],"sourcesContent":["import type { CoworkButtonOptions, Theme, Size, Variant, Shape } from './types';\nimport { COWORK_ICON } from './icons';\nimport { resolveTheme, themeToCSS, SIZE_MAP, SHAPE_MAP, BRAND_COLOR, BRAND_COLOR_HOVER, BRAND_COLOR_ACTIVE } from './themes';\nimport { showPopup } from './popup-dialog';\n\nconst BUTTON_STYLES = `\n :host {\n display: inline-block;\n vertical-align: middle;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-tap-highlight-color: transparent;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .cb-btn {\n display: inline-flex;\n align-items: center;\n gap: var(--cb-gap);\n height: var(--cb-height);\n min-height: 44px;\n padding: var(--cb-padding);\n border: 1.5px solid var(--cb-border);\n background: var(--cb-bg);\n color: var(--cb-text);\n font-family: inherit;\n font-size: var(--cb-font-size);\n font-weight: 600;\n line-height: 1;\n border-radius: var(--cb-radius);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n touch-action: manipulation;\n transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n }\n\n @media (pointer: fine) {\n .cb-btn { min-height: unset; }\n }\n\n /* ─── FILLED ─── */\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: ${BRAND_COLOR_HOVER};\n box-shadow: 0 2px 8px rgba(212, 121, 92, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn:active {\n background: ${BRAND_COLOR_ACTIVE};\n transform: scale(0.98);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: #5A4BD6;\n box-shadow: 0 2px 8px rgba(107, 92, 231, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: #4F41C8;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn:hover {\n background: #292524;\n border-color: #57534E;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn:active {\n background: #1C1917;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn:hover {\n border-color: #D6D3D1;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn:active {\n background: #FAFAF9;\n transform: scale(0.98);\n }\n\n /* ─── OUTLINE ─── */\n\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn {\n background: transparent;\n border-color: ${BRAND_COLOR};\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: rgba(212, 121, 92, 0.08);\n box-shadow: 0 2px 8px rgba(212, 121, 92, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn {\n background: transparent;\n border-color: #6B5CE7;\n color: #6B5CE7;\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: rgba(107, 92, 231, 0.08);\n box-shadow: 0 2px 8px rgba(107, 92, 231, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: rgba(107, 92, 231, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn {\n background: transparent;\n border-color: #57534E;\n color: #F5F0EB;\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(212, 121, 92, 0.08);\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn {\n background: transparent;\n border-color: #D6D3D1;\n color: #1C1917;\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(212, 121, 92, 0.05);\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.1);\n transform: scale(0.98);\n }\n\n /* ─── GHOST ─── */\n\n :host([data-variant=\"ghost\"]) .cb-btn {\n background: transparent;\n border-color: transparent;\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn {\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn:hover {\n background: rgba(212, 121, 92, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .cb-btn:active {\n background: rgba(212, 121, 92, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn {\n color: #6B5CE7;\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn:hover {\n background: rgba(107, 92, 231, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .cb-btn:active {\n background: rgba(107, 92, 231, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn {\n color: #F5F0EB;\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn:hover {\n background: rgba(255, 255, 255, 0.06);\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .cb-btn:active {\n background: rgba(255, 255, 255, 0.1);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn {\n color: #1C1917;\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .cb-btn:active {\n background: rgba(0, 0, 0, 0.08);\n transform: scale(0.98);\n }\n\n /* ─── FOCUS ─── */\n\n .cb-btn:focus-visible {\n outline: 2px solid var(--cb-focus-color, ${BRAND_COLOR});\n outline-offset: 2px;\n }\n\n /* ─── ICON ─── */\n\n .cb-btn-icon {\n width: var(--cb-icon-size);\n height: var(--cb-icon-size);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .cb-btn-icon svg { width: 100%; height: 100%; }\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .cb-btn-icon,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .cb-btn-icon {\n color: #FFFFFF;\n --cb-icon-accent: rgba(255,255,255,0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n --cb-icon-accent: #1C1917;\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n --cb-icon-accent: #FFFFFF;\n }\n\n :host([data-variant=\"outline\"]) .cb-btn-icon,\n :host([data-variant=\"ghost\"]) .cb-btn-icon {\n color: var(--cb-accent-color, ${BRAND_COLOR});\n }\n\n /* ─── LABEL ─── */\n\n .cb-btn-label {\n letter-spacing: -0.01em;\n }\n`;\n\nexport class CoworkButton extends HTMLElement {\n static observedAttributes = ['command', 'skill-url', 'theme', 'size', 'variant', 'shape', 'popup', 'popup-title', 'popup-description', 'auto-launch'];\n\n private _options: CoworkButtonOptions = {\n command: '',\n theme: 'branded',\n size: 'md',\n variant: 'filled',\n popup: true,\n };\n\n private _mqCleanup: (() => void) | null = null;\n private _rendered = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n attributeChangedCallback() {\n if (!this._rendered) return;\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n set options(opts: Partial<CoworkButtonOptions>) {\n this._options = { ...this._options, ...opts };\n this.render();\n this.updateLightDOM();\n }\n\n get options() {\n return this._options;\n }\n\n private syncFromAttributes() {\n const command = this.getAttribute('command');\n const skillUrl = this.getAttribute('skill-url');\n const theme = this.getAttribute('theme') as Theme | null;\n const size = this.getAttribute('size') as Size | null;\n const variant = this.getAttribute('variant') as Variant | null;\n const shape = this.getAttribute('shape') as Shape | null;\n const popup = this.getAttribute('popup');\n const popupTitle = this.getAttribute('popup-title');\n const popupDescription = this.getAttribute('popup-description');\n const autoLaunch = this.getAttribute('auto-launch');\n\n if (command !== null) this._options.command = command;\n if (skillUrl !== null) this._options.skillUrl = skillUrl;\n if (theme) this._options.theme = theme;\n if (size) this._options.size = size;\n if (variant) this._options.variant = variant;\n if (shape) this._options.shape = shape;\n if (popup !== null) this._options.popup = popup !== 'false';\n if (popupTitle !== null) this._options.popupTitle = popupTitle;\n if (popupDescription !== null) this._options.popupDescription = popupDescription;\n if (autoLaunch === null) {\n delete this._options.autoLaunch;\n } else {\n this._options.autoLaunch = autoLaunch !== 'false';\n }\n }\n\n private updateLightDOM() {\n const { command, skillUrl } = this._options;\n\n this.setAttribute('role', 'button');\n this.setAttribute('tabindex', '0');\n this.setAttribute('aria-label', `Run on Cowork: ${command}`);\n if (this._options.popup !== false) {\n this.setAttribute('aria-haspopup', 'dialog');\n } else {\n this.removeAttribute('aria-haspopup');\n }\n\n let link = this.querySelector('a[data-cb-crawl]') as HTMLAnchorElement | null;\n if (!link) {\n link = document.createElement('a');\n link.setAttribute('data-cb-crawl', '');\n link.setAttribute('aria-hidden', 'true');\n link.style.cssText = 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;';\n this.appendChild(link);\n }\n link.textContent = `Run on Cowork: ${command}`;\n link.setAttribute('data-platform', 'cowork');\n link.setAttribute('data-command', command);\n if (skillUrl) {\n link.href = skillUrl;\n link.setAttribute('data-skill-url', skillUrl);\n } else {\n link.href = `https://claude.ai/cowork?command=${encodeURIComponent(command)}`;\n link.removeAttribute('data-skill-url');\n }\n }\n\n private getResolvedTheme(): Theme {\n return this._options.theme || 'branded';\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const theme = this.getResolvedTheme();\n const resolvedTheme = theme === 'system' ? (\n typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n ) : theme;\n const variant = this._options.variant || 'filled';\n\n const tokens = resolveTheme(theme);\n const size = this._options.size || 'md';\n const shape = this._options.shape || 'rounded';\n const sizeTokens = SIZE_MAP[size];\n const radius = SHAPE_MAP[shape][size];\n\n this.setAttribute('data-theme', resolvedTheme);\n this.setAttribute('data-variant', variant);\n\n const bgOverride = variant !== 'filled' ? 'transparent' : tokens.bg;\n const borderOverride = variant === 'ghost' ? 'transparent' :\n variant === 'outline' ? tokens.primary : tokens.border;\n const textOverride = variant !== 'filled' ? tokens.primary : tokens.text;\n\n this.shadowRoot.innerHTML = `\n <style>${BUTTON_STYLES}</style>\n <button\n class=\"cb-btn\"\n type=\"button\"\n style=\"\n ${themeToCSS(tokens)}\n --cb-bg: ${bgOverride};\n --cb-border: ${borderOverride};\n --cb-text: ${textOverride};\n --cb-accent-color: ${tokens.primary};\n --cb-focus-color: ${tokens.primary};\n --cb-height: ${sizeTokens.height};\n --cb-font-size: ${sizeTokens.fontSize};\n --cb-icon-size: ${sizeTokens.iconSize};\n --cb-padding: ${sizeTokens.padding};\n --cb-gap: ${sizeTokens.gap};\n --cb-radius: ${radius};\n \"\n aria-label=\"Run on Cowork: ${this._options.command.replace(/\"/g, '"')}\"\n >\n <span class=\"cb-btn-icon\" aria-hidden=\"true\">${COWORK_ICON}</span>\n <span class=\"cb-btn-label\">Run on Cowork</span>\n </button>\n `;\n\n const btn = this.shadowRoot.querySelector('.cb-btn')!;\n btn.addEventListener('click', () => this.handleClick());\n btn.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Enter' || (e as KeyboardEvent).key === ' ') {\n e.preventDefault();\n this.handleClick();\n }\n });\n this._rendered = true;\n this.setupSystemThemeWatch();\n }\n\n private handleClick() {\n const { popup, command, skillUrl, popupTitle, popupDescription, autoLaunch } = this._options;\n\n this.dispatchEvent(new CustomEvent('cb-open', {\n bubbles: true,\n composed: true,\n detail: { command },\n }));\n\n if (popup === false) {\n navigator.clipboard.writeText(command).then(() => {\n this._options.onCopy?.(command);\n this.dispatchEvent(new CustomEvent('cb-copy', {\n bubbles: true,\n composed: true,\n detail: { command },\n }));\n });\n return;\n }\n\n showPopup({\n variant: 'cowork',\n theme: this.getResolvedTheme(),\n title: popupTitle || 'Run on Cowork',\n description: popupDescription || 'Copy and paste into a Cowork session to get started.',\n command,\n skillUrl,\n autoLaunch: autoLaunch === true,\n onCopy: (cmd) => {\n this._options.onCopy?.(cmd);\n this.dispatchEvent(new CustomEvent('cb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: cmd },\n }));\n },\n onClose: () => {\n this.dispatchEvent(new CustomEvent('cb-close', {\n bubbles: true,\n composed: true,\n }));\n },\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n if (this.getResolvedTheme() !== 'system' || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n}\n\nexport function registerCoworkButton(tagName = 'cowork-button') {\n if (typeof customElements === 'undefined') return;\n if (!customElements.get(tagName)) {\n customElements.define(tagName, CoworkButton);\n }\n}\n\nregisterCoworkButton();\n\nexport function createCoworkButton(options: CoworkButtonOptions): CoworkButton {\n const el = document.createElement('cowork-button') as CoworkButton;\n el.options = options;\n return el;\n}\n"],"mappings":"iGAKA,IAAMA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBA6CJC,CAAiB;AAAA;AAAA;AAAA;AAAA,kBAIjBC,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAyChBC,CAAW;AAAA,aAClBA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBA+BJA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAcXA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAgBlBA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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CACF,CAAC,CACH,CAEQ,uBAAwB,CAI9B,GAHA,KAAK,aAAa,EAClB,KAAK,WAAa,KAEd,KAAK,iBAAiB,IAAM,UAAY,OAAO,OAAW,IAAa,OAE3E,IAAMC,EAAK,OAAO,WAAW,8BAA8B,EACrDC,EAAU,IAAM,KAAK,OAAO,EAClCD,EAAG,iBAAiB,SAAUC,CAAO,EACrC,KAAK,WAAa,IAAMD,EAAG,oBAAoB,SAAUC,CAAO,CAClE,CACF,EArOa9B,EACJ,mBAAqB,CAAC,UAAW,YAAa,QAAS,OAAQ,UAAW,QAAS,QAAS,cAAe,oBAAqB,aAAa,EAsO/I,SAAS+B,EAAqBC,EAAU,gBAAiB,CAC1D,OAAO,eAAmB,KACzB,eAAe,IAAIA,CAAO,GAC7B,eAAe,OAAOA,EAAShC,CAAY,CAE/C,CAEA+B,EAAqB,EAEd,SAASE,EAAmBC,EAA4C,CAC7E,IAAMC,EAAK,SAAS,cAAc,eAAe,EACjD,OAAAA,EAAG,QAAUD,EACNC,CACT","names":["BUTTON_STYLES","BRAND_COLOR_HOVER","BRAND_COLOR_ACTIVE","BRAND_COLOR","CoworkButton","opts","command","skillUrl","theme","size","variant","shape","popup","popupTitle","popupDescription","autoLaunch","link","resolvedTheme","tokens","resolveTheme","sizeTokens","SIZE_MAP","radius","SHAPE_MAP","bgOverride","borderOverride","textOverride","themeToCSS","COWORK_ICON","btn","e","showPopup","cmd","mq","handler","registerCoworkButton","tagName","createCoworkButton","options","el"]} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1051236
0.22%7365
0.03%