PageSourceSearch

https://circle21.events/_next/static/chunks/pages/myevent/shop/products-cb34932618336605.js

js circle21.events collected 2026-09-24 12:19:14 UTC 6,671 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9111],{98061:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/myevent/shop/products",function(){return n(14153)}])},12286:function(t,e,n){"use strict";n.d(e,{Z:function(){return LayoutEventShop}});var i=n(11527),o=n(96600),r=n(85335),s=n(76983),a=n(39533),l=n.n(a),d=n(11837),c=n(37868),u=n(91602);function LayoutEventShop(t){let{children:e}=t,{query:n}=(0,o.useRouter)(),a=n.competitionId,h=(0,r.usePathname)(),p=[{id:"main",links:[{href:"/myevent/shop/products?competitionId=".concat(a),text:"Products",icon:(0,i.jsx)(d.j,{}),active:!!(null==h?void 0:h.startsWith("/myevent/shop/products"))||"/myevent/shop"===h},{href:"/myevent/shop/orders?competitionId=".concat(a),text:"Orders",icon:(0,i.jsx)(c.x,{}),active:!!(null==h?void 0:h.startsWith("/myevent/shop/orders"))},{href:"/myevent/shop/settings?competitionId=".concat(a),text:"Settings",icon:(0,i.jsx)(u.y,{}),active:!!(null==h?void 0:h.startsWith("/myevent/shop/settings"))}]}];return(0,i.jsxs)("div",{className:l().pageWrapper,children:[(0,i.jsx)(s.Z,{groups:p,title:"Shop"}),(0,i.jsx)("div",{className:l().content,children:e})]})}},14153:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return ShopProducts}});var i=n(11527),o=n(50959),r=n(96600),s=n(89546),a=n(12286),l=n(65985),d=n(62585),c=n(50455),u=n(58607),h=n(74995),p=n(27360),g=n(65610),x=n(44136),m=n(63675),v=n(8852),j=n(46837),y=n(29256),f=n(88027),Z=n(57181),S=n(39175),_=n(18302),b=n(50951),w=n(35863),z=n(88164),P=n(22795),C=n(58944),k=n(6896),I=n(37263),A=n(59342);function ShopProducts(){var t,e,n,s;let a=(0,r.useRouter)(),f=a.query.competitionId,[L,E]=(0,o.useState)(!1),[N,T]=(0,o.useState)("grid"),[O,R]=(0,o.useState)(!1),W=(0,S.g)(),{data:q}=(0,_.e)({competitionId:f,admin:!0,enabled:!!f}),F=function(t){let e=(0,w.NL)();return(0,z.D)({mutationFn:async e=>{let{data:n}=await b.x1.post("/api/competition/".concat(t,"/shop/sync-with-organization"),{enabled:e});return n},onSuccess:()=>{e.invalidateQueries({queryKey:["competition"]})}})}(f),B=(0,w.NL)(),{data:D}=(0,A.HP)(t=>t),K=!!((null==D?void 0:D.is_admin)||(null==D?void 0:D.is_support_admin)),{data:Q,isLoading:X}=(0,I.$)({organization_id:(null==q?void 0:q.organization_id)||"",user_id:null==D?void 0:D.id,role:"admin"}),H=K||X||(null!==(s=null==Q?void 0:null===(n=Q.pages)||void 0===n?void 0:null===(e=n[0])||void 0===e?void 0:null===(t=e.data)||void 0===t?void 0:t.length)&&void 0!==s?s:0)>0,[U,Y]=(0,o.useState)(null),[$,G]=(0,o.useState)(!1),[J,M]=(0,o.useState)(!1),handleSyncToggle=async t=>{if((null==q?void 0:q.organization_id)&&!H){M(!0);return}let e=t.target.checked;Y(e),G(!0);try{await F.mutateAsync(e),await B.invalidateQueries({queryKey:["shop-products"]}),k.Am.success(e?"Shop synced with organization":"Sync with organization disabled")}catch(t){Y(null)}finally{G(!1)}},{data:V,isLoading:tt}=(0,Z.i)({competition_id:f,limit:100}),te=(null==V?void 0:V.data)||[],tn=tt||!f||$;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Z,{title:"Products",actions:(0,i.jsxs)(d.Z,{display:"flex",gap:1,alignItems:"center",flexWrap:"wrap",children:[(null==q?void 0:q.organization_id)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Z,{fontSize:12,color:"var(--color-neutral400)",children:"Sync with Organization"}),(0,i.jsx)(g.Z,{theme:"light",name:"sync-with-org",checked:null!==U?U:!!q.sync_products_with_organization,onChange:handleSyncToggle,disabled:F.isLoading})]}),(0,i.jsxs)(d.Z,{sx:{display:"inline-flex",border:"1px solid var(--color-neutral600)",borderRadius:"6px",overflow:"hidden",height:"30px",padding:"4px",gap:"2px"},children:[(0,i.jsx)(d.Z,{onClick:()=>T("grid"),sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"100%",cursor:"pointer",backgroundColor:"grid"===N?"var(--color-neutral100)":"var(--color-neutral800)",color:"grid"===N?"var(--color-neutral800)":"var(--color-neutral100)",transition:"all 0.2s ease",borderRight:"1px solid var(--color-neutral300)",borderRadius:"4px",borderColor:"transparent"},children:(0,i.jsx)(P.y,{size:18})}),(0,i.jsx)(d.Z,{onClick:()=>T("list"),sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"100%",cursor:"pointer",backgroundColor:"list"===N?"var(--color-neutral100)":"var(--color-neutral800)",color:"list"===N?"var(--color-neutral800)":"var(--color-neutral100)",transition:"all 0.2s ease",borderRadius:"4px",borderColor:"transparent"},children:(0,i.jsx)(C.j,{size:18})})]}),(0,i.jsx)(h.Z,{onClick:()=>E(!0),size:"small",children:"Add Product"})]})}),!tn&&te.length>0&&"grid"===N&&(0,i.jsx)(u.ZP,{container:!0,spacing:2,pb:2,children:te.map(t=>(0,i.jsx)(u.ZP,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,i.jsx)(x.Z,{product:t})},t.id))}),!tn&&te.length>0&&"list"===N&&(0,i.jsx)(d.Z,{pb:2,children:te.map(t=>(0,i.jsx)(m.Z,{product:t},t.id))}),tn&&"grid"===N&&(0,i.jsx)(u.ZP,{container:!0,spacing:2,pb:2,children:Array.from({length:4}).map((t,e)=>(0,i.jsx)(u.ZP,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,i.jsx)(j.Z,{height:350})},e))}),tn&&"list"===N&&(0,i.jsx)(d.Z,{pb:2,children:Array.from({length:3}).map((t,e)=>(0,i.jsx)(j.Z,{height:80,style:{marginBottom:"8px"}},e))}),!tn&&0===te.length&&(0,i.jsx)(u.ZP,{container:!0,spacing:2,pb:2,paddingTop:10,children:(0,i.jsxs)(u.ZP,{item:!0,xs:12,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:1,children:[(0,i.jsx)(c.Z,{textAlign:"center",variant:"h4",fontSize:"24px",fontWeight:"800",children:"Launch Your Exclusive Event Shop"}),(0,i.jsx)(c.Z,{textAlign:"center",fontSize:"14px",color:"var(--color-neutral500)",children:"Turn your event into a digital storefront. Sell products and sponsor items directly inside the app."}),(0,i.jsx)(d.Z,{mt:1,children:(0,i.jsx)(h.Z,{onClick:()=>E(!0),variant:"outlined",size:"large",children:"Add Product"})})]})}),(0,i.jsx)(y.n,{showBtn:!0,formId:"create-product-form",isOpen:L,setIsOpen:()=>E(!1),title:"Add Product",submitLabel:"Add Product",loading:O||W.isLoading,children:(0,i.jsx)(v.Z,{competitionId:f,onClose:()=>E(!1),onUploadingChange:R})}),(0,i.jsxs)(p.Z,{isOpen:J,onClose:()=>M(!1),title:"Organization Product",children:[(0,i.jsx)(c.Z,{fontSize:14,mb:3,children:"This product belongs to the organization. To make changes, please contact the organization directly."}),(0,i.jsx)(h.Z,{theme:"light",variant:"outlined",onClick:()=>M(!1),children:"Close"})]})]})}ShopProducts.getLayout=function(t){return(0,i.jsx)(s.Z,{restrictedTo:[f.u.organiser,f.u.admin],children:(0,i.jsx)(a.Z,{children:t})})}}},function(t){t.O(0,[8217,9714,7458,6750,708,1066,9019,8922,4536,5372,338,6446,2270,9774,2888,179],function(){return t(t.s=98061)}),_N_E=t.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.