1import{sG as de,il as ge,n as _,fq as ye,sH as ee,sI as pe,a as j,c8 as z,bx as te,sJ as F,sK as ae,g6 as C,g7 as x,ai as V,sL as Z}from"./commonChunk.ClFq2l8G.js";import{A as se,t as H}from"./vendorChunk.B0S1SHvJ.js";import"../vendors/vendor-stable.B-qaYwd4.js";const X=async(t=!1,S=!1,y=!0)=>{const l=a=>ye.ossDecrypt(a),{useMockMaintainIframe:u}=de(),{domainListMap:p}=ge(),s=()=>{var a;return _.request({baseURL:"/",url:u?`${window.location.origin}/pages/503/cocos/maintain-time.json`:"/cocos/maintain-time.json",method:"GET",params:{timestamp:Date.now()}},{maxRetryCount:Math.max(((a=p.ossDomain)==null?void 0:a.length)||0,3),oss:{enable:!0,force:!0},token:{type:!1},cache:{useCacheOnError:()=>!1},error:{checkResCode:!1,action:"silent",failedActions:[{type:"statusCode",code:[404,403],actions:{retry:!1}}]},crypto:{enable:!1}}).then(o=>{const g=typeof o.data=="string"?JSON.parse(l(o.data)):o.data;return JSON.stringify(g)==="{}"?Promise.reject(new Error("empty-maintain-error")):!y||y&&ee(g).health?g:Promise.reject()}).catch(()=>Promise.reject(new Error("request-error")))},w=()=>_.request({baseURL:"/",url:"/cocos/maintain-time-default.json",method:"GET",params:{timestamp:Date.now()}},{oss:{enable:!0,force:!0},token:{type:!1},error:{checkResCode:!1,action:"silent",failedActions:[{type:"statusCode",code:[404,403],actions:{retry:!1}}]},crypto:{enable:!1}}).then(a=>{const o=typeof a.data=="string"?JSON.parse(l(a.data)):a.data;return o&&(o._isDefault=!0),o});try{if(t)return w();if(!S)return s();try{return await s()}catch(a){return await w()}}catch(a){return Promise.reject()}},he=()=>_.request({url:"/api/lobby/h5/config/getAccessRestrictedInfo"},{token:{type:"staticOnly"},oss:{enable:!0},omitKey:["platformType","currency"],crypto:{enable:!1}}),Se=async t=>{const S=await he(),y=await pe().catch(()=>{}),l={...S.data.data,...y};let u="";const p="page-403-payload";sessionStorage.setItem(p,JSON.stringify(l)),t&&(u="page-403-log",sessionStorage.setItem(u,t));const{siteInfos:s}=j(),w=(s==null?void 0:s.title)||(s==null?void 0:s.siteName)||"",a=se(`${window.location.origin}/pages/403/index.html`,{logId:u,payloadId:p,title:w,t:Math.ceil(Date.now()/(1e3*60*5))}),{updateAreaStatus:o}=z();o(!0);const g=te();g.closeAll(),g.open("iframeAccessRestrictedPopup",{options:{src:a,fullScreen:!0,scrollable:!1,closeOnRouteChange:!1,zIndex:ae["modal-top-z-index"],style:{backgroundColor:F.iframeMaintainPopupBg}}})};let J=!1;const d={state:"unknown",timestamp:null},ke=async t=>{var S,y;if(!J){J=!0;try{t=Object.assign({isSiteFreeze:!1,isSiteFreezeAndMaintain:!1,ipCheck:!0,check403:!1},t);const l=te(),u=!0,{isSiteFreeze:p,isSiteFreezeAndMaintain:s,ipCheck:w,check403:a}=t,o=p,g=s,O=!p&&!s,q="page-503-payload";let U;const{updateSiteMaintenanceStatus:W,updateIPCheck:$}=z(),re=()=>{clearTimeout(U),C.destroy(x.MAINTAININFO),W(!1)},G=e=>{const{siteConfig:r}=j(),{language:n}=V();return{siteConfig:r,...e,staffall:{online:{type:1,url:e.online_service}},maintainTimeInfo:ee(e),requestInfo:t.requestInfo,language:n}},E=e=>{const r=e.end_time*1e3-Date.now();r>0&&(C.destroy(x.MAINTAININFO),U=window.setTimeout(()=>{C.create({key:x.MAINTAININFO,immediate:!0,interval:1e3*60*5,pollingHandler:async()=>{const[n,i]=await H(X(!1,!1));if(n&&["empty-maintain-error","request-error"].includes(n.message))return b.end();i&&JSON.stringify(i)!==JSON.stringify(e)&&(b.update(G(i)),E(i))}})},r))},B=e=>{Object.entries(e).forEach(([r,n])=>{sessionStorage.setItem(r,n)})},v=e=>{e.style.textAlign="left";const r=e.children;for(const n of r)v(n)},b={update:e=>{B({[q]:JSON.stringify(e)})},start:async e=>{const{siteMaintenanceStatus:r,areaStatus:n}=z();if(r||!n)return;const i=503,{siteInfos:h}=j(),T=G(e),ie=JSON.stringify(T),oe=(h==null?void 0:h.title)||(h==null?void 0:h.siteName)||"Access Restricted",ce=se(`${window.location.origin}/pages/${i}/index.html`,{payloadKey:q,title:oe,useIframe:u,t:Math.ceil(Date.now()/(1e3*60*5))});if(W(!0),u){B({[q]:ie}),E(e);const f=(T.annSkinConfig||[]).find(A=>A.languageCodes.includes(T.language||"")&&A.backgroundColorType===1),le=f!=null&&f.backgroundColorType?{backgroundColor:(f==null?void 0:f.backgroundColorUrl)||F.iframeMaintainPopupBg,backgroundImage:(f==null?void 0:f.backgroundColorUrl)||"",width:"6.9rem"}:{backgroundColor:F.iframeMaintainPopupBg,width:"6.9rem"};l.closeAll(),l.open("iframeMaintainPopup",{options:{src:ce,closeOnRouteChange:!1,zIndex:ae["modal-top-z-index"],style:le,className:"maintain-pop"}}).then(()=>{var A;O&&E(e);try{const M=(A=document.querySelector(".maintain-pop"))==null?void 0:A.querySelector(".ui-iframe-popup__content"),k=M==null?void 0:M.querySelector("iframe");k&&(k.onload=()=>{var Y,Q;const m=(Q=(Y=k.contentDocument)==null?void 0:Y.body)==null?void 0:Q.querySelector(".matainContentWrap"),N=m==null?void 0:m.querySelector("#accessRestrictedImagePath"),c=m==null?void 0:m.querySelector("#accessRestrictedContent"),P=m==null?void 0:m.querySelector("#accessRestrictedLogInfo"),ue=c.querySelectorAll("img")||[],fe=[N,...Array.from(ue)].map(L=>new Promise((R,me)=>{const D=new Image;D.src=L.src,D.onload=()=>R(D),D.onerror=()=>me(new Error(`Failed to load image: ${L.src}`))}));Promise.all(fe).then(()=>{setTimeout(()=>{const L=(c==null?void 0:c.scrollHeight)>c.clientHeight?c.clientHeight:c==null?void 0:c.scrollHeight,R=Number(L)+Number(N==null?void 0:N.scrollHeight)+Number(P==null?void 0:P.scrollHeight)||0;k.style.height=`${R+10}px`,M.style.height=`${R+10}px`},150)}),V().isRtlLayoutWithLeftAlign&&v(c)})}catch(M){console.warn(M)}})}},end:()=>{u&&l.close("iframeMaintainPopup"),re()}},[K,I]=await H(X(o,g)),ne=!K&&!!I;if(w&&O){if(ne){const r=Date.now();if(d.state!=="unknown"&&d.timestamp&&r-d.timestamp>=36e5&&(d.state="unknown",d.timestamp=null),d.state==="whiteList")return;if(d.state==="notWhiteList"){b.start(I);return}const n=new Date(I.start_time*1e3).getTime()<=Date.now(),[,i]=await H(Z("whiteList",n?2:void 0));i&&$(i),i&&i.areaStatus&&!i.siteMaintenanceStatus?d.state="whiteList":(d.state="notWhiteList",b.start(I))}else if(a){const e=await Z("area");$(e),typeof e.areaStatus=="boolean"&&!e.areaStatus&&Se(JSON.stringify({data:e}))}}else K?(S=t==null?void 0:t.onError)==null||S.call(t):b.start(I)}catch(l){}finally{J=!1,(y=t==null?void 0:t.onCallback)==null||y.call(t)}}};export{ke as to503};
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.