1import{H as C,T as S,M as V}from"./DkEhcZiB.js";import{_ as T}from"./D3S1n6T8.js";import{a as H}from"./Cm0UX6qg.js";import{r as m,o as q,a as s,e as f,w as h,f as n,F as y,b as g,t as p,x as P,g as i,j as A,y as L}from"./BX97eYXR.js";import"./8817wFzl.js";const M={key:0,class:"container min-h-screen mx-auto"},F={class:"gap-10 md:flex 2xl:my-12"},N={class:"md:w-3/4"},z={class:"md:w-1/3 px-4 md:sticky md:h-[300px] md:top-[50px]"},B={class:"uppercase"},D=["innerHTML"],$={class:"flex flex-wrap gap-2 mb-6"},j=["onClick"],E={class:"w-full px-6 py-1 text-center border rounded-full md:w-64"},R=["disabled"],U={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},O=n("div",{class:"fixed left-0 right-0 w-full text-center inset-1/2 md:grid"},[n("p",null," Loading")],-1),I=[O],Q={key:2,class:"fixed left-0 right-0 w-full text-center inset-1/2 md:grid"},W=n("p",null,"Loading",-1),X=[W],ne={__name:"vision-quest",setup(J){const e=m(null),_=m(!1);m(!1);function b(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(t)}const d=m(null);async function x(){var t,r;try{const o="vision-quest";_.value=!0;const u=await H.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=(r=(t=u.data)==null?void 0:t.data)==null?void 0:r.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{_.value=!1}}function w(t){d.value=t}function k(){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 r=P();r.addToCart(e.value,t.node),r.openCartDrawer()}function v(t){if(!t||!e.value)return!1;const r=e.value.variants.edges.find(o=>o.node.id===t);return r&&r.node.quantityAvailable>=1}return q(x),(t,r)=>{const o=S,u=V,l=C,c=T;return e.value?(i(),s("div",M,[f(l,null,{default:h(()=>[f(o,null,{default:h(()=>[A(" High Wizardry! | "+p(e.value.title),1)]),_:1}),f(u,{name:"description",content:e.value.description},null,8,["content"])]),_:1}),n("div",F,[n("div",N,[(i(!0),s(y,null,g(e.value.images.edges,a=>(i(),s("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))]),n("div",z,[n("h1",B,p(e.value.title),
621),n("div",{class:"my-10 leading-tight uppercase",innerHTML:e.value.descriptionHtml},null,8,D),n("div",$,[(i(!0),s(y,null,g(e.value.variants.edges,a=>(i(),s("button",{key:a.node.id,class:L(a.node.id===d.value?"bg-gray-100 border-gray-100 border px-6 uppercase rounded-full":"px-6 border uppercase rounded-full"),onClick:K=>w(a.node.id)},p(a.node.title),11,j))),128))]),n("div",E,p(b(e.value.priceRange.minVariantPrice.amount)),1),e.value.availableForSale&&v(d.value)?(i(),s("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:k},p(v(d.value)?"Add to Cart":"Sold Out"),9,R)):(i(),s("button",U," Sold Out "))])])])):_.value?(i(),s("div",G,I)):(i(),s("div",Q,X))}}};export{ne 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.