(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5092,7074,9675,4137,7202],{Cov9:function(n,t,l){"use strict";l.d(t,{h:function(){return e},x:function(){return a}});var i=l("NMK5");let e=(0,i.Jj)(n=>{var t,l;return void 0!==n&&n?{province:n.state||"",keyCategory:n.key_category,category:n.category,description:n.description,qualityMin:n.air_quality_min||null,qualityMax:n.air_quality_max||null,currentAqiusValue:(null==n?void 0:null===(t=n.pollution)||void 0===t?void 0:t.aqius)||null,updatedTime:(null==n?void 0:null===(l=n.pollution)||void 0===l?void 0:l.ts)||null}:null}),a=(0,i.Jj)(n=>void 0!==n&&n?{title:n.title||"",description:n.description||"",disclaimer:n.disclaimer||"",featuredImage:n.featured_image||""}:null)},ejbI:function(n,t,l){"use strict";function myImageLoader(n){let{src:t="",width:l,quality:i}=n;return t.includes("?")?"".concat(t,"&w=").concat(l,"&q=").concat(i||75):"".concat(t,"?w=").concat(l,"&q=").concat(i||75)}l.d(t,{Z:function(){return myImageLoader}})},Fyo5:function(n,t,l){"use strict";l.d(t,{B9:function(){return isValidStatus},le:function(){return checkValidDataApi},rx:function(){return checkValidData}});var i=l("qe1T");function checkValidDataApi(n){var t;let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!n&&"string"==typeof(null==n?void 0:n.state)&&(!!l||""!==n.state)&&"number"==typeof(null==n?void 0:null===(t=n.pollution)||void 0===t?void 0:t.aqius)}function checkValidData(n){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!n&&"string"==typeof(null==n?void 0:n.province)&&(!!t||""!==n.province)&&"number"==typeof(null==n?void 0:n.currentAqiusValue)}function isValidStatus(n){return Object.values(i.P).includes(n)}},QW8v:function(n,t,l){"use strict";l.d(t,{W:function(){return c}});var i=l("VNqU"),e=l("09QT"),a=l("Cov9"),o=l("oQBk"),u=l("Tk9B"),r=l("Fyo5");let c=(0,i.Ue)((n,t)=>({loading:!1,error:null,currentData:null,cardInfo:null,listProvinces:null,currentLocation:null,setCurrentLocation(t){n({currentLocation:t})},fetchInitData:async()=>{let{loading:l,listProvinces:i}=t();if(!l&&!i){n({loading:!0,error:null});try{var c,d;let t=await (0,u.k)(!1),l=(null==t?void 0:t.location)||null,[i,s,v,f]=await Promise.all([(0,e.callApiNew)(o.PATHS.HEALTH_TOOL.GET_AIR_POPULATION_INFO),l?(0,e.callApiNew)(o.PATHS.HEALTH_TOOL.GET_AIR_POPULATION_SPECIFIC_PROVINCE,{params:{type:"geo",lat:l.latitude,lng:l.longitude}}):null,(0,e.callApiNew)(o.PATHS.HEALTH_TOOL.GET_AIR_POPULATION_DEFAULT),(0,e.callApiNew)(o.PATHS.HEALTH_TOOL.GET_AIR_POPULATION_PROVINCE),(0,u.k)(!1)]),p=null==s?void 0:s.data,_=null==v?void 0:v.data,A=(0,r.le)(p,!0),T=(0,r.le)(_),y=!!(null==i?void 0:i.data)&&!!(null==f?void 0:null===(c=f.data)||void 0===c?void 0:c.provinces)&&(A||T);if(y){let e=l&&A;n({currentLocation:e?t:null,cardInfo:(0,a.x)(null==i?void 0:i.data),currentData:(0,a.h)(e?p:T?_:null),listProvinces:(null==f?void 0:null===(d=f.data)||void 0===d?void 0:d.provinces)||[]})}else n({error:"General error"})}catch(t){n({error:t.message})}finally{n({loading:!1})}}},retryFetchInitData:async()=>{n({error:null}),await t().fetchInitData()}}))},VYCi:function(){},"A/s0":function(){},YZfw:function(){},uMuU:function(){}}]);