1import{H,T as k,M as V}from"./DkEhcZiB.js";import{_ as S}from"./D3S1n6T8.js";import{u as T,c as M,r as m,o as P,a as i,e as f,w as v,f as n,F as g,b as y,t as p,x as A,g as s,j as q,y as z}from"./BX97eYXR.js";import{a as L}from"./Cm0UX6qg.js";import"./8817wFzl.js";const R={key:0,class:"container min-h-screen mx-auto"},F={class:"gap-10 md:flex 2xl:my-12"},N={class:"md:w-3/4"},B={class:"md:w-1/3 px-4 md:sticky md:h-[300px] md:top-[50px]"},D={class:"uppercase"},E=["innerHTML"],O={class:"flex flex-wrap gap-2 mb-6"},U=["onClick"],$={class:"w-full px-6 py-1 text-center border rounded-full md:w-64"},j=["disabled"],I={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=n("div",{class:"fixed left-0 right-0 w-full text-center inset-1/2 md:grid"},[n("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=n("p",null,"Loading",-1),K=[J],oe={__name:"syntonic",setup(Y){T({title:M(()=>"High Wizard Mailer #4 CHROMIRIUM Variant (Holographic Hidden COVER)")});const e=m(null),h=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="high-wizard-mailer-5-variant-syntonic";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=(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{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 r=A();r.addToCart(e.value,t.node),r.openCartDrawer()}function _(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 P(x),(t,r)=>{const o=k,u=V,l=H,c=S;return e.value?(s(),i("div",R,[f(l,null,{default:v(()=>[f(o,null,{default:v(()=>[q(" 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,[(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))]),n("div",B,[n("h1",D,p(e.value.title),
621),n("div",{class:"my-10 leading-tight uppercase",innerHTML:e.value.descriptionHtml},null,8,E),n("div",O,[(s(!0),i(g,null,y(e.value.variants.edges,a=>(s(),i("button",{key:a.node.id,class:z(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,U))),128))]),n("div",$,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,j)):(s(),i("button",I," 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.