1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4110],{2149:(e,t,l)=>{"use strict";l.d(t,{A:()=>B});var i=l(37876),a=l(51829),s=l(16969),r=l(10892),n=l(72790),o=l(3369),d=l(57390),c=l(70521),u=l(20038),h=l(83365),g=l(30258),x=l(75340),m=l(43588),p=l(47520),A=l(66855),b=l(56557),j=l.n(b),f=l(59852),I=l(58347),v=l(82702),S=l(73996),w=l(75283),y=l(76686),C=l(24661),T=l(73446),P=l(14232),D=l(75826),O=l(64177),E=l(72193),k=l(76213);let M=({children:e,fallback:t=null})=>{let[l,a]=(0,P.useState)(!1);return((0,P.useEffect)(()=>{a(!0)},[]),l)?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(i.Fragment,{children:t})};var U=l(61482),H=l(57025),z=l(58053);let B=({collection:e})=>{let[t,{data:l,error:b}]=(0,O.n)(f.Vq,{errorPolicy:"all"}),[B]=(0,O.n)(f.mW),[F,V]=(0,P.useState)(!1),[N,_]=(0,P.useState)(!1),[R,$]=(0,P.useState)(),[L,q]=(0,P.useState)(!1),{submitType:W,meaningfulUpdate:J,handleSubmit:X}=(0,D.j)();(0,P.useEffect)(()=>{$((0,T.u)(e))},[e,$]),(0,P.useEffect)(()=>{!b&&l&&($((0,T.u)(l.saveCollection)),V(!0))},[b,l,$,V]);let G={categories:R?.categories??[],categoriesToDelete:R?.categoriesToDelete??[],title:R?.title??"",slug:R?.slug??"",headline:R?.headline??"",blurb:R?.blurb??"",headerCopy:R?.headerCopy??"",collectionsOnProducts:R?.collectionsOnProducts??[],heroImageBigId:R?.heroImageBigId??null,heroImageBig:R?.heroImageBig??null,heroImageSmallId:R?.heroImageSmallId??null,heroImageSmall:R?.heroImageSmall??null,includeInHomeMainSection:R?.includeInHomeMainSection??!1,meta:R?.meta??{description:"",keywords:"",title:""},productsToDelete:R?.productsToDelete??[],publishAt:R?.publishAt??"",showInSave:R?.showInSave??!1,showInShop:R?.showInShop??!1,tags:R?.tags??[],robotsMetaTag:R?.robotsMetaTag??"index,follow",copywriterId:R?.copywriterId??null,reviewerId:R?.reviewerId??null,updatedAt:R?.updatedAt??"",softUpdatedAt:R?.softUpdatedAt??""},Q=async e=>{await B({variables:{id:e}}),_(!0)};return e?.id&&!R?null:(0,i.jsx)(a.A,{baseUrl:"/collections",existingId:e?.id,updatedId:l?.saveCollection?.id,savedSuccessfully:F,unPublishedSuccessfully:N,initialValues:G,error:b,validate:e=>{let t={...(0,E.D2)({inputValues:e,requiredFields:["title","slug"]})};return"publish"===W.current&&(t={...t={...t,...(0,E.D2)({inputValues:e,requiredFields:["headline","heroImageBigId","collectionsOnProducts","copywriterId"]}),...(0,k.lH)(e.heroImageBig,"heroImageBigId",{labelPrefix:"Header Image Big: "}),...(0,k.lH)(e.heroImageSmall,"heroImageSmallId",{labelPrefix:"Header Image Small: "})},...(0,k.qG)(e.collectionsOnProducts??null,"collectionsOnProducts")}),t},onSubmit:async l=>{let{meta:i,collectionsOnProducts:a,publishAt:s,heroImageBig:r,heroImageSmall:n,...o}=l,d=(0,z.Fp)(R?.isPublished,W.current,R?.updatedAt,J.current),c=(0,z.n)(W.current,R?.softUpdatedAt??void 0),u="publish"!==W.current||s?(0,z.V3)(s):j()().toDate();await t({variables:{collection:{...o,collectionsOnProducts:(0,k.Z3)(a),id:e?.id,publishAt:u,updatedAt:d,softUpdatedAt:c,slug:l.slug||"",title:l.title||"",meta:{...i,id:e?.metaId||void 0},categories:l.categories.map(({id:e,name:t,slug:l})=>({id:parseInt(String(e)),name:t,slug:l})),tags:l.tags.map(({id:e,slug:t,name:l})=>({id:e,slug:t,name:l}))},publish:"publish"===W.current}})},children:t=>{let{isSubmitting:l,values:a,errors:b,setFieldValue:f,submitForm:T,handleChange:P,touched:D,dirty:O}=t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(I.A,{container:!0,spacing:2,children:[(0,i.jsx)(I.A,{size:{xs:12,md:6},children:(0,i.jsx)(g.A,{title:"Header Image Big",onSave:e=>{f("heroImageBigId",e.id),f("heroImageBig",e)},height:800,width:800,imageId:a.heroImageBigId,captionEnabled:!1,altEnabled:!0})}),(0,i.jsx)(I.A,{size:{xs:12,md:6},children:(0,i.jsx)(g.A,{title:"Header Image Small",onDelete:()=>{f("heroImageSmallId",null),f("heroImageSmall",null)},onSave:e=>{f("heroImageSmallId",e.id),f("heroImageSmall",e)},height:275,width:410,imageId:a.heroImageSmallId,captionEnabled:!1,altEnabled:!0})}),(0,i.jsx)(I.A,{size:{xs:12,sm:6},children:(0,i.jsx)(u.A,{name:"title",isSubmitting:l})}),(0,i.jsxs)(I.A,{size:{xs:12,sm:6},style:{display:"flex",alignItems:"start",paddingLeft:"16px",flexDirection:"column",gap:"8px"},children:[(0,i.jsxs)(v.A,{component:"div",variant:"body1",children:[(0,i.jsx)("b",{children:"Published At (US/Chicago):"})," ",j()(a.publishAt).isValid()?(0,z.FJ)(j()(a.publishAt).toDate(),"America/Chicago",!0):"N/A"]}),(0,i.jsxs)(v.A,{component:"div",variant:"body1",children:[(0,i.jsx)("b",{children:"Updated At (US/Chicago):"})," ",j()(a.updatedAt).isValid()?(0,z.FJ)(j()(a.updatedAt).toDate(),"America/Chicago",!0):"N/A"]}),(0,z.Rc)(a.softUpdatedAt,a.updatedAt)&&(0,i.jsxs)(v.A,{component:"div",variant:"body1",children:[(0,i.jsx)("b",{children:"Soft Updated At (US/Chicago):"})," ",(0,z.FJ)(j()(a.softUpdatedAt).toDate(),"America/Chicago",!0)]})]}),(0,i.jsx)(I.A,{size:{xs:12,sm:6},children:(0,i.jsx)(d.A,{name:"slug",isSubmitting:l})}),(0,i.jsx)(I.A,{size:{xs:12,sm:6},children:(0,i.jsx)(u.A,{name:"headline",isSubmitting:l})}),(0,i.jsx)(I.A,{size:{xs:12,sm:6},children:(0,i.jsx)(u.A,{name:"headerCopy",isSubmitting:l})}),(0,i.jsx)(I.A,{size:{xs:12,sm:6},children:(0,i.jsx)(p.A,{value:a.tags,onChange:(e,t)=>
1f("tags",t),error:!!b.tags})}),(0,i.jsx)(I.A,{size:{xs:12,sm:6},children:(0,i.jsx)(U.A,{label:"Copywriter",userId:a.copywriterId,onChange:(e,t)=>f("copywriterId",t?.id),error:D.copywriterId&&!!b.copywriterId,helperText:D.copywriterId&&b.copywriterId})}),(0,i.jsx)(I.A,{size:{xs:12,sm:6},children:(0,i.jsx)(S.A,{label:"Categories",name:"categories",value:"",onChange:P,error:D.categories&&!!b.categories,helperText:D.categories&&b.categories,fullWidth:!0,onClick:()=>q(!0),placeholder:0!==a.categories.length?"":"Click to select a category",InputProps:{readOnly:!0,startAdornment:a.categories?.map((e,t)=>(0,i.jsx)(w.A,{sx:{marginRight:"5px"},label:e.name,onDelete:()=>{f("categories",(a.categories||[]).filter(t=>t.id!==e.id)),f("categoriesToDelete",[...a.categoriesToDelete||[],e.id])}},`category-chip-${t}`))}})}),(0,i.jsx)(I.A,{size:{xs:12,md:6},children:(0,i.jsxs)(y.A,{p:1,display:"flex",gap:2,width:"100%",justifyContent:"space-evenly",children:[(0,i.jsx)(c.A,{name:"showInSave",isSubmitting:l,labelPlacement:"start"}),(0,i.jsx)(c.A,{name:"showInShop",isSubmitting:l,labelPlacement:"start"}),(0,i.jsx)(c.A,{name:"includeInHomeMainSection",isSubmitting:l,labelPlacement:"start"})]})}),(0,i.jsx)(I.A,{size:{xs:12,md:6},justifyContent:"space-around",display:"flex",children:(0,i.jsx)(h.A,{isSubmitting:l})}),(0,i.jsx)(M,{fallback:(0,i.jsx)("div",{children:"Loading editor..."}),children:(0,i.jsx)(H.A,{initialValue:G.blurb??"",onChange:e=>f("blurb",e),placeholder:"Enter blurb...",label:"Blurb"})}),(0,i.jsx)(m.A,{setFieldValue:f,relationName:"collectionsOnProducts",productsOnSomething:a.collectionsOnProducts})]}),(0,i.jsx)(o.A,{productsOnSomething:a.collectionsOnProducts,productsToDelete:a.productsToDelete??[],setFieldValue:f,relationName:"collectionsOnProducts"}),(0,i.jsx)(x.A,{isSubmitting:l}),(0,i.jsx)(I.A,{size:{xs:12},children:(0,i.jsxs)(I.A,{sx:s.VU,children:[(0,i.jsx)(I.A,{children:(0,i.jsx)(C.A,{variant:"contained",color:"primary",disabled:l||!O,onClick:()=>X("draft",T),children:"Save Draft"})}),(0,i.jsx)(I.A,{children:(0,i.jsx)(r.A,{message:R?.isPublished?n.pM:n.Hn,onConfirmation:e=>X("publish",T,e),disabled:l||!O,useMeaningfulUpdate:!0,hideMeaningCheckbox:!R?.isPublished,children:(0,i.jsx)(C.A,{variant:"contained",color:"secondary",disabled:l||!O,children:"Save & Publish"})})}),e?.isPublished&&(0,i.jsx)(I.A,{children:(0,i.jsx)(r.A,{message:"Are you sure to un-publish this Collection? Make sure to have a redirect url!",onConfirmation:()=>Q(e.id),children:(0,i.jsx)(C.A,{variant:"contained",color:"warning",children:"Un-publish"})})})]})}),(0,i.jsx)(A.A,{onItemSelected:e=>{a.categories.some(t=>t.id===e.id)||f("categories",[...a.categories,e]),q(!1)},open:L,onClose:()=>q(!1)})]})}})}},4720:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/collections/create",function(){return l(69835)}])},12857:(e,t,l)=>{"use strict";l.d(t,{A:()=>u});var i=l(37876),a=l(85051),s=l(83621),r=l(73060),n=l(77713),o=l(95927),d=l(2498),c=l(58053);let u=({isSubmitting:e,name:t,label:l,options:u,fullWidth:h=!0,description:g})=>(0,i.jsx)(a.B0,{name:t,children:({field:a,form:x,meta:m})=>(0,i.jsxs)(s.A,{fullWidth:h,disabled:e,error:m.touched&&!!m.error,children:[(0,i.jsx)(r.A,{children:l??(0,c.i5)(t)}),(0,i.jsx)(n.A,{...a,label:l??(0,c.i5)(t),onChange:e=>x.setFieldValue(t,e.target.value),children:u.map(e=>(0,i.jsx)(o.A,{value:e.value,children:e.label},e.value))}),m.touched&&m.error||g?(0,i.jsx)(d.A,{children:m.touched&&m.error?m.error:g}):null]})})},28405:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var i=l(40925),a=l(37876);let s=(0,i.A)((0,a.jsx)("path",{d:"M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12s4.48 10 10 10 10-4.48 10-10m-10 1H8v-2h4V8l4 4-4 4z"}),"ArrowCircleRight")},47520:(e,t,l)=>{"use strict";l.d(t,{A:()=>m});var i=l(37876),a=l(73640),s=l.n(a),r=l(4103),n=l.n(r),o=l(96521),d=l(73996),c=l(14232),u=l(59852),h=l(26686),g=l(64177),x=l(54431);let m=({title:e="Tag",value:t,onChange:l,error:a,helperText:r})=>{let[m]=(0,g.n)(u.j$),[p,A]=(0,c.useState)([]),[b,j]=(0,c.useState)(""),[f,I]=(0,c.useState)([]),{loading:v,data:S}=(0,x.IT)(u.PR,{variables:{offset:0,limit:10,sort:{name:h.pH.asc},search:b}});(0,c.useEffect)(()=>{!v&&S?.tags&&A(S.tags.data)},[v,S,A]);let w=s()(e=>{let t=e.trim();t&&j(t)}),y=async(e,t)=>{let i=t.find(e=>void 0===e.id),a=t.filter(e=>e.id);if(i){let e=i.value,t=await m({variables:{tag:{name:e,slug:n()(e,{trim:!0,lower:!0})}}});t.data?.saveTag&&a.push(t.data.saveTag)}I(a),l&&l(e,a)},C=[...Array.from(new Set([...p,...f,...t||[]]))].sort((0,h.hz)(h.pH.asc,"name"));return(0,i.jsx)(o.A,{fullWidth:!0,multiple:!0,autoComplete:!0,options:C,loading:v,value:t,getOptionLabel:({name:e})=>e,isOptionEqualToValue:(e,t)=>
1e.id==t.id,filterOptions:(e,{inputValue:t})=>{let l=e.find(e=>e.name===t),i=t.trim();return l||""===i||e.push({value:i,name:`Add "${i}"`}),e},renderInput:t=>(0,i.jsx)(d.A,{...t,label:e,error:a,helperText:r}),onInputChange:(e,t)=>{w(t)},onChange:y})}},61482:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var i=l(37876),a=l(80053),s=l(26686),r=l(14232),n=l(59852),o=l(54431),d=l(75850);let c=({label:e="User",userId:t,onChange:l,error:c,helperText:u})=>{let[h,g]=(0,r.useState)(""),{loading:x,data:m}=(0,o.IT)(n.sO,{variables:{offset:0,limit:10,sort:[{firstName:s.pH.asc},{lastName:s.pH.asc}],role:d.f.AUTHOR,search:h||void 0}}),{data:p}=(0,o.IT)(n.xb,{skip:!t,variables:{id:t}});return(0,i.jsx)(a.A,{data:m?.users.data,error:c,getOptionLabel:e=>(({firstName:e,lastName:t,email:l})=>`${e} ${t}`.trim()||l)(e),helperText:u,label:e,loading:x,onChange:l,setSearch:g,value:t&&p?.user||null})}},66855:(e,t,l)=>{"use strict";l.d(t,{A:()=>b});var i=l(37876),a=l(6172),s=l(76686),r=l(75353),n=l(21565),o=l(69015),d=l(59852),c=l(14232),u=l(54431),h=l(9092),g=l(62753),x=l(2797),m=l(90330),p=l(82702),A=l(69750);let b=({onClose:e,onItemSelected:t,open:l,skipIds:b=[]})=>{let[j,f]=(0,c.useState)([]),{loading:I,data:v}=(0,u.IT)(d.Q$,{variables:{offset:0,limit:1e3,sort:{name:"asc"}}}),S=(0,c.useMemo)(()=>{if(!v?.categories?.data)return[];let e=new Map,t=[];return v.categories.data.forEach(t=>{let l={...t,path:t.name};e.set(t.id,l)}),v.categories.data.forEach(l=>{let i=l.name,a=l;for(;a.parentCategoryId;){let t=e.get(a.parentCategoryId);if(t)i=`${t.name} â ${i}`,a=t;else break}t.push({...l,path:i})}),t.sort((e,t)=>e.path.localeCompare(t.path))},[v]);return(0,c.useEffect)(()=>{!I&&v?.categories&&S.length>0&&f(S)},[v,I,S]),(0,i.jsx)(a.A,{onClose:()=>{e&&e()},open:l,children:(0,i.jsx)(s.A,{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",children:(0,i.jsx)(r.A,{title:(0,i.jsx)(n.A,{title:"Categories"}),sx:{width:"100%"},children:(0,i.jsx)(h.A,{sx:{maxHeight:500,overflow:"auto",p:1},children:I?(0,i.jsx)(s.A,{display:"flex",justifyContent:"center",p:3,children:(0,i.jsx)(g.A,{})}):(0,i.jsxs)(x.A,{children:[j.map(e=>b?.includes(e.id)?null:(0,i.jsxs)(s.A,{children:[(0,i.jsxs)(m.Ay,{sx:{display:"flex",justifyContent:"space-between",py:1,px:2,"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"}},children:[(0,i.jsx)(p.A,{variant:"body1",children:e.path}),(0,i.jsx)(o.A,{title:"Select",onClick:()=>{t(e)}})]}),(0,i.jsx)(A.A,{})]},`category-${e.id}`)),0===j.length&&!I&&(0,i.jsx)(s.A,{p:2,children:(0,i.jsx)(p.A,{variant:"body1",align:"center",children:"No categories found"})})]})})})})})}},69015:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var i=l(37876),a=l(28405),s=l(80424),r=l(22250);let n=({onClick:e,title:t})=>(0,i.jsx)(s.A,{title:t,children:(0,i.jsx)(r.A,{size:"small",onClick:e,children:(0,i.jsx)(a.A,{})})})},69835:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>u});var i=l(37876),a=l(93546),s=l(2149),r=l(75353),n=l(21565),o=l(76686),d=l(11399);let c=()=>(0,i.jsxs)(o.A,{display:"flex",flexDirection:"column",alignItems:"center",gap:2,children:[(0,i.jsx)(r.A,{title:(0,i.jsx)(n.A,{title:"Create Collection",backLink:(0,d.a$)("/collections")}),sx:{width:"100%"},content:!1}),(0,i.jsx)(r.A,{sx:{position:"relative",width:"100%"},children:(0,i.jsx)(o.A,{children:(0,i.jsx)(s.A,{})})})]});c.getLayout=function(e){return(0,i.jsx)(a.A,{children:e})};let u=c},75826:(e,t,l)=>{"use strict";l.d(t,{j:()=>a});var i=l(14232);let a=()=>{let e=(0,i.useRef)("draft"),t=(0,i.useRef)(!0),l=(0,i.useRef)("");return{submitType:e,meaningfulUpdate:t,changeLogDescription:l,handleSubmit:(i,a,s=!0,r)=>(e.current=i,t.current=s,l.current=r??"",a()),prepareSaveDraft:()=>{e.current="draft",t.current=!1,l.current=""}}}},75850:(e,t,l)=>{"use strict";l.d(t,{f:()=>i});let i={USER:"user",STAFF:"staff",AUTHOR:"author",SUPERADMIN:"superadmin"}},83365:(e,t,l)=>{"use strict";l.d(t,{A:()=>d});var i=l(37876),a=l(12857),s=l(73287),r=l(82702),n=l(19135),o=l(85051);let d=({name:e="robotsMetaTag",label:t="Robots Meta Tag",isSubmitting:l})=>{let[d]=(0,o.Mt)(e),c=String(d.value).includes("noindex")?(0,i.jsxs)(r.A,{sx:{color:s.M.red},children:["If tag is ",(0,i.jsx)("code",{children:"noindex"}),", the page will not be listed in sitemap.xml."," ",(0,i.jsx)(n.A,{href:"https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag",target:"_blank",rel:"noopener noreferrer",sx:{textDecorationColor:s.M.red,color:s.M.red},children:"Learn more"}),"."]}):null;return(0,i.jsx)(a.A,{name:e,label:t,isSubmitting:l,options:[{value:"index,follow",label:"index,follow"},{value:"noindex,nofollow",label:"noindex,nofollow"},{value:"noindex,follow",label:"noindex,follow"},{value:"index,nofollow",label:"index,nofollow"}],description:c})}}},e=>{e.O(0,[7755,6680,7713,3996,6654,7664,6103,8230,2251,8856,4431,6760,8289,7602,3990,424,3089,1678,2732,696,5454,8575,4770,9514,8612,3546,9852,9800,7959,106,636,6593,8792],()=>e(e.s=4720)),_N_E=e.O()}]);
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.