1import{H as k,T,M as V}from"./DkEhcZiB.js";import{_ as H}from"./D3S1n6T8.js";import{r as m,u as S,c as A,o as P,a as i,e as f,w as v,f as r,F as g,b as y,t as p,x as N,g as s,j as M,y as q}from"./BX97eYXR.js";import{a as L}from"./Cm0UX6qg.js";import"./8817wFzl.js";const z={key:0,class:"container min-h-screen mx-auto"},D={class:"gap-10 md:flex 2xl:my-12"},E={class:"md:w-3/4"},F={class:"md:w-1/3 px-4 md:sticky md:h-[300px] md:top-[50px]"},I={class:"uppercase"},R=["innerHTML"],B={class:"flex flex-wrap gap-2 mb-6"},O=["onClick"],U={class:"w-full px-6 py-1 text-center border rounded-full md:w-64"},$=["disabled"],j={key:1,disabled:"",class:"block w-full px-6 py-1 mt-4 text-white bg-gray-300 border rounded-full md:inline md:w-64"},G={key:1},W=r("div",{class:"fixed left-0 right-0 w-full text-center inset-1/2 md:grid"},[r("p",null," Loading")],-1),Q=[W],X={key:2,class:"fixed left-0 right-0 w-full text-center inset-1/2 md:grid"},J=r("p",null,"Loading",-1),K=[J],oe={__name:"LSP845",setup(Y){const e=m(null),h=m(!1);m(!1);function b(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(t)}S({title:A(()=>"High Wizard Mailer ONE (#1) HIDDEN COVER (TITANIUM VARIANT)")});const d=m(null);async function x(){var t,n;try{const o="high-wizard-mailer-one-1-hidden-cover-titanium-variant";h.value=!0;const u=await L.post("https://highwizardry.myshopify.com/api/2023-04/graphql",{query:` 2 query GetProductByHandle($productHandle: String!) { 3 product(handle: $productHandle) { 4 availableForSale 5 compareAtPriceRange { 6 maxVariantPrice { 7 amount 8 currencyCode 9 } 10 minVariantPrice { 11 amount 12 currencyCode 13 } 14 } 15 variants(first: 5){ 16 edges { 17 node { 18 id 19 title 20 quantityAvailable 21 } 22 } 23 } 24 description 25 descriptionHtml 26 handle 27 id 28 images(first: 20) { 29 edges { 30 cursor 31 node { 32 altText 33 height 34 id 35 url 36 width 37 } 38 } 39 } 40 onlineStoreUrl 41 options(first: 5) { 42 id 43 name 44 values 45 } 46 priceRange { 47 minVariantPrice { 48 amount 49 currencyCode 50 } 51 maxVariantPrice { 52 amount 53 currencyCode 54 } 55 } 56 productType 57 tags 58 title 59 vendor 60 } 61 } 62 `,variables:{productHandle:o}},{headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":"acb69c731fd1191b8208f2b8df4e9384"}});if(u.data.errors)throw new Error(`GraphQL error: ${u.data.errors.map(c=>c.message).join(", ")}`);const l=(n=(t=u.data)==null?void 0:t.data)==null?void 0:n.product;if(l&&l.variants.edges.length>0){const c=l.variants.edges.find(a=>a.node.quantityAvailable);c&&(d.value=c.node.id)}e.value=l}catch(o){console.error("Error fetching product:",o.message)}finally{h.value=!1}}function w(t){d.value=t}function C(){if(!d.value){console.error("No variant selected!");return}const t=e.value.variants.edges.find(o=>o.node.id===d.value);if(!t){console.error("Selected variant not found!");return}const n=N();n.addToCart(e.value,t.node),n.openCartDrawer()}function _(t){if(!t||!e.value)return!1;const n=e.value.variants.edges.find(o=>o.node.id===t);return n&&n.node.quantityAvailable>=1}return P(x),(t,n)=>{const o=T,u=V,l=k,c=H;return e.value?(s(),i("div",z,[f(l,null,{default:v(()=>[f(o,null,{default:v(()=>[M(" High Wizardry! | "+p(e.value.title),1)]),_:1}),f(u,{name:"description",content:e.value.description},null,8,["content"])]),_:1}),r("div",D,[r("div",E,[(s(!0),i(g,null,y(e.value.images.edges,a=>(s(),i("div",{key:a,class:"mb-4"},[f(c,{src:a.node.url,alt:a.node.altText,quality:"80",width:"860",height:"1161",placeholder:""},null,8,["src","alt"])]))),128))]),r("div",F,[r("h1",I,p(e.value.title),
621),r("div",{class:"my-10 leading-tight uppercase",innerHTML:e.value.descriptionHtml},null,8,R),r("div",B,[(s(!0),i(g,null,y(e.value.variants.edges,a=>(s(),i("button",{key:a.node.id,class:q(a.node.id===d.value?"bg-gray-100 border-gray-100 border px-6 uppercase rounded-full":"px-6 border uppercase rounded-full"),onClick:Z=>w(a.node.id)},p(a.node.title),11,O))),128))]),r("div",U,p(b(e.value.priceRange.minVariantPrice.amount)),1),e.value.availableForSale&&_(d.value)?(s(),i("button",{key:0,disabled:!d.value,class:"block w-full px-6 py-1 mt-4 uppercase transition ease-in-out delay-200 border rounded-full disabled:bg-zinc-100 disabled:hover:none hover:border hover:border-gray-200 hover:bg-gray-200 md:inline md:w-64",onClick:C},p(_(d.value)?"Add to Cart":"Sold Out"),9,$)):(s(),i("button",j," Sold Out "))])])])):h.value?(s(),i("div",G,Q)):(s(),i("div",X,K))}}};export{oe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.