1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6618],{16618:function(e,t,n){n.d(t,{ab:function(){return I},OW:function(){return C},d2:function(){return w}});var r=n(85893),l=n(67294),i=n(68871);l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("rounded-xl border border-neutral-200 bg-white text-neutral-950 shadow dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",n),...l})}).displayName="Card",l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",n),...l})}).displayName="CardHeader",l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)("h3",{ref:t,className:(0,i.cn)("font-semibold leading-none tracking-tight",n),...l})}).displayName="CardTitle",l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)("p",{ref:t,className:(0,i.cn)("text-sm text-neutral-500 dark:text-neutral-400",n),...l})}).displayName="CardDescription",l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("p-6 pt-0",n),...l})}).displayName="CardContent",l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex items-center p-6 pt-0",n),...l})}).displayName="CardFooter";var a=n(77667);a.zt;let s=a.fC;a.xz,l.forwardRef((e,t)=>{let{className:n,sideOffset:l=4,...s}=e;return(0,r.jsx)(a.VY,{ref:t,sideOffset:l,className:(0,i.cn)("z-50 overflow-hidden rounded-md bg-neutral-900 px-3 py-1.5 text-xs text-neutral-50 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:bg-neutral-50 dark:text-neutral-900",n),...s})}).displayName=a.VY.displayName;var o=n(16321),d=n(87787),c=n(62469);let u=d.fC;d.xz;let x=d.h_;d.x8;let h=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)(d.aV,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...l})});h.displayName=d.aV.displayName,l.forwardRef((e,t)=>{let{className:n,children:l,...a}=e;return(0,r.jsxs)(x,{children:[(0,r.jsx)(h,{}),(0,r.jsxs)(d.VY,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950",n),...a,children:[l,(0,r.jsxs)(d.x8,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400",children:[(0,r.jsx)(c.Pxu,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}).displayName=d.VY.displayName,l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)(d.Dx,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",n),...l})}).displayName=d.Dx.displayName,l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)(d.dk,{ref:t,className:(0,i.cn)("text-sm text-neutral-500 dark:text-neutral-400",n),...l})}).displayName=d.dk.displayName;var p=n(44597);n(67467);var m=n(81328),j=n(89734),g=n.n(j),f=n(82786);n(41664);var v=n(33889),y=n(50196),b=n(91803);n(30245),n(54075),n(57495),n(26544),n(39332);let Z=(e,t)=>{let n=null==t?void 0:t.reduce((e,t)=>({...e,[t.id]:t}),{}),r=g()(null==e?void 0:e.files,e=>Number(e.additional_price));return{sizes:g()((0,y.vI)(t),e=>y.Le[e]||e),variantMap:n,files:r,colors:(0,y.is)(t),product:e}},w=e=>{let t={variables:{productId:"".concat(e)},fetchPolicy:"cache-first",skip:!e},{data:{printfulProduct:n}={},error:r,loading:l}=(0,m.lZ4)(t),{data:{printfulProductPrintFiles:i=""}={}}=(0,m.$Eq)(t),{data:{printfulVariants:a=[]}={}}=(0,m.kUs)({variables:{productId:"".concat(e)},skip:!e}),{data:{printfulMockTemplate:s=""}={}}=(0,m.Hb0)(t),o=Z(n,a),d=i?JSON.parse(i):null;return{...o,printfileData:d,printfileMap:null==d?void 0:d.printfiles.reduce((e,t)=>({...e,[t.printfile_id]:t}),{}),variantPrintfileMap:null==d?void 0:d.variant_printfiles.reduce((e,t)=>({...e,[t.variant_id]:t.placements}),{}),printfulMockTemplate:s||null,loading:l,printfulVariants:a,layoutTemplates:{},variants:a,error:r}},k=e=>{let{minPrice:t,maxPrice:n,type:l}=e;return"range"===l?(0,r.jsxs)(r.Fragment,{children:["$",(0,b.G)(t)," - ","$",(0,b.G)(n)]}):(0,r.jsxs)(r.Fragment,{children:["$",(0,b.G)(n)]})},C=e=>{let{product:t}=e,n=(null==t?void 0:t.minPrice)!==(null==t?void 0:t.maxPrice)?"range":"single";return(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(f.mW,{src:null==t?void 0:t.image,padding:0,size:50}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm",children:null==t?void 0:t.title}),(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"font-bold",children:t?(0,r.jsx)(k,{type:n,minPrice:t.minPrice,maxPrice:t.maxPrice}):null}),(0,r.jsx)(s,{children:(0,r.jsx)(p.Z,{className:"ml-1"})})]})})]})]})},S=e=>{let{product:t}=e,[n,i]=(0,l.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.z,{onClick:()=>{i(!0)},children:"Product info, pricing & guidelines"}),(0,r.jsx)(u,{open:n,children:(0,r.jsxs)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-96 bg-white shadow-lg p-4",children:[(0,r.jsx)("div",{className:"text-lg mb-2",children:null==t?void 0:t.title}),(0,r.jsx)("div",{children:null==t?void 0:t.description}),(0,r.jsx)("div",{className:"text-lg mt-4",children:"Pricing"}),(0,r.jsxs)("div",{children:["Starting Price: ",null==t?void 0:t.minPrice," - ",null==t?void 0:t.maxPrice]}),(0,r.jsx)("div",{className:"text-lg mt-4",children:"Guidelines"}),(0,r.jsx)("div",{children:"Follow these guidelines for best results..."})]})})]})},I=e=>{let{product:t,colors:n,state:l,onColorSelect:i,onSizeSelect:a,onTechniqueSelect:s}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-bold mb-2",children:null==t?void 0:t.title}),(0,r.jsx)(S,{product:t}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.LA,{selected:l.technique,techniques:null==t?void 0:t.techniques,onClick:s}),(0,r.jsx)(v.oW,{selected:null==l?void 0:l.sizes,sizes:null==t?void 0:t.sizes,onClick:a}),(0,r.jsx)(v.W6,{selected:null==l?void 0:l.colors,colors:n,onClick:i})]})]})}},33889:function(e,t,n){n.d(t,{W6:function(){return u},f4:function(){return H},oW:function(){return Q},LA:function(){return q}});let r={minWidth:"33.333%",flexBasis:"33.333%",flexGrow:0,flexShrink:0,display:"flex",justifyContent:"center",alignItems:"center"};var l=n(85893),i=n(67294),a=n(95442),s=n(69320),o=n(98969),d=e=>{let{children:t}=e;return(0,l.jsx)(a.Z,{mb:1,children:(0,l.jsx)(s.Z,{fontWeight:800,children:t})})},c=n(10929);let u=e=>{var t;let{colors:n={},selected:r,hideTitle:i,onClick:u}=e;return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(a.Z,{justifyContent:"space-between",alignItems:"center",sx:{width:"100%",display:i?"none":"flex"},children:[(0,l.jsx)(d,{children:"Colors"}),(0,l.jsx)(s.Z,{children:(null==r?void 0:r.length)||""})]}),(0,l.jsx)(c.Z,{container:!0,spacing:1,children:null===(t=Object.entries(n))||void 0===t?void 0:t.map(e=>{let[t,n]=e,i=r&&r.includes(n);return(0,l.jsx)(c.Z,{xs:4,sx:{},children:(0,l.jsx)(o.Z,{fullWidth:!0,size:"small",variant:r&&r.includes(n)?"contained":"text",onClick:u&&(()=>
1u(n)),sx:{height:40,border:"2px solid lightgrey",background:n,borderColor:i?"blue":"grey","&:hover":{background:n}}})},t)})})]}):null};var x=n(70563),h=e=>{let{description:t,title:n}=e,[r,c]=i.useState(!1),[u,...h]=(null==t?void 0:t.split("\n⢠"))||[],p=r?h:h.slice(0,2),m=h.length>2;return(0,l.jsxs)(a.Z,{justifyContent:"space-between",alignItems:"center",sx:{width:"100%"},children:[n?(0,l.jsx)(d,{children:"string"==typeof n?n:"Description"}):null,u?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Z,{variant:"body1",children:u}),p.length?(0,l.jsxs)("ul",{children:[p.map((e,t)=>(0,l.jsx)("li",{children:(0,l.jsx)(s.Z,{variant:"body1",children:e})},t)),m?(0,l.jsx)(o.Z,{variant:"text",onClick:()=>c(!r),children:r?"show less":"show more"}):null]}):null]}):(0,l.jsx)(s.Z,{variant:"body1",children:(0,l.jsx)(x.Z,{variant:"text"})})]})},p=n(32921),m=n(67842);function j(e){let{children:t,value:n,current:r,...i}=e;return(0,l.jsx)("div",{role:"tabpanel",hidden:n!==r,id:"tabpanel-".concat(n),"aria-labelledby":"tab-".concat(n),...i,children:n===r?t:null})}function g(e){return{id:"tab-".concat(e),"aria-controls":"tabpanel-".concat(e)}}var f=n(81328),v=n(1316),y=n(61154),b=n(13712),Z=n(47884),w=n(74887),k=n(36153),C=n(41143),S=n.n(C),I=n(44908),D=n.n(I),N=n(90006),F=n(36596),P=n(96714),E=n(13736),z=e=>{let{label:t,children:n}=e,r=t.toLocaleLowerCase().replaceAll(" ","-");return(0,l.jsxs)(N.Z,{children:[(0,l.jsx)(F.Z,{expandIcon:(0,l.jsx)(E.Z,{}),"aria-controls":"".concat(r,"-content"),id:"".concat(r,"-header"),children:(0,l.jsx)(s.Z,{children:t})}),(0,l.jsx)(P.Z,{children:n})]})};let M=e=>{let{productId:t}=e,{data:{printfulProductSizeGuide:n}={}}=(0,f.sfh)({variables:{productId:t}});if(!n)return(0,l.jsx)(R,{});let r=JSON.parse(n);if(!r)return(0,l.jsx)(L,{});let{size_tables:i}=r;return(0,l.jsx)(_,{sizeTables:i})},R=()=>(0,l.jsxs)(v.Z,{direction:"column",spacing:2,my:2,alignItems:"center",children:[(0,l.jsxs)(s.Z,{variant:"body1",width:"100%",children:[(0,l.jsx)(x.Z,{variant:"text",width:"100%"}),(0,l.jsx)(x.Z,{variant:"text",width:"100%"}),(0,l.jsx)(x.Z,{variant:"text",width:"65%"})]}),(0,l.jsx)(a.Z,{width:"100%",display:"inline-flex",flexDirection:"row-reverse",children:(0,l.jsx)(x.Z,{variant:"rounded",width:"25%"})}),(0,l.jsx)(x.Z,{variant:"rounded",width:"100%",height:100})]}),L=()=>(0,l.jsx)(s.Z,{variant:"body1",mx:2,my:5,children:"This loot does not have a size guide."}),_=e=>{let{sizeTables:t}=e,n=t.find(e=>"product_measure"===e.type&&"inches"===e.unit),r=t.find(e=>"product_measure"===e.type&&"cm"===e.unit),[a,o]=i.useState(!n),d=a?r:n;if(!d)return(0,l.jsx)(L,{});S()("product_measure"===d.type,"bad type");let{description:c,image_url:u,image_description:x,measurements:h,unit:p}=d,m=W(c),j=W(x);return(0,l.jsxs)(v.Z,{direction:"column",spacing:2,my:2,children:[(0,l.jsx)(s.Z,{variant:"body1",children:m}),n&&r?(0,l.jsx)(A,{checked:!a,onChange:()=>o(!a)}):null,(0,l.jsxs)("div",{children:[(0,l.jsx)(z,{label:"Product Measurements",children:(0,l.jsx)(T,{imageUrl:u,imageDescription:j})}),(0,l.jsx)(z,{label:"Product Size Chart",children:(0,l.jsx)(O,{measurements:h,unit:p})})]})]})},A=e=>(0,l.jsx)(a.Z,{width:"100%",display:"inline-flex",children:(0,l.jsxs)(v.Z,{direction:"row",spacing:1,alignItems:"center",ml:"auto",children:[(0,l.jsx)(s.Z,{variant:"caption",children:"cm"}),(0,l.jsx)(y.Z,{size:"small",color:"default",...e}),(0,l.jsx)(s.Z,{variant:"caption",children:"inches"})]})}),T=e=>{let{imageUrl:t,imageDescription:n}=e;return(0,l.jsxs)(v.Z,{direction:"row",children:[(0,l.jsx)("div",{style:{display:"inline-flex",justifyContent:"center",maxWidth:"50%"},children:(0,l.jsx)("img",{src:t,alt:"product measurement graphic",style:{margin:"auto"}})}),(0,l.jsx)("div",{style:{margin:"auto"},children:(0,l.jsx)(s.Z,{variant:"caption",align:"right",whiteSpace:"pre-wrap",children:n})})]})},O=e=>{let{measurements:t,unit:n}=e,r=t.map(e=>e.type_label),i=D()(t.map(e=>e.values.map(e=>e.size)).flat()).map(e=>{let n=t.reduce((t,n)=>{let r=n.values.find(t=>t.size===e);if(r){if("value"in r)t.push(r.value);else{let{min_value:e,max_value:n}=r;S()("string"==typeof e,"Missing min_value"),S()("string"==typeof n,"Missing max_value"),t.pu
1sh("".concat(e," - ").concat(n))}}return t},[]);return{size:e,values:n}});return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(b.Z,{"aria-label":"size-table",children:[(0,l.jsx)(Z.Z,{children:(0,l.jsxs)(w.Z,{children:[(0,l.jsx)(k.Z,{align:"left",children:"Size"}),r.map(e=>(0,l.jsx)(k.Z,{align:"right",children:e},e))]})}),i.map(e=>{let{size:t,values:r}=e;return(0,l.jsxs)(w.Z,{children:[(0,l.jsx)(k.Z,{align:"left",children:t}),r.map((e,r)=>(0,l.jsxs)(k.Z,{align:"right",children:[function(e){let t=parseFloat(e),n=Math.floor(t);if(t-n<.05)return"".concat(n);let r=Math.ceil(t);return r-t<.05?"".concat(r):"".concat(t)}(e),"inches"===n?'"':" ".concat(n)]},"".concat(t,"-").concat(r)))]},t)})]})})};function W(e){S()("string"==typeof e,"Bad input: ".concat(e));let{documentElement:{textContent:t}}=new DOMParser().parseFromString(e,"text/html");return S()(t,"Failed to htmlDecode input"),t}var U=n(16618),G=n(13311),K=n.n(G),V=n(37370);let B=e=>{let{printfile:t}=e,n=null==t?void 0:t.width,r=null==t?void 0:t.height;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(V.b,{label:"Width (Pixels)",value:"".concat(n)}),(0,l.jsx)(V.b,{label:"Height (Pixels)",value:"".concat(r)}),(0,l.jsx)(V.b,{label:"DPI",value:"".concat(null==t?void 0:t.dpi)}),(0,l.jsx)(V.b,{label:"Fill Mode",value:null==t?void 0:t.fill_mode}),(0,l.jsx)(V.b,{label:"Rotate?",value:(null==t?void 0:t.can_rotate)?"Can Rotate":"No Rotate"})]})};var Y=e=>{let{productId:t,variantId:n}=e,{printfileData:r={}}=(0,U.d2)(t),{available_placements:i={},printfiles:o,variant_printfiles:d}=r||{},c=K()(d,e=>e.variant_id==n);Object.keys(i).length;let u=null==c?void 0:c.placements,x=c&&c.placements&&Object.keys(null==c?void 0:c.placements)[0],h=null==o?void 0:o.reduce((e,t)=>({...e,[null==t?void 0:t.printfile_id]:t}),{});return K()(o,e=>e.printfile_id==(null==c?void 0:c.placements[x])),(0,l.jsxs)(a.Z,{children:[(0,l.jsx)(a.Z,{mb:2,children:(0,l.jsx)(s.Z,{children:"Print Plates"})}),u?Object.keys(u).map(e=>(0,l.jsxs)(a.Z,{sx:{border:"1px grey solid",borderRadius:2,p:2,mb:2},children:[(0,l.jsx)(s.Z,{gutterBottom:!0,fontWeight:"800",children:i[e]}),(0,l.jsx)(B,{printfile:h[u[e]]})]},e)):null]})};let H=e=>{let{productId:t,variantId:n,description:r}=e,[a,s]=i.useState("description");return(0,l.jsxs)("div",{children:[(0,l.jsxs)(p.Z,{value:a,onChange:(e,t)=>
1s(t),"aria-label":"product detail tabs",children:[(0,l.jsx)(m.Z,{label:"Description",value:"description",...g("details")}),(0,l.jsx)(m.Z,{label:"Size Guide",value:"sizing",...g("sizing")}),(0,l.jsx)(m.Z,{label:"Print Files",value:"printFiles",...g("printFiles")})]}),(0,l.jsx)(j,{value:"description",current:a,children:(0,l.jsx)(h,{description:r})}),(0,l.jsx)(j,{value:"sizing",current:a,children:(0,l.jsx)(M,{productId:t})}),(0,l.jsx)(j,{value:"printFiles",current:a,children:(0,l.jsx)(Y,{productId:t,variantId:n})})]})};var X=n(50196);let Q=e=>{let{selected:t,sizes:n,onClick:i,hideTitle:s,sort:u=!0}=e,h=u?n&&[...n].sort(X.K1):n;return(0,l.jsxs)(a.Z,{children:[(0,l.jsxs)(a.Z,{justifyContent:"space-between",alignItems:"center",sx:{display:s?"none":"flex"},children:[(0,l.jsx)(d,{children:"Sizes"}),(0,l.jsx)(d,{children:t&&t.length?t.length:""})]}),(0,l.jsx)(c.Z,{container:!0,spacing:1,children:h?h.map(e=>{let n=t&&t.includes(e);return(0,l.jsx)(c.Z,{xs:4,children:(0,l.jsx)(o.Z,{size:"small",variant:n?"contained":"outlined",color:"primary",onClick:i&&(()=>i(e)),sx:{width:"100%",...r},children:e})},e)}):(0,l.jsx)(c.Z,{container:!0,spacing:1,children:[0,1,2,3,4].map(e=>(0,l.jsx)(c.Z,{xs:4,children:(0,l.jsx)(x.Z,{variant:"rounded",sx:{width:"100%",...r},children:(0,l.jsx)(o.Z,{size:"small",children:"L"})})},e))})})]})},q=e=>{let{techniques:t=[],selected:n,onClick:r}=e;return(0,l.jsxs)(a.Z,{children:[(0,l.jsx)(d,{children:"Techniques"}),(0,l.jsx)(a.Z,{display:"flex",flexDirection:{xs:"column",md:"row"},gap:1,my:2,children:null==t?void 0:t.map((e,t)=>(0,l.jsx)(o.Z,{onClick:()=>r&&r(e),sx:{flex:1},variant:"outlined",children:e.displayName},t))})]})}},61440:function(e,t,n){n.d(t,{Z:function(){return c}});var r=n(85893);n(67294);var l=n(95442),i=n(4224),a=n(40613),s=n(99136),o=n(69320),d=n(70563);function c(e){let{children:t,image:n,sx:s,alt:o="Lootgod art cover",loading:c,...u}=e;return(0,r.jsxs)(i.Z,{...u,sx:{minHeight:140,width:"100%",display:"flex",...s},children:[(0,r.jsx)(l.Z,{sx:{display:"flex",flex:1,flexDirection:"column"},children:t}),c?(0,r.jsx)(d.Z,{variant:"rectangular",sx:{width:{xs:120,sm:151},minHeight:140}}):(0,r.jsx)(a.Z,{sx:{width:{xs:120,sm:151}},image:n,alt:o})]})}c.Content=e=>{let{title:t,description:n,children:l}=e;return(0,r.jsxs)(s.Z,{sx:{flex:"1 0 auto"},children:[t?(0,r.jsx)(o.Z,{component:"div",variant:"h6",fontWeight:800,children:t}):null,n?(0,r.jsx)(o.Z,{variant:"subtitle2",color:"text.secondary",component:"div",children:n}):null,l]})},c.Actions=e=>{let{children:t}=e;return(0,r.jsx)(l.Z,{p:2,pt:0,flex:1,width:"100%",children:t})}},98390:function(e,t,n){n.d(t,{k:function(){return f},Z:function(){return v}});var r=n(85893),l=n(67294),i=n(69320),a=n(1316),s=n(95442),o=n(40920),d=n(41102),c=n(81328),u=n(50841),x=n(87066),h=n(41143),p=n.n(h),m=e=>{let{onCreate:t}=e,{enqueueSnackbar:n,closeSnackbar:r}=(0,u.Ds)(),[i,a]=l.useState(void 0),[s,{data:o,loading:d}]=(0,c.kXV)({variables:{filetype:"jpg"}}),[h,m]=l.useState(!1),[j,g]=l.useState(0),[f,v]=l.useState(""),y=e=>{v(URL.createObjectURL(e))},b=async e=>{let l=e||i;if(l){let e=n("Uploading your art...",{variant:"info",persist:!0});try{var o,d;m(!0),console.log(l,null==l?void 0:l.name.split(".").pop());let{data:e}=await s({variables:{filetype:(null==l?void 0:l.name.split(".").pop())||"jpg"}}),r=null==e?void 0:null===(o=e.createImageUpload)||void 0===o?void 0:o.uploadUrl,i=null==e?void 0:null===(d=e.createImageUpload)||void 0===d?void 0:d.imageId;p()(r&&i,"Bad response from createImageUpload!"),await x.Z.put(r,await l.arrayBuffer(),{headers:{"Content-Type":l.type}}),g(e=>e+1),t&&"function"==typeof t&&t(i),v(""),a(void 0),n("Successful! ".concat(i),{variant:"success"})}catch(e){console.log(e),n("Something went wrong!",{variant:"error"})}finally{r(e),m(!1)}}else alert("No Image Selected")};return{selectedImage:i,uploadImage:b,previewPath:f,uploading:d,loading:h,uploadCount:j,uploadResults:o,handleFileDrop:async e=>(y(e),a(e),e)}},j=n(43408),g=n(1216);let f=()=>{let{session:e,loading:t}=(0,j.kP)();return t||(null==e?void 0:e.uploadsEnabled)?null:(0,r.jsxs)(s.Z,{my:3,children:[(0,r.jsx)(i.Z,{children:"Apply to become a partnered artist via our Discord."}),(0,r.jsx)(g.Z,{variant:"outlined"})]})};var v=e=>{let{onCreate:t}=e,{session:n}=(0,j.kP)(),{uploadImage:l,loading:c,previewPath:u,handleFileDrop:x,selectedImage:h}=m({onCreate:t||(()=>null)}),p=e=>{l(e)},g=(null==n?void 0:n.uploadsEnabled)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{component:"pre",variant:"h6",children:h?null:"Drop Images Here \n (or click)"}),u?(0,r.jsx)("img",{src:u,alt:"uploaded image",style:{maxHeight:400,width:"auto",maxWidth:"100%"}}):(0,r.jsx)(o.Z,{color:"disabled",sx:{fontSize:64}}),h?null:(0,r.jsx)(i.Z,{className:"text-xs",color:"text.secondary",textAlign:"center",children:"must be a JPEG or PNG, less than 10MB."})]}):(0,r.jsx)(r.Fragment,{children:"You are not a partnered artist."});return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.Z,{width:"100%",direction:"column",children:(0,r.jsx)(d.ZP,{disabled:!n||!(null==n?void 0:n.uploadsEnabled),accept:{"image/png":[".png"],"image/jpeg":[".jpg"]},style:{minHeight:200,cursor:"pointer"},onChange:e=>p(e[0]),children:(0,r.jsx)(s.Z,{textAlign:"center",children:g})})})})}},8125:function(e,t,n){n.d(t,{V:function(){return a}});var r=n(85893),l=n(91803),i=n(70563);n(67294);let a=e=>{let{value:t,float:n,decimals:a=2,prefix:s}=e,o=void 0!==t,d=void 0!==n;return o&&d?(console.error("LoadableDollars does not accept both value and float"),(0,r.jsx)(i.Z,{})):d?(0,r.jsxs)(r.Fragment,{children:[s,n]}):o?(0,r.jsxs)(r.Fragment,{children:[s,(0,l.G)(t,a)]}):(0,r.jsx)(i.Z,{})}},37370:function(e,t,n){n.d(t,{b:function(){return b}});var r=n(85893),l=n(67294),i=n(81328),a=n(95442),s=n(69320),o=n(2302),d=n(98969),c=n(4224),u=n(70563),x=n(20564),h=n(37491),p=n(48403),m=n.n(p),j=n(50841),g=n(8125),f=n(91803),v=n(61440),y=n(43408);let b=e=>{let{label:t,value:n,strikeValue:l,color:i}=e,o="text.primary";return 0===n&&(o="text.secondary"),"number"==typeof n&&n<0&&(o="lightgreen"),(0,r.jsxs)(a.Z,{display:"flex",justifyContent:"space-between",children:[(0,r.jsx)(s.Z,{children:t.split(" ").map(m()).join(" ")}),(0,r.jsxs)(s.Z,{color:i||o,children:[l?(0,r.jsxs)(r.Fragment,{children:["$",(0,r.jsx)(a.Z,{component:"del",mr:1,children:(0,r.jsx)(g.V,{value:l})})]}
1):null,"string"==typeof n?n:(0,r.jsxs)(r.Fragment,{children:[n&&n<0?"- ":null,"$",(0,r.jsx)(g.V,{value:n&&Math.abs(n)})]})]})]})},Z=["discount","subtotal","shipping","tax"],w=e=>{let{pricing:t}=e,n=(null==t?void 0:t.discount)===0?Z.filter(e=>"discount"!==e):Z;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{label:"loot",value:null==t?void 0:t.subtotal},"loot"),(0,r.jsx)(b,{label:"50 Coin",value:1e3},"coin"),(0,r.jsx)(b,{label:"Discount: BONUS COIN",value:-1e3},"coinDiscount"),n.map(e=>(0,r.jsx)(b,{label:e,value:null==t?void 0:t[e]},e)),(0,r.jsx)(o.Z,{sx:{my:1}}),(0,r.jsx)(b,{label:"total",value:null==t?void 0:t.total},"total")]})},k=e=>{let{orderId:t,total:n}=e,[a,s]=(0,l.useState)(!1),{session:o}=(0,y.kP)(),{enqueueSnackbar:c}=(0,j.Ds)(),[u]=(0,i.icL)({variables:{orderId:t},onCompleted:e=>{let{createOrderCheckoutSession:{url:t}={url:""}}=e;t?window.location.assign(t):(console.error("checkout no url??"),s(!1))},onError:e=>{let{}=e;c("An error has occurred. Please reach out to support!",{variant:"error"}),s(!1)}});return(0,r.jsx)(d.Z,{onClick:()=>{s(!0),u()},variant:"contained",disabled:a||void 0===o,color:"primary",fullWidth:!0,children:a?"Processing...":"PURCHASE $".concat((0,f.G)(n))})},C={confirmed:"success",paid:"success",cancelled:"error",draft:"primary"},S={confirmed:e=>"\uD83C\uDF89 ".concat(e," \uD83C\uDF89"),paid:e=>e,draft:e=>e},I=e=>{let{status:t}=e,n=S[t]||S.draft;return(0,r.jsx)(d.Z,{variant:"text",color:C[t],children:n(t).toUpperCase()})},D=e=>{let{children:t,sx:n={}}=e;return(0,r.jsx)(c.Z,{sx:{p:2,...n},children:t})},N=e=>{let{item:t,imageId:n,variantId:l}=e;return(0,r.jsxs)(D,{children:[(0,r.jsxs)(a.Z,{mb:2,children:[(0,r.jsx)(s.Z,{gutterBottom:!0,children:t.name}),(0,r.jsx)(s.Z,{variant:"subtitle2",children:t.productName}),(0,r.jsx)(o.Z,{sx:{my:1}})]}),(0,r.jsx)(a.Z,{display:"flex",children:(0,r.jsxs)(a.Z,{children:[n&&l?(0,r.jsx)(E,{imageId:n,variantId:l}):null,t.templateId?(0,r.jsx)(P,{templateId:t.templateId}):null]})})]})},F=()=>(0,r.jsx)(u.Z,{variant:"rounded",height:"90px",width:"90px"}),P=e=>{let{templateId:t}=e,{data:{productTemplate:{mockupFileUrl:n}={mockupFileUrl:void 0}}={}}=(0,i.qp6)({variables:{templateId:t}});return n?(0,r.jsx)("img",{src:n,alt:"Image file",style:{maxHeight:90,borderRadius:4}}):(0,r.jsx)(F,{})},E=e=>{let{imageId:t,variantId:n}=e,l=!!(t&&n),{data:{printfulMock:{images:a}={images:void 0}}={}}=(0,i.yoP)({variables:{imageId:t,variantId:n},skip:!l}),[{href:s}]=a||[{href:void 0}];return l?s?(0,r.jsx)("img",{src:s,alt:"Image file",style:{maxHeight:90,borderRadius:4}}):(0,r.jsx)(F,{}):(0,r.jsx)(r.Fragment,{})},z={shipped:"Your order has been shipped!",confirmed:"Your order has been confirmed!",paid:"Your order has been paid for!",draft:"Your order is in draft state."},M={shipped:"/assets/order_shipping.png",confirmed:"/assets/order_creating.png",paid:"/assets/paid_for.png",draft:"https://stuff.lootgod.com/01GTD9QG3S9G9G57PP3EY7G0JF/512w-01GTD9QG3S9G9G57PP3EY7G0JF.jpeg"},R=e=>{let{status:t}=e;return(0,r.jsx)(s.Z,{variant:"h6",fontWeight:"500",children:z[t]||"Unknown Order Status"})},L=()=>(0,r.jsx)(s.Z,{variant:"body2",color:"text.primary",mt:2,children:"Complete your secure purchase with Stripe, lootgod's trusted payment processor."}),_=()=>(0,r.jsx)(x.Z,{children:(0,r.jsxs)(h.ZP,{container:!0,sx:{my:4},children:[(0,r.jsxs)(h.ZP,{item:!0,xs:!0,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",children:[(0,r.jsx)(u.Z,{variant:"text",height:40,sx:{width:240}}),(0,r.jsx)(a.Z,{my:3,children:(0,r.jsx)(u.Z,{sx:{width:100,height:70}})}),(0,r.jsx)(u.Z,{height:40,sx:{width:200}})]}),(0,r.jsxs)(h.ZP,{item:!0,container:!0,spacing:2,xs:12,sx:{my:2},children:[(0,r.jsx)(h.ZP,{item:!0,xs:12,children:(0,r.jsx)(u.Z,{variant:"rectangular",height:120})}),(0,r.jsx)(h.ZP,{item:!0,xs:12,md:7,children:(0,r.jsx)(u.Z,{variant:"rectangular",height:120})}),(0,r.jsx)(h.ZP,{item:!0,xs:12,md:5,children:(0,r.jsx)(u.Z,{variant:"rectangular",height:180})})]})]})});t.Z=e=>{let{orderId:t,debug:n=!1}=e,{session:l}=(0,y.kP)(),{data:{printfulOrder:d}={},error:c,loading:u}=(0,i.irS)({variables:{orderId:t,guest:null===l},skip:!t||void 0===l});if(c)return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(a.Z,{width:"100%",my:2,children:[(0,r.jsx)(s.Z,{variant:"h5",textAlign:"center",color:"error",children:c.message}),(0,r.jsx)(o.Z,{})]})});if(!d||u)return(0,r.jsx)(_,{});let{status:p,items:m,recipient:j,pricing:g,imageId:f,variantId:b}=d;return(0,r.jsxs)(x.Z,{sx:{mb:8,pt:{xs:1,md:6}},children:[(0,r.jsxs)(h.ZP,{container:!0,spacing:3,children:[(0,r.jsxs)(h.ZP,{item:!0,xs:12,md:6,children:[(m||[]).map(e=>(0,r.jsx)(N,{item:e,imageId:f,variantId:b},e.id)),n?JSON.stringify(m):null,(0,r.jsxs)(D,{sx:{mt:2},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",gutterBottom:!0,children:"Shipping Address"}),(0,r.jsx)(o.Z,{sx:{my:1}}),(0,r.jsx)(s.Z,{variant:"h6",children:"".concat(j.address1," ").concat(j.city," ").concat(j.zip,", ").concat(j.stateCode," ").concat(j.countryCode)}
1)]})]}),(0,r.jsxs)(h.ZP,{item:!0,xs:12,md:6,children:[(0,r.jsxs)(v.Z,{image:M[p],sx:{mb:2},children:[(0,r.jsx)(v.Z.Content,{title:(0,r.jsx)(a.Z,{children:(0,r.jsx)(R,{status:p})}),description:(0,r.jsxs)(s.Z,{variant:"h6",children:["Order ",t]})}),(0,r.jsx)(I,{status:p})]}),(0,r.jsxs)(D,{children:[(0,r.jsx)(w,{pricing:null!=g?g:void 0}),"draft"===p&&(null==g?void 0:g.total)!==void 0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{orderId:t,total:g.total}),(0,r.jsx)(L,{})]}):null]})]})]}),n?"order: ":null,n?(0,r.jsx)("pre",{children:JSON.stringify(d,null,2)}):null]})}},26544:function(e,t,n){var r=n(85893);n(67294);var l=n(98969),i=n(81328);t.Z=e=>{let{productId:t}=e,[n,{loading:a}]=(0,i.V5m)({variables:{productId:t},onCompleted:e=>{let{syncProduct:t}=e;console.log(t)}});return(0,r.jsx)(l.Z,{disabled:a,onClick:()=>n(),children:"Sync"})}},57495:function(e,t,n){n.d(t,{c:function(){return i}});var r=n(85893);n(67294);var l=n(68871);let i=e=>{let{data:t}=e;return(0,r.jsx)("pre",{className:(0,l.cn)("w-80vw overflow-auto p-4 border-2 border-dashed border-red-500 bg-gray-100 font-xs",{hidden:!0}),children:null})};t.Z=e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:null})}},16321:function(e,t,n){n.d(t,{z:function(){return d}});var r=n(85893),l=n(67294),i=n(88426),a=n(45139),s=n(68871);let o=(0,a.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-neutral-300",{variants:{variant:{default:"bg-neutral-900 text-neutral-50 shadow hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90",destructive:"bg-red-500 text-neutral-50 shadow-sm hover:bg-red-500/90 dark:bg-red-900 dark:text-neutral-50 dark:hover:bg-red-900/90",outline:"border border-neutral-200 bg-white shadow-sm hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",secondary:"bg-neutral-100 text-neutral-900 shadow-sm hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80",ghost:"hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",link:"text-neutral-900 underline-offset-4 hover:underline dark:text-neutral-50"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=l.forwardRef((e,t)=>{let{className:n,variant:l,size:a,asChild:d=!1,...c}=e,u=d?i.g7:"button";return(0,r.jsx)(u,{className:(0,s.cn)(o({variant:l,size:a,className:n})),ref:t,...c})});d.displayName="Button"},18942:function(e,t,n){n.d(t,{o:function(){return d}});var r=n(67294),l=n(81328),i=n(50841),a=n(85893),s=n(45656);let o=(0,a.jsx)(()=>(0,a.jsxs)(a.Fragment,{children:["Image is processing",(0,a.jsx)(s.Z,{})]}),{}),d=e=>{let[t,n]=(0,r.useState)(0),a=(0,r.useRef)(),{data:{image:s}={},loading:d,error:c,refetch:u}=(0,l.BEN)(e?{variables:{imageId:e},pollInterval:t}:{skip:!0}),{status:x}=s||{},{enqueueSnackbar:h,closeSnackbar:p}=(0,i.Ds)();return(0,r.useEffect)(()=>{switch(c&&(p(a.current),n(0)),x){case"DONE":p(a.current),n(0);break;case"INITIALIZED":case"GENERATING":case"RENDERING":case"SYNCING":n(3e3),a.current||(a.current=h(o,{variant:"info",persist:!0,preventDuplicate:!0}))}},[x,c,h,p]),(0,r.useEffect)(()=>()=>{p(a.current)},[]),{image:s,refetch:u,loading:d,error:c}}},68871:function(e,t,n){n.d(t,{cn:function(){return i}});var r=n(90512),l=n(98388);function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,l.m6)((0,r.W)(t))}},91803:function(e,t,n){n.d(t,{G:function(){return r}});let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e/10**t).toFixed(t)}},50196:function(e,t,n){n.d(t,{Le:function(){return o},is:function(){return s},vI:function(){return a},K1:function(){return d}});var r=n(44908),l=n.n(r),i=n(3386);let a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return l()(e.map(e=>e.size)).filter(i.Dw)},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter(e=>e.color).reduce((e,t)=>
1({...e,["".concat(t.color)]:t.colorCode||t.color}),{})},o={"9XL":90,"8XL":80,"7XL":70,"6XL":60,"5XL":50,"4XL":40,"3XL":30,"2XL":20,XL:10,L:0,M:-10,S:-20,XS:-30,"2XS":-40,"3XS":-50,"4XS":-60,"5XS":-70,"6XS":-80,"7XS":-90},d=(e,t)=>{var n,r;return(null!==(n=o[e])&&void 0!==n?n:-100)-(null!==(r=o[t])&&void 0!==r?r:-100)}},10705:function(e,t,n){n.d(t,{zz:function(){return l},ZW:function(){return u},A4:function(){return y},oC:function(){return h},XY:function(){return j},Mb:function(){return g},vL:function(){return Z},wv:function(){return m},$7:function(){return f},yI:function(){return x},$o:function(){return b},mF:function(){return p},tj:function(){return v},MK:function(){return i},HD:function(){return w}});var r=n(67294);let l=r.createContext({}),i=()=>r.useContext(l),a={data:[],history:[],future:[],technique:"DTG",colors:[],sizes:[]},s=e=>["DESIGNER_STATE",e].join("_"),o=(e,t)=>{let n=JSON.stringify(t),r=Math.ceil(n.length/5e3);for(let t=0;t<r;t++){let r=5e3*t,l=r+5e3,i=n.substring(r,l),a=s("".concat(e,"_chunk_").concat(t));localStorage.setItem(a,i)}let l=s("".concat(e,"_metadata"));localStorage.setItem(l,JSON.stringify({numChunks:r}))},d=e=>{let t=s("".concat(e,"_metadata")),n=localStorage.getItem(t);if(!n)return null;let{numChunks:r}=JSON.parse(n),l="";for(let t=0;t<r;t++){let n=s("".concat(e,"_chunk_").concat(t)),r=localStorage.getItem(n);if(!r)return console.error("Missing chunk ".concat(t," for state ID ").concat(e)),null;l+=r}try{return JSON.parse(l)}catch(e){return console.error("Failed to parse the loaded state:",e),null}},c=(e,t)=>{switch(t.type){case"SAVE":let n=s(t.payload);return console.log("TEMPLATE SAVE",n),o(n,e),e;case"LOAD":let r=d(t.payload);if(!r)return console.warn("No saved state found for the key:",t.payload.key),e;try{return console.log("LOADED STATE",r),{...e,...r}}catch(t){return console.error("Failed to parse the loaded state:",t),e}case"UPDATE_LAYER":return{...e,data:e.data.map(e=>e.id===t.payload.id?{...e,...t.payload}:e),history:[...e.history,e.data],future:[]};case"LOCK":return{...e,data:e.data.map(e=>e.id===t.payload.id?{...e,locked:!0}:e),history:[...e.history,e.data],future:[]};case"UNLOCK":return{...e,data:e.data.map(e=>e.id===t.payload.id?{...e,locked:!1}:e),history:[...e.history,e.data],future:[]};case"ADD":return{...e,data:[...e.data,t.payload],history:[...e.history,e.data],future:[]};case"REMOVE":let l=e.data.find(e=>e.id===t.payload.id);if(null==l?void 0:l.locked)return e;return{...e,data:e.data.filter(e=>e.id!==t.payload.id),history:[...e.history,e.data],future:[]};case"COPY":let i=e.data.find(e=>e.id===t.payload.id);if(!i)return e;let a={...i,id:Date.now().toString()};return{...e,data:[...e.data,a],history:[...e.history,e.data],future:[]};case"UNDO":if(0===e.history.length)return e;let c=e.history[e.history.length-1];return{...e,data:c,history:e.history.slice(0,-1),future:[e.data,...e.future]};case"REDO":if(0===e.future.length)return e;let u=e.future[0];return{...e,data:u,history:[...e.history,e.data],future:e.future.slice(1)};case"FOCUS":return{...e,focusedLayerId:t.payload.id};case"SET_MOCK_TASK":return{...e,...t.payload};case"COLOR_ADD":return{...e,colors:Array.from(new Set([...e.colors,...t.payload]))};case"COLOR_REMOVE":return{...e,colors:e.colors.filter(e=>!t.payload.includes(e))};case"SIZE_ADD":return{...e,sizes:Array.from(new Set([...e.sizes,...t.payload]))};case"SIZE_REMOVE":return{...e,sizes:e.sizes.filter(e=>!t.payload.includes(e))};default:return e}},u=(e,t)=>{e({type:"COLOR_ADD",payload:t})},x=(e,t)=>{e({type:"COLOR_REMOVE",payload:t})},h=(e,t)=>{e({type:"SIZE_ADD",payload:t})},p=(e,t)=>{e({type:"SIZE_REMOVE",payload:t})},m=e=>e.data.find(t=>t.id===e.focusedLayerId);function j(e,t,n){let r=t.data.find(e=>e.id===n);if(!r||!r.x||!r.width)return;let l=-1===r.scaleX?1:-1,i=r.x-r.width*l;e({type:"UPDATE_LAYER",payload:{id:n,scaleX:l,x:i}})}function g(e,t,n){let r=t.data.find(e=>e.id===n);if(!r)return;let l=-1===r.scaleY?1:-1,i=((null==r?void 0:r.y)||0)-((null==r?void 0:r.height)||0)*l;e({type:"UPDATE_LAYER",payload:{id:n,scaleY:l,y:i}})}let f=(e,t)=>{e({type:"LOAD",payload:t})}
1,v=(e,t,n)=>{e({type:"UPDATE_LAYER",payload:{id:t,...n}})},y=(e,t)=>{e({type:"ADD",payload:t})},b=(e,t)=>{e({type:"REMOVE",payload:{id:t}})},Z=(e,t)=>{e({type:"FOCUS",payload:{id:t}})},w=()=>r.useReducer(c,a)},54075:function(e,t,n){n.d(t,{ys:function(){return tE},ZP:function(){return tz}});var r=n(85893),l=n(67294),i=n(11163),a=n(16618),s=n(95442),o=n(43508),d=n(98969),c=n(69320),u=n(24766),x=n(87707),h=n(9304),p=n(4224),m=n(60988),j=n(13311),g=n.n(j),f=n(24350),v=n.n(f),y=n(10705),b=n(5152),Z=n.n(b),w=n(6372),k=n(81550),C=n(12668),S=n(1316),I=n(64681),D=n(72008),N=n(13757),F=n(26760),P=n(17740),E=n(72372);function z(){let e=(0,P.R)(E.S);return(0,r.jsxs)("div",{children:[(0,r.jsxs)(d.Z,{sx:{position:"absolute",top:0,left:0},onClick:()=>E.S.intro=!0,children:[(0,r.jsx)(D.Z,{}),"GO BACK"]}),(0,r.jsx)(S.Z,{direction:"row",spacing:1,my:1,sx:{display:"flex",justifyContent:"center"},children:e.colors.map(e=>(0,r.jsx)(s.Z,{className:"circle",style:{background:e},onClick:()=>E.S.color=e},e))}),(0,r.jsx)(s.Z,{children:(0,r.jsx)(s.Z,{children:e.decals.map(e=>(0,r.jsx)(s.Z,{onClick:()=>E.S.decal=e,children:(0,r.jsx)("img",{src:"/"+e+".png",alt:"brand",style:{maxWidth:69,maxHeight:69}})},e))})}),(0,r.jsxs)(d.Z,{sx:{position:"absolute",top:0,right:0},onClick:()=>{let e=document.createElement("a"),t=document.querySelector("#merch-canvas canvas");e.setAttribute("download","canvas.png"),t&&(e.setAttribute("href",t.toDataURL("image/png").replace("image/png","image/octet-stream")),e.click())},children:["DOWNLOAD",(0,r.jsx)(I.Z,{})]})]})}var M=function(){let e=(0,P.R)(E.S),t={type:"spring",duration:.8},n={initial:{x:-100,opacity:0,transition:{...t,delay:0}},animate:{x:0,opacity:1,transition:{...t,delay:.8}},exit:{x:-100,opacity:0,transition:{...t,delay:0}}};return(0,r.jsxs)("div",{style:{position:"absolute",top:0,left:0,bottom:0,right:0},children:[(0,r.jsx)(k.E.header,{initial:{opacity:0,y:-100},animate:{opacity:1,y:0},transition:t,children:(0,r.jsx)(k.E.div,{animate:{x:e.intro?0:100,opacity:e.intro?1:0},transition:t,style:{position:"absolute",display:"none",top:0,right:0},children:(0,r.jsx)(F.Z,{sx:{height:32,width:32}})})}),(0,r.jsx)(C.M,{children:e.intro?(0,r.jsx)(k.E.section,{...n,style:{height:"100vh",top:0,left:0},children:(0,r.jsxs)(s.Z,{p:2,pt:10,children:[(0,r.jsx)("img",{src:"/pelago_dev_transparent.png",alt:"logo",style:{height:70,marginBottom:48}}),(0,r.jsx)(k.E.div,{initial:{x:100,opacity:0},animate:{x:0,opacity:1},transition:{type:"spring",damping:9,stiffness:40,restDelta:.001,duration:.3},children:(0,r.jsx)(c.Z,{variant:"h2",fontWeight:"800",children:"DESIGN WITH AI"})},"title"),(0,r.jsx)(s.Z,{mt:1,children:(0,r.jsxs)(k.E.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},transition:{type:"spring",damping:7,stiffness:30,restDelta:.001,duration:.6,delay:.2,delayChildren:.2},children:[(0,r.jsxs)(c.Z,{gutterBottom:!0,children:["Create your unique and exclusive shirt with our brand-new 3D customization tool. ",(0,r.jsx)("br",{}),(0,r.jsx)("strong",{children:"Unleash your imagination"})," and define your own style."]}),(0,r.jsxs)(d.Z,{color:"primary",size:"large",variant:"contained",style:{marginTop:16},onClick:()=>E.S.intro=!1,children:["CUSTOMIZE IT ",(0,r.jsx)(N.Z,{})]})]},"p")})]})},"main"):(0,r.jsx)(k.E.section,{...n,style:{height:"100vh",top:0,left:0,width:"100vw",zIndex:1e4,position:"absolute"},children:(0,r.jsx)(z,{})},"custom")})]})},R=n(81328),L=n(29750),_=n(15879),A=n(98390),T=n(46785),O=n(13177),W=n(32829),U=n(48040),G=n(41376),K=n(66802),V=n(43326),B=n(26048),Y=n(17588),H=n(50782),X=n(61779);let Q=[{label:"Product",icon:(0,r.jsx)(T.Z,{}),key:"Product"},{label:"Layers",icon:(0,r.jsx)(O.Z,{}),key:"Layers"},{label:"Uploads",icon:(0,r.jsx)(W.Z,{}),key:"Uploads"},{label:"web3",icon:(0,r.jsx)(U.Z,{}),key:"Web3"},{label:"NFC",icon:(0,r.jsx)(G.Z,{}),key:"NFC"},{label:"Text",icon:(0,r.jsx)(K.Z,{}),key:"Text"},{label:"Fill",icon:(0,r.jsx)(V.Z,{}),key:"Fill"}],q=[{label:"Transform",icon:(0,r.jsx)(B.Z,{}),key:"Transform"},{label:"Position",icon:(0,r.jsx)(Y.Z,{}),key:"Position"},{label:"Crop",icon:(0,r.jsx)(H.Z,{}
1),key:"Crop"},{label:"Remove Background",icon:(0,r.jsx)(X.Z,{}),key:"RemoveBackground"}];var $=n(87536),J=n(61430),ee=n(23485),et=n(18610),en=n(42600),er=n(38686),el=n(13712),ei=n(47884),ea=n(74887),es=n(36153),eo=n(95814),ed=n(61154),ec=n(50841),eu=n(41664),ex=n.n(eu),eh=n(43408),ep=n(39332),em=n(80137),ej=e=>{let{initialValue:t="",onChange:n,currencySymbol:i="$",placeholder:a="0.00"}=e,[s,o]=(0,l.useState)(""),[d,c]=(0,l.useState)(t),u=(0,l.useRef)(null),x=e=>{let t=parseInt(e.replace(/[^\d]/g,""),10)/100;return isNaN(t)?"":t.toFixed(2)};return(0,l.useEffect)(()=>{o(x(d))},[d]),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{ref:u,type:"text",value:s,onChange:e=>{let t=e.target.value.replace(/[^\d]/g,"");c(t),null==n||n(t)},onFocus:()=>{u.current&&(u.current.value=d)},onBlur:()=>{o(x(d))},placeholder:a,className:"w-full px-3 py-2 pl-7 border rounded-md border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500"}),(0,r.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",children:i})]})};let eg=e=>{let t=(0,ep.useParams)(),n=null==t?void 0:t.orgId;return n?n:localStorage.getItem("orgId")||e||null},ef=e=>{let{orgId:t,control:n,setValue:i}=e,a=eg(t),{data:s,loading:c,error:u}=(0,R.yWc)({variables:{organizationId:a},skip:!a}),[x,h]=(0,l.useState)(!1),[p,m]=(0,l.useState)("");return(0,r.jsxs)(J.Z,{fullWidth:!0,margin:"normal",children:[(0,r.jsx)($.Qr,{name:"shopId",control:n,render:e=>{var t;let{field:n}=e;return(0,r.jsxs)(ee.Z,{...n,label:"Store",displayEmpty:!0,onChange:e=>{"create-new"===e.target.value?h(!0):n.onChange(e)},children:[(0,r.jsx)(et.Z,{value:"",children:(0,r.jsx)("em",{children:"Select a store"})}),null==s?void 0:null===(t=s.organizationShops)||void 0===t?void 0:t.map(e=>(0,r.jsx)(et.Z,{value:e.id,children:e.title},e.id)),(0,r.jsx)(et.Z,{value:"create-new",children:"+ Create new store"})]})}}),x&&(0,r.jsxs)("div",{children:[(0,r.jsx)(o.Z,{fullWidth:!0,label:"New Store Name",value:p,onChange:e=>m(e.target.value),margin:"normal"}),(0,r.jsx)(d.Z,{variant:"contained",onClick:()=>{console.log("Creating new store:",p),h(!1)},disabled:!p,children:"Create Store"})]})]})};var ev=e=>{let{defaultValues:t={},variants:n=[]}=e,{control:l,handleSubmit:i,setValue:a,watch:c,formState:{errors:u}}=(0,$.cI)({defaultValues:{...t,variants:n.map(e=>({...e,price:e.price}))}}),{session:x}=(0,eh.kP)(),{state:h}=(0,y.MK)(),{enqueueSnackbar:p}=(0,ec.Ds)(),{fields:m}=(0,$.Dq)({control:l,name:"variants"}),[j,{data:g,loading:f}]=(0,R.LJR)({onCompleted:e=>{let{createShopProductFromMock:t}=e;p("Product Added To Shop!",{action:e=>(0,r.jsx)(d.Z,{component:ex(),target:"_blank",rel:"noreferrer",href:"/shop/".concat(null==t?void 0:t.id,"/").concat(null==t?void 0:t.id),children:"View"})})},onError:e=>{console.log(e),p("Product Failed To Register",{variant:"error"})}});return(0,r.jsx)("form",{onSubmit:i(e=>{let t=e.variants.map(e=>({variant_id:e.id,price:+e.price}));j({variables:{shopId:e.shopId,mockId:h.mockId,variantPrices:t,price:Math.ceil(+e.variants[0].price),userId:(null==x?void 0:x.id)||"GUEST",published:e.published}})}),children:(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,r.jsx)(ef,{control:l,setValue:a}),(0,r.jsx)($.Qr,{name:"title",control:l,defaultValue:"",rules:{required:"Title is required"},render:e=>{var t;let{field:n}=e;return(0,r.jsx)(o.Z,{...n,label:"Title",placeholder:"Short sleeve t-shirt",variant:"outlined",error:!!u.title,helperText:null===(t=u.title)||void 0===t?void 0:t.message})}}),(0,r.jsx)($.Qr,{name:"description",control:l,defaultValue:"",render:e=>{let{field:t}=e;return(0,r.jsx)(o.Z,{...t,label:"Description",variant:"outlined",multiline:!0,rows:4})}}),(0,r.jsx)(en.Z,{component:er.Z,children:(0,r.jsxs)(el.Z,{children:[(0,r.jsx)(ei.Z,{children:(0,r.jsxs)(ea.Z,{children:[(0,r.jsx)(es.Z,{children:"Variant Name"}),(0,r.jsx)(es.Z,{children:"Color"}),(0,r.jsx)(es.Z,{children:"Size"}),(0,r.jsx)(es.Z,{children:"Price"})]})}),(0,r.jsx)(eo.Z,{children:m.map((e,t)=>(0,r.jsxs)(ea.Z,{children:[(0,r.jsx)(es.Z,{children:e.name}),(0,r.jsx)(es.Z,{children:e.color}),(0,r.jsx)(es.Z,{children:e.size}),(0,r.jsx)(es.Z,{children:(0,r.jsx)($.Qr,{name:"variants.".concat(t,".price"),control:l,defaultValue:e.price,render:e=>{let{field:t}=e;return(0,r.jsx)(ej,{...t,initialValue:"".concat(t.value)||""})}})})]},e.id))})]})}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-bold",children:"Published"}),(0,r.jsx)("p",{className:"text-xs",children:"Will make the item immediately available for sale."})]}),(0,r.jsx)($.Qr,{name:"published",control:l,defaultValue:!0,render:e=>{let{field:t}=e;return(0,r.jsx)(ed.Z,{...t})}})]}),(0,r.jsx)(em.Z,{loading:f,type:"submit",variant:"contained",color:"primary",children:"Save"})]})})},ey=n(61763);let eb=e=>{let{value:t="Design",onChange:n}=e,[i,a]=(0,l.useState)(t);(0,l.useEffect)(()=>{a(t)},[t]);let s=e=>{a(e),n(e)};return(0,r.jsxs)(ey.Z,{variant:"contained","aria-label":"design-mockup-toggle",sx:{backgroundColor:"rgba(0,0,0,0.2)",fontWeight:800},children:[(0,r.jsx)(d.Z,{onClick:()=>s("Design"),sx:{fontWeight:900,backgroundColor:"Design"===i?"primary.main":"transparent",color:"Design"===i?"common.white":"common.black","&:hover":{backgroundColor:"Design"===i?"primary.dark":"transparent",color:"Design"===i?"common.white":"primary.dark"}},children:"Design"}),(0,r.jsx)(d.Z,{onClick:()=>s("Mockups"),sx:{fontWeight:900,backgroundColor:"Mockups"===i?"primary.main":"transparent",color:"Mockups"===i?"common.white":"common.black","&:hover":{backgroundColor:"Mockups"===i?"primary.dark":"transparent",color:"Mockups"===i?"common.white":"primary.dark"}},children:"Mockups"})]})};var eZ=n(56169),ew=n(61971),ek=n(42016);n(75855);let eC=e=>{let{src:t="",onSubmit:n,cropData:i}=e,[a]=(0,l.useState)(t),[o,u]=(0,l.useState)(i),x=(0,l.createRef)();return(0,r.jsxs)("div",{style:{position:"relative"},children:[(0,r.jsx)("div",{style:{width:"100%"},children:(0,r.jsx)(ek.Z,{ref:x,style:{height:400,width:"100%"},initialAspectRatio:1,preview:".img-preview",src:a,viewMode:1,minCropBoxHeight:10,minCropBoxWidth:10,background:!1,responsive:!0,zoomable:!1,autoCropArea:1,checkOrientation:!1,guides:!0})}),(0,r.jsxs)(s.Z,{sx:{width:"100%",background:"rgba(0,0,0,0.5)"},children:[(0,r.jsxs)("div",{className:"box",style:{width:"50%",float:"right"},children:[(0,r.jsx)("div",{children:"Preview"}),(0,r.jsx)("div",{className:"img-preview",style:{width:"100%",overflow:"hidden",height:"200px",float:"left"}})]}),(0,r.jsxs)(s.Z,{sx:{width:"50%"},children:[(0,r.jsx)(s.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,r.jsx)(c.Z,{children:"Result"})}),(0,r.jsx)(s.Z,{sx:{width:"100%",height:200,overflow:"hidden"},children:o?(0,r.jsx)("img",{src:o.src,alt:"cropped",style:{width:"100%",objectFit:"contain",height:"100%"}}):null})]})]}),(0,r.jsx)(s.Z,{p:1,display:"flex",width:"100%",justifyContent:"flex-end",children:(0,r.jsx)(d.Z,{variant:"contained",color:"primary",onClick:()=>{var e;if(void 0!==(null===(e=x.current)||void 0===e?void 0:e.cropper)){let e=x.current.cropper.getCroppedCanvas(),t=e.toDataURL();u({src:t,width:e.width,height:e.height}),n({src:t,width:e.width,height:e.height,cropData:{src:t,width:e.width,height:e.height,x:e.x,y:e.y}})}},children:"Crop Image"})})]})};var eS=n(32537),eI=n(82521),eD=n(18942),eN=n(52365),eF=n(42124),eP=n(90006),eE=n(36596),ez=n(96714),eM=n(45524),eR=n(32190),eL=n(45557),e_=n(47608),eA=n(55771);let eT=e=>{let{buttons:t,focused:n,onClick:l,StackProps:i}=e;return(0,r.jsx)(S.Z,{...i||{},children:null==t?void 0:t.map((e,t)=>(0,r.jsx)(d.Z,{onClick:()=>l(e.key),sx:{borderRadius:2,color:e.key===n?"black":"#666",backgroundColor:e.key===n?"#ddd":"inherit"},children:(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[e.icon,(0,r.jsx)("b",{style:{fontSize:10,textWrap:"nowrap"},children:e.label})]})},t))})}
1,eO=e=>{let{focusKey:t,setFocusKey:n}=(0,y.MK)();return(0,r.jsx)(eT,{buttons:Q,focused:t,onClick:e=>{n(e)},...e})},eW=e=>{let{label:t,children:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.Z,{sx:{fontSize:12,fontWeight:800,mr:.2},component:"span",children:[t,":"]}),(0,r.jsx)(c.Z,{sx:{fontSize:12,mr:.4},component:"span",children:n})]})},eU={Text:e=>{let{values:t,onSubmit:n,disabledMessage:l}=e,{control:i,handleSubmit:a}=(0,$.cI)({defaultValues:t});return(0,r.jsx)("form",{onSubmit:a(n),children:(0,r.jsxs)(S.Z,{spacing:2,children:[(0,r.jsxs)(d.Z,{type:"submit",disabled:!!l,children:["Save",l?" (".concat(l,")"):""]}),(0,r.jsx)($.Qr,{name:"text",control:i,render:e=>{let{field:t}=e;return(0,r.jsx)(o.Z,{...t,label:"Text",multiline:!0,minRows:3,variant:"outlined",fullWidth:!0})}}),(0,r.jsx)(c.Z,{children:"Color"}),(0,r.jsx)($.Qr,{name:"color",control:i,render:e=>{let{field:t}=e;return(0,r.jsx)(eZ.Ie,{...t,color:t.value,onChangeComplete:e=>t.onChange(e.hex)})}}),(0,r.jsx)($.Qr,{name:"fontSize",control:i,render:e=>{let{field:t}=e;return(0,r.jsx)(o.Z,{...t,type:"number",label:"Font Size",variant:"outlined",fullWidth:!0})}}),(0,r.jsx)($.Qr,{name:"x",control:i,render:e=>{let{field:t}=e;return(0,r.jsx)(o.Z,{...t,type:"number",label:"X Pos.",variant:"outlined",fullWidth:!0})}}),(0,r.jsx)($.Qr,{name:"y",control:i,render:e=>{let{field:t}=e;return(0,r.jsx)(o.Z,{...t,type:"number",label:"Y Pos.",variant:"outlined",fullWidth:!0})}}),(0,r.jsx)($.Qr,{name:"letterSpacing",control:i,render:e=>{let{field:t}=e;return(0,r.jsx)(o.Z,{...t,type:"number",label:"Letter Spacing",variant:"outlined",fullWidth:!0})}}),(0,r.jsx)($.Qr,{name:"fontFamily",control:i,render:e=>{let{field:t}=e;return(0,r.jsxs)(o.Z,{...t,select:!0,label:"Font",variant:"outlined",fullWidth:!0,SelectProps:{native:!0},children:[(0,r.jsx)("option",{value:"Arial",children:"Arial"}),(0,r.jsx)("option",{value:"Helvetica",children:"Helvetica"}),(0,r.jsx)("option",{value:"Times New Roman",children:"Times New Roman"})]})}}),(0,r.jsx)(c.Z,{children:"Transform"}),(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(c.Z,{children:"Rotate"}),(0,r.jsx)($.Qr,{name:"rotation",control:i,render:e=>{let{field:t}=e;return(0,r.jsx)(eN.ZP,{...t,step:1,min:0,max:360})}})]})]})})},File:()=>(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eO,{buttons:q,StackProps:{direction:"row"}})})},eG=e=>{var t,n,l,i;let{id:a,type:o,layerName:d,printfile:u,printQuality:x,dimensions:p,imageId:m,image:j,locked:g,width:f,height:v,color:b,x:Z,y:w}=e,{dispatch:k,state:C}=(0,y.MK)(),S=C.focusedLayerId===a,{image:I}=(0,eD.o)(m),D=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;(0,y.vL)(k,e)},N=eU[o]?eU[o]:()=>null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{display:"flex",sx:{position:"relative",border:"1px solid transparent",borderRadius:2,p:1,backgroundColor:S?"rgba(100,100,100,0.1)":"transparent","&:hover":{borderColor:S?"":"lightgrey"},cursor:"pointer"},onClick:()=>D(S?"":a),onFocus:()=>D(a),children:[(0,r.jsxs)(s.Z,{position:"relative",width:50,height:50,marginRight:2,children:["Fill"!==o&&(0,r.jsx)("img",{src:m&&(null==I?void 0:I.src)?null==I?void 0:I.src:j||"/img/transparent-pattern.png",alt:d,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4}}),"Text"===o&&(0,r.jsx)(s.Z,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(eR.Z,{sx:{color:"black",fontSize:28}})}),"Fill"===o&&(0,r.jsx)(s.Z,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:2,backgroundColor:b}})]}),(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(s.Z,{display:"flex",alignItems:"center",children:[(0,r.jsx)(eF.Z,{label:o,sx:{height:20,fontSize:10,padding:.2,fontWeight:800},size:"small"}),(0,r.jsx)(c.Z,{sx:{fontSize:12,ml:1},children:d})]}),(0,r.jsx)(eW,{label:"Print Quality",children:x||u}),(0,r.jsxs)(s.Z,{display:"flex",children:[(0,r.jsx)(eW,{label:"Width",children:null===(t=f||(null==p?void 0:p.width))||void 0===t?void 0:t.toFixed(2)}),(0,r.jsx)(eW,{label:"Height",children:null===(n=v||(null==p?void 0:p.height))||void 0===n?void 0:n.toFixed(2)})]}),(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(eW,{label:"X",children:null===(l=Z||(null==p?void 0:p.x))||void 0===l?void 0:l.toFixed(2)}),(0,r.jsx)(eW,{label:"Y",children:null===(i=w||(null==p?void 0:p.y))||void 0===i?void 0:i.toFixed(2)})]})]}),(0,r.jsxs)(s.Z,{sx:{position:"absolute",top:0,right:0,display:"flex",alignItems:"center"},children:[(0,r.jsx)(h.Z,{onClick:()=>{k({type:g?"UNLOCK":"LOCK",payload:{id:a}})},size:"small",children:g?(0,r.jsx)(eS.Z,{}):(0,r.jsx)(eI.Z,{})}),(0,r.jsx)(eK,{id:a})]})]}),(0,r.jsxs)(eP.Z,{id:"accordion_".concat(a),expanded:C.focusedLayerId===a,sx:{display:{xs:"none",md:"block"},zIndex:10,maxHeight:600,overflowY:"auto"},children:[(0,r.jsx)(eE.Z,{sx:{display:"none"}}),(0,r.jsx)(ez.Z,{sx:{p:0},children:(0,r.jsx)(N,{disabledMessage:g?"locked":"",values:e,onSubmit:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k({type:"UPDATE_LAYER",payload:{id:a,...e}})}})})]})]})},eK=e=>{let{id:t}=e,{dispatch:n,removeLayer:i,copyLayer:a}=(0,y.MK)(),[s,o]=l.useState(null),d=()=>{o(null)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{"aria-label":"Menu Actions","aria-controls":"menu-actions","aria-haspopup":"true",onClick:e=>{o(e.currentTarget)},size:"small",children:(0,r.jsx)(eL.Z,{})}),(0,r.jsxs)(eM.Z,{id:"menu-actions",anchorEl:s,keepMounted:!0,open:!!s,onClose:d,children:[(0,r.jsxs)(et.Z,{onClick:()=>{i(n,t),d()},children:[(0,r.jsx)(h.Z,{"aria-label":"delete",children:(0,r.jsx)(e_.Z,{})}),"Delete"]}),(0,r.jsxs)(et.Z,{onClick:()=>{a(n,t),d()},children:[(0,r.jsx)(h.Z,{"aria-label":"duplicate",children:(0,r.jsx)(eA.Z,{})}),"Duplicate"]})]})]})},eV=()=>{var e;let{state:t}=(0,y.MK)();return(0,r.jsxs)(s.Z,{sx:{height:"100%"},children:[null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.map((e,t)=>(0,r.jsx)(eG,{...e},"layer-".concat(t))),(null==t?void 0:t.data.length)?null:(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(s.Z,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",sx:{flexDirection:"column"},children:[(0,r.jsx)("img",{src:"/icons/design_woman.svg",alt:"woman_design_graphic",style:{width:"100%",maxHeight:200,objectFit:"contain"}}),(0,r.jsx)(c.Z,{fontWeight:900,gutterBottom:!0,sx:{mb:2,textAlign:"center"},children:"Start Designing"}),(0,r.jsx)(c.Z,{sx:{mb:2,textAlign:"center"},children:"Your layers will appear here."})]})})]})};var eB=n(88305),eY=n(57793),eH=n(297),eX=n(60718),eQ=n(5301),eq=n(82971),e$=n(68774),eJ=n(32521),e0=n(65832);let e1=e=>{let{label:t,value:n=0,onValueChange:l}=e;return(0,r.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:0},children:[(0,r.jsx)(h.Z,{size:"small",onClick:()=>{l(n-1)},"aria-label":"Decrease ".concat(t),children:(0,r.jsx)(eJ.Z,{})}),(0,r.jsx)(eq.Z,{value:Math.floor(n),margin:"dense",onChange:e=>{l(Number(e.target.value))},inputProps:{step:1,min:1,type:"number","aria-labelledby":"input-slider-".concat(t)},sx:{width:60}}),(0,r.jsx)(h.Z,{size:"small",onClick:()=>{l(n+1)},"aria-label":"Increase ".concat(t),children:(0,r.jsx)(e$.Z,{})})]})},e2=e=>{let{rotation:t,width:n,height:l,onRotationChange:i,onWidthChange:a,onHeightChange:o}=e;return(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,r.jsx)(c.Z,{fontWeight:800,children:"Rotate"}),(0,r.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:2,pl:2},children:[(0,r.jsx)(eN.ZP,{value:"number"==typeof t?t:0,onChange:(e,t)=>
1i(t),"aria-labelledby":"input-slider",min:-360,max:360}),(0,r.jsx)(eq.Z,{value:t,margin:"dense",onChange:e=>i(Number(e.target.value)),inputProps:{step:1,min:-360,max:360,type:"number","aria-labelledby":"input-slider"},sx:{width:60}})]}),(0,r.jsxs)(s.Z,{sx:{display:"flex"},children:[(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",flex:1,gap:0},children:[(0,r.jsx)(c.Z,{fontWeight:800,children:"Width"}),(0,r.jsx)(e1,{label:"Width",value:n,onValueChange:a})]}),(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",flex:1,gap:0},children:[(0,r.jsx)(c.Z,{fontWeight:800,children:"Height"}),(0,r.jsx)(e1,{label:"Height",value:l,onValueChange:o})]})]})]})},e4=()=>{let{dispatch:e,state:t}=(0,y.MK)();return(0,r.jsxs)(s.Z,{my:1,children:[(0,r.jsx)(c.Z,{fontWeight:800,gutterBottom:!0,children:"Flip"}),(0,r.jsxs)(s.Z,{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[(0,r.jsx)(d.Z,{fullWidth:!0,onClick:()=>(0,y.XY)(e,t,t.focusedLayerId),startIcon:(0,r.jsx)(e0.Z,{style:{transform:"scaleX(-1)"}}),variant:"outlined",children:"Horizontally"}),(0,r.jsx)(d.Z,{fullWidth:!0,onClick:()=>(0,y.Mb)(e,t,t.focusedLayerId),startIcon:(0,r.jsx)(e0.Z,{style:{transform:"rotate(90deg)"}}),variant:"outlined",children:"Vertically"})]})]})};var e8=n(5931),e3=n(13536);let e6=()=>{let{state:e,dispatch:t}=(0,y.MK)(),n=e.history.length>0,l=e.future.length>0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{onClick:()=>{n&&t({type:"UNDO"})},disabled:!n,"aria-label":"Undo",children:(0,r.jsx)(e8.Z,{})}),(0,r.jsx)(h.Z,{onClick:()=>{l&&t({type:"REDO"})},disabled:!l,"aria-label":"Redo",children:(0,r.jsx)(e3.Z,{})})]})};var e5=n(10392),e9=n(8143),e7=n(87107);let te=["Design","Mockups","Pricing"],tt=()=>{let{state:e,stageType:t}=(0,y.MK)(),n={Design:{},"Mock-Ups":{completed:!!(null==e?void 0:e.mockId)},Pricing:{}};return(0,r.jsx)(e5.Z,{activeStep:te.indexOf(t),children:te.map(e=>(0,l.createElement)(e9.Z,{...n[e],key:e},(0,r.jsx)(e7.Z,{children:e})))})};var tn=n(80224),tr=n(61730),tl=n(70563),ti=n(13617);let ta=e=>{let{}=e,t=(0,tn.Z)(),n=(0,tr.Z)(t.breakpoints.down("xs"));return(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:n?"column-reverse":"row",p:2,maxHeight:"70vh"},children:[(0,r.jsx)(s.Z,{sx:{display:"grid",gridTemplateColumns:n?"repeat(3, 1fr)":"repeat(4, 1fr)",gap:2,width:n?"100%":"50%"},children:Array.from({length:n?6:12}).map((e,t)=>(0,r.jsx)(tl.Z,{variant:"rectangular",width:"100%",sx:{paddingTop:"100%"}},t))}),(0,r.jsx)(tl.Z,{variant:"rectangular",sx:{width:n?"100%":"50%",paddingTop:n?"100%":"50%",marginTop:n?2:0,marginLeft:n?0:2,marginBottom:n?2:0}})]})},ts=e=>{let{imageUrls:t}=e,[n,i]=(0,l.useState)(t[0]),[a,o]=(0,l.useState)(1),d=(0,tn.Z)(),c=(0,tr.Z)(d.breakpoints.down("sm")),u=12*a,x=t.slice(u-12,u);return(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:c?"column-reverse":"row"},children:[(0,r.jsxs)(s.Z,{sx:{flex:1,p:2,display:"flex",flexDirection:"column",order:c?1:0},children:[(0,r.jsx)(s.Z,{sx:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:x.map((e,t)=>(0,r.jsx)(s.Z,{sx:{width:"100%",height:0,paddingBottom:"100%",position:"relative",borderRadius:2,border:n===e?"2px solid black":"2px solid lightgray",boxSizing:"border-box",cursor:"pointer"},onClick:()=>i(e),onFocus:()=>i(e),children:(0,r.jsx)("img",{src:e,alt:"Thumbnail ".concat(t+1),style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,objectFit:"cover"}})},t))}),(0,r.jsx)(ti.Z,{count:Math.ceil(t.length/12),page:a,onChange:(e,t)=>
1{o(t)},sx:{mt:2,display:"flex",justifyContent:"center"}})]}),(0,r.jsx)(s.Z,{sx:{flex:1,order:c?0:1},children:(0,r.jsx)(s.Z,{sx:{width:"100%",pt:"100%",position:"relative"},children:(0,r.jsx)("img",{src:n,alt:"Large Preview",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"}})})})]})};var to=n(42724),td=n(68871);let tc=l.forwardRef((e,t)=>{let{className:n,type:l,...i}=e;return(0,r.jsx)("input",{type:l,className:(0,td.cn)("flex h-9 w-full rounded-md border border-neutral-200 bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300",n),ref:t,...i})});tc.displayName="Input";var tu=n(16321),tx=n(92840);let th=e=>{let{selectedIdMap:t,onClick:n}=e,[i,a]=(0,l.useState)(""),{data:{myImages:s=[]}={},refetch:o,loading:d,error:c}=(0,R.iaF)(),u=s.filter(e=>{var t;return null==e?void 0:null===(t=e.publicUrl)||void 0===t?void 0:t.toLowerCase().includes(i.toLowerCase())});return(0,r.jsxs)("div",{className:"my-4 w-full flex flex-col h-full",children:[(0,r.jsx)("div",{className:"container mx-auto",children:(0,r.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,r.jsxs)("div",{className:"flex items-center w-full space-x-2",children:[(0,r.jsx)(tc,{placeholder:"Search images...",value:i,onChange:e=>a(e.target.value),className:"w-full"}),(0,r.jsx)(tu.z,{variant:"ghost",onClick:()=>o(),className:(0,td.cn)({"animate-spin":d}),children:(0,r.jsx)(tx.Z,{className:"h-5 w-5"})})]})})}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2 overflow-y-auto flex-1",children:u.map((e,t)=>(0,r.jsx)("div",{className:"aspect-square",children:(0,r.jsx)(to.Z,{image:null==e?void 0:e.publicUrl,onClick:()=>n(e.id)})},t))})]})},tp=Z()(()=>Promise.all([n.e(5900),n.e(6479)]).then(n.bind(n,96479)),{loadableGenerated:{webpack:()=>[96479]},ssr:!1}),tm=Z()(()=>Promise.all([n.e(3737),n.e(6484),n.e(8517),n.e(7931)]).then(n.bind(n,47931)),{loadableGenerated:{webpack:()=>[47931]},ssr:!1}),tj=Z()(()=>n.e(8686).then(n.bind(n,48686)),{loadableGenerated:{webpack:()=>[48686]},ssr:!1}),tg=e=>{if(!e||!e.variant_printfiles)return{placementMap:{},printfileMap:{}};let t=e.printfiles.reduce((e,t)=>({...e,[t.printfile_id]:t}),{});return{placementMap:e.variant_printfiles.reduce((e,t)=>({...e,["".concat(t.variant_id)]:t.placements}),{}),printfileMap:t}},tf=(e,t,n)=>Object.entries(n[e]||{}).map(e=>{let[n,r]=e;return{label:n,printfile:t[r]}}),tv=()=>{let[e,t]=(0,l.useState)(""),{dispatch:n,focusPrintfile:i}=(0,y.MK)();return(0,r.jsxs)(s.Z,{component:"form",onSubmit:r=>{r.preventDefault(),e.trim()&&((0,y.A4)(n,{id:Date.now().toString(),printfile:i,type:"Text",image:"",layerName:e,description:e,text:e,x:0,y:0,printQuality:"Good",width:100,height:100,dimensions:{width:0,height:0}}),t(""))},sx:{mt:2},children:[(0,r.jsx)(o.Z,{fullWidth:!0,label:"Enter text",variant:"outlined",value:e,onChange:e=>t(e.target.value),sx:{mb:2}}),(0,r.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",children:"Create Text Layer"})]})},ty=()=>{let[e,t]=(0,l.useState)("#fff"),{dispatch:n,state:i,focusPrintfile:a}=(0,y.MK)(),o=g()(i.data,e=>"Fill"===e.type);return(0,r.jsxs)(s.Z,{component:"form",onSubmit:t=>{t.preventDefault(),o?(0,y.tj)(n,o.id,{color:e,layerName:"Fill ".concat(e),description:"Fill layer with color ".concat(e),width:0,height:0,x:0,y:0}):(0,y.A4)(n,{id:Date.now().toString(),printfile:a,type:"Fill",width:0,height:0,x:0,y:0,color:e,layerName:"Fill ".concat(e),description:"Fill layer with color ".concat(e),printQuality:"Great",dimensions:{width:0,height:0}})},sx:{mt:2},children:[(0,r.jsx)(eZ.xS,{color:e,onChangeComplete:e=>t(e.hex)}),(0,r.jsxs)(d.Z,{type:"submit",variant:"contained",color:"primary",children:[o?"Update":"Create"," Fill Layer"]})]})},tb=e=>{let{label:t="web3"}=e;return(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center",p:2},children:[(0,r.jsx)(ew.Z,{}),(0,r.jsxs)(c.Z,{variant:"h5",sx:{mt:2,fontSize:{xs:"16px",md:"24px"}},children:[t," coming soon"]})]})},tZ=()=>{let{product:e,toggleSize:t,toggleColor:n,state:l,colors:i}=(0,y.MK)();return(0,r.jsx)(a.ab,{product:e,colors:i,state:l,onSizeSelect:t,onColorSelect:n,onTechniqueSelect:()=>null})},tw=()=>{let{dispatch:e,focusPrintfile:t}=(0,y.MK)(),n=n=>{console.log(n),(0,y.A4)(e,{type:"File",printfile:t,imageId:n,id:"layer-".concat(Date.now()),x:0,y:0,width:1024,height:1024})};return(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",height:"calc(100vh - 128px)",overflowY:"hidden"},children:[(0,r.jsx)(A.Z,{onCreate:n}),(0,r.jsx)(th,{onClick:n})]})},tk={Product:tZ,Layers:eV,Uploads:tw,Web3:()=>{let{dispatch:e,focusPrintfile:t}=(0,y.MK)();return(0,r.jsx)(s.Z,{display:"flex",flexDirection:"column",sx:{position:"relative",flex:1,height:"calc(100% - 128px)"},children:(0,r.jsx)(th,{onClick:n=>{console.log(n),(0,y.A4)(e,{type:"File",printfile:t,src:n,id:"layer-".concat(Date.now()),x:0,y:0,width:1024,height:1024})}})})},NFC:()=>(0,r.jsx)(tb,{label:"NFC"}),Text:tv,Fill:ty,Transform:()=>{let{state:e,dispatch:t,setFocusKey:n}=(0,y.MK)(),l=(0,y.wv)(e),i=e=>n=>t({type:"UPDATE_LAYER",payload:{id:null==l?void 0:l.id,[e]:n}});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{onClick:()=>n("Layers"),children:"Back to layers"}),(0,r.jsx)(e2,{rotation:null==l?void 0:l.rotation,width:null==l?void 0:l.width,height:null==l?void 0:l.height,onHeightChange:i("height"),onWidthChange:i("width"),onRotationChange:i("rotation")}),(0,r.jsx)(e4,{})]})},Crop:()=>
1{let{focusKey:e,dispatch:t,state:n,setFocusKey:l}=(0,y.MK)(),i=(0,y.wv)(n),{image:a}=(0,eD.o)(null==i?void 0:i.imageId),s=()=>l("Layers");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{onClick:s,children:"Back to layers"}),e,(0,r.jsxs)(u.Z,{open:!0,onClose:s,children:[(0,r.jsxs)(x.Z,{children:[(0,r.jsx)(h.Z,{edge:"start",color:"inherit",onClick:s,"aria-label":"close",children:(0,r.jsx)(L.Z,{})}),(0,r.jsx)(c.Z,{sx:{ml:2,flex:1},variant:"h6",component:"div",children:"Crop Image"})]}),(0,r.jsx)(eC,{onSubmit:e=>{t({type:"UPDATE_LAYER",payload:{id:n.focusedLayerId,...e}}),s()},src:null==a?void 0:a.src,cropData:null==i?void 0:i.cropData})]})]})},Position:()=>{let{dispatch:e,focusPlacement:t,state:n,setFocusKey:l}=(0,y.MK)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{children:(0,r.jsx)(d.Z,{onClick:()=>l("Layers"),children:"Back to layers"})}),(0,r.jsx)(tC,{onAlign:r=>{let l=(0,y.wv)(n);if(!l)return;let i=l.x,a=l.y,{width:s=0,height:o=0}=l,{width:d,height:c}=t.printfile;switch(r){case"align-vertical-top":a=0;break;case"align-vertical-center":a=(c-o)/2;break;case"align-vertical-bottom":a=c-o;break;case"align-horizontal-left":i=0;break;case"align-horizontal-center":i=(d-s)/2;break;case"align-horizontal-right":i=d-s;break;default:console.warn("Unknown alignment key:",r)}(0,y.tj)(e,l.id,{x:i,y:a})}})]})}},tC=e=>{let{onAlign:t}=e,n=e=>{t(e)};return(0,r.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,r.jsx)(c.Z,{children:"Align"}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[(0,r.jsx)(h.Z,{onClick:()=>n("align-vertical-top"),children:(0,r.jsx)(eB.Z,{})}),(0,r.jsx)(h.Z,{onClick:()=>n("align-vertical-center"),children:(0,r.jsx)(eY.Z,{})}),(0,r.jsx)(h.Z,{onClick:()=>n("align-vertical-bottom"),children:(0,r.jsx)(eH.Z,{})}),(0,r.jsx)(h.Z,{sx:{transform:"rotate(180deg)"},onClick:()=>n("align-horizontal-left"),children:(0,r.jsx)(eX.Z,{})}),(0,r.jsx)(h.Z,{onClick:()=>n("align-horizontal-center"),children:(0,r.jsx)(eQ.Z,{})}),(0,r.jsx)(h.Z,{onClick:()=>n("align-horizontal-right"),children:(0,r.jsx)(eX.Z,{})})]})]})},tS={Product:tZ,Layers:eV,Uploads:tw,Web3:()=>(0,r.jsx)(tb,{}),NFC:()=>(0,r.jsx)(tb,{label:"NFC"}),Text:()=>(0,r.jsx)(tv,{}),Fill:()=>(0,r.jsx)(ty,{})},tI=()=>{let{focusKey:e}=(0,y.MK)(),t=tk[e];return(0,r.jsx)(s.Z,{p:1,sx:{height:"100%"},children:t&&(0,r.jsx)(t,{})})},tD=()=>{let{focusKey:e}=(0,y.MK)(),t=tS[e];return(0,r.jsx)(s.Z,{sx:{height:"100%"},children:t&&(0,r.jsx)(t,{})})},tN=e=>{var t;let{productId:n,variantId:i,onClose:o,from:d}=e,[u,m]=l.useState("Product"),[j,f]=l.useState("Design"),{printfileData:v,layoutTemplates:b,variantPrintfileMap:Z,variants:w,product:k,colors:C}=(0,a.d2)(n),[S,I]=l.useState(null),[D,N]=l.useState("ZOOM"),[F,P]=(0,y.HD)(),E=(0,l.useMemo)(()=>d,[d]);(0,l.useEffect)(()=>{E&&(0,y.$7)(P,E)},[E,P]);let z=null==w?void 0:w.filter(e=>{let t=e.colorCode||(null==e?void 0:e.color)||"",n=e.size||"";return F.colors.includes(t)&&F.sizes.includes(n)}),{placementMap:M,printfileMap:R}=tg(v),_=tf(null===(t=z[0])||void 0===t?void 0:t.id,R,M);l.useEffect(()=>{if(!S&&_.length){var e;I(null===(e=_[0])||void 0===e?void 0:e.label)}},[_,I,S]),(0,l.useEffect)(()=>{if(Object.values(C).length>0&&0===F.colors.length&&(0,y.ZW)(P,[Object.values(C)[0]]),w.length>0&&0===F.sizes.length){let e=w[0].size||"";e&&(0,y.oC)(P,[e])}},[C,w,F.colors,F.sizes,P]);let A=g()(_,e=>{let{label:t}=e;return t==S}),T=l.useMemo(()=>{var e;return null==b?void 0:null===(e=b.templates)||void 0===e?void 0:e.filter(e=>null==b?void 0:b.variant_mapping.some(t=>t.templates.some(t=>t.template_id===e.template_id&&t.placement===(null==A?void 0:A.label))))},[b,A]);return(0,l.useEffect)(()=>{let e=e=>{let t=(0,y.wv)(F);t&&("Backspace"===e.key||"Delete"===e.key)&&window.confirm('Are you sure you want to delete the layer "'.concat(t.id,'"?'))&&(0,y.$o)(P,t.id)};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[F,P]),(0,r.jsx)(s.Z,{sx:{position:"relative",height:"100%"},children:(0,r.jsxs)(y.zz.Provider,{value:{state:F,dispatch:P,toggleColor:e=>{F.colors.includes(e)?(0,y.yI)(P,[e]):(0,y.ZW)(P,[e])},toggleSize:e=>{F.sizes.includes(e)?(0,y.mF)(P,[e]):(0,y.oC)(P,[e])},productId:n,variantId:i,product:k,colors:C,gridMode:D,focusKey:u,setFocusKey:m,setGridMode:N,removeLayer:y.$o,printfileData:v,focu
1sPrintfile:S,setFocusPrintfile:I,focusPlacement:A,variantPrintfileMap:Z,stageType:j,placementsForVariant:_,filteredVariants:z},children:[(0,r.jsx)(x.Z,{sx:{borderBottom:"1px solid #ddd"},children:(0,r.jsxs)(s.Z,{sx:{display:"flex",width:"100%",alignItems:"center"},children:[(0,r.jsxs)(s.Z,{display:{xs:"block",md:"flex"},alignItems:"center",children:[(0,r.jsx)(c.Z,{sx:{flex:1,textWrap:"nowrap",fontWeight:"bold",fontSize:{xs:"0.8rem",md:"1rem"}},children:null==k?void 0:k.typeName}),(0,r.jsx)(s.Z,{sx:{borderRight:{md:"4px solid #ddd"},display:"none"}}),(0,r.jsx)(c.Z,{component:ex(),href:"#",sx:{display:"none",fontSize:12},children:"Change Product"})]}),(0,r.jsxs)(s.Z,{display:"flex",alignItems:"center",sx:{marginLeft:"auto"},children:[(0,r.jsx)(e6,{}),(0,r.jsx)(s.Z,{sx:{pl:1,backgroundColor:"#aaa"}}),(0,r.jsx)(eb,{value:j,onChange:f}),(0,r.jsx)(s.Z,{sx:{pl:1,backgroundColor:"#aaa"}}),(0,r.jsx)(h.Z,{onClick:o,sx:{color:"#ccc","&:hover":{color:"#333"}},children:(0,r.jsx)(L.Z,{})})]})]})}),(0,r.jsxs)(s.Z,{display:"flex",sx:{width:"100%"},children:[(0,r.jsx)(s.Z,{sx:{display:"Mockups"===j?"none":{xs:"none",md:"block"},borderRight:"1px solid #ddd"},children:(0,r.jsx)(eO,{})}),(0,r.jsxs)(s.Z,{flex:1,display:"flex",children:[(0,r.jsx)(s.Z,{sx:{display:"Mockups"===j?"none":{xs:"none",md:"block"},width:320,borderRight:"1px solid #ddd"},children:(0,r.jsx)(tI,{})}),(0,r.jsxs)(s.Z,{flex:1,sx:{backgroundColor:"#dedede",position:"relative",height:{xs:"calc(100vh - 112px)",md:"calc(100vh - 128px)"}},children:[(0,r.jsx)(s.Z,{sx:{opacity:"Mockups"===j?0:1,transition:"all 0.2s ease-in"},children:(0,r.jsx)(tp,{focusPlacement:A,layoutTemplates:T,children:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(tj,{})})})}),(0,r.jsx)(s.Z,{sx:{pointerEvents:"Mockups"!==j?"none":"all",opacity:"Mockups"!==j?0:1,transition:"all 0.2s ease-in"},children:(0,r.jsx)(tF,{product:k})}),(0,r.jsx)(s.Z,{sx:{pointerEvents:"Pricing"!==j?"none":"all",opacity:"Pricing"!==j?0:1,transition:"all 0.2s ease-in"},children:(0,r.jsx)(tF,{product:k})})]})]})]}),(0,r.jsxs)(s.Z,{sx:{position:"relative",height:"100vh"},children:[(0,r.jsx)(s.Z,{sx:{display:{xs:"block",md:"none"},width:"100%",position:"absolute",zIndex:1e3,bottom:0},children:(0,r.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column-reverse"},children:(0,r.jsxs)(p.Z,{sx:{borderRadius:"24px 24px 0px 0px",boxShadow:"0 -4px 6px -1px rgba(0,0,0,0.1), 0 -2px 4px -1px rgba(0,0,0,0.06)"},children:[(0,r.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",px:2,width:"100%",justifyContent:"space-between"},children:[(0,r.jsx)(c.Z,{sx:{fontWeight:"bold"},children:u}),(0,r.jsx)(h.Z,{sx:{alignSelf:"flex-end",display:{xs:u?"flex":"none",md:"none"},justifyContent:"center",alignItems:"center"},onClick:()=>m(""),children:(0,r.jsx)(L.Z,{})})]}),(0,r.jsx)(s.Z,{sx:{overflow:"auto"},children:(0,r.jsx)(tD,{})}),(0,r.jsx)(eO,{buttons:q,StackProps:{direction:"row"}})]})})}),(0,r.jsx)(x.Z,{sx:{zIndex:1e3,borderTop:"1px solid #ddd",position:"fixed",width:"100vw",bottom:0,background:"white",left:0},children:(0,r.jsxs)(s.Z,{sx:{display:"flex",width:"100%",alignItems:"center"},children:[k?(0,r.jsx)(a.OW,{product:k}):null,(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center mx-auto",children:[(0,r.jsx)("div",{className:"text-sm",children:"Selected Products"}),(null==z?void 0:z.length)||"Select Colors/Sizes"]}),(0,r.jsxs)(s.Z,{display:"flex",alignItems:"center",sx:{marginLeft:"auto"},children:[(0,r.jsx)(tt,{}),(0,r.jsx)(tP,{product:k})]})]})})]})]})})},tF=e=>{var t,n;let{product:i}=e,{state:a,filteredVariants:o,dispatch:c,placementsForVariant:u,printfileData:x,variantId:h}=(0,y.MK)(),{session:m}=(0,eh.kP)(),{enqueueSnackbar:j}=(0,ec.Ds)(),[g,{data:f}]=(0,R.qTI)({fetchPolicy:"cache-first",onCompleted:e=>{let{syncProductMockStatus:t}=e;c({type:"SET_MOCK_TASK",payload:{...t}})}}),[b,{data:Z}]=(0,R.jY4)({onCompleted:e=>{let{createMockWithPlates:t}=e;c({type:"SET_MOCK_TASK",payload:{...t}})},onError:e=>{console.log(e),j("Error",{variant:"error"})}}),{options:w,option_groups:k}=x||{},{syncProductMockStatus:C}=f||{syncProductMockStatus:null},S=v()(u,"label"),I={productId:null==i?void 0:i.id,variantId:(null===(t=o[0])||void 0===t?void 0:t.id)||h,options:w,optionGroups:k,plates:null==a?void 0:a.data.map(e=>{var t,n,r,l,i,a;return{imageId:e.imageId,src:e.src,plateId:e.printfile,area_width:null===(n=S[e.printfile])||void 0===n?void 0:null===(t=n.printfile)||void 0===t?void 0:t.width,area_height:null===(l=S[e.printfile])||void 0===l?void 0:null===(r=l.printfile)||void 0===r?void 0:r.height,fill:e.color,color:e.color,text:e.text,fontSize:(null==e?void 0:e.fontSize)?+e.fontSize:null,letterSpacing:(null==e?void 0:e.letterSpacing)?+e.letterSpacing:null,type:e.type||"rect",rotation:e.rotation||0,width:e.width,height:e.height,x:null!==(i=null==e?void 0:e.x)&&void 0!==i?i:0,y:null!==(a=null==e?void 0:e.y)&&void 0!==a?a:0}})},D=l.useCallback(()=>{a.mockId&&(null==m?void 0:m.id)&&g({variables:{mockId:a.mockId,userId:null==m?void 0:m.id}})},[null==a?void 0:a.mockId,m,g]);return l.useEffect(()=>{a.mockId&&setTimeout(()=>{D()},6e3)},[a,D]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:0,left:0,right:0,bottom:0,p:1,margin:"auto",width:"100%",maxWidth:"1000px",height:"max-content"},children:(0,r.jsxs)(p.Z,{sx:{width:"100%",margin:"auto"},children:[(0,r.jsx)(d.Z,{onClick:()=>b({variables:I}),children:"Send for Mocks"}),Z?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(d.Z,{onClick:D,disabled:(null==C?void 0:C.status)==="completed",children:"Resync"})}):null,C?(0,r.jsx)(ts,{imageUrls:(null==C?void 0:null===(n=C.images)||void 0===n?void 0:n.map(e=>e.href))||[]}):(0,r.jsx)(ta,{count:9})]})})})},tP=e=>{var t;let{product:n}=e,[i,a]=(0,l.useState)(!1),{filteredVariants:o}=(0,y.MK)(),u=()=>a(!0),x=()=>a(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{variant:"contained",color:"primary",sx:{fontWeight:800},endIcon:(0,r.jsx)(_.Z,{}),onClick:()=>u(),children:"Launch"}),(0,r.jsx)(m.Z,{open:i,onClose:x,sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100vw",height:"100vh",overflow:"scroll"},children:(0,r.jsx)(s.Z,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",p:1},children:(0,r.jsxs)(p.Z,{sx:{width:"100%",maxWidth:"500px",p:2},children:[(0,r.jsx)(c.Z,{children:"Add product to store"}),(0,r.jsx)(ev,{variants:o,defaultValues:{...n,variantId:null===(t=o[0])||void 0===t?void 0:t.id,variantIds:null==o?void 0:o.map(e=>{let{id:t}=e;return t}),costPerItem:(null==n?void 0:n.maxPrice)/100,price:((null==n?void 0:n.maxPrice)/100*1.3).toFixed(2)}}),(0,r.jsx)(s.Z,{sx:{display:"flex",justifyContent:"flex-end",mt:3},children:(0,r.jsx)(d.Z,{onClick:x,children:"Cancel"})})]})})})]})},tE=()=>(0,r.jsxs)(s.Z,{sx:{width:{xs:"100%"},height:"100vh",position:"absolute",top:0,left:0,bottom:0},children:[(0,r.jsx)(tm,{}),(0,r.jsx)(M,{})]});var tz=()=>{let{query:{productId:e="272",variantId:t="9019"}}=(0,i.useRouter)();return(0,r.jsxs)("div",{children:[(0,r.jsx)(w.Z,{title:"Custom Loot Designer",description:"Design your custom loot, position and modify images on print plates.",image:"/img/designer_page.png"}),(0,r.jsx)(tN,{productId:e,variantId:t})]})}},72372:function(e,t,n){n.d(t,{S:function(){return r}});let r=(0,n(86949).sj)({intro:!1,colors:["#ccc","#EFBD4E","#80C670","#726DE8","#EF674E","#353934"],decals:["react","pelago_dev","three2","pmndrs"],color:"#EFBD4E",decal:"pelago_dev"})}}]);
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.