const utilGlobal=function(){let uid;let data;let finalCall;const mediaQueries={maxMobile:"(max-width: 1024px)"};function handleError(response,errorText,responseType="json"){if(!response.ok){if(uiGlobal&&uiGlobal.toggleLoader&&uiGlobal.globalSwal&&errorText){uiGlobal.showGlobalSwalError(errorText)}throw Error(`${errorText} ||| ${response.statusText}`)}}function clearOrderStorage(){if(dataModelGlobal.isOrder){return}const ignoredSessionStorageData=["authData","filters","server-type","serverFilters"];Object.keys(sessionStorage).forEach((key=>{if(ignoredSessionStorageData.indexOf(key)!==-1){return}sessionStorage.removeItem(key)}))}const changeOrderLink=(serverPlan,instantType,params)=>{if(serverPlan==="D104a"){serverPlan="D104"}else if(serverPlan==="D105a"||serverPlan==="D105b"){serverPlan="D105"}return`/newOrder/dedicated/config/?type=${serverPlan}${instantType?`&instantType=${instantType}`:""}${params?`${params}`:""}`};function calculateServerPrice(array){return array.reduce(((currentCount,total)=>{const count=!currentCount?0:currentCount;return total+=count}),0)}function getServerDefaultComponents(serverInitialData,componentsArr){let object={};const{DefaultConfig:DefaultConfig}=serverInitialData;componentsArr.forEach((key=>{let formattedKey=key;if(formattedKey==="HDD"||formattedKey==="OS"){formattedKey=DefaultConfig.hasOwnProperty("JBOD")?"JBOD":"EmbeddedRAID"}if(DefaultConfig.hasOwnProperty(formattedKey)){const defaultConfigValue=DefaultConfig[formattedKey];let formattedValue=serverInitialData[key].filter((item=>item.Value===defaultConfigValue))[0];if(key==="HDD"){formattedValue=serverInitialData[key].filter((item=>item.SubItem===defaultConfigValue[0].SubItem))[0]}if(key==="OS"){formattedValue=serverInitialData[key].filter((item=>item.Value===defaultConfigValue[0].OS))[0]}if(key==="CPU"){formattedValue=serverInitialData[key].filter((item=>item.SubItem===defaultConfigValue.SubItem))[0]}if(key==="IPv"){formattedValue=serverInitialData[key].filter((item=>item.SubItem===defaultConfigValue[0].SubItem))[0]}object[key]=formattedValue?formattedValue:serverInitialData[key][0]}else{object[key]=serverInitialData[formattedKey][0]}}));return object}const getPriceDiscount=data=>{let price=0;if(!Object.hasOwn(data,"initialPrice")||!Object.hasOwn(data,"discount")||!Object.hasOwn(data,"type")){console.error("Discount price data is invalid!");return}const{initialPrice:initialPrice,discount:discount,type:type}=data;switch(type){case"fixed-amount":{price=initialPrice-discount;break}case"percentage":{price=initialPrice*(discount/100);break}}return price};function OTP(){var html=`\n
Enter the 6-digit code that the application generates to verify and complete setup.
\nIn case you lost your Authenticator Code, make sure to contact us.
\n