1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6980],{81024:(e,t,a)=>{a.d(t,{A:()=>o});var l=a(95155),r=a(85233);a(12115);let o=e=>{let{classes:t,onClick:a,icon:o,children:i}=e;return(0,l.jsxs)("div",{onClick:a,className:(0,r.zP)("flex w-full cursor-pointer items-center gap-2 rounded-full border border-heading bg-transparent px-4 py-1.5 text-sm text-heading hover:bg-custom-gradient hover:text-white",t),children:[o&&(0,l.jsx)("span",{className:"",children:o}),(0,l.jsx)("span",{children:i})]})}},23602:(e,t,a)=>{a.d(t,{x:()=>r});var l=a(95155);let r=()=>(0,l.jsxs)("div",{role:"status mx-auto w-fit",children:[(0,l.jsxs)("svg",{"aria-hidden":"true",className:"dark:text-heading_ligth mr-2 size-16 animate-spin fill-heading text-gray-200",fill:"none",viewBox:"0 0 100 101",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),(0,l.jsx)("span",{className:"sr-only",children:"Loading..."})]})},26136:(e,t,a)=>{a.d(t,{X:()=>h});var l=a(95155),r=a(73373),o=a(27930),i=a(12685),n=a(20984),s=a(5293),d=a(12115),u=a(11536),c=a(83391),m=a(26009);let p=Object.values(n.tB),v=Object.values(n.g9),h=()=>{let e=(0,c.d4)(e=>e.app.homeMainCampaign),t=(0,c.wA)(),[a,h]=(0,d.useState)(null),[g,b]=(0,d.useState)(!1),[x,w]=(0,d.useState)(!1),[f,y]=(0,d.useState)(""),C=(0,d.useMemo)(()=>{var t,l;return(null==e?void 0:null===(l=e.impact_rules)||void 0===l?void 0:null===(t=l.filter(e=>{var t,l;return(null==e?void 0:null===(t=e.donationType)||void 0===t?void 0:t.toLowerCase())===(null==a?void 0:null===(l=a.iteration)||void 0===l?void 0:l.toLowerCase())}))||void 0===t?void 0:t.map(e=>({name:String(e.upperPriceRange),value:String(e.upperPriceRange)})))||[]},[e,null==a?void 0:a.iteration]),N=(0,d.useMemo)(()=>{if(!(null==e?void 0:e.impact_rules))return;let t=x?Number(f):Number(null==a?void 0:a.amount);return e.impact_rules.filter(e=>{var t,l;return(null===(t=e.donationType)||void 0===t?void 0:t.toLowerCase())===(null==a?void 0:null===(l=a.iteration)||void 0===l?void 0:l.toLowerCase())}).find(e=>t&&Number(t)>e.lowerPriceRange&&Number(t)<=e.upperPriceRange)},[e,null==a?void 0:a.iteration,null==a?void 0:a.amount,x,f]);(0,d.useEffect)(()=>{if(e&&!a){var t,l;let a=(null===(l=e.impact_rules)||void 0===l?void 0:null===(t=l.filter(e=>{var t;return(null==e?void 0:null===(t=e.donationType)||void 0===t?void 0:t.toLowerCase())===p[0].toLowerCase()}))||void 0===t?void 0:t.map(e=>({name:String(e.upperPriceRange),value:String(e.upperPriceRange)})))||[];h({currency:s.tT.currency,symbol:s.tT.symbol,donationType:n.g9.Charitable,iteration:p[0],amount:a.length>0?Number(a[0].value):0,item:e,itemType:"campaign",quantity:1,description:""})}},[e]),(0,d.useEffect)(()=>{a&&N&&h(e=>e?{...e,description:((null==N?void 0:N.preText)||"")+" "+((null==N?void 0:N.impactValue)?null==N?void 0:N.impactValue:"")+" "+((null==N?void 0:N.postText)||"")}:e)},[N]);let j=(e,t)=>{"amount"===e&&x?y(String(t)):h(a=>a?{...a,[e]:t}:a)};if(!a)return null;let k=x?Number(f):Number(a.amount),T=k&&k>0;return(0,l.jsxs)("div",{className:"bg-gradient-to-br from-[#250833] to-[#1a0524] px-4 py-12 sm:px-6 lg:px-12",children:[(0,l.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,l.jsxs)("div",{className:"mb-8 text-center",children:[(0,l.jsx)("h2",{className:"text-4xl font-bold text-white lg:text-6xl",children:"Qu
1ick Donate"}),(0,l.jsx)("p",{className:"mt-2 text-lg text-gray-300",children:"Make a difference in seconds"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 items-center gap-4 lg:grid-cols-5 lg:gap-6",children:[(0,l.jsxs)("div",{className:"lg:col-span-1",children:[(0,l.jsx)("label",{className:"mb-2 block text-sm font-medium text-gray-300",children:"Donation Type"}),(0,l.jsx)(o.A,{value:a.donationType,options:v.map(e=>({name:String(e),value:String(e)})),onChange:e=>j("donationType",e),className:"w-full",innerClasses:"bg-white/10 backdrop-blur-sm border-white/20 text-white hover:bg-white/20 transition-colors",dropdownClasses:"bg-white/95 backdrop-blur-sm border border-gray-200"})]}),(0,l.jsxs)("div",{className:"lg:col-span-1",children:[(0,l.jsx)("label",{className:"mb-2 block text-sm font-medium text-gray-300",children:"Frequency"}),(0,l.jsx)(o.A,{options:p.map(e=>({name:String(e),value:String(e)})),value:a.iteration,onChange:t=>{var a,l;w(!1),y(""),h(e=>e?{...e,iteration:t}:e);let r=(null==e?void 0:null===(l=e.impact_rules)||void 0===l?void 0:null===(a=l.filter(e=>{var a;return(null==e?void 0:null===(a=e.donationType)||void 0===a?void 0:a.toLowerCase())===t.toLowerCase()}))||void 0===a?void 0:a.map(e=>({name:String(e.upperPriceRange),value:String(e.upperPriceRange)})))||[];r.length>0&&h(e=>e?{...e,amount:Number(r[0].value)}:e)},className:"w-full",innerClasses:"bg-white/10 backdrop-blur-sm border-white/20 text-white hover:bg-white/20 transition-colors",dropdownClasses:"bg-white/95 backdrop-blur-sm border border-gray-200"})]}),(0,l.jsxs)("div",{className:"lg:col-span-2",children:[(0,l.jsx)("label",{className:"mb-2 block text-sm font-medium text-gray-300",children:"Amount"}),x?(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(u.vWH,{className:"absolute left-4 top-1/2 -translate-y-1/2 transform text-white/70"}),(0,l.jsx)("input",{type:"number",inputMode:"decimal",placeholder:"Enter your amount...",className:"w-full rounded-full border border-white/20 bg-white/10 px-12 py-3 text-white placeholder-white/50 outline-none transition-all focus:border-white/40 focus:bg-white/20",value:f,onChange:e=>{y(e.target.value)},min:"0",step:"0.01"}),(0,l.jsx)("button",{onClick:()=>w(!1),className:"absolute right-4 top-1/2 -translate-y-1/2 transform text-white/70 transition-colors hover:text-white",children:"\xd7"})]}):(0,l.jsx)("div",{className:"flex gap-2",children:(0,l.jsx)(o.A,{value:String(a.amount),options:[...C,{name:"Custom Amount",value:"custom"}],onChange:e=>{"custom"===e?(w(!0),y("")):(w(!1),j("amount",Number(e)))},className:"flex-1",innerClasses:"bg-white/10 backdrop-blur-sm border-white/20 text-white hover:bg-white/20 transition-colors",dropdownClasses:"bg-white/95 backdrop-blur-sm border border-gray-200"},"".concat(a.iteration,"-").concat(a.amount))})]}),(0,l.jsxs)("div",{className:"lg:col-span-1",children:[(0,l.jsx)("label",{className:"mb-2 block text-sm font-medium text-gray-300 opacity-0",children:"Action"}),(0,l.jsx)(r.A,{text:"Donate Now",disabled:!T,onClick:()=>{var l;if(!a||!e)return;let r=x?Number(f):Number(a.amount);r&&!(r<=0)&&(t((0,i.B5)({item:e,currency:a.currency,symbol:(null===(l=s.q_.find(e=>{var t,l;return(null==e?void 0:null===(t=e.currency)||void 0===t?void 0:t.toLowerCase())===(null==a?void 0:null===(l=a.currency)||void 0===l?void 0:l.toLowerCase())}))||void 0===l?void 0:l.symbol)||s.tT.symbol,donationType:a.donationType,iteration:a.iteration,itemType:"campaign",quantity:1,amount:r,description:((null==N?void 0:N.preText)||"")+" "+((null==N?void 0:N.impactValue)?null==N?void 0:N.impactValue:"")+" "+((null==N?void 0:N.postText)||"")})),b(!0))},rightIcon:(0,l.jsx)(u.Z0P,{className:"size-5"}),className:"w-full rounded-full bg-gradient-to-r from-purple-600 to-pink-600 px-6 py-3 font-semibold text-white shadow-lg transition-all duration-300 hover:scale-105 hover:from-purple-700 hover:to-pink-700 hover:shadow-xl disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100"})]})]}),N&&T&&(0,l.jsx)("div",{className:"mt-6 rounded-lg bg-white/10 p-4 backdrop-blur-sm",children:(0,l.jsxs)("p",{className:"text-center text-white",children:[(0,l.jsx)("span",{className:"font-semibold",children:"Your impact:"})," ",N.preText," ",N.impactValue," ",N.postText]})})]}),(0,l.jsx)(m.Z,{isOpen:g,onClose:()=>b(!1)})]})}},71447:(e,t,a)=>{a.d(t,{w:()=>r});var l=a(89208);let r=async e=>{let{method:t,path:a,data:r,contentType:o="application/json",query:i}
1=e,n=i?"?".concat(new URLSearchParams(i).toString()):"",s="".concat("https://api.ilmuk.org").concat(a).concat(n),d=l.A.get("accessToken"),u={method:t,headers:{Authorization:d?"".concat(d):"","Content-Type":o},cache:"no-store",...r&&{body:"application/json"===o?JSON.stringify(r):r}};try{let e=await fetch(s,u),t=await e.json();if(null==t?void 0:t.error)throw t;return t}catch(e){throw console.error("Error fetching data:",e),e}}}}]);
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.