import{D as d,n as u,c as m,B as a}from"./vendor-mini-lit-Cx886NBU.js";import{b as c,r as y,t as f}from"./vendor-lit-BtHfzs80.js";import"./vendor-lucide-DBEJLfdn.js";import"./vendor-marked-_iteVaMm.js";var h=Object.defineProperty,b=Object.getOwnPropertyDescriptor,p=(t,e,o,i)=>{for(var r=i>1?void 0:i?b(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&h(e,o,r),r};let l=class extends d{constructor(){super(...arguments),this.url="",this.modalWidth="min(520px, 92vw)",this.modalHeight="auto"}createRenderRoot(){return this}static show(t){const e=new l;e.url=t,document.body.appendChild(e),e.open(),queueMicrotask(()=>{const o=e.querySelector("input[data-copy-link-input]");o&&(o.focus(),o.select())})}async copy(){try{await navigator.clipboard.writeText(this.url)}catch{const t=this.querySelector("input[data-copy-link-input]");if(t){t.focus(),t.select();try{document.execCommand("copy")}catch{}}}}renderContent(){return c`
			${u({className:"flex flex-col",children:c`
					${m({title:"Copy session link",description:"Press Ctrl/Cmd+C to copy, or use the button below."})}
					<div class="mt-4">
						<input
							type="text"
							readonly
							data-copy-link-input
							data-testid="copy-link-fallback-input"
							class="w-full px-3 py-2 text-sm font-mono border border-border rounded bg-muted text-foreground"
							.value=${this.url}
							@click=${t=>t.target.select()}
						/>
					</div>
					<div class="mt-4 flex justify-end gap-2 border-t border-border pt-3">
						${a({variant:"outline",size:"sm",onClick:()=>this.close(),children:"Close"})}
						${a({variant:"default",size:"sm",onClick:()=>this.copy(),children:"Copy"})}
					</div>
				`})}
		`}};p([y()],l.prototype,"url",2);l=p([f("copy-link-fallback-dialog")],l);export{l as CopyLinkFallbackDialog};
