1"use strict";(self.webpackChunkapp_react_swatch=self.webpackChunkapp_react_swatch||[]).push([[8241],{6811:(e,t,a)=>{a.d(t,{A:()=>r});const r=e=>{let t=e.category;return React.createElement("span",{className:"inline-block rounded-[4px] px-2 pt-1 text-[12px] leading-[21px] font-bold uppercase bg-[var(--activity-color)] text-black mr-3 rtl:mr-0 rtl:ml-3"},t)}},8241:(e,t,a)=>{a.r(t),a.d(t,{default:()=>y});var r=a(6540),l=a(824),c=a(1129),n=a(876),o=a(8850),s=a(4164),i=a(3325),d=a(6811);const m=e=>{let t=e.activity,a=e.location;const r=(0,o.tq)().static.labels;return React.createElement("div",{className:"flex flex-col gap-3"},t.activityDate&&React.createElement("div",{className:"flex items-center"},React.createElement(c.I,{slug:"CalendarBooked",className:"w-4 h-4 shrink-0"}),React.createElement("span",{className:"ml-2.5 text-[14px]"},t.activityDate)),t.activityTime&&React.createElement("div",{className:"flex items-center"},React.createElement(c.I,{slug:"WatchVolunteer",className:"w-4 h-4 shrink-0"}),React.createElement("span",{className:"ml-2.5 text-[14px]"},t.activityTime)),a&&React.createElement("div",{className:"flex items-center"},React.createElement(c.I,{slug:"LocationLoyalty",className:"w-4 h-5 shrink-0"}),React.createElement("span",{className:"ml-2.5 text-[14px]"},a)),void 0!==t.spotsLeft&&React.createElement("div",{className:"flex items-center"},React.createElement(c.I,{slug:"User",className:"w-[15px] ml-[1px] h-[14px] shrink-0"}),React.createElement("span",{className:"ml-2.5 text-[14px]"},t.spotsLeft," ",r.LOYALTY.VOLUNTEERING_SPOTS_LEFT)))};var p=a(8955),u=a(501);function b(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,r)}return a}function x(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?b(Object(a),!0).forEach(function(t){E(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):b(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function E(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,l,c,n,o=[],s=!0,i=!1;try{if(c=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;s=!1}else for(;!(s=(r=c.call(a)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){i=!0,l=e}finally{try{if(!s&&null!=a.return&&(n=a.return(),Object(n)!==n))return}finally{if(i)throw l}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?R(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}const N=e=>{let t=e.activity,a=e.location,l=e.isOpen,n=e.setIsOpen,i=e.mode,b=e.projectId,E=e.isRegistered;const R=(0,o.Ky)(),N=(0,o.tq)().static,v=N.labels,g=N.urls,L=f((0,r.useState)({isLoading:!1,error:!1,alreadyRegistered:!1}),2),h=L[0],O=L[1],y=f((0,r.useState)(!1),2),A=y[0],T=y[1],w=f((0,r.useState)({step:null,isLoading:!1,error:!1,contactSwatchError:!1}),2),k=w[0],I=w[1],Y=e=>{e?I(e=>x(x({},e),{},{step:"success",isLoading:!1})):T(!0)},C=(e,t)=>{setTimeout(()=>{R.getContentByUrl(g.DATA_FETCH.LOYALTY_DETAILS).then(a=>{const r=a.data.loyaltyData;r&&R.setState(r,"loyaltyData"),t||Y(e)}).catch(a=>{console.error("Failed to load loyalty info:",a),t||Y(e)})},2e3)},S=()=>{h.isLoading||h.alreadyRegistered||(O(e=>x(x({},e),{},{isLoading:!0})),R.submitFormJson(g.ACTION.LOYALTY_REGISTER_VOLUNTEER,{activityId:t.
1id,registrationId:t.registration.registrationId,projectId:b}).then(e=>{const t=(null==e?void 0:e.data)||{},a=t.error,r=t.data;a?null!=r&&r.alreadyRegistered?O(e=>x(x({},e),{},{alreadyRegistered:!0})):null!=r&&r.activityFull?C(!1,!0):O(e=>x(x({},e),{},{error:!0})):C()}).catch(e=>{console.error("Failed to register for volunteer activity:",e),O(e=>x(x({},e),{},{error:!0}))}))};return React.createElement(p.a,{static:!0,isOpen:l,onClose:()=>n(!1),size:"medium",closeButton:!0,wrapperClassName:(0,s.A)("!max-h-none !h-[100vh] desktop:!h-auto desktop:!max-h-[calc(100vh-190px)]",{"!h-auto":"success"===k.step}),className:(0,s.A)("!max-w-none desktop:!w-[588px] !max-h-[100vh] desktop:!max-h-[calc(100vh-80px)] items-center bg-white p-3 !static desktop:!fixed transform-none desktop:-translate-x-1/2 desktop:-translate-y-1/2 rounded-none desktop:rounded-[10px]",{"!absolute !-translate-x-1/2 !-translate-y-1/2 !w-[calc(100vw-40px)] desktop:!w-[588px]":"success"===k.step,"!w-auto":"success"!==k.step})},React.createElement("div",{className:"pt-2"},A?React.createElement("div",null,React.createElement("h3",{"data-test-id":"srfg-booking-confirmed",className:"mb-5 text-[19px] desktop:text-[24px] font-bold items-center"},React.createElement(c.I,{slug:"CheckGreen",className:"h-[75px] w-[75px] mb-10 desktop:!mb-5 block mx-auto"}),v.LOYALTY.BOOKING_CONFIRMATION),React.createElement("div",{className:"text-[16px] mb-10 desktop:!mb-6"},v.LOYALTY.BOOKING_CONFIRMATION_MESSAGE),React.createElement("div",{className:"text-[24px] rounded-[5px] border-[5px] border-solid border-[var(--activity-color)] p-6",style:{"--activity-color":t.colorCode}},t.title&&React.createElement("div",{className:"mb-5 font-bold text-[19px] desktop:text-[24px]"},t.title),t.activityDate&&React.createElement("div",{className:"flex items-center pl-1 mb-3"},React.createElement(c.I,{slug:"CalendarBooked",className:"w-4 h-4 shrink-0"}),React.createElement("span",{className:"text-[12px] ml-2.5"},t.activityDate)),t.activityTime&&React.createElement("div",{className:"flex items-center pl-1 mb-3"},React.createElement(c.I,{slug:"WatchVolunteer",className:"w-4 h-4 shrink-0"}),React.createElement("span",{className:"text-[12px] ml-2.5"},t.activityTime)),a&&React.createElement("div",{className:"flex items-center pl-1"},React.createElement(c.I,{slug:"LocationLoyalty",className:"w-[14px] shrink-0 ml-[1px]"}),React.createElement("span",{className:"text-[12px] ml-2.5"},a))),React.createElement("div",{className:"mt-5 flex justify-center border-solid border-cart-border border-t-[1px]"},React.createElement("button",{"data-test-id":"srfg-event-add-to-calendar",onClick:()=>(0,u.ky)(t),className:"mt-2.5 underline text-base"},v.LOYALTY.ADD_TO_CALENDAR))):"confirm"===k.step?React.createElement("div",null,React.createElement("h3",{"data-test-id":"srfg-booking-confirmed",className:"mb-5 text-[19px] desktop:text-[24px] font-bold items-center"},React.createElement(c.I,{slug:"RedCancel",className:"h-[75px] w-[75px] mb-10 desktop:!mb-5 block mx-auto"}),v.LOYALTY.CANCEL_BOOKING_TITLE),React.createElement("p",{className:"mb-10 text-[16px] desktop:!mb-6"},v.LOYALTY.CANCEL_BOOKING_CONFIRMATION),React.createElement("div",{className:"text-[24px] rounded-[5px] border-[5px] border-solid border-[var(--activity-color)] p-6",style:{"--activity-color":t.colorCode}},React.createElement("p",{className:"mb-4 text-[19px] desktop:text-[24px] font-bold"},t.title),t.activityDate&&React.createElement("div",{className:"flex pl-1 mb-3 items-center"},React.createElement(c.I,{slug:"CalendarBooked",className:"h-4 w-4 shrink-0"}),React.createElement("span",{className:"text-[12px] ml-2.5"},t.activityDate)),t.activityTime&&React.createElement("div",{className:"flex pl-1 mb-3 items-center "},React.createElement(c.I,{slug:"WatchVolunteer",className:"h-4 w-4 shrink-0"}),React.createElement("span",{className:"ml-2.5 text-[12px] "},t.activityTime)),a&&React.createElement("div",{className:"flex pl-1 items-center"},React.createElement(c.I,{slug:"LocationLoyalty",className:"shrink-0 ml-[1px] w-[14px] "}),React.createElement("span",{className:"ml-2.5 text-[12px]"},a))),k.error&&React.createElement("div",{className:"mb-6 text-[14px] text-red"},v.LOYALTY.BOOKING_ERROR_MESSAGE),React.createElement("div",{className:"mt-6 mobile:flex-col flex justify-between mb-[140px] desktop:mb-0"},React.createElement("button",{onClick:()=>n(!1),className:"!h-[40px] w-full rounded-[5px] border border-solid border-black bg-white text-sm font-bold text-black desktop:w-[calc(50%-8px)] hover:scale-[1.05] transition duration-300 mobile:mt-2.5 mobile:order-1"},v.LOYALTY.CLOSE),React.createElement("button",{onClick:()=>
1{if(k.isLoading)return;let e=!1;I(e=>x(x({},e),{},{isLoading:!0,error:!1})),R.submitFormJson(g.ACTION.LOYALTY_UNREGISTER_VOLUNTEER,{registrationId:t.registration.registrationId}).then(t=>{const a=(null==t?void 0:t.data)||{},r=a.error,l=a.data;r?null!=l&&l.contactSwatch?I(e=>x(x({},e),{},{step:null,contactSwatchError:!0})):I(e=>x(x({},e),{},{error:!0})):(e=!0,C(!0))}).catch(e=>{console.error("Failed to cancel volunteer activity:",e),I(e=>x(x({},e),{},{error:!0}))}).finally(()=>{e||I(e=>x(x({},e),{},{isLoading:!1}))})},disabled:k.isLoading,className:(0,s.A)("!h-[40px] w-full rounded-[5px] px-6 text-[14px] font-bold text-white desktop:w-[calc(50%-8px)]",{"pointer-events-none bg-inactive-grey":k.isLoading,"bg-red hover:scale-[1.05] transition duration-300":!k.isLoading})},v.LOYALTY.CONFIRM_CANCELLATION))):"success"===k.step?React.createElement("div",null,React.createElement("h2",{className:"mb-4 text-[24px] font-bold"},v.LOYALTY.PARTICIPATION_CANCELLED_TITLE),React.createElement("p",{className:"mb-6 text-[16px]"},v.LOYALTY.PARTICIPATION_CANCELLED_MESSAGE),React.createElement("div",{className:"border-t border-solid border-[#e0e0e0] pt-4 text-center"},React.createElement("button",{onClick:()=>n(!1),className:"text-sm underline"},v.LOYALTY.BACK_TO_DASHBOARD))):React.createElement(React.Fragment,null,React.createElement("div",{className:"rounded-[5px] p-6 border-[5px] border-[var(--activity-color)]",style:{"--activity-color":t.colorCode}},React.createElement("div",{className:"mb-4 flex items-center justify-between"},t.category&&React.createElement(d.A,{category:t.category}),void 0!==t.minutesAwarded&&React.createElement("span",{className:"ml-auto font-bold items-center gap-2 rounded-[4px] border border-black px-2 pt-[3px] text-[12px] leading-5 uppercase text-black line-clamp-1 break-all"},"+",v.LOYALTY.REMAINING_MINUTES.replace("{0}",String(t.minutesAwarded)))),React.createElement("h3",{className:"mb-4 text-[19px] desktop:text-[24px] font-bold"},t.title),React.createElement(m,{activity:t,location:a})),t.description&&React.createElement("div",null,React.createElement("h3",{className:"mb-4 mt-6 text-[19px] font-bold"},v.LOYALTY.EVENT_DETAILS_HEADING),React.createElement("div",{className:"mb-6 min-h-6 text-sm"},t.description)),h.alreadyRegistered&&React.createElement("div",{className:"mb-6 flex items-start gap-2 rounded-[5px] border border-solid border-[#e0e0e0] p-3 text-[14px]"},React.createElement(c.I,{slug:"Info",className:"h-5 w-5 shrink-0 mt-0.5"}),React.createElement("span",null,v.LOYALTY.VOLUNTEERING_ALREADY_REGISTERED_MESSAGE," ",React.createElement("a",{href:g.ACTION.LOYALTY_CUSTOMER_SERVICE,className:"font-bold underline"},v.LOYALTY.CONTACT_US),".")),h.error&&React.createElement("div",{className:"mb-6 text-[14px] text-red"},v.LOYALTY.BOOKING_ERROR_MESSAGE),k.contactSwatchError&&React.createElement("div",{className:"mb-6 flex items-start gap-2 rounded-[5px] border border-solid border-[#e0e0e0] p-3 text-[14px]"},React.createElement(c.I,{slug:"Info",className:"h-5 w-5 shrink-0 mt-0.5"}),React.createElement("span",null,v.LOYALTY.CANCEL_BOOKING_CONTACT_SWATCH_ERROR," ",React.createElement("a",{href:g.ACTION.LOYALTY_CUSTOMER_SERVICE,className:"font-bold underline"},v.LOYALTY.CONTACT_US),".")),"details"===i&&t.isUserEligibleForVolunteering&&(t.isBooked||E)&&!t.isUnregistrationPossible&&React.createElement("div",{className:"mb-6 flex items-start gap-2 rounded-[5px] border border-solid border-[#e0e0e0] p-3 text-[14px]"},React.createElement(c.I,{slug:"Info",className:"h-5 w-5 shrink-0 mt-0.5"}),React.createElement("span",null,v.LOYALTY.CANNOT_UNREGISTER_MESSAGE," ",React.createElement("a",{href:g.ACTION.LOYALTY_CUSTOMER_SERVICE,className:"font-bold underline"},v.LOYALTY.CUSTOMER_SUPPORT_FORM),".")),"details"===i&&t.isUserEligibleForVolunteering&&(!t.isBooked||!E)&&!t.canRegisterMoreActivities&&React.createElement("div",{className:"mb-6 flex items-start gap-2 rounded-[5px] border border-solid border-[#e0e0e0] p-3 text-[14px]"},React.createElement(c.I,{slug:"Info",className:"h-5 w-5 shrink-0 mt-0.5"}),React.createElement("span",null,v.LOYALTY.MAX_VOTING_LIMIT_REACHED_MESSAGE," ",React.createElement("a",{href:g.ACTION.LOYALTY_CUSTOMER_SERVICE,className:"font-bold underline"},v.LOYALTY.CONTACT_US)," ",v.LOYALTY.ASSISTANCE_MESSAGE)),(()=>{if("book"===i||"details"===i&&t.isUserEligibleForVolunteering&&!t.isBooked&&!t.canRegisterMoreActivities)return React.createElement("div",{className:"mt-6 mobile:flex-col flex justify-between mb-[86px] desktop:mb-0"},React.createElement("button",{onClick:()=>n(!1),className:"!h-[40px] w-full rounded-[5px] border border-solid border-black bg-white text-sm font-bold text-black hover:scale-[1.05] transition duration-300 desktop:w-[calc(50%-8px)] mobile:mt-2.5 mobile:order-1"},v.LOYALTY.CANCEL),React.createElement("button",{onClick:S,disabled:h.isLoading||h.alreadyRegistered||!t.canRegisterMoreActivities,className:(0,s.A)("!h-[40px] w-full rounded-[5px] text-[14px] font-bold text-white desktop:w-[calc(50%-8px)]",{"pointer-events-none bg-inactive-grey":h.isLoading||h.alreadyRegistered||!t.canRegisterMoreActivities,"bg-black hover:scale-[1.05] transition duration-300":!h.isLoading&&!h.alreadyRegistered&&t.canRegisterMoreActivities})},t.isSoldOut?v.LOYALTY.SOLD_OUT:v.LOYALTY.BOOK));if(t.isUserEligibleForVolunteering){const e=t.isBooked||E;if(e&&t.isUnregistrationPossible)return React.createElement("div",{className:"mt-6 mobile:flex-col flex justify-between mb-[140px] desktop:mb-0"},React.createElement("button",{onClick:()=>n(!1),className:"!h-[40px] w-full rounded-[5px] border border-solid border-black hover:scale-[1.05] transition duration-300 bg-white text-sm font-bold text-black desktop:w-[calc(50%-8px)] mobile-land:w-[calc(50%-8px)] mobile:mt-2.5 mobile:order-1"},v.LOYALTY.CANCEL),React.createElement("button",{onClick:()=>I(e=>x(x({},e),{},{step:"confirm"})),disabled:k.contactSwatchError,className:(0,s.A)("!h-[40px] w-full rounded-[5px] px-6 text-[14px] font-bold text-white desktop:w-[calc(50%-8px)] mobile-land:w-[calc(50%-8px)]",{"pointer-events-none bg-inactive-grey":k.contactSwatchError,"bg-red hover:scale-[1.05] transition duration-300":!k.contactSwatchError})},v.LOYALTY.CANCEL_BOOKING));if(e&&!t.isUnregistrationPossible)return React.createElement("div",{className:"mt-6 mobile:flex-col flex justify-between mb-[140px] desktop:mb-0"},React.createElement("button",{onClick:()=>n(!1),className:"!h-[40px] w-full rounded-[5px] border border-solid border-black bg-white text-sm font-bold text-black desktop:w-[calc(50%-8px)] mobile:mt-2.5 hover:scale-[1.05] transition duration-300 mobile:order-1 "},v.LOYALTY.CANCEL),React.createElement("button",{onClick:()=>window.open(g.ACTION.LOYALTY_CUSTOMER_SERVICE,"_blank","noopener,noreferrer"),className:"!h-[40px] w-full rounded-[5px] bg-black px-6 text-[14px] font-bold text-white transition duration-300 hover:scale-[1.05] desktop:w-[calc(50%-8px)]"},v.LOYALTY.CONTACT_US));if(t.isSoldOut)return React.createElement("div",{className:"mt-6 mobile:flex-col flex justify-between mb-[140px] desktop:mb-0"},React.createElement("button",{onClick:()=>n(!1),className:"!h-[40px] w-full rounded-[5px] border border-solid border-black hover:scale-[1.05] transition duration-300 bg-white text-sm font-bold text-black desktop:w-[calc(50%-8px)] mobile:mt-2.5 mobile:order-1"},v.LOYALTY.CANCEL),React.createElement("button",{className:"!h-[40px] w-full rounded-[5px] pointer-events-none !bg-inactive-grey px-6 text-[14px] font-bold text-white transition duration-300 hover:scale-[1.05] desktop:w-[calc(50%-8px)]",disabled:!0},v.LOYALTY.SOLD_OUT))}return null})())))};function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,l,c,n,o=[],s=!0,i=!1;try{if(c=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;s=!1}else for(;!(s=(r=c.call(a)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){i=!0,l=e}
1finally{try{if(!s&&null!=a.return&&(n=a.return(),Object(n)!==n))return}finally{if(i)throw l}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}const L=e=>{let t=e.activity,a=e.location,l=e.projectId,n=e.isVisible,s=e.maxTitlesHeight;const i=(0,o.tq)().static.labels,p=v((0,r.useState)(t),2),u=p[0],b=p[1],x=u.registration.isRegistered,E=v((0,r.useState)(null),2),f=E[0],R=E[1],g=Number.isFinite(u.minutesAwarded)?i.LOYALTY.REMAINING_MINUTES.replace("{0}",String(u.minutesAwarded)):"",L=u.isUserEligibleForVolunteering,h=u.canRegisterMoreActivities,O=null!=u.spotsLeft&&u.spotsLeft>0;let y="book";L?!x&&O&&h||(y="details"):y="locked";const A=(0,r.useCallback)(()=>R("book"),[]),T=(0,r.useCallback)(()=>R("details"),[]),w=(0,r.useCallback)(e=>{e||R(null)},[]);(0,r.useEffect)(()=>{b(t)},[t]);let k=null;x?k=React.createElement("span",{className:"ml-auto font-bold items-center gap-2 rounded-[4px] border border-black px-2 pt-[3px] text-[12px] leading-5 uppercase text-black line-clamp-1 break-all"},React.createElement(c.I,{slug:"Check",className:"h-3 w-3 text-green-500 relative top-[-1px] shrink-0 mr-[6px]"}),i.LOYALTY.VOLUNTEERING_ACTIVITY_BOOKED):u.isSoldOut?k=React.createElement("span",{className:"ml-auto rounded-[4px] border border-black px-2 pt-[7px] pb-1 text-[12px] font-bold uppercase text-black"},i.LOYALTY.SOLD_OUT):void 0!==u.minutesAwarded&&(k=React.createElement("span",{className:"ml-auto font-bold items-center gap-2 rounded-[4px] border border-black px-2 pt-[3px] text-[12px] leading-5 uppercase text-black line-clamp-1 break-all",title:"+".concat(g)},"+",g));const I={"--activity-color":u.colorCode};return React.createElement("div",{className:"flex h-full flex-col rounded-[10px] border border-cart-border bg-white p-5 shadow-[1.5px_3px_4px_rgba(0,0,0,0.2)]",style:I},React.createElement("div",{className:"mb-4 flex items-center"},u.category&&React.createElement(d.A,{category:u.category}),k),React.createElement("h4",{className:"mb-4 text-[16px] font-bold leading-[24px] m-project-title",style:{height:"".concat(s,"px")}},u.title),React.createElement("div",{className:"mb-2 flex grow flex-col"},React.createElement(m,{activity:u,location:a})),"book"===y&&React.createElement("button",{onClick:A,className:"mt-2 flex w-full items-center justify-center rounded-[5px] bg-black px-6 py-3 text-[14px] font-bold text-white transition duration-300 hover:scale-[1.05] mb-[-10px]",tabIndex:n?0:-1},i.LOYALTY.BOOK),"locked"===y&&React.createElement("button",{disabled:!0,className:"mt-4 flex w-full items-center justify-center rounded-[5px] px-6 py-3 text-[14px] font-bold text-white pointer-events-none !bg-product-border transition duration-300 mb-[-10px]",tabIndex:n?0:-1},React.createElement(c.I,{slug:"Lock",className:"mr-2 h-4 w-4"}),i.LOYALTY.VOTING_MEMBERS_ONLY),"details"===y&&React.createElement("div",{className:"mt-2 flex justify-center border-t-[1px] border-solid border-cart-border"},React.createElement("button",{onClick:T,className:"mt-2.5 text-[14px] underline",tabIndex:n?0:-1},i.LOYALTY.SEE_DETAILS)),null!==f&&React.createElement(N,{isOpen:null!==f,setIsOpen:w,activity:u,location:a,mode:f,projectId:l,isRegistered:x}))};function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,l,c,n,o=[],s=!0,i=!1;try{if(c=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;s=!1}else for(;!(s=(r=c.call(a)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){i=!0,l=e}finally{try{if(!s&&null!=a.return&&(n=a.return(),Object(n)!==n))return}finally{if(i)throw l}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return O(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?O(e,t):void 0}}
1(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}const y=e=>{var t,a,d;let m=e.volunteeringData;const p=(0,o.tq)().static.labels,u=h((0,r.useState)(0),2),b=u[0],x=u[1],E=h((0,r.useState)(m),2),f=E[0],R=E[1],N=f.project,v=f.volunteerActivities,g=[null==N||null===(t=N.address)||void 0===t?void 0:t.street,null==N||null===(a=N.address)||void 0===a?void 0:a.city,null==N||null===(d=N.address)||void 0===d?void 0:d.country].filter(Boolean).join(", "),O=v.length>0&&v[0].isUserEligibleForVolunteering,y=O?p.LOYALTY.VOLUNTEERING_TITLE_ELIGIBLE:p.LOYALTY.VOLUNTEERING_TITLE_INELIGIBLE,A=O?p.LOYALTY.VOLUNTEERING_SUBTITLE_ELIGIBLE:p.LOYALTY.VOLUNTEERING_SUBTITLE_INELIGIBLE;return(0,r.useEffect)(()=>{R(m)},[m]),React.createElement("div",{className:"mb-[25px] mt-8 desktop:mb-8 tablet:mb-8"},React.createElement("div",{className:"flex flex-col gap-5 xl:flex-row"},React.createElement("div",{className:"flex m-1 shrink-0 flex-col justify-between overflow-hidden rounded-[8px] xl:w-[345px] w-full",style:{boxShadow:"-8px 8px 0px ".concat(N.colorCode),outline:"4px solid ".concat(N.colorCode),outlineOffset:"-1px"}},React.createElement("div",null,React.createElement("div",{className:"relative"},N.image&&React.createElement(n.A,{src:N.image,alt:N.name,height:"889",width:"863",addClass:"h-[262px] w-full object-cover"}),React.createElement("div",{className:"absolute left-5 top-5"},React.createElement(c.I,{slug:"WinnerBadge",colorCode:N.colorCode,label:p.LOYALTY.WINNER,className:"w-[100px] desktop:w-[166px] shrink-0"}))),React.createElement("div",{className:"flex flex-col gap-5 px-[15px] pb-[15px]"},React.createElement("h3",{className:"mt-4 text-[19px] font-bold"},N.name),React.createElement("div",{className:"flex flex-col gap-5"},N.ambassador&&React.createElement("div",{className:"flex items-center gap-2.5"},N.ambassadorImage&&React.createElement(n.A,{src:N.ambassadorImage,alt:N.ambassador,height:"20",width:"20",addClass:"h-5 w-5 shrink-0 rounded-full"}),React.createElement("span",{className:"text-[14px]"},React.createElement("span",null,N.ambassador))),g&&React.createElement("div",{className:"flex items-center gap-[14px]"},React.createElement(c.I,{slug:"LocationLoyalty",className:"w-[14px] shrink-0 ml-[3px]"}),React.createElement("span",{className:"text-[14px]"},React.createElement("span",null,g)))))),N.redirectUrl&&React.createElement("div",{className:"mb-[25px] border-t-[1px] border-cart-border pt-3 text-center"},React.createElement("a",{href:N.redirectUrl,className:"text-[14px] underline"},p.LOYALTY.LEARN_MORE))),React.createElement("div",{className:"min-w-0 flex-1 xl:w-auto xl:rounded-[10px] xl:static xl:left-auto p-5 xl:p-8 relative left-[-20px] rounded-none w-[calc(100%+40px)]",style:{backgroundColor:N.colorCode,"--vol-nav-bg":N.colorCode}},React.createElement("div",{className:"mb-5"},y&&React.createElement("h3",{className:"mb-2.5 text-[19px] desktop:text-[24px] font-bold"},y),A&&React.createElement("p",{className:"text-[16px]"},A)),React.createElement("div",{className:"m-react-slider"},React.createElement(l.A,{slidesPerView:3,slidesPerGroup:1,navigation:!0,pagination:!0,afterInit:e=>{if(null!=e&&e.destroyed)return;let t=0;const a=e.slides;null==a||a.forEach(e=>{const a=e.querySelector(".m-project-title");a&&(a.style.height="auto",a.clientHeight>t&&(t=a.clientHeight))}),t>0&&x(t)},breakpoints:{320:{slidesPerView:1.2,spaceBetween:20,slidesPerGroup:1},740:{slidesPerView:2.6,spaceBetween:20,slidesPerGroup:1},1200:{slidesPerView:2,spaceBetween:10,slidesPerGroup:2},1366:{slidesPerView:3,spaceBetween:10,slidesPerGroup:3}},className:(0,s.A)({"m-hide-arrows desktop:!px-0":v.length<=3,"desktop:!px-12":v.length>3},"!pb-6 [&_.swiper-wrapper]:!h-auto mobile:!overflow-visible [&_.swiper-button-prev]:![background-color:var(--vol-nav-bg)] [&_.swiper-button-next]:![background-color:var(--vol-nav-bg)]")},v.map(e=>React.createElement(i.qr,{key:e.id,className:"!visible [&>*]:visible p-0 !h-auto"},t=>{let a=t.isVisible;return React.createElement(L,{maxTitlesHeight:b,activity:e,location:e.location||g,projectId:N.id,isVisible:a})})))))))}}}]);
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.