import{i as p,b as d,a as c,t as u}from"./vendor-lit-B2r-dKc0.js";var b=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(e,o,i,n)=>{for(var t=n>1?void 0:n?h(o,i):o,a=e.length-1,l;a>=0;a--)(l=e[a])&&(t=(n?l(o,i,t):l(t))||t);return n&&t&&b(o,i,t),t};let s=class extends p{constructor(){super(...arguments),this.sessionId="",this.messageCount=0,this.proposalTypes=[],this._boundKeyDown=this._onKeyDown.bind(this),this._cancel=()=>{this.dispatchEvent(new CustomEvent("cancel",{bubbles:!1}))},this._confirm=()=>{this.dispatchEvent(new CustomEvent("continue",{bubbles:!1}))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.style.position="fixed",this.style.inset="0",this.style.zIndex="50",document.addEventListener("keydown",this._boundKeyDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._boundKeyDown)}_onKeyDown(e){e.key==="Escape"&&(e.preventDefault(),this._cancel())}render(){return d`
			<div
				class="fixed inset-0 z-50 flex items-center justify-center p-4"
				style="background: rgba(0,0,0,0.55);"
				data-continue-chooser-backdrop
				@click=${e=>{e.target===e.currentTarget&&this._cancel()}}
			>
				<div
					role="dialog"
					aria-modal="true"
					aria-label="Continue in new session"
					class="bg-background text-foreground rounded-lg shadow-xl w-full"
					style="max-width: 460px; border:1px solid var(--border);"
				>
					<div class="flex flex-col gap-3 p-5">
						<div class="flex flex-col gap-1">
							<h2 class="text-base font-semibold">Continue in new session</h2>
							<p class="text-xs text-muted-foreground">
								Start a fresh session configured like this one. The full
								history will be cloned losslessly — the agent picks up where
								you left off.
							</p>
							${this.proposalTypes.length>0?d`
								<p class="text-xs text-muted-foreground" data-proposal-carryover>
									Your ${this.proposalTypes.join(" / ")} proposal draft will be carried over so you can keep editing.
								</p>
							`:null}
						</div>

						<div class="flex items-center justify-end gap-2 pt-1">
							<button
								type="button"
								class="px-3 py-1.5 text-sm rounded-md border hover:bg-muted"
								style="border-color: var(--border);"
								data-action="cancel"
								@click=${this._cancel}
							>
								Cancel
							</button>
							<button
								type="button"
								class="px-3 py-1.5 text-sm rounded-md text-white"
								style="background: var(--primary, #3b82f6); border:1px solid var(--primary, #3b82f6);"
								data-action="continue"
								@click=${this._confirm}
							>
								Continue
							</button>
						</div>
					</div>
				</div>
			</div>
		`}};r([c()],s.prototype,"sessionId",2);r([c({type:Number})],s.prototype,"messageCount",2);r([c({type:Array})],s.prototype,"proposalTypes",2);s=r([u("continue-session-chooser")],s);customElements.get("continue-session-chooser")||customElements.define("continue-session-chooser",s);export{s as ContinueSessionChooser};
