(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1203],{60873:function(e,n,t){Promise.resolve().then(t.bind(t,97832)),Promise.resolve().then(t.bind(t,68536))},68536:function(e,n,t){"use strict";t.d(n,{ClientLayout:function(){return l}});var r=t(93720),o=t(97832),i=t(58802);function l(e){let{children:n,locale:t,messages:l}=e;return(0,r.jsx)(o.default,{locale:t,messages:l,onError:function(e){"MISSING_MESSAGE"!==e.code&&console.error(e)},children:(0,r.jsx)(i.L,{children:n})})}},58802:function(e,n,t){"use strict";t.d(n,{L:function(){return d},Y:function(){return m}});var r=t(93720),o=t(15312),i=t(20667),l=t(7545);let u=null,c=null,a=async()=>{if("enabled"===localStorage.getItem("__BY_MOCK_COMING_SOON__")){let e=Date.now();return[{configKey:"enable_time",configVal:"".concat(Math.floor((e-36e5)/1e3),",").concat(Math.floor((e+36e5)/1e3))},{configKey:"front-end_optional_module",configVal:"countDown,comingSoon,pre-register,T&C,T&C-1,T&C-2,T&C-3,imprint,imprint-companyName,imprint-businessAddress,imprint-businessActivity,imprint-registrationNumber,imprint-taxId,imprint-authorizedRepresentative"}]}return null!==u?u:null!==c?c:c=(async()=>{try{var e,n;let t=await i.Z.get("".concat((0,l.Wd)(),"/compliance/v1/wall/site-extend-info"),{params:{moduleId:"SITE_MODULE_COMING_SOON_PAGE"}}),r=(null==t?void 0:null===(n=t.data)||void 0===n?void 0:null===(e=n.result)||void 0===e?void 0:e.items)||[];return u=r,r}catch(e){return console.error("fetch coming soon config error:",e),u=[],[]}})()};a();let s=()=>{let[e,n]=(0,o.useState)(u||[]),[t,r]=(0,o.useState)(null===u);(0,o.useEffect)(()=>{(async()=>{if(null!==u){n(u),r(!1);return}try{let e=await a();n(e)}catch(e){console.error("load coming soon config error:",e)}finally{r(!1)}})()},[]);let i=(0,o.useMemo)(()=>{var n;let t=null===(n=e.find(e=>"enable_time"===e.configKey))||void 0===n?void 0:n.configVal.split(",");if(!t||t.length<2)return!1;let r=t[0],o=t[1],i=Date.now(),l=10===r.length?1e3*Number(r):Number(r),u=10===o.length?1e3*Number(o):Number(o);return i>=l&&i<=u},[e]);return{comingSoonConfig:e,configLoading:t,isInTimeRange:i}},f=(0,o.createContext)(void 0),d=e=>{let{children:n}=e,{isInTimeRange:t,configLoading:o,comingSoonConfig:i}=s();return(0,r.jsx)(f.Provider,{value:{isInTimeRange:t,configLoading:o,comingSoonConfig:i},children:n})},m=()=>{let e=(0,o.useContext)(f);if(void 0===e)throw Error("useComingSoonContext must be used within a ComingSoonProvider");return e}},97832:function(e,n,t){"use strict";t.d(n,{default:function(){return i}});var r=t(12856),o=t(26657);function i(e){let{locale:n,...t}=e;if(!n)throw Error(void 0);return(0,o.jsx)(r.Pj,{locale:n,...t})}}},function(e){e.O(0,[6469,667,8233,3614,1744],function(){return e(e.s=60873)}),_N_E=e.O()}]); //# sourceMappingURL=layout-48a5e7850eb83887.js.map