PageSourceSearch

https://platform.carbonhalo.com/_next/static/chunks/pages/groups-b4828da464278172.js

js carbonhalo.com collected 2026-10-04 10:28:15 UTC 42,000 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2400],{5381:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});var s=t(37876),o=t(48230),l=t.n(o);let i=e=>(0,s.jsx)("div",{className:"breadcrumbs ml-1 p-0.5 text-sm font-semibold",children:(0,s.jsxs)("ul",{children:[(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:"/home",children:"Home"})}),e.paths.map(e=>{let{name:r,path:t}=e;return(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:t,children:r})},t)})]})})},11332:(e,r,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/groups",function(){return t(34456)}])},23500:(e,r,t)=>{"use strict";t.d(r,{NR:()=>x,PI:()=>g,QN:()=>N,YR:()=>j,ZN:()=>b,mq:()=>C});var s=t(83350),o=t(85461),l=t(15526),i=t(42252),n=t(89099),a=t.n(n),d=t(97685),c=t(60513);let u=c.z.object({id:c.z.string().nullable(),createdDate:c.z.string().nullable(),groupId:c.z.string().nullable(),approved:c.z.boolean().nullable()}).array(),p=c.z.object({id:c.z.string(),title:c.z.string()}),m=async e=>{let{id:r,privateCode:t,couponId:o}=e,{data:l}=await s.protectedApiCaller.post("/groups/".concat(r,"/join"),{privateCode:t,couponId:o});return p.parse(l)},g=()=>{let e=(0,o.jE)();return(0,l.n)({mutationFn:m,onSuccess:()=>{e.invalidateQueries(["myGroups"]),e.invalidateQueries(["allGroups"])}})},h=async e=>{let{memberId:r,id:t,privateCode:o,couponId:l}=e,{data:i}=await s.publicApiCaller.post("/groups/".concat(t,"/joinoncreate"),{privateCode:o,memberId:r,couponId:l});return p.parse(i)},x=()=>(0,l.n)({mutationFn:h}),v=async e=>{let{groupId:r,memberId:t}=e,{data:o}=await s.protectedApiCaller.post("/member/".concat(t,"/requested-group/").concat(r));return o},b=()=>{let e=(0,o.jE)();return(0,l.n)({mutationFn:v,onSuccess:()=>{e.invalidateQueries(["myGroups"]),e.invalidateQueries(["allGroups"])},onError:e=>{console.log(e)}})},y=async e=>{let{data:r}=await s.protectedApiCaller.post("/group/".concat(e,"/approve"));return r},j=()=>(0,l.n)({mutationFn:y,onSuccess:()=>{d.Ay.success("Member request approved"),a().push("/groups")},onError:e=>{d.Ay.error("Error approving the request"),console.error("Error approving the request:",e)}}),f=async e=>{let{data:r}=await s.protectedApiCaller.get("/member/".concat(e,"/requested-group"));return u.parse(r)},N=e=>(0,i.I)({queryKey:[e,"requested-groups"],queryFn:()=>f(e),onError(e){console.log("err: ",e)},retry:!1}),w=async e=>{let{groupId:r,privateCode:t}=e,{data:o}=await s.protectedApiCaller.post("/group/".concat(r,"/coupon/join"),{privateCode:t});return o},C=()=>{let e=(0,o.jE)();return(0,l.n)({mutationFn:w,onSuccess:()=>{e.invalidateQueries(["myGroups"]),e.invalidateQueries(["allGroups"])}})}},24201:(e,r,t)=>{"use strict";t.d(r,{E:()=>a,_:()=>c});var s=t(83350),o=t(85461),l=t(15526),i=t(60513);i.z.object({id:i.z.string(),welcomeTemplateId:i.z.string().optional()});let n=async e=>{let r=e.id,t=e.private,{title:o,description:l="",groupPurposeOption:i,purposeOther:n,groupTypeOption:a,typeOther:d,privateCode:c,target1:u,image:p}=e;await s.protectedApiCaller.put("/groups/".concat(r),{title:"".concat(o),description:l,groupPurposeOption:i,purposeOther:"GPO_999"===i?n:"",groupTypeOption:a,typeOther:"GTO_999"===a?d:"",FYStartMonth:"JUL",privateCode:"public"===t?"":c,groupTarget:{financialYear:2023,target1:u,target2:10,target3:100,target4:100,target5:100},image:p})},a=()=>{let e=(0,o.jE)();return(0,l.n)({mutationFn:n,onSuccess:()=>{e.invalidateQueries(["myGroups"])}})},d=async e=>{await s.protectedApiCaller.patch("/group/".concat(e.id,"/admin"),e)},c=()=>{let e=(0,o.jE)();return(0,l.n)({mutationFn:d,onSuccess:()=>{e.invalidateQueries(["allGroupForAdmin"])}})}},34456:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>eu});var s=t(37876),o=t(22161),l=t(63548),i=t(35032),n=t(73919),a=t(70121),d=t(83350),c=t(85461),u=t(15526),p=t(60513);let m=p.z.object({id:p.z.string(),title:p.z.string(),systemGroup:p.z.boolean()}),g=async e=>{let{title:r,description:t="",groupPurposeOption:s,groupPurposeOther:o,groupTypeOption:l,privateCode:i,target1:n,image:a}=e,{data:c}=await d.protectedApiCaller.post("/groups",{title:"".concat(r),description:t,groupPurposeOption:s,purposeOther:o,groupTypeOption:l,FYStartMonth:"JUL",privateCode:i,image:a,groupTarget:{financialYear:2023,target1:n,target2:10,target3:100,target4:100,target5:100}});return m.parse(c)};var h=t(14232),x=t(89343);let v=(0,x.A)(n.A);
1v.isPrivate=void 0,v.title=void 0,v.groupTypeOption=void 0,v.groupPurposeOption=void 0;let b=e=>{let{onCreated:r}=e,{mutate:t,isLoading:o}=(()=>{let e=(0,c.jE)();return(0,u.n)({mutationFn:g,onSuccess:()=>{e.invalidateQueries(["myGroups"])}})})(),[l,d]=(0,h.useState)(v),[p,m]=(0,h.useState)(1),x=(0,h.useCallback)(e=>{d(r=>({...r,...e}))},[]),b=(0,h.useCallback)(e=>{t(e,{onSuccess:()=>{null==r||r(),m(e=>e+1),d(v)}})},[t,r]);return(0,s.jsx)(i.A,{model:n.A,schema:n.w,className:"grid grid-cols-6 rounded bg-secondary-light px-section-gutter-x py-section-gutter-y",edit:!0,object:l,section:"new",onChange:x,onSubmit:b,submitButton:(0,s.jsx)("div",{className:"col-span-6 mt-4 text-right",children:(0,s.jsx)(a.A,{color:"dark-blue",type:"submit",disabled:o,children:"Create a Group"})})},p)};var y=t(49408),j=t(5381),f=t(13671);let N=async e=>{let{data:r}=await d.protectedApiCaller.delete("/groups/".concat(e,"/leave"));return r};var w=t(49570),C=t(95661);let A=async(e,r)=>{if(!e)return null;let{data:t}=await d.protectedApiCaller.get("/groups/".concat(e,"/").concat(r||2023,"/targets"));return t};var k=t(42252),G=t(49304);function z(e){let{id:r}=e,[t,o]=(0,h.useState)(null);return((0,k.I)({queryKey:["fetchGroupTargets",r],queryFn:()=>A(r),onSuccess:e=>{o(e)}}),t)?(0,s.jsx)(i.A,{model:n.A,schema:n.w,section:"targets",className:"grid grid-cols-6 bg-grey-1 px-section-gutter-x py-section-gutter-y",object:t.groupTarget}):(0,s.jsx)("div",{children:(0,s.jsx)(G.A,{})})}var P=t(55088),S=t(67232),I=t(64839);let E=async e=>{let{data:r}=await d.protectedApiCaller.delete("/groups/".concat(e));return r};var F=t(20327),q=t(54587),O=t.n(q),T=t(18720);let J=[{field:"title",name:"Group Name",type:"groupName",section:"new",createable:!0,editable:!0,labelCols:2,inputCols:4},{field:"groupTypeOption",name:"Who is your Group for?",type:"select",section:"new",lookup:"/group-type-options",editable:!0,createable:!0,labelCols:2},{field:"typeOther",name:"Please provide more information.",showIf:e=>
1"GTO_999"===e.groupTypeOption,type:"text",section:"new",editable:!0,createable:!0,labelCols:2},{field:"groupPurposeOption",name:"Your Group's main purpose?",type:"select",lookup:"/group-purpose-options",section:"new",editable:!0,createable:!0,labelCols:2},{field:"purposeOther",name:"Please provide more information.",showIf:e=>"GPO_999"===e.groupPurposeOption,type:"text",section:"new",editable:!0,createable:!0,labelCols:2},{field:"private",name:"Private or Public?",type:"select",section:"new",options:[{value:"private",name:"Private"},{value:"public",name:"Public"},{value:"closed",name:"Closed"}],createable:!0,editable:!0,labelCols:2},{field:"privateCode",name:"Your Private Groups Password",showToggle:!0,disableAutocomplete:!0,type:"password",section:"new",editable:!0,createable:!0,labelCols:2,inputCols:2,showIf:e=>"private"===e.private},{type:"number",name:"Target number of members for your Group",field:"target1",section:"new",createable:!0,editable:!0,labelCols:2,inputCols:1},{field:"image",name:"Group Logo",type:"logo",createable:!0,editable:!0,section:"new",labelCols:2,helperText:"This enables your logo to appear on your decarbonisation reports. PNG, JPG or GIF images only"}],D=(0,T.A)(J);p.z.object({groupId:p.z.string().optional()});let Q=p.z.object({title:p.z.string(),groupTypeOption:p.z.string(),typeOther:p.z.string().optional(),groupPurposeOption:p.z.string(),purposeOther:p.z.string(),private:p.z.enum(["private","public"]),privateCode:p.z.string().optional(),target1:p.z.number(),image:p.z.string().optional()}),M=async e=>{let{groupId:r}=e;if(!r)return null;let{data:t}=await d.protectedApiCaller.get("/groups/".concat(r,"/defaults"));return Q.parse(t)};var _=t(24201),R=t(97685);let Y=(0,x.A)(J),B=e=>{var r;let{group:t,setEditGroup:o}=e,{mutate:l,isLoading:n}=(0,_.E)(),d=(0,c.jE)(),{data:u,isSuccess:p}=(e=>{let{groupId:r}=e;return(0,k.I)({queryKey:["defaultValueForUpdate",r],queryFn:()=>M({groupId:r}),enabled:!!r,onError(e){console.log("err: ",e)},cacheTime:1/0})})({groupId:null==t?void 0:t.id}),[m,g]=(0,h.useState)(Y);(0,h.useEffect)(()=>{p&&u&&g(u)},[u,p]),(0,h.useEffect)(()=>()=>{d.invalidateQueries(["defaultValueForUpdate",null==t?void 0:t.id])},[d,null==t?void 0:t.id]);let x=(0,h.useCallback)(e=>{g(r=>({...r,...e}))},[]),v=(0,h.useCallback)(()=>((null==m?void 0:m.groupTypeOption)!=="GTO_999"||Object.hasOwn(m,"typeOther"))&&((null==m?void 0:m.groupTypeOption)!=="GTO_999"||(null==m?void 0:m.typeOther)!=="")?((null==m?void 0:m.groupPurposeOption)!=="GPO_999"||Object.hasOwn(m,"purposeOther"))&&((null==m?void 0:m.groupPurposeOption)!=="GPO_999"||(null==m?void 0:m.purposeOther)!=="")?(null==m?void 0:m.private)==="private"&&(null==m?void 0:m.privateCode)===""?(R.oR.error("Please enter your private groups password",{position:"bottom-center"}),null):void l({...m,id:null==t?void 0:t.id},{onSettled:()=>{g(Y),o(null)}}):(R.oR.error("Please provide more information about who your group's main purpose",{position:"bottom-center"}),null):(R.oR.error("Please provide more information about who your group is for",{position:"bottom-center"}),null),[m,null==t?void 0:t.id,o,l]);return(null==m?void 0:m.title)?(0,s.jsx)(i.A,{model:J,schema:D,className:"grid grid-cols-6 bg-secondary-light px-section-gutter-x py-section-gutter-y",edit:!0,object:m,section:"new",onChange:x,onSubmit:v,submitButton:(0,s.jsx)("div",{className:"col-span-6 mt-4 text-right",children:(0,s.jsx)(a.A,{color:"dark-blue",type:"submit",disabled:n,children:"Save"})})},null!=(r=null==t?void 0:t.id)?r:"fake"):(0,s.jsx)("div",{className:"flex h-[400px] w-full items-center justify-center",children:(0,s.jsx)(G.A,{})})};var K=t(63759);let L=e=>{let{val:r}=e;return(0,s.jsxs)("select",{className:"input input-xs input-bordered input-ghost w-[200px]",children:[(0,s.jsx)("option",{children:"Select"}),(0,s.jsx)("option",{value:"revenue",selected:"revenue"===r,children:"% of Revenue"}),(0,s.jsx)("option",{value:"units",selected:"units"===r,children:"% of Sales Units"}),(0,s.jsx)("option",{value:"production",selected:"production"===r,children:"% of Production"}),(0,s.jsx)("option",{value:"other",selected:"other"===r,children:"Other"})]})},U=[{name:"Business Fuels",tonnes:25,allocate:10,calculation:"revenue"},{name:"Electricity",tonnes:30,allocate:12,calculation:"units"}
1,{name:"Employee Commute",tonnes:10,allocate:14,calculation:"production"},{name:"Freight and Packaging",tonnes:15,allocate:2,calculation:"other"},{name:"Waste",tonnes:20,allocate:11,calculation:"revenue"},{name:"Business Travel",tonnes:35,allocate:9,calculation:"units"},{name:"Suppliers",tonnes:40,allocate:15,calculation:"production"}];function W(e){let{showPlan:r,setShowPlan:t}=e;return(0,s.jsx)(C.A,{open:r,onClose:()=>t(!1),bodyClassName:"max-w-6xl",title:"Submit new Plan",children:(0,s.jsxs)("div",{className:"mt-1 grid border-grey-2",style:{gridTemplateColumns:"30% 1fr",borderTop:"2px solid"},children:[(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Who Group is For"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:"Downer Suppliers"}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Group Purpose"}),(0,s.jsxs)("div",{className:"bg-grey-1 p-2",children:["Downer is subject to mandatory climate reporting requirements and has targets in place to reduce emissions as part of its sustainability commitment. Downer is supported by many suppliers. Suppliers create carbon emissions in providing goods and services to Downer. Downer is required to report on these carbon emissions. These emissions also need to be reduced overtime."," "]}),(0,s.jsx)("div",{className:"bg-grey-2 p-2 font-bold",children:"My data to submit"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2"}),(0,s.jsx)("div",{className:"bg-grey-2 p-2 font-bold"}),(0,s.jsxs)("div",{className:"bg-grey-1 p-2",children:[(0,s.jsxs)("div",{className:"grid w-[500px] grid-cols-2",children:[(0,s.jsx)("div",{children:"12 months ending"}),(0,s.jsx)("div",{children:"30 June 2023"}),(0,s.jsx)("div",{children:"Emissions Validation Level"}),(0,s.jsx)("div",{children:"Estimated"}),(0,s.jsx)("div",{children:"Emissions Reduction Plan"}),(0,s.jsx)("div",{children:"Link"})]}),(0,s.jsxs)("div",{className:"mt-2 grid gap-1",style:{gridTemplateColumns:"2fr 1fr 2fr 2fr"},children:[(0,s.jsx)("div",{className:"font-bold",children:"Emission Category"}),(0,s.jsx)("div",{className:"font-bold",children:"C02 tonnes"}),(0,s.jsx)("div",{className:"font-bold",children:"% to allocate to Group"}),(0,s.jsx)("div",{className:"font-bold",children:"Calculation Method"}),U.map(e=>(0,s.jsxs)(h.Fragment,{children:[(0,s.jsx)("div",{children:e.name}
1),(0,s.jsx)("div",{children:e.tonnes}),(0,s.jsxs)("div",{children:[(0,s.jsx)("input",{className:"input input-xs input-bordered input-ghost w-16",type:"number",value:e.allocate}),"%",(0,s.jsxs)("span",{className:"ml-2 text-xs text-grey-3",children:["(",(e.tonnes*(e.allocate/100)).toFixed(1)," tonnes)"]})]}),(0,s.jsx)(L,{val:e.calculation})]},e.name))]})]}),(0,s.jsx)("div",{}),(0,s.jsx)("div",{className:"mt-2 w-full pr-4 text-right",children:(0,s.jsx)(a.A,{onClick:()=>t(!1),children:"Submit"})})]})})}var V=t(13020),Z=t(42224),H=t(89099);let X=(e,r)=>"Hi\n\nWe are inviting your business to join our decarbonisation group, ".concat(e.title,"\n\nOur business has adopted Carbonhalo’s five-stage decarbonisation program. It is very simple to follow, we can do it on our own and it’s an easy way to show our sustainability story to customers, employees and stakeholders.\n\nOne of the best features of the program is creating a group to join businesses together on the same journey. This enables much more impact, demonstrates how our broader business community is helping and shows we are making a real difference together.  \n\nMore information about Carbonhalo can be found at carbonhalo.com.\n\nIf you use the link below to sign up to the Carbonhalo program, it will automatically add your business to our group.\n\nIf you don’t want to use the link, you can join our group once you have signed into the program.  \n\n").concat(r,"/join?id=").concat(e.id).concat(e.privateCode?"&privateCode=".concat(e.privateCode):""),$=e=>{let[r,t]=(0,h.useState)(!1),{close:o,group:l}=e,i=(0,P.UK)(),[n,d]=(0,h.useState)(X(l,null==i?void 0:i.webfront)),[c,u]=(0,h.useState)(!1);return((0,h.useEffect)(()=>{d(X(l,null==i?void 0:i.webfront))},[l,null==i?void 0:i.webfront]),e.disabled)?null:(0,s.jsxs)("div",{children:[(0,s.jsx)(a.A,{color:"dark-blue",compact:!0,onClick:()=>{u(!0)},children:"Invite Members"}),(0,s.jsx)(C.A,{open:c,onClose:()=>{u(!1),t(!1)},title:"Group Invite Information",bodyClassName:"w-screen-lg max-w-screen-lg",actions:(0,s.jsxs)(s.Fragment,{children:[r?(0,s.jsx)("span",{className:"flex items-center justify-center text-green-2",children:"Invite copied to your clipboard."}):null,(0,s.jsx)(a.A,{color:"primary-blue",onClick:()=>{window.navigator.clipboard.writeText(n),t(!0),setTimeout(()=>t(!1),3e3)},children:"Copy Invite"}),(0,s.jsx)(a.A,{color:"dark-blue",onClick:()=>{u(!1),o(),d(X(l,null==i?void 0:i.webfront)),t(!1)},children:"Done"})]}),children:(0,s.jsx)("textarea",{className:"h-[500px] w-full bg-secondary-soft-light p-2",value:n,onChange:e=>{d(e.target.value),t(!1)}})})]})};function ee(){let{data:e,isLoading:r}=(0,w.a)(),{mutate:t}=(()=>{let e=(0,c.jE)();return(0,u.n)({mutationFn:N,onSuccess:()=>{e.invalidateQueries(["myGroups"]),e.invalidateQueries(["allGroups"])}})})(),{mutate:o}=(()=>{let e=(0,c.jE)();return(0,u.n)({mutationFn:E,onSuccess:()=>{e.invalidateQueries(["myGroups"]),e.invalidateQueries(["allGroups"])}})})(),{user:l}=(0,S.A)(),i=(0,H.useRouter)(),[n,d]=(0,h.useState)(null),[p,m]=(0,h.useState)(null),g=(0,h.useRef)(null),x=(0,P.UK)(),{data:v}=(0,I.IZ)(null==l?void 0:l.memberId),[b,y]=(0,h.useState)(null),[j,A]=(0,h.useState)(null),[k,G]=(0,h.useState)(!1),{data:q}=(0,V.t)(null==l?void 0:l.memberId),{data:T}=(0,K.e)("compliance"),J=(0,h.useMemo)(()=>e?T?{groupCreated:e.groupCreated.map(e=>({...e,type:e.isPrivate?"Private":"Public"})),groupJoined:[...e.groupJoined.map(e=>({...e,type:e.isPrivate?"Private":"Public"})),{id:"downer",type:"Compliance",title:"Downer Suppliers",systemGroup:!1,isPrivate:!0,kind:"Supplier"}]}:e:null,[e,T]),[D,Q]=(0,h.useState)();return r||!J?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("input",{style:{height:0,padding:0,margin:0,overflow:"hidden",position:"absolute",left:"-200vw"},ref:g}),(0,s.jsx)(W,{showPlan:k,setShowPlan:G}),(0,s.jsx)(f.A,{sections:[{header:"Groups Created",color:"header-green",data:J.groupCreated,actions:[{render:e=>(0,s.jsx)($,{close:()=>{var e;return null==(e=g.current)?void 0:e.focus()},group:e,disabled:(null==q?void 0:q.folder)==="terc"})},{label:"Members",onClick:e=>Q({id:e.id,type:"quicktrack"}),color:"primary"},{label:"Report",onClick:e=>Q({id:e.id,type:"dashboard"}),color:"header-green"},{label:"Edit",color:"dark-blue",onClick:e=>{A(e)},getProps:e=>({disabled:!!e.systemGroup,className:e.systemGroup?"hidden":""})},{color:"grey",render:e=>(0,s.jsx)("div",{className:"dropdown",children:(0,s.jsx)("label",{children:(0,s.jsx)(O(),{onClick:()=>y(e),className:"cursor-pointer",alt:"Show menu",src:F.A,height:17,width:17})})})}]},{header:"Groups Joined",color:"dark-blue",data:J.groupJoined,actions:[{label:"View Data Requests",onClick:()=>{i.push("/suppliers/allocation")},color:"dark-blue",getProps:e=>({className:"Supplier"===e.kind?"":"hidden"})},{label:"Members",onClick:e=>Q({id:e.id,type:"quicktrack"}),getProps:e=>({className:"Compliance"===e.type||"Supplier"===e.kind?"hidden":""}),color:"primary"},{label:"Report",onClick:e=>{Q({id:e.id,type:"dashboard"})},getProps:e=>({className:"Compliance"===e.type||"Supplier"===e.kind?"hidden":""}),color:"header-green"},{label:"Submit New Plan",onClick:()=>{G(!0)},getProps:e=>({className:"Compliance"===e.type?"":"hidden"})},{label:"Plans Submitted",getProps:e=>({className:"Compliance"===e.type?"":"hidden"})},{label:"Leave Group",onClick:e=>d(e),color:"danger",getProps:e=>({disabled:!!e.systemGroup||e.id===(null==v?void 0:v.groupId),className:e.systemGroup||e.id===(null==v?void 0:v.groupId)?"hidden":""})}]}],columns:T?["title","type","kind"]:["title","isPrivate","kind"],formatters:{isPrivate:e=>e?"Private":"Public",kind:e=>e?"Supplier":""}}),(0,s.jsx)(C.A,{open:!!n,onClose:()=>d(null),title:"Are you sure you want to leave this group?",actions:(0,s.jsx)(a.A,{color:"secondary",onClick:()=>{t(null==n?void 0:n.id),d(null)},children:"Leave Group"}),children:(0,s.jsx)("div",{children:null==n?void 0:n.title})}),(0,s.jsx)(C.A,{open:!!j,onClose:()=>A(null),title:"Edit Group",bodyClassName:"max-w-6xl",children:(0,s.jsx)(B,{group:j,setEditGroup:A})}),b&&(0,s.jsx)(C.A,{open:!!b,onClose:()=>
1y(null),title:"Confirm deletion",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Are you sure you want to delete the group:"}),(0,s.jsx)("p",{className:"m-3 font-bold",children:null==b?void 0:b.title}),(0,s.jsx)("p",{children:"This action cannot be undone!"}),(0,s.jsxs)("div",{className:"text-right",children:[(0,s.jsx)(a.A,{className:"mr-2",onClick:()=>y(null),children:"Cancel"}),(0,s.jsx)(a.A,{color:"danger",onClick:()=>{o(null==b?void 0:b.id),y(null)},children:"Delete"})]})]})}),(0,s.jsx)(C.A,{open:!!p,onClose:()=>m(null),title:"".concat(null==p?void 0:p.title," targets"),bodyClassName:"w-screen-lg max-w-screen-lg",children:(0,s.jsx)(z,{id:null==p?void 0:p.id},null==p?void 0:p.id)}),(0,s.jsx)(C.A,{bodyClassName:"w-full max-w-full h-full max-h-full p-0",open:!!D,onClose:()=>Q(void 0),children:(null==D?void 0:D.type)&&D.id&&D.type in Z.x&&Z.x[D.type]({id:D.id,open:!!D,year:null==x?void 0:x.currentFY,onClose:()=>{Q(void 0)}})})]})}var er=t(35280),et=t(94009),es=t(23500),eo=t(49119),el=t(48711),ei=t(91183),en=t(32961),ea=t(94141);function ed(){var e,r,t,o;let{data:l}=(0,w.a)(),{data:i,isLoading:n}=(0,eo.Dm)(),[d,u]=(0,h.useState)(""),{refetch:p,data:m,error:g,isFetching:x}=(0,ea.Y)(d),{mutate:v}=(0,es.mq)(),{data:b}=(0,en.L)("states"),{mutate:y}=(0,es.PI)(),{mutate:j}=(0,es.ZN)(),[N,A]=(0,h.useState)(),[k,z]=(0,h.useState)(),[P,I]=(0,h.useState)(!1),{user:E}=(0,S.A)(),{data:F}=(0,ei.k)(null==E?void 0:E.memberId),[q,O]=(0,h.useState)(""),[T,J]=(0,h.useState)(!1),[D,Q]=(0,h.useState)(""),[M,_]=(0,h.useState)(""),Y=(0,h.useRef)(null),B=(0,c.jE)(),{data:K}=(0,es.QN)(null==E?void 0:E.memberId);(0,h.useEffect)(()=>{F&&_(F.reportingStateId)},[F]);let L=(0,h.useMemo)(()=>i?i.filter(e=>"all"===M||e.reportingStateId===M):[],[i,M]),U=e=>!!l&&l.groupJoined.some(r=>r.id===e.id),W=(0,h.useCallback)(()=>{O(""),J(!1),Q("")},[]),V=(0,h.useCallback)(e=>{if(e.isPrivate&&!q){z(e),J(!0),setTimeout(()=>{var e;null==(e=Y.current)||e.focus()},100);return}y({id:e.id,privateCode:q},{onSuccess:W,onError:e=>{var r,t;O(""),null==(r=Y.current)||r.focus(),(0,el.F0)(e)&&(null==(t=e.response)?void 0:t.status)===409?Q("Incorrect group code."):Q("Something went wrong, please try again.")}})},[W,y,q]),Z=(0,h.useCallback)((e,r)=>{null!==e&&j({groupId:r.id,memberId:e.memberId},{onSuccess:()=>{R.Ay.success("Your request to join this group has been sent.",{duration:5e3,position:"top-center"});let r=null==e?void 0:e.memberId;r&&B.invalidateQueries([r,"requested-groups"]),W()},onError:e=>{var r,t;O(""),null==(r=Y.current)||r.focus(),(0,el.F0)(e)&&(null==(t=e.response)?void 0:t.status)===409?Q("Your request to join this group has already been sent."):Q("Something went wrong, please try again.")}})},[W,j,B]),H=(0,h.useCallback)(e=>{switch(e.key){case"Escape":W();break;case"Enter":k&&V(k)}},[W,V,k]);return n||!F?null:L.length?(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsxs)("div",{className:"mt-4 flex justify-between p-2",children:[(0,s.jsx)("div",{className:"flex  items-center",children:(0,s.jsx)(a.A,{onClick:()=>{console.log("clicked"),I(!0)},children:"Join Group By Coupon"})}),(0,s.jsxs)("div",{className:"flex items-center justify-center",children:[(0,s.jsx)("div",{className:"mr-2",children:"Show groups in"}),(0,s.jsxs)("select",{className:"select select-bordered",value:M,onChange:e=>_(e.target.value),children:[(0,s.jsx)("option",{value:"all",children:"Show All"}),null==b?void 0:b.map(e=>(0,s.jsx)("option",{value:e.id,children:e.title},e.id))]})]})]}),N&&(0,s.jsx)(C.A,{open:!!(null==N?void 0:N.groupPurpose),onClose:()=>A(void 0),title:"Purpose of  ".concat(null==N?void 0:N.groupName),children:null==N?void 0:N.groupPurpose}),(0,s.jsx)(f.A,{sections:[{header:"Groups",data:L,color:"primary-blue"}],columns:["title"],actions:[{render:e=>(e=>U(e)&&e.isPrivate?(0,s.jsx)("span",{className:"badge h-6 bg-purple-3 text-white ",children:"Private"}):K&&K.some(r=>r.groupId===(null==e?void 0:e.id))?(0,s.jsx)("span",{className:"badge badge-error h-6 bg-purple-4 text-white ",children:"Request sent"}):e.isPrivate?(0,s.jsx)("span",{className:"badge h-6 bg-purple-3 text-white ",children:"Private"}):(0,s.jsx)("span",{className:"hidden"}))(e)},{label:"Purpose",onClick:async e=>{var r;A({groupName:e.title,groupPurpose:null!=(r=null==e?void 0:e.groupPurpose)?r:""})}},{label:"Join",color:"dark-blue",onClick:e=>V(e),getProps:e=>({disabled:U(e)})}]}),(0,s.jsx)(C.A,{open:!!T,onClose:()=>W(),title:"".concat(null==k?void 0:k.title," is a Private Group"),actions:k&&E&&E.memberId&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.A,{onClick:()=>Z(E,k),children:"Request to Join"}),(0,s.jsx)("div",{className:"grow"}),(0,s.jsx)(a.A,{onClick:()=>V(k),color:"dark-blue",children:"Join"})]}),children:(0,s.jsxs)("div",{className:"form-control w-full",children:[(0,s.jsx)("label",{className:"label",children:(0,s.jsx)("span",{className:"label-text",children:"Enter Group Code"})}),(0,s.jsx)("label",{className:"input-group",children:(0,s.jsx)("input",{type:"password",className:"input input-bordered w-full",value:q,ref:Y,onChange:e=>O(e.target.value),onKeyDown:H})}),D&&(0,s.jsx)("div",{className:"alert h-20 bg-secondary text-white",children:D})]})}),(0,s.jsx)(C.A,{open:P,onClose:()=>I(!1),title:"Join Group By Coupon",children:(0,s.jsxs)("div",{className:"form-control w-full",children:[(0,s.jsx)("label",{className:"label",children:(0,s.jsx)("span",{className:"label-text",children:"Enter Coupon Code"})}),(0,s.jsx)("input",{className:"input input-bordered shrink bg-white",placeholder:"Enter your co
1de here",value:d,onChange:e=>u(e.target.value)}),m&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-2 rounded bg-header-blue px-6 py-4 text-white",children:[(0,s.jsxs)("p",{className:"text-lg font-bold",children:["Group Name: ",null==m||null==(e=m.group)?void 0:e.title]}),(0,s.jsxs)("p",{className:"text-sm text-yellow-400",children:[(0,s.jsxs)("span",{className:"font-semibold text-yellow-500",children:["Provided By Member:"," "]}),null==m||null==(r=m.member)?void 0:r.name]})]}),((null==l?void 0:l.groupCreated.some(e=>{var r;return e.id===(null==(r=m.group)?void 0:r.id)}))||(null==l?void 0:l.groupJoined.some(e=>{var r;return e.id===(null==(r=m.group)?void 0:r.id)})))&&(0,s.jsx)("div",{className:"p-2 text-xs font-semibold text-red-500",children:"You have already joined this group"})]}),(0,s.jsx)("div",{children:!!g&&(0,s.jsx)("div",{className:"p-2 text-xs font-semibold text-red-500",children:"Invalid Coupon Code"})}),(0,s.jsxs)("div",{className:"mt-4 flex justify-end",children:[(0,s.jsx)(a.A,{onClick:()=>I(!1),children:"Cancel"}),m?(0,s.jsx)(a.A,{href:"",className:"ml-2 flex h-[46px] w-[150px] items-center justify-center text-center ",disabled:(null==l?void 0:l.groupCreated.some(e=>{var r;return e.id===(null==(r=m.group)?void 0:r.id)}))||(null==l?void 0:l.groupJoined.some(e=>{var r;return e.id===(null==(r=m.group)?void 0:r.id)})),onClick:()=>{var e;v({groupId:null==(e=m.group)?void 0:e.id,privateCode:d},{onSuccess:()=>{I(!1),R.Ay.success("Group joined")}})},children:"Join"}):(0,s.jsx)(a.A,{href:"",className:"ml-2 flex h-[46px] w-[150px] items-center justify-center text-center",disabled:!d,onClick:async()=>{await p()},color:"primary",children:x?(0,s.jsx)(G.A,{}):"Apply Code "})]})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-4  flex  justify-between p-2",children:[(0,s.jsx)("div",{className:"flex  items-center",children:(0,s.jsx)(a.A,{onClick:()=>{console.log("clicked"),I(!0)},children:"Join Group By Coupon"})}),(0,s.jsxs)("div",{className:"flex items-center justify-center",children:[(0,s.jsx)("div",{className:"mr-2",children:"Show groups in"}),(0,s.jsxs)("select",{className:"select select-bordered",value:M,onChange:e=>_(e.target.value),children:[(0,s.jsx)("option",{value:"all",children:"Show All"}),null==b?void 0:b.map(e=>(0,s.jsx)("option",{value:e.id,children:e.title},e.id))]})]})]}),(0,s.jsx)("div",{className:"p-3",children:"No Groups to show."}),(0,s.jsx)(C.A,{open:P,onClose:()=>I(!1),title:"Join Group By Coupon",children:(0,s.jsxs)("div",{className:"form-control w-full",children:[(0,s.jsx)("label",{className:"label",children:(0,s.jsx)("span",{className:"label-text",children:"Enter Coupon Code"})}),(0,s.jsx)("input",{className:"input input-bordered shrink bg-white",placeholder:"Enter your code here",value:d,onChange:e=>u(e.target.value)}),m&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-2 rounded bg-header-blue px-6 py-4 text-white",children:[(0,s.jsxs)("p",{className:"text-lg font-bold",children:["Group Name: ",null==m||null==(t=m.group)?void 0:t.title]}),(0,s.jsxs)("p",{className:"text-sm text-yellow-400",children:[(0,s.jsxs)("span",{className:"font-semibold text-yellow-500",children:["Provided By Member:"," "]}),null==m||null==(o=m.member)?void 0:o.name]})]}),((null==l?void 0:l.groupCreated.some(e=>{var r;return e.id===(null==(r=m.group)?void 0:r.id)}))||(null==l?void 0:l.groupJoined.some(e=>{var r;return e.id===(null==(r=m.group)?void 0:r.id)})))&&(0,s.jsx)("div",{className:"p-2 text-xs font-semibold text-red-500",children:"You have already joined this group"})]}),(0,s.jsx)("div",{children:!!g&&(0,s.jsx)("div",{className:"p-2 text-xs font-semibold text-red-500",children:"Invalid Coupon Code"})}),(0,s.jsxs)("div",{className:"mt-4 flex justify-end",children:[(0,s.jsx)(a.A,{onClick:()=>I(!1),children:"Cancel"}),m?(0,s.jsx)(a.A,{href:"",className:"ml-2 flex h-[46px] w-[150px] items-center justify-center text-center ",disabled:(null==l?void 0:l.groupCreated.some(e=>{var r;return e.id===(null==(r=m.group)?void 0:r.id)}))||(null==l?void 0:l.groupJoined.some(e=>{var r;return e.id===(null==(r=m.group)?void 0:r.id)})),onClick:()=>{var e;v({groupId:null==(e=m.group)?void 0:e.id,privateCode:d},{onSuccess:()=>{I(!1),R.Ay.success("Group joined")}})},children:"Join"}):(0,s.jsx)(a.A,{href:"",className:"ml-2 flex h-[46px] w-[150px] items-center justify-center text-center",disabled:!d,onClick:async()=>{await p()},color:"primary",children:x?(0,s.jsx)(G.A,{}):"Apply Code "})]})]})})]})}let ec={id:"AU00123",name:"Downer EDI",who:"Businesses that supply goods and services to Downer EDI",purpose:"Downer is subject to mandatory climate reporting requirements and has targets in place to reduce emissions as part of its sustainability commitment. Downer is supported by many suppliers. Suppliers create carbon emissions in providing goods and services to Downer. Downer is required to report on these carbon emissions. These emissions also need to be reduced overtime.  "},eu=()=>{let[e,r]=(0,h.useState)(!1),[]=(0,h.useState)(!1),{data:t}=(0,K.e)("compliance"),{user:i}=(0,S.A)(),{data:n}=(0,V.t)(null==i?void 0:i.memberId);return(0,s.jsxs)(l.A,{title:"Groups",acl:{role:"member",memberType:["BCAP"]},children:[(0,s.jsx)(er.A,{}),(0,s.jsx)(o.A,{children:(0,s.jsx)(j.A,{paths:[{name:"Carbonhalo Groups",path:"/groups"}]})}),(0,s.jsx)(et.A,{title:"Carbonhalo Groups",className:"bg-groups"}),(0,s.jsx)(o.A,{children:(0,s.jsx)(y.A,{title:(0,s.jsx)("div",{className:"flex w-[1026px] flex-row items-center",children:(0,s.jsx)("div",{children:"What are Groups"})}),leftTitleClassName:"text-bg-header-blue",color:"primary",children:(0,s.jsxs)("div",{className:"bg-green-3 p-4",children:[(0,s.jsx)("p",{className:"mb-2",children:"Our group reports combine the action plans of group members together for a shared impact story. Create your own group/s in minutes and invite like-minded businesses to develop their decarbonisation action plan with Carbonhalo. Join groups that relate to your business."}),(0,s.jsxs)("p",{className:"mb-2",children:["Groups can be public (anyone can join) or private (requires a password to join)."," ",(0,s.jsx)("span",{className:"font-bold",children:"Become a climate leader today"})," ","by creating a group for your industry association, value chain or local business community. Or join an existing group to add your impact to their shared program."]})]})})}),(0,s.jsxs)(o.A,{className:"flex flex-col gap-5",children:[(0,s.jsx)(y.A,{expand:!0,color:"primary",title:"My Groups",rightToggleClassName:"hidden",children:(0,s.jsx)(ee,{})}),(0,s.jsx)(y.A,{color:"primary",title:t?(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{children:"Join a Community Group"}),(0,s.jsx)("div",{className:"text-sm font-normal",children:"Link your action plan to a Group relevant to you to supp
1ort that Group’s efforts to build collective impact"})]}):"Join a Group",children:(0,s.jsx)(ed,{})}),(null==n?void 0:n.folder)!=="terc"&&(0,s.jsx)(y.A,{color:"primary",title:t?(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{children:"Create a Community Group"}),(0,s.jsx)("div",{className:"text-sm font-normal",children:"Become a climate leader and create a Group to accelerate emission reduction in your community/s"})]}):"Create a Group",expand:e,onExpand:e=>r(e),children:(0,s.jsx)(b,{onCreated:()=>r(!1)})})]}),t&&(0,s.jsxs)(o.A,{children:[(0,s.jsx)(y.A,{color:"primary",title:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{children:"Join a Supplier Group"}),(0,s.jsx)("div",{className:"w-[700px] text-sm font-normal",children:"Submit your action plan and scope 1 and 2 emissions data to comply with procurement and/or reporting needs of your customers"})]}),containerClassName:"mt-5",children:(0,s.jsxs)("div",{className:"mb-[100px] grid",style:{gridTemplateColumns:"30% 1fr"},children:[(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Group ID"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsx)("input",{className:"input input-bordered w-full",value:ec.id})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Group Name"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:ec.name}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Group Password"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsx)("input",{className:"input input-bordered w-full",type:"password",value:"hello"})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Who Group is For"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:ec.who}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Group Purpose"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:ec.purpose}),(0,s.jsx)("div",{className:"bg-grey-2 p-2"}),(0,s.jsxs)("div",{className:"flex bg-grey-1 p-2",children:[(0,s.jsx)(a.A,{children:"Request to Join"}),(0,s.jsx)("div",{className:"grow"}),(0,s.jsx)(a.A,{children:"Join"})]})]})}),(0,s.jsx)(y.A,{color:"primary",title:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{children:"Create a Supplier Group"}),(0,s.jsx)("div",{className:"w-[700px] text-sm font-normal",children:"Create a compliance group to collect emissions data from suppliers to support your procurement policies and/or climate reporting needs"})]}),containerClassName:"mt-5",children:(0,s.jsxs)("div",{className:"mb-[100px] grid",style:{gridTemplateColumns:"30% 1fr"},children:[(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Group Name"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsx)("input",{className:"input input-bordered w-full",value:ec.name})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Who Group is For"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsx)("input",{className:"input input-bordered w-full",value:ec.who})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Group Purpose"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsx)("textarea",{className:"input input-bordered h-[100px] w-full",value:ec.purpose})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"What supplier data is required"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsxs)("div",{className:"grid w-[400px] grid-cols-2 gap-2",children:[(0,s.jsx)("div",{children:"Scope 1 Emissions"}),(0,s.jsx)("div",{children:(0,s.jsx)("input",{type:"checkbox",className:"checkbox",checked:!0})}),(0,s.jsx)("div",{children:"Scope 2 Emissions"}),(0,s.jsx)("div",{children:(0,s.jsx)("input",{type:"checkbox",className:"checkbox",checked:!0})}),(0,s.jsx)("div",{children:"Scope 3 Emissions"}),(0,s.jsx)("div",{children:(0,s.jsx)("input",{type:"checkbox",className:"checkbox"})}),(0,s.jsxs)("div",{children:["% Relating to ",ec.name]}),(0,s.jsx)("div",{children:(0,s.jsx)("input",{type:"checkbox",className:"checkbox",checked:!0})}),(0,s.jsx)("div",{children:"Emission Reduction Plan"}),(0,s.jsx)("div",{children:(0,s.jsx)("input",{type:"checkbox",className:"checkbox",checked:!0})})]})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Date required by"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsx)("input",{className:"input input-bordered w-full",type:"date",value:"2024-03-31"})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Do you require Carbonhalo to help engage suppliers to comply with your group needs?"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsxs)("select",{className:"input input-bordered w-[200px]",children:[(0,s.jsx)("option",{value:"yes",children:"Yes"}),(0,s.jsx)("option",{value:"no",children:"No"})]})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Group Password"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsx)("input",{className:"input input-bordered w-full",type:"password",value:"123456-abcdef"})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2",children:"Link to your Compliance Group"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2",children:(0,s.jsx)("a",{href:"",className:"link",children:ec.name})}),(0,s.jsx)("div",{className:"bg-grey-2 p-2"}),(0,s.jsx)("div",{className:"bg-grey-1 p-2 pr-2 text-right",children:(0,s.jsx)(a.A,{children:"Create Group"})})]})})]}),(null==n?void 0:n.folder)==="terc"&&(0,s.jsx)(o.A,{children:(0,s.jsxs)("div",{className:"rounded bg-secondary-soft-light p-4",children:["Interested in forming a group? Email us the purpose of your group at",(0,s.jsx)("a",{href:"mailto:[email protected]",children:" [email protected] "}),", and we'll assist you in setting it up.",(0,s.jsx)("br",{})," Let's create meaningful connections together!"," "]})})]})}},49119:(e,r,t)=>{"use strict";t.d(r,{D6:()=>f,Dm:()=>v,Ir:()=>P,Si:()=>y,UY:()=>G,fp:()=>A,zf:()=>w});var s=t(83350),o=t(42252),l=t(60513),i=t(69744),n=t(11642),a=t(64839);
1let d=i.Cy,c=l.z.array(i.Cy),u=l.z.object({financialYear:n.OQ,target1:n.OQ,target2:n.OQ,target3:n.OQ,target4:n.OQ,target5:n.OQ}).optional(),p=l.z.object({groupTarget:u,achievedTarget:u}).optional();l.z.object({groupId:l.z.string().optional()});let m=l.z.object({groupOptionPurpose:l.z.string().optional()});l.z.object({groupId:l.z.string().optional(),year:l.z.number().optional()});let g=l.z.object({id:l.z.string(),code:l.z.string(),legalName:n.Ay,tradingAs:n.Ay}),h=l.z.array(g);l.z.object({couponId:l.z.string()});let x=async()=>{let{data:e}=await s.protectedApiCaller.get("/groups");return c.parse(e)},v=()=>(0,o.I)({queryKey:["allGroups"],queryFn:x}),b=async e=>{let{groupId:r}=e,{data:t}=await s.protectedApiCaller.get("/groups/".concat(r));return d.parse(t)},y=e=>{let{groupId:r}=e;return(0,o.I)({queryKey:["GroupsById",r],queryFn:()=>b({groupId:r}),enabled:!!r})},j=async e=>{let{groupId:r}=e,{data:t}=await s.protectedApiCaller.get("/group/".concat(r,"/purpose"));return m.parse(t)},f=e=>{let{groupId:r}=e;return(0,o.I)({queryKey:["groupPurpose",r],queryFn:()=>j({groupId:r}),enabled:!!r})},N=async()=>{let{data:e}=await s.protectedApiCaller.get("/groups/admin");return c.parse(e)},w=()=>(0,o.I)({queryKey:["allGroupForAdmin"],queryFn:N}),C=async e=>{let{groupId:r,year:t}=e,{data:o}=await s.protectedApiCaller.get("/groups/".concat(r,"/").concat(t,"/targets/admin"));return p.parse(o)},A=e=>{let{groupId:r,year:t}=e;return(0,o.I)({queryKey:["groupTargetsForAdmin",r,t],queryFn:()=>C({groupId:r,year:t}),enabled:!!r})},k=async e=>{let{couponId:r}=e,{data:t}=await s.protectedApiCaller.get("/members/coupon/".concat(r,"/admin"));return h.parse(t)},G=e=>{let{couponId:r}=e;return(0,o.I)({queryKey:["allCouponMembersForAdmin",r],queryFn:()=>k({couponId:r}),enabled:!!r})},z=async e=>{if(!e)return null;let{data:r}=await s.protectedApiCaller.get("/groups/".concat(e,"/members/admin")),t=a.kA.array().safeParse(r);return t.success?t.data:[]},P=e=>(0,o.I)({queryKey:["allGroupMembersForAdmin",e],queryFn:()=>z(e)})},69744:(e,r,t)=>{"use strict";t.d(r,{Cy:()=>i,JF:()=>u,dB:()=>a});var s=t(83350),o=t(42252),l=t(60513);let i=l.z.object({id:l.z.string(),title:l.z.string(),groupPurpose:l.z.string().optional(),systemGroup:l.z.boolean(),isPrivate:l.z.boolean().optional(),memberCount:l.z.number().optional(),groupMembershipPeriod:l.z.number().optional(),headerMessage:l.z.string().optional(),welcomeTemplateId:l.z.string().optional(),ownerId:l.z.string(),reportingStateId:l.z.string().optional(),membersCount:l.z.number().optional(),newMemberEmailTemplateId:l.z.string().optional(),existingMemberEmailTemplateId:l.z.string().optional(),planReviewerId:l.z.string().optional(),programManagerId:l.z.string().optional()});l.z.object({id:l.z.string()});let n=async e=>{if(!e)return null;let{data:r}=await s.protectedApiCaller.get("/groups/".concat(e));return i.parse(r)},a=e=>(0,o.I)({queryKey:["group",e],queryFn:()=>n(e)}),d=l.z.object({title:l.z.string()}),c=async e=>{if(!e)return null;let{data:r}=await s.protectedApiCaller.get("/groups/".concat(e,"/title"));return d.parse(r).title},u=e=>(0,o.I)({retry:!1,queryKey:["group",e],queryFn:()=>c(e)})},94009:(e,r,t)=>{"use strict";t.d(r,{A:()=>o});var s=t(37876);let o=e=>{let{title:r,subtitle:t,className:o}=e;return(0,s.jsx)("div",{className:"mx-auto mt-1 w-284 rounded-lg border-2 border-solid border-primary-green bg-tag-green bg-no-repeat px-2 font-semibold ".concat(o," "),style:{backgroundSize:40,backgroundPosition:"-50px"},children:(0,s.jsx)("div",{className:"container m-auto my-2 flex w-full max-w-screen-lg items-start overflow-hidden",children:(0,s.jsxs)("div",{className:"flex grow items-end gap-3 py-2",children:[(0,s.jsx)("div",{className:"text-2xl",children:r}),(0,s.jsx)("div",{className:"mb-[1px] opacity-80",children:t})]})})})}},94141:(e,r,t)=>{"use strict";t.d(r,{Y:()=>d});var s=t(83350),o=t(11642),l=t(42252),i=t(60513);let n=i.z.object({coupon:i.z.object({id:i.z.string(),descriptions:i.z.object({bcap:i.z.string().optional(),"bcap-plus":i.z.string().optional(),"bcap-advanced":i.z.string().optional()}),couponPlan:o.Ay,kind:i.z.enum(["stripe","group","default"])}),member:i.z.object({id:i.z.string(),name:i.z.string()}),group:i.z.object({id:i.z.string(),title:i.z.string(),privateCode:i.z.string().optional()}).optional()});i.z.object({privateCode:i.z.string().optional(),couponId:i.z.string().optional()});let a=async e=>{if(!e)return;let{data:r}=await s.publicApiCaller.get("/coupon/".concat(e));return n.parse(r)},d=e=>(0,l.I)({cacheTime:0,enabled:!1,retry:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,queryKey:["coupon",e],queryFn:()=>a(e)})}},e=>{e.O(0,[4440,3755,6587,3509,4925,5414,1462,9899,5032,3548,4690,5280,8024,9133,5730,2624,6455,374,636,6593,8792],()=>e(e.s=11332)),_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.