const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DhTKlDYs.js","./entry.Cl9Y7gpG.css"])))=>i.map(i=>d[i]); import{ab as Me,h as te,m as y,l as O,ac as D,q as Te,f as Ie,g as me,G as Re,o as d,c,a as t,b as P,w as C,t as _,d as E,a8 as je,j as r,k as T,aa as pe,a9 as fe,x as X,y as be,z as Z,F as ee,r as Be,C as Oe,ad as se,_ as K,$ as H,a0 as F,a1 as Ae,S as Le,P as Ue,n as he,e as Ke,v as ze,A as ie,U as qe,ae as Fe}from"./DhTKlDYs.js";import{_ as ye}from"./D6RH7Yzs.js";const W="gamma-market-cart-v1",gs=Me("cart",()=>{const e=y([]),s=y({name:"",addressLine1:"",addressLine2:"",city:"",postalCode:"",country:"",email:"",phone:"",notes:""}),a=y(""),m=y(null),f=y({orderId:"",status:"idle",submittedEventId:"",invoice:"",invoiceAmount:"",invoiceExpiration:""});(()=>{const p=localStorage.getItem(W);if(p)try{const v=JSON.parse(p);e.value=v.items||[],s.value={...s.value,...v.shippingInfo||{}},a.value=v.shippingReference||"",m.value=v.guestKeys||null,f.value={...f.value,...v.orderState||{}}}catch{localStorage.removeItem(W)}})(),te([e,s,a,m,f],()=>{const p={items:e.value,shippingInfo:s.value,shippingReference:a.value,guestKeys:m.value,orderState:f.value};localStorage.setItem(W,JSON.stringify(p))},{deep:!0});const i=O(()=>e.value.reduce((p,v)=>{const g=Number(v.price?.amount||0);return p+g*v.quantity},0)),u=O(()=>e.value.reduce((p,v)=>p+v.quantity,0)),n=(p,v=1)=>{const g=e.value.find(o=>o.reference===p.reference);if(g){g.quantity+=v;return}e.value.push({reference:p.reference,d:p.d,title:p.title,image:p.image,price:p.price,quantity:v})},h=p=>{e.value=e.value.filter(v=>v.reference!==p)},x=(p,v)=>{const g=e.value.find(o=>o.reference===p);g&&(g.quantity=Math.max(1,Number(v)||1))},w=p=>{s.value={...s.value,...p}},k=p=>{m.value=p},I=p=>{f.value={...f.value,...p}},R=()=>{a.value="",f.value={orderId:"",status:"idle",submittedEventId:"",invoice:"",invoiceAmount:"",invoiceExpiration:""}};return{items:e,shippingInfo:s,shippingReference:a,guestKeys:m,orderState:f,subtotal:i,totalItems:u,addToCart:n,removeFromCart:h,updateQuantity:x,setShippingInfo:w,setGuestKeys:k,setOrderState:I,clearCheckout:R,clearCart:()=>{e.value=[],R()}}}),ue="gamma-market-theme",J=e=>e==="light"?"light":"dark",He=()=>{const e=D("theme-mode",()=>"dark"),s=D("shop-bootstrap-state",()=>({merchantTheme:null,merchantThemeMode:""})),a=O(()=>!!s.value?.merchantTheme);te(()=>[a.value,s.value?.merchantThemeMode],()=>{if(!a.value)return;const i=J(s.value?.merchantThemeMode||"dark");e.value=i,document.documentElement.setAttribute("data-theme",i)},{immediate:!0});const m=i=>{if(a.value){const n=s.value?.merchantThemeMode||"dark";e.value=J(n),document.documentElement.setAttribute("data-theme",e.value);return}const u=J(i);e.value=u,document.documentElement.setAttribute("data-theme",u),localStorage.setItem(ue,u)};return{theme:e,hasMerchantTheme:a,initializeTheme:()=>{if(a.value){m(s.value?.merchantThemeMode||"dark");return}const i=localStorage.getItem(ue);m(i||"dark")},applyTheme:m,toggleTheme:()=>{a.value||m(e.value==="dark"?"light":"dark")}}},De={class:"sticky top-0 z-10 border-b border-[var(--line)] bg-[color:var(--surface)]/95 backdrop-blur"},Ve={class:"mx-auto flex max-w-6xl items-center px-4 py-3 sm:px-6 lg:px-8"},Ye={class:"flex flex-1 justify-start"},Ge=["src"],We={key:1,class:"flex h-9 w-9 items-center justify-center rounded-full border border-[var(--line)] bg-stone-100 text-xs font-bold text-[var(--muted)]"},Je={class:"hidden items-center gap-4 text-sm font-medium sm:gap-6 md:flex"},Qe={class:"flex flex-1 items-center justify-end gap-4 text-sm font-medium"},Xe={class:"text-xs font-semibold"},Ze=["href"],et={class:"sr-only"},tt={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7",class:"h-5 w-5","aria-hidden":"true"},st={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7",class:"h-5 w-5","aria-hidden":"true"},ot={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8",class:"h-5 w-5","aria-hidden":"true"},nt={key:0,d:"M4 7h16M4 12h16M4 17h16"},rt={key:1,d:"M6 6l12 12M18 6 6 18"},at={key:0,class:"border-b border-[var(--line)] bg-[var(--surface)] md:hidden"},lt={class:"mx-auto flex max-w-6xl flex-col gap-1 px-4 py-3 text-sm font-medium sm:px-6 lg:px-8"},it={class:"w-full max-w-2xl rounded-2xl border border-[var(--line)] bg-[var(--surface)] p-5 shadow-2xl"},ut={class:"flex items-center justify-between gap-3"},dt={key:0,class:"mt-3 text-sm text-[var(--muted)]"},ct={key:1,class:"mt-3 rounded-lg border border-red-200 bg-red-50 p-2 text-sm text-red-800"},mt={key:2,class:"mt-3 text-sm text-[var(--muted)]"},pt={key:3,class:"mt-3 text-sm text-[var(--muted)]"},ft={key:4,class:"mt-3 space-y-2"},bt={class:"min-w-0 truncate text-sm font-medium"},ht={class:"shrink-0 text-xs text-[var(--muted)]"},yt="/nostr-assets/nostr-logo-black.svg",vt={__name:"ShopHeader",props:{itemCount:{type:Number,default:0},merchantProfile:{type:Object,default:null},merchantNpub:{type:String,default:""}},setup(e){const{theme:s,hasMerchantTheme:a,initializeTheme:m,toggleTheme:f}=He(),{ensureBootstrap:b}=Te(),i=Ie(),u=y(!1),n=y(!1),h=y(""),x=y(!1),w=y(""),k=D("shop-search-inventory",()=>[]),I=D("shop-search-loaded",()=>!1),R=async()=>{if(!(x.value||I.value)){x.value=!0,w.value="";try{const g=await b();k.value=g.products||[],I.value=!0}catch(g){w.value=g.message||"Could not load products for search."}finally{x.value=!1}}},j=async()=>{u.value=!0,n.value=!1,I.value||await R()},p=O(()=>{const g=h.value.trim().toLowerCase();return g?k.value.filter(o=>{const N=(o.categories||[]).map(U=>String(U||"").trim()).filter(Boolean);return[o.title,o.summary,o.description,...N,N.length?"":"uncategorized"].join(" ").toLowerCase().includes(g)}).slice(0,5):[]}),v=g=>`/product/${encodeURIComponent(g.d)}`;return te(()=>i.fullPath,()=>{u.value=!1,n.value=!1}),me(()=>{m(),window.addEventListener("shop:open-search",j)}),Re(()=>{window.removeEventListener("shop:open-search",j)}),(g,o)=>{const N=ye;return d(),c(ee,null,[t("header",De,[t("div",Ve,[t("div",Ye,[P(N,{to:"/",class:"flex items-center gap-3 text-lg font-semibold tracking-tight"},{default:C(()=>[e.merchantProfile?.picture?(d(),c("img",{key:0,src:e.merchantProfile.picture,alt:"Merchant profile",class:"h-9 w-9 rounded-full border border-[var(--line)] object-cover"},null,8,Ge)):(d(),c("div",We," M ")),t("span",null,_(e.merchantProfile?.name||"loading"),1)]),_:1})]),t("nav",Je,[P(N,{to:"/"},{default:C(()=>[...o[5]||(o[5]=[E("Home",-1)])]),_:1}),P(N,{to:"/products"},{default:C(()=>[...o[6]||(o[6]=[E("Products",-1)])]),_:1}),P(N,{to:"/categories"},{default:C(()=>[...o[7]||(o[7]=[E("Categories",-1)])]),_:1}),P(N,{to:"/contact"},{default:C(()=>[...o[8]||(o[8]=[E("About us",-1)])]),_:1})]),t("nav",Qe,[P(N,{to:"/cart",class:"inline-flex items-center gap-2 rounded-full border border-[var(--line)] px-2 py-1.5"},{default:C(()=>[o[9]||(o[9]=t("span",{class:"sr-only"},"Open cart",-1)),o[10]||(o[10]=t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8",class:"h-5 w-5","aria-hidden":"true"},[t("circle",{cx:"9",cy:"20",r:"1.5"}),t("circle",{cx:"18",cy:"20",r:"1.5"}),t("path",{d:"M3 4h2l2.2 10.2a2 2 0 0 0 2 1.6h7.8a2 2 0 0 0 2-1.5L21 7H7.5"})],-1)),t("span",Xe,_(e.itemCount),1)]),_:1}),t("button",{class:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--line)]",onClick:j},[...o[11]||(o[11]=[t("span",{class:"sr-only"},"Search products",-1),t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8",class:"h-5 w-5","aria-hidden":"true"},[t("circle",{cx:"11",cy:"11",r:"7"}),t("path",{d:"m20 20-3.5-3.5"})],-1)])]),e.merchantNpub?(d(),c("a",{key:0,href:`https://njump.me/${e.merchantNpub}`,target:"_blank",rel:"noopener noreferrer",class:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--line)]"},[o[12]||(o[12]=t("span",{class:"sr-only"},"Open merchant npub",-1)),t("img",{src:yt,alt:"",class:"h-5 w-5 object-contain",style:je({filter:r(s)==="dark"?"invert(1)":"none"}),"aria-hidden":"true"},null,4)],8,Ze)):T("",!0),r(a)?T("",!0):(d(),c("button",{key:1,class:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--line)]",onClick:o[0]||(o[0]=(...M)=>r(f)&&r(f)(...M))},[t("span",et,_(r(s)==="dark"?"Switch to light mode":"Switch to dark mode"),1),r(s)==="dark"?(d(),c("svg",tt,[...o[13]||(o[13]=[pe('',9)])])):(d(),c("svg",st,[...o[14]||(o[14]=[t("path",{d:"M12 3a7 7 0 1 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))])),t("button",{class:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--line)] md:hidden",onClick:o[1]||(o[1]=M=>n.value=!r(n))},[o[15]||(o[15]=t("span",{class:"sr-only"},"Toggle menu",-1)),(d(),c("svg",ot,[r(n)?(d(),c("path",rt)):(d(),c("path",nt))]))])])])]),r(n)?(d(),c("div",at,[t("nav",lt,[P(N,{to:"/",class:"rounded-lg px-3 py-2"},{default:C(()=>[...o[16]||(o[16]=[E("Home",-1)])]),_:1}),P(N,{to:"/products",class:"rounded-lg px-3 py-2"},{default:C(()=>[...o[17]||(o[17]=[E("Products",-1)])]),_:1}),P(N,{to:"/categories",class:"rounded-lg px-3 py-2"},{default:C(()=>[...o[18]||(o[18]=[E("Categories",-1)])]),_:1}),P(N,{to:"/contact",class:"rounded-lg px-3 py-2"},{default:C(()=>[...o[19]||(o[19]=[E("About us",-1)])]),_:1})])])):T("",!0),r(u)?(d(),c("div",{key:1,class:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 px-4 pt-20",onClick:o[4]||(o[4]=fe(M=>u.value=!1,["self"]))},[t("div",it,[t("div",ut,[o[20]||(o[20]=t("h2",{class:"text-lg font-semibold"},"Search Products",-1)),t("button",{class:"rounded border border-[var(--line)] px-2 py-1 text-xs",onClick:o[2]||(o[2]=M=>u.value=!1)},"Close")]),X(t("input",{"onUpdate:modelValue":o[3]||(o[3]=M=>Z(h)?h.value=M:null),type:"search",placeholder:"Type to search products",class:"mt-4 w-full rounded-lg border border-[var(--line)] bg-white px-3 py-2 text-sm text-black"},null,512),[[be,r(h)]]),r(x)?(d(),c("p",dt,"Loading inventory…")):r(w)?(d(),c("p",ct,_(r(w)),1)):r(h).trim()?r(p).length===0?(d(),c("p",pt,"No matching products.")):(d(),c("div",ft,[(d(!0),c(ee,null,Be(r(p),M=>(d(),Oe(N,{key:M.id,to:v(M),class:"flex items-center justify-between gap-3 rounded-lg border border-[var(--line)] px-3 py-2 hover:bg-black/5"},{default:C(()=>[t("span",bt,_(M.title),1),t("span",ht,_(M.price.display),1)]),_:2},1032,["to"]))),128))])):(d(),c("p",mt,"Start typing to see up to 5 matching products."))])])):T("",!0)],64)}}},xs=Object.assign(vt,{__name:"ShopHeader"}),gt=se("/btc-button.png"),xt=se("/paypal-button.png"),wt=se("/Logo.png");var L=Symbol("verified"),kt=e=>e instanceof Object;function _t(e){if(!kt(e)||typeof e.kind!="number"||typeof e.content!="string"||typeof e.created_at!="number"||typeof e.pubkey!="string"||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let s=0;s{if(typeof e!="string")return"";const s=e.trim();return s.startsWith("wss://")?s:""},V=e=>Array.from(new Set(e.map($t).filter(Boolean))),Mt=e=>{const a=String(e||"").toLowerCase().split(".")[0]||"";return a.startsWith("npub1")?a:a.startsWith("npubs1")?`npub1${a.slice(6)}`:""},Tt=e=>{const s=Ke(e);if(s.type!=="npub")throw new Error("Invalid npub format.");return s.data},ge=e=>{const s=[];for(const a of e?.tags||[])(a[0]==="relay"||a[0]==="r")&&a[1]&&s.push(a[1]);return V(s)},It=e=>e.filter(s=>s[0]!=="d"&&s[0]!=="name"),xe=({sourceManifest:e,sourcePubkey:s,relays:a})=>{const m=It((e?.tags||[]).map(i=>[...i])),f=V([...ge(e),...a||[]]).map(i=>["relay",i]),b=m.filter(i=>i[0]!=="relay"&&i[0]!=="r");return{kind:15128,created_at:Math.floor(Date.now()/1e3),tags:[...b,...f,["muse",ve,...V(a||[]).slice(0,3)]],content:e?.content||""}},Rt=()=>{const e=new Le;return{uniq:V,generateIdentity:()=>{const i=Pt(),u=Et(i);return{secretKey:i,pubkey:u,npub:he(u),nsec:Ue(i)}},resolveSourceNpub:({hostname:i,fallbackNpub:u=""})=>Mt(i)||String(u||""),fetchSourceManifest:async({sourceNpub:i,relays:u})=>{const n=Tt(i),x=[...await e.querySync(u,{kinds:[15128,35128],authors:[n],limit:30})].sort((k,I)=>I.created_at-k.created_at)[0];if(!x)throw new Error("No source nsite manifest found on selected relays.");const w=ge(x);return{sourcePubkey:n,manifest:x,manifestRelays:w}},publishProfile:async({identity:i,name:u,relays:n})=>{const h={name:u,display_name:u,about:"Owner of a sovereign Nsite webshop"},x=de({kind:0,created_at:Math.floor(Date.now()/1e3),tags:[],content:JSON.stringify(h)},i.secretKey),w=e.publish(n,x);return await Promise.any(w),x},publishClonedManifest:async({identity:i,sourceManifest:u,sourcePubkey:n,relays:h})=>{const x=xe({sourceManifest:u,sourcePubkey:n,relays:h}),w=de(x,i.secretKey),k=e.publish(h,w);return await Promise.any(k),w},TEMPLATE_MUSE_PUBKEY:ve}},jt={key:0},Bt={class:"w-full max-w-xl rounded-2xl border border-violet-300/50 bg-[var(--surface)] p-6 shadow-2xl"},Ot={key:0,class:"mt-5 grid gap-2"},At={key:1,class:"mt-5 rounded-xl border border-violet-300/40 bg-violet-500/10 p-4"},Lt={key:0,class:"mt-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900"},Ut={class:"mt-3 text-xs"},Kt={class:"font-mono break-all"},zt={class:"mt-1 text-xs"},qt={class:"font-mono break-all"},Ft={class:"mt-2 flex gap-2"},Ht={class:"mt-3 flex items-center gap-2 text-xs"},Dt=["disabled"],Vt={key:0,class:"mt-3 inline-flex items-center gap-2 rounded-full border border-violet-300/50 bg-violet-500/20 px-3 py-1 text-xs text-violet-100"},Yt={key:2,class:"mt-5 rounded-xl border border-emerald-300/50 bg-emerald-500/10 p-4"},Gt={class:"mt-2 text-xs text-[var(--muted)]"},Wt={class:"font-mono break-all"},Jt={class:"mt-1 text-xs text-[var(--muted)]"},Qt=["href"],Xt={key:3,class:"mt-5 rounded-xl border border-violet-300/40 bg-violet-500/10 p-4"},Zt=["disabled"],es=["href"],ts={key:1,class:"mt-2 text-xs text-red-500"},ss={key:4,class:"mt-3 rounded-lg border border-red-300 bg-red-50 p-3 text-sm text-red-700"},os={class:"mt-5 flex justify-end gap-2"},ce="/nostr-assets/nostr-ostrich-running.gif",ns={__name:"ShopNsiteCloneFab",props:{embedded:{type:Boolean,default:!1}},setup(e){const s=y(!1),a=y(""),m=y("choice"),f=y(""),b=y(null),i=y(!1),u=y(!1),n=y(""),h=y(""),x=y([]),w=y(!1),k=y(""),I=y(""),{debugState:R,setShopDebug:j}=ze(),{uniq:p,generateIdentity:v,resolveSourceNpub:g,fetchSourceManifest:o,publishProfile:N,publishClonedManifest:M}=Rt(),U=e,we=()=>{m.value="choice",f.value="",b.value=null,i.value=!1,u.value=!1,n.value="",h.value="",x.value=[],w.value=!1,k.value="",I.value=""},oe=()=>{s.value=!1,we()},ne=()=>p([...R.value.merchantOutbox||[],...R.value.merchantInbox||[],...R.value.orderPublishRelays||[],...R.value.paymentListenRelays||[],"wss://relay.ditto.pub","wss://relay.damus.io","wss://relay.primal.net","wss://nos.lol"]),re=async $=>{$&&await navigator.clipboard.writeText($)},ke=async()=>{m.value="existing",k.value=""},_e=()=>{m.value="new",n.value=""},Se=()=>{b.value=v(),i.value=!1,n.value="",console.log("[nsite-clone] newcomer keys generated",{npub:b.value.npub,pubkey:b.value.pubkey}),j({details:{cloneNewcomerGenerated:!0,cloneNewcomerNpub:b.value.npub}})},Ne=async()=>{if(n.value="",!f.value.trim()){n.value="Please enter a display name.";return}if(!b.value){n.value="Please generate your keys first.";return}if(!i.value){n.value="Please confirm that you safely backed up your keys.";return}try{u.value=!0;const $=ne(),l=g({hostname:window.location.hostname,fallbackNpub:R.value.merchantNpub});if(!l)throw new Error("Could not resolve source nsite npub for cloning.");const S=await o({sourceNpub:l,relays:$}),B=S.manifestRelays.length>0?S.manifestRelays:$;x.value=B;const z=await N({identity:b.value,name:f.value.trim(),relays:B}),q=await M({identity:b.value,sourceManifest:S.manifest,sourcePubkey:S.sourcePubkey,relays:B}),A=`https://${b.value.npub}.nsite.lol/`;h.value=A,console.log("[nsite-clone] newcomer clone published",{sourceNpub:l,publishRelays:B,profileEventId:z.id,cloneEventId:q.id,siteUrl:A}),j({details:{cloneNewcomerPublished:!0,cloneNewcomerProfileEventId:z.id,cloneNewcomerManifestEventId:q.id,cloneNewcomerSiteUrl:A}}),window.open(A,"_blank","noopener,noreferrer")||(n.value="Clone published, but your browser blocked opening the new site tab. Use the link below."),m.value="new-success"}catch($){n.value=$.message||"Failed to publish profile and clone this nsite.",console.error("[nsite-clone] newcomer clone failed",$),j({details:{cloneNewcomerPublished:!1,cloneNewcomerError:n.value}})}finally{u.value=!1}},Ce=async()=>{if(k.value="",!window.nostr?.getPublicKey||!window.nostr?.signEvent){k.value="No Nostr browser signer found. Please install a NIP-07 extension first.";return}try{w.value=!0;const $=ne(),l=g({hostname:window.location.hostname,fallbackNpub:R.value.merchantNpub});if(!l)throw new Error("Could not resolve source nsite npub for cloning.");const S=await o({sourceNpub:l,relays:$}),B=S.manifestRelays.length>0?S.manifestRelays:$,z=await window.nostr.getPublicKey(),q=xe({sourceManifest:S.manifest,sourcePubkey:S.sourcePubkey,relays:B}),A=await window.nostr.signEvent(q),{SimplePool:ae}=await Fe(async()=>{const{SimplePool:Ee}=await import("./DhTKlDYs.js").then($e=>$e.aw);return{SimplePool:Ee}},__vite__mapDeps([0,1]),import.meta.url),le=new ae,Pe=le.publish(B,A);await Promise.any(Pe),le.close(B);const G=`https://${he(z)}.nsite.lol/`;I.value=G,j({details:{cloneExistingPublished:!0,cloneExistingManifestEventId:A.id,cloneExistingSiteUrl:G}}),window.open(G,"_blank","noopener,noreferrer")||(k.value="Clone published, but your browser blocked opening the new site tab. Use the link below.")}catch($){k.value=$.message||"Failed to clone this nsite with your existing signer.",console.error("[nsite-clone] existing-user clone failed",$),j({details:{cloneExistingPublished:!1,cloneExistingError:k.value}})}finally{w.value=!1}};return me(()=>{a.value=window.location.href,console.log("[nsite-clone] current deployment URL",a.value),j({details:{deploymentSource:a.value}})}),($,l)=>(d(),c(ee,null,[t("button",{class:ie(["inline-flex items-center justify-center border border-violet-300 bg-gradient-to-br from-violet-500 via-fuchsia-500 to-purple-700 text-white shadow-[0_12px_30px_rgba(168,85,247,0.45)] transition hover:scale-[1.02] hover:shadow-[0_16px_34px_rgba(168,85,247,0.6)]",U.embedded?"h-9 gap-1.5 rounded-full px-3 py-2 text-xs font-semibold":"fixed bottom-6 right-6 z-40 h-14 w-14 rounded-full"]),onClick:l[0]||(l[0]=S=>s.value=!0)},[l[6]||(l[6]=t("span",{class:"sr-only"},"Open Nostr clone dialog",-1)),t("img",{src:ce,alt:"",class:ie(U.embedded?"h-5 w-5 object-contain":"h-10 w-10 object-contain"),"aria-hidden":"true"},null,2),U.embedded?(d(),c("span",jt,"Clone This Nsite")):T("",!0)],2),r(s)?(d(),c("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/55 px-4",onClick:fe(oe,["self"])},[t("div",Bt,[l[19]||(l[19]=pe('Nostr Boutique logo

Congratulations you found something cool!

Did you know you can have your own sovereign shop like this?

If you knew this, congratulations, you're quite the nerd 🤓. If you didn’t, there is a short write-up on how this works at https://nostr.boutique/explain.

If you already have a key, you can clone by clicking I'm already on Nostr. If you are new, follow the I'm new here path and have your own store in under 15 seconds.

',6)),r(m)==="choice"?(d(),c("div",Ot,[t("button",{class:"rounded-lg border border-violet-300 bg-violet-600 px-4 py-2 text-sm font-semibold text-white",onClick:_e}," I’m new here "),t("button",{class:"rounded-lg border border-[var(--line)] px-4 py-2 text-sm font-semibold",onClick:ke}," I’m already on Nostr ")])):r(m)==="new"?(d(),c("div",At,[l[15]||(l[15]=t("label",{class:"text-xs font-semibold uppercase tracking-[0.1em] text-[var(--muted)]"},"Your display name",-1)),X(t("input",{"onUpdate:modelValue":l[1]||(l[1]=S=>Z(f)?f.value=S:null),type:"text",placeholder:"Sovereign Shop Owner",class:"mt-2 w-full rounded-lg border border-[var(--line)] bg-white/95 px-3 py-2 text-sm text-black"},null,512),[[be,r(f)]]),t("button",{class:"mt-3 rounded-lg border border-violet-300 bg-violet-600 px-4 py-2 text-sm font-semibold text-white",onClick:Se}," Generate my keys "),r(b)?(d(),c("div",Lt,[l[13]||(l[13]=t("p",{class:"font-semibold"},"Important: We do not store these keys.",-1)),l[14]||(l[14]=t("p",{class:"mt-1"},"If you lose them, you can’t access this site anymore. You can always create a new one.",-1)),t("p",Ut,[l[7]||(l[7]=t("span",{class:"font-semibold"},"npub:",-1)),l[8]||(l[8]=E()),t("span",Kt,_(r(b).npub),1)]),t("p",zt,[l[9]||(l[9]=t("span",{class:"font-semibold"},"nsec:",-1)),l[10]||(l[10]=E()),t("span",qt,_(r(b).nsec),1)]),t("div",Ft,[t("button",{class:"rounded border border-amber-300 bg-white px-2 py-1 text-xs",onClick:l[2]||(l[2]=S=>re(r(b).npub))},"Copy npub"),t("button",{class:"rounded border border-amber-300 bg-white px-2 py-1 text-xs",onClick:l[3]||(l[3]=S=>re(r(b).nsec))},"Copy nsec")]),t("label",Ht,[X(t("input",{"onUpdate:modelValue":l[4]||(l[4]=S=>Z(i)?i.value=S:null),type:"checkbox"},null,512),[[qe,r(i)]]),l[11]||(l[11]=t("span",null,"I saved these keys securely.",-1))]),t("button",{class:"mt-3 rounded-lg border border-violet-300 bg-violet-700 px-4 py-2 text-sm font-semibold text-white disabled:cursor-not-allowed disabled:opacity-60",disabled:r(u),onClick:Ne},_(r(u)?"Publishing and cloning...":"Publish profile and clone now"),9,Dt),r(u)?(d(),c("div",Vt,[t("img",{src:ce,alt:"",class:"h-5 w-5 object-contain","aria-hidden":"true"}),l[12]||(l[12]=t("span",null,"Deploying and running on Nostr...",-1))])):T("",!0)])):T("",!0)])):r(m)==="new-success"?(d(),c("div",Yt,[l[17]||(l[17]=t("p",{class:"font-semibold text-emerald-200"},"Your sovereign shop clone is live.",-1)),t("p",Gt,[l[16]||(l[16]=E("New npub: ",-1)),t("span",Wt,_(r(b)?.npub),1)]),t("p",Jt,"Published relays: "+_(r(x).join(", ")),1),t("a",{href:r(h),target:"_blank",rel:"noopener noreferrer",class:"mt-3 inline-flex rounded-lg border border-emerald-300 bg-emerald-600 px-4 py-2 text-sm font-semibold text-white"}," Open my new Nsite ",8,Qt)])):(d(),c("div",Xt,[t("button",{class:"rounded-lg border border-violet-300 bg-violet-500 px-4 py-2 text-sm font-semibold text-white",disabled:r(w),onClick:Ce},_(r(w)?"Cloning with your signer...":"Clone this Nsite to my own Npub !"),9,Zt),l[18]||(l[18]=t("p",{class:"mt-2 text-xs text-[var(--muted)]"}," This uses your Nostr browser signer and always publishes the clone as your root site with the template `muse` tag. ",-1)),r(I)?(d(),c("a",{key:0,href:r(I),target:"_blank",rel:"noopener noreferrer",class:"mt-3 inline-flex rounded-lg border border-emerald-300 bg-emerald-600 px-4 py-2 text-sm font-semibold text-white"}," Open my cloned Nsite ",8,es)):T("",!0),r(k)?(d(),c("p",ts,_(r(k)),1)):T("",!0)])),r(n)?(d(),c("p",ss,_(r(n)),1)):T("",!0),t("div",os,[r(m)!=="choice"?(d(),c("button",{key:0,class:"rounded-lg border border-[var(--line)] px-4 py-2 text-sm",onClick:l[5]||(l[5]=S=>m.value="choice")}," Back ")):T("",!0),t("button",{class:"rounded-lg border border-[var(--line)] px-4 py-2 text-sm",onClick:oe}," Close ")])])])):T("",!0)],64))}},rs={class:"mt-12 border-t border-[var(--line)] bg-[var(--surface)]/70"},as={class:"mx-auto grid max-w-6xl gap-8 px-4 py-8 sm:px-6 lg:grid-cols-[1.5fr_0.7fr_0.9fr] lg:px-8"},ls={class:"mt-2 text-xl font-semibold tracking-tight"},is=["href"],us={class:"flex flex-col items-center justify-center gap-2 place-self-center"},ds={key:0,class:"inline-flex items-center","aria-label":"PayPal payment option"},cs={class:"mt-3 grid grid-cols-2 gap-x-6 gap-y-2 text-sm font-medium md:grid-cols-3"},ms={class:"border-t border-[var(--line)]"},ps={class:"mx-auto flex max-w-6xl flex-col gap-3 px-4 py-4 text-xs text-[var(--muted)] sm:px-6 md:flex-row md:items-center md:justify-between lg:px-8"},fs={class:"md:ml-auto"},ws={__name:"ShopFooter",props:{merchantProfile:{type:Object,default:null},merchantNpub:{type:String,default:""}},setup(e){const s=e,a=new Date().getFullYear(),m=O(()=>s.merchantProfile?.name||"Nostr Boutique"),f=O(()=>{const u=String(s.merchantProfile?.website||s.merchantProfile?.url||"").trim();return u?u.startsWith("http://")||u.startsWith("https://")?u:`https://${u}`:""}),b=O(()=>f.value?f.value.replace(/^https?:\/\//,""):""),i=O(()=>String(s.merchantProfile?.paypal||"").trim().length>0);return(u,n)=>{const h=ye;return d(),c("footer",rs,[t("div",as,[t("div",null,[n[0]||(n[0]=t("p",{class:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--muted)]"},"Nostr Boutique",-1)),t("h2",ls,_(r(m)),1),r(f)?(d(),c("a",{key:0,href:r(f),target:"_blank",rel:"noopener noreferrer",class:"mt-3 inline-flex text-sm font-medium underline underline-offset-4 hover:text-[var(--text)]"},_(r(b)),9,is)):T("",!0)]),t("div",us,[n[2]||(n[2]=t("div",{class:"inline-flex items-center","aria-label":"Bitcoin payment option"},[t("img",{src:gt,alt:"Pay with Bitcoin",class:"h-9 w-auto"})],-1)),r(i)?(d(),c("div",ds,[...n[1]||(n[1]=[t("img",{src:xt,alt:"Pay with PayPal",class:"h-8 w-auto"},null,-1)])])):T("",!0)]),t("div",null,[n[8]||(n[8]=t("p",{class:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--muted)]"},"Browse",-1)),t("div",cs,[P(h,{to:"/"},{default:C(()=>[...n[3]||(n[3]=[E("Home",-1)])]),_:1}),P(h,{to:"/products"},{default:C(()=>[...n[4]||(n[4]=[E("Products",-1)])]),_:1}),P(h,{to:"/categories"},{default:C(()=>[...n[5]||(n[5]=[E("Categories",-1)])]),_:1}),P(h,{to:"/contact"},{default:C(()=>[...n[6]||(n[6]=[E("About us",-1)])]),_:1}),P(h,{to:"/cart"},{default:C(()=>[...n[7]||(n[7]=[E("Cart",-1)])]),_:1})])])]),t("div",ms,[t("div",ps,[t("div",null,[t("p",null,_(r(a))+" "+_(r(m))+". Powered by Nostr.",1),n[9]||(n[9]=t("p",{class:"mt-1"},"Decentralized products, merchant-owned identity.",-1))]),t("div",fs,[P(ns,{embedded:""})])])])])}}};export{xs as S,ws as _,Et as a,de as f,Pt as g,gs as u};