"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1538],{m0Nu:function(e,t,a){a.d(t,{Os:function(){return m},Ti:function(){return c},Zn:function(){return d},eD:function(){return u}});var n=a("Kh6r"),r=a("ysjU"),o=a("TD78"),l=a("m+Kt"),i=a("NBFx"),s=a("qe1T");let c={[s.P.GOOD]:{color:"green",valueColorIndex:7,statusColorIndex:6,borderStartColorIndex:2,borderEndColorIndex:8,informationIcon:n.Z},[s.P.MODERATE]:{color:"yellow",valueColorIndex:6,statusColorIndex:5,borderStartColorIndex:2,borderEndColorIndex:6,informationIcon:r.Z},[s.P.UNHEALTHY_FOR_SENSITIVE]:{color:"yellow",valueColorIndex:9,statusColorIndex:9,borderStartColorIndex:5,borderEndColorIndex:9,informationIcon:o.Z},[s.P.UNHEALTHY]:{color:"red",valueColorIndex:7,statusColorIndex:6,borderStartColorIndex:3,borderEndColorIndex:6,informationIcon:o.Z},[s.P.VERY_UNHEALTHY]:{color:"violet",valueColorIndex:8,statusColorIndex:7,borderStartColorIndex:4,borderEndColorIndex:8,informationIcon:l.Z},[s.P.HAZARDOUS]:{color:"redViolet",valueColorIndex:9,statusColorIndex:8,borderStartColorIndex:5,borderEndColorIndex:9,informationIcon:i.Z}},d="currentLocation",u="airPopulation.getLocation",m={md:240,sm:200}},vKIh:function(e,t,a){a.d(t,{Z:function(){return em}});var n=a("BGKE"),r=a("q1tI"),o=a("Eso5"),l=a("kfjY"),i=a("dDsW"),s=a("a5vB"),c=a("QW8v"),d=a("/npG"),u=(0,d.k)((e,t)=>{let{backgroundColor:a}=t;return{root:{},inner:{position:"relative",minHeight:260,".error-screen":{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",backgroundColor:a},".chart-screen":{position:"relative",zIndex:0}},icon:{flexShrink:0},errorScreenRoot:{[e.fn.smallerThan("sm")]:{justifyContent:"space-evenly"}}}});let m=(0,r.createContext)({});var p=a("vCEM"),h=a("VkaC"),g=a("rQtb"),f=a("OAL+"),x=(0,d.k)(e=>({root:{},info:{[e.fn.largerThan("sm")]:{alignItems:"flex-start"}},colLeft:{[e.fn.smallerThan("sm")]:{order:2,textAlign:"center"},[e.fn.largerThan("sm")]:{display:"flex",alignItems:"center"}},colRight:{display:"flex",justifyContent:"center",alignItems:"center"}})),v=a("m0Nu"),C=(0,d.k)((e,t)=>{let{size:a,backgroundColor:n}=t;return{root:{display:"flex",gap:24,backgroundColor:n,'button[data-variant="secondary"]':{borderColor:e.colors.gray[2]},[e.fn.smallerThan("sm")]:{gap:16,flexDirection:"column"}},colLeft:{[e.fn.largerThan("sm")]:{order:2}},colRight:{[e.fn.largerThan("sm")]:{width:v.Os[a],flexShrink:0,order:1}},locator:{display:"flex",flexDirection:"column",gap:2}}});let Layout=e=>{let{colLeft:t,colRight:a,styles:l,classNames:i,className:s,...c}=e,{size:d,backgroundColor:u}=(0,r.useContext)(m),{classes:p,cx:h}=C({size:d,backgroundColor:u},{name:"AirPopulation__Layout",styles:l,classNames:i});return(0,n.BX)(o.x,{...c,className:h(s,p.root),children:[(0,n.tZ)(o.x,{className:p.colLeft,children:t}),(0,n.tZ)(o.x,{className:p.colRight,children:a})]})},ErrorScreenGeneral=e=>{let{styles:t,classNames:a,...r}=e,{retryFetchInitData:o}=(0,c.W)(e=>({retryFetchInitData:e.retryFetchInitData}),s.X),{formatMessage:l}=(0,i.Z)(),{classes:d}=x(void 0,{name:"AirPopulation__ErrorScreenGeneral",styles:t,classNames:a});return(0,n.tZ)(Layout,{...r,classNames:{root:d.root,colLeft:d.colLeft,colRight:d.colRight},colLeft:(0,n.BX)(f.K,{spacing:16,className:d.info,children:[(0,n.tZ)(h.T,{size:"h3",children:l({id:"airPopulation.notFound.title",defaultMessage:"Opps!"})}),(0,n.tZ)(h.T,{size:"p2",variant:"secondary",children:l({id:"airPopulation.notFound.description",defaultMessage:"We couldn’t load the Air Pollution Tool right now. Please try again later or refresh the page."})}),(0,n.tZ)(g.B,{size:"lg",variant:"secondary",onClick:o,"data-event-category":"AQI","data-event-action":"retry AQI display","data-event-label":"click to retry",children:l({id:"airPopulation.retryButton.label"})})]}),colRight:(0,n.tZ)("img",{loading:"lazy",alt:"Result not found",width:120,height:120,src:p.C.getAssetPath("airPopulation/not-found.svg")})})};var Z=(0,d.k)(e=>({root:{},info:{[e.fn.largerThan("sm")]:{alignItems:"flex-start"}},selector:{[e.fn.smallerThan("sm")]:{alignItems:"center"}},desc:{[e.fn.smallerThan("sm")]:{textAlign:"center"}},colLeft:{[e.fn.largerThan("sm")]:{display:"flex",alignItems:"center"}},colRight:{display:"flex",justifyContent:"center",alignItems:"center"}})),b=a("Jy0G"),y=a("1Hbx"),w=a("IEKS"),N=a("0D4Z"),k=a("t/pd"),I=a("ChHM"),B=a("hXNO"),T=(0,d.k)(e=>({root:{position:"relative"},locator:{},locatorValue:{position:"relative",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:4,".loading-icon":{padding:8,svg:{width:16,height:16}}},selectTarget:{position:"absolute",left:0,bottom:0,right:0,[e.fn.smallerThan("sm")]:{left:"50%",right:"auto"}}})),S=a("9aQb"),A=a("VZtU"),L=a("fEsb"),_=a("vaps"),R=a("SPK5"),E=a("Dmus"),D=a("mYVa"),X=(0,d.k)(e=>({root:{display:"flex",flexDirection:"column",gap:8,background:"#fff",border:"1px solid ".concat(e.colors.gray[1]),padding:4,borderRadius:12,width:254,boxShadow:"0px 0px 1px 0px #0000000A, 0px 2px 8px 0px #0000000A, 0px 10px 16px 0px #0000000A",[e.fn.smallerThan("sm")]:{transform:"translateX(-50%)"}},input:{input:{paddingLeft:40}},inputWrapper:{position:"relative"},searchIcon:{position:"absolute",top:10,left:16},item:{padding:"".concat((0,D.h)(8)," ").concat((0,D.h)(12)),transition:"background .2s ease",cursor:"pointer",'&[data-is-current-loc="true"]':{position:"relative",marginBottom:16,"&:before":{position:"absolute",top:"calc(100% + 8px)",left:0,right:0,content:'""',borderBottom:"1px solid ".concat(e.colors.neutral[1])}},'&[data-selected="true"]':{cursor:"default"},'&[data-selected="true"],&:hover':{backgroundColor:e.colors.gray[1],borderRadius:8}}}));let Select=e=>{let{selectedItem:t,data:a=[],onClickItem:l,styles:s,classNames:c}=e,{formatMessage:d}=(0,i.Z)(),{classes:u,theme:m}=X(void 0,{name:"AirPopulation__Select",styles:s,classNames:c}),[p,g]=(0,r.useState)(""),f=(0,r.useMemo)(()=>{let e=(0,E.bG)(p),t=a.filter(t=>t.value===v.Zn||(0,E.bG)(t.label).includes((0,E.bG)(e)));return t.length>0?t:a},[p]);return(0,n.BX)(o.x,{className:u.root,children:[(0,n.BX)(o.x,{className:u.inputWrapper,children:[(0,n.tZ)(S.I,{className:u.input,value:p,onChange:g,placeholder:d({id:"airPopulation.locationSelector.placeholder",defaultMessage:"Search for city"}),"data-event-category":"AQI","data-event-action":"search AQI location","data-event-label":p}),(0,n.tZ)(A.Z,{size:20,color:m.colors.gray[3],className:u.searchIcon})]}),(0,n.tZ)(_.x.Autosize,{mah:320,type:"auto",scrollbarSize:6,children:f.map((e,a)=>{let r=t===e.label;return(0,n.BX)(R.k,{"data-is-current-loc":e.isUseCurrentLocation,"data-selected":r,className:u.item,align:"center",gap:8,onClick:()=>!r&&l(e.value),"data-event-category":"AQI","data-event-action":"choose AQI location","data-event-label":e.label,children:[e.isUseCurrentLocation?(0,n.tZ)(w.Z,{}):(0,n.tZ)(L.Z,{}),(0,n.tZ)(h.T,{size:"p2",children:e.label})]},String(a))})})]})},LocationSelector=e=>{let{styles:t,classNames:a}=e,{formatMessage:d}=(0,i.Z)(),{data:u,selectedValue:p,setSelectedValue:g,loading:f,firstLoading:x,selectorZIndex:C,onChangeValue:Z}=(0,r.useContext)(m),{listProvinces:S}=(0,c.W)(e=>({listProvinces:e.listProvinces||[]}),s.X),A=(0,r.useMemo)(()=>[{label:d({id:v.eD}),value:v.Zn,isUseCurrentLocation:!0,icon:w.Z},...(S||[]).map(e=>({label:e,value:e}))],[S]),[L,_]=(0,r.useState)(!1),[R,E]=(0,r.useState)(),D=(0,I.O)(()=>_(!1)),{classes:X}=T(void 0,{name:"AirPopulation__LocationSelector",styles:t,classNames:a}),F=(0,r.useRef)(null),z=(0,B.d)();return(0,r.useEffect)(()=>{if(F.current){let e=F.current.getBoundingClientRect();E({top:e.bottom+window.scrollY,left:e.left+window.scrollX,width:e.width})}},[x]),(0,r.useEffect)(()=>{if(u&&F.current){let e=F.current.getBoundingClientRect();E({top:e.bottom+window.scrollY,left:e.left+window.scrollX,width:e.width})}},[u]),(0,r.useEffect)(()=>{_(!1)},[z]),(0,n.tZ)(o.x,{className:X.root,children:x?(0,n.tZ)(N.O,{height:24,radius:4,width:140}):(0,n.BX)(o.x,{className:X.locator,children:[(0,n.BX)(o.x,{className:X.locatorValue,onClick:()=>{if(!f){if(F.current){let e=F.current.getBoundingClientRect();E({top:e.bottom+window.scrollY,left:e.left+window.scrollX,width:e.width})}_(!0)}},children:[(0,n.tZ)(h.T,{size:"h3",variant:"secondary",children:p===v.Zn?d({id:v.eD}):p}),f?(0,n.tZ)(b.L,{hideText:!0,className:"loading-icon"}):(0,n.tZ)(y.Z,{size:22,color:"#111111",style:{transform:"rotate(".concat(L?"180deg":0,")")}})]}),(0,n.tZ)(o.x,{"data-target":!0,className:X.selectTarget,ref:F}),(0,n.tZ)(k.h,{children:(0,n.tZ)(l.u,{mounted:!!(L&&R),transition:"fade",children:e=>(0,n.tZ)(o.x,{ref:D,sx:{position:"absolute",top:null==R?void 0:R.top,left:null==R?void 0:R.left,width:null==R?void 0:R.width,borderRadius:8,zIndex:C,...e},children:(0,n.tZ)(Select,{selectedItem:p||"",data:A,onClickItem:e=>{var t,a;g(null===(a=A.filter(t=>t.value===e))||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.label),_(!1),null==Z||Z(e)}})})})})]})})},ErrorScreenNotFoundResult=e=>{let{styles:t,classNames:a,message:r,...o}=e,{formatMessage:l}=(0,i.Z)(),{classes:s}=Z(void 0,{name:"AirPopulation__ErrorScreenNotFoundResult",styles:t,classNames:a});return(0,n.tZ)(Layout,{...o,classNames:{root:s.root,colLeft:s.colLeft,colRight:s.colRight},colLeft:(0,n.BX)(f.K,{spacing:16,className:s.info,children:[(0,n.BX)(f.K,{spacing:2,className:s.selector,children:[(0,n.tZ)(LocationSelector,{}),(0,n.tZ)(h.T,{size:"p3",variant:"error",children:l({id:"airPopulation.notFoundResult.error",defaultMessage:"Please reselect location"})})]}),(0,n.tZ)(h.T,{size:"p2",variant:"secondary",className:s.desc,children:r||l({id:"airPopulation.notFoundResult.description",defaultMessage:"Looks like there was an issue with your selected location. Try selecting it again!"})})]}),colRight:(0,n.tZ)("img",{loading:"lazy",alt:"Result not found",width:120,height:120,src:p.C.getAssetPath("airPopulation/result-not-found.svg")})})};var F=(0,d.k)(e=>({info:{display:"flex",flexDirection:"column",gap:16,[e.fn.largerThan("sm")]:{position:"absolute",top:"20%",left:0,bottom:0}},locator:{display:"flex",flexDirection:"column",gap:2,[e.fn.smallerThan("sm")]:{alignItems:"stretch",textAlign:"center"}},colLeft:{position:"relative",[e.fn.smallerThan("sm")]:{zIndex:2},[e.fn.largerThan("sm")]:{width:"100%"}},colRight:{paddingBottom:20,[e.fn.largerThan("sm")]:{}},infoColLeft:{[e.fn.smallerThan("sm")]:{display:"none"}},infoColRight:{[e.fn.largerThan("sm")]:{display:"none"}},chart:{display:"flex",flexDirection:"column",gap:24,[e.fn.smallerThan("sm")]:{alignItems:"center",gap:32}}})),z=a("+Hg+"),M=a("AeFk");let P=(0,M.F4)({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}});var H=(0,d.k)((e,t)=>{var a,n,r,o,l;let{color:i,borderStartColorIndex:s,borderEndColorIndex:c,statusColorIndex:d,valueColorIndex:u,endCircleAngle:m,gapAngleLeft:p,circleAngle:h,firstLoading:g,size:f,borderOutsideColor:x,backgroundChartColor:C}=t,Z=null===(a=e.colors[i])||void 0===a?void 0:a[s],b=null===(n=e.colors[i])||void 0===n?void 0:n[c],y=null===(r=e.colors[i])||void 0===r?void 0:r[d],w=null===(o=e.colors[i])||void 0===o?void 0:o[u],N={display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"50%"},k=v.Os[f];return{root:{position:"relative",borderRadius:"50%",width:k,height:k,backgroundColor:x,...g&&{overflow:"hidden"}},border:{...N,width:k,height:"".concat(k,"px"),position:"relative",background:"conic-gradient(\n from 180deg,\n ".concat(C," 0deg ").concat(p,"deg,\n ").concat(x," ").concat(p,"deg,\n ").concat(x," ").concat(m,"deg,\n ").concat(C," ").concat(m,"deg ").concat(h,"deg\n )"),"&:before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,inset:0,borderRadius:"inherit",background:"conic-gradient(\n from 180deg,\n transparent 0deg ".concat(p,"deg,\n ").concat(Z," ").concat(p,"deg,\n ").concat(b," var(--deg),\n transparent var(--deg) ").concat(m,"deg,\n transparent ").concat(m,"deg ").concat(h,"deg\n )"),...g&&{animation:"".concat(P," 2s linear infinite"),opacity:.5}}},borderWhite:{...N,width:k-6,height:k-6,backgroundColor:"#fff",zIndex:1},background:{...N,width:"100%",height:"100%",position:"relative","&:before":{content:'""',position:"absolute",top:6,left:6,width:k-18,height:k-18,background:g?e.colors.neutral[0]:null===(l=e.colors[i])||void 0===l?void 0:l[0],opacity:.5,borderRadius:"inherit"}},mainCircle:{...N,position:"relative",flexDirection:"column",width:k-68,height:k-68,backgroundColor:"#fff",boxShadow:"5px 7px 20px ".concat(w,"1F,\n 21px 30px 37px ").concat(w,"1A,\n 48px 67px 50px ").concat(w,"0F"),transition:"all .3s ease",...g&&{boxShadow:"5px 6px 8px ".concat(e.colors.gray[7],"1F,\n 8px 9px 10px ").concat(e.colors.gray[7],"1A,\n 10px 12px 14px ").concat(e.colors.gray[7],"0F")}},label:{},value:{fontSize:(0,D.h)("sm"===f?56:64),lineHeight:(0,D.h)(64),fontWeight:"sm"===f?z.F.halfBold:z.F.semiBold,color:w,marginTop:-10},status:{lineHeight:"".concat((0,D.h)(20)," !important"),color:"#fff"},tagArea:{position:"absolute",top:"calc(100% - 26px)",left:0,right:0,zIndex:1,display:"flex",justifyContent:"center",textAlign:"center"},tag:{backgroundColor:y,borderRadius:20,padding:"".concat((0,D.h)("sm"===f?3:4)," ").concat((0,D.h)(16)," ").concat((0,D.h)("sm"===f?5:4)),minHeight:"sm"===f?28:32,display:"flex",alignItems:"center",justifyContent:"center",transition:"all .3s ease",opacity:g?0:1}}});a("Vg41");let W=(0,r.memo)(e=>{let{data:t}=(0,r.useContext)(m),{currentAqiusValue:l=0}=t||{},i=(0,r.useRef)(null),s=(0,r.useRef)(null),[c,d]=(0,r.useState)(null),u=(0,r.useRef)(0);return(0,r.useEffect)(()=>{Promise.all([a.e(2138),a.e(9467),a.e(4467),a.e(6966),a.e(5243),a.e(8132),a.e(1375),a.e(4561),a.e(1448),a.e(5465),a.e(1217),a.e(5480),a.e(731),a.e(2050),a.e(2008),a.e(8469),a.e(8214),a.e(1482),a.e(6817),a.e(467),a.e(5951),a.e(9357),a.e(747),a.e(5675),a.e(6753),a.e(4802),a.e(3046),a.e(5745),a.e(3437),a.e(252),a.e(6839),a.e(9424),a.e(5702),a.e(8922),a.e(6399),a.e(553),a.e(2902),a.e(4969),a.e(3257),a.e(6611),a.e(7538),a.e(6894),a.e(5341)]).then(a.t.bind(a,"qTOg",23)).then(e=>{let{default:t}=e;d(()=>t)})},[]),(0,r.useEffect)(()=>{if(!c||!i.current)return;i.current.innerHTML="";let e=document.createElement("span");e.textContent=String(Math.round(Number(l))||0),i.current.appendChild(e);let t=new c({el:e,value:Math.round(Number(l))||0,theme:"default",format:"(,ddd)"});s.current=t,u.current=Math.round(Number(l))||0,setTimeout(()=>t.update(u.current),100)},[c]),(0,r.useEffect)(()=>{if(!s.current)return;let e=Math.round(Number(l))||0,t=u.current;if(u.current=e,e===t)return;let a=Math.abs(e-t),n=Math.max(200,Math.min(30*a,300)),r=document.querySelectorAll(".odometer-ribbon-inner");r.forEach(e=>{e.setAttribute("style","transition-duration: ".concat(n,"ms !important; transition-timing-function: cubic-bezier(0.4,0,0.2,1) !important;"))}),s.current.update(e)},[l]),(0,n.tZ)(o.x,{...e,ref:i,sx:{overflow:"hidden"}})}),V=(0,r.memo)(e=>{let{styles:t,classNames:a}=e,{data:l,firstLoading:i,size:s,borderOutsideColor:c,backgroundChartColor:d}=(0,r.useContext)(m),{color:u="gray",valueColorIndex:p=7,statusColorIndex:g=6,borderEndColorIndex:f=7,borderStartColorIndex:x=3,category:v,currentAqiusValue:C=0}=l||{},Z=(0,r.useMemo)(()=>{let e=Math.min((C||0)/500*270,270),t=i?120:e+45;return{gapAngleLeft:45,selectedDeg:t,endCircleAngle:315,circleAngle:360}},[C,i]),{classes:b,cx:y}=H({color:i?"neutral":u,borderEndColorIndex:f,borderStartColorIndex:x,statusColorIndex:g,valueColorIndex:p,firstLoading:i,size:s,borderOutsideColor:c,backgroundChartColor:d,...Z},{name:"AirPopulation__Chart",styles:t,classNames:a}),[w,N]=(0,r.useState)(Z.selectedDeg),k=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=Z.selectedDeg,t=e-w,a=performance.now(),animate=e=>{let n=Math.min((e-a)/200,1);N(w+t*(1-Math.pow(1-n,3))),n<1&&(k.current=requestAnimationFrame(animate))};return cancelAnimationFrame(k.current),k.current=requestAnimationFrame(animate),()=>cancelAnimationFrame(k.current)},[Z.selectedDeg]),(0,n.BX)(o.x,{className:y(b.root,"chart-root"),style:{"--deg":"".concat(w,"deg")},children:[(0,n.tZ)(o.x,{className:y(b.border,"chart-border"),children:(0,n.tZ)(o.x,{className:y(b.borderWhite,"chart-border-white"),children:(0,n.tZ)(o.x,{className:y(b.background,"chart-background"),children:(0,n.tZ)(o.x,{className:b.mainCircle,children:!i&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(h.T,{size:"title2",variant:"tertiary",className:y(b.label,"chart-label"),children:"AQI"}),(0,n.tZ)(W,{className:b.value},"main-value")]})})})})}),(0,n.tZ)("div",{className:b.tagArea,children:(0,n.tZ)("div",{className:b.tag,children:(0,n.tZ)(h.T,{size:"sm"===s?"p3":"title2",className:b.status,weight:"semiBold",color:"#fff",children:v})})})]})});var Y=a("8vDj");let Information=e=>{var t;let a=(0,Y.rZ)(),{firstLoading:l,data:i}=(0,r.useContext)(m),{color:s="gray",description:c,informationIcon:d,valueColorIndex:u=7}=i||{},p="function"==typeof d?d:null;return l?(0,n.BX)(f.K,{spacing:8,...e,children:[(0,n.tZ)(N.O,{height:16,radius:4,width:200}),(0,n.tZ)(N.O,{height:16,radius:4,width:200}),(0,n.tZ)(N.O,{height:16,radius:4,width:130})]}):c?(0,n.BX)(o.x,{sx:{position:"relative",".info-label":{"&:before":{content:'""',display:"inline-block",width:20}},".info-icon":{position:"absolute",top:2,left:0}},...e,children:[p&&(0,n.tZ)(p,{size:16,color:null===(t=a.colors[s])||void 0===t?void 0:t[u],className:"info-icon"}),(0,n.tZ)(h.T,{size:"p3",className:"info-label",children:c})]}):null};var O=a("Wgwc"),U=a.n(O);let TimeStatus=()=>{let{firstLoading:e,data:t}=(0,r.useContext)(m),{updatedTime:a}=t||{},{formatMessage:o}=(0,i.Z)();return e?(0,n.tZ)(N.O,{sx:{marginTop:6},height:12,radius:4,width:120}):(0,n.tZ)(h.T,{size:"p3",variant:"tertiary",children:o({id:"airPopulation.timeUpdate",defaultMessage:"{time} Update every {from} - {to}h"},{time:U()(a).format("HH:mm"),from:1,to:2})})},Form=e=>{let{styles:t,classNames:a,className:r,...l}=e,{classes:i}=F(void 0,{name:"AirPopulation__Form",styles:t,classNames:a});return(0,n.tZ)(Layout,{...l,classNames:{colLeft:i.colLeft,colRight:i.colRight},colLeft:(0,n.BX)(o.x,{className:i.info,children:[(0,n.BX)(o.x,{className:i.locator,children:[(0,n.tZ)(LocationSelector,{}),(0,n.tZ)(TimeStatus,{})]}),(0,n.tZ)(o.x,{className:i.infoColLeft,children:(0,n.tZ)(Information,{})})]}),colRight:(0,n.BX)(o.x,{className:i.chart,children:[(0,n.tZ)(V,{}),(0,n.tZ)(o.x,{className:i.infoColRight,children:(0,n.tZ)(Information,{})})]})})},j={in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30%)"},transitionProperty:"transform, opacity"},Body=e=>{let{className:t,styles:a,classNames:d,...p}=e,{notShareLocationErr:h,notLoadResultError:g,backgroundColor:f,size:x}=(0,r.useContext)(m),{formatMessage:v}=(0,i.Z)(),{classes:C,cx:Z}=u({size:x,backgroundColor:f},{name:"AirPopulation__Body",styles:a,classNames:d}),{errorInitLoad:b}=(0,c.W)(e=>({errorInitLoad:e.error}),s.X),y="string"==typeof b,w="string"==typeof g;return(0,n.tZ)(o.x,{...p,className:Z(C.root,t,"air-population-body"),children:(0,n.BX)(o.x,{className:C.inner,children:[(0,n.tZ)(l.u,{keepMounted:!0,mounted:!y&&!w,transition:j,children:e=>(0,n.tZ)(o.x,{className:"chart-screen",style:e,children:(0,n.tZ)(Form,{})})}),(0,n.tZ)(l.u,{mounted:y,keepMounted:!0,transition:j,children:e=>(0,n.tZ)(o.x,{style:e,className:"error-screen",children:(0,n.tZ)(ErrorScreenGeneral,{classNames:{root:C.errorScreenRoot}})})}),(0,n.tZ)(l.u,{mounted:w||h,transition:j,children:e=>(0,n.tZ)(o.x,{style:e,className:"error-screen",children:(0,n.tZ)(ErrorScreenNotFoundResult,{classNames:{root:C.errorScreenRoot},message:h?v({id:"airPopulation.notShareLocation.error",defaultMessage:"Cannot find your location. Please try again."}):""})})})]})})};var G=a("09QT"),K=a("Cov9"),q=a("oQBk"),Q=a("Fyo5"),J=a("Tk9B"),$=a("TD78"),ee=(0,d.k)(e=>({root:{backgroundColor:e.colors.neutral[0],padding:12},icon:{flexShrink:0}})),et=a("QJsO"),ea=a("15qF"),en=(0,d.k)(()=>({root:{position:"relative",cursor:"pointer",height:40,width:40},item:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",position:"absolute",top:0,left:0,right:0,bottom:0}})),er=a("B1nu"),eo=(0,d.k)(e=>({root:{},body:{padding:16,[e.fn.largerThan("sm")]:{padding:"".concat((0,D.h)(24)," ").concat((0,D.h)(24)," ").concat((0,D.h)(24)," ").concat((0,D.h)(48))}},modalBody:{padding:0},disclaimer:{justifyContent:"center"}}));let ModalDetail=e=>{let{className:t,...a}=e,{classes:r}=eo(void 0,{name:"AirPopulation__ModalDetail"});return(0,n.tZ)(em,{selectorZIndex:500,children:e=>{var t;return(0,n.BX)(er.M,{...a,title:null==e?void 0:null===(t=e.cardInfo)||void 0===t?void 0:t.title,size:600,classNames:{body:r.modalBody},zIndex:500,children:[(0,n.tZ)(Body,{className:r.body}),(0,n.tZ)(em.Disclaimer,{className:r.disclaimer})]})}})};var el=a("P60J"),ei=a("qe1T");let es=(0,M.F4)({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}});var ec=(0,d.k)((e,t)=>{var a,n,r,o;let{color:l,borderStartColorIndex:i,borderEndColorIndex:s,valueColorIndex:c,endCircleAngle:d,gapAngleLeft:u,circleAngle:m,firstLoading:p,selectedDeg:h,size:g}=t,f=null===(a=e.colors[l])||void 0===a?void 0:a[i],x=null===(n=e.colors[l])||void 0===n?void 0:n[s],v=null===(r=e.colors[l])||void 0===r?void 0:r[c],C={display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"50%"},Z="md"===g?40:32,b="md"===g?40:32;return{root:{position:"relative",borderRadius:"50%",width:Z,height:b,".warning-icon":{position:"absolute",top:0,left:"95%",zIndex:1}},border:{...C,width:Z,height:Z,position:"relative",background:null===(o=e.colors[l])||void 0===o?void 0:o[0],"&:before":{transform:"rotate(135deg)",content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:"conic-gradient(\n from 180deg,\n transparent 0deg ".concat(u,"deg,\n ").concat(f," ").concat(u,"deg,\n ").concat(x," ").concat(h,"deg,\n transparent ").concat(h,"deg ").concat(d,"deg,\n transparent ").concat(d,"deg ").concat(m,"deg\n )"),...p&&{animation:"".concat(es," 2s linear infinite"),opacity:.5}}},borderWhite:{...C,flexDirection:"column",justifyContent:"center",width:Z-4,height:Z-4,backgroundColor:e.colors.neutral[0],zIndex:1},label:{fontSize:(0,D.h)("md"===g?8:6),lineHeight:(0,D.h)("md"===g?12:10)},value:{fontSize:(0,D.h)("md"===g?15:13),lineHeight:(0,D.h)("md"===g?15:13),fontWeight:"md"===g?z.F.semiBold:z.F.halfBold,color:v}}});let ed=(0,r.memo)(e=>{let{size:t,styles:a,classNames:l}=e,{data:i,firstLoading:s,size:c}=(0,r.useContext)(m),{color:d="gray",valueColorIndex:u=7,borderEndColorIndex:p=7,borderStartColorIndex:g=3,currentAqiusValue:f=0,keyCategory:x}=i||{},v=(0,r.useMemo)(()=>{let e=Math.min((f||0)/500*270,270),t=s?120:e+45;return{gapAngleLeft:45,selectedDeg:t,endCircleAngle:315,circleAngle:360}},[f,s]),{classes:C,cx:Z}=ec({color:s?"neutral":d,borderEndColorIndex:p,borderStartColorIndex:g,valueColorIndex:u,firstLoading:s,size:t||c,...v,selectedDeg:v.selectedDeg},{name:"AirPopulation__SimpleChart",styles:a,classNames:l});return(0,n.BX)(o.x,{className:C.root,children:[(0,n.tZ)(o.x,{className:C.border,children:(0,n.tZ)(o.x,{className:C.borderWhite,children:!s&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(h.T,{size:"title2",variant:"secondary",className:Z(C.label,"chart-label"),children:"AQI"}),(0,n.tZ)(o.x,{className:C.value,children:f})]})})}),x===ei.P.HAZARDOUS&&(0,n.tZ)(el.Z,{className:"warning-icon",color:"red",size:12})]})}),eu={in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(50%)"},transitionProperty:"transform, opacity"};var em=Object.assign(e=>{let{children:t,size:a="md",borderOutsideColor:o,backgroundChartColor:l,backgroundColor:d="#fff",selectorZIndex:u}=e,{formatMessage:h}=(0,i.Z)(),{cardInfo:g,currentLocation:f,setCurrentLocation:x,listProvinces:C,currentData:Z,fetchInitData:b}=(0,c.W)(e=>({cardInfo:e.cardInfo,listProvinces:e.listProvinces,currentData:e.currentData,currentLocation:e.currentLocation,fetchInitData:e.fetchInitData,setCurrentLocation:e.setCurrentLocation}),s.X),[y,w]=(0,r.useState)(null),[N,k]=(0,r.useState)(null),[I,B]=(0,r.useState)(!0),[T,S]=(0,r.useState)(!1),[A,L]=(0,r.useState)(null),[_,R]=(0,r.useState)(!1),E=(0,Y.rZ)(),D=(0,r.useCallback)(async()=>{try{if(S(!0),null==f?void 0:f.location)handleFetchResult({type:"geo",lat:String(f.location.latitude),lng:String(f.location.longitude)});else{let e=await (0,J.k)();(null==e?void 0:e.location)?(handleFetchResult({type:"geo",lat:String(e.location.latitude),lng:String(e.location.longitude)}),x(e)):(x(e),R(!0))}}catch(e){}finally{S(!1)}},[]),handleFetchResult=async e=>{try{S(!0);let t=await (0,G.d)(q.y.HEALTH_TOOL.GET_AIR_POPULATION_SPECIFIC_PROVINCE,{params:e}),a=(0,K.h)(null==t?void 0:t.data),n=(0,Q.rx)(a,"geo"===e.type);if(n&&(null==a?void 0:a.keyCategory)&&(0,Q.B9)(a.keyCategory)){let e=v.Ti[null==a?void 0:a.keyCategory];k({...e,...a}),L(null)}else L("")}catch(e){L("")}finally{S(!1),R(!1)}};return(0,r.useEffect)(()=>{b()},[b]),(0,r.useEffect)(()=>{(null==C?void 0:C.length)&&"number"==typeof(null==Z?void 0:Z.currentAqiusValue)&&B(!1)},[C,Z]),(0,r.useEffect)(()=>{if(!Z)return;let e=v.Ti[null==Z?void 0:Z.keyCategory];k({...e,...Z}),w(f?h({id:v.eD}):null==Z?void 0:Z.province)},[Z]),(0,n.tZ)(z.T,{variant:z.C.LEADGEN,children:(0,n.tZ)(m.Provider,{value:{notShareLocationErr:_,notLoadResultError:A,data:N,setData:k,loading:T,firstLoading:I,heading:"Air polulation",disclaimer:"Information is for reference only and not a substitute for medical advice.",avatar:p.C.getAssetPath("tiki/maskcot.png"),size:a,borderOutsideColor:o||E.colors.neutral[0],backgroundChartColor:l||"#fff",backgroundColor:d,selectorZIndex:u,selectedValue:y,setSelectedValue:w,onChangeValue:e=>{e===v.Zn?D():handleFetchResult({type:"state",name:e})},handleClickCurrentLocation:D},children:"function"==typeof t?t({cardInfo:g,result:N}):t||(0,n.tZ)(Body,{})})})},{Disclaimer:e=>{let{className:t,...a}=e,{classes:r,theme:o,cx:l}=ee(void 0,{name:"AirPopulation__Disclaimer"}),{disclaimer:i}=(0,c.W)(e=>{var t;return{disclaimer:null===(t=e.cardInfo)||void 0===t?void 0:t.disclaimer}},s.X);return i?(0,n.BX)(R.k,{gap:4,...a,className:l(t,r.root),children:[(0,n.tZ)($.Z,{size:16,color:o.colors.yellow[8],className:r.icon}),(0,n.tZ)(h.T,{size:"c1",children:i})]}):null},Heading:()=>{let{heading:e}=(0,r.useContext)(m);return e?(0,n.tZ)(h.T,{size:"h3",children:e}):null},Body:Body,Chart:V,IconChart:e=>{let{dataTracking:t,className:a,...i}=e,{firstLoading:s,size:c}=(0,r.useContext)(m),[d,u]=(0,r.useState)(!1),[p,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)(!1),{classes:x,cx:v}=en(void 0,{name:"AirPopulation__IconChart"});return(0,r.useEffect)(()=>{s||(h(e=>!e),u(!0))},[s]),(0,r.useEffect)(()=>{if(!d)return;let e=setInterval(()=>{h(e=>!e)},4e3);return()=>clearInterval(e)},[d]),(0,n.BX)(n.HY,{children:[(0,n.BX)(o.x,{...i,className:v(x.root,a),onClick:()=>f(!0),"data-event-category":null==t?void 0:t.dataEventCategory,"data-event-action":null==t?void 0:t.dataEventAction,"data-event-label":null==t?void 0:t.dataEventLabel,children:[(0,n.tZ)(o.x,{className:x.item,children:(0,n.tZ)(l.u,{mounted:!p,transition:eu,duration:400,timingFunction:"ease",children:e=>(0,n.tZ)(o.x,{style:e,children:(0,n.tZ)(et.z,{inline:!0,processing:!0,color:"green",size:8,sx:{marginTop:3},children:(0,n.tZ)(ea.Z,{size:"md"===c?32:24})})})})}),(0,n.tZ)(o.x,{className:x.item,children:(0,n.tZ)(l.u,{mounted:p,transition:eu,duration:400,timingFunction:"ease",children:e=>(0,n.tZ)(o.x,{style:e,children:(0,n.tZ)(ed,{size:c})})})})]}),(0,n.tZ)(ModalDetail,{opened:g,onClose:()=>f(!1)})]})}})},"HPD/":function(e,t,a){a.d(t,{q:function(){return AirPopulationEmbedCard}});var n=a("BGKE"),r=a("Vmir"),o=a("vKIh");let AirPopulationEmbedCard=e=>{let{formProps:t,cardProps:a}=e;return(0,n.tZ)(o.Z,{...t,children:e=>{let{cardInfo:t}=e;return(0,n.BX)(r.H,{...a,children:[(0,n.tZ)(r.H.Banner,{isRevamp:!0,icon:(0,n.tZ)("img",{alt:"health-tool-icon",src:null==t?void 0:t.featuredImage,loading:"lazy"}),medicalReview:void 0,heading:(null==t?void 0:t.title)||"",disclaimer:(null==t?void 0:t.disclaimer)||""}),(0,n.tZ)(r.H.Body,{sx:e=>({padding:"24px 16px",[e.fn.largerThan("sm")]:{padding:"40px 48px"}}),children:(0,n.tZ)(o.Z.Body,{})})]})}})}},"YL+3":function(e,t,a){a.d(t,{A:function(){return CustomSelect}});var n=a("BGKE"),r=a("q1tI"),o=a("VkaC"),l=a("1Hbx"),i=a("Eso5"),s=a("SPK5"),c=a("kfjY"),d=a("vaps"),u=a("ChHM"),m=a("hXNO"),p=a("/npG"),h=a("mYVa"),g=(0,p.k)(e=>({root:{position:"relative"},selectedLabel:{padding:"".concat((0,h.h)(4)," 0"),cursor:"pointer",userSelect:"none",maxWidth:200},selectedLabelText:{},item:{userSelect:"none",whiteSpace:"nowrap",padding:"".concat((0,h.h)(8)," ").concat((0,h.h)(12)),transition:"background .2s ease",cursor:"pointer",'&[data-is-current-loc="true"]':{position:"relative",marginBottom:16,"&:before":{position:"absolute",top:"calc(100% + 8px)",left:0,right:0,content:'""',borderBottom:"1px solid ".concat(e.colors.neutral[1])}},'&[data-selected="true"]':{cursor:"default",backgroundColor:e.colors.blue[0]},"&:hover":{backgroundColor:e.colors.gray[1]}},dropdownList:{minWidth:120,maxWidth:200,background:"#fff",position:"absolute",top:"100%",right:0,borderRadius:8,boxShadow:"0px 0px 1px 0px #0000000A, 0px 2px 8px 0px #0000000A, 0px 10px 16px 0px #0000000A"}}));let CustomSelect=e=>{var t;let{value:a,data:p=[],onSelectItem:h,styles:f,classNames:x,className:v,...C}=e,{classes:Z,cx:b}=g(void 0,{name:"CustomSelect__Select",styles:f,classNames:x}),y=(0,m.d)(),[w,N]=(0,r.useState)(!1),k=(0,u.O)(()=>N(!1)),[I,B]=(0,r.useState)("string"==typeof a&&(null===(t=p.filter(e=>e.value===a))||void 0===t?void 0:t[0])||null);return(0,n.BX)(i.x,{...C,className:b(Z.root,v),ref:k,children:[(0,n.BX)(s.k,{justify:"space-between",align:"center",gap:8,onClick:()=>N(e=>!e),className:Z.selectedLabel,children:[(0,n.tZ)(o.T,{className:Z.selectedLabelText,size:y?"p3":"p4",lineClamp:1,children:null==I?void 0:I.label}),(0,n.tZ)(l.Z,{size:20})]}),(0,n.tZ)(c.u,{mounted:w,transition:"fade",children:e=>(0,n.tZ)(i.x,{style:e,children:(0,n.tZ)(d.x.Autosize,{mah:320,type:"auto",scrollbarSize:6,className:Z.dropdownList,children:p.map((e,t)=>{let a=(null==I?void 0:I.value)===e.value;return(0,n.tZ)(s.k,{"data-selected":a,className:Z.item,align:"center",gap:8,onClick:()=>{a||(N(!1),h(e),B(e))},children:(0,n.tZ)(o.T,{size:y?"p3":"p4",weight:a?"halfBold":"regular",lineClamp:1,children:e.label})},String(t))})})})})]})}},lMcb:function(e,t,a){a.d(t,{Z:function(){return I}});var n=a("BGKE"),r=a("Eso5"),o=a("C/sX"),l=a("q1tI");let i=(0,l.createContext)({});var s=a("iuhU");let FeatureCardContent=e=>{let{children:t,className:a,...o}=e;return(0,n.tZ)(r.x,{...o,className:(0,s.default)(a,"card-content"),children:t})};FeatureCardContent.displayName="FeatureCardContent";var c=a("VkaC"),d=a("hXNO");let FeatureCardHeading=e=>{let{children:t,...a}=e,r=(0,d.d)();return(0,n.tZ)(c.T,{size:r?"h4":"h2",as:"h2",variant:"primary",weight:"halfBold",...a,children:t})};FeatureCardHeading.displayName="FeatureCardHeading";var u=a("SPK5");let FeatureCardIcon=e=>{let{src:t}=e;return t?(0,n.tZ)(u.k,{align:"center",justify:"center",sx:e=>({img:{width:16,height:16},[e.fn.largerThan("sm")]:{boxShadow:"0px 0px 1px 0px #0000000A,\n0px 2px 8px 0px #0000000A,\n0px 10px 16px 0px #0000000A\n",width:80,height:80,borderRadius:"50%",img:{width:40,height:40}}}),children:(0,n.tZ)("img",{loading:"lazy",src:t,alt:""})}):null};FeatureCardIcon.displayName="FeatureCardIcon";var m=a("/npG"),p=(0,m.k)(e=>({root:{[e.fn.largerThan("sm")]:{paddingLeft:48,paddingRight:48}}}));let FeatureCardInner=e=>{let{children:t,styles:a,classNames:o,className:l,...i}=e,{classes:s,cx:c}=p(void 0,{name:"FeatureCard__Inner",styles:a,classNames:o});return(0,n.tZ)(r.x,{className:c("inner-section",l,s.root),...i,children:t})};FeatureCardInner.displayName="FeatureCardInner";let FeatureCardLeftContent=e=>{let{children:t}=e;return(0,n.tZ)(r.x,{children:t})};FeatureCardLeftContent.displayName="FeatureCardLeftContent";let FeatureCardRightContent=e=>{let{children:t}=e;return(0,n.tZ)(r.x,{children:t})};FeatureCardRightContent.displayName="FeatureCardRightContent";var h=(0,m.k)(e=>({root:{},icon:{display:"inline-block",verticalAlign:"middle",img:{display:"block"}},label:{display:"inline-block",verticalAlign:"middle",marginLeft:8,color:e.colors.gray[6],textTransform:"uppercase"}}));let FeatureCardSectionName=e=>{let{icon:t="",children:a,styles:o,classNames:s,className:d,...u}=e,{url:m}=(0,l.useContext)(i),{classes:p,cx:g}=h(void 0,{name:"FeatureCard__SectionName",styles:o,classNames:s});return(0,n.BX)(r.x,{...u,className:g(p.root,d),component:m?"a":"div",href:m,children:[t&&(0,n.tZ)(r.x,{className:p.icon,children:"string"==typeof t?(0,n.tZ)("img",{loading:"lazy",width:20,height:20,src:t,alt:""}):t}),(0,n.tZ)(c.T,{size:"title2",weight:"semiBold",as:"span",className:p.label,children:a})]})};FeatureCardSectionName.displayName="FeatureCardSectionName";var g=a("rQtb"),f=a("le9Y"),x=(0,m.k)(e=>({root:{borderRadius:44,[e.fn.smallerThan("sm")]:{width:"100%"}}}));let FeatureCardViewAll=e=>{let{children:t,href:a,styles:r,classNames:o,className:s,...d}=e,{classes:u,cx:m}=x(void 0,{name:"FeatureCard__VerticalCenterLayout",styles:r,classNames:o}),{color:p,url:h}=(0,l.useContext)(i),v=a||h;return v?(0,n.tZ)(g.B,{className:m(u.root,s),component:"a",variant:"secondary",size:"lg",rightIcon:(0,n.tZ)(f.Z,{color:"currentColor",size:20}),color:"gray"===p?"yellow":p||"green",withColorHover:!0,href:v,...d,children:(0,n.tZ)(c.T,{size:"p1",color:"inherit",weight:"semiBold",children:t})}):null};FeatureCardViewAll.displayName="FeatureCardViewAll";var v=(0,m.k)((e,t)=>{var a,n;let{color:r}=t;return{root:{...r&&{backgroundColor:null===(n=e.colors)||void 0===n?void 0:null===(a=n[r])||void 0===a?void 0:a[0]},[e.fn.largerThan("sm")]:{borderRadius:24}},inner:{},header:{}}}),C=a("mYVa"),Z=a("OAL+"),b=a("frWj");let HorizontalLayout=()=>{let{sectionName:e,heading:t,content:a,viewAll:o}=(0,l.useContext)(i);return(0,n.BX)(u.k,{sx:e=>({[e.fn.smallerThan("sm")]:{gap:24,flexDirection:"column",alignItems:"stretch",padding:"".concat((0,C.h)(40)," ").concat((0,C.h)(16))},[e.fn.largerThan("sm")]:{alignItems:"center",gap:64,padding:48}}),children:[(0,n.tZ)(r.x,{sx:e=>({[e.fn.largerThan("sm")]:{width:345,flexShrink:0}}),children:(0,n.BX)(Z.K,{spacing:24,children:[(0,n.BX)(Z.K,{sx:e=>({gap:12,[e.fn.largerThan("sm")]:{gap:16}}),children:[e,t]}),(0,n.tZ)(b.z,{smallerThan:"sm",styles:{display:"none "},children:(0,n.tZ)(r.x,{children:o})})]})}),(0,n.tZ)(r.x,{sx:e=>({[e.fn.largerThan("sm")]:{width:"calc(100% - 345px - 64px)"}}),children:a}),(0,n.tZ)(b.z,{largerThan:"sm",styles:{display:"none "},children:(0,n.tZ)(r.x,{children:o})})]})};var y=(0,m.k)(e=>({root:{gap:24,padding:"".concat((0,C.h)(40)," ").concat((0,C.h)(16)),[e.fn.largerThan("sm")]:{padding:48}},body:{},header:{gap:12,[e.fn.largerThan("sm")]:{gap:24}}}));let VerticalLayout=e=>{let{styles:t,className:a,classNames:o}=e,{sectionName:s,heading:c,content:d}=(0,l.useContext)(i),{classes:u,cx:m}=y(void 0,{name:"FeatureCard__VerticalLayout",styles:t,classNames:o});return(0,n.BX)(Z.K,{className:m(a,u.root),children:[(0,n.BX)(Z.K,{className:u.header,children:[s,c]}),(0,n.tZ)(r.x,{className:u.body,children:d})]})};var w=(0,m.k)(e=>({inner:{},header:{gap:12,[e.fn.smallerThan("sm")]:{padding:"".concat((0,C.h)(24)," ").concat((0,C.h)(24)," 0")},[e.fn.largerThan("sm")]:{alignItems:"center",gap:16,padding:40}}}));let VerticalCenterLayout=e=>{let{styles:t,classNames:a,...o}=e,{sectionName:s,icon:c,heading:d,content:u,viewAll:m}=(0,l.useContext)(i),{classes:p}=w(void 0,{name:"FeatureCard__VerticalCenterLayout",styles:t,classNames:a});return(0,n.BX)(Z.K,{className:p.inner,...o,children:[(0,n.BX)(Z.K,{className:p.header,children:[s,c,d,m&&(0,n.tZ)(b.z,{smallerThan:"sm",styles:{display:"none"},children:(0,n.tZ)(r.x,{children:m})})]}),u,m&&(0,n.tZ)(b.z,{largerThan:"sm",styles:{display:"none"},children:(0,n.tZ)(r.x,{className:"viewall-bottom",sx:{padding:"0 ".concat((0,C.h)(16)," ").concat((0,C.h)(16)," ").concat((0,C.h)(16))},children:m})})]})};var N=(0,m.k)(e=>({inner:{gap:24,[e.fn.largerThan("sm")]:{gap:32}},header:{gap:8,alignItems:"center",textAlign:"center",[e.fn.largerThan("sm")]:{alignItems:"flex-start"}}}));let VerticalCenterLayoutV2=e=>{let{styles:t,classNames:a,...o}=e,{sectionName:s,icon:c,heading:d,content:u,viewAll:m}=(0,l.useContext)(i),{classes:p}=N(void 0,{name:"FeatureCard__VerticalCenterLayoutV2",styles:t,classNames:a});return(0,n.BX)(Z.K,{className:p.inner,...o,children:[(0,n.BX)(Z.K,{className:p.header,children:[s,c,d,m&&(0,n.tZ)(b.z,{largerThan:"sm",styles:{display:"none"},children:(0,n.tZ)(r.x,{children:m})})]}),u]})};var k=a("ENdw");let FeatureCard=e=>{let{layout:t="vertical",color:a,children:l,styles:s,className:c,classNames:d,url:u,...m}=e,{classes:p,cx:h}=v({color:a},{name:"FeatureCard",styles:s,classNames:d}),g={sectionName:null,icon:null,heading:null,viewAll:null,content:null,left:null,right:null,inner:null},f=Array.isArray(l)?l:[l];return f.forEach(e=>{if(!(null==e?void 0:e.type))return;let t=e.type.displayName;switch(t){case"FeatureCardSectionName":g.sectionName=e;break;case"FeatureCardHeading":g.heading=e;break;case"FeatureCardIcon":g.icon=e;break;case"FeatureCardViewAll":g.viewAll=e;break;case"FeatureCardContent":g.content=e;break;case"FeatureCardLeftContent":g.left=e;break;case"FeatureCardRightContent":g.right=e;break;case"FeatureCardInner":g.inner=e}}),(0,n.tZ)(i.Provider,{value:{color:a,url:u,...g},children:(0,n.tZ)(r.x,{className:h(p.root,c),...m,children:"two-columns"===t?(0,n.tZ)(o.r,{children:l}):t===k.N.Horizontal?(0,n.tZ)(HorizontalLayout,{}):t===k.N.Vertical?(0,n.tZ)(VerticalLayout,{}):t===k.N.VerticalCenter?(0,n.tZ)(VerticalCenterLayout,{classNames:{inner:p.inner,header:p.header}}):t===k.N.VerticalCenterV2?(0,n.tZ)(VerticalCenterLayoutV2,{}):l})})};FeatureCard.SectionName=FeatureCardSectionName,FeatureCard.Heading=FeatureCardHeading,FeatureCard.Icon=FeatureCardIcon,FeatureCard.ViewAll=FeatureCardViewAll,FeatureCard.Content=FeatureCardContent,FeatureCard.LeftContent=FeatureCardLeftContent,FeatureCard.RightContent=FeatureCardRightContent,FeatureCard.Inner=FeatureCardInner;var I=FeatureCard},ENdw:function(e,t,a){var n,r;a.d(t,{N:function(){return n}}),(r=n||(n={})).Vertical="vertical",r.VerticalCenter="verticalCenter",r.Horizontal="horizontal",r.TwoColumns="two-columns",r.VerticalCenterV2="vertical-center-v2"},QiCV:function(e,t,a){a.d(t,{Vy:function(){return getRamadanStatus}}),a("Wgwc"),a("q0An"),a("H+I9");var n=a("llb7");function getRamadanStatus(e){let{toDate:t,imsakDate:a,maghribDate:r,nextImsakDate:o}=e;return a||r||!o?t.isBefore(a)?n.I.COUNT_DOWN_TO_PRAY_TIME:t.isBefore(r)?n.I.COUNT_DOWN_TO_BREAKING_TIME:t.isBefore(o)?n.I.COUNT_DOWN_TO_PRAY_TIME:n.I.IDLE:n.I.IDLE}},fx93:function(e,t,a){a.d(t,{Z:function(){return G}});var n=a("BGKE"),r=a("q1tI"),o=a("a5vB"),l=a("I07S"),i=a("vCEM"),s=a("/npG"),c=(0,s.k)((e,t)=>{let{colorShade:a,withSmallPattern:n}=t,{mainColor:r,secondColor:o,thirdColor:l,bgFillColor:s}=a||{};return{root:{position:"relative",color:e.colors.indigo[0],background:"radial-gradient(77.54% 111.71% at 50.1% -1.4%, ".concat(r," 0%,").concat(o," 67%, ").concat(l," 100%)"),[e.fn.largerThan("sm")]:{background:"radial-gradient(77.54% 111.71% at 50.1% -1.4%, ".concat(r," 0%,").concat(o," 67%, ").concat(l," 100%)")},"&:before":{content:'""',position:"absolute",inset:0,maskImage:"url(".concat(i.C.getAssetPath("ramadan/pattern.svg"),")"),WebkitMaskImage:"url(".concat(i.C.getAssetPath("ramadan/pattern.svg"),")"),maskRepeat:"repeat",WebkitMaskRepeat:"repeat",maskPosition:"20px 50%",WebkitMaskPosition:"20px 50%",backgroundColor:s,mixBlendMode:"soft-light",opacity:"0.34",borderRadius:"inherit",...n&&{maskSize:"50px",WebkitMaskSize:"50px"},[e.fn.smallerThan("sm")]:{maskSize:"50px",WebkitMaskSize:"50px"}}},inner:{position:"relative",borderRadius:"inherit"}}}),d=a("pdCJ");let u=(0,r.createContext)(null),BoxWrapper=e=>{let{children:t,className:a,withSmallPattern:i,...s}=e,d=(0,r.useContext)(u),{colorShade:m}=(0,l.Y)(d,e=>({colorShade:e.colorShade}),o.X),{classes:p,cx:h}=c({colorShade:m,withSmallPattern:i},{name:"RamadanWidget__BoxWrapper"});return(0,n.tZ)("div",{...s,className:h(p.root,a),children:(0,n.tZ)("div",{className:h(p.inner),children:t})})};var m=a("q9DY"),p=a("kfjY"),h=a("Eso5"),g=a("iuhU"),f=a("raAP"),x=a("hXNO"),v=a("dDsW"),C=a("yv45"),Z=a("H+I9"),b=a("//Af"),y=a.n(b);let GoldText=e=>{let{children:t,className:a,sx:i,gradient:s="linear-gradient(90deg,#D5A561 0%,#E8BD84 14%,#F8D2A4 29%,#FFDBB0 37%,#D5A561 52%,#FFDBB0 67%,#D5A561 100%)",...c}=e,d=(0,r.useContext)(u),{colorShade:m}=(0,l.Y)(d,e=>({colorShade:e.colorShade}),o.X);return(0,n.tZ)(h.x,{...c,className:(0,g.default)(y().className,a),sx:{display:"inline-block",backgroundImage:s,WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",filter:"\n drop-shadow(1px 0 0 ".concat(m.mainColor,") \n drop-shadow(-1px 0 0 ").concat(m.mainColor,") \n drop-shadow(0 1px 0 ").concat(m.mainColor,") \n drop-shadow(0 -1px 0 ").concat(m.mainColor,")\n "),...i},children:t})};var w=a("llb7");let CountDownTitle=e=>{let{className:t}=e,{formatMessage:a}=(0,v.Z)(),i=(0,r.useContext)(u),{status:s}=(0,l.Y)(i,e=>({status:e.status}),o.X);return(0,n.tZ)(GoldText,{className:(0,g.default)(t,"uppercase","font-bold","text-[16.67px]","leading-[120%]","tracking-[-0.22px]"),children:a({id:s===w.I.COUNT_DOWN_TO_BREAKING_TIME?"ramadanWidget.countdownToIftar":"ramadanWidget.countdownToNextImsak"})})},StatusBarBackground=e=>{let{width:t=293,...a}=e,i=(0,r.useContext)(u),{colorShade:s}=(0,l.Y)(i,e=>({colorShade:e.colorShade}),o.X),{mainColor:c,secondColor:d,thirdColor:m}=s;return(0,n.BX)("svg",{width:t,viewBox:"0 0 293 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:[(0,n.BX)("g",{"clip-path":"url(#clip0_4055_102851)",children:[(0,n.tZ)("path",{d:"M29.64 47.99C25.46 47.79 18.34 46.6 13.74 41.14C11.13 38.04 9.9 35.58 8.82 33.42C7.47 30.72 6.49 28.77 3.04 26.23L0 24L3.04 21.77C6.49 19.23 7.47 17.28 8.82 14.58C9.91 12.41 11.14 9.95 13.74 6.85C18.34 1.39 25.46 0.2 29.64 0H262.63C266.81 0.2 273.93 1.39 278.53 6.85C281.14 9.95 282.37 12.41 283.45 14.58C284.8 17.28 285.78 19.23 289.23 21.77L292.27 24L289.23 26.23C285.78 28.77 284.8 30.72 283.45 33.42C282.36 35.59 281.13 38.05 278.53 41.15C273.93 46.61 266.81 47.8 262.63 48H29.64V47.99Z",fill:"url(#paint0_linear_4055_102851)"}),(0,n.tZ)("path",{d:"M30.2101 46.9098C25.9401 46.7898 19.0201 45.6898 14.5801 40.4298C12.0601 37.4298 10.8601 35.0398 9.80012 32.9198C8.43012 30.1898 7.35012 28.0298 3.69012 25.3398L1.87012 23.9998L3.69012 22.6598C7.35012 19.9698 8.44012 17.8098 9.80012 15.0798C10.8601 12.9598 12.0601 10.5698 14.5801 7.56984C19.0201 2.29984 25.9501 1.20984 30.2101 1.08984H262.06C266.32 1.20984 273.25 2.30984 277.68 7.56984C280.2 10.5698 281.4 12.9598 282.46 15.0798C283.83 17.8098 284.91 19.9698 288.57 22.6598L290.39 23.9998L288.57 25.3398C284.91 28.0298 283.82 30.1898 282.46 32.9198C281.4 35.0398 280.2 37.4298 277.68 40.4298C273.25 45.6898 266.32 46.7798 262.06 46.9098H30.2101Z",fill:"url(#paint1_linear_4055_102851)"}),(0,n.tZ)("path",{d:"M30.6503 46.0902C26.5803 46.0302 19.5903 45.0902 15.2203 39.9002C12.7603 36.9802 11.5903 34.6302 10.5503 32.5602C9.13027 29.7302 8.01027 27.4902 4.19027 24.6802L3.28027 24.0102L4.19027 23.3402C8.02027 20.5302 9.14027 18.2902 10.5503 15.4602C11.5903 13.3902 12.7603 11.0402 15.2203 8.12016C19.6003 2.91016 26.5903 1.97016 30.6503 1.91016H261.62C265.69 1.97016 272.68 2.91016 277.05 8.10016C279.51 11.0202 280.68 13.3702 281.72 15.4402C283.14 18.2702 284.26 20.5102 288.09 23.3202L289 23.9902L288.09 24.6602C284.26 27.4702 283.14 29.7102 281.72 32.5402C280.68 34.6102 279.51 36.9602 277.05 39.8802C272.68 45.0702 265.69 46.0102 261.62 46.0702H30.6503V46.0902Z",fill:"url(#paint2_linear_4055_102851)"}),(0,n.tZ)("path",{d:"M276.42 8.64023C272.51 4.00024 266.22 2.74023 261.17 2.74023H103.03C103.03 2.74023 31.3297 2.74023 31.1097 2.74023C26.0597 2.74023 19.7697 4.00024 15.8597 8.64023C10.1697 15.3902 11.5697 18.9402 4.67969 24.0002C11.5697 29.0602 10.1697 32.6102 15.8597 39.3602C19.7697 44.0002 26.0597 45.2602 31.1097 45.2602H261.17C266.22 45.2602 272.51 44.0002 276.42 39.3602C282.11 32.6102 280.71 29.0602 287.6 24.0002C280.71 18.9402 282.11 15.3902 276.42 8.64023Z",fill:"url(#paint3_radial_4055_102851)"})]}),(0,n.BX)("defs",{children:[(0,n.BX)("linearGradient",{id:"paint0_linear_4055_102851",x1:"0",y1:"24",x2:"292.28",y2:"24",gradientUnits:"userSpaceOnUse",children:[(0,n.tZ)("stop",{"stop-color":"#AA9257"}),(0,n.tZ)("stop",{offset:"0.43","stop-color":"#D8BD8E"}),(0,n.tZ)("stop",{offset:"0.57","stop-color":"#D0B685"}),(0,n.tZ)("stop",{offset:"0.8","stop-color":"#BEA46F"}),(0,n.tZ)("stop",{offset:"1","stop-color":"#AA9257"})]}),(0,n.BX)("linearGradient",{id:"paint1_linear_4055_102851",x1:"1.87012",y1:"23.9999",x2:"290.41",y2:"23.9999",gradientUnits:"userSpaceOnUse",children:[(0,n.tZ)("stop",{"stop-color":"#816735"}),(0,n.tZ)("stop",{offset:"0.18","stop-color":"#BDA05F"}),(0,n.tZ)("stop",{offset:"0.5","stop-color":"#816735"}),(0,n.tZ)("stop",{offset:"0.56","stop-color":"#886E3A"}),(0,n.tZ)("stop",{offset:"0.65","stop-color":"#9D8149"}),(0,n.tZ)("stop",{offset:"0.76","stop-color":"#BDA05F"}),(0,n.tZ)("stop",{offset:"0.82","stop-color":"#B59859"}),(0,n.tZ)("stop",{offset:"0.9","stop-color":"#A0834A"}),(0,n.tZ)("stop",{offset:"1","stop-color":"#816735"})]}),(0,n.BX)("linearGradient",{id:"paint2_linear_4055_102851",x1:"3.28027",y1:"24.0002",x2:"289",y2:"24.0002",gradientUnits:"userSpaceOnUse",children:[(0,n.tZ)("stop",{"stop-color":"#C7A265"}),(0,n.tZ)("stop",{offset:"0.14","stop-color":"#DBBB85"}),(0,n.tZ)("stop",{offset:"0.29","stop-color":"#ECD0A4"}),(0,n.tZ)("stop",{offset:"0.37","stop-color":"#F4D9B0"}),(0,n.tZ)("stop",{offset:"0.52","stop-color":"#C7A265"}),(0,n.tZ)("stop",{offset:"0.67","stop-color":"#F4D9B0"}),(0,n.tZ)("stop",{offset:"1","stop-color":"#C7A265"})]}),(0,n.BX)("radialGradient",{id:"paint3_radial_4055_102851",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(145.783 20.1314) scale(163.112 76.6652)",children:[(0,n.tZ)("stop",{"stop-color":c}),(0,n.tZ)("stop",{offset:"0.67","stop-color":d}),(0,n.tZ)("stop",{offset:"1","stop-color":m})]}),(0,n.tZ)("clipPath",{id:"clip0_4055_102851",children:(0,n.tZ)("rect",{width:"292.28",height:"48",fill:"white"})})]})]})},CountDownTimer=e=>{let{hideTitle:t,width:a,valueClass:i,unitClass:s,...c}=e,{formatMessage:d}=(0,v.Z)(),m=(0,r.useContext)(u),{imsakDate:p,maghribDate:f,status:x}=(0,l.Y)(m,e=>({imsakDate:e.imsakDate,maghribDate:e.maghribDate,toDate:e.toDate,status:e.status}),o.X),b="flex items-center",y=i||"font-bold text-[32px] leading-[42px] tracking-[-1px] w-[30px]",w=s||"font-normal text-[20px] leading-[120%] tracking-[-0.2px]",N=(0,C.dD)({imsakDate:p,maghribDate:f,toDate:m.getState().toDate,status:x});return(0,n.tZ)("div",{...c,children:(0,n.BX)(h.x,{className:"relative flex items-center",children:[(0,n.tZ)(StatusBarBackground,{width:a,style:{display:"block",margin:"0 auto"}}),!t&&(0,n.tZ)("div",{className:(0,g.default)("absolute top-0 left-0 w-full text-center"),style:{transform:"translateY(-53%)"},children:(0,n.tZ)(CountDownTitle,{})}),(0,n.BX)("div",{className:"absolute inset-0 flex justify-between px-6",children:[(0,n.BX)("div",{className:b,children:[(0,n.tZ)(GoldText,{className:y,children:(0,Z.yu)(N.hour)}),(0,n.tZ)(GoldText,{className:w,children:d({id:"common.unitHours",defaultMessage:"hours"})})]}),(0,n.BX)("div",{className:b,children:[(0,n.tZ)(GoldText,{className:y,children:(0,Z.yu)(N.minute)}),(0,n.tZ)(GoldText,{className:w,children:d({id:"common.unitMins",defaultMessage:"mins"})})]}),(0,n.BX)("div",{className:b,children:[(0,n.tZ)(GoldText,{className:y,children:(0,Z.yu)(N.second)}),(0,n.tZ)(GoldText,{className:w,children:d({id:"common.unitSeconds",defaultMessage:"seconds"})})]})]})]})})},GregorianDate=e=>{let t=(0,r.useContext)(u),{ramadanEvent:a}=(0,l.Y)(t,e=>({ramadanEvent:e.ramadanEvent}),o.X);return(null==a?void 0:a.gregorianDate)?(0,n.tZ)("div",{...e,children:null==a?void 0:a.gregorianDate}):null},ImsakDate=e=>{let t=(0,r.useContext)(u),{ramadanEvent:a}=(0,l.Y)(t,e=>({ramadanEvent:e.ramadanEvent}),o.X),{formatMessage:i}=(0,v.Z)();return(null==a?void 0:a.prayerTimes.imsak.time)?(0,n.BX)("div",{...e,children:[i({id:"ramadanWidget.fastingTimeStarts",defaultMessage:"Fasting time starts"}),": ",a.prayerTimes.imsak.time]}):null},MaghribTime=e=>{let t=(0,r.useContext)(u),{ramadanEvent:a}=(0,l.Y)(t,e=>({ramadanEvent:e.ramadanEvent}),o.X),{formatMessage:i}=(0,v.Z)();return(null==a?void 0:a.prayerTimes.maghrib.time)?(0,n.BX)("div",{...e,children:[i({id:"ramadanWidget.breakingFastTime",defaultMessage:"Breaking fast time"}),": ",a.prayerTimes.maghrib.time]}):null},EventTime=()=>(0,n.BX)("div",{className:"flex flex-col gap-2",children:[(0,n.tZ)(GregorianDate,{className:(0,g.default)("font-inter font-medium","text-[14px] leading-[110%] tracking-[-0.2px]")}),(0,n.BX)("div",{className:(0,g.default)("font-inter font-normal","text-[12px] leading-[110%] tracking-[-0.2px]"),children:[(0,n.tZ)(ImsakDate,{}),(0,n.tZ)(MaghribTime,{})]})]});var N=(0,s.k)(()=>({root:{},inner:{backgroundImage:"url(".concat(i.C.getAssetPath("ramadan/pattern.svg"),")")}}));let IdleHeading=e=>{let{styles:t,classNames:a,className:r}=e,{formatMessage:o}=(0,v.Z)(),{cx:l}=N(void 0,{name:"RamadanWidget__IdleHeading",styles:t,classNames:a});return(0,n.BX)(h.x,{className:l(r,"flex items-center gap-2"),children:[(0,n.tZ)("img",{loading:"lazy",src:i.C.getAssetPath("ramadan/clock.png"),alt:"clock",className:"ramadan-clock w-16 h-16"}),(0,n.tZ)(GoldText,{className:l("ramadan-heading","uppercase","font-display","font-bold","text-[26px]","leading-[1.2]","tracking-[-0.22px]"),children:o({id:"ramadanWidget.fastingTime"})})]})};var k=a("VkaC"),I=a("1Hbx"),B=a("fEsb"),T=a("8vDj"),S=a("mYVa"),A=a("XRSF"),L=a("ChHM"),_=a("m0Nu"),R=(0,s.k)(e=>({root:{position:"relative"},locator:{},locatorValue:{position:"relative",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:4,".loading-icon":{padding:8,svg:{width:16,height:16}}},selectTarget:{position:"absolute",left:0,bottom:0,right:0,[e.fn.smallerThan("sm")]:{left:"50%",right:"auto"}}})),E=a("9aQb"),D=a("VZtU"),X=a("IEKS"),F=a("TD78"),z=a("vaps"),M=a("LES+"),P=a("SPK5"),H=a("Dmus"),W=(0,s.k)(e=>({root:{display:"flex",flexDirection:"column",gap:8,background:"#fff",border:"1px solid ".concat(e.colors.gray[1]),padding:4,borderRadius:12,width:"100%",boxShadow:"0px 0px 1px 0px #0000000A, 0px 2px 8px 0px #0000000A, 0px 10px 16px 0px #0000000A",[e.fn.largerThan("sm")]:{width:300}},input:{input:{paddingLeft:32,[e.fn.largerThan("sm")]:{paddingLeft:35},"&,&::placeholder":{fontSize:(0,S.h)(12),[e.fn.largerThan("sm")]:{fontSize:(0,S.h)(14)}}}},inputWrapper:{position:"relative"},searchIcon:{position:"absolute",top:10,left:8},item:{padding:"".concat((0,S.h)(6)," ").concat((0,S.h)(8)),transition:"background .2s ease",cursor:"pointer",'&[data-is-current-loc="true"]':{position:"relative",marginBottom:8,"&:before":{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,content:'""',borderBottom:"1px solid ".concat(e.colors.neutral[1])}},'&[data-selected="true"]':{cursor:"default",backgroundColor:e.colors.blue[0],borderRadius:8},"&:hover":{backgroundColor:e.colors.gray[1],borderRadius:8}}}));let Select=e=>{let{data:t=[],onClickItem:a,styles:i,classNames:s}=e,{formatMessage:c}=(0,v.Z)(),{classes:d,theme:m}=W(void 0,{name:"AirPopulation__Select",styles:i,classNames:s}),p=(0,r.useContext)(u),[f,C]=(0,r.useState)(!1),{selectedZone:Z,errorCurrentLocation:b,setErrorCurrentLocation:y,loadingCurrentLocation:w}=(0,l.Y)(p,e=>({loadingCurrentLocation:e.loadingCurrentLocation,errorCurrentLocation:e.errorCurrentLocation,setErrorCurrentLocation:e.setErrorCurrentLocation,selectedZone:e.selectedZone}),o.X),N=(0,x.d)(),I=N?16:20,[T,L]=(0,r.useState)(""),_=(0,r.useMemo)(()=>{let e=(0,H.bG)(T),a=t.filter(t=>(0,H.bG)(t.label).includes((0,H.bG)(e)));return a.length>0?a:t},[T,t]);return(0,r.useEffect)(()=>{b&&C(!0)},[b]),(0,r.useEffect)(()=>{let e;return f?e=setTimeout(()=>{C(!1)},5e3):y(!1),()=>clearTimeout(e)},[f]),(0,n.BX)(h.x,{className:d.root,children:[(0,n.BX)(h.x,{className:d.inputWrapper,children:[(0,n.tZ)(E.I,{className:d.input,value:T,onChange:L,placeholder:c({id:"navigation.search.input.placeholder",defaultMessage:"Search for city"})}),(0,n.tZ)(D.Z,{size:18,color:m.colors.gray[3],className:d.searchIcon})]}),(0,n.tZ)(z.x.Autosize,{mah:320,type:"auto",scrollbarSize:6,children:_.map((e,t)=>{let r=!e.isUseCurrentLocation&&(null==Z?void 0:Z.value)===e.value;return e.isUseCurrentLocation?(0,n.BX)(M.J,{width:200,position:"bottom",withArrow:!0,shadow:"md",opened:f,children:[(0,n.tZ)(M.J.Target,{children:(0,n.BX)(P.k,{"data-is-current-loc":e.isUseCurrentLocation,"data-selected":r,className:(0,g.default)(d.item,"select-none"),align:"top",gap:8,onClick:()=>!r&&a(e.value),"data-event-category":"Header Banner","data-event-action":"Ramadan Widget Location Combobox","data-event-label":"current location",children:[(0,n.tZ)("div",{className:"shrink-0 pt-[2px]",children:e.isUseCurrentLocation?w?(0,n.tZ)(A.a,{size:I}):(0,n.tZ)(X.Z,{size:I}):(0,n.tZ)(B.Z,{size:I})}),(0,n.tZ)(k.T,{sx:()=>({fontSize:(0,S.h)(12),[m.fn.largerThan("sm")]:{fontSize:(0,S.h)(14)}}),children:e.label})]})}),(0,n.BX)(M.J.Dropdown,{children:[(0,n.tZ)(F.Z,{color:"red",size:I,className:"inline-block mr-1 align-middle mb-[3px]"}),(0,n.tZ)(k.T,{size:"p4",as:"span",variant:"error",children:c({id:"clinicLocator.plsAllowAccess"})})]})]},String(t)):(0,n.BX)(P.k,{"data-is-current-loc":e.isUseCurrentLocation,"data-selected":r,className:d.item,align:"top",gap:8,onClick:()=>!r&&a(e.value),"data-event-category":"Header Banner","data-event-action":"Ramadan Widget Location Combobox","data-event-label":e.label,children:[(0,n.tZ)("div",{className:"shrink-0 pt-[2px]",children:e.isUseCurrentLocation?(0,n.tZ)(X.Z,{size:I}):(0,n.tZ)(B.Z,{size:I})}),(0,n.tZ)(k.T,{sx:()=>({fontSize:(0,S.h)(12),[m.fn.largerThan("sm")]:{fontSize:(0,S.h)(14)}}),children:e.label})]},String(t))})})]})},LocationSelector=e=>{let{styles:t,className:a,classNames:i}=e,{formatMessage:s}=(0,v.Z)(),c=(0,r.useContext)(u),{ramadanEvent:d,currentLocation:m,listZone:g,selectedZone:f,loading:C,colorShade:Z,handleChangeLocation:b,handleChangeZone:y,handleCloseLocatorDropdown:w}=(0,l.Y)(c,e=>({colorShade:e.colorShade,ramadanEvent:e.ramadanEvent,currentLocation:e.currentLocation,currentZone:e.currentZone,listZone:e.listZone,loading:e.loading,selectedZone:e.selectedZone,setSelectedZone:e.setSelectedZone,handleChangeZone:e.handleChangeZone,handleChangeLocation:e.handleChangeLocation,handleCloseLocatorDropdown:e.handleCloseLocatorDropdown}),o.X),N=(0,T.rZ)(),E=N.colors.indigo[1],{mainColor:D,secondColor:X,thirdColor:F}=Z,[z,M]=(0,r.useState)(!1),P=(0,L.O)(()=>M(!1)),{classes:H,cx:W}=R(void 0,{name:"AirPopulation__LocationSelector",styles:t,classNames:i}),V=(0,x.d)(),Y=[{label:s({id:_.eD}),value:_.Zn,isUseCurrentLocation:!0},...g||[]];return(0,r.useEffect)(()=>{z||w()},[z]),(0,r.useEffect)(()=>{M(!1)},[V]),(0,n.tZ)(h.x,{className:W(a,H.root),children:(0,n.BX)(h.x,{className:H.locator,ref:P,children:[(0,n.BX)(h.x,{className:"cursor-pointer relative w-full h-[40px]",onClick:()=>{C||M(e=>!e)},sx:()=>({background:"radial-gradient(57.65% 180.3% at 49.87% 40.9%, ".concat(D," 0%, ").concat(X," 67%, ").concat(F," 100%)"),borderColor:D,border:"1px solid ".concat(D),borderRadius:8,padding:"8px 30px 8px 36px",color:E}),children:[(0,n.tZ)(k.T,{className:"select-none tracking-[-0.3px] break-all",lineClamp:1,color:E,sx:()=>({fontSize:(0,S.h)(12),lineHeight:(0,S.h)(22),[N.fn.largerThan("sm")]:{fontSize:(0,S.h)(14)}}),children:m&&!d?s({id:_.eD}):null==f?void 0:f.label}),(0,n.tZ)("div",{className:"absolute right-0 top-0 z-[0] w-[40px] h-[40px] flex items-center justify-center",children:C?(0,n.tZ)(A.a,{size:18,color:"yellow",className:"loading-icon"}):(0,n.tZ)(I.Z,{size:24,color:E,style:{transform:"rotate(".concat(z?"180deg":0,")")}})}),(0,n.tZ)("div",{className:"absolute left-0 top-0 z-[0] w-[40px] h-[40px] flex items-center justify-center",children:(0,n.tZ)(B.Z,{color:E,size:V?18:20})})]}),(0,n.tZ)(p.u,{mounted:!!z,keepMounted:!0,transition:"fade",children:e=>(0,n.tZ)(h.x,{sx:{position:"absolute",top:"calc(100% + 8px)",...e,borderColor:D,[N.fn.smallerThan("sm")]:{right:0,width:"calc(100vw - 24px)"},[N.fn.largerThan("sm")]:{right:0}},children:(0,n.tZ)(Select,{data:Y,onClickItem:e=>{e===_.Zn?b(()=>{M(!1)}):(y(e),M(!1))}})})})]})})},Logo=()=>(0,n.tZ)(GoldText,{className:(0,g.default)("font-display","font-semibold","text-[32px] md:text-[44px]","leading-[110%]","tracking-[0px]"),children:"Ramadan"}),SponsorLogo=e=>{let{className:t=""}=e,a=(0,r.useContext)(u),{shouldRender:i,ramadanEvent:s}=(0,l.Y)(a,e=>({shouldRender:e.shouldRender,ramadanEvent:e.ramadanEvent}),o.X),c=null==s?void 0:s.sponsorItem;return i&&(null==c?void 0:c.logo)?(0,n.tZ)("img",{className:(0,g.default)(t,"h-[40px] w-auto object-contain"),loading:"lazy",src:c.logo,alt:c.name||"sponsor"}):null},SponsorText=e=>{let{className:t,...a}=e,i=(0,r.useContext)(u),{ramadanEvent:s}=(0,l.Y)(i,e=>({ramadanEvent:e.ramadanEvent}),o.X),c=null==s?void 0:s.sponsorItem;return(null==c?void 0:c.content)?(0,n.tZ)("div",{className:(0,g.default)("font-inter","font-normal","text-[14px]","leading-[110%]","tracking-[-0.2px]","[&_a]:text-[#e8bd84]","[&_a]:underline",t),...a,dangerouslySetInnerHTML:{__html:c.content}}):null},Sponsor=()=>{let e=(0,r.useContext)(u),{shouldRender:t,ramadanEvent:a}=(0,l.Y)(e,e=>({shouldRender:e.shouldRender,ramadanEvent:e.ramadanEvent}),o.X),i=null==a?void 0:a.sponsorItem;return t&&((null==i?void 0:i.logo)||(null==i?void 0:i.content))?(0,n.BX)("div",{className:"flex flex-col gap-0 items-center",children:[(0,n.tZ)(SponsorLogo,{}),(0,n.tZ)(SponsorText,{className:"text-center"})]}):null},DesktopView=()=>{let e=(0,r.useContext)(u),{shouldRender:t,status:a}=(0,l.Y)(e,e=>({shouldRender:e.shouldRender,status:e.status}),o.X);return t?(0,n.BX)("div",{className:(0,g.default)("h-full","relative z-[1]","flex flex-col gap-3","grid grid-cols-[1fr_292px_1fr] items-center gap-0"),children:[(0,n.BX)("div",{className:"flex gap-3 items-center ",children:[(0,n.tZ)("img",{className:" h-[81px] w-[103px] ",loading:"lazy",src:i.C.getAssetPath("ramadan/moon.png"),alt:"moon"}),(0,n.BX)(h.x,{className:"flex gap-[16px]",children:[(0,n.tZ)(Logo,{}),(0,n.tZ)(EventTime,{})]})]}),(0,n.tZ)("div",{className:(0,g.default)("flex justify-center w-[292px]"),children:a===w.I.IDLE?(0,n.tZ)(IdleHeading,{}):(0,n.tZ)(CountDownTimer,{className:"pt-[10px]"})}),(0,n.tZ)("div",{children:(0,n.BX)("div",{className:(0,g.default)("max-w-[550px]","flex items-center gap-1 justify-between"),children:[(0,n.tZ)("div",{className:"w-full",children:(0,n.tZ)(Sponsor,{})}),(0,n.BX)("div",{className:"flex items-center gap-7 flex-shrink-0",children:[(0,n.tZ)("div",{className:"w-[200px]",children:(0,n.tZ)(LocationSelector,{})}),(0,n.tZ)("img",{loading:"lazy",className:"h-[80px] w-auto object-contain [transform:rotateY(-180deg)]",src:i.C.getAssetPath("ramadan/sparkle-star.png"),alt:"sparkle star"})]})]})})]}):null};var V=(0,s.k)(e=>({inner:{position:"relative",[e.fn.largerThan("sm")]:{"&:before,&:after":{content:'""',position:"absolute",top:0,backgroundImage:"url(".concat(i.C.getAssetPath("ramadan/sparkle.png"),")"),backgroundSize:"cover",width:421,height:80},"&:before":{left:-242},"&:after":{right:-242}}}}));let MobileView=()=>{var e;let t=(0,r.useContext)(u),{shouldRender:a,status:s,ramadanEvent:c}=(0,l.Y)(t,e=>({shouldRender:e.shouldRender,status:e.status,ramadanEvent:e.ramadanEvent}),o.X),d="text-[10px] leading-[1.2] tracking-[-0.2px] text-gray-800",m=s!==w.I.IDLE||(null==c?void 0:null===(e=c.sponsorItem)||void 0===e?void 0:e.logo);return a?(0,n.BX)("div",{className:(0,g.default)("p-[12px]","h-full","relative z-[1]","flex flex-col gap-[9px]"),children:[(0,n.BX)("div",{className:"flex flex-col gap-2 items-center ",children:[m&&(0,n.BX)("div",{className:"flex flex-col w-full",children:[(0,n.BX)("div",{className:"flex gap-[4px]",children:[(0,n.tZ)(Logo,{}),(0,n.BX)("div",{className:"pt-[8px]",children:[(0,n.tZ)(ImsakDate,{className:d}),(0,n.tZ)(MaghribTime,{className:d})]})]}),(0,n.tZ)(GregorianDate,{className:d})]}),s===w.I.IDLE?(0,n.tZ)(IdleHeading,{}):(0,n.tZ)(CountDownTimer,{className:"pt-[10px]"}),(0,n.BX)("div",{className:"flex gap-1 items-center w-full",children:[(0,n.tZ)(SponsorText,{className:"shrink-0 w-[50%] !text-[12px] leading-[1.1] tracking-[-0.2px] "}),(0,n.tZ)(LocationSelector,{className:"w-full"})]})]}),(0,n.tZ)(SponsorLogo,{className:"absolute top-0 right-[32px]"}),(0,n.tZ)("img",{loading:"lazy",className:"absolute right-5 top-0 h-[83px] w-auto object-contain",src:i.C.getAssetPath("ramadan/sparkle-star-mobile.png"),alt:"sparkle star"})]}):null},RamadanWidgetComponent=e=>{let t=(0,r.useContext)(u),{shouldRender:a}=(0,l.Y)(t,e=>({shouldRender:e.shouldRender}),o.X),i=(0,x.d)(),{classes:s,cx:c}=V(void 0,{name:"RamadanWidget"});return a?(0,n.tZ)(BoxWrapper,{...e,children:(0,n.tZ)("div",{className:c(s.inner,"max-w-[1440px] mx-auto h-auto md:h-[81px]"),children:i?(0,n.tZ)(MobileView,{}):(0,n.tZ)(DesktopView,{})})}):null};var Y=a("nCpW"),O=a("P5LW"),U=a("CF0j"),j=a("0EDw");let WidgetView=e=>{let{className:t,...a}=e,i=(0,r.useContext)(u),{status:s}=(0,l.Y)(i,e=>({status:e.status}),o.X);return s===w.I.IDLE?null:(0,n.tZ)(BoxWrapper,{withSmallPattern:!0,...a,children:(0,n.BX)("div",{className:"flex gap-1 justify-between p-2",children:[(0,n.BX)("div",{className:"flex flex-col gap-[1px] justify-center",children:[(0,n.tZ)(CountDownTitle,{className:"font-bold text-[16.84px] leading-[120%]"}),(0,n.tZ)(SponsorText,{className:"text-[9px]"})]}),(0,n.tZ)(CountDownTimer,{hideTitle:!0,width:192,unitClass:"text-[13.33px] leading-[120%] tracking-[-0.13px]",valueClass:"text-[21.33px] leading-[28px] w-[20px]"})]})})};var G={Provider:e=>{let{children:t,initialState:a}=e,o=(0,r.useRef)();return o.current||(o.current=(0,d.P)(a)),(0,n.tZ)(u.Provider,{value:o.current,children:t})},Container:e=>{let{children:t}=e,a=(0,r.useContext)(u),{locale:i}=(0,O.h)(),{ramadanEvent:s,fetchInitData:c,updateTime:d,status:m}=(0,l.Y)(a,e=>({ramadanEvent:e.ramadanEvent,fetchInitData:e.fetchInitData,updateTime:e.updateTime,status:e.status}),o.X);(0,r.useEffect)(()=>{U.rV.includes(i)&&c()},[c]);let p=(0,Y.Y)(()=>{let e=a.getState().toDate;e&&d(e.add(1,"second"))},1e3);return(0,r.useEffect)(()=>(m!==w.I.IDLE?p.start():p.stop(),p.stop),[s,m]),(0,n.tZ)(n.HY,{children:t})},CloseBannerWrapper:()=>{let e=(0,r.useContext)(u),{shouldRender:t}=(0,l.Y)(e,e=>({shouldRender:e.shouldRender}),o.X),a=(0,f.U)(),[i,s]=(0,r.useState)(!1);return(0,n.tZ)(p.u,{mounted:t&&!i,transition:"fade",children:e=>(0,n.BX)(h.x,{className:"relative z-[2]",sx:e=>({".close-btn":{[e.fn.largerThan("sm")]:{transform:"translateY(-50%)"}}}),children:[(0,n.tZ)(RamadanWidgetComponent,{style:e}),(0,n.tZ)(m.Z,{size:24,color:"#fff",className:(0,g.default)("close-btn","cursor-pointer absolute z-[1]","top-[8px] md:top-1/2 right-[8px] md:right-3"),"data-event-category":"Header Banner","data-event-action":"Ramadan Widget Close","data-event-label":a,onClick:()=>s(!0)})]})})},ShortcutWidget:()=>{let e=(0,r.useContext)(u),{status:t,shouldRender:a}=(0,l.Y)(e,e=>({status:e.status,shouldRender:e.shouldRender}),o.X);return a?(0,n.tZ)(BoxWrapper,{withSmallPattern:!0,className:"px-3 py-3 rounded-lg",children:(0,n.tZ)("div",{className:"flex flex-col gap-1",children:t===w.I.IDLE?(0,n.tZ)(IdleHeading,{}):(0,n.BX)(n.HY,{children:[(0,n.tZ)(CountDownTimer,{className:"pt-[10px]"}),(0,n.tZ)(SponsorText,{className:"!text-[12px] text-center"})]})})}):null},CountDownTimer:CountDownTimer,BoxWrapper:BoxWrapper,SponsorText:SponsorText,StickyMobileWidget:()=>{let e=(0,x.d)(),t=(0,r.useContext)(u),{shouldRender:a}=(0,l.Y)(t,e=>({shouldRender:e.shouldRender}),o.X),[i]=(0,j.b)(),s=i.y>=window.innerHeight;return e&&a?(0,n.tZ)(p.u,{transition:"fade",mounted:s,children:e=>(0,n.tZ)(WidgetView,{style:e})}):null}}},llb7:function(e,t,a){var n,r;a.d(t,{I:function(){return n}}),(r=n||(n={})).IDLE="idle",r.COUNT_DOWN_TO_PRAY_TIME="count_down_to_pray_time",r.COUNT_DOWN_TO_BREAKING_TIME="count_down_to_breaking_time"},CBW8:function(e,t,a){a.d(t,{o:function(){return AdBlockContainer}});var n=a("BGKE"),r=a("P5LW"),o=a("N2Lg");let AdBlockContainer=e=>{let{children:t}=e,{locale:a}=(0,r.h)(),l=null===o.Zr||void 0===o.Zr?void 0:o.Zr.includes(a);return l?null:(0,n.tZ)(n.HY,{children:t})}},LplW:function(e,t,a){a.d(t,{E:function(){return FixedBottomAdBlock}});var n=a("BGKE"),r=a("q1tI"),o=a("Vvt1"),l=a.n(o);let i=l()(()=>Promise.all([a.e(4846),a.e(2233),a.e(1058),a.e(3295),a.e(1538),a.e(7152),a.e(5684),a.e(2574),a.e(9057),a.e(9884),a.e(7644),a.e(6962),a.e(6638),a.e(7741),a.e(3434),a.e(2433),a.e(5385),a.e(3564),a.e(7082),a.e(3158),a.e(5641),a.e(7454),a.e(7004),a.e(4758),a.e(6219),a.e(17),a.e(8990),a.e(4067),a.e(9487),a.e(9083),a.e(1520),a.e(270),a.e(7596),a.e(8217),a.e(7543),a.e(2835),a.e(2507),a.e(6885),a.e(7859),a.e(690),a.e(2730),a.e(6287),a.e(7682),a.e(1551),a.e(4870),a.e(9922),a.e(3133),a.e(612),a.e(2002),a.e(1880),a.e(7471),a.e(7165),a.e(5451),a.e(8612)]).then(a.bind(a,"lXMY")).then(e=>e.FixedBottomAdBlock),{loadableGenerated:{webpack:()=>["lXMY"]},ssr:!1}),FixedBottomAdBlock=e=>{let[t,a]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{setTimeout(()=>{a(!0)},500)},[]),t)?(0,n.tZ)(i,{...e}):null}},lXMY:function(e,t,a){a.r(t),a.d(t,{FixedBottomAdBlock:function(){return FixedBottomAdBlock}});var n=a("BGKE"),r=a("q1tI"),o=a("Yida"),l=a("Q6jF"),i=a("P5LW"),s=a("1LUM"),c=a("xJ6s");let FixedBottomAdBlock=e=>{let{className:t="",adUnitPath:a,divId:d,isMobile:u,contentId:m,ignoreRefreshAd:p=!1,customTargetings:h,...g}=e,{locale:f}=(0,i.h)(),[x,v]=(0,r.useState)(!0),[C,Z]=(0,r.useState)(!1),[b,y]=(0,r.useState)(!0),w=(0,r.useRef)(null),N=(0,r.useRef)((0,l.Z)()),k=(0,r.useRef)(null),I=(0,r.useRef)(),B=(0,r.useRef)();return((0,r.useEffect)(()=>{let checkAdShowing=()=>{B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{if(document.getElementById("subot--container"))v(!0);else{var e;v(!1),(null===(e=w.current)||void 0===e?void 0:e.clientHeight)?y(!1):y(!0)}checkAdShowing()},4e3)};return checkAdShowing(),()=>{I.current&&clearTimeout(I.current),B.current&&clearTimeout(B.current)}},[]),x||C)?null:(0,n.tZ)(c.nE,{ref:k,className:"".concat(t," sticky-bottom-ad"),"data-visible":!b,...g,children:a&&(0,n.tZ)(s.AdBlock,{wrapperProps:{m:0},ref:w,adUnitPath:a,size:u?[[320,50],[320,100]]:[728,90],divId:(d||"div-gpt-ad-sticky")+(u?"-mobile":"")+m+String(N.current),pos:["Sticky"],contentId:m,hideIfHasSubot:u,customTargetings:h,adDefaultSize:u?[320,50]:[728,90],showCloseBtn:!0,onCloseAd:()=>Z(!0),refreshInterval:f===o.L.Vietnam?30:60,ignoreRefreshAd:p})},u?"mobile":"desktop")}},xJ6s:function(e,t,a){a.d(t,{On:function(){return s},R7:function(){return c},nE:function(){return i},o$:function(){return d}});var n=a("rBCA"),r=a("tKpg"),o=a("iBNF"),l=a("rIrU");let i=(0,n.Z)("div",{target:"e1q29jt0"})("position:fixed;z-index:",l.kg.adBlock,";bottom:0;left:0;right:0;max-width:100%;background:none;transition:transform 0.3s ease-in-out;",r.M.mbUp,"{left:50%;width:fit-content;transform:translateX(-50%);}.close-sticky-button{position:absolute;display:flex;width:16px;height:16px;align-items:center;justify-content:center;background:#bfbfbf;border-radius:50%;color:white;cursor:pointer;font-size:12px;line-height:12px;transform:translate(50%,-50%);top:0;right:0;}opacity:0;pointer-events:none;&[data-visible='true']{opacity:1;pointer-events:auto;}"),s=(0,n.Z)("div",{target:"e1q29jt1"})("display:flex;justify-content:center;align-items:center;flex-direction:column;max-width:100%;",r.M.mbUp,"{width:fit-content;height:fit-content;}margin-inline:auto;/* margin:1rem auto;*/\n &[data-no-wrapper='false']{border:1px solid ",o.r.colors.neutral50,";background:",o.r.colors.neutral50,";}&[data-no-wrapper='true']{line-height:0;}&[data-header-bottom='true']{flex-direction:column-reverse;background:none;border:none;}",r.M.mbDown,"{[data-video='true'] [data-gc-instream-floating='true']{height:100px !important;div[class^='InstreamDom_player']{&[data-arb-resize-mode='compute-height']:not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_){height:100px !important;}div:last-child{width:180px !important;}}div[class^='InstreamDom_videoTitle']{position:absolute !important;left:180px !important;top:50%;transform:translate(0,-50%);z-index:999 !important;color:white !important;display:block !important;white-space:normal !important;text-align:left !important;font-size:14px !important;line-height:22px !important;font-weight:normal !important;padding:0 16px !important;width:auto !important;height:auto !important;max-height:66px !important;}div[class^='CloseButton']{top:23px !important;color:white !important;border-color:transparent !important;}}}"),c=(0,n.Z)("div",{target:"e1q29jt2"})("/* background:",o.r.colors.neutral50,";*/\n width:100%;padding:0 5px 1.5px;display:flex;align-items:center;justify-content:center;gap:5px;text-transform:capitalize;img{height:12px;width:12px;max-width:12px;max-height:12px;}&[data-header-bottom='true']{background:",o.r.colors.neutral50,";}span{font-size:10px;line-height:12px;color:",o.r.colors.gray400,";font-weight:400;}"),d=(0,n.Z)("div",{target:"e1q29jt3"})("background-color:white;background-image:url('/images/close-blue.svg');background-repeat:no-repeat;background-size:contain;background-position:center;width:14px;height:14px;position:absolute;top:0;right:0;z-index:1;cursor:pointer;")},"1LUM":function(e,t,a){a.r(t),a.d(t,{AdBlock:function(){return v}});var n=a("BGKE"),r=a("q1tI"),o=a("Yida"),l=a("Eso5"),i=a("O/o9"),s=a("dDsW"),c=a("P5LW"),d=a("N2Lg"),u=a("VIdu");window.pbjs=window.pbjs||{que:[]},window.googletag=window.googletag||{cmd:[]};var m=a("xJ6s");let p={},h=["TopBanner","MidBanner1","MidBanner2","masthead","Sticky"],_getForceRefreshConfig=(e,t)=>{if(e===o.L.Vietnam&&h.some(e=>t.includes(e)))return!0},displayAd=e=>{let{contentId:t,adUnitPath:a,size:n,divId:r,pos:o,sizeMapping:l,hideIfHasSubot:i,customTargetings:s,onSuccess:c}=e;if(!r||!document.getElementById(r))return console.error("divId is required");destroyAdSlot(r),window.googletag=window.googletag||{cmd:[]};let{googletag:d}=window;d.cmd.push(function(){let e=document.querySelector('meta[name="content_id"]'),m="string"==typeof t?t:null==e?void 0:e.content,h=d.defineSlot(a,n,r);if(document.querySelector("script[src*='https://micro.rubiconproject.com/prebid/dynamic']")&&function(e){var t;let a;let n=(t=e=>{window.googletag.pubads().refresh(e)},a=!1,n=>{a||(a=!0,t(n||e))});window.pbjs.que.push(function(){window.pbjs.rp.requestBids({callback:n,gptSlotObjects:e})}),setTimeout(n,3500)}([h]),h){try{s&&Object.keys(s).forEach(e=>{e&&(null==h||h.setTargeting(e,s[e]))})}catch(e){console.error(e)}p[r]=h,(0,u.Tm)(h),h.setTargeting("Pos",o),h.addService(d.pubads()),m&&h.setTargeting("Content_ID",m),l&&h.defineSizeMapping(l),i&&document.getElementById("subot--container")&&h.setTargeting("chatbot",!0),d.display(r),d.pubads().isInitialLoadDisabled()&&d.pubads().refresh([h]),null==c||c()}})},destroyAdSlot=e=>{if(p[e]){window.googletag=window.googletag||{cmd:[]};let{googletag:t}=window;t.cmd.push(function(){t.destroySlots([p[e]]),delete p[e]})}},g=["Sticky"],f=(0,r.forwardRef)(function(e,t){let{asPath:a,locale:r}=(0,c.h)();return(d.Rk[r]||[]).find(e=>a.startsWith(e))||a.startsWith("/health-tools/")&&!(d.rd[r]||[]).find(e=>encodeURIComponent(decodeURIComponent(a)).startsWith(encodeURIComponent(e)))||a.startsWith("/bot/")&&!(d.Iu[r]||[]).find(e=>encodeURIComponent(decodeURIComponent(a)).startsWith(encodeURIComponent(e)))?(0,n.tZ)("div",{ref:t}):(0,n.tZ)(x,{...e,ref:t})}),x=(0,r.forwardRef)(function(e,t){let{className:a,adUnitPath:d,size:u,divId:h,pos:f,sizeMapping:x,contentId:v,isHidden:C,hideIfHasSubot:Z,isSticky:b,refreshInterval:y,customTargetings:w,style:N,adDefaultSize:k,noWrapper:I,showCloseBtn:B,onCloseAd:T,headerBottom:S,wrapperProps:A,onlyRefreshInview:L,ignoreRefreshAd:_=!1,adWrapperStyle:R,adStyle:E,isVideo:D}=e,{locale:X}=(0,c.h)(),F=y||(X===o.L.Vietnam&&f.some(e=>g.includes(e))?30:void 0),{formatMessage:z}=(0,s.Z)(),{ref:M,inView:P}=(0,i.YD)(),H=(0,r.useRef)(null),W=(0,r.useRef)(F);W.current=_getForceRefreshConfig(X,f)?15:F;let V=_getForceRefreshConfig(X,f)||L,[Y,O]=(0,r.useState)(!1),setupRefreshAd=e=>{null!==H.current&&clearInterval(H.current),H.current=window.setInterval(()=>{window.googletag=window.googletag||{cmd:[]};let{googletag:e}=window;e.cmd.push(function(){p[h]&&e.pubads().refresh([p[h]])})},1e3*e)};if((0,r.useEffect)(()=>{P&&V&&W.current&&!_?setupRefreshAd(W.current):!P&&V&&null!==H.current&&clearInterval(H.current)},[P,V,_]),(0,r.useEffect)(()=>()=>{destroyAdSlot(h),H.current&&clearInterval(H.current)},[]),(0,r.useEffect)(()=>{C||displayAd({contentId:v,adUnitPath:d,size:u,divId:h,pos:f,sizeMapping:x,hideIfHasSubot:Z,customTargetings:w,onSuccess:()=>{!W.current||V||_||setupRefreshAd(W.current);let e=document.getElementById(h);e&&D&&e.setAttribute("data-video",String(!!D))}})},[C]),Y)return null;let U=(0,n.tZ)("div",{style:{position:"relative",width:"fit-content",height:"fit-content",overflow:"hidden",maxWidth:"100%",display:"flex",alignItems:"center",justifyContent:"center",...R},children:(0,n.tZ)("div",{ref:t,id:h,style:E})});if(b)return U;let j=k?k[0]:u?Array.isArray(u[0])?u[0][0]:u[0]:void 0,G=k?k[1]:u?Array.isArray(u[0])?u[0][1]:u[1]:void 0;return(0,n.BX)(l.x,{...A,className:a,children:[B&&(0,n.tZ)(m.o$,{onClick:()=>{null==T||T(),O(!0)}}),(0,n.tZ)(m.On,{ref:M,className:a,style:N,"data-no-wrapper":!!I,"data-header-bottom":!!S,children:I?(0,n.BX)(n.HY,{children:[B&&(0,n.tZ)(m.o$,{onClick:()=>{null==T||T(),O(!0)}}),U]}):(0,n.BX)(n.HY,{children:[(0,n.BX)(m.R7,{"data-header-bottom":!!S,children:[(0,n.tZ)("img",{loading:"lazy",src:"/svg/adsIcon.svg",alt:"ad icon"}),(0,n.tZ)("span",{"data-ads-type":!0,children:z({id:"adBanner.title",defaultMessage:"Advertisement"})}),B&&(0,n.tZ)(m.o$,{onClick:()=>{null==T||T(),O(!0)}})]}),(0,n.tZ)("div",{style:{minWidth:j||"100%",minHeight:G||"100%",position:"relative"},children:U})]})})]})}),v=(0,r.memo)(f,(e,t)=>e.adUnitPath===t.adUnitPath&&e.divId===t.divId&&e.className===t.className&&e.isHidden===t.isHidden)}}]);