define("service","underscore jquery set CryptoJS".split(" "),function(b9,cG,aE,bs){function a8(c1,c0){if(b9.isArray(c1)){for(var c2=0;c2<c1.length;c2++){cR(c1[c2])}}else{cR(c1)}cH(c0)}function m(c1,c0){if(b9.isArray(c1)){for(var c2=0;c2<c1.length;c2++){bm(c1[c2])}}else{bm(c1)}B(c0)}function aO(){return aY({}).get_user_mac_addr}function bN(c0,c3){return bv(arguments,{},c1,c2,null,false);function c1(c4,c5){return{multi_data:1,cmd:"DDNS_Enable,DDNS_Mode,DDNSProvider,DDNSAccount,DDNSPassword,DDNS,DDNS_Hash_Value"}}function c2(c4){if(c4){return{DDNS_Enable:c4.DDNS_Enable,DDNS_Mode:c4.DDNS_Mode,DDNSProvider:c4.DDNSProvider,DDNSAccount:c4.DDNSAccount,DDNSPassword:c4.DDNSPassword,DDNS:c4.DDNS,DDNS_Hash_Value:c4.DDNS_Hash_Value}}else{return U}}}function aP(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4=cG.extend({},c2);return c4}function c1(c2){if(c2){return c2}else{return U}}}function cc(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="modem_main_state,puknumber,pinnumber,blc_wan_mode,blc_wan_auto_mode,psw_fail_num_str,login_lock_time,psw_changed";c4.multi_data=1;return c4}function c1(c2){if(c2){if(c2.blc_wan_mode=="AUTO"){c2.blc_wan_mode=c2.blc_wan_auto_mode?c2.blc_wan_auto_mode:"AUTO_PPP"}else{c2.blc_wan_mode=c2.blc_wan_mode?c2.blc_wan_mode:"PPP"}c2.psw_fail_num_str=c2.psw_fail_num_str==""?aE.MAX_LOGIN_COUNT:c2.psw_fail_num_str;c2.login_lock_time=c2.login_lock_time==""?"300":c2.login_lock_time;return c2}else{return U}}}function aL(){return bv(arguments,{},c0,c1,{errorType:"badPassword"},true);function c0(c2,c3){var c4={goformId:"LOGIN",password:aE.PASSWORD_ENCODE?Base64.encode(c2.password):c2.password};return c4}function c1(c2){if(c2&&(c2.result=="0"||c2.result=="4")){br.isLoggedIn=true;return{result:true}}else{var c3={};switch(c2.result){case"1":c3={errorType:"Login Fail"};break;case"2":c3={errorType:"duplicateUser"};break;case"3":c3={errorType:"badPassword"};break;default:c3={errorType:"Login Fail"};break}br.isLoggedIn=false;return cG.extend(U,c3)}}}function ba(){if(br.isLoggedIn!=undefined){return bv(arguments,{status:br.isLoggedIn?"loggedIn":"loggedOut"})}else{var c2={};if(!aE.HAS_LOGIN){c2.status="loggedIn";c2.errorType="no_login";br.isLoggedIn=true}return bv(arguments,c2,c0,c1,null,false)}function c0(c3,c4){var c5={};c5.cmd="loginfo";c5.multi_data=1;return c5}function c1(c4){if(c4&&c4.loginfo||c4.loginfo==""){var c3={};switch(c4.loginfo){case"ok":br.isLoggedIn=true;c3.status="loggedIn";break;default:br.isLoggedIn=false;c3.status="loggedOut";break}return c3}else{br.isLoggedIn=undefined;return cG.extend(U,{errorType:"LoginStatusError"})}}}function I(){return bv(arguments,{},c0,c1,{},true);function c0(c2,c3){var c4={};c4.goformId="ENTER_PIN";c4.PinNumber=c2.PinNumber;return c4}function c1(c2){if(c2&&c2.result==="success"){return{result:true}}else{return{result:false}}}}function S(){return bv(arguments,{},c0,c1,{},true);function c0(c2,c3){var c4={};c4.goformId="ENTER_PUK";c4.PUKNumber=c2.PUKNumber;c4.PinNumber=c2.PinNumber;return c4}function c1(c2){if(c2&&c2.result==="success"){return{result:true}}else{return{result:false}}}}function e(){if(br.isLoggedIn===undefined){var c0=ba();return{networkType:br.networkType,signalImg:br.signalImg,networkOperator:br.networkOperator,spn_b1_flag:br.spn_b1_flag,spn_name_data:br.spn_name_data,spn_b2_flag:br.spn_b2_flag,connectStatus:br.connectStatus,rj45ConnectStatus:br.rj45ConnectStatus,ssid1AttachedNum:br.ssid1AttachedNum,ssid2AttachedNum:br.ssid2AttachedNum,wirelessDeviceNum:br.ssid1AttachedNum+br.ssid2AttachedNum,roamingStatus:br.roamingStatus,wifiStatus:br.wifiStatus,simStatus:br.simStatus,pinStatus:br.pinStatus,batteryStatus:br.batteryStatus,batteryLevel:br.batteryLevel,batteryPers:br.batteryPers,batteryTime:br.batteryTime,ssid:br.ssid,authMode:br.authMode,data_counter:br.data_counter,isLoggedIn:c0.status=="loggedIn",newSmsReceived:br.newSmsReceived,smsReportReceived:br.smsReportReceived,smsUnreadCount:br.smsUnreadCount,limitVolumeEnable:br.limitVolumeEnable,limitVolumeType:br.limitVolumeType,limitVolumePercent:br.limitVolumePercent,limitVolumeSize:br.limitVolumeSize,connectWifiProfile:br.connectWifiProfile,connectWifiSSID:br.connectWifiSSID,connectWifiStatus:br.connectWifiStatus,multi_ssid_enable:br.multi_ssid_enable,roamMode:br.roamMode,blc_wan_mode:br.blc_wan_mode,current_upgrade_state:br.current_upgrade_state,is_mandatory:br.is_mandatory,new_version_state:br.new_version_state,allowRoamingUpdate:br.allowRoamingUpdate,ap_station_enable:br.ap_station_enable,ap_station_mode:br.ap_station_mode,dialMode:br.dialMode,fota_package_already_download:br.fota_package_already_download,ethWanMode:br.ethWanMode,fota_user_selector:br.fota_user_selector,defaultWanName:br.defaultWanName}}return{networkType:br.networkType,signalImg:br.signalImg,networkOperator:br.networkOperator,spn_b1_flag:br.spn_b1_flag,spn_name_data:br.spn_name_data,spn_b2_flag:br.spn_b2_flag,connectStatus:br.connectStatus,rj45ConnectStatus:br.rj45ConnectStatus,ssid1AttachedNum:br.ssid1AttachedNum,ssid2AttachedNum:br.ssid2AttachedNum,wirelessDeviceNum:br.ssid1AttachedNum+br.ssid2AttachedNum,roamingStatus:br.roamingStatus,wifiStatus:br.wifiStatus,simStatus:br.simStatus,pinStatus:br.pinStatus,batteryStatus:br.batteryStatus,batteryLevel:br.batteryLevel,batteryPers:br.batteryPers,batteryTime:br.batteryTime,ssid:br.ssid,authMode:br.authMode,data_counter:br.data_counter,isLoggedIn:br.isLoggedIn,newSmsReceived:br.newSmsReceived,smsReportReceived:br.smsReportReceived,smsUnreadCount:br.smsUnreadCount,limitVolumeEnable:br.limitVolumeEnable,limitVolumeType:br.limitVolumeType,limitVolumePercent:br.limitVolumePercent,limitVolumeSize:br.limitVolumeSize,connectWifiProfile:br.connectWifiProfile,connectWifiSSID:br.connectWifiSSID,connectWifiStatus:br.connectWifiStatus,multi_ssid_enable:br.multi_ssid_enable,blc_wan_mode:br.blc_wan_mode,roamMode:br.roamMode,current_upgrade_state:br.current_upgrade_state,is_mandatory:br.is_mandatory,new_version_state:br.new_version_state,allowRoamingUpdate:br.allowRoamingUpdate,ap_station_enable:br.ap_station_enable,ap_station_mode:br.ap_station_mode,dialMode:br.dialMode,fota_package_already_download:br.fota_package_already_download,ethWanMode:br.ethWanMode,fota_user_selector:br.fota_user_selector,defaultWanName:br.defaultWanName}}function bu(){var c1=br.limitVolumeType=="1";var c0={data_counter:br.data_counter,connectStatus:br.connectStatus,rj45ConnectStatus:br.rj45ConnectStatus,limitVolumeEnable:br.limitVolumeEnable,limitVolumeType:br.limitVolumeType,limitVolumePercent:br.limitVolumePercent,networkType:br.networkType};if(c1){c0.limitDataMonth=br.limitVolumeSize;c0.limitTimeMonth=0}else{c0.limitTimeMonth=br.limitVolumeSize;c0.limitDataMonth=0}c0.blc_wan_mode=br.blc_wan_mode;return c0}function D(){br.newSmsReceived=false}function bX(){br.smsReportReceived=false}function b(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="sms_capacity_info";return c4}function c1(c2){return{nvTotal:parseInt(c2.sms_nv_total,10),nvUsed:parseInt(c2.sms_nv_rev_total,10)+parseInt(c2.sms_nv_send_total,10)+parseInt(c2.sms_nv_draftbox_total,10),simTotal:parseInt(c2.sms_sim_total,10),simUsed:parseInt(c2.sms_sim_rev_total,10)+parseInt(c2.sms_sim_send_total,10)+parseInt(c2.sms_sim_draftbox_total,10),nvReceive:parseInt(c2.sms_nv_rev_total,10),nvSend:parseInt(c2.sms_nv_send_total,10),nvDraft:parseInt(c2.sms_nv_draftbox_total,10),simReceive:parseInt(c2.sms_sim_rev_total,10),simSend:parseInt(c2.sms_sim_send_total,10),simDraft:parseInt(c2.sms_sim_draftbox_total,10)}}}function a4(){var c4=arguments[1];var c3=0;return bv(arguments,{},c0,c2,null,true);function c0(c5,c6){var c7={};c7.notCallback=true;c7.goformId="CONNECT_NETWORK";return c7}function c2(c5){if(c5.result=="success"){c3=(new Date).getTime();cH(c1)}else{c4({result:false})}}function c1(c5){if(c5.ppp_status=="ppp_connecting"){br.connectStatus="ppp_connecting"}else{if(c5.ppp_status=="ppp_connected"){B(c1);br.connectStatus="ppp_connected";c4({result:true,status:br.connectStatus})}else{if((new Date).getTime()-c3<1e4){br.connectStatus="ppp_connecting"}else{B(c1);c4({result:false})}}}}}function O(){var c4=arguments[1];var c3=0;return bv(arguments,{},c1,c2,null,true);function c1(c5,c6){var c7={};c7.notCallback=true;c7.goformId="DISCONNECT_NETWORK";return c7}function c2(c5){if(c5.result=="success"){c3=(new Date).getTime();cH(c0)}else{c4({result:false})}}function c0(c5){if(c5.ppp_status=="ppp_disconnecting"){br.connectStatus="ppp_disconnecting"}else{if(c5.ppp_status=="ppp_disconnected"){B(c0);br.connectStatus="ppp_disconnected";c4({result:true,status:br.connectStatus})}else{if((new Date).getTime()-c3<1e4){br.connectStatus="ppp_disconnecting"}else{B(c0);c4({result:false})}}}}}function l(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="APN_configtmp0,APN_configtmp1,APN_configtmp2,APN_configtmp3,APN_configtmp4,APN_configtmp5,APN_configtmp6,APN_configtmp7,APN_configtmp8,APN_configtmp9,APN_configtmp10,APN_configtmp11,APN_configtmp12,APN_configtmp13,APN_configtmp14,APN_configtmp15,APN_configtmp16,APN_configtmp17,APN_configtmp18,APN_configtmp19,ipv6_APN_configtmp0,ipv6_APN_configtmp1,ipv6_APN_configtmp2,ipv6_APN_configtmp3,ipv6_APN_configtmp4,ipv6_APN_configtmp5,ipv6_APN_configtmp6,ipv6_APN_configtmp7,ipv6_APN_configtmp8,ipv6_APN_configtmp9,ipv6_APN_configtmp10,ipv6_APN_configtmp11,ipv6_APN_configtmp12,ipv6_APN_configtmp13,ipv6_APN_configtmp14,ipv6_APN_configtmp15,ipv6_APN_configtmp16,ipv6_APN_configtmp17,ipv6_APN_configtmp18,ipv6_APN_configtmp19,m_profile_name,profile_name,wan_dial,pdp_type,pdp_select,index,Current_index,apn_auto_config,ipv6_apn_auto_config,apn_mode,wan_apn,ppp_auth_mode,ppp_username,ppp_passtmp,ipv6_wan_apn,ipv6_pdp_type,ipv6_ppp_auth_mode,ipv6_ppp_username,ipv6_ppp_passtmp,apn_num_preset";c4.multi_data=1;return c4}function c1(c2){if(c2){return{APNs:c2.APN_configtmp0+"||"+c2.APN_configtmp1+"||"+c2.APN_configtmp2+"||"+c2.APN_configtmp3+"||"+c2.APN_configtmp4+"||"+c2.APN_configtmp5+"||"+c2.APN_configtmp6+"||"+c2.APN_configtmp7+"||"+c2.APN_configtmp8+"||"+c2.APN_configtmp9+"||"+c2.APN_configtmp10+"||"+c2.APN_configtmp11+"||"+c2.APN_configtmp12+"||"+c2.APN_configtmp13+"||"+c2.APN_configtmp14+"||"+c2.APN_configtmp15+"||"+c2.APN_configtmp16+"||"+c2.APN_configtmp17+"||"+c2.APN_configtmp18+"||"+c2.APN_configtmp19,ipv6APNs:c2.ipv6_APN_configtmp0+"||"+c2.ipv6_APN_configtmp1+"||"+c2.ipv6_APN_configtmp2+"||"+c2.ipv6_APN_configtmp3+"||"+c2.ipv6_APN_configtmp4+"||"+c2.ipv6_APN_configtmp5+"||"+c2.ipv6_APN_configtmp6+"||"+c2.ipv6_APN_configtmp7+"||"+c2.ipv6_APN_configtmp8+"||"+c2.ipv6_APN_configtmp9+"||"+c2.ipv6_APN_configtmp10+"||"+c2.ipv6_APN_configtmp11+"||"+c2.ipv6_APN_configtmp12+"||"+c2.ipv6_APN_configtmp13+"||"+c2.ipv6_APN_configtmp14+"||"+c2.ipv6_APN_configtmp15+"||"+c2.ipv6_APN_configtmp16+"||"+c2.ipv6_APN_configtmp17+"||"+c2.ipv6_APN_configtmp18+"||"+c2.ipv6_APN_configtmp19,apnMode:c2.apn_mode,profileName:c2.m_profile_name||c2.profile_name,wanDial:c2.wan_dial,pdpType:c2.pdp_type=="IP"?"IP":c2.ipv6_pdp_type,pdpSelect:c2.pdp_select,index:c2.index,currIndex:c2.Current_index,autoApns:c2.apn_auto_config,autoApnsV6:c2.ipv6_apn_auto_config,wanApn:c2.wan_apn,authMode:c2.ppp_auth_mode.toLowerCase(),username:c2.ppp_username,password:c2.ppp_passtmp,dnsMode:"",dns1:"",dns2:"",wanApnV6:c2.ipv6_wan_apn,authModeV6:c2.ipv6_ppp_auth_mode.toLowerCase(),usernameV6:c2.ipv6_ppp_username,passwordV6:c2.ipv6_ppp_passtmp,dnsModeV6:"",dns1V6:"",dns2V6:"",apnNumPreset:c2.apn_num_preset}}else{return{result:false}}}}function aw(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={apn_action:"delete",apn_mode:"manual",index:c2.index};c4.goformId="APN_PROC_EX";return c4}function c1(c2){if(c2.result=="success"){return{result:true}}else{return{result:false}}}}function bt(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c4){var c3={goformId:"APN_PROC_EX",apn_mode:c2.apnMode};if(c2.apnMode=="manual"){c3.apn_action="set_default";c3.set_default_flag="1";c3.pdp_type=c2.pdpType;c3.index=c2.index}return c3}function c1(c2){if(c2.result=="success"){return{result:true}}else{return{result:false}}}}function bl(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"APN_PROC_EX",apn_action:"save",apn_mode:"manual",profile_name:c2.profileName,wan_dial:"*99#",pdp_type:c2.pdpType,pdp_select:"auto",index:c2.index};if(c2.pdpType=="IP"){cG.extend(c4,{wan_apn:c2.wanApn,ppp_auth_mode:c2.authMode,ppp_username:c2.username,ppp_passtmp:c2.password})}else{if(c2.pdpType=="IPv6"){cG.extend(c4,{ipv6_wan_apn:c2.wanApnV6,ipv6_ppp_auth_mode:c2.authModeV6,ipv6_ppp_username:c2.usernameV6,ipv6_ppp_passtmp:c2.passwordV6})}else{cG.extend(c4,{wan_apn:c2.wanApn,ppp_auth_mode:c2.authMode,ppp_username:c2.username,ppp_passtmp:c2.password,dns_mode:c2.dnsMode,prefer_dns_manual:c2.dns1,standby_dns_manual:c2.dns2,ipv6_wan_apn:c2.wanApnV6,ipv6_ppp_auth_mode:c2.authModeV6,ipv6_ppp_username:c2.usernameV6,ipv6_ppp_passtmp:c2.passwordV6})}}return c4}function c1(c2){if(c2.result=="success"){return{result:true}}else{return{result:false}}}}var cN=["modem_main_state","pin_status","blc_wan_mode","blc_wan_auto_mode","loginfo","fota_new_version_state","fota_current_upgrade_state","fota_upgrade_selector","network_provider","is_mandatory","sta_count","m_sta_count"];var at=["signalbar","network_type","sub_network_type","ppp_status","rj45_state","EX_SSID1","sta_ip_status","EX_wifi_profile","m_ssid_enable","wifi_cur_state","SSID1","simcard_roam","lan_ipaddr","battery_charging","battery_vol_percent","battery_pers","spn_name_data","spn_b1_flag","spn_b2_flag","realtime_tx_bytes","realtime_rx_bytes","realtime_time","realtime_tx_thrpt","realtime_rx_thrpt","monthly_rx_bytes","monthly_tx_bytes","traffic_alined_delta","monthly_time","date_month","data_volume_limit_switch","data_volume_limit_size","data_volume_alert_percent","data_volume_limit_unit","roam_setting_option","upg_roam_switch","fota_package_already_download","ssid","dial_mode","ethwan_mode","default_wan_name"];if(aE.HAS_SMS){cG.merge(at,["sms_received_flag","sts_received_flag","sms_unread_num"])}var aQ=[];var bH=[bk];function aR(){if(!cF){setTimeout(function(){aR()},1e3);return}var c0=cm();cX(c0,function(c1){for(var c2=0;c2<bH.length;c2++){if(typeof bH[c2]==="function"){bH[c2](c1)}}cG.merge(bH,aQ);aQ=[];setTimeout(function(){aR()},1e3)},function(){cB();setTimeout(function(){aR()},1e3)},false)}function cm(){var c0={multi_data:1};if(window.location.hash&&window.location.hash!="#entry"&&br.isLoggedIn){if(aE.HAS_SMS){c0.sms_received_flag_flag=0;c0.sts_received_flag_flag=0}if(at.length>0&&b9.indexOf(cN,at[0])==-1){cG.each(at,function(c1,c2){cN.push(c2)})}}else{if(at.length>0&&b9.indexOf(cN,at[0])!=-1){cN=b9.without(cN,at)}}c0.cmd=cN.join(",");return c0}function cH(c0){if(b9.indexOf(aQ,c0)==-1){aQ.push(c0)}}function B(c0){bH=b9.without(bH,c0);if(bH.length==0){bH.push(bk)}return aQ}function cR(c0){if(b9.indexOf(cN,c0)==-1){cN.push(c0)}}function bm(c0){cN=b9.without(cN,c0);return cN}function bk(c1){br.defaultWanName=c1.default_wan_name;br.signalImg=typeof c1.signalbar=="undefined"?"0":c1.signalbar;br.networkType=c1.sub_network_type?c1.sub_network_type:c1.network_type?c1.network_type:"";if(br.networkType.toLowerCase().indexOf("limited_service")!=-1||br.networkType.toLowerCase().indexOf("limited service")!=-1){br.networkType="limited_service"}else{if(br.networkType.toLowerCase().indexOf("no_service")!=-1||br.networkType.toLowerCase().indexOf("no service")!=-1){br.networkType="no_service"}}br.networkOperator=c1.network_provider?c1.network_provider:"";br.spn_b1_flag=c1.spn_b1_flag;br.spn_b2_flag=c1.spn_b2_flag;br.spn_name_data=c1.spn_name_data;br.connectStatus=typeof c1.ppp_status=="undefined"?"ppp_disconnected":c1.ppp_status;br.rj45ConnectStatus=typeof c1.rj45_state=="undefined"||c1.rj45_state==""?"dead":c1.rj45_state;br.ethWanMode=c1.ethwan_mode;br.ssid1AttachedNum=c1.sta_count==""?0:parseInt(c1.sta_count,10);br.ssid2AttachedNum=c1.m_sta_count==""?0:parseInt(c1.m_sta_count,10);br.roamingStatus=aB(br.networkType,c1.modem_main_state,c1.simcard_roam);br.wifiStatus=c1.wifi_cur_state=="1";br.simStatus=c1.modem_main_state;br.pinStatus=c1.pin_status;var c2=3*60*60;var c0=c1.battery_vol_percent&&c1.battery_vol_percent.length>0?c1.battery_vol_percent:100;br.batteryPers=c1.battery_pers;var c3=Math.round(c2*(1-c0/100));br.batteryStatus=typeof c1.battery_charging=="undefined"?"0":c1.battery_charging;br.batteryLevel=c0;br.batteryTime=c3.toString();br.data_counter={uploadRate:c1.realtime_tx_thrpt==""?0:c1.realtime_tx_thrpt,downloadRate:c1.realtime_rx_thrpt==""?0:c1.realtime_rx_thrpt,currentSent:c1.realtime_tx_bytes==""?0:c1.realtime_tx_bytes,currentReceived:c1.realtime_rx_bytes==""?0:c1.realtime_rx_bytes,currentConnectedTime:c1.realtime_time==""?0:c1.realtime_time,monthlySent:c1.monthly_tx_bytes==""?0:c1.monthly_tx_bytes,monthlyReceived:c1.monthly_rx_bytes==""?0:c1.monthly_rx_bytes,traffic_alined_delta:c1.traffic_alined_delta==""?0:c1.traffic_alined_delta,monthlyConnectedTime:c1.monthly_time==""?0:c1.monthly_time,month:c1.date_month==""?1:c1.date_month};br.ssid=c1.SSID1;br.authMode=c1.AuthMode;br.isLoggedIn=aE.HAS_LOGIN?c1.loginfo=="ok":true;if(aE.HAS_SMS){if(!br.newSmsReceived){br.newSmsReceived=c1.sms_received_flag>0}if(!br.smsReportReceived){br.smsReportReceived=c1.sts_received_flag>0}if(typeof c1.sms_dev_unread_num!="undefined"){br.smsUnreadCount=aE.SMS_UNREAD_NUM_INCLUDE_SIM?parseInt(c1.sms_dev_unread_num|0,10)+parseInt(c1.sms_sim_unread_num|0,10):parseInt(c1.sms_dev_unread_num|0,10)}else{br.smsUnreadCount=parseInt(c1.sms_unread_num|0,10)}}if(c1.data_volume_limit_switch=="1"){br.limitVolumeEnable=true;br.limitVolumeType=c1.data_volume_limit_unit=="data"?"1":"0";br.limitVolumePercent=c1.data_volume_alert_percent;if(c1.data_volume_limit_unit=="data"){var c4=c1.data_volume_limit_size.split("_");br.limitVolumeSize=c4[0]*c4[1]*1024*1024}else{br.limitVolumeSize=c1.data_volume_limit_size*60*60}}else{br.limitVolumeEnable=false;br.limitVolumeType="1";br.limitVolumePercent="100";br.limitVolumeSize="0"}br.connectWifiProfile=c1.EX_wifi_profile;br.connectWifiSSID=c1.EX_SSID1;br.connectWifiStatus=c1.sta_ip_status;br.multi_ssid_enable=c1.m_ssid_enable;br.roamMode=c1.roam_setting_option;if(c1.blc_wan_mode=="AUTO"){br.blc_wan_mode=c1.blc_wan_auto_mode?c1.blc_wan_auto_mode:"AUTO_PPP"}else{br.blc_wan_mode=c1.blc_wan_mode?c1.blc_wan_mode:"PPP"}br.new_version_state=c1.fota_new_version_state=="has_critical"||c1.fota_new_version_state=="has_optional"||c1.fota_new_version_state=="already_has_pkg";br.current_upgrade_state=c1.fota_current_upgrade_state;if(br.current_upgrade_state=="verify_failed"){br.current_upgrade_state="upgrade_pack_error"}br.fota_user_selector=c1.fota_upgrade_selector;br.is_mandatory=c1.is_mandatory=="1"||c1.fota_new_version_state=="has_critical";br.allowRoamingUpdate=c1.upg_roam_switch;br.dialMode=c1.dial_mode;br.fota_package_already_download=c1.fota_package_already_download}function cB(){br.batteryStatus="0"}function aB(c1,c0,c2){if(""==cG.trim(c1)||"no_service"==c1.toLowerCase()||"limited_service"==c1.toLowerCase()||"modem_sim_undetected"==c0||"modem_waitpin"==c0||"modem_waitpuk"==c0){return false}if("Internal"==c2||"International"==c2){return true}else{return false}}cG(document).ready(function(){setTimeout(function(){aR()},0)});function bj(c1,c0,c3,c5){if(typeof c1!=="string"||c1===""||typeof c0!=="number"||isNaN(c0)){if(typeof c5==="function"){c5(false);return}}var c4=-1;if(c0===0){c4=0}else{if(c0===2){c4=2}else{if(c0==7){c4=7}else{c4=-1}}}if(-1===c4){if(typeof c5==="function"){c5(false);return}}var c2;if(c3.toString()=="NaN"){c2=""}else{c2=c3}cX({goformId:"SET_NETWORK",NetworkNumber:c1,Rat:c0,nSubrat:c2},function(c8){if(c8&&c8.result=="success"){var c7;var c6=0;var c9=setInterval(function(){var da=cl({cmd:"m_netselect_result"},false);if(!da){c5(false);return}if(da.m_netselect_result=="manual_success"){c7="1";window.clearInterval(c9);c5(true)}else{if(da.m_netselect_result=="manual_fail"){c7="0";window.clearInterval(c9);c5(false)}else{if(c6<120){c6++}else{window.clearInterval(c9);c5(false)}}}},1e3)}else{c5(false)}},function(c6){c5(false)},true)}function cy(){var c3=arguments[1];return bv(arguments,{},c1,c2,null,true);function c1(c4,c5){var c6={};c6.notCallback=true;c6.goformId="PBM_CONTACT_ADD";c6.location=c4.location;c6.name=encodeMessage(c4.name);c6.mobilephone_num=c4.mobile_phone_number;if(c6.location==1){c6.add_index_pc=c4.index;c6.homephone_num=c4.home_phone_number;c6.officephone_num=c4.office_phone_number;c6.email=encodeMessage(c4.mail);c6.groupchoose=c4.group;if(!c6.groupchoose){c6.groupchoose="common"}}else{c6.edit_index=c4.index}if(c4.delId!=undefined){c6.delId=c4.delId}return c6}function c2(c4){if(c4&&c4.result=="success"){a8("pbm_write_flag",c0)}else{c3(c4)}}function c0(c4){aX(c4,c3,c0)}}function aX(c0,c2,c1){if(c0.pbm_write_flag=="0"){m("pbm_write_flag",c1);c2({result:"success"})}else{if(c0.pbm_write_flag=="6"||c0.pbm_write_flag=="7"||c0.pbm_write_flag=="8"||c0.pbm_write_flag=="9"||c0.pbm_write_flag=="10"||c0.pbm_write_flag=="11"||c0.pbm_write_flag=="14"){m("pbm_write_flag",c1);c2({result:"fail"})}else{}}}function bi(){var c3=arguments[1];return bv(arguments,{},c1,c2,null,true);function c1(c4,c5){var c6={};c6.notCallback=true;c6.goformId="PBM_CONTACT_DEL";c6.del_option="delete_num";c6.delete_id=c4.indexs.join(",");return c6}function c2(c4){if(c4&&c4.result=="success"){a8("pbm_write_flag",c0)}else{c3(c4)}}function c0(c4){aX(c4,c3,c0)}}function aS(){var c3=arguments[1];return bv(arguments,{},c0,c2,null,true);function c0(c4,c5){var c6={};c6.notCallback=true;c6.goformId="PBM_CONTACT_DEL";c6.del_option="delete_all";c6.del_all_location=c4.location;return c6}function c2(c4){if(c4&&c4.result=="success"){a8("pbm_write_flag",c1)}else{c3(c4)}}function c1(c4){aX(c4,c3,c1)}}function Y(){var c3=arguments[1];return bv(arguments,{},c1,c2,null,true);function c1(c4,c5){var c6={};c6.notCallback=true;c6.goformId="PBM_CONTACT_DEL";c6.del_option="delete_all_by_group";c6.del_all_location=3;c6.del_group=c4.group;return c6}function c2(c4){if(c4&&c4.result=="success"){a8("pbm_write_flag",c0)}else{c3(c4)}}function c0(c4){aX(c4,c3,c0)}}function ae(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="SET_CONNECTION_MODE";c4.ConnectionMode=c2.connectionMode;c4.roam_setting_option=c2.isAllowedRoaming;return c4}function c1(c2){if(c2){return c2}else{callback(c2)}}}function bW(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="ALK_SIM_SELECT";c4.sim_select=c2.sim_select;return c4}function c1(c2){if(c2){return c2}else{callback(c2)}}}function cT(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="alk_sim_select";return c4}function c1(c3){if(c3){var c2={};c2.alk_sim_select=c3.alk_sim_select;return c2}else{return U}}}function J(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="ConnectionMode";return c4}function c1(c3){if(c3){var c2={};c2.connectionMode=c3.connectionMode;c2.isAllowedRoaming=c3.autoConnectWhenRoaming;return c2}else{return U}}}function a(c3,c0){if(c3[0].data_per_page==0){return{pbm_data:[]}}return bv(c3,{},c1,c2,null,false);function c1(c4,c5){var c6={};c6.mem_store=c0;if(c0==2){c6.cmd="pbm_data_total"}else{c6.cmd="pbm_data_info"}c6.page=c4.page;c6.data_per_page=c4.data_per_page;c6.orderBy=c4.orderBy;c6.isAsc=c4.isAsc;return c6}function c2(c4){if(c4&&c4.pbm_data){var c5=[];cG.each(c4.pbm_data,function(c6){c5.push({pbm_id:c4.pbm_data[c6].pbm_id,pbm_location:c4.pbm_data[c6].pbm_location,pbm_number:c4.pbm_data[c6].pbm_number,pbm_anr:c4.pbm_data[c6].pbm_anr,pbm_anr1:c4.pbm_data[c6].pbm_anr1,pbm_group:c4.pbm_data[c6].pbm_group,pbm_name:decodeMessage(c4.pbm_data[c6].pbm_name),pbm_email:decodeMessage(c4.pbm_data[c6].pbm_email)})});return{pbm_data:c5}}else{return U}}}function bP(){if(arguments[0].data_per_page==0){return{pbm_data:[]}}return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="pbm_data_total";c4.mem_store=3;c4.pbm_group=c2.group;c4.page=c2.page;c4.data_per_page=c2.data_per_page;c4.orderBy=c2.orderBy;c4.isAsc=c2.isAsc;return c4}function c1(c2){if(c2&&c2.pbm_data){var c3=[];cG.each(c2.pbm_data,function(c4){c3.push({pbm_id:c2.pbm_data[c4].pbm_id,pbm_location:c2.pbm_data[c4].pbm_location,pbm_number:c2.pbm_data[c4].pbm_number,pbm_anr:c2.pbm_data[c4].pbm_anr,pbm_anr1:c2.pbm_data[c4].pbm_anr1,pbm_group:c2.pbm_data[c4].pbm_group,pbm_name:decodeMessage(c2.pbm_data[c4].pbm_name),pbm_email:decodeMessage(c2.pbm_data[c4].pbm_email)})});return{pbm_data:c3}}else{return U}}}function cV(){return a(arguments,1)}function cz(){return a(arguments,0)}function R(){return a(arguments,2)}function cb(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="pbm_init_flag";return c4}function c1(c2){if(c2){return c2}else{return U}}}function b7(c3,c2){return bv(c3,{},c0,c1,null,false);function c0(c4,c5){var c6={};c6.cmd="pbm_capacity_info";if(c2){c6.pbm_location="pbm_sim"}else{c6.pbm_location="pbm_native"}return c6}function c1(c4){if(c4){return c4}else{return U}}}function bK(){var c0=b7(arguments,true);return{simPbmTotalCapacity:parseInt(c0.pbm_sim_max_record_num),simPbmUsedCapacity:parseInt(c0.pbm_sim_used_record_num),simType:c0.pbm_sim_type,maxNameLen:parseInt(c0.pbm_sim_max_name_len),maxNumberLen:parseInt(c0.pbm_sim_max_number_len)>40?40:parseInt(c0.pbm_sim_max_number_len)}}function af(){var c0=b7(arguments,false);return{pcPbmTotalCapacity:parseInt(c0.pbm_dev_max_record_num),pcPbmUsedCapacity:parseInt(c0.pbm_dev_used_record_num)}}function bA(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"lan_station_list"};return c4}function c1(c2){var c5=[];var c6=c2.lan_station_list||c2.station_list;for(var c4=0;c6&&c4<c6.length;c4++){var c7={};c7.macAddress=c6[c4].mac_addr;var c3=c6[c4].hostname;c7.hostName=c3==""?cG.i18n.prop("unknown"):c3;c7.ipAddress=c6[c4].ip_addr;c5.push(c7)}return{attachedDevices:c5}}}function bn(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"station_list"};return c4}function c1(c2){var c5=[];var c6=c2.station_list;for(var c4=0;c6&&c4<c6.length;c4++){var c7={};c7.macAddress=c6[c4].mac_addr;var c3=c6[c4].hostname;c7.hostName=c3==""?cG.i18n.prop("unknown"):c3;c7.ipAddress=c6[c4].ip_addr;c5.push(c7)}return{attachedDevices:c5}}}function k(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="SET_WEB_LANGUAGE";c4.Language=c2.Language;return c4}function c1(c2){if(c2){return c2}else{return U}}}function z(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="Language";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.Language=c3&&c3.Language?c3.Language:"en";return c2}else{return U}}}function bE(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="SET_BEARER_PREFERENCE";c4.BearerPreference=c2.strBearerPreference;return c4}function c1(c2){if(c2){return c2}else{return U}}}function aC(c2){cG.post("/reqproc/proc_post",{goformId:"SCAN_NETWORK"},function(c3){if(c3.result=="success"){c0()}else{c2(false,[])}},"json").error(function(){c2(false,[])});function c0(){cG.getJSON("/reqproc/proc_get",{cmd:"m_netselect_status",_:(new Date).getTime()},function(c3){if(c3.m_netselect_status=="manual_selecting"){setTimeout(c0,1e3)}else{cG.getJSON("/reqproc/proc_get",{cmd:"m_netselect_contents",_:(new Date).getTime()},function(c4){if(trim(c4.m_netselect_contents)!=""){c1(c4.m_netselect_contents)}else{c2(false,[])}}).error(function(){c2(false,[])})}}).error(function(){c2(false,[])})}function c1(c3){var c7=/([^,;]*),([^,]*),([^,]*),([^,]*),([^,;]*)/g;var c8=[];var c9;var c6=c3.split(";");var c4="";for(i=0;i<c6.length;i++){var c5=c6[i].split(",").length;if(c5==4){c4+=c6[i]+",NON;"}else{c4+=c6[i]+";"}}while(c9=c7.exec(c4)){if(c9!=null){c8.push({strShortName:c9[2].replace(/\"/g,""),strNumeric:c9[3].replace(/\D/g,""),nRat:parseInt(c9[4],10),nState:parseInt(c9[1],10),SubAct:parseInt(c9[5],10)})}}c2(true,c8)}}function P(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="current_network_mode,m_netselect_save,net_select_mode,m_netselect_contents,net_select,ppp_status,modem_main_state";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.current_network_mode=c3.current_network_mode;c2.net_select_mode=c3.net_select_mode;c2.m_netselect_save=c3.m_netselect_save;c2.m_netselect_contents=c3.m_netselect_contents;c2.net_select=c3.net_select;c2.ppp_status=c3.ppp_status;c2.modem_main_state=c3.modem_main_state;return c2}else{return U}}}function aI(){return bv(arguments,{},c0,c1,{},false);function c0(c2,c3){var c4={cmd:"sms_data_total",page:c2.page,data_per_page:aE.SMS_DATABASE_SORT_SUPPORT?c2.smsCount:500,mem_store:c2.nMessageStoreType,tags:c2.tags,order_by:c2.orderBy};return c4}function c1(c2){if(c2&&c2.messages&&c2.messages.length>0){return{messages:cC(c2.messages)}}else{return{messages:[]}}}}function cC(c2,c7){var c8=[];for(var c3=0;c3<c2.length;c3++){if(!aE.SHOW_UN_COMPLETE_CONCAT_SMS&&typeof c2[c3].received_all_concat_sms!="undefined"&&c2[c3].received_all_concat_sms=="0"){continue}var c5={};c5.id=c2[c3].id;c5.number=c2[c3].number;c5.content=c7?c2[c3].content:aU(c2[c3].content);c5.time=transTime("20"+c2[c3].date);c5.isNew=c2[c3].tag=="1";c5.groupId=c2[c3].draft_group_id;c5.tag=c2[c3].tag;c5.receivedAll=c2[c3].received_all_concat_sms=="1";c8.push(c5)}if(!aE.SMS_DATABASE_SORT_SUPPORT){var c0=[];var c4=[];for(var c3=c8.length;c3--;){var c1=c8[c3];var c6=cG.inArray(c1.id,c0);if(c6==-1){c0.push(c1.id);c4.push(c1)}else{if(c1.content.length>c4[c6].content.length){c4[c6]=c1}}}return b9.sortBy(c4,function(c9){return 0-c9.id})}else{return c8}}function aU(c0){return decodeMessage(escapeMessage(c0))}function aW(){var c3=arguments[1];var c1=arguments[2]?arguments[2]:c3;return bv(arguments,{},c0,c2,null,true);function c0(c4,c5){var c6={goformId:"SEND_SMS",notCallback:true,Number:c4.number,sms_time:getCurrentTimeString(),MessageBody:escapeMessage(encodeMessage(c4.message)),ID:c4.id,encode_type:getEncodeType(c4.message).encodeType};return c6}function c2(c4){if(!c4){c1(cG.extend(U,{errorType:"sendFail",errorText:"send_fail_try_again"}));return}if(c4.result=="success"){setTimeout(function(){cD({smsCmd:4,errorType:"sendFail",errorText:"send_fail_try_again"},c3,c1)},1e3)}else{c1(cG.extend(U,{errorType:"sendFail",errorText:"send_fail_try_again"}))}}}function aF(){var c3=arguments[1];var c1=arguments[2]?arguments[2]:c3;return bv(arguments,{},c0,c2,null,true);function c0(c4,c5){var c6={notCallback:true,goformId:"SAVE_SMS",SMSMessage:escapeMessage(encodeMessage(c4.message)),SMSNumber:c4.numbers.join(";")+";",Index:c4.index,encode_type:getEncodeType(c4.message).encodeType,sms_time:c4.currentTimeString,draft_group_id:c4.groupId};return c6}function c2(c4){if(!c4){c1(cG.extend(U,{errorType:"saveFail",errorText:"save_fail"}));return}if(c4.result=="success"){cD({smsCmd:5,errorType:"saveFail",errorText:"save_fail"},c3,c1)}else{c1(cG.extend(U,{errorType:"saveFail",errorText:"save_fail"}))}}}function bO(){var c4=arguments[1];var c2=arguments[2]?arguments[2]:c4;return bv(arguments,{},c1,c3,null,true);function c1(c5,c6){var c7={goformId:"ALL_DELETE_SMS",notCallback:true,which_cgi:c5.location};return c7}function c3(c5){if(!c5){c2(cG.extend(U,{errorType:"deleteFail",errorText:"delete_fail_try_again"}));return}if(c5.result=="success"){a8("sms_cmd_status_info",c0)}else{c2(cG.extend(U,{errorType:"deleteFail",errorText:"delete_fail_try_again"}))}}function c0(c6){var c5=c6.sms_cmd_status_info;if(c5=="2"){m("sms_cmd_status_info",c0);c2(cG.extend(U,{errorType:"deleteFail",errorText:"delete_fail_try_again"}))}else{if(c5=="3"){m("sms_cmd_status_info",c0);c4({result:true})}}}}function cr(){var c3=arguments[1];var c1=arguments[2]?arguments[2]:c3;return bv(arguments,{},c0,c2,null,true);function c0(c5,c6){var c4=c5.ids.join(";")+";";var c7={goformId:"DELETE_SMS",msg_id:c4,notCallback:true};return c7}function c2(c4){if(!c4){c1(cG.extend(U,{errorType:"deleteFail",errorText:"delete_fail_try_again"}));return}if(c4.result=="success"){cD({smsCmd:6,errorType:"deleteFail",errorText:"delete_fail_try_again"},c3,c1)}else{c1(cG.extend(U,{errorType:"deleteFail",errorText:"delete_fail_try_again"}))}}}function cD(c1,c2,c0){cX({cmd:"sms_cmd_status_info",sms_cmd:c1.smsCmd},function(c4){if(c4){var c3=c4.sms_cmd_status_result;if(c3=="2"){c0(cG.extend(U,{errorType:c1.errorType,errorText:c1.errorText}))}else{if(c3=="3"){c2({result:"success"})}else{window.setTimeout(function(){cD(c1,c2,c0)},1e3)}}}else{c0(cG.extend(U,{errorType:c1.errorType,errorText:c1.errorText}))}},function(c3){c0(cG.extend(U,{errorType:c1.errorType,errorText:c1.errorText}))},false)}function aG(){if(aE.smsIsReady){var c2=arguments[1];if(c2){return c2({sms_cmd:"1",sms_cmd_status_result:"3"})}else{return{sms_cmd:"1",sms_cmd_status_result:"3"}}}else{return bv(arguments,{},c0,c1,null,false)}function c0(c3,c4){var c5={};c5.cmd="sms_cmd_status_info";c5.sms_cmd=1;return c5}function c1(c3){if(c3){if(c3.sms_cmd_status_result=="3"){aE.smsIsReady=true}return c3}else{return U}}}function ad(){return bv(arguments,{},c0,c1,null,true);function c0(c3,c4){var c2=c3.ids.join(";");if(c3.ids.length>0){c2+=";"}var c5={goformId:"SET_MSG_READ",msg_id:c2,tag:0};return c5}function c1(c2){if(c2.result=="success"){return{result:true}}else{return{result:false}}}}function K(){return bv(arguments,{},c0,c1,{},false);function c0(c2,c3){var c4={cmd:"sms_status_rpt_data",page:c2.page,data_per_page:c2.smsCount};return c4}function c1(c2){if(c2){return{messages:cC(c2.messages,true)}}else{return U}}}function bq(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4=cG.extend({},c2);c4.goformId="LOGOUT";return c4}function c1(c2){if(c2&&c2.result=="success"){br.isLoggedIn=false;return{result:true}}else{return cG.extend(U,{errorType:"loggedOutError"})}}}function bR(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.newPassword=aE.PASSWORD_ENCODE?Base64.encode(c2.newValue):c2.newValue;c4.oldPassword=aE.PASSWORD_ENCODE?Base64.encode(c2.oldValue):c2.oldValue;c4.goformId="CHANGE_PASSWORD";return c4}function c1(c2){if(c2&&c2.result==="success"){return{result:true}}else{return cG.extend(U,{errorType:"badPassword"})}}}function cw(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="imei,time_to_live";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.imei=c3.imei;c2.time_to_live=c3.time_to_live;return c2}else{return U}}}function by(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="ALK_WRITE_IMEI";c4.imei_string=c2.imei_string;return c4}function c1(c2){if(c2&&c2.result==="success"){return{result:true}}else{return{result:false}}}}function bo(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="ALK_WRITE_TTL";c4.ttl_value=c2.ttl_value;return c4}function c1(c2){if(c2&&c2.result==="success"){return{result:true}}else{return{result:false}}}}function ca(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="show_advance_setting";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.show_advance_setting=c3.show_advance_setting;return c2}else{return U}}}function cP(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="pinnumber,pin_status,puknumber";c4.multi_data=1;return c4}function c1(c2){if(c2){return c2}else{return U}}}function cZ(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="ENABLE_PIN";c4.OldPinNumber=c2.oldPin;return c4}function c1(c2){if(c2&&c2.result==="success"){return{result:true}}else{return{result:false}}}}function bT(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="DISABLE_PIN";c4.OldPinNumber=c2.oldPin;return c4}function c1(c2){if(c2&&c2.result==="success"){return{result:true}}else{return{result:false}}}}function o(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="ENABLE_PIN";c4.OldPinNumber=c2.oldPin;c4.NewPinNumber=c2.newPin;return c4}function c1(c2){if(c2&&c2.result==="success"){return{result:true}}else{return{result:false}}}}function bp(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="lan_ipaddr,lan_netmask,mac_address,dhcpEnabled,dhcpStart,dhcpEnd,dhcpLease_hour";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.ipAddress=c3.lan_ipaddr;c2.subnetMask=c3.lan_netmask;c2.macAddress=c3.mac_address;c2.dhcpServer=c3.dhcpEnabled;c2.dhcpStart=c3.dhcpStart;c2.dhcpEnd=c3.dhcpEnd;c2.dhcpLease=parseInt(c3.dhcpLease_hour,10);return c2}else{return U}}}function b6(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="DHCP_SETTING";c4.lanIp=c2.ipAddress;c4.lanNetmask=c2.subnetMask;c4.lanDhcpType=c2.dhcpServer=="1"?"SERVER":"DISABLE";if(c4.lanDhcpType=="SERVER"){c4.dhcpStart=c2.dhcpStart;c4.dhcpEnd=c2.dhcpEnd;c4.dhcpLease=c2.dhcpLease}c4.dhcp_reboot_flag=1;return c4}function c1(c2){if(c2){return c2}else{return U}}}function bU(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="sms_parameter_info";return c4}function c1(c3){if(c3){var c2={};c2.centerNumber=c3.sms_para_sca;c2.memStroe=c3.sms_para_mem_store;c2.deliveryReport=c3.sms_para_status_report;switch(parseInt(c3.sms_para_validity_period,10)){case 143:c2.validity="twelve_hours";break;case 167:c2.validity="one_day";break;case 173:c2.validity="one_week";break;case 244:c2.validity="largest";break;case 255:c2.validity="largest";break;default:c2.validity="twelve_hours";break}return c2}else{return U}}}function aN(){var c3=arguments[1];var c1=arguments[2]?arguments[2]:c3;return bv(arguments,{},c0,c2,null,true);function c0(c4,c5){var c6={};c6.goformId="SET_MESSAGE_CENTER";c6.save_time=c4.validity;c6.MessageCenter=c4.centerNumber;c6.status_save=c4.deliveryReport;c6.save_location="native";c6.notCallback=true;return c6}function c2(c4){if(!c4){c1(cG.extend(U,{errorType:"smsSettingFail",errorText:"error_info"}));return}if(c4.result=="success"){cD({smsCmd:3,errorType:"smsSettingFail",errorText:"error_info"},c3,c1)}else{c1(cG.extend(U,{errorType:"deleteFail",errorText:"delete_fail_try_again"}))}}}function av(){var c1={};if(aE.HAS_PARENTAL_CONTROL&&aE.currentUserInChildGroup!=false){c1={errorType:"no_auth"}}return bv(arguments,c1,c0,c2,null,true);function c0(c3,c4){var c5={};c5.goformId="RESTORE_FACTORY_SETTINGS";return c5}function c2(c3){if(c3){return c3}else{return U}}}function aa(c0){var c1={};c1.cmd="restore_flag";c1.multi_data=1;cX(c1,function(c2){if(c2&&c2.restore_flag==="1"){c0()}else{setTimeout(function(){aa(c0)},5e3)}},function(){setTimeout(function(){aa(c0)},5e3)},false)}function b5(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="wifi_wps_index,WscModeOption,AuthMode,wifi_cur_state,EncrypType,wps_mode,WPS_SSID,m_ssid_enable,SSID1,m_SSID,m_EncrypType,m_AuthMode,wifi_sta_connection";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.wpsFlag=c3.WscModeOption;c2.authMode=c3.AuthMode;c2.wpsType=c3.wps_mode;c2.radioFlag=c3.wifi_cur_state=="1"?"1":"0";c2.encrypType=c3.EncrypType;c2.wpsSSID=c3.WPS_SSID;c2.ssidEnable=c3.m_ssid_enable;c2.ssid=c3.SSID1;c2.multiSSID=c3.m_SSID;c2.m_encrypType=c3.m_EncrypType;c2.wifi_wps_index=c3.wifi_wps_index;c2.AuthMode=c3.AuthMode;c2.m_AuthMode=c3.m_AuthMode;c2.ap_station_enable=c3.wifi_sta_connection;return c2}else{return U}}}function r(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="WIFI_WPS_SET";c4.WPS_SSID=c2.wpsSSID;c4.wps_mode=c2.wpsType;c4.wifi_wps_index=c2.wpsIndex;if(c4.wps_mode=="PIN"){c4.wps_pin=c2.wpsPin}return c4}function c1(c2){if(c2){return c2}else{return U}}}function ab(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="WIFI_M_WPS_SET";c4.m_WPS_SSID=c2.wpsSSID;c4.m_wps_mode=c2.wpsType;c4.m_wifi_wps_index=c2.wpsIndex;if(c4.m_wps_mode=="PIN"){c4.m_wps_pin=c2.wpsPin}return c4}function c1(c2){if(c2){return c2}else{return U}}}function ce(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="Sleep_interval";return c4}function c1(c3){if(c3){var c2={};c2.sleepMode=c3.Sleep_interval;return c2}else{return U}}}function bc(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="SET_WIFI_SLEEP_INFO";c4.sysIdleTimeToSleep=c2.sleepMode;return c4}function c1(c2){if(c2){return c2}else{return U}}}function bQ(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="RemoteManagement,WANPingFilter";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.remoteFlag=c3.RemoteManagement=="1"?"1":"0";c2.pingFlag=c3.WANPingFilter=="1"?"1":"0";return c2}else{return U}}}function cv(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="FW_SYS";c4.remoteManagementEnabled=c2.remoteFlag;c4.pingFrmWANFilterEnabled=c2.pingFlag;return c4}function c1(c2){if(c2){return c2}else{return U}}}function C(){return bv(arguments,{},c0,c2,null,false);function c0(c3,c4){var c5={};c5.cmd="PortForwardEnable,PortForwardRules_0,PortForwardRules_1,PortForwardRules_2,PortForwardRules_3,PortForwardRules_4,PortForwardRules_5,PortForwardRules_6,PortForwardRules_7,PortForwardRules_8,PortForwardRules_9";c5.multi_data=1;return c5}function c2(c4){if(c4){var c3={};c3.portForwardEnable=c4.PortForwardEnable;var c5=[];if(c4.PortForwardRules_0!=""){c5.push([0,c4.PortForwardRules_0])}if(c4.PortForwardRules_1!=""){c5.push([1,c4.PortForwardRules_1])}if(c4.PortForwardRules_2!=""){c5.push([2,c4.PortForwardRules_2])}if(c4.PortForwardRules_3!=""){c5.push([3,c4.PortForwardRules_3])}if(c4.PortForwardRules_4!=""){c5.push([4,c4.PortForwardRules_4])}if(c4.PortForwardRules_5!=""){c5.push([5,c4.PortForwardRules_5])}if(c4.PortForwardRules_6!=""){c5.push([6,c4.PortForwardRules_6])}if(c4.PortForwardRules_7!=""){c5.push([7,c4.PortForwardRules_7])}if(c4.PortForwardRules_8!=""){c5.push([8,c4.PortForwardRules_8])}if(c4.PortForwardRules_9!=""){c5.push([9,c4.PortForwardRules_9])}c3.portForwardRules=c1(c5);return c3}else{return U}}function c1(c3){var c7=[];if(c3&&c3.length>0){for(var c5=0;c5<c3.length;c5++){var c4={};var c6=c3[c5][1].split(",");c4.index=c3[c5][0];c4.ipAddress=c6[0];c4.portRange=c6[1]+" - "+c6[2];c4.protocol=transProtocol(c6[3]);c4.comment=c6[4];c7.push(c4)}}return c7}}function ao(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="FW_FORWARD_ADD";c4.ipAddress=c2.ipAddress;c4.portStart=c2.portStart;c4.portEnd=c2.portEnd;c4.protocol=c2.protocol;c4.comment=c2.comment;return c4}function c1(c2){if(c2){return c2}else{return U}}}function cu(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="FW_FORWARD_DEL";c4.delete_id=c2.indexs.join(";")+";";return c4}function c1(c2){if(c2){return c2}else{return U}}}function aA(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="VIRTUAL_SERVER";c4.PortForwardEnable=c2.portForwardEnable;return c4}function c1(c2){if(c2){return c2}else{return U}}}function c(c5,c4,c0){var c3=c5+c4+"FFFFFFFFFFFFFFFFFFFFFFFF";var c7;var c6;c7=c3.substring(0,24);c6=c3.substring(0,16);var c2=bs.enc.Latin1.parse(c7);var c1=bs.enc.Latin1.parse(c6);var c8=bs.AES.decrypt(c0,c2,{iv:c1,mode:bs.mode.CBC,padding:bs.pad.ZeroPadding}).toString(bs.enc.Utf8);return c8}function a1(){return bv(arguments,{},c0,c1,null,false);function c0(c3,c4){var c5={};var c2=aE.PASSWORD_ENCODE?",WPAPSK1_encode":",imei,rnum_js,WPAPSK1_enaes";c5.cmd="pdp_type,ipv6_pdp_type,wifi_cur_state,SSID1,HideSSID,AuthMode,WscModeOption,ppp_status,apn_index,ipv6_apn_index,ipv6_APN_index,m_profile_name,apn_mode,EncrypType,DefaultKeyID,Key1Str1,Key2Str1,Key3Str1,Key4Str1"+c2+",APN_configtmp0,APN_configtmp1,APN_configtmp2,APN_configtmp3,APN_configtmp4,APN_configtmp5,APN_configtmp6,APN_configtmp7,APN_configtmp8,APN_configtmp9,APN_configtmp10,APN_configtmp11,APN_configtmp12,APN_configtmp13,APN_configtmp14,APN_configtmp15,APN_configtmp16,APN_configtmp17,APN_configtmp18,APN_configtmp19,ipv6_APN_configtmp0,ipv6_APN_configtmp1,ipv6_APN_configtmp2,ipv6_APN_configtmp3,ipv6_APN_configtmp4,ipv6_APN_configtmp5,ipv6_APN_configtmp6,ipv6_APN_configtmp7,ipv6_APN_configtmp8,ipv6_APN_configtmp9,ipv6_APN_configtmp10,ipv6_APN_configtmp11,ipv6_APN_configtmp12,ipv6_APN_configtmp13,ipv6_APN_configtmp14,ipv6_APN_configtmp15,ipv6_APN_configtmp16,ipv6_APN_configtmp17,ipv6_APN_configtmp18,ipv6_APN_configtmp19";c5.multi_data=1;return c5}function c1(c2){if(c2){if(aE.PASSWORD_ENCODE){c2.WPAPSK1=Base64.decode(c2.WPAPSK1_encode)}else{c2.WPAPSK1=c(c2.rnum_js,c2.imei,c2.WPAPSK1_enaes)}return c2}else{return U}}}function cW(){au(arguments,c0,c1);function c0(c2){var c3={goformId:"QUICK_SETUP_EX",index:c2.apn_index,pdp_type:c2.pdp_type,apn_mode:c2.apnMode,profile_name:c2.profile_name,wan_apn:c2.wan_apn,ppp_auth_mode:c2.ppp_auth_mode,ppp_username:c2.ppp_username,ppp_passtmp:c2.ppp_passtmp,ipv6_wan_apn:c2.ipv6_wan_apn,ipv6_ppp_auth_mode:c2.ipv6_ppp_auth_mode,ipv6_ppp_username:c2.ipv6_ppp_username,ipv6_ppp_passtmp:c2.ipv6_ppp_passtmp,SSID_name:c2.SSID_name,SSID_Broadcast:c2.SSID_Broadcast,Encryption_Mode_hid:c2.Encryption_Mode_hid,security_shared_mode:c2.security_shared_mode,WPA_PreShared_Key:aE.PASSWORD_ENCODE?Base64.encode(c2.WPA_PreShared_Key):c2.WPA_PreShared_Key,wep_default_key:c2.wep_default_key,WPA_ENCRYPTION_hid:c2.WPA_ENCRYPTION_hid};c3.wep_key_1=c2.wep_key_1;c3.wep_key_2=c2.wep_key_2;c3.wep_key_3=c2.wep_key_3;c3.wep_key_4=c2.wep_key_4;if(c2.wep_default_key=="1"){c3.WEP2Select=c2.WEP2Select}else{if(c2.wep_default_key=="2"){c3.WEP3Select=c2.WEP3Select}else{if(c2.wep_default_key=="3"){c3.WEP4Select=c2.WEP4Select}else{c3.WEP1Select=c2.WEP1Select}}}return c3}function c1(c2){if(c2){return c2}else{return cG.extend(U,{errorType:"SetSetUpError"})}}}function au(c9,c4,c2){var c8=false;var c0=false;var c6=c4(c9[0]);var c7=c9[1];var c1=function(da){c8=true;if(!c0&&c7){c7(c2(da))}c0=true};var c5=c9[2];var c3=function(){c8=true;if(c5){c5()}};cX(c6,c1,c3,true);addTimeout(function(){if(c8==false){var da=addInterval(function(){if(c8==false){z({},function(db){window.clearInterval(da);c1({result:"success"})})}},1e3)}},5e3)}function bM(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"sdcard_mode_option,sd_card_state,HTTP_SHARE_STATUS,HTTP_SHARE_WR_AUTH,HTTP_SHARE_FILE",multi_data:1};return c4}function c1(c3){if(c3){var c4;if("mmc2"==c3.HTTP_SHARE_FILE||"/mmc2"==c3.HTTP_SHARE_FILE||"/mmc2/"==c3.HTTP_SHARE_FILE){c4="1"}else{c4="0"}var c2={sd_mode:c3.sdcard_mode_option=="1"?"0":"1",sd_status:c3.sd_card_state,share_status:c3.HTTP_SHARE_STATUS=="Enabled"?"1":"0",share_auth:c3.HTTP_SHARE_WR_AUTH=="readOnly"?"0":"1",file_to_share:c4,share_file:c3.HTTP_SHARE_FILE};return c2}else{return U}}}function cn(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"HTTPSHARE_MODE_SET",mode_set:c2.mode=="0"?"http_share_mode":"usb_mode"};return c4}function c1(c2){if(c2&&c2.result=="success"){return{result:"success"}}else{if(c2&&c2.result=="processing"){return{result:"processing"}}else{return{result:false}}}}}function L(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"GOFORM_HTTPSHARE_CHECK_FILE",path_SD_CARD:c2.path};return c4}function c1(c2){if(c2){if(c2.result=="no_sdcard"){return{status:"no_sdcard"}}else{if(c2.result=="noexist"){return{status:"noexist"}}else{if(c2.result=="processing"){return{status:"processing"}}else{return{status:"exist"}}}}}else{return U}}}function ac(){return bv(arguments,{},c0,c2,null,true);function c0(c3,c4){var c5={goformId:"HTTPSHARE_ENTERFOLD",path_SD_CARD:c3.path,indexPage:c3.index};return c5}function c2(c3){if(c3){if(c3.result=="failure"){return cG.extend(U,{errorType:"get_file_list_failure"})}else{if(c3.result=="no_sdcard"){return cG.extend(U,{errorType:"no_sdcard"})}else{return c1(c3.result)}}}else{return U}}function c1(c3){var c6={};c6.totalRecord=c3.totalRecord;var c8=[];var c5=c3.fileInfo;for(var c4=0;c5&&c4<c5.length;c4++){if(c5[c4].fileName==""){continue}var c7={};c7.fileName=c5[c4].fileName;c7.attribute=c5[c4].attribute;c7.size=c5[c4].size;c7.lastUpdateTime=c5[c4].lastUpdateTime;c8.push(c7)}c6.details=c8;return c6}}function bx(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c5=new Date;var c4=c5.getTime();var c6=c5.getTimezoneOffset()*60;return{goformId:"HTTPSHARE_FILE_RENAME",path_SD_CARD:c2.path,OLD_NAME_SD_CARD:c2.oldPath,NEW_NAME_SD_CARD:c2.newPath,path_SD_CARD_time:transUnixTime(c4),path_SD_CARD_time_unix:Math.round((c4-c6*1e3)/1e3)}}function c1(c2){if(c2){if(c2.result=="success"){return{result:true}}else{if(c2.result=="no_sdcard"){return cG.extend(U,{errorType:"no_sdcard"})}else{if(c2.result=="noexist"){return cG.extend(U,{errorType:"no_exist"})}else{if(c2.result=="processing"){return cG.extend(U,{errorType:"sd_file_processing_cant_rename"})}else{return{result:false}}}}}}else{return U}}}function A(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"HTTPSHARE_GETCARD_VALUE"};return c4}function c1(c2){if(!c2||c2.result&&c2.result=="no_sdcard"){return cG.extend(U,{errorType:"no_sdcard"})}else{return{totalMemorySize:c2.sd_card_total_size==""?0:c2.sd_card_total_size*32*1024,availableMemorySize:c2.sd_card_avi_space==""?0:c2.sd_card_avi_space*32*1024}}}}function aT(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4=(new Date).getTime();var c5={goformId:"HTTPSHARE_DEL",path_SD_CARD:c2.path,name_SD_CARD:c2.names,path_SD_CARD_time:transUnixTime(c4),path_SD_CARD_time_unix:Math.round(c4/1e3)};return c5}function c1(c2){if(c2.result&&c2.result=="failure"){return{status:"failure"}}else{if(c2.result&&c2.result=="no_sdcard"){return{status:"no_sdcard"}}else{if(c2.result&&c2.result=="processing"){return{status:"processing"}}else{if(c2.result&&c2.result=="success"){return{status:"success"}}else{return U}}}}}}function G(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c5=new Date;var c4=c5.getTime();var c6=c5.getTimezoneOffset()*60;return{goformId:"HTTPSHARE_NEW",path_SD_CARD:c2.path,path_SD_CARD_time:transUnixTime(c4),path_SD_CARD_time_unix:Math.round((c4-c6*1e3)/1e3)}}function c1(c2){if(c2.result&&c2.result=="failure"){return cG.extend(U,{errorType:"create_folder_failure"})}else{if(c2.result&&c2.result=="no_sdcard"){return cG.extend(U,{errorType:"no_sdcard"})}else{if(c2.result&&c2.result=="success"){return{result:true}}else{return U}}}}}function b4(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"HTTPSHARE_AUTH_SET",HTTP_SHARE_STATUS:c2.share_status=="1"?"Enabled":"Disabled",HTTP_SHARE_WR_AUTH:c2.share_auth=="1"?"readWrite":"readOnly",HTTP_SHARE_FILE:c2.share_file};return c4}function c1(c2){if(c2){if(c2.result=="no_sdcard"){return cG.extend(U,{errorType:"no_sdcard"})}else{return{result:true}}}else{return U}}}function bb(){return bv(arguments,{},c1,c2,null,false);function c1(c3,c4){var c5={};c5.cmd="IPPortFilterEnable,DefaultFirewallPolicy,IPPortFilterRules_0,IPPortFilterRules_1,IPPortFilterRules_2,IPPortFilterRules_3,IPPortFilterRules_4,IPPortFilterRules_5,IPPortFilterRules_6,IPPortFilterRules_7,IPPortFilterRules_8,IPPortFilterRules_9";c5.cmd+=",IPPortFilterRulesv6_0,IPPortFilterRulesv6_1,IPPortFilterRulesv6_2,IPPortFilterRulesv6_3,IPPortFilterRulesv6_4,IPPortFilterRulesv6_5,IPPortFilterRulesv6_6,IPPortFilterRulesv6_7,IPPortFilterRulesv6_8,IPPortFilterRulesv6_9";c5.multi_data=1;return c5}function c2(c4){if(c4){var c3={};c3.portFilterEnable=c4.IPPortFilterEnable;c3.defaultPolicy=c4.DefaultFirewallPolicy;var c6=[];if(c4.IPPortFilterRules_0!=""){c6.push([0,c4.IPPortFilterRules_0])}if(c4.IPPortFilterRules_1!=""){c6.push([1,c4.IPPortFilterRules_1])}if(c4.IPPortFilterRules_2!=""){c6.push([2,c4.IPPortFilterRules_2])}if(c4.IPPortFilterRules_3!=""){c6.push([3,c4.IPPortFilterRules_3])}if(c4.IPPortFilterRules_4!=""){c6.push([4,c4.IPPortFilterRules_4])}if(c4.IPPortFilterRules_5!=""){c6.push([5,c4.IPPortFilterRules_5])}if(c4.IPPortFilterRules_6!=""){c6.push([6,c4.IPPortFilterRules_6])}if(c4.IPPortFilterRules_7!=""){c6.push([7,c4.IPPortFilterRules_7])}if(c4.IPPortFilterRules_8!=""){c6.push([8,c4.IPPortFilterRules_8])}if(c4.IPPortFilterRules_9!=""){c6.push([9,c4.IPPortFilterRules_9])}c3.portFilterRules=c0(c6,"IPv4");var c5=[];if(c4.IPPortFilterRulesv6_0!=""){c5.push([10,c4.IPPortFilterRulesv6_0])}if(c4.IPPortFilterRulesv6_1!=""){c5.push([11,c4.IPPortFilterRulesv6_1])}if(c4.IPPortFilterRulesv6_2!=""){c5.push([12,c4.IPPortFilterRulesv6_2])}if(c4.IPPortFilterRulesv6_3!=""){c5.push([13,c4.IPPortFilterRulesv6_3])}if(c4.IPPortFilterRulesv6_4!=""){c5.push([14,c4.IPPortFilterRulesv6_4])}if(c4.IPPortFilterRulesv6_5!=""){c5.push([15,c4.IPPortFilterRulesv6_5])}if(c4.IPPortFilterRulesv6_6!=""){c5.push([16,c4.IPPortFilterRulesv6_6])}if(c4.IPPortFilterRulesv6_7!=""){c5.push([17,c4.IPPortFilterRulesv6_7])}if(c4.IPPortFilterRulesv6_8!=""){c5.push([18,c4.IPPortFilterRulesv6_8])}if(c4.IPPortFilterRulesv6_9!=""){c5.push([19,c4.IPPortFilterRulesv6_9])}c3.portFilterRules=b9.union(c3.portFilterRules,c0(c5,"IPv6"));return c3}else{return U}}function c0(c3,c8){var c7=[];if(c3&&c3.length>0){for(var c5=0;c5<c3.length;c5++){var c4={};var c6=c3[c5][1].split(",");c4.index=c3[c5][0];c4.macAddress=c6[11];c4.destIpAddress=c6[4]=="any/0"?"":c6[4];c4.sourceIpAddress=c6[0]=="any/0"?"":c6[0];c4.destPortRange=c6[6]=="0"?"":c6[6]+" - "+c6[7];c4.sourcePortRange=c6[2]=="0"?"":c6[2]+" - "+c6[3];c4.action=c6[9]==1?"filter_accept":"filter_drop";c4.protocol=transProtocol(c6[8]);c4.comment=c6[10];c4.ipType=c8;c7.push(c4)}}return c7}}function ah(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="BASIC_SETTING";c4.portFilterEnabled=c2.portFilterEnable;c4.defaultFirewallPolicy=c2.defaultPolicy;return c4}function c1(c2){if(c2){return c2}else{return U}}}function T(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="ADD_IP_PORT_FILETER_V4V6";c4.ip_version=c2.ipType;c4.mac_address=c2.macAddress;c4.dip_address=c2.destIpAddress;c4.sip_address=c2.sourceIpAddress;c4.dFromPort=c2.destPortStart;c4.dToPort=c2.destPortEnd;c4.sFromPort=c2.sourcePortStart;c4.sToPort=c2.sourcePortEnd;c4.action=c2.action;c4.protocol=c2.protocol;c4.comment=c2.comment;return c4}function c1(c2){if(c2){return c2}else{return U}}}function ay(){return bv(arguments,{},c0,c1,null,true);function c0(c3,c4){var c5={};var c6=b9.filter(c3.indexs,function(c7){return c7.length==1});c5.goformId="DEL_IP_PORT_FILETER_V4V6";var c2=[];b9.each(c3.indexs,function(c7){if(c7.length==2){c2.push(c7.substring(1))}});c5.delete_id_v6=c2.length>0?c2.join(";")+";":"";c5.delete_id=c6.length>0?c6.join(";")+";":"";return c5}function c1(c2){if(c2){return c2}else{return U}}}function ci(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="WirelessMode,CountryCode,Channel,HT_MCS,wifi_band,wifi_11n_cap,MAX_Access_num,m_MAX_Access_num,MAX_Station_num,wifi_sta_connection";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={mode:c3.WirelessMode,countryCode:c3.CountryCode,channel:c3.Channel,rate:c3.HT_MCS,wifiBand:c3.wifi_band=="a"?"a":"b",bandwidth:c3.wifi_11n_cap,MAX_Station_num:cG.isNumeric(c3.MAX_Station_num)?c3.MAX_Station_num:aE.MAX_STATION_NUMBER,MAX_Access_num:c3.MAX_Access_num,m_MAX_Access_num:c3.m_MAX_Access_num,ap_station_enable:c3.wifi_sta_connection};return c2}else{return U}}}function cQ(){au(arguments,c0,c1);function c0(c2){var c3={goformId:"SET_WIFI_INFO",wifiMode:c2.mode,countryCode:c2.countryCode,MAX_Access_num:c2.station,m_MAX_Access_num:c2.m_station};if(aE.WIFI_BAND_SUPPORT){c3.wifi_band=c2.wifiBand}if(aE.WIFI_BAND_SUPPORT&&c2.wifiBand=="a"){c3.selectedChannel="auto"}else{c3.selectedChannel=c2.channel;c3.abg_rate=c2.rate}if(aE.WIFI_BANDWIDTH_SUPPORT){c3.wifi_11n_cap=c2.bandwidth}return c3}function c1(c2){if(c2){return c2}else{return U}}}function a6(){return bv(arguments,{},c0,c1,null,false);function c0(c3,c4){var c2=aE.PASSWORD_ENCODE?"WPAPSK1_encode,m_WPAPSK1_encode,":"rnum_js,WPAPSK1_enaes,m_WPAPSK1_enaes,";var c5={cmd:"wifi_coverage,m_ssid_enable,imei,network_type,sub_network_type,rssi,rscp,lte_rsrp,imsi,sim_imsi,cr_version,hw_version,MAX_Access_num,"+c2+"SSID1,AuthMode,m_SSID,m_AuthMode,m_HideSSID,m_MAX_Access_num,lan_ipaddr,mac_address,msisdn,LocalDomain,wan_ipaddr,static_wan_ipaddr,ipv6_wan_ipaddr,ipv6_pdp_type,pdp_type,ppp_status,sta_ip_status,rj45_state,ethwan_mode,ziccid,lte_band",multi_data:1};return c5}function c1(c2){if(c2){return{ssid:c2.SSID1,authMode:c2.AuthMode,passPhrase:aE.PASSWORD_ENCODE?Base64.decode(c2.WPAPSK1_encode):c(c2.rnum_js,c2.imei,c2.WPAPSK1_enaes),m_ssid:c2.m_SSID,m_AuthMode:c2.m_AuthMode,m_passPhrase:aE.PASSWORD_ENCODE?Base64.decode(c2.m_WPAPSK1_encode):c(c2.rnum_js,c2.imei,c2.m_WPAPSK1_enaes),m_max_access_num:c2.m_MAX_Access_num,multi_ssid_enable:c2.m_ssid_enable,ipAddress:c2.lan_ipaddr,wanIpAddress:c2.wan_ipaddr,staticWanIpAddress:c2.static_wan_ipaddr,ipv6WanIpAddress:c2.ipv6_wan_ipaddr,ipv6PdpType:c2.ipv6_pdp_type,macAddress:c2.mac_address,simSerialNumber:c2.msisdn,lanDomain:c2.LocalDomain,imei:c2.imei,iccid:c2.ziccid,signal:convertSignal(c2),imsi:c2.imsi||c2.sim_imsi,sw_version:c2.cr_version,hw_version:c2.hw_version,max_access_num:c2.MAX_Access_num,wifiRange:c2.wifi_coverage,pdpType:c2.pdp_type,rj45ConnectStatus:typeof c2.rj45_state=="undefined"||c2.rj45_state==""?"dead":c2.rj45_state,blc_wan_mode:br.blc_wan_mode,connectStatus:c2.ppp_status,wifiConStatus:c2.sta_ip_status,ethwan_mode:c2.ethwan_mode.toUpperCase(),lte_band:c2.lte_band}}else{return U}}}function cM(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"imei,rnum_js",multi_data:1};return c4}function c1(c2){if(c2){var c5=c2.rnum_js+c2.imei+"FFFFFFFFFFFFFFFFFFFFFFFF";var c3;var c4;c3=c5.substring(0,24);c4=c5.substring(0,16);return{skey:c3,siv:c4}}else{return{skey:"FFFFFFFFFFFFFFFFFFFFFFFF",siv:"FFFFFFFFFFFFFFFF"}}}}function V(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="wifi_coverage";return c4}function c1(c3){if(c3){var c2={};c2.wifiRangeMode=c3.wifi_coverage;return c2}else{return U}}}function cO(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="SET_WIFI_COVERAGE";c4.wifi_coverage=c2.wifiRangeMode;return c4}function c1(c2){if(c2){return c2}else{return U}}}function aj(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="upnpEnabled";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.upnpSetting=c3.upnpEnabled=="1"?"1":"0";return c2}else{return U}}}function aZ(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="UPNP_SETTING";c4.upnp_setting_option=c2.upnpSetting;return c4}function c1(c2){if(c2){return c2}else{return U}}}function ax(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="DMZEnable,DMZIPAddress";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.dmzSetting=c3.DMZEnable=="1"?"1":"0";c2.ipAddress=c3.DMZIPAddress;return c2}else{return U}}}function cK(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="DMZ_SETTING";c4.DMZEnabled=c2.dmzSetting;if(c4.DMZEnabled=="1"){c4.DMZIPAddress=c2.ipAddress}return c4}function c1(c2){if(c2){return c2}else{return U}}}function a5(){return bv(arguments,{},c1,c2,null,false);function c1(c3,c4){var c5={};c5.cmd="PortMapEnable,PortMapRules_0,PortMapRules_1,PortMapRules_2,PortMapRules_3,PortMapRules_4,PortMapRules_5,PortMapRules_6,PortMapRules_7,PortMapRules_8,PortMapRules_9",c5.multi_data=1;return c5}function c2(c4){if(c4){var c3={};c3.portMapEnable=c4.PortMapEnable;var c5=[];if(c4.PortMapRules_0!=""){c5.push([0,c4.PortMapRules_0])}if(c4.PortMapRules_1!=""){c5.push([1,c4.PortMapRules_1])}if(c4.PortMapRules_2!=""){c5.push([2,c4.PortMapRules_2])}if(c4.PortMapRules_3!=""){c5.push([3,c4.PortMapRules_3])}if(c4.PortMapRules_4!=""){c5.push([4,c4.PortMapRules_4])}if(c4.PortMapRules_5!=""){c5.push([5,c4.PortMapRules_5])}if(c4.PortMapRules_6!=""){c5.push([6,c4.PortMapRules_6])}if(c4.PortMapRules_7!=""){c5.push([7,c4.PortMapRules_7])}if(c4.PortMapRules_8!=""){c5.push([8,c4.PortMapRules_8])}if(c4.PortMapRules_9!=""){c5.push([9,c4.PortMapRules_9])}c3.portMapRules=c0(c5);return c3}else{return U}}function c0(c3){var c7=[];if(c3&&c3.length>0){for(var c5=0;c5<c3.length;c5++){var c4={};var c6=c3[c5][1].split(",");c4.index=c3[c5][0];c4.sourcePort=c6[1];c4.destIpAddress=c6[0];c4.destPort=c6[2];c4.protocol=transProtocol(c6[3]);c4.comment=c6[4];c7.push(c4)}}return c7}}function bC(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="ADD_PORT_MAP";c4.portMapEnabled=c2.portMapEnable;c4.fromPort=c2.sourcePort;c4.ip_address=c2.destIpAddress;c4.toPort=c2.destPort;c4.protocol=c2.protocol;c4.comment=c2.comment;return c4}function c1(c2){if(c2){return c2}else{return U}}}function bz(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="ADD_PORT_MAP";c4.portMapEnabled=c2.portMapEnable;return c4}function c1(c2){if(c2){return c2}else{return U}}}function aV(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="DEL_PORT_MAP";c4.delete_id=c2.indexs.join(";")+";";return c4}function c1(c2){if(c2){return c2}else{return U}}}function H(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{cmd:"data_volume_limit_switch,data_volume_limit_unit,data_volume_limit_size,data_volume_alert_percent,monthly_tx_bytes,monthly_rx_bytes,monthly_time,traffic_alined_delta",multi_data:1}}function c1(c3){if(c3){var c4=c3.data_volume_limit_unit=="data";var c2={dataLimitChecked:c3.data_volume_limit_switch,dataLimitTypeChecked:c4?"1":"0",limitDataMonth:c4?c3.data_volume_limit_size:"0",alertDataReach:c4?c3.data_volume_alert_percent:"0",limitTimeMonth:c4?"0":c3.data_volume_limit_size,alertTimeReach:c4?"0":c3.data_volume_alert_percent,monthlySent:c3.monthly_tx_bytes==""?0:c3.monthly_tx_bytes,monthlyReceived:c3.monthly_rx_bytes==""?0:c3.monthly_rx_bytes,monthlyConnectedTime:c3.monthly_time==""?0:c3.monthly_time,traffic_alined_delta:c3.traffic_alined_delta==""?0:c3.traffic_alined_delta};return c2}else{return U}}}function al(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c5=c2.dataLimitTypeChecked=="1";var c4={goformId:"DATA_LIMIT_SETTING",data_volume_limit_switch:c2.dataLimitChecked};if(c2.dataLimitChecked=="1"){c4.data_volume_limit_unit=c5?"data":"time";c4.data_volume_limit_size=c5?c2.limitDataMonth:c2.limitTimeMonth;c4.data_volume_alert_percent=c5?c2.alertDataReach:c2.alertTimeReach}return c4}function c1(c2){if(c2){return c2}else{return U}}}function cq(){var c2=arguments[1];return bv(arguments,{},c0,c1,null,true);function c0(c3,c4){if(c3.sendOrReply=="send"){return{goformId:"USSD_PROCESS",USSD_operator:c3.operator,USSD_send_number:c3.strUSSDCommand,notCallback:true}}else{if(c3.sendOrReply=="reply"){return{goformId:"USSD_PROCESS",USSD_operator:c3.operator,USSD_reply_number:c3.strUSSDCommand,notCallback:true}}}}function c1(c3){if(!c3){c2(false,"ussd_fail");return}if(c3.result=="success"){callbackTemp=c2;b2()}else{c2(false,"ussd_fail")}}}function b2(){cG.ajax({url:"/reqproc/proc_get",data:{cmd:"ussd_write_flag"},cache:false,async:true,dataType:"json",success:function(c0){if(c0.ussd_write_flag=="1"){callbackTemp(false,"ussd_no_service")}else{if(c0.ussd_write_flag=="4"||c0.ussd_write_flag=="unknown"||c0.ussd_write_flag=="3"){callbackTemp(false,"ussd_timeout")}else{if(c0.ussd_write_flag=="15"){setTimeout(b2,1e3)}else{if(c0.ussd_write_flag=="10"){callbackTemp(false,"ussd_retry")}else{if(c0.ussd_write_flag=="99"){callbackTemp(false,"ussd_unsupport")}else{if(c0.ussd_write_flag=="41"){callbackTemp(false,"operation_not_supported")}else{if(c0.ussd_write_flag=="2"){callbackTemp(false,"network_terminated")}else{if(c0.ussd_write_flag=="16"){cG.ajax({url:"/reqproc/proc_get",data:{cmd:"ussd_data_info"},dataType:"json",async:true,cache:false,success:function(c1){var c2={};c2.data=c1.ussd_data;c2.ussd_action=c1.ussd_action;c2.ussd_dcs=c1.ussd_dcs;callbackTemp(true,c2)},error:function(){callbackTemp(false,"ussd_info_error")}})}else{callbackTemp(false,"ussd_fail")}}}}}}}}},error:function(){callbackTemp(false,"ussd_fail")}})}function p(c1){cG.ajax({url:"/reqproc/proc_post",data:{goformId:"USSD_PROCESS",USSD_operator:"ussd_cancel"},cache:false,dataType:"json",success:function(c2){if(c2.result=="success"){c0()}else{c1(false)}}});function c0(){cG.ajax({url:"/reqproc/proc_get",data:{cmd:"ussd_write_flag"},cache:false,async:true,dataType:"json",success:function(c2){if(c2.ussd_write_flag=="15"){setTimeout(c0,1e3)}else{if(c2.ussd_write_flag=="13"){c1(true)}else{c1(false)}}},error:function(){c1(false)}})}}function aJ(){var c4=arguments[1];var c3=0;return bv(arguments,{},c0,c1,null,true);function c0(c5){return{goformId:"UNLOCK_NETWORK",notCallback:true,unlock_network_code:c5.unlock_network_code}}function c1(c5){if(c5&&c5.result=="success"){cH(c2)}else{c4({result:"fail"})}}function c2(){if(c3>5){B(c2);c4({result:"fail"})}else{if(br.simStatus!="modem_imsi_waitnck"){B(c2);c4({result:"success"})}}c3++}}function cd(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{cmd:"unlock_nck_time"}}function c1(c2){if(c2){return c2}else{return U}}}function cU(){var c2=arguments[1];return bv(arguments,{},c0,c1,null,true);function c0(c3){return{goformId:"SET_UPGRADE_NOTICE",upgrade_notice_flag:c3.upgrade_notice_flag,notCallback:true}}function c1(c3){if(c3.result=="success"){c2(true)}else{c2(false)}}}function bV(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{cmd:"upgrade_notice_flag"}}function c1(c2){if(c2){return c2}else{return U}}}function ar(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{multi_data:1,cmd:"wifi_sta_connection,pswan_priority,wifiwan_priority,ethwan_priority"}}function c1(c2){if(c2){return{ap_station_enable:c2.wifi_sta_connection,ap_station_mode:parseInt(c2.wifiwan_priority,10)>parseInt(c2.pswan_priority,10)?"wifi_pref":"dial_pref"}}else{return U}}}function a9(){var c1=arguments[0];return bv(arguments,{},c0,c2,null,true);function c0(c3){return{goformId:"WIFI_STA_CONTROL",wifi_sta_connection:c3.ap_station_enable}}function c2(c3){if(c3&&c3.result=="success"){br.ap_station_enable=c1.ap_station_enable==1;return c3}else{return U}}}function Z(){return ar({},function(c0){br.ap_station_enable=c0.ap_station_enable==1;br.ap_station_mode=c0.ap_station_mode})}function cf(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c4){var c5="wifi_profile_num,wifi_profile";for(var c3=1;c3<aE.AP_STATION_LIST_LENGTH;c3++){c5=c5+",wifi_profile"+c3}return{multi_data:1,cmd:c5}}function c1(c2){if(c2){var c7=[];for(var c6=0;c6<aE.AP_STATION_LIST_LENGTH;c6++){var c9="";if(c6==0){c9=c2.wifi_profile}else{c9=c2["wifi_profile"+c6]}var c5=c9.split(";");for(var c4=0;c4<c5.length;c4++){var c8=c5[c4].split(",");if(!c8[0]){break}var c3={profileName:c8[0],fromProvider:c8[1],connectStatus:c8[2],signal:c8[3],ssid:c8[4],authMode:c8[5],encryptType:c8[6],password:c8[7]=="0"?"":c8[7],keyID:c8[8],mac:c8[9]};c7.push(c3)}}return{hotspotList:c7}}else{return U}}}function am(){return bv(arguments,{},c0,c1,null,true);function c0(c2){return{goformId:"WLAN_SET_STA_REFRESH"}}function c1(c2){if(c2){return c2}else{return U}}}function W(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{multi_data:1,cmd:"scan_finish,EX_APLIST,EX_APLIST1"}}function c1(c2){if(c2){if(c2.scan_finish=="0"){return{scan_finish:"0",hotspotList:[]}}if(c2.scan_finish=="2"){return{scan_finish:"2",hotspotList:[]}}var c7=[];for(var c6=0;c6<=1;c6++){var c9;if(c6==0){c9=c2.EX_APLIST}else{c9=c2.EX_APLIST1}var c5=c9.split(";");for(var c4=0;c4<c5.length;c4++){var c8=c5[c4].split(",");if(!c8[0]){break}var c3={fromProvider:c8[0],connectStatus:c8[1],ssid:c8[2],signal:c8[3],channel:c8[4],authMode:c8[5],encryptType:c8[6],mac:c8[7]};c7.push(c3)}}return{scan_finish:"1",hotspotList:c7}}else{return U}}}function cE(c1){var c0=[];c0.push(c1.profileName);c0.push(c1.fromProvider||"0");c0.push(c1.connectStatus||"0");c0.push(c1.signal);c0.push(c1.ssid);c0.push(c1.authMode);c0.push(c1.encryptType);c0.push(c1.password||"0");c0.push(c1.keyID);c0.push(c1.mac);return c0.join(",")}function ai(){return bv(arguments,{},c0,c1,null,true);function c0(db){var dc=db.apList;var c2="modify";if(db.profileName==""){c2="add";var c7=(jQuery.fn.jquery+Math.random()).replace(/\D/g,"");db.profileName=c7;dc.push({profileName:c7,fromProvider:"0",connectStatus:"0",signal:db.signal,ssid:db.ssid,authMode:db.authMode,encryptType:db.encryptType,password:db.password||"0",keyID:db.keyID,mac:db.mac})}var c9={profile0:[]};for(var c3=1;c3<aE.AP_STATION_LIST_LENGTH;c3++){c9["profile"+c3]=[]}var c4="";for(var c3=0;c3<dc.length;c3++){var c6="";if(db.profileName==dc[c3].profileName){c6=cE(db);c4=c6}else{c6=cE(dc[c3])}var c5=parseInt(c3%10);c9["profile"+c5].push(c6)}var c8={wifi_profile:c9.profile0.join(";")};for(var c3=1;c3<aE.AP_STATION_LIST_LENGTH;c3++){c8["wifi_profile"+c3]=c9["profile"+c3].join(";")}var da=cG.extend({goformId:"WIFI_SPOT_PROFILE_UPDATE",wifi_profile_num:dc.length,wifi_update_profile:c4,action:c2},c8);return da}function c1(c2){if(c2){return c2}else{return U}}}function cL(){return bv(arguments,{},c0,c1,null,true);function c0(db){var dd=db.apList;var c9={profile0:[]};for(var c3=1;c3<aE.AP_STATION_LIST_LENGTH;c3++){c9["profile"+c3]=[]}var c2=false;var c5="";for(var c3=0;c3<dd.length;c3++){var c7=cE(dd[c3]);if(dd[c3].profileName==db.profileName){c2=true;c5=c7;continue}var dc=c3;if(c2){dc=c3-1}var c6=parseInt(dc%10);c9["profile"+c6].push(c7)}var c4=c2?dd.length-1:dd.length;var c8={wifi_profile:c9.profile0.join(";")};for(var c3=1;c3<aE.AP_STATION_LIST_LENGTH;c3++){c8["wifi_profile"+c3]=c9["profile"+c3].join(";")}var da=cG.extend({goformId:"WIFI_SPOT_PROFILE_UPDATE",wifi_profile_num:c4,wifi_update_profile:c5,action:"delete"},c8);return da}function c1(c2){if(c2){return c2}else{return U}}}function bB(){return bv(arguments,{},c0,c1,null,true);function c0(c2){return{goformId:"WLAN_SET_STA_CON",EX_SSID1:c2.EX_SSID1,EX_AuthMode:c2.EX_AuthMode,EX_EncrypType:c2.EX_EncrypType,EX_DefaultKeyID:c2.EX_DefaultKeyID,EX_WEPKEY:c2.EX_WEPKEY,EX_WPAPSK1:c2.EX_WPAPSK1,EX_wifi_profile:c2.EX_wifi_profile,EX_mac:c2.EX_mac}}function c1(c2){if(c2&&(c2.result=="success"||c2.result=="processing")){return c2}else{return U}}}function aH(){return bv(arguments,{},c0,c1,null,true);function c0(c2){return{goformId:"WLAN_SET_STA_DISCON"}}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function cJ(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{multi_data:1,cmd:"blc_wan_mode,blc_wan_auto_mode,loginfo,ppp_status,rj45_state,ethwan_mode"}}function c1(c3){if(c3){var c2={};if(c3.blc_wan_mode=="AUTO"){c2.blc_wan_mode=c3.blc_wan_auto_mode?c3.blc_wan_auto_mode:"AUTO_PPP"}else{c2.blc_wan_mode=c3.blc_wan_mode?c3.blc_wan_mode:"PPP"}c2.loginfo=c3.loginfo;c2.ppp_status=c3.ppp_status;c2.rj45_state=typeof c3.rj45_state=="undefined"||c3.rj45_state==""?"dead":c3.rj45_state;c2.ethwan_mode=c3.ethwan_mode.toUpperCase();return c2}else{return U}}}function a0(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{cmd:"rj45_plug"}}function c1(c3){if(c3){var c2={};c2.rj45_plug=c3.rj45_plug==""?"wan_lan_off":c3.rj45_plug;return c2}else{return U}}}function co(c0,c1){if(aE.RJ45_SUPPORT){if(c1=="dead"||c1==""){return"PPP"}else{if(!c0||c0=="undefined"){if(c1=="working"){return"PPPOE"}else{return"PPP"}}else{return c0}}}else{return"PPP"}}function bf(c0,c3){return bv(arguments,{},c1,c2,null,true);function c1(c4){var c5=cG.extend({goformId:"OPERATION_MODE"},c4);return c5}function c2(c4){if(c4&&c4.result=="success"){return c4}else{return U}}}function a3(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{multi_data:1,cmd:"opms_wan_auto_mode,ethwan_mode,pppoe_username,pppoe_cc,ethwan_dialmode,ppp_status,static_wan_ipaddr,static_wan_netmask,static_wan_gateway,static_wan_primary_dns,static_wan_secondary_dns,rj45_state,lan_ipaddr,lan_netmask"}}function c1(c2){if(c2){return{opms_wan_auto_mode:c2.opms_wan_auto_mode,ethwan_mode:c2.ethwan_mode.toUpperCase(),pppoe_username:c2.pppoe_username,pppoe_cc:c2.pppoe_cc,ethwan_dialmode:c2.ethwan_dialmode=="manual"?"manual_dial":"auto_dial",ppp_status:c2.ppp_status,static_wan_ipaddr:c2.static_wan_ipaddr,static_wan_netmask:c2.static_wan_netmask,static_wan_gateway:c2.static_wan_gateway,static_wan_primary_dns:c2.static_wan_primary_dns,static_wan_secondary_dns:c2.static_wan_secondary_dns,rj45_state:typeof c2.rj45_state=="undefined"||c2.rj45_state==""?"dead":c2.rj45_state,lan_ipaddr:c2.lan_ipaddr,lan_netmask:c2.lan_netmask}}else{return U}}}function cs(c0,c3){return bv(arguments,{},c1,c2,null,true);function c1(c4){var c5=cG.extend({notCallback:true},c4);return c5}function c2(c4){if(c4.result=="success"){c3({result:true})}else{c3({result:false})}}}function ap(c0,c4){return bv(arguments,{},c1,c2,null,false);function c1(c5,c6){return{multi_data:1,cmd:"sntp_year,sntp_month,sntp_day,sntp_hour,sntp_minute,sntp_second,sntp_time_set_mode,sntp_static_server0,sntp_static_server1,sntp_static_server2,sntp_server0,sntp_server1,sntp_server2,sntp_server3,sntp_server4,sntp_server5,sntp_server6,sntp_server7,sntp_server8,sntp_server9,sntp_other_server0,sntp_other_server1,sntp_other_server2,sntp_timezone,sntp_timezone_index,sntp_dst_enable,ppp_status,sntp_process_result,rj45_state"}}function c2(c5){if(c5){var c6=c3(c5);return{sntp_year:c5.sntp_year,sntp_month:c5.sntp_month,sntp_day:c5.sntp_day,sntp_hour:c5.sntp_hour,sntp_minute:c5.sntp_minute,sntp_second:c5.sntp_second,sntp_time_set_mode:c5.sntp_time_set_mode,sntp_servers:c6,sntp_server0:c5.sntp_server0,sntp_server1:c5.sntp_server1,sntp_server2:c5.sntp_server2,sntp_static_server0:c5.sntp_static_server0,sntp_static_server1:c5.sntp_static_server1,sntp_static_server2:c5.sntp_static_server2,sntp_other_server0:c5.sntp_other_server0,sntp_other_server1:c5.sntp_other_server1,sntp_other_server2:c5.sntp_other_server2,sntp_timezone:c5.sntp_timezone,sntp_timezone_index:c5.sntp_timezone_index?c5.sntp_timezone_index:"0",sntp_dst_enable:c5.sntp_dst_enable,ppp_status:c5.ppp_status,blc_wan_mode:br.blc_wan_mode,sntp_process_result:c5.sntp_process_result,rj45_state:typeof c5.rj45_state=="undefined"||c5.rj45_state==""?"dead":c5.rj45_state}}else{return U}}function c3(c5){var c9=[];for(var c8=0;c8<3;c8++){var c7="sntp_static_server"+c8.toString();if(c5[c7]!=""){var db={};db.name=c5[c7];db.value=c5[c7];c9.push(db)}}var da=[{name:"Other",value:"Other"},{name:"NONE",value:""}];for(var c6=0;c6<2;c6++){c9.push(da[c6])}return c9}}function b1(c0,c3){return bv(arguments,{},c1,c2,null,true);function c1(c4){var c5=cG.extend({},c4);return c5}function c2(c4){if(c4&&c4.result=="success"){return c4}else{return U}}}function g(c0,c3){var c2=cG.extend({},c0);cG.post("reqproc/proc_post",c2,function(c4){if(c4&&c4.result=="success"){if(c0.manualsettime=="auto"){setTimeout(c1,2e3);c3(c4)}else{c3(true)}}else{if(c4&&c4.result=="processing"){c3(c4)}else{c3(false)}}},"json");function c1(){cG.ajax({url:"reqproc/proc_get",dataType:"json",data:{cmd:"sntp_process_result"},cache:false,async:false,success:function(c4){if(c4.sntp_process_result=="failure"){c3(false)}else{if(c4.sntp_process_result=="success"){c3(true)}else{setTimeout(c1,2e3)}}},error:function(){c3(false)}})}}function b3(c0,c3){return bv(arguments,{},c1,c2,null,true);function c1(c4){var c5=cG.extend({},c4);return c5}function c2(c4){if(c4&&c4.result=="success"){return c4}else{return U}}}function bL(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{cmd:"websURLFilters"}}function c1(c2){var c5=[];if(c2){if(c2.websURLFilters.length==0){return{urlFilterRules:[]}}else{var c6=c2.websURLFilters.split(";");for(var c4=0;c4<c6.length;c4++){var c3={};c3.index=c4;c3.url=c6[c4];c5.push(c3)}return{urlFilterRules:c5}}}else{return U}}}function ch(c0,c3){return bv(arguments,{},c1,c2,null,true);function c1(c4){var c5=cG.extend({},c4);return c5}function c2(c4){if(c4&&c4.result=="success"){return c4}else{return U}}}function bD(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{multi_data:"1",cmd:"wifi_wds_mode,wifi_wds_ssid,wifi_wds_AuthMode,wifi_wds_EncrypType,wifi_wds_WPAPSK1,wifi_cur_state "}}function c1(c2){if(c2){return{currentMode:c2.wifi_wds_mode,wdsSSID:c2.wifi_wds_ssid,wdsAuthMode:c2.wifi_wds_AuthMode,wdsEncrypType:c2.wifi_wds_EncrypType,wdsWPAPSK1:c2.wifi_wds_WPAPSK1,RadioOff:c2.wifi_cur_state=="1"?"1":"0"}}else{return U}}}function an(c0,c3){return bv(arguments,{},c1,c2,null,true);function c1(c4){var c5=cG.extend({},c4);return c5}function c2(c4){if(c4&&c4.result=="success"){return c4}else{return U}}}function x(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{multi_data:"1",cmd:"syslog_mode,debug_level"}}function c1(c2){if(c2){return{currentMode:c2.syslog_mode,debugLevel:c2.debug_level}}else{return U}}}function a7(c0,c3){return bv(arguments,{},c1,c2,null,true);function c1(c4){var c5=cG.extend({},c4);return c5}function c2(c4){if(c4&&c4.result=="success"){return c4}else{return U}}}function b0(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){return{multi_data:"1",cmd:"ACL_mode,wifi_mac_black_list,wifi_hostname_black_list,wifi_cur_state,user_ip_addr,client_mac_address,wifi_mac_white_list"}}function c1(c2){if(c2){return{ACL_mode:c2.ACL_mode,wifi_mac_black_list:c2.wifi_mac_black_list,wifi_hostname_black_list:c2.wifi_hostname_black_list,RadioOff:c2.wifi_cur_state=="1"?"1":"0",user_ip_addr:c2.user_ip_addr,client_mac_address:c2.client_mac_address,wifi_mac_white_list:c2.wifi_mac_white_list}}else{return U}}}function az(){return bv(arguments,{},c0,c1,null,true);function c0(c2){var c3=cG.extend({goformId:"WIFI_MAC_FILTER"},c2);return c3}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function aq(){return bv(arguments,{},c0,c1,null,false);function c0(c2){return{cmd:"mgmt_quicken_power_on,need_hard_reboot,need_sim_pin",multi_data:1}}function c1(c2){return{fastbootEnabled:c2.mgmt_quicken_power_on=="1"?"1":"0",need_hard_reboot:c2.need_hard_reboot,need_sim_pin:c2.need_sim_pin=="yes"?"yes":"no"}}}function bJ(){return bv(arguments,{},c0,c1,null,true);function c0(c2){return{goformId:"MGMT_CONTROL_POWER_ON_SPEED",mgmt_quicken_power_on:c2.fastbootEnabled}}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function a2(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="TURN_OFF_DEVICE";return c4}function c1(c2){if(c2){return c2}else{return U}}}function ag(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="REBOOT_DEVICE";return c4}function c1(c2){if(c2){return c2}else{return U}}}function X(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="fota_new_version_state,fota_current_upgrade_state,fota_package_already_download";c4.multi_data=1;return c4}function c1(c2){if(c2){var c3=c2.fota_new_version_state=="has_critical"||c2.fota_new_version_state=="has_optional"||c2.fota_new_version_state=="already_has_pkg";c2.hasNewVersion=c3;return c2}else{return U}}}function bh(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};if(aE.UPGRADE_TYPE=="OTA"){c4.cmd="is_mandatory"}else{c4.cmd="fota_new_version_state"}return c4}function c1(c2){if(c2){if(aE.UPGRADE_TYPE=="OTA"){return{is_mandatory:c2.is_mandatory=="1"}}else{return{is_mandatory:c2.fota_new_version_state=="has_critical"}}}else{return U}}}function ct(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="upgrade_result";return c4}function c1(c2){if(c2){return c2}else{return U}}}function be(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="fota_current_upgrade_state";return c4}function c1(c2){if(c2){c2.current_upgrade_state=c2.fota_current_upgrade_state;return c2}else{return U}}}function N(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="fota_pkg_total_size,fota_dl_pkg_size";c4.multi_data=1;return c4}function c1(c2){if(c2){return c2}else{return U}}}function M(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="IF_UPGRADE";c4.select_op=c2.selectOp;if(c4.select_op=="check"){c4.ota_manual_check_roam_state=1}return c4}function c1(c2){if(c2){return c2}else{return U}}}function F(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="fota_updateMode,fota_updateIntervalDay,fota_allowRoamingUpdate";c4.multi_data=1;return c4}function c1(c2){if(c2){return{updateMode:c2.fota_updateMode,updateIntervalDay:c2.fota_updateIntervalDay,allowRoamingUpdate:c2.fota_allowRoamingUpdate}}else{return U}}}function ak(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="SetUpgAutoSetting";c4.UpgMode=c2.updateMode;c4.UpgIntervalDay=c2.updateIntervalDay;c4.UpgRoamPermission=c2.allowRoamingUpdate;return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function cY(){return cg({nv:["dm_last_check_time"]},arguments[1],arguments[2])}function h(){return cg({nv:["network_type","sub_network_type","rssi","rscp","lte_rsrp"]},arguments[1],arguments[2])}function j(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="RESULT_RESTORE";return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function v(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"childGroupList"};return c4}function c1(c2){if(c2&&(c2.childGroupList||c2.devices)){return c2}else{return{devices:[]}}}}function cj(){return bv(arguments,aE.currentUserInChildGroup==false?{}:{errorType:"no_auth"},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"ADD_DEVICE",mac:c2.macAddress};return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function cx(){return bv(arguments,aE.currentUserInChildGroup==false?{}:{errorType:"no_auth"},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"DEL_DEVICE",mac:c2.mac};return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function s(c0){if(typeof aE.currentUserInChildGroup=="undefined"){var c3=[];if(typeof c0!="undefined"){c3=c0}else{c3=v({}).devices}var c1=aY({}).get_user_mac_addr;var c2=b9.find(c3,function(c4){return c4.mac==c1});aE.currentUserInChildGroup=typeof c2!="undefined";return{result:typeof c2!="undefined"}}return{result:aE.currentUserInChildGroup}}function aY(){return cg({nv:"get_user_mac_addr"},arguments[1],arguments[2])}function u(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"hostNameList"};return c4}function c1(c2){if(c2&&(c2.hostNameList||c2.devices)){return c2}else{return{devices:[]}}}}function bd(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"EDIT_HOSTNAME",mac:c2.mac,hostname:c2.hostname};return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function cS(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"site_white_list"};return c4}function c1(c2){if(c2&&(c2.site_white_list||c2.siteList)){return c2}else{return{siteList:[]}}}}function E(){return bv(arguments,aE.currentUserInChildGroup==false?{}:{errorType:"no_auth"},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"REMOVE_WHITE_SITE",ids:c2.ids.join(",")};return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function bw(){return bv(arguments,aE.currentUserInChildGroup==false?{}:{errorType:"no_auth"},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"ADD_WHITE_SITE",name:c2.name,site:c2.site};return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function bZ(){var c3={0:[],1:[],2:[],3:[],4:[],5:[],6:[]};return bv(arguments,{},c0,c2,null,false);function c0(c4,c5){var c6={cmd:"time_limited"};return c6}function c2(c4){if(c4){return c1(c4)}else{return c3}}function c1(c4){if(c4.time_limited==""){return{time_limited:[]}}var c5=c4.time_limited.split(";");b9.each(c5,function(c6){var c7=c6.split("+");if(c7.length==2){c3[c7[0]]=c7[1].split(",")}});return c3}}function n(){return bv(arguments,aE.currentUserInChildGroup==false?{}:{errorType:"no_auth"},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"SAVE_TIME_LIMITED",time_limited:c2.time};return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function ck(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"openEnable,closeEnable,openTime,closeTime",multi_data:"1"};return c4}function c1(c2){if(c2){if(c2.openTime.indexOf(":")!=-1){var c3=c2.openTime.split(":");c2.openH=leftInsert(c3[0],2,"0");c2.openM=leftInsert(c3[1],2,"0")}else{c2.openH="06";c2.openM="00"}if(c2.closeTime.indexOf(":")!=-1){var c4=c2.closeTime.split(":");c2.closeH=leftInsert(c4[0],2,"0");c2.closeM=leftInsert(c4[1],2,"0")}else{c2.closeH="22";c2.closeM="00"}return c2}else{return U}}}function bI(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"SAVE_TSW",openEnable:c2.openEnable,closeEnable:c2.closeEnable};if(c2.openEnable=="1"){c4.openTime=c2.openTime;c4.closeTime=c2.closeTime}return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{if(c2&&c2.result=="failure"){return c2}else{return U}}}}function aK(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={goformId:"FLOW_CALIBRATION_MANUAL",calibration_way:c2.way,time:c2.way=="time"?c2.value:0,data:c2.way=="data"?c2.value:0};return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function cg(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};if(b9.isArray(c2.nv)){c4.cmd=c2.nv.join(",");c4.multi_data=1}else{c4.cmd=c2.nv}return c4}function c1(c2){if(c2){return c2}else{return U}}}function aM(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="vwim_mc_state,traffic_overrun,detect_new_version";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.vwim_mc_state=c3.vwim_mc_state;c2.traffic_overrun=c3.traffic_overrun;c2.detect_new_version=c3.detect_new_version;c2.blc_wan_mode=br.blc_wan_mode;return c2}else{return U}}}function cA(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="CLEAR_REDIRECT_FLAG";c4.flag_id=c2.redirectFlags;return c4}function c1(c2){if(c2){return c2}else{return U}}}function bY(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="lock_zone_enable,pin_interlock_and_V4_lock";c4.multi_data=1;return c4}function c1(c2){if(c2){return c2}else{return U}}}function bG(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="PIN_LOCK_V4_ENCODE";c4.pin_interlock_and_V4_lock=c2.pin_interlock_and_V4_lock;c4.TspLock_key_data=c2.TspLock_key_data;return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function aD(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="cell_id_list,global_cell_id,network_type,sub_network_type,cell_not_correct";c4.multi_data=1;return c4}function c1(c2){if(c2){return c2}else{return U}}}function bS(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="LOCK_ZONE";c4.lock_zone_enable=c2.lock_zone_enable;return c4}function c1(c2){if(c2&&c2.result=="success"){return c2}else{return U}}}function cI(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={cmd:"update_type"};return c4}function c1(c2){return{update_type:c2.update_type?c2.update_type:"mifi_fota"}}}function f(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c3){var c4={};c4.cmd="AuthMode,passPhrase";c4.multi_data=1;return c4}function c1(c3){if(c3){var c2={};c2.AuthMode=c3.AuthMode;c2.passPhrase=aE.PASSWORD_ENCODE?Base64.decode(c3.passPhrase):c3.passPhrase;return c2}else{return U}}}function y(){return bv(arguments,{},c0,c1,null,true);function c0(c2,c3){var c4={};c4.goformId="SET_WIFI_SECURITY_INFO";c4.AuthMode=c2.AuthMode;if(c4.AuthMode=="WPAPSKWPA2PSK"){c4.passPhrase=aE.PASSWORD_ENCODE?Base64.encode(c2.passPhrase):c2.passPhrase}return c4}function c1(c2){if(c2){return c2}else{return U}}}function b8(){au(arguments,c0,c1);function c0(c2){var c3={goformId:"SET_WIFI_SSID1_SETTINGS",ssid:c2.SSID,broadcastSsidEnabled:c2.broadcast,MAX_Access_num:c2.station,security_mode:c2.AuthMode,cipher:c2.cipher,NoForwarding:c2.NoForwarding,show_qrcode_flag:c2.show_qrcode_flag};if(aE.WIFI_WEP_SUPPORT){c3.wep_default_key=c2.wep_default_key;c3.wep_key_1=c2.wep_key_1;c3.wep_key_2=c2.wep_key_2;c3.wep_key_3=c2.wep_key_3;c3.wep_key_4=c2.wep_key_4;if(c2.wep_default_key=="1"){c3.WEP2Select=c2.WEP2Select}else{if(c2.wep_default_key=="2"){c3.WEP3Select=c2.WEP3Select}else{if(c2.wep_default_key=="3"){c3.WEP4Select=c2.WEP4Select}else{c3.WEP1Select=c2.WEP1Select}}}}if(c2.AuthMode=="WPAPSK"||c2.AuthMode=="WPA2PSK"||c2.AuthMode=="WPAPSKWPA2PSK"||c2.AuthMode=="WPA3Personal"||c2.AuthMode=="WPA2WPA3"){c3.security_shared_mode=c2.cipher;c3.passphrase=aE.PASSWORD_ENCODE?Base64.encode(c2.passPhrase):c2.passPhrase}else{if(c2.AuthMode=="SHARED"){c3.security_shared_mode="WEP";c3.security_mode="SHARED"}else{if(c2.encryptType=="WEP"){c3.security_shared_mode="WEP";c3.security_mode="OPEN"}else{c3.security_shared_mode="NONE"}}}return c3}function c1(c2){if(c2){return c2}else{return U}}}function bF(){au(arguments,c0,c1);function c0(c2){var c3={goformId:"SET_WIFI_SSID2_SETTINGS",m_SSID:c2.m_SSID,m_HideSSID:c2.m_broadcast,m_MAX_Access_num:c2.m_station,m_AuthMode:c2.m_AuthMode,cipher:c2.m_cipher,m_NoForwarding:c2.m_NoForwarding,m_show_qrcode_flag:c2.m_show_qrcode_flag};if(aE.WIFI_WEP_SUPPORT){c3.m_DefaultKeyID=c2.m_wep_default_key;c3.m_Key1Str1=c2.m_wep_key_1;c3.m_Key2Str1=c2.m_wep_key_2;c3.m_Key3Str1=c2.m_wep_key_3;c3.m_Key4Str1=c2.m_wep_key_4;if(c2.m_wep_default_key=="1"){c3.m_Key2Type=c2.m_WEP2Select}else{if(c2.m_wep_default_key=="2"){c3.m_Key3Type=c2.m_WEP3Select}else{if(c2.m_wep_default_key=="3"){c3.m_Key4Type=c2.m_WEP4Select}else{c3.m_Key1Type=c2.m_WEP1Select}}}}if(c2.m_AuthMode=="WPAPSK"||c2.m_AuthMode=="WPA2PSK"||c2.m_AuthMode=="WPAPSKWPA2PSK"||c2.m_AuthMode=="WPA3Personal"||c2.m_AuthMode=="WPA2WPA3"){c3.m_EncrypType=c2.m_cipher;c3.m_WPAPSK1=aE.PASSWORD_ENCODE?Base64.encode(c2.m_passPhrase):c2.m_passPhrase}else{if(c2.m_AuthMode=="SHARED"){c3.m_EncrypType="WEP";c3.m_security_mode="SHARED"}else{if(c2.m_encryptType=="WEP"){c3.m_EncrypType="WEP";c3.m_security_mode="OPEN"}else{c3.m_EncrypType="NONE"}}}return c3}function c1(c2){if(c2){return c2}else{return U}}}function cp(){return bv(arguments,{},c0,c1,null,false);function c0(c4,c2){var c3={};c3.cmd="lte_band,cell_id,ping_google";c3.multi_data=1;return c3}function c1(c3){if(c3){var c2={};c2.lte_band=c3.lte_band;c2.cell_id=c3.cell_id;c2.ping_google=c3.ping_google;return c2}else{return unknownErrorObject}}}function q(){return bv(arguments,{},c0,c1,null,false);function c0(c4,c2){var c3={};c3.cmd="work_lte_band";c3.multi_data=1;return c3}function c1(c3){if(c3){var c2={};c2.work_lte_band=c3.work_lte_band;return c2}else{return unknownErrorObject}}}function Q(){return bv(arguments,{},c0,c1,null,false);function c0(c4,c2){var c3={};c3.goformId="SET_FREQ_BAND";c3.work_lte_band=c4.work_lte_band;c3.ping_google=c4.ping_google;return c3}function c1(c2){if(c2){return c2}else{return unknownErrorObject}}}function d(){return bv(arguments,{},c0,c1,null,false);function c0(c2,c4){var c5={};var c3=aE.PASSWORD_ENCODE?"WPAPSK1_encode,m_WPAPSK1_encode,":"imei,rnum_js,WPAPSK1_enaes,m_WPAPSK1_enaes,";c5.cmd="m_ssid_enable,wifi_cur_state,NoForwarding,m_NoForwarding,"+c3+"MAX_Station_num,SSID1,AuthMode,HideSSID,MAX_Access_num,show_qrcode_flag,EncrypType,Key1Str1,Key2Str1,Key3Str1,Key4Str1,DefaultKeyID,m_SSID,m_AuthMode,m_HideSSID,m_MAX_Access_num,m_EncrypType,m_show_qrcode_flag,m_DefaultKeyID,m_Key1Str1,m_Key2Str1,m_Key3Str1,m_Key4Str1,rotationFlag,wifi_sta_connection";c5.multi_data=1;return c5}function c1(c3){if(c3){var c2={wifi_enable:c3.wifi_cur_state=="1"?"1":"0",multi_ssid_enable:c3.m_ssid_enable,MAX_Station_num:cG.isNumeric(c3.MAX_Station_num)?c3.MAX_Station_num:aE.MAX_STATION_NUMBER,AuthMode:c3.AuthMode,SSID:c3.SSID1,broadcast:c3.HideSSID,apIsolation:c3.NoForwarding,passPhrase:aE.PASSWORD_ENCODE?Base64.decode(c3.WPAPSK1_encode):c(c3.rnum_js,c3.imei,c3.WPAPSK1_enaes),MAX_Access_num:c3.MAX_Access_num,cipher:c3.EncrypType=="TKIP"?"0":c3.EncrypType=="AES"?1:2,encryptType:c3.EncrypType,show_qrcode_flag:c3.show_qrcode_flag=="1"?true:false,keyID:c3.DefaultKeyID,Key1Str1:c3.Key1Str1,Key2Str1:c3.Key2Str1,Key3Str1:c3.Key3Str1,Key4Str1:c3.Key4Str1,m_SSID:c3.m_SSID,m_broadcast:c3.m_HideSSID,m_apIsolation:c3.m_NoForwarding,m_MAX_Access_num:c3.m_MAX_Access_num,m_AuthMode:c3.m_AuthMode,m_passPhrase:aE.PASSWORD_ENCODE?Base64.decode(c3.m_WPAPSK1_encode):c(c3.rnum_js,c3.imei,c3.m_WPAPSK1_enaes),m_cipher:c3.m_EncrypType=="TKIP"?"0":c3.m_EncrypType=="AES"?1:2,m_show_qrcode_flag:c3.m_show_qrcode_flag=="1"?true:false,m_encryptType:c3.m_EncrypType,m_keyID:c3.m_DefaultKeyID,m_Key1Str1:c3.m_Key1Str1,m_Key2Str1:c3.m_Key2Str1,m_Key3Str1:c3.m_Key3Str1,m_Key4Str1:c3.m_Key4Str1,rotationFlag:c3.rotationFlag,ap_station_enable:c3.wifi_sta_connection};return c2}else{return U}}}function t(){au(arguments,c0,c1);function c0(c2){var c4=c2;if(c2.wifiEnabled=="0"){c4={wifiEnabled:c2.wifiEnabled}}var c3=cG.extend({goformId:"SET_WIFI_INFO"},c4);return c3}function c1(c2){if(c2){return c2}else{return U}}}function bv(c5,dc,c6,c2,c1,c3){var c9=c5[0],db=c5[1],c4=c5[2];var c7;if(dc&&typeof dc.errorType==="string"){c7=cG.extend(U,dc);if(!db){return c7}da(c7,db,c4)}else{c7=cG.extend({},dc);var c8;if(c6){c8=c6(c9,c3)}else{c8=c9}if(!db){if(c8&&(c8.cmd||c8.goformId)){var c0=cl(c8,c3);if(c2){c7=cG.extend({},c2(c0))}else{c7=c0}}return c7}else{if(c8&&(c8.cmd||c8.goformId)){cX(c8,function(dd){if(c2){c7=cG.extend({},c2(dd))}else{c7=cG.extend({},dd)}if(!c8.notCallback){da(c7,db,c4)}},function(){if(c1){c7=cG.extend(U,c1)}else{c7=cG.extend(U,{errorType:"Unknown"})}da(c7,db,c4)},c3)}else{da(c7,db,c4)}}}function da(dd,df,de){de=de?de:df;if(isErrorObject(dd)){switch(dd.errorType){case"cellularNetworkError":case"deviceError":case"wifiConnectionError":window.receivedNonSpecificError(dd);break;default:de(dd)}}else{df(dd)}}}function cl(c0,c1){return bg(c0,null,null,false,c1)}function cX(c2,c0,c1,c3){bg(c2,c0,c1,true,c3)}function w(c0){var c2=/^[A-z0-9]+$/;var c1=c0.match(c2);if(c1==null){return"error"}else{return c0}}function bg(c3,c1,c2,c5,c4){var c0=null;cG.ajax({type:!!c4?"POST":"GET",url:c4?"/reqproc/proc_post":c3.cmd?"/reqproc/proc_get":"/reqproc/proc_post",data:c3,dataType:"json",async:!!c5,cache:false,error:function(c6){if(c5){c2(c6)}else{if(c6.status==200){c0=jQuery.parseJSON("("+w(c6.responseText)+")")}}},success:function(c6){if(c5){c1(c6)}else{c0=c6}}});if(!c5){return c0}}var br={networkType:"",signalImg:"0",spn_b1_flag:"1",spn_name_data:"",spn_b2_flag:"1",networkOperator:"China Mobile",connectStatus:"ppp_disconnected",rj45ConnectStatus:"rj45_dead",attachedDevices:[],ssid1AttachedNum:0,ssid2AttachedNum:0,data_counter:{uploadRate:0,downloadRate:0,totalSent:0,totalReceived:0,totalConnectedTime:0,currentSent:0,currentReceived:0,currentConnectedTime:0,monthlySent:0,monthlyReceived:0,monthlyConnectedTime:0,month:""},newSmsReceived:false,smsReportReceived:false,smsUnreadCount:"0",isLoggedIn:undefined,limitVolumeEnable:false,limitVolumeType:"1",limitVolumePercent:"100",limitVolumeSize:"0",allowRoamingUpdate:"0",blc_wan_mode:"",ap_station_enable:undefined,ap_station_mode:undefined,dialMode:"",ethWanMode:"AUTO",fota_user_selector:"",defaultWanName:""};var U={errorType:"UnknownError",errorId:"123",errorText:"UnknownError"};var cF=true;return{clearRedirectFlag:cA,connect:a4,disconnect:O,getSIMPhoneBookCapacity:bK,getDevicePhoneBookCapacity:af,getDevicePhoneBooks:cV,getSIMPhoneBooks:cz,getPhoneBooks:R,getPhoneBookReady:cb,getPhoneBooksByGroup:bP,deletePhoneBooks:bi,deleteAllPhoneBooks:aS,deleteAllPhoneBooksByGroup:Y,savePhoneBook:cy,deleteAllMessages:bO,deleteMessage:cr,setSmsRead:ad,sendSMS:aW,saveSMS:aF,getSMSReady:aG,getSMSMessages:aI,getSMSDeliveryReport:K,getSmsCapability:b,resetNewSmsReceivedVar:D,resetSmsReportReceivedVar:bX,getSmsSetting:bU,setSmsSetting:aN,getAttachedCableDevices:bA,getCurrentlyAttachedDevicesInfo:bn,getConnectionInfo:bu,getRedirectData:aM,getLanguage:z,setLanguage:k,getNetSelectInfo:P,getSecurityInfo:f,setSecurityInfo:y,getStatusInfo:e,getConnectionMode:J,setConnectionMode:ae,getWifiBasic:d,setWifiBasic:b8,setWifiBasic4SSID2:bF,setWifiBasicMultiSSIDSwitch:t,getWpsInfo:b5,openWps:r,getSleepMode:ce,setSleepMode:bc,getWifiAdvance:ci,setWifiAdvance:cQ,getWifiRange:V,setWifiRange:cO,getSimSelect:cT,setSimSelect:bW,getLoginStatus:ba,getLoginData:cc,login:aL,logout:bq,changeManageInfo:bR,getPinData:cP,enablePin:cZ,disablePin:bT,changePin:o,enterPIN:I,enterPUK:S,getLanInfo:bp,setLanInfo:b6,getApnSettings:l,deleteApn:aw,setDefaultApn:bt,addOrEditApn:bl,getQuickSettingInfo:a1,setQuickSetting4IPv6:cW,scanForNetwork:aC,setBearerPreference:bE,editHostName:bd,getSiteWhiteList:cS,removeSiteWhite:E,saveSiteWhite:bw,setNetwork:bj,getUpnpSetting:aj,setUpnpSetting:aZ,getDmzSetting:ax,setDmzSetting:cK,getDeviceInfo:a6,getDeviceInfoLow:cM,getPortForward:C,setPortForward:ao,getPortFilter:bb,setPortFilterBasic:ah,setPortFilter:T,deleteFilterRules:ay,getPortMap:a5,setPortMap:bC,enablePortMap:bz,deleteMapRules:aV,getTrafficAlertInfo:H,setTrafficAlertInfo:al,getCurrentUpgradeState:be,setUpgradeSelectOp:M,addTimerThings:a8,removeTimerThings:m,getPackSizeInfo:N,getMandatory:bh,getOTAUpdateSetting:F,setOTAUpdateSetting:ak,getSignalStrength:h,getOTAlastCheckTime:cY,clearUpdateResult:j,refreshAPStationStatus:Z,getSntpParams:ap,setSntpSetting:g,setSNTPDate:b1,restoreFactorySettings:av,checkRestoreStatus:aa,getSysSecurity:bQ,setSysSecurity:cv,deleteForwardRules:cu,enableVirtualServer:aA,getSDConfiguration:bM,setSdCardMode:cn,checkFileExists:L,getFileList:ac,fileRename:bx,getSdMemorySizes:A,deleteFilesAndFolders:aT,createFolder:G,setSdCardSharing:b4,setUpdateInfoWarning:cU,getUpdateInfoWarning:bV,getAPStationBasic:ar,setAPStationBasic:a9,getWdsInfo:bD,setWDS:an,addUrlFilterRule:b3,getUrlFilterList:bL,deleteSelectedRules:ch,getMacFilterInfo:b0,setMacFilter:az,getFastbootSetting:aq,setFastbootSetting:bJ,turnOffDevice:a2,restart:ag,updateTimerFlag:cF,childGroupList:v,addChildGroup:cj,removeChildGroup:cx,checkCurrentUserInChildGroup:s,getTimeLimited:bZ,saveTimeLimited:n,getHostNameList:u,getHotspotList:cf,searchHotspot:am,getSearchHotspotList:W,saveHotspot:ai,deleteHotspot:cL,connectHotspot:bB,disconnectHotspot:aH,getOpMode:cJ,getRj45PlugState:a0,SetOperationMode:bf,getPppoeParams:a3,setPppoeDialMode:cs,getTsw:ck,saveTsw:bI,trafficCalibration:aK,getParams:cg,getNewVersionState:X,getUpgradeResult:ct,getV4Switch:bY,setV4Switch:bG,getCellId:aD,setCellIdSwitch:bS,getDdnsParams:bN,setDDNSForward:aP,getUpdateType:cI,getCurretnMAC:aO,getUSSDResponse:cq,USSDReplyCancel:p,getNetworkUnlockTimes:cd,unlockNetwork:aJ,getSyslogInfo:x,setSysLog:a7,getNetInfo:cp,getNetBandInfo:q,setselectedband:Q,setIMEI:by,setTTL:bo,getShowImeiTTL:ca,getIMEITTL:cw}});define("adm_lan","jquery knockout set service".split(" "),function(h,o,d,j){var q="";function b(){return j.getLanInfo()}function f(t){var s=(t-0).toString(16);if(s.length==1){s="0"+s}return s.toUpperCase()}function r(){var t=this;var s=b();t.dhcpStart=o.observable(s.dhcpStart);t.dhcpEnd=o.observable(s.dhcpEnd);t.dhcpLease=o.observable(s.dhcpLease);t.ipAddress=o.observable(s.ipAddress);t.subnetMask=o.observable(s.subnetMask);t.dhcpServer=o.observable(s.dhcpServer);t.macAddress=o.observable(s.macAddress);t.showMacAddress=o.observable(d.SHOW_MAC_ADDRESS);t.hasWifi=o.observable(d.HAS_WIFI);t.hasUssd=d.HAS_USSD;t.hasDdns=d.DDNS_SUPPORT;var s=j.getShowImeiTTL();if(s.show_advance_setting==1){t.showTTL=o.observable(true)}else{t.showTTL=o.observable(false)}t.hasUpdateCheck=d.HAS_UPDATE_CHECK;t.clear=function(){clearTimer();n();clearValidateMsg()};t.refreshStatus=function(){var u=j.getConnectionInfo();if(u.connectStatus=="ppp_disconnected"){h("input","#frmLan").each(function(){h(this).attr("disabled",false)})}else{h("input","#frmLan").each(function(){h(this).attr("disabled",true)});clearValidateMsg()}};t.saveAct=function(){showLoading();var u={ipAddress:t.ipAddress(),subnetMask:t.subnetMask(),dhcpServer:t.dhcpServer(),dhcpStart:t.dhcpStart(),dhcpEnd:t.dhcpEnd(),dhcpLease:t.dhcpLease()};j.setLanInfo(u,function(v){if(v.result=="success"){successOverlay();t.clear()}else{errorOverlay()}})};t.save=function(){var u=h("#frmLan").serialize();if(u==q){showAlert("setting_no_change");return false}if(d.RJ45_SUPPORT){var v=j.getPppoeParams();if(l(v.static_wan_ipaddr,t.ipAddress(),t.subnetMask())){showAlert("lan_tip_staticip_notsame");return false}}showConfirm("lan_confirm_reopen",function(){t.saveAct()})};t.refreshStatus();t.dhcpServerHandler=function(){h("#txtIpAddress").parent().find(".error").hide();h("#txtIpAddress").show();return true};addTimeout(function(){q=h("#frmLan").serialize()},500)}function p(x,v){var t;var w=[];var u=[];var s="0x";for(t=2,index_tmp=0;t<10;t+=2,index_tmp++){w[index_tmp]="0x"+x.substring(t,t+2);u[index_tmp]="0x"+v.substring(t,t+2)}for(t=0;t<4;t++){s=s+f(w[t]&u[t])}return s-0}h.validator.addMethod("dhcp_check",function(u,v,w){var t=w=="start"?h("#txtDhcpIpPoolStart").val():h("#txtDhcpIpPoolEnd").val();var s=k(h("#txtIpAddress").val(),h("#txtSubnetMask").val(),t);return this.optional(v)||s});h.validator.addMethod("dhcpCompare",function(t,u,v){var s;if(v=="#txtDhcpIpPoolStart"){s=m(h("#txtIpAddress").val(),h("#txtSubnetMask").val(),h(v).val(),t)}else{s=m(h("#txtIpAddress").val(),h("#txtSubnetMask").val(),t,h(v).val())}return s!=1});h.validator.addMethod("ipRange",function(t,v,w){var u=false;if(h("#dhcpEnable").is(":checked")){u=true}var s=m(t,h("#txtSubnetMask").val(),h("#txtDhcpIpPoolStart").val(),h("#txtDhcpIpPoolEnd").val(),u);return s!=2});h.validator.addMethod("subnetmask_check",function(t,u,v){var s=c(t);return this.optional(u)||s});function l(x,y,t){if(!x||!y||!t){return false}if(x==y){return true}var w=[];var v=[];var s=[];ip_array=x.split(".");lanIp_array=y.split(".");s=t.split(".");for(var u=0;u<ip_array.length;u+=1){w.push(parseInt(s[u])&parseInt(ip_array[u]));v.push(parseInt(s[u])&parseInt(lanIp_array[u]))}if(v.join(".")!=w.join(".")){return false}else{return true}}function e(s){return s==255||s==254||s==252||s==248||s==240||s==224||s==192||s==128||s==0}function g(v){var u=v.indexOf(".");var t=v.indexOf(".",u+1);var s=v.indexOf(".",t+1);o_ip=f(v.substring(0,u))+f(v.substring(u+1,t))+f(v.substring(t+1,s))+f(v.substring(s+1,v.length));o_ip="0x"+o_ip;return o_ip}function a(w){var v=w.indexOf(".");var u=w.indexOf(".",v+1);var t=w.indexOf(".",u+1);var s=w.substring(t+1,w.length)-0;return s}function k(s,C,B){var y=g(s);var w=a(s);var u=g(C);var A=a(C);var x=g(B);var z=a(B);var v;var t;if(p(y,u)!=p(x,u)){return false}v=w&A;t=(w&A)+(255-A);return!(z==v||z==t)}function c(s){var t=s.split(".");if("0.0.0.0"==s||"255.255.255.255"==s){return false}if(t.length!=4){return false}t[0]=parseInt(t[0]);t[1]=parseInt(t[1]);t[2]=parseInt(t[2]);t[3]=parseInt(t[3]);if(t[3]!=0){if(t[0]!=255||t[1]!=255||t[2]!=255){return false}else{if(!e(t[3])){return false}}}if(t[2]!=0){if(t[0]!=255||t[1]!=255){return false}else{if(!e(t[2])){return false}}}if(t[1]!=0){if(t[0]!=255){return false}else{if(!e(t[1])){return false}}}if(t[0]!=255){return false}return true}function m(u,w,s,t,v){s_startIp=g(s);s_endIp=g(t);s_lanIp=g(u);if(s_startIp>s_endIp){return 1}if(s_lanIp>=s_startIp&&s_lanIp<=s_endIp){return 2}return 0}function n(){var s=h("#container");o.cleanNode(s[0]);var t=new r;o.applyBindings(t,s[0]);addInterval(t.refreshStatus,1e3);h("#frmLan").validate({submitHandler:function(){t.save()},rules:{txtIpAddress:{lanip_check:true,ipRange:true},txtSubnetMask:{ipv4:true,subnetmask_check:true},txtDhcpIpPoolStart:{lanip_check:true,dhcp_check:"start",dhcpCompare:"#txtDhcpIpPoolEnd"},txtDhcpIpPoolEnd:{lanip_check:true,dhcp_check:"end",dhcpCompare:"#txtDhcpIpPoolStart"},txtDhcpLease:{range:[1,65535],digits:true}},groups:{lanip_check:"txtDhcpIpPoolStart txtDhcpIpPoolEnd"},errorPlacement:function(u,v){if(v.attr("name")=="txtDhcpLease"){u.insertAfter("#errorHolder")}else{if(v.attr("name")=="txtDhcpIpPoolStart"){u.insertAfter("#txtDhcpIpPoolEnd")}else{u.insertAfter(v)}}}})}return{init:n}});define("adm_others","jquery knockout set service underscore".split(" "),function(c,a,r,t,s){var d=s.map(r.sntpTimeSetMode,function(u){return new Option(u.name,u.value)});var e=s.map(r.timeZone,function(u){return new Option(u.name,u.value)});var g=s.map(r.daylightSave,function(u){return new Option(u.name,u.value)});var h=s.map(r.SIM_SELECTS,function(u){return new Option(u.name,u.value)});var k=[];var f=[];var b=[];var m=[];var j=[];var q=[1,3,5,7,8,10,12];var l=[4,6,9,11];function p(y,u,x){var w={};for(var v=y;v<=u;v++){w.name=v;w.value=v;x.push(new Option(w.name,w.value))}}p(2e3,2030,k);p(1,12,f);p(0,23,m);p(0,59,j);function o(){var A=this;var B=false;A.fastbootSupport=r.FAST_BOOT_SUPPORT;A.turnOffSupport=r.TURN_OFF_SUPPORT;A.SNTPSupport=r.HAS_SNTP;A.hasUssd=r.HAS_USSD;A.hasDdns=r.DDNS_SUPPORT;A.hasUpdateCheck=r.HAS_UPDATE_CHECK;A.hasUssd=r.HAS_USSD;A.hasDdns=r.DDNS_SUPPORT;var w=t.getShowImeiTTL();if(w.show_advance_setting==1){A.showTTL=a.observable(true)}else{A.showTTL=a.observable(false)}var E=t.getSimSelect();A.modes=a.observableArray(h);A.selectMode=a.observable(E.alk_sim_select);if(r.HAS_PARENTAL_CONTROL){B=t.checkCurrentUserInChildGroup().result}A.currentUserInChildGroup=a.observable(B);var D=t.getFastbootSetting();A.fastbootEnableFlag=a.observable(r.RJ45_SUPPORT?D.need_sim_pin!="yes"&&t.getRj45PlugState().rj45_plug=="wan_lan_off":D.need_sim_pin!="yes");A.fastbootSetting=a.observable(D.fastbootEnabled);addInterval(function(){A.fastbootEnableFlag(r.RJ45_SUPPORT?D.need_sim_pin!="yes"&&t.getRj45PlugState().rj45_plug=="wan_lan_off":D.need_sim_pin!="yes")},1e3);A.save=u;function u(){showLoading();var F=A.selectMode();t.setSimSelect({sim_select:F},function(G){if(G.result=="success"){showConfirm("restart_confirm",function(){restartDevice(t)})}else{errorOverlay()}})}A.restore=function(){showConfirm("restore_confirm",function(){showLoading("restoring");t.restoreFactorySettings({},function(F){if(F&&F.result=="success"){successOverlay()}else{errorOverlay()}},function(F){if(isErrorObject(F)&&F.errorType=="no_auth"){errorOverlay()}})})};A.restart=function(){showConfirm("restart_confirm",function(){restartDevice(t)})};A.saveFastBoot=function(){showLoading();var F={fastbootEnabled:A.fastbootSetting(),need_hard_reboot:D.need_hard_reboot};t.setFastbootSetting(F,function(G){if(G.result=="success"){successOverlay()}else{errorOverlay()}})};A.turnoff=function(){showConfirm("turnoff_confirm",function(){showLoading("turnoff");t.turnOffDevice({},function(F){if(F&&F.result=="success"){successOverlay()}else{errorOverlay()}},c.noop)})};t.setSNTPDate({goformId:"SNTP_Getdatastatic"});var A=this;var y=t.getSntpParams();globalTime=new Date(parseInt(y.sntp_year,10),parseInt(y.sntp_month,10)-1,parseInt(y.sntp_day,10),parseInt(y.sntp_hour,10),parseInt(y.sntp_minute,10),parseInt(y.sntp_second,10));A.day=a.observable();A.localTime=a.observable();A.timeSetModes=a.observableArray(d);A.isManualSetTime=a.observable(false);A.isAutoSntpTime=a.observable(false);A.currentMode=a.observable(y.sntp_time_set_mode);x();A.changeSetTimeMode=function(){x()};A.currentYear=a.observable(parseInt(y.sntp_year,10));A.currentMonth=a.observable(parseInt(y.sntp_month,10));A.currentDate=a.observable(parseInt(y.sntp_day,10));A.currentHour=a.observable(parseInt(y.sntp_hour,10));A.currentMinute=a.observable(parseInt(y.sntp_minute,10));A.years=a.observableArray(k);A.months=a.observableArray(f);A.initDateList=function(){z();A.dates(b)};z();A.dates=a.observableArray(b);A.hours=a.observableArray(m);A.minutes=a.observableArray(j);var C=s.map(y.sntp_servers,function(F){return new Option(F.name,F.value)});A.serverList=a.observableArray(C);A.currentServer0=a.observable(y.sntp_server0);A.currentServer1=a.observable(y.sntp_server1);A.currentServer2=a.observable(y.sntp_server2);A.customServer0=a.observable(y.sntp_other_server0);A.customServer1=a.observable(y.sntp_other_server1);A.customServer2=a.observable(y.sntp_other_server2);A.isOther0=a.observable(false);A.isOther1=a.observable(false);A.isOther2=a.observable(false);v();A.changeServerSelect=function(){v()};A.timeZones=a.observableArray(e);A.currentTimeZone=a.observable(y.sntp_timezone+"_"+y.sntp_timezone_index);A.daylightSaves=a.observableArray(g);A.currentDaylightSave=a.observable(y.sntp_dst_enable);A.updateCurrentTime=function(){var F=globalTime.getDay();switch(F){case 6:A.day(c.i18n.prop("saturday"));break;case 5:A.day(c.i18n.prop("friday"));break;case 4:A.day(c.i18n.prop("thursday"));break;case 3:A.day(c.i18n.prop("wednesday"));break;case 2:A.day(c.i18n.prop("tuesday"));break;case 1:A.day(c.i18n.prop("monday"));break;case 0:A.day(c.i18n.prop("sunday"));break;default:break}var G=globalTime.getFullYear()+"-"+getTwoDigit(globalTime.getMonth()+1)+"-"+getTwoDigit(globalTime.getDate())+" "+getTwoDigit(globalTime.getHours())+":"+getTwoDigit(globalTime.getMinutes())+":"+getTwoDigit(globalTime.getSeconds());A.localTime(G);globalTime.setTime(globalTime.getTime()+1e3)};A.apply=function(){var G=[];for(var F=0;F<y.sntp_servers.length;F++){G.push(y.sntp_servers[F].value)}var I=t.getStatusInfo();if(!checkConnectedStatus(I.connectStatus,I.rj45ConnectStatus,I.connectWifiStatus)&&A.currentMode()=="auto"){showAlert("sntp_syn_time_wan_connected");return}showLoading("");var H={goformId:"SNTP",manualsettime:A.currentMode(),sntp_server1_ip:A.currentServer0(),sntp_server2_ip:A.currentServer1(),sntp_server3_ip:A.currentServer2(),sntp_other_server0:A.customServer0(),sntp_other_server1:A.customServer1(),sntp_other_server2:A.customServer2(),timezone:A.currentTimeZone().split("_")[0],sntp_timezone_index:A.currentTimeZone().split("_")[1],DaylightEnabled:A.currentDaylightSave(),time_year:A.currentYear(),time_month:A.currentMonth(),time_day:A.currentDate(),time_hour:A.currentHour(),time_minute:A.currentMinute()};t.setSntpSetting(H,function(J){if(J){if(J.result=="success"&&A.currentMode()=="auto"){successOverlay("sntp_req_success")}else{if(J.result=="processing"&&A.currentMode()=="auto"){successOverlay("sntp_processing")}else{t.setSNTPDate({goformId:"SNTP_Getdatastatic"},function(K){var L=t.getSntpParams();globalTime=new Date(parseInt(L.sntp_year,10),parseInt(L.sntp_month,10)-1,parseInt(L.sntp_day,10),parseInt(L.sntp_hour,10),parseInt(L.sntp_minute,10),parseInt(L.sntp_second,10));successOverlay()})}}}else{errorOverlay()}})};function x(){if(A.currentMode()=="manual"){A.isManualSetTime(true);A.isAutoSntpTime(false)}else{A.isManualSetTime(false);A.isAutoSntpTime(true)}return true}function z(){b=[];if(c.inArray(parseInt(A.currentMonth(),10),l)!=-1){p(1,30,b)}else{if(c.inArray(parseInt(A.currentMonth(),10),q)!=-1){p(1,31,b)}else{if(parseInt(A.currentYear(),10)%4==0){p(1,29,b)}else{p(1,28,b)}}}}function v(){A.isOther0(A.currentServer0()=="Other");A.isOther1(A.currentServer1()=="Other");A.isOther2(A.currentServer2()=="Other");!A.isOther0()&&c("#sntp_server0").find(".error").hide();!A.isOther1()&&c("#sntp_server1").find(".error").hide();!A.isOther2()&&c("#sntp_server2").find(".error").hide()}}function n(){var v=new o;var u=c("#container")[0];a.cleanNode(u);a.applyBindings(v,u);v.updateCurrentTime();addInterval(function(){v.updateCurrentTime()},1e3);c("#sntpForm").validate({submitHandler:function(){v.apply()},rules:{sntp_other_server0:"sntp_invalid_server_name",sntp_other_server1:"sntp_invalid_server_name",sntp_other_server2:"sntp_invalid_server_name"}})}return{init:n}});define("imeistl","jquery knockout set service underscore".split(" "),function(f,d,c,a,b){function e(){var l=this;var k=a.getIMEITTL();l.imeivalue=d.observable();l.TTLNew=d.observable(k.time_to_live);l.isDataCard=c.PRODUCT_TYPE=="DATACARD";l.hasUpdateCheck=c.HAS_UPDATE_CHECK;l.hasUssd=c.HAS_USSD;l.hasDdns=c.DDNS_SUPPORT;l.IMEINew=d.observable(k.imei);var j=a.getShowImeiTTL();if(j.show_advance_setting==1){l.showTTL=d.observable(true)}else{l.showTTL=d.observable(false)}function m(){showLoading();var o=l.IMEINew();var n=/^\d{1,}$/;var p=new RegExp(n);var r=p.test(o);if(!r||o.length!=15){errorOverlay();return false}var q={imei_string:l.IMEINew};a.setIMEI(q,function(s){if(s.result==true){successOverlay()}else{errorOverlay()}})}function h(){showLoading();var n={ttl_value:l.TTLNew()};a.setTTL(n,function(o){if(o&&o.result==true){successOverlay()}else{errorOverlay()}})}l.changeImei=m;l.changeTTL=h}function g(){var h=f("#container");d.cleanNode(h[0]);var j=new e;d.applyBindings(j,h[0]);f("#frmimei").validate({submitHandler:function(){j.changeImei()},rules:{imeiNewKey:{IMEINew_check:true}}});f("#frmttl").validate({submitHandler:function(){j.changeTTL()},rules:{txtttlvalue:{ttl_check:true}}})}return{init:g}});define("adm_management","jquery knockout set service underscore CryptoJS".split(" "),function(f,e,d,a,c,b){function g(){var l=this;l.currentValue=e.observable();l.newValue=e.observable();l.confirmValue=e.observable();function k(){var s={};if(d.PASSWORD_ENCODE){s.oldValue=l.currentValue();s.newValue=l.newValue()}else{var r=new RegExp("(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,32}");if(!r.test(l.newValue())){showConfirm("password_note_too_low",function(){var v=a.getDeviceInfoLow();var w=b.enc.Latin1.parse(v.skey);var t=b.enc.Latin1.parse(v.siv);var x=b.AES.encrypt(l.currentValue(),w,{iv:t,mode:b.mode.CBC,padding:b.pad.ZeroPadding}).toString();var u=b.AES.encrypt(l.newValue(),w,{iv:t,mode:b.mode.CBC,padding:b.pad.ZeroPadding}).toString();s.oldValue=x;s.newValue=u;showLoading();a.changeManageInfo(s,function(y){l.cancel();if(y&&y.result==true){successOverlay()}else{if(y&&y.errorType=="badPassword"){hideLoading();showAlert("current_password_error",function(){f("#txtCurrent").focus()})}else{errorOverlay()}}})});return}var o=a.getDeviceInfoLow();var p=b.enc.Latin1.parse(o.skey);var m=b.enc.Latin1.parse(o.siv);var q=b.AES.encrypt(l.currentValue(),p,{iv:m,mode:b.mode.CBC,padding:b.pad.ZeroPadding}).toString();var n=b.AES.encrypt(l.newValue(),p,{iv:m,mode:b.mode.CBC,padding:b.pad.ZeroPadding}).toString();s.oldValue=q;s.newValue=n}showLoading();a.changeManageInfo(s,function(t){l.cancel();if(t&&t.result==true){successOverlay()}else{if(t&&t.errorType=="badPassword"){hideLoading();showAlert("current_password_error",function(){f("#txtCurrent").focus()})}else{errorOverlay()}}})}function j(){l.currentValue("");l.newValue("");l.confirmValue("")}l.cancel=j;l.changeValue=k}function h(){var j=f("#container");e.cleanNode(j[0]);var k=new g;e.applyBindings(k,j[0]);f("#frmPassword").validate({submitHandler:function(){k.changeValue()},rules:{txtCurrent:"manage_info_check",txtNew:"manage_info_check",txtConfirm:{equalTo:"#txtNew"}}})}return{init:h}});define("adm_pin","jquery knockout set service".split(" "),function(g,d,c,b){var e={common:0,requirePin:1,modifyPin:2,requirePuk:3,destroyed:4};var f={enable:"1",disable:"0"};function a(){var r=this;var o=b.getPinData();r.isDataCard=c.PRODUCT_TYPE=="DATACARD";r.originPinStatus=d.observable(o.pin_status);r.pinStatus=d.observable(o.pin_status);r.pinNumber=d.observable(o.pinnumber);r.pukNumber=d.observable(o.puknumber);r.currentPin=d.observable();r.newPin=d.observable();r.confirmPin=d.observable();r.puk=d.observable();r.pageState=d.observable();r.operateSuccessFlag=true;r.callback=t;var l=b.getShowImeiTTL();if(l.show_advance_setting==1){r.showTTL=d.observable(true)}else{r.showTTL=d.observable(false)}function t(v){if(v&&v.result==true){r.operateSuccessFlag=true;successOverlay()}else{r.operateSuccessFlag=false;if(r.pinNumber()==2){showAlert("last_enter_pin")}else{if(r.pukNumber()==2){showAlert("last_enter_puk")}else{errorOverlay()}}}h(r)}function q(){if(r.isConnectedNetWork()){showAlert("cannot_operate_when_connected");return}if(r.pageState()==e.common){return}var v={oldPin:r.currentPin(),newPin:r.newPin()};showLoading();if(r.pageState()==e.modifyPin){b.changePin(v,r.callback)}else{if(r.pageState()==e.requirePuk){v={PinNumber:r.newPin(),PUKNumber:r.puk()};b.enterPUK(v,r.callback)}else{if(r.pinStatus()==f.enable){b.enablePin(v,r.callback)}else{b.disablePin(v,r.callback)}}}}function s(){r.pageState(e.common);r.pinStatus(r.originPinStatus());r.clear()}function m(){r.confirmPin("");r.currentPin("");r.newPin("");r.puk("");clearValidateMsg()}function k(v){if(v.pinnumber>0){if(r.operateSuccessFlag){r.cancel()}else{r.clear()}}else{r.clear();if(v.puknumber>0){r.pageState(e.requirePuk)}else{r.pageState(e.destroyed)}}}function p(){if(r.isConnectedNetWork()){showAlert("cannot_operate_when_connected");return}r.pinStatus(r.originPinStatus());r.pageState(e.modifyPin);r.clear()}function n(){if(r.isConnectedNetWork()){g("#frmPin :input").each(function(){disableBtn(g(this))});clearValidateMsg()}else{g("#frmPin :input").each(function(){if(this.id=="txtPin"||this.id=="btnPinApply"){if(r.pageState()==e.common){disableBtn(g(this));return}}if(this.id=="btnModifyPin"){if(r.originPinStatus()!=f.enable){disableBtn(g(this));return}}if(this.id=="pinEnable"||this.id=="pinDisable"){if(r.pageState()==e.modifyPin){disableBtn(g(this));return}}enableBtn(g(this))})}}function u(){var v=b.getConnectionInfo();return v.connectStatus=="ppp_connected"}function j(){if(r.pinStatus()==r.originPinStatus()){r.pageState(e.common)}else{r.pageState(e.requirePin)}r.clear()}r.changePin=q;r.cancel=s;r.clear=m;r.computePageState=k;r.computePageState(o);r.displayModifyPinPage=p;r.fixPageEnable=n;r.isConnectedNetWork=u;r.pinStatusChangeEvent=d.dependentObservable(j,this)}function h(m){var k=m;if(k){var l=b.getPinData();k.originPinStatus(l.pin_status);k.pinNumber(l.pinnumber);k.pukNumber(l.puknumber);k.computePageState(l)}else{k=new a;addInterval(function(){k.fixPageEnable()},1e3)}var j=g("#container")[0];d.cleanNode(j);d.applyBindings(k,j);k.fixPageEnable();g("#frmPin").validate({submitHandler:function(){k.changePin()},rules:{txtPuk:"puk_check",txtPin:"pin_check",txtNewPin:"pin_check",txtConfirmPin:{equalToPin:"#txtNewPin"}}})}return{init:h}});define("adm_quick_set","jquery knockout set service underscore CryptoJS".split(" "),function(g,o,c,k,m,l){var a={ok:0,wps_on:1,wifi_off:2};var h={auto:"auto",manual:"manual"};var j=1;var b=5;function d(){return m.map(c.APN_AUTH_MODES,function(p){return new Option(p.name,p.value)})}var e=m.map(c.WIFI_WEP_SUPPORT?c.AUTH_MODES_WEP:c.AUTH_MODES,function(p){return new Option(p.name,p.value)});function f(){var K=this;var q=k.getQuickSettingInfo();K.currentStep=o.observable(j);K.ipType=o.observable(q.pdp_type=="IP"?"IP":q.ipv6_pdp_type);K.supportIPv6=c.IPV6_SUPPORT;K.supportIpv4AndIpv6=c.IPV4_AND_V6_SUPPORT;K.wpsFlag=o.observable(q.WscModeOption);function H(){return q.apn_index<c.defaultApnSize||q.ppp_status=="ppp_connected"||q.ppp_status=="ppp_connecting"}function p(){return q.ppp_status=="ppp_connected"||q.ppp_status=="ppp_connecting"||!K.profileName()&&K.apnMode()==h.auto}function F(){var O=q["APN_configtmp"+q.apn_index];var N=q["ipv6_APN_configtmp"+q.apn_index];var M=[];var L=[];if(O){M=O.split("($)")}if(N){L=N.split("($)")}return{m_profile_name:M[0],wan_apn:M[1],ppp_auth_mode:M[4]==""||typeof M[4]=="undefined"?"":M[4].toLowerCase(),ppp_username:M[5],ppp_passtmp:M[6],pdp_type:M[7],ipv6_wan_apn:L[1],ipv6_ppp_auth_mode:typeof L[4]=="undefined"||L[4]==""?"":L[4].toLowerCase(),ipv6_ppp_username:L[5],ipv6_ppp_passtmp:L[6],ipv6_pdp_type:L[7]}}K.currAPN=o.computed(F);K.apn=o.observable(K.currAPN().wan_apn);K.ipv6_apn=o.observable(K.currAPN().ipv6_wan_apn);K.ipv6_selectedAuthMode=o.observable(K.currAPN().ipv6_ppp_auth_mode);K.ipv6_username=o.observable(K.currAPN().ipv6_ppp_username);K.ipv6_password=o.observable(K.currAPN().ipv6_ppp_passtmp);K.profileName=o.observable(K.currAPN().m_profile_name);K.selectedAuthMode=o.observable(K.currAPN().ppp_auth_mode);K.username=o.observable(K.currAPN().ppp_username);K.password=o.observable(K.currAPN().ppp_passtmp);K.transAPN=o.observable("apn_ipv4_apn");K.transAPNIPv6=o.observable("apn_ipv6_apn");K.transAuthMode=o.observable("apn_authentication_ipv4");K.transAuthModeIPv6=o.observable("apn_authentication_ipv6");K.transUserName=o.observable("apn_user_name_ipv4");K.transPassword=o.observable("apn_password_ipv4");K.transUserNameIPv6=o.observable("apn_user_name_ipv6");K.transPasswordIPv6=o.observable("apn_password_ipv6");K.apnDisabled=o.computed(H);K.apnMode=o.observable(q.apn_mode);K.apnModeDisabled=o.computed(p);K.authModes=o.observableArray(d());if(K.ipType()=="IPv6"){K.showIPv4=false;K.showIPv6=true;K.transAPNIPv6("apn");K.transAuthModeIPv6("apn_authentication");K.transUserNameIPv6("apn_user_name");K.transPasswordIPv6("apn_password")}else{if(c.IPV4_AND_V6_SUPPORT&&K.ipType()=="IPv4v6"){K.showIPv4=true;K.showIPv6=true}else{if(K.ipType()=="IP"||K.ipType()=="IPv4"){K.showIPv4=true;K.showIPv6=false;K.transAPN("apn");K.transAuthMode("apn_authentication");K.transUserName("apn_user_name");K.transPassword("apn_password")}else{K.showIPv4=true;K.showIPv6=false;K.transAPN("apn");K.transAuthMode("apn_authentication");K.transUserName("apn_user_name");K.transPassword("apn_password")}}}K.wifiDisabled=q.wifi_cur_state!="1";K.ssid=o.observable(q.SSID1);K.broadcast=o.observable(q.HideSSID);K.hasWifiWep=c.WIFI_WEP_SUPPORT;K.hasWifiWpa3=c.WIFI_WAP3_SUPPORT;K.hasWifiWpa23=c.WIFI_WPA2_WAP3_SUPPORT;K.securityModes=o.observableArray(e);K.selectedSecurityMode=o.observable(q.AuthMode);K.WPAKey=o.observable(q.WPAPSK1);K.apnMode_display=o.observable("");K.apnMode_trans=o.computed(I);K.selectedAuthMode_display=o.computed(y);K.ipv6_selectedAuthMode_display=o.computed(C);K.showWifiPassword=o.observable(false);K.showWifiPasswordHandler=r;var v=k.getWifiAdvance();K.adBand=o.observable(v.wifiBand);K.adMode=o.observable(v.mode);K.encryptType=o.observable(q.EncrypType);K.keyID=o.observable(q.DefaultKeyID);K.wepPassword=o.observable("");K.getWepPassword=z;K.wepPassword(K.getWepPassword());K.profileChangeHandler=G;K.broadcast_display=o.observable("");K.broadcast_trans=o.computed(w);K.selectedSecurityMode_display=o.observable();K.selectedSecurityMode_trans=o.computed(B);K.callback=u;K.next=E;K.previous=D;K.save=J;function I(){if(h.auto==K.apnMode()){K.apnMode_display(g.i18n.prop("apn_auto_apn"));return"apn_auto_apn"}else{K.apnMode_display(g.i18n.prop("apn_manual_apn"));return"apn_manual_apn"}}function w(){if("0"==K.broadcast()){K.broadcast_display(g.i18n.prop("enable"));return"enable"}else{K.broadcast_display(g.i18n.prop("disable"));return"disable"}}function E(){var L=K.currentStep();var M=K.currentStep()+1;s(M);if(L==1&&K.apnMode()==h.auto){M=K.currentStep()+1;s(M)}}function D(){var L=K.currentStep();var M=K.currentStep()-1;s(M);if(L==3&&K.apnMode()==h.auto){M=K.currentStep()-1;s(M)}}function J(){var M=function(){t()};var L=x();if(L==a.wifi_off){showConfirm("quick_setting_wifi_disable_confirm",M)}else{if(L==a.wps_on){showAlert("wps_on_info")}else{showConfirm("quick_setting_param_changed_confirm",M)}}}function u(L){if(L.result=="success"){successOverlay();location.hash="#network_choose"}else{errorOverlay()}}function s(L){if(L>b){L=b}else{if(L<j){L=j}}K.currentStep(L);return true}function C(){var L=K.ipv6_selectedAuthMode();return A(L)}function A(M){for(var L=0;L<c.APN_AUTH_MODES.length;L++){if(M==c.APN_AUTH_MODES[L].value){return c.APN_AUTH_MODES[L].name}}}function z(){return K.keyID()=="3"?q.Key4Str1:K.keyID()=="2"?q.Key3Str1:K.keyID()=="1"?q.Key2Str1:q.Key1Str1}function x(){var L=k.getWpsInfo();if(L.radioFlag=="0"){return a.wifi_off}else{if(L.wpsFlag=="1"){return a.wps_on}}return a.ok}function G(M,L){g("#pwdWepKey").parent().find("label[class='error']").hide();K.wepPassword(K.getWepPassword());return true}function t(){showLoading();var N=c.IPV4V6_SUPPORT&&K.currAPN().pdp_type=="IPv4v6";var O="";if(c.PASSWORD_ENCODE){O=K.WPAKey()}else{var M=k.getDeviceInfoLow();var P=l.enc.Latin1.parse(M.skey);var L=l.enc.Latin1.parse(M.siv);O=l.AES.encrypt(K.WPAKey(),P,{iv:L,mode:l.mode.CBC,padding:l.pad.ZeroPadding}).toString()}var Q={apn_index:q.apn_index,apnMode:K.apnMode(),Encryption_Mode_hid:K.selectedSecurityMode(),ipv6_ppp_auth_mode:N?K.selectedAuthMode():K.ipv6_selectedAuthMode(),ipv6_ppp_username:N?K.username():K.ipv6_username(),ipv6_ppp_passtmp:N?K.password():K.ipv6_password(),ipv6_wan_apn:N?K.apn():K.ipv6_apn(),pdp_type:K.ipType(),ppp_auth_mode:K.selectedAuthMode(),ppp_username:K.username(),ppp_passtmp:K.password(),profile_name:K.profileName(),security_shared_mode:"NONE",SSID_Broadcast:K.broadcast(),SSID_name:K.ssid(),wan_apn:K.apn(),wep_default_key:0,WPA_ENCRYPTION_hid:K.selectedSecurityMode()=="OPEN"?"NONE":K.selectedSecurityMode()=="WPA2PSK"?1:2,WPA_PreShared_Key:O};Q.wep_default_key=K.keyID();if(K.encryptType()=="SHARED"||K.selectedSecurityMode()=="WEP"){Q.security_shared_mode="WEP";Q.wep_key_1=q.Key1Str1;Q.wep_key_2=q.Key2Str1;Q.wep_key_3=q.Key3Str1;Q.wep_key_4=q.Key4Str1;var R="0";if(K.wepPassword().length=="5"||K.wepPassword().length=="13"){R="1"}else{R="0"}if(K.keyID()=="3"){Q.wep_key_4=K.wepPassword();Q.WEP4Select=R}else{if(K.keyID()=="2"){Q.wep_key_3=K.wepPassword();Q.WEP3Select=R}else{if(K.keyID()=="1"){Q.wep_key_2=K.wepPassword();Q.WEP2Select=R}else{Q.wep_key_1=K.wepPassword();Q.WEP1Select=R}}}}else{if(K.encryptType()=="WPAPSKWPA2PSK"){Q.security_shared_mode="NONE"}else{Q.security_shared_mode="NONE"}}k.setQuickSetting4IPv6(Q,K.callback)}function y(){var L=K.selectedAuthMode();return A(L)}function B(){var N=K.selectedSecurityMode();var M=c.WIFI_WEP_SUPPORT?c.AUTH_MODES_WEP:c.AUTH_MODES;for(var L=0;L<M.length;L++){if(N==M[L].value){K.selectedSecurityMode_display(g.i18n.prop("security_mode_"+M[L].value));return"security_mode_"+M[L].value}}}function r(){g("#pwdWepKey").parent().find(".error").hide();g("#codeWPAKey").parent().find(".error").hide();var L=g("#showWifiPassword:checked");if(L&&L.length==0){K.showWifiPassword(true)}else{K.showWifiPassword(false)}}}function n(){var p=g("#container");o.cleanNode(p[0]);var q=new f;o.applyBindings(q,p[0]);g("#quickSettingForm").validate({submitHandler:function(){if(q.currentStep()<5){q.next()}else{q.save()}},rules:{txtAPN:"apn_check",txtIPv6APN:"apn_check",txtSSID:"ssid",pwdWepKey:{wifi_wep_password_check:true,wifi_password_check:true},txtWepKey:{wifi_wep_password_check:true,wifi_password_check:true},txtWPAKey:"wifi_password_check",codeWPAKey:"wifi_password_check",txtUserName:"ppp_username_check",txtIPv6UserName:"ppp_username_check",txtSecretCode:"ppp_secretcode_check",txtIPv6SecretCode:"ppp_secretcode_check"},errorPlacement:function(r,s){var t=s.attr("id");if(t=="pwdWepKey"||t=="txtWepKey"){r.insertAfter("#lblShowWepPassword")}else{if(t=="txtWPAKey"||t=="codeWPAKey"){r.insertAfter("#lblShowWifiPassword")}else{r.insertAfter(s)}}}})}return{init:n}});define("main","set service knockout underscore jquery statusBar echarts".split(" "),function(k,f,e,l,h,g,c){var d={color:["red","red","red","red","red"],series:[{name:"��������",type:"pie",radius:["0","72"],itemStyle:{normal:{label:{show:false},labelLine:{show:false}}},data:[],selectedOffset:3}],animation:false,title:{text:"",x:"center",y:"center",itemGap:0,textStyle:{color:"#FFF",fontFamily:"΢���ź�",fontSize:20,fontWeight:"bolder"},subtextStyle:{color:"#FFF",fontFamily:"΢���ź�",fontSize:16,fontWeight:"bolder"}},tooltip:{formatter:"{b}"}};var m=window.language;var a=0;var j=null;var b={CONNECTED:1,DISCONNECTED:2,CONNECTING:3,DISCONNECTING:4};function o(){a=0;n.oldUsedData=null;n.oldAlarmData=null;j=c.init(h("#traffic_graphic")[0]);var q=h("#container")[0];e.cleanNode(q);var r=new p;e.applyBindings(r,q);var t=f.getLoginData();var s=t.psw_changed;if(s!="1"){showConfirm("password_note_first_change",function(){window.location.hash="#pwd_mode"});return}}var n={initStatus:null,initShownStatus:function(q){this.initStatus={};var r=q.ipv6PdpType.toLowerCase().indexOf("v6")>0;if(k.RJ45_SUPPORT){var s=checkCableMode(q.blc_wan_mode);if(s){this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}else{if(k.IPV6_SUPPORT){if(q.pdpType=="IP"){this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}else{if(r){if(q.ipv6PdpType=="IPv6"){this.initStatus.showIpv6WanIpAddr=true;this.initStatus.showIpv4WanIpAddr=false}else{this.initStatus.showIpv6WanIpAddr=true;this.initStatus.showIpv4WanIpAddr=true}}}}else{this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}}}else{if(k.IPV6_SUPPORT){if(q.pdpType=="IP"){this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}else{if(r){if(q.ipv6PdpType=="IPv6"){this.initStatus.showIpv6WanIpAddr=true;this.initStatus.showIpv4WanIpAddr=false}else{this.initStatus.showIpv6WanIpAddr=true;this.initStatus.showIpv4WanIpAddr=true}}}}else{this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}}},wanIpGet:function(r){var q={wanIpAddress:"",ipv6WanIpAddress:""};q.wanIpAddress=verifyDeviceInfo(r.wanIpAddress);q.ipv6WanIpAddress=verifyDeviceInfo(r.ipv6WanIpAddress);return q},cachedAPStationBasic:null,cachedConnectionMode:null,getCanConnectNetWork:function(s){var q=f.getStatusInfo();if(q.simStatus!="modem_init_complete"){return false}var r=q.networkType.toLowerCase();if(r=="searching"){return false}if(r==""||r=="limited service"){r="limited_service"}if(r=="no service"){r="no_service"}if(r=="limited_service"||r=="no_service"){if(s.cStatus()!=b.CONNECTED){return false}}if(k.AP_STATION_SUPPORT){if(q.connectWifiStatus=="connect"){if(q.ap_station_mode=="wifi_pref"){return false}}}return true},doConnect:function(){showLoading("connecting");f.connect({},function(q){if(q.result){successOverlay()}else{errorOverlay()}})},refreshHomeData:function(r){var q=f.getConnectionInfo();r.connectStatus(q.connectStatus);r.canConnect(this.getCanConnectNetWork(r));r.networkType(n.getNetworkType(q.networkType));if(q.connectStatus=="ppp_connected"){r.current_Flux(transUnit(parseInt(q.data_counter.currentReceived,10)+parseInt(q.data_counter.currentSent,10),false));r.connected_Time(transSecond2Time(q.data_counter.currentConnectedTime));r.up_Speed(transUnit(q.data_counter.uploadRate,true));r.down_Speed(transUnit(q.data_counter.downloadRate,true))}else{r.current_Flux(transUnit(0,false));r.connected_Time(transSecond2Time(0));r.up_Speed(transUnit(0,true));r.down_Speed(transUnit(0,true))}r.trafficAlertEnable(q.limitVolumeEnable);if(q.limitVolumeEnable){if(q.limitVolumeType=="1"){r.trafficUsed(transUnit(parseInt(q.data_counter.monthlySent,10)+parseInt(q.data_counter.monthlyReceived,10),false));r.trafficLimited(transUnit(q.limitDataMonth,false))}else{r.trafficUsed(transSecond2Time(q.data_counter.monthlyConnectedTime));r.trafficLimited(transSecond2Time(q.limitTimeMonth))}}if(m!=window.language){m=window.language;a=1}if(true){n.updateEcharts(q)}else{n.allFreeEcharts()}n.refreshStationInfo(r)},allFreeEcharts:function(){var q=n.data.free;q.value=1;q.selected=false;q.name=h.i18n.prop("echarts_no");d.series[0].data=[q];d.title.text="";n.setEcharts(d,h.i18n.prop("echarts_no"))},getNetworkType:function(q){var r=q.toLowerCase();if(r==""||r=="limited service"){r="limited_service"}if(r=="no service"){r="no_service"}if(r=="limited_service"||r=="no_service"){return h.i18n.prop("network_type_"+r)}else{return q}},data:{full:{value:30,name:"��������",itemStyle:{normal:{color:"#DF4313"}}},used:{value:30,name:"��ʹ��",itemStyle:{normal:{color:"#8CC916"}}},left1:{value:50,name:"����ֵ��δʹ��",itemStyle:{normal:{color:"#D8D8D8"}}},free:{value:50,name:"δʹ��",itemStyle:{normal:{color:"#D8D8D8"}}},alert:{value:1,name:"����ֵ",itemStyle:{normal:{color:"#FF5500"}}},alarm:{value:19.7,name:"������",itemStyle:{normal:{color:"#8CC916"}}},start:{value:50,name:"����ֵ��δʹ��",itemStyle:{normal:{color:"#D8D8D8"}}}},getDataInfo:function(q){return{data:/\d+(.\d+)?/.exec(q)[0],unit:/[A-Z]{1,2}/.exec(q)[0]}},oldAlarmData:null,oldUsedData:null,updateEcharts:function(K){var u=h.i18n.prop("echarts_no");a++;if(a%10!=2){return false}var N=0,v=0,C=0,t=0,q=0,D=0;if(K.limitVolumeEnable){u=h.i18n.prop("echarts_used");d.series[0].data=[];if(K.limitVolumeType=="1"){var L=transUnit(K.limitDataMonth,false);d.series[0].data=[];if(K.limitDataMonth==0){var I=n.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_used");d.series[0].data.push(I)}else{var z=n.getDataInfo(L);N=z.data*n.getUnitValue(z.unit)*1048576;v=parseInt(K.data_counter.monthlySent,10)+parseInt(K.data_counter.monthlyReceived,10);C=N*K.limitVolumePercent/100;if(v>=N){var M=n.data.full;M.value=100;M.name=h.i18n.prop("echarts_full");d.series[0].data.push(M);u=h.i18n.prop("echarts_full")}else{if(C-v>0){D=C-v;t=N-C}else{q=v-C;t=N-v}var I=n.data.used;if(C-v>0){I.value=v}else{I.value=C}I.name=h.i18n.prop("echarts_used");d.series[0].data.push(I);if(D>0){var B=n.data.left1;B.value=D;B.name=h.i18n.prop("echarts_left1");d.series[0].data.push(B)}var y=n.data.alert;y.value=N/200;y.name=h.i18n.prop("echarts_alert");d.series[0].data.push(y);if(q>0){var w=n.data.alarm;w.value=q;w.name=h.i18n.prop("echarts_alarm");d.series[0].data.push(w)}var A=n.data.free;A.value=t;A.name=h.i18n.prop("echarts_free");d.series[0].data.push(A)}}}else{d.series[0].data=[];if(K.limitTimeMonth==0){var I=n.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_used");d.series[0].data.push(I)}else{N=K.limitTimeMonth;v=K.data_counter.monthlyConnectedTime;C=N*K.limitVolumePercent/100;if(v>=N){var x=n.data.full;x.value=100;x.name=h.i18n.prop("echarts_full");d.series[0].data.push(x);u=h.i18n.prop("echarts_full")}else{if(C-v>0){D=C-v;t=N-C}else{q=v-C;t=N-v}var r=n.data.used;if(C-v>0){r.value=v}else{r.value=C}r.name=h.i18n.prop("echarts_used");d.series[0].data.push(r);if(D>0){var J=n.data.left1;J.value=D;J.name=h.i18n.prop("echarts_left1");d.series[0].data.push(J)}var G=n.data.alert;G.value=N/200;G.name=h.i18n.prop("echarts_alert");d.series[0].data.push(G);if(q>0){var E=n.data.alarm;E.value=q;E.name=h.i18n.prop("echarts_alarm");d.series[0].data.push(E)}var H=n.data.free;H.value=t;H.name=h.i18n.prop("echarts_free");d.series[0].data.push(H)}}}}else{var I=n.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_no");d.series[0].data=[I];d.title.text=""}var s=l.find(d.series[0].data,function(O){return O.name==h.i18n.prop("echarts_used")});var F=l.find(d.series[0].data,function(O){return O.name==h.i18n.prop("echarts_alarm")});if(!F){F={value:0}}if(typeof s=="undefined"){n.setEcharts(d,u)}else{if(n.oldUsedData!=s.value||n.oldAlarmData!=F.value){n.oldUsedData=s.value;n.oldAlarmData=F.value;n.setEcharts(d,u)}}},getUnitValue:function(q){q=q.toUpperCase();if(q=="GB"){return"1024"}else{if(q=="TB"){return"1048576"}else{return"1"}}},setEcharts:function(t,s){var r=n.data.start;r.value=0;r.name=s;r.selected=false;var q=[r].concat(t.series[0].data);t.series[0].data=q;j.setOption(t,true);addTimeout(function(){j.resize()},1e3)},refreshStationInfo:function(q){q.wirelessDeviceNum(f.getStatusInfo().wirelessDeviceNum);if(a%10==2){f.getAttachedCableDevices({},function(r){q.wireDeviceNum(r.attachedDevices.length)})}},getUnit:function(q){if(q=="1024"){return"GB"}else{if(q=="1048576"){return"TB"}else{return"MB"}}},refreshOpmodeInfo:function(w){var u=f.getOpMode();w.isLoggedIn(u.loginfo=="ok");var t=checkCableMode(u.blc_wan_mode);if(w.opCurMode()&&!t){var s=f.getLoginData();var r=s.modem_main_state;if(r=="modem_sim_undetected"||r=="modem_undetected"||r=="modem_sim_destroy"||r=="modem_waitpin"||r=="modem_waitpuk"||r=="modem_imsi_waitnck"){window.location.reload();return}}w.opCurMode(t);if(t&&u.ethwan_mode=="DHCP"){w.enableFlag(false)}else{if(!t&&u.ppp_status!="ppp_disconnected"||t&&u.rj45_state!="idle"&&u.rj45_state!="dead"){w.enableFlag(true)}else{w.enableFlag(false)}}var v=u.blc_wan_mode=="AUTO_PPP"||u.blc_wan_mode=="AUTO_PPPOE"?"AUTO":u.blc_wan_mode;var q="";switch(v){case"AUTO":q="opmode_auto";break;case"PPPOE":q="opmode_cable";break;case"PPP":q="opmode_gateway";break;default:break}h("#opmode").attr("data-trans",q).text(h.i18n.prop(q));w.isShowHomeConnect(!t);w.showTraffic(true);w.isSupportQuicksetting(k.HAS_QUICK_SETTING&&!t)}};function p(){var u=this;u.hasSms=k.HAS_SMS;u.hasPhonebook=k.HAS_PHONEBOOK;u.isSupportSD=k.SD_CARD_SUPPORT;u.isCPE=k.PRODUCT_TYPE=="CPE";u.hasRj45=k.RJ45_SUPPORT;u.notDataCard=k.PRODUCT_TYPE!="DATACARD";u.hasParentalControl=k.HAS_PARENTAL_CONTROL;var s=f.getWifiBasic();if(k.WIFI_SUPPORT_QR_SWITCH){u.showQRCode=k.WIFI_SUPPORT_QR_CODE&&s.show_qrcode_flag}else{u.showQRCode=k.WIFI_SUPPORT_QR_CODE}if(k.WIFI_SUPPORT_QR_CODE){u.qrcodeSrc="./pic/qrcode_ssid_wifikey.png?_="+h.now()}else{u.qrcodeSrc="./pic/res_blacktrans.png"}if(u.hasRj45){var r=checkCableMode(f.getOpMode().blc_wan_mode);u.opCurMode=e.observable(r);u.isShowHomeConnect=e.observable(!r);u.showTraffic=true;u.isSupportQuicksetting=e.observable(k.HAS_QUICK_SETTING&&!r)}else{u.isShowHomeConnect=e.observable(true);u.showTraffic=true;u.isSupportQuicksetting=e.observable(k.HAS_QUICK_SETTING)}if(k.PRODUCT_TYPE=="DATACARD"){h("#home_image").addClass("data-card")}var t=f.getConnectionInfo();u.networkType=e.observable(n.getNetworkType(t.networkType));u.connectStatus=e.observable(t.connectStatus);u.canConnect=e.observable(false);u.cStatus=e.computed(function(){if(u.connectStatus().indexOf("_connected")!=-1){return b.CONNECTED}else{if(u.connectStatus().indexOf("_disconnecting")!=-1){return b.DISCONNECTING}else{if(u.connectStatus().indexOf("_connecting")!=-1){return b.CONNECTING}else{return b.DISCONNECTED}}}});u.current_Flux=e.observable(transUnit(0,false));u.connected_Time=e.observable(transSecond2Time(0));u.up_Speed=e.observable(transUnit(0,true));u.down_Speed=e.observable(transUnit(0,true));u.isLoggedIn=e.observable(false);u.enableFlag=e.observable(true);u.iccid=e.observable("");u.imei=e.observable("");u.imsi=e.observable("");u.ssid=e.observable("");u.lteband=e.observable("");u.hasWifi=k.HAS_WIFI;u.showMultiSsid=e.observable(k.HAS_MULTI_SSID&&s.multi_ssid_enable=="1");u.trafficAlertEnable=e.observable(false);u.trafficUsed=e.observable("");u.trafficLimited=e.observable("");u.wireDeviceNum=e.observable(f.getAttachedCableDevices().attachedDevices.length);u.wirelessDeviceNum=e.observable(f.getStatusInfo().wirelessDeviceNum);u.showOpModeWindow=function(){if(u.enableFlag()){return}showSettingWindow("change_mode","opmode_popup","opmode_popup",400,300,function(){})};u.currentOpMode=e.observable("0");var v=false;h("#showDetailInfo").popover({html:true,placement:"top",trigger:"focus",title:function(){return h.i18n.prop("device_info")},content:function(){return w()}}).on("shown.bs.popover",function(){v=true}).on("hidden.bs.popover",function(){v=false});function q(){var x=f.getDeviceInfo();u.imei(verifyDeviceInfo(x.imei));u.imsi(verifyDeviceInfo(x.imsi));u.ssid(verifyDeviceInfo(x.ssid));u.iccid(verifyDeviceInfo(x.iccid));u.showMultiSsid(k.HAS_MULTI_SSID&&x.multi_ssid_enable=="1");return x}q();function w(){var z=q();n.initShownStatus(z);var x=n.wanIpGet(z);var A=l.template(h("#detailInfoTmpl").html());var y=A({iccid:verifyDeviceInfo(z.iccid),imei:verifyDeviceInfo(z.imei),imsi:verifyDeviceInfo(z.imsi),signal:signalFormat(z.signal),hasWifi:k.HAS_WIFI,isCPE:k.PRODUCT_TYPE=="CPE",hasRj45:k.RJ45_SUPPORT,showMultiSsid:k.HAS_MULTI_SSID&&z.multi_ssid_enable=="1",ssid:verifyDeviceInfo(z.ssid),max_access_num:verifyDeviceInfo(z.max_access_num),m_ssid:verifyDeviceInfo(z.m_ssid),m_max_access_num:verifyDeviceInfo(z.m_max_access_num),wifi_long_mode:"wifi_des_"+z.wifiRange,lanDomain:verifyDeviceInfo(z.lanDomain),ipAddress:verifyDeviceInfo(z.ipAddress),showMacAddress:k.SHOW_MAC_ADDRESS,macAddress:verifyDeviceInfo(z.macAddress),showIpv4WanIpAddr:n.initStatus.showIpv4WanIpAddr,wanIpAddress:x.wanIpAddress,showIpv6WanIpAddr:n.initStatus.showIpv6WanIpAddr,ipv6WanIpAddress:x.ipv6WanIpAddress,sw_version:verifyDeviceInfo(z.sw_version),hw_version:verifyDeviceInfo(z.hw_version),lteband:"B"+z.lte_band});return h(y).translate()}u.connectHandler=function(){if(u.connectStatus()=="ppp_connected"){showLoading("disconnecting");f.disconnect({},function(x){if(x.result){successOverlay()}else{errorOverlay()}})}else{if(f.getStatusInfo().roamingStatus){showConfirm("dial_roaming_connect",function(){u.connect()})}else{u.connect()}}};u.connect=function(){var y=f.getStatusInfo();var z=g.getTrafficResult(y);if(y.limitVolumeEnable&&z.showConfirm){var x=null;if(z.usedPercent>100){x={msg:"traffic_beyond_connect_msg"};g.setTrafficAlertPopuped(true)}else{x={msg:"traffic_limit_connect_msg",params:[z.limitPercent]};g.setTrafficAlert100Popuped(false)}showConfirm(x,function(){n.doConnect()})}else{n.doConnect()}};f.getSignalStrength({},function(y){var x=signalFormat(convertSignal(y));h("#fresh_signal_strength").text(x);if(v){h("#popoverSignalTxt").text(x)}});n.refreshHomeData(u);addInterval(function(){f.getSignalStrength({},function(y){var x=signalFormat(convertSignal(y));h("#fresh_signal_strength").text(x);if(v){h("#popoverSignalTxt").text(x)}});n.refreshHomeData(u)},1e3);if(u.hasRj45){n.refreshOpmodeInfo(u);addInterval(function(){n.refreshOpmodeInfo(u)},1e3)}u.showNetworkSettingsWindow=function(){if(u.hasRj45){f.getOpMode({},function(x){var y=checkCableMode(x.blc_wan_mode);if(y){window.location.hash="#network_set"}else{window.location.hash="#conn_set"}})}else{window.location.hash="#conn_set"}}}return{init:o}});define("language","knockout service jquery set underscore".split(" "),function(j,f,d,c,g){function a(){return f.getLanguage()}function b(k){window.CURRENT_LANGUAGE=k;d("body").attr("lang",k);d.i18n.properties({name:"Messages",path:"i18n/",mode:"map",cache:true,language:k,callback:function(){jQuery.validator.messages=d.i18n.map;d("body").translate()}})}window.language=null;function e(){var m=this;var l=a();var k=g.map(c.LANGUAGES,function(n){return new Option(n.name,n.value)});document.title=c.WEBUI_TITLE;if(d("#webui_title")[0]){d("#webui_title").html(c.WEBUI_TITLE)}m.languages=j.observableArray(k);m.currentLan=j.observable(l.Language);window.language=m.currentLan();m.langChangeHandler=function(o,n){clearValidateMsg();f.setLanguage({Language:m.currentLan()},function(){b(m.currentLan());window.language=m.currentLan()})};b(m.currentLan())}function h(){j.applyBindings(new e,d("#language")[0])}return{init:h}});define("entry","jquery knockout set service underscore menu logout CryptoJS".split(" "),function(f,p,d,g,n,c,q,m){var l={LOGIN:0,WAIT_PIN:1,WAIT_PUK:2,PUK_LOCKED:3,LOGGEDIN:4,LOADING:5};var b=h();var e=0;var k="0";function j(){var y=this;var v=g.getLoginData();var t=g.getLoginStatus();y.confirmPIN=p.observable();y.leftSeconds=p.observable(0);y.loginCount=p.observable(0);y.loginSecuritySupport=p.observable(d.LOGIN_SECURITY_SUPPORT);y.newPIN=p.observable();y.password=p.observable();y.PIN=p.observable();y.pinNumber=p.observable(v.pinnumber);y.PUK=p.observable();y.pukNumber=p.observable(v.puknumber);y.showEntrance=p.observable(false);y.sharePathInvalid=p.observable(false);y.uiLoginTimer=p.observable(300);y.accountLocked=p.computed(function(){return y.loginCount()==d.MAX_LOGIN_COUNT&&y.leftSeconds()!="-1"});y.leftUnlockTime=p.computed(function(){y.leftSeconds();var A=transSecond2Time(y.uiLoginTimer());return A.substring(A.indexOf(":")+1,A.length)});if(d.SD_CARD_SUPPORT){g.getSDConfiguration({},function(A){y.showEntrance(A.sd_status=="1"&&A.share_status=="1"&&A.sd_mode=="0");if(y.showEntrance()){g.checkFileExists({path:A.share_file},function(B){if(B.status=="exist"||B.status=="processing"){y.sharePathInvalid(false)}else{y.sharePathInvalid(true)}})}})}var r=s(t,v);y.pageState=p.observable(r);if(r==l.LOADING){addTimeout(u,500)}x();y.login=function(){if(d.LOGIN_SECURITY_SUPPORT&&y.accountLocked()){showAlert("password_error_account_lock_time",function(){x()});return false}y.pageState(l.LOADING);window.clearInterval(b);var C="";if(d.PASSWORD_ENCODE){C=y.password()}else{var B=g.getDeviceInfoLow();var D=m.enc.Latin1.parse(B.skey);var A=m.enc.Latin1.parse(B.siv);C=m.AES.encrypt(y.password(),D,{iv:A,mode:m.mode.CBC,padding:m.pad.ZeroPadding}).toString()}g.login({password:C},function(E){setTimeout(function(){b=h()},1300);if(E.result){y.pageState(l.LOGGEDIN);if(d.LOGIN_SECURITY_SUPPORT){y.loginCount(0);y.uiLoginTimer(300);clearInterval(e)}f("#container").empty();window.location.hash="#main";q.init()}else{y.password("");if(d.LOGIN_SECURITY_SUPPORT){y.checkLoginData(function(){if(y.loginCount()==d.MAX_LOGIN_COUNT){showAlert("password_error_five_times",function(){x()});y.startLoginLockInterval()}else{showAlert({msg:"password_error_left",params:[d.MAX_LOGIN_COUNT-y.loginCount()]},function(){x()})}})}else{showAlert("password_error",function(){x()})}y.pageState(l.LOGIN)}})};y.checkLoginData=function(A){g.getLoginData({},function(C){var B=parseInt(C.psw_fail_num_str,10);y.loginCount(d.MAX_LOGIN_COUNT-B);y.leftSeconds(C.login_lock_time);y.uiLoginTimer(C.login_lock_time);if(f.isFunction(A)){A()}else{if(y.loginCount()==d.MAX_LOGIN_COUNT){y.startLoginLockInterval()}}})};y.startLoginLockInterval=function(){e=setInterval(function(){g.getLoginData({},function(A){if(A.login_lock_time<=0||A.psw_fail_num_str==5){y.loginCount(0);clearInterval(e)}if(y.leftSeconds()!=A.login_lock_time){y.leftSeconds(A.login_lock_time);y.uiLoginTimer(A.login_lock_time)}else{y.uiLoginTimer(y.uiLoginTimer()>0?y.uiLoginTimer()-1:0)}})},1e3)};y.checkLoginData();y.enterPIN=function(){y.pageState(l.LOADING);var A=y.PIN();g.enterPIN({PinNumber:A},function(B){if(!B.result){showAlert("pin_error",function(){u()});y.PIN("")}else{u()}})};function x(){setTimeout(function(){var A=f("#txtAdmin:visible");var B=f("#txtPIN:visible");var C=f("#txtPUK:visible");if(A.length>0){A.focus()}else{if(B.length>0){B.focus()}else{if(C.length>0){C.focus()}}}},100)}function u(){var C=g.getLoginData();var A=g.getLoginStatus();var B=s(A,C);if(B==l.LOADING){addTimeout(u,500)}else{y.pageState(B);y.pinNumber(C.pinnumber);y.pukNumber(C.puknumber)}x()}y.enterPUK=function(){y.pageState(l.LOADING);var C=y.newPIN();var A=y.confirmPIN();var B={};B.PinNumber=C;B.PUKNumber=y.PUK();g.enterPUK(B,function(D){if(!D.result){showAlert("puk_error",function(){u()});y.PUK("");y.newPIN("");y.confirmPIN("")}else{u()}})};function z(A,C){if(A.status=="loggedIn"){var B=C.modem_main_state;if(B=="modem_waitpin"){return l.WAIT_PIN}else{if((B=="modem_waitpuk"||C.pinnumber==0)&&C.puknumber!=0){return l.WAIT_PUK}else{if((C.puknumber==0||B=="modem_sim_destroy")&&B!="modem_sim_undetected"&&B!="modem_undetected"){return l.PUK_LOCKED}else{return l.LOGGEDIN}}}}else{var B=C.modem_main_state;if(f.inArray(B,d.TEMPORARY_MODEM_MAIN_STATE)!=-1){return l.LOADING}else{return l.LOGIN}}}function s(A,B){if(d.LOGIN_THEN_CHECK_PIN){return z(A,B)}else{return w(A,B)}}function w(A,C){if(A.status=="loggedIn"){return l.LOGGEDIN}else{var B=C.modem_main_state;if(f.inArray(B,d.TEMPORARY_MODEM_MAIN_STATE)!=-1){return l.LOADING}else{if(B=="modem_waitpin"){return l.WAIT_PIN}else{if((B=="modem_waitpuk"||parseInt(C.pinnumber)===0)&&parseInt(C.puknumber)!=0){return l.WAIT_PUK}else{if((parseInt(C.puknumber)===0||B=="modem_sim_destroy")&&B!="modem_sim_undetected"&&B!="modem_undetected"){return l.PUK_LOCKED}else{return l.LOGIN}}}}}}}function a(){if(window.location.hash!=d.defaultRoute&&n.indexOf(d.GUEST_HASH,window.location.hash)==-1){if(!manualLogout&&k=="1"){manualLogout=false;k="UNREAL";showAlert("need_login_again",function(){window.location="index.html"})}else{if(k=="UNREAL"){return}else{window.location="index.html"}}}}function h(){return setInterval(function(){var r=g.getStatusInfo();if(!r.isLoggedIn){a();return}k=g.getStatusInfo().isLoggedIn?"1":"0"},1e3)}function o(){var t=g.getStatusInfo();if(t.isLoggedIn){window.location.hash="#main";return}var r=f("#container")[0];p.cleanNode(r);var s=new j;p.applyBindings(s,r);f("#frmLogin").validate({submitHandler:function(){s.login()},rules:{txtAdmin:"login_password_length_check"}});f("#frmPIN").validate({submitHandler:function(){s.enterPIN()},rules:{txtPIN:"pin_check"}});f("#frmPUK").validate({submitHandler:function(){s.enterPUK()},rules:{txtNewPIN:"pin_check",txtConfirmPIN:{equalToPin:"#txtNewPIN"},txtPUK:"puk_check"}})}return{init:o,gotoLogin:a}});define("logout","set service knockout underscore jquery".split(" "),function(b,f,j,g,d){function c(){var l=this;var k=function(){var m=f.getLoginStatus();return m.status=="loggedIn"}();l.loggedIn=j.observable(k);l.logout=function(){showConfirm("confirm_logout",function(){manualLogout=true;f.logout({},a())})};l.showLogout=function(){if(b.HAS_LOGIN){return l.loggedIn()}else{return false}}}function a(){window.location="index.html"}function e(){var k=new c;h(k)}function h(l){var k=d("#logout")[0];j.cleanNode(k);j.applyBindings(l,k)}return{init:e}});define("opmode","knockout service jquery set underscore".split(" "),function(d,a,f,c,b){function e(){var h=this;h.isLoggedIn=d.observable(false);h.enableFlag=d.observable(false);h.showOpModeWindow=function(){showSettingWindow("change_mode","opmode_popup","opmode_popup",400,300,function(){})};h.currentOpMode=d.observable("0");a.getOpMode({},function(l){h.isLoggedIn(l.loginfo=="ok");if(l.opms_wan_mode!="PPP"&&l.rj45_state!="idle"&&l.rj45_state!="dead"){h.enableFlag(false)}else{if(l.opms_wan_mode=="PPP"&&l.ppp_status!="ppp_disconnected"){h.enableFlag(false)}else{if(l.opms_wan_mode=="DHCP"){h.enableFlag(true)}else{h.enableFlag(true)}}}var k=l.opms_wan_mode=="DHCP"||l.opms_wan_mode=="STATIC"?"PPPOE":l.opms_wan_mode;var j="";switch(k){case"BRIDGE":j="opmode_bridge";break;case"PPP":j="opmode_gateway";break;case"PPPOE":j="opmode_cable";break;default:break}f("#opmode").attr("data-trans",j).text(f.i18n.prop(j))});setInterval(function(){var j=a.getConnectionInfo();if(j.opms_wan_mode=="DHCP"){h.enableFlag(true)}else{if(j.opms_wan_mode=="PPP"&&j.ppp_status!="ppp_disconnected"||j.opms_wan_mode!="PPP"&&j.rj45_state!="idle"&&j.rj45_state!="dead"){h.enableFlag(false)}else{h.enableFlag(true)}}},1e3)}function g(){var h=f("#currentOpMode")[0];d.cleanNode(h);var j=new e;d.applyBindings(j,h)}return{init:g}});define("opmode_popup","knockout service jquery set underscore".split(" "),function(d,a,f,c,b){function e(){var j=this;var h="";j.selectedMode=d.observable("0");a.getOpMode({},function(k){if(k.blc_wan_mode=="AUTO_PPP"){h="AUTO"}else{if(k.blc_wan_mode=="AUTO_PPPOE"){h="AUTO"}else{if(k.blc_wan_mode=="PPPOE"){h="PPPOE"}else{h=k.blc_wan_mode}}}j.selectedMode(h)});j.changeOpMode=function(){var k=f('input:radio[name="opMode"]:checked').val();var l="";if(k==h){hidePopupSettingWindow();return}if(k=="LTE_BRIDGE"){l="opmode_msg3"}else{l="opmode_msg2"}showConfirm(l,function(){showLoading();a.SetOperationMode({opMode:k},function(n){if(n&&n.result=="success"){var m="";switch(k){case"AUTO":m="opmode_auto";break;case"PPP":m="opmode_gateway";break;case"PPPOE":m="opmode_cable";break;default:break}f("#opmode").attr("data-trans",m).text(f.i18n.prop(m));successOverlay()}else{errorOverlay()}})})}}function g(){var h=new e;d.applyBindings(h,f("#popupSettingWindow")[0]);f("#opmode_form").validate({submitHandler:function(){h.changeOpMode()}})}return{init:g}});define("router","underscore jquery menu set service".split(" "),function(j,f,b,c,g){var e="";var a=f("#container");checkFormContentModify=function(o){if(c.CONTENT_MODIFIED.modified&&window.location.hash!=o){if(c.CONTENT_MODIFIED.message=="sms_to_save_draft"){c.CONTENT_MODIFIED.callback.ok(c.CONTENT_MODIFIED.data);c.resetContentModifyValue();window.location.hash=o}else{showConfirm(c.CONTENT_MODIFIED.message,{ok:function(){c.CONTENT_MODIFIED.callback.ok(c.CONTENT_MODIFIED.data);c.resetContentModifyValue();window.location.hash=o},no:function(){var p=c.CONTENT_MODIFIED.callback.no(c.CONTENT_MODIFIED.data);if(!p){window.location.hash=o;c.resetContentModifyValue()}}})}return false}else{return true}};function n(){setInterval(function(){var t=g.getStatusInfo();var o=b.findMenu();if(o.length==0){return false}var s=["phonebook","sms_list"];var p=f.inArray(o[0].path,s)!=-1;if(o[0].checkSIMStatus===true){var r=t.simStatus=="modem_sim_undetected"||t.simStatus=="modem_sim_destroy"||t.simStatus=="modem_waitpin"||t.simStatus=="modem_waitpuk";var q=t.simStatus=="modem_imsi_waitnck";if(t.isLoggedIn&&(f("#div-nosimcard")[0]==undefined&&r||f("#div-network-lock")[0]==undefined&&q||(f("#div-nosimcard")[0]!=undefined||f("#div-network-lock")[0]!=undefined)&&t.simStatus=="modem_init_complete")){d(o[0],t.simStatus,p)}}},1e3)}function m(){var p=window.location.hash;if(p=="#entry"||j.indexOf(c.GUEST_HASH,p)!=-1){f("#manageContainer").attr("style","margin-top:-36px;")}else{f("#manageContainer").attr("style","margin-top:0px;")}if(window.location.hash=="#entry"){f("#mainContainer").addClass("loginBackgroundBlue")}else{var o=f("#mainContainer");if(o.hasClass("loginBackgroundBlue")){f("#container").css({margin:0});o.removeClass("loginBackgroundBlue").height("auto")}}}function d(q,o,p){var r={};f.extend(r,q);if(o=="modem_sim_undetected"||o=="modem_sim_destroy"){if(!p){r.path="sim_abnormal"}}else{if(o=="modem_waitpin"||o=="modem_waitpuk"){r.path="sim_abnormal"}else{if(o=="modem_imsi_waitnck"){r.path="locknet"}}}l(r)}function l(q){var p=q.path.replace(/\//g,"_");var r=f("body").removeClass();if(p!="entry"&&p!="main"){r.addClass("beautiful_bg page_"+p)}else{r.addClass("page_"+p)}clearTimer();hideLoading();var o="text!tmpl/"+q.path+".html";require([o,q.path],function(s,t){a.stop(true,true);a.hide();a.html(s);t.init();b.refreshMenu();f("#container").translate();b.activeSubMenu();f("form").attr("autocomplete","off");a.fadeIn()})}function h(){if(window.location.hash!=e){var t=g.getStatusInfo();if(window.location.hash==c.defaultRoute||j.indexOf(c.GUEST_HASH,window.location.hash)!=-1){if(t.isLoggedIn){window.location.hash=e==""?"#main":e;return}}var q=b.findMenu();if(q.length==0){window.location.hash=c.defaultRoute}else{if(c.RJ45_SUPPORT&&window.location.hash=="#main"){if(q[0].checkSIMStatus&&checkCableMode(t.blc_wan_mode)||!q[0].checkSIMStatus&&!checkCableMode(t.blc_wan_mode)){window.location.reload();return}}var o=b.findMenu(e);e=q[0].hash;if(e=="#entry"){f("#indexContainer").addClass("login-page-bg");b.rebuild()}else{f("#indexContainer").removeClass("login-page-bg")}if(o.length!=0&&q[0].path==o[0].path&&q[0].level!=o[0].level&&q[0].level!="1"&&o[0].level!="1"){return}m();var s=["phonebook","sms_list"];var r=f.inArray(q[0].path,s)!=-1;if(q[0].checkSIMStatus===true||r){if(t.simStatus==undefined){showLoading("waiting");function p(){var u=g.getStatusInfo();if(u.simStatus==undefined||f.inArray(u.simStatus,c.TEMPORARY_MODEM_MAIN_STATE)!=-1){addTimeout(p,500)}else{d(q[0],u.simStatus,r);hideLoading()}}p()}else{d(q[0],t.simStatus,r)}}else{l(q[0])}}}}function k(){n();window.location.hash=window.location.hash||"#main";if("onhashchange"in window&&(typeof document.documentMode==="undefined"||document.documentMode==8)){window.onhashchange=h;h()}else{setInterval(h,200)}f("a[href^='#']").die("click").live("click",function(){var o=f(this);c.CONTENT_MODIFIED.checkChangMethod();return checkFormContentModify(o.attr("href"))})}return{init:k}});define("statusBar","knockout jquery underscore service set menu tooltip".split(" "),function(V,G,ac,g,L,W,I){var h=false;var s=false;var z=false;var q=null;var T=0;var c=[];var X=false;var w=true;var S=true;var Y={};var H=null;var x=false;var K=null;var O=null;var l=false;var u=false;var U=0;var J=function(){return g.getStatusInfo()};function M(){var ai=this;var ah=J();var ae=ah.roamingStatus?true:false;var ag=G("#langLogoBar");function ad(){showLoading("connecting");g.connect({},function(aj){if(aj.result){refreshWifiConnectStatus(ai,aj.status)}successOverlay()},function(aj){errorOverlay()})}function af(){showLoading("disconnecting");g.disconnect({},function(aj){if(aj.result){refreshWifiConnectStatus(ai,aj.status)}successOverlay()},function(aj){errorOverlay()})}if(ah.isLoggedIn){if(!ag.hasClass("langborderBg")){ag.addClass("langborderBg")}G("#statusBar:hidden").show()}else{if(ag.hasClass("langborderBg")){ag.removeClass("langborderBg")}G("#statusBar:visible").hide()}ai.batteryLevel=V.observable(ah.batteryLevel+"%");ai.batteryPers=V.observable(n(ah.batteryPers,ah.batteryStatus));ai.batteryStatus=V.observable(ah.batteryStatus);ai.connectionCssClass=V.observable("");ai.connectStatus=V.observable(ah.connectStatus);ai.connectStatusText=V.observable();ai.connectStatusTrans=V.observable();ai.hasWifi=V.observable(L.HAS_WIFI);ai.hasBattery=V.observable(L.HAS_BATTERY);ai.isLoggedIn=V.observable(ah.isLoggedIn);ai.isShowConnectionIcon=V.observable(false);ai.isShowFotaNewversionIcon=V.observable(ah.new_version_state&&ah.fota_package_already_download!="yes"&&!L.isShowFotaIcon);ai.isShowRj45ConnectionIcon=V.observable(false);ai.networkOperator=V.observable(o(ah.spn_b1_flag,ah.spn_name_data,ah.spn_b2_flag,ah.networkOperator,ae));ai.networkType=V.observable(getNetworkType(ah.networkType));ai.pinStatus=V.observable(ah.pinStatus);ai.pinStatusText=V.observable();ai.rj45ConnectionCssClass=V.observable("");ai.roamingStatus=V.observable(ah.roamingStatus?"R":"");ai.showAttachedDevices=V.observable(ah.wifiStatus);ai.showSmsDeleteConfirm=V.observable(false);ai.smsUnreadCount=V.observable(0);ai.simStatus=V.observable(D(ah.simStatus));ai.signalCssClass=V.observable(F(ah.signalImg,ah.networkType,ah.simStatus));ai.updateType=V.observable(g.getUpdateType().update_type);ai.wifiStatusCssClass=V.observable(m(ah.wifiStatus,ah.wirelessDeviceNum));ai.wifiStatusImg=V.observable(e(ah.wifiStatus,ah.wirelessDeviceNum));k(ai,ah.connectStatus,ah.data_counter,ah.connectWifiSSID,ah.connectWifiStatus,ah.rj45ConnectStatus);ai.connect=ad;ai.disconnect=af}function aa(){var ad="#msg_main";if(window.location.hash=="#msg_main"){ad="#msg_list"}L.CONTENT_MODIFIED.checkChangMethod();if(checkFormContentModify(ad)){window.location.hash=ad}}gotoSmsList=aa;function o(ah,ad,ag,af,ae){if(ad==""){return af}else{ad=decodeMessage(ad);if(ah=="0"&&ag=="0"){if(ae){return ad==af?af:ad+"  "+af}else{return ad}}else{if(ah=="1"&&ag=="1"){if(ae){return af}else{return ad==af?af:ad+"  "+af}}else{if(ah=="1"){return ad==af?af:ad+"  "+af}else{if(ag=="1"){if(ae){return af}else{return ad}}}}}return""}}function y(au,ak,an){L.smsMaxId=au.id;var af=G.now();Y["m"+af]=af;var av=au.number;if(w&&L.phonebook&&L.phonebook.length==0){w=false;if(L.HAS_PHONEBOOK){Z()}else{L.phonebook=[]}}for(ap in L.phonebook){if(getLastNumber(L.phonebook[ap].pbm_number,L.SMS_MATCH_LENGTH)==getLastNumber(au.number,L.SMS_MATCH_LENGTH)){av=L.phonebook[ap].pbm_name;break}}var ai={mark:"m"+af,name:av,title:G.i18n.prop("sms"),titleTrans:"sms",tag:au.tag,content:au.content,datetime:au.time};if(H==null){H=G.template("newMessagePopTmpl",G("#newMessagePopTmpl"))}G(".bubbleItem:not(.report)","#buttom-bubble").remove();G.tmpl("newMessagePopTmpl",ai).appendTo("#buttom-bubble");if((window.location.hash=="#msg_main"||window.location.hash=="#msg_list")&&an=="1"){var ag=L.currentChatObject&&L.currentChatObject==getLastNumber(au.number,L.SMS_MATCH_LENGTH);var ao=getLastNumber(au.number,L.SMS_MATCH_LENGTH);var at=G("#smslist-item-"+ao);if(at&&at.length>0){for(var ap=0;L.listMsgs&&ap<L.listMsgs.length;ap++){if(getLastNumber(L.listMsgs[ap].number,L.SMS_MATCH_LENGTH)==getLastNumber(au.number,L.SMS_MATCH_LENGTH)){L.listMsgs[ap].id=au.id;L.listMsgs[ap].latestId=au.id;L.listMsgs[ap].latestSms=au.content;L.listMsgs[ap].latestTime=au.time;if(!ak){L.listMsgs[ap].newCount++;L.listMsgs[ap].totalCount++}break}}at.find(".smslist-item-checkbox p.checkbox").attr("id",au.id);at.find(".smslist-item-checkbox input:checkbox").val(au.id).attr("id","checkbox"+au.id);if(!ak){var ah=at.find(".smslist-item-total-count").text();ah=Number(ah.substring(1,ah.length-1));at.find(".smslist-item-total-count").text("("+(ah+1)+")");if(!L.currentChatObject||L.currentChatObject!=getLastNumber(au.number,L.SMS_MATCH_LENGTH)){var aj=at.find(".smslist-item-new-count").removeClass("hide");if(aj&&aj.text().length>0){aj.text(Number(aj.text())+1)}else{aj.text(1)}}}if(at.find(".smslist-item-draft-flag").length>0){if(L.currentChatObject&&L.currentChatObject==getLastNumber(au.number,L.SMS_MATCH_LENGTH)){at.find(" td:nth-child(2)").removeClass("font-weight-bold")}else{at.find(" td:nth-child(2)").addClass("font-weight-bold")}}else{var ae=at.find(".smslist-item-msg").text(au.content);ae.closest("td").prop("title",au.content);at.find("span.clock-time").text(au.time);if(L.currentChatObject&&L.currentChatObject==getLastNumber(au.number,L.SMS_MATCH_LENGTH)){ae.closest("tr").removeClass("font-weight-bold")}else{ae.closest("tr").addClass("font-weight-bold")}}at.find(".smslist-item-repeat span").die().click(function(){forwardClickHandler(au.id)});var ar=at;at.hide().remove();G("#smslist-table").prepend(ar.show())}else{var al="";if(L.phonebook&&L.phonebook.length>0){for(ap in L.phonebook){if(getLastNumber(L.phonebook[ap].pbm_number,L.SMS_MATCH_LENGTH)==getLastNumber(au.number,L.SMS_MATCH_LENGTH)){al=L.phonebook[ap].pbm_name;break}}}var aq={id:au.id,name:al,number:au.number,latestId:au.id,totalCount:1,newCount:ag?0:1,latestSms:au.content,latestTime:au.time,checked:false,hasDraft:false,itemId:getLastNumber(au.number,L.SMS_MATCH_LENGTH)};if(O==null){O=G.template("smsTableTmpl",G("#smsTableTmpl"))}G.tmpl("smsTableTmpl",{data:[aq]}).prependTo("#smslist-table")}if(L.HAS_PHONEBOOK){G(".sms-add-contact-icon").removeClass("hide")}else{G(".sms-add-contact-icon").addClass("hide")}if(ag){var ad=G("#talk-item-"+au.id,"#chatlist");if(ad&&ad.length>0){G(".J_content pre",ad).html(dealContent(au.content));G(".time .smslist-item-time",ad).text(au.time);G(".smslist-item-repeat",ad).die().click(function(){forwardClickHandler(au.id)});G(".smslist-item-delete",ad).die().click(function(){deleteSingleItemClickHandler(au.id)})}else{G("#smsOtherTmpl").tmpl(au).appendTo("#chatlist");G(".clear-container","#chatpanel").animate({scrollTop:G("#chatlist").height()})}if(!L.SMS_SET_READ_WHEN_COMPLETE){g.setSmsRead({ids:[au.id]},G.noop)}else{if(L.SMS_SET_READ_WHEN_COMPLETE&&au.receivedAll){g.setSmsRead({ids:[au.id]},G.noop)}}}enableCheckbox(G("#smslist-checkAll"))}if(window.location.hash=="#msg_sim"&&an=="0"){var al="";if(L.phonebook&&L.phonebook.length>0){for(ap in L.phonebook){if(getLastNumber(L.phonebook[ap].pbm_number,L.SMS_MATCH_LENGTH)==getLastNumber(au.number,L.SMS_MATCH_LENGTH)){al=L.phonebook[ap].pbm_name;break}}}var aq={id:au.id,name:al,number:au.number,content:au.content,time:au.time,tag:au.tag,checked:false,itemId:getLastNumber(au.number,L.SMS_MATCH_LENGTH)};if(ak){var am=G(".simMsgList-item-class-"+aq.id);am.hide().remove()}if(K==null){K=G.template("ssimMessageListTemplate",G("#simMessageListTemplate"))}G.tmpl("simMessageListTemplate",{data:[aq]}).prependTo("#simMsgList_container")}}function a(){var ad=g.getCurrentUpgradeState();if(ad.current_upgrade_state=="low_battery"){showInfo("ota_low_battery");clearInterval(T)}}function D(ad){var ae;switch(ad){case"modem_destroy":ae="./pic/simcard_undetected.png";break;case"modem_imsi_waitnck":ae="./pic/simcard_undetected.png";break;case"modem_init_complete":ae="./pic/simcard_detected.png";break;case"modem_sim_destroy":ae="./pic/simcard_undetected.png";break;case"modem_sim_undetected":ae="./pic/simcard_undetected.png";break;case"modem_undetected":ae="./pic/simcard_undetected.png";break;case"modem_waitpin":ae="./pic/simcard_undetected.png";break;case"modem_waitpuk":ae="./pic/simcard_undetected.png";break;default:ae="./pic/simcard_detected.png";break}return ae}function B(ad,ae){setTimeout(function(){var ag=G("#chosenUserSelect");var ah=G("option",ag);for(var af=0;af<ah.length;af++){if(getLastNumber(ae,L.SMS_MATCH_LENGTH)==ah[af].value){ah[af].text=ad+"/"+ae;ah[af].value=ae;break}}ag.trigger("liszt:updated")},0)}function t(ad){if(G.isArray(ad.pbm_data)&&ad.pbm_data.length>0){L.phonebook=ad.pbm_data}}function j(ad,ae){if(!L.dbMsgs){L.dbMsgs=[]}if(c.length==0){G.each(L.dbMsgs,function(af,ag){c.push(ag.id)})}G.each(ad,function(af,ah){if(G.inArray(ah.id,c)==-1){c.push(ah.id);L.dbMsgs.push(ah);if(ah.tag=="1"){y(ah,false,ae)}}else{for(var ag=0;ag<L.dbMsgs.length;ag++){if(L.dbMsgs[ag].id==ah.id&&L.dbMsgs[ag].content!=ah.content&&ah.tag=="1"){L.dbMsgs[ag].content=ah.content;y(ah,true,ae);break}}}})}function n(af,ad){var ae=null;if("0"==ad){if("1"==af){ae="pic/power_one.png"}else{if("2"==af){ae="pic/power_two.png"}else{if("3"==af){ae="pic/power_three.png"}else{if("4"==af){ae="pic/power_full.png"}else{ae="pic/power_out.png"}}}}}else{ae="pic/power_charging.gif"}return ae}function k(ae,ad,ak,af,aj,ai){var ah="icon_connection ";var ag="icon_connection ";if(ai=="connect"){ah+="connecting"}else{if(ai=="working"){ah+="rj45_connected"}else{ah+="disconnect"}}if(ad=="ppp_connecting"||ad=="wifi_connecting"){ag+="connecting"}else{if(ad=="ppp_connected"){if(ak.uploadRate!="0"&&ak.downloadRate!="0"){ag+="connectionBoth"}else{if(ak.uploadRate!="0"&&ak.downloadRate=="0"){ag+="connectionUp"}else{if(ak.uploadRate=="0"&&ak.downloadRate!="0"){ag+="connectionDown"}else{ag+="connectionNone"}}}}else{if(ad=="ppp_disconnected"){if(af&&aj=="connect"){g.getHotspotList({},function(ap){var ao="icon_connection ";var am="connecting ";for(var an=0,al=ap.hotspotList.length;an<al;an++){if(ap.hotspotList[an].connectStatus=="1"){am="wifi_connected";break}}ao+=am;ae.connectionCssClass(ao)});ae.rj45ConnectionCssClass(ah);return}else{if(af&&(aj=="connecting"||aj=="dhcping")){ag+="connecting"}else{ag+="disconnect"}}}else{ag+="disconnect"}}}ae.connectionCssClass(ag);ae.rj45ConnectionCssClass(ah)}function Z(){var ad=g.getPhoneBooks({page:0,data_per_page:2e3,orderBy:"id",isAsc:false});t(ad)}function F(af,ae,ad){ae=ae.toLowerCase();ad=ad?ad.toLowerCase():"";if(ae==""||ae=="limited_service"||ae=="no_service"||ae=="limited service"||ae=="no service"||ad!="modem_init_complete"){af="_none"}return"signal signal"+af}function m(ad,ae){if(ad){if(ae==0){return"wifi_status0"}else{return"wifi_status"+ae}}else{return"wifi_status_off"}}function e(ad,ae){if(ad){if(ae==0){return"./pic/wlan0.png"}else{return"./pic/wlan"+ae+".png"}}else{return"./pic/wlan_off.png"}}function Q(){g.getPackSizeInfo({},function(ae){var ad;if(parseInt(ae.fota_pkg_total_size)==0){ad=0}else{ad=parseInt(parseInt(ae.fota_dl_pkg_size)*100/parseInt(ae.fota_pkg_total_size))}if(ad>100){ad=100}if(ad>=0){if(ad>95){showProgressBar("ota_update","<br/>"+G.i18n.prop("ota_update_warning"))}setProgressBar(ad)}})}function A(){if(w&&L.phonebook&&L.phonebook.length==0){w=false;if(L.HAS_PHONEBOOK){Z()}else{L.phonebook=[]}}g.getSMSDeliveryReport({page:0,smsCount:10},function(af){var ae=af.messages;var ad=[];G.each(ae,function(ag,ah){if(G.inArray(ah.number,ad)==-1){ad.push(ah.number);window.setTimeout(function(){var ai=G.now();Y["m"+ai]=ai;ah.name=ah.number;for(ag in L.phonebook){if(getLastNumber(L.phonebook[ag].pbm_number,L.SMS_MATCH_LENGTH)==getLastNumber(ah.number,L.SMS_MATCH_LENGTH)){ah.name=L.phonebook[ag].pbm_name;break}}var aj=G.i18n.prop("sms_delivery_report_"+ah.content);var ak={mark:"m"+ai,name:ah.name,title:G.i18n.prop("sms_report"),titleTrans:"sms_report",content:aj,datetime:ah.time,report:"report"};if(H==null){H=G.template("newMessagePopTmpl",G("#newMessagePopTmpl"))}G(".report","#buttom-bubble").remove();G.tmpl("newMessagePopTmpl",ak).appendTo("#buttom-bubble")},100)}})},function(){})}function N(ad){return ad=="modem_sim_undetected"||ad=="modem_undetected"||ad=="modem_sim_destroy"||ad=="modem_waitpin"||ad=="modem_waitpuk"||ad=="modem_imsi_waitnck"}function E(){q=true;var ad=g.getNewVersionState();function ag(){var ah=["downloading"];var ai=g.getCurrentUpgradeState();if(ai.current_upgrade_state.toLowerCase()=="idle"){addTimeout(ag,1e3)}else{if(G.inArray(ai.current_upgrade_state,ah)!=-1&&ad.fota_new_version_state!="already_has_pkg"){hideLoading();p()}}}if(!G("#progress").is(":visible")){ag()}var af=0;var ae=function(){var ai=null;if(af<=3){af=af+1;ai=g.getCurrentUpgradeState()}else{ai=J()}var ah=ai.current_upgrade_state;if(q&&S==true){if(ad.fota_new_version_state=="already_has_pkg"){if(ah=="low_battery"){hideProgressBar();q=false;g.removeTimerThings("fota_current_upgrade_state",function(){});showInfo("ota_pkg_low_battery");window.clearTimeout(U);return}else{if(ah=="prepare_install"){hideProgressBar();q=false;g.removeTimerThings("fota_current_upgrade_state",function(){});showInfo("ota_pkg_download_success");window.clearTimeout(U);T=setInterval(function(){a()},1e3);return}}}else{if(ah=="downloading"){Q()}else{if(ah=="download_failed"){hideProgressBar();q=false;showAlert("ota_download_failed");window.clearTimeout(U);return}else{if(ah=="low_battery"){hideProgressBar();q=false;g.removeTimerThings("fota_current_upgrade_state",function(){});showInfo("ota_low_battery");window.clearTimeout(U);return}else{if(ah=="prepare_install"){hideProgressBar();q=false;g.removeTimerThings("fota_current_upgrade_state",function(){});showInfo("ota_download_success");window.clearTimeout(U);T=setInterval(function(){a()},1e3);return}else{q=false;hideProgressBar();window.clearTimeout(U);return}}}}}U=window.setTimeout(ae,1e3)}};if(q&&S==true){U=window.setTimeout(ae,100)}else{window.clearTimeout(U)}}function r(ae){if(!G("#loading").is(":visible")&&!G("#confirm").is(":visible")){var ad=ae?"ota_update_success":"ota_update_failed";X=true;showAlert(ad,function(){X=false;if(L.UPGRADE_TYPE=="OTA"){g.clearUpdateResult({},G.noop())}})}else{window.setTimeout(function(){r(ae)},1e3)}}function p(){var ae=g.getMandatory();var ad=ae.is_mandatory;var af=g.getPackSizeInfo();var ag;if(parseInt(af.fota_pkg_total_size)==0){ag=0}else{ag=parseInt(parseInt(af.fota_dl_pkg_size)*100/parseInt(af.fota_pkg_total_size))}if(ag>100){ag=100}if(ad){showProgressBar("ota_update","<br/>"+G.i18n.prop("ota_update_warning"))}else{var ah="";if(L.UPGRADE_TYPE=="OTA"){ah="<br/><br/><button id='btnStopUpgrade' onclick='stopOTAUpgrade();' class='btn-1 btn-primary'>"+G.i18n.prop("cancel")+"</button>"}showProgressBar("ota_update","<br/>"+G.i18n.prop("ota_update_warning")+ah)}if(ag>=0){setProgressBar(ag)}}function P(){g.setUpgradeSelectOp({selectOp:"1"},function(ad){if(ad.result=="success"){E()}})}function d(){g.setUpgradeSelectOp({selectOp:"0"},function(ad){})}function C(ad){var af=J();if(ad){var ae=g.getOpMode();if(!checkConnectedStatus(af.connectStatus,ae.rj45_state,af.connectWifiStatus)){showAlert("ota_network_disconnected");return}if(af.fota_user_selector=="none"){P()}else{if(af.fota_user_selector=="accept"){E()}else{if(af.fota_user_selector=="cancel"){showAlert("ota_have_cancel")}else{if(af.fota_user_selector=="downloading_cancel"){showAlert("ota_have_cancel")}}}}}else{if(af.fota_user_selector=="none"){d()}else{if(af.fota_user_selector=="accept"){E()}else{if(af.fota_user_selector=="cancel"){}else{if(af.fota_user_selector=="downloading_cancel"){}}}}}}function b(af){var ae=af.current_upgrade_state;if(ae=="upgrade_pack_redownload"){showConfirm("ota_interrupted",{ok:function(){C(1)},no:function(){C(0)}})}else{var ad=["prepare_install","low_battery","connecting_server","connect_server_success","downloading","accept"];if(G.inArray(ae,ad)!=-1){E()}else{showConfirm(G.i18n.prop("ota_new_version"),{ok:function(){C(1);L.ISNOW_NOTICE=false},no:function(){C(0);L.ISNOW_NOTICE=false}})}}}showOTAAlert=function(){L.ISNOW_NOTICE=true;var ad=g.getMandatory().is_mandatory;if(ad){E()}else{var ae={};ae=g.getCurrentUpgradeState();b(ae)}};stopOTAUpgrade=function(){g.setUpgradeSelectOp({selectOp:"2"},function(ad){});q=false;window.clearTimeout(U);hideLoading();showAlert("ota_cancel")};function f(ad){u=!!ad;l=!!ad;if(!ad){x=true}}function v(ad){l=!!ad;if(!ad){x=true}}function ab(af){var ad={showConfirm:false,limitPercent:af.limitVolumePercent};if(af.limitVolumeType=="1"){var ae=parseInt(af.data_counter.monthlySent,10)+parseInt(af.data_counter.monthlyReceived,10);ad.usedPercent=ae/af.limitVolumeSize*100;if(ad.usedPercent>ad.limitPercent){ad.showConfirm=true;ad.type="data"}}else{ad.usedPercent=af.data_counter.monthlyConnectedTime/af.limitVolumeSize*100;if(ad.usedPercent>ad.limitPercent){ad.showConfirm=true;ad.type="time"}}return ad}function R(){if(L.PRODUCT_TYPE=="DATACARD"){G("#statusBar").addClass("padding-right-90");G("#language").addClass("data-card-language")}var ag=G("<img />").attr("src","pic/res_alert.png");var af=G("<img />").attr("src","pic/res_confirm.png");var aj=G("<img />").attr("src","pic/res_info.png");window.setTimeout(function(){var al=new M;V.applyBindings(al,G("#statusBar")[0]);window.setInterval(function(){var ap=J();var an=ap.roamingStatus?true:false;var ao=G("#langLogoBar");S=ap.isLoggedIn;al.batteryLevel(ap.batteryLevel+"%");al.batteryPers(n(ap.batteryPers,ap.batteryStatus));al.batteryStatus(ap.batteryStatus);al.isShowFotaNewversionIcon(ap.new_version_state&&ap.fota_user_selector&&ap.fota_package_already_download!="yes"&&L.ISNOW_NOTICE&&al.updateType()=="mifi_fota");al.isShowRj45ConnectionIcon(L.RJ45_SUPPORT);al.networkOperator(o(ap.spn_b1_flag,ap.spn_name_data,ap.spn_b2_flag,ap.networkOperator,an));al.networkType(getNetworkType(ap.networkType));al.pinStatus(ap.pinStatus);al.roamingStatus(ap.roamingStatus?"R":"");al.showAttachedDevices(ap.wifiStatus);al.simStatus(D(ap.simStatus));al.signalCssClass(F(ap.signalImg,ap.networkType,ap.simStatus));al.isLoggedIn(ap.isLoggedIn);al.wifiStatusCssClass(m(ap.wifiStatus,ap.wirelessDeviceNum));al.wifiStatusImg(e(ap.wifiStatus,ap.wirelessDeviceNum));if(L.HAS_SMS){if(!h&&ap.isLoggedIn){ak(ap.smsUnreadCount)}else{al.smsUnreadCount(ap.smsUnreadCount)}}k(al,ap.connectStatus,ap.data_counter,ap.connectWifiSSID,ap.connectWifiStatus,ap.rj45ConnectStatus);ae(al,ap.connectStatus,ap.connectWifiSSID,ap.connectWifiStatus);checkTrafficLimitAlert(al,ap);ad({simStatus:ap.simStatus,wifiStatus:ap.wifiStatus,deviceSize:ap.wirelessDeviceNum,networkType:ap.networkType});if(ap.isLoggedIn){G("#statusBar:hidden").show()}else{G("#statusBar:visible").hide()}},500);if(L.HAS_SMS){window.setInterval(function(){if(al.isLoggedIn()){ak()}},1e4);ai()}window.setInterval(function(){var ao=J();var an=["prepare_install","low_battery","download_success","downloading"];if(al.isLoggedIn()==true&&!G("#progress").is(":visible")&&ao.defaultWanName!=""){if(G.inArray(ao.current_upgrade_state,an)!=-1){if(null==q){if(!ao.is_mandatory){G.modal.close()}E()}else{if(false==q){q=null}}}}},1e3);var am=function(){var an=g.getStatusInfo();if(an.isLoggedIn){g.getUpgradeResult({},function(ao){if(ao.upgrade_result=="success"){r(true)}else{if(ao.upgrade_result=="fail"){r(false)}else{window.setTimeout(am,1e3)}}},function(){window.setTimeout(am,1e3)})}else{window.setTimeout(am,1e3)}};if(al.updateType()=="mifi_fota"){am();window.setInterval(function(){var an=J();if(an.isLoggedIn&&an.defaultWanName!=""){if(an.new_version_state&&an.fota_package_already_download!="yes"&&!L.ALREADY_NOTICE){g.getUpgradeResult({},function(ao){if(ao.upgrade_result=="success"){r(true)}else{if(ao.upgrade_result=="fail"){r(false)}else{if(X==false){L.ALREADY_NOTICE=true;showOTAAlert()}}}})}}},1e3)}function ak(an){g.getSmsCapability({},function(ao){var ap=false;if(ao.nvTotal!=0&&ao.nvUsed>=ao.nvTotal){G("#sms_unread_count").attr("tipTitle","sms_capacity_is_full");ap=true}else{if(ao.nvTotal!=0&&ao.nvUsed+5>=ao.nvTotal){G("#sms_unread_count").attr("tipTitle","sms_capacity_will_full");ap=true}else{G("#sms_unread_count").attr("tipTitle","sms_unread_count")}}al.showSmsDeleteConfirm(ap);if(typeof an!="undefined"){al.smsUnreadCount(an)}h=true})}},1200);I.init();function ai(){var ak=J();if(ak.isLoggedIn){g.getSMSReady({},function(al){if(al.sms_cmd_status_result=="1"){window.setTimeout(function(){ai()},1e3)}else{s=true}})}else{window.setTimeout(function(){ai()},1e3)}}checkTrafficLimitAlert=function(an,ao){if(window.location.hash=="#entry"){return false}var ak=L.AP_STATION_SUPPORT?g.getStatusInfo().ap_station_enable:"undefined";var ap=ab(ao);var am=G("#confirm-container:visible").length>0;var al=L.PRODUCT_TYPE=="CPE"&&checkCableMode(ao.blc_wan_mode)?true:false;if(L.AP_STATION_SUPPORT&&(typeof ak=="undefined"||ak==="")){g.refreshAPStationStatus({},G.noop());return false}ak=ak==1;if(!ao.isLoggedIn||am||u&&l||!ao.limitVolumeEnable||!ak&&!(ao.connectStatus=="ppp_connected")||al){return false}if(x){window.setTimeout(function(){x=false},2e3);return false}if(ap.showConfirm){var aq=null;if(ap.usedPercent>100&&!l){u=true;l=true;aq={msg:ak?"traffic_beyond_msg":"traffic_beyond_disconnect_msg"}}else{if(!u){u=true;l=false;aq={msg:ak?"traffic_limit_msg":"traffic_limit_disconnect_msg",params:[ap.limitPercent]}}}if(aq!=null){if(ak){showAlert(aq)}else{showConfirm(aq,function(){showLoading("disconnecting");g.disconnect({},function(ar){if(ar.result){successOverlay()}else{errorOverlay()}})})}}}return true};function ad(ak){G("#statusItemSimStatus").attr("tipTitle","sim_status_"+ak.simStatus);if(ak.wifiStatus){if(ak.deviceSize==0){G("#wifi_status").attr("tipTitle","wifi_status_on")}else{G("#wifi_status").attr("tipTitle","wifi_status"+ak.deviceSize)}}else{G("#wifi_status").attr("tipTitle","wifi_status_off")}}function ae(am,ak,al,an){am.connectStatus(ak);if(ak=="ppp_disconnecting"){am.connectStatusTrans("disconnecting");am.connectStatusText(G.i18n.prop("disconnecting"))}else{if(ak=="ppp_connecting"){am.connectStatusTrans("connecting");am.connectStatusText(G.i18n.prop("connecting"))}else{if(ak=="ppp_connected"){am.connectStatusTrans("connected");am.connectStatusText(G.i18n.prop("connected"))}else{if(al){if(an=="dhcping"||an=="connecting"){am.connectStatus("wifi_connecting");am.connectStatusTrans("connecting");am.connectStatusText(G.i18n.prop("connecting"))}else{if(an=="connect"){am.connectStatus("wifi_connect");am.connectStatusTrans("connected");am.connectStatusText(G.i18n.prop("connected"))}else{am.connectStatus("ppp_disconnected");am.connectStatusTrans("disconnected");am.connectStatusText(G.i18n.prop("disconnected"))}}}else{am.connectStatusTrans("disconnected");am.connectStatusText(G.i18n.prop("disconnected"))}}}}}getNetworkType=function(al){var ak=al.toLowerCase();if(ak==""||ak=="limited service"){ak="limited_service"}if(ak=="no service"){ak="no_service"}if(ak=="limited_service"||ak=="no_service"){G("#networkType","#statusBar").attr("data-trans","network_type_"+ak);return G.i18n.prop("network_type_"+ak)}else{G("#networkType","#statusBar").removeAttr("data-trans");return al}};if(L.HAS_SMS&&W.checkIsMenuExist("sms_list")){window.setInterval(function(){var al=J();if(window.location.hash=="#entry"||N(al.simStatus)){return}for(key in Y){var am=Y[key];if(G.now()-am>5e3){delete Y["m"+am];var ak=G(".bubbleItem#m"+am,"#buttom-bubble");ak.fadeOut(1e3,function(){G(this).remove()})}}if(al.isLoggedIn){if(al.newSmsReceived&&!z){z=true;g.resetNewSmsReceivedVar();ah()}if(al.smsReportReceived){g.resetSmsReportReceivedVar();A()}}},1e3);if(L.SMS_DATABASE_SORT_SUPPORT){window.setInterval(function(){if(W.checkIsMenuExist("sms_list")){var ak=J();if(ak.isLoggedIn&&s&&!z&&!N(ak.simStatus)){z=true;ah()}}},20001)}}function ah(){var al=1;var ak=5;if(!L.dbMsgs||L.dbMsgs.length==0){ak=500;al=10}g.getSMSMessages({page:0,smsCount:ak,nMessageStoreType:0,tags:al,orderBy:"order by id desc"},function(am){if(am&&am.messages){j(am.messages,0)}z=false});g.getSMSMessages({page:0,smsCount:ak,nMessageStoreType:1,tags:al,orderBy:"order by id desc"},function(am){if(am&&am.messages){j(am.messages,1)}z=false})}if(L.HAS_SMS){G(".bubbleItem","#buttom-bubble").live("mouseover",function(){var ak=G(this);delete Y[ak.attr("id")]}).live("mouseout",function(){var al=G(this);var ak=G.now();Y["m"+ak]=ak;al.attr("id","m"+ak);G(".bubbleItem h3 a.bubbleCloseBtn","#buttom-bubble").data("targetid","m"+ak)});G(".bubbleItem h3 a.bubbleCloseBtn","#buttom-bubble").die().live("click",function(){var al=G(this).data("targetid");delete Y[al];var ak=G(".bubbleItem#"+al,"#buttom-bubble");ak.fadeOut(1e3,function(){G(this).remove()})})}}return{init:R,setTrafficAlertPopuped:f,setTrafficAlert100Popuped:v,getTrafficResult:ab,showOTAAlert:showOTAAlert}});define("status_traffic_alert","jquery knockout service statusBar echarts".split(" "),function(h,n,k,f,e){var l=null;var o=null;var b=false;var d=false;var j={data:{alarm:{itemStyle:{normal:{color:"#8CC916"}},name:"������",value:19.7},alert:{itemStyle:{normal:{color:"#FF5500"}},name:"����ֵ",value:1},free:{itemStyle:{normal:{color:"#D8D8D8"}},name:"δʹ��",value:50},full:{itemStyle:{normal:{color:"#DF4313"}},name:"��������",value:30},left1:{itemStyle:{normal:{color:"#D8D8D8"}},name:"����ֵ��δʹ��",value:50},start:{itemStyle:{normal:{color:"#D8D8D8"}},name:"����ֵ��δʹ��",value:50},used:{itemStyle:{normal:{color:"#8CC916"}},name:"��ʹ��",value:30}},cacheEle:{},getEle:function(p){if(this.cacheEle.hasOwnProperty("id")){return this.cacheEle[p]}else{this.cacheEle[p]=h("#"+p);return this.cacheEle[p]}},fetchTrafficAlertInfo:function(){o=g();return o},getTrafficStatisticalDatalnfo:function(p){return{data:/\d+(.\d+)?/.exec(p)[0],unit:/[A-Z]{1,2}/.exec(p)[0]}},getTrafficTimeHours:function(p){var q=p.split(":");return{h:parseInt(q[0],10),m:parseInt(q[1],10),s:parseInt(q[2],10)}},getTrafficTimeInfo:function(p){return{data:/\d+(.\d+)?/.exec(p)[0],unit:/[a-z]{4,6}/.exec(p)[0]}},getTrafficTimeToSeconds:function(q){var p=this.getTrafficTimeHours(q);return p.h*3600+p.m*60+p.s},getTrafficUnitByScale:function(p){if(p=="1024"){return"GB"}else{if(p=="1048576"){return"TB"}else{return"MB"}}},getTrafficValueByStatisticalUnit:function(p){p=p.toLowerCase();if(p=="minute"){return"60"}else{if(p=="gb"){return"1024"}else{if(p=="hour"){return"3600"}else{if(p=="tb"){return"1048576"}else{return"1"}}}}},isFormEditable:function(s){var r=s.dataLimitTypeChecked()=="1"&&(s.viewEditUsedData()||s.viewEditAlertData()||s.viewEditTotalData());var p=s.dataLimitTypeChecked()=="0"&&(s.viewEditUsedTime()||s.viewEditAlertTime()||s.viewEditTotalTime());if(r||p){h(".border-color-transition:visible").addClass("attention-focus");addTimeout(function(){h(".border-color-transition:visible").removeClass("attention-focus")},1500);return true}else{var q=false;if(s.dataLimitTypeChecked()==1){if(s.alertDataReach()=="0"){s.editAlertDataHandler();q=true}if(s.limitDataMonth()=="0"){s.editTotalDataHandler();q=true}}else{if(s.alertTimeReach()=="0"){s.editAlertTimeHandler();q=true}if(s.limitTimeMonth()=="0"){s.editTotalTimeHandler();q=true}}if(q){h(".border-color-transition:visible").addClass("attention-focus");addTimeout(function(){h(".border-color-transition:visible").removeClass("attention-focus")},1500)}return q}},refreshFlowDiagramInfo:function(H){var F=0;var G=0;var w=0;var u=0;var D=0;var p=0;var q=h.i18n.prop("echarts_no");if(o.dataLimitChecked=="1"){q=h.i18n.prop("echarts_used");a.series[0].data=[];if(H.dataLimitTypeChecked()=="1"){a.title.text="";a.series[0].data=[];if(H.limitDataMonth()==0){var I=j.data.used;I.value=1;I.name=h.i18n.prop("echarts_used");I.selected=false;a.series[0].data.push(I)}else{D=H.limitDataMonth()*H.selectedDataUnit()*1048576;p=parseInt(o.monthlySent,10)+parseInt(o.monthlyReceived,10);u=D*H.alertDataReach()/100;if(p>=D){var s=j.data.full;s.value=100;s.name=h.i18n.prop("echarts_full");a.series[0].data.push(s);q=h.i18n.prop("echarts_full")}else{if(u>p){w=u-p;G=D-u}else{F=p-u;G=D-p}var I=j.data.used;if(u-p>0){I.value=p}else{I.value=u}I.name=h.i18n.prop("echarts_used");a.series[0].data.push(I);if(w>0){var z=j.data.left1;z.value=w;z.name=h.i18n.prop("echarts_left1");a.series[0].data.push(z)}var v=j.data.alert;v.value=D/200;v.name=h.i18n.prop("echarts_alert");a.series[0].data.push(v);if(F>0){var r=j.data.alarm;r.value=F;r.name=h.i18n.prop("echarts_alarm");a.series[0].data.push(r)}var t=j.data.free;t.value=G;t.name=h.i18n.prop("echarts_free");a.series[0].data.push(t)}}}else{a.series[0].data=[];if(H.limitTimeMonth()==0){var I=j.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_used");a.series[0].data.push(I)}else{D=H.limitTimeMonth()*H.selectedTimeUnit();p=o.monthlyConnectedTime;u=D*H.alertTimeReach()/100;if(p>=D){var x=j.data.full;x.value=100;x.name=h.i18n.prop("echarts_full");a.series[0].data.push(x);q=h.i18n.prop("echarts_full")}else{if(u-p>0){w=u-p;G=D-u}else{F=p-u;G=D-p}var y=j.data.used;if(u-p>0){y.value=p}else{y.value=u}y.name=h.i18n.prop("echarts_used");a.series[0].data.push(y);if(w>0){var E=j.data.left1;E.value=w;E.name=h.i18n.prop("echarts_left1");a.series[0].data.push(E)}var C=j.data.alert;C.value=D/200;C.name=h.i18n.prop("echarts_alert");a.series[0].data.push(C);if(F>0){var A=j.data.alarm;A.value=F;A.name=h.i18n.prop("echarts_alarm");a.series[0].data.push(A)}var B=j.data.free;B.value=G;B.name=h.i18n.prop("echarts_free");a.series[0].data.push(B)}}}}else{var I=j.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_no");a.series[0].data=[I];a.title.text=""}j.setFlowDiagramInfo(a,q)},setFlowDiagramInfo:function(p,q){var s=j.data.start;s.name=q;s.selected=false;s.value=0;var r=[s].concat(p.series[0].data);p.series[0].data=r;l.setOption(p,true);addTimeout(function(){l.resize()},1e3)}};var a={animation:false,color:["red","red","red","red","red"],series:[{name:"��������",radius:["0","75"],selectedOffset:3,type:"pie",data:[],itemStyle:{normal:{labelLine:{show:false},label:{show:false}}}}],title:{itemGap:0,text:"",subtextStyle:{color:"#FFF",fontFamily:"΢���ź�",fontSize:16,fontWeight:"bolder"},textStyle:{color:"#FFF",fontFamily:"΢���ź�",fontSize:20,fontWeight:"bolder"},x:"center",y:"center"},tooltip:{formatter:"{b}"}};function g(){return k.getTrafficAlertInfo()}function c(){var p=this;var V=j.fetchTrafficAlertInfo();var A=V.limitDataMonth.split("_");b=false;d=false;p.alertDataReach=n.observable(V.alertDataReach||0);p.alertTimeReach=n.observable(V.alertTimeReach||0);p.dataLimitChecked=n.observable(V.dataLimitChecked=="0"?"0":"1");p.dataLimitTypeChecked=n.observable(V.dataLimitTypeChecked=="0"?"0":"1");p.limitTimeMonth=n.observable(V.limitTimeMonth||0);p.usedDataText=n.observable(transUnit(parseInt(V.monthlySent,10)+parseInt(V.monthlyReceived,10),false));var r=j.getTrafficStatisticalDatalnfo(p.usedDataText());var F=r.data;p.dataUsed=n.observable(F);var B=r.unit;p.selectedDataUsedUnit=n.observable(j.getTrafficValueByStatisticalUnit(B));p.usedDataTextDescData=n.observable("");p.limitDataMonth=n.observable(A[0]||0);p.selectedDataUnit=n.observable(A[1]||1);var I=transUnit(p.limitDataMonth()*p.selectedDataUnit()*1024*1024,false);var t=I.substring(I.length-2);p.limitDataMonth(I.substring(0,I.length-2));p.selectedDataUnit(j.getTrafficValueByStatisticalUnit(t));p.usedDataTextDesc=n.computed(H);p.limitDataMonthDescData=n.observable("");p.limitDataMonthDesc=n.computed(Y);p.alertDataReachDescData=n.observable("");p.alertDataReachDesc=n.computed(R);p.leftDataDescData=n.observable("");p.leftDataDesc=n.computed(N);p.monthlyConnectedTime=n.observable(transSecond2Time(V.monthlyConnectedTime));var S=j.getTrafficTimeInfo(transTimeUnit(V.monthlyConnectedTime));p.usedTime=n.observable(S.data);p.selectedTimeUsedUnit=n.observable(j.getTrafficValueByStatisticalUnit(S.unit));p.usedTimeTextDescData=n.observable("");p.usedTimeTextDesc=n.computed(T);var X=j.getTrafficTimeInfo(transTimeUnit(parseFloat(p.limitTimeMonth())*3600));p.selectedTimeUnit=n.observable(j.getTrafficValueByStatisticalUnit(X.unit));p.limitTimeMonth(X.data);p.limitTimeMonthDescData=n.observable("");p.limitTimeMonthDescText=n.observable("traffic_limit_time_h");p.limitTimeMonthDesc=n.computed(w);p.alertTimeReachDescData=n.observable("");p.alertTimeReachDesc=n.computed(u);p.leftTimeDescData=n.observable("");p.leftTimeDesc=n.computed(y);p.save=z;p.viewEditUsedData=n.observable(false);p.editUsedDataHandler=x;p.editUsedDataSaveHandler=aa;p.saveUsedData=M;p.editUsedDataCancelHandler=G;p.viewEditTotalData=n.observable(false);p.editTotalDataHandler=E;p.editTotalDataSaveHandler=s;p.editTotalDataCancelHandler=Q;p.viewEditAlertData=n.observable(false);p.editAlertDataHandler=L;p.editAlertDataSaveHandler=q;p.editAlertDataCancelHandler=Z;p.viewEditUsedTime=n.observable(false);p.editUsedTimeHandler=v;p.saveUsedTime=J;p.editUsedTimeSaveHandler=O;p.editUsedTimeCancelHandler=C;p.viewEditTotalTime=n.observable(false);p.editTotalTimeHandler=D;p.editTotalTimeSaveHandler=ab;p.editTotalTimeCancelHandler=P;p.viewEditAlertTime=n.observable(false);p.editAlertTimeHandler=K;p.editAlertTimeSaveHandler=U;p.editAlertTimeCancelHandler=W;j.refreshFlowDiagramInfo(p);function R(){if(isNaN(p.limitDataMonth()*p.selectedDataUnit()*p.alertDataReach())){p.alertDataReachDescData(p.alertDataReach()+", ");return h.i18n.prop("traffic_alert_reach_text",p.alertDataReach()," ")}var ac=transUnit(p.limitDataMonth()*p.selectedDataUnit()*p.alertDataReach()*1048576/100,false);p.alertDataReachDescData(p.alertDataReach()+","+ac);return h.i18n.prop("traffic_alert_reach_text",p.alertDataReach(),ac)}function u(){if(isNaN(p.limitTimeMonth()*p.alertTimeReach())){p.alertTimeReachDescData(p.alertTimeReach()+", ");return h.i18n.prop("traffic_alert_reach_text",p.alertTimeReach()," ")}var ac=transSecond2Time(p.limitTimeMonth()*p.selectedTimeUnit()*p.alertTimeReach()/100);p.alertTimeReachDescData(p.alertTimeReach()+","+ac);return h.i18n.prop("traffic_alert_reach_text",p.alertTimeReach(),ac)}function Z(){p.alertDataReach(j.getEle("editAlertData").data("oldValue"));p.viewEditAlertData(false)}function L(){j.getEle("editAlertData").data("oldValue",p.alertDataReach());p.viewEditAlertData(true)}function q(){if(j.getEle("alertDataReach").valid()){p.viewEditAlertData(false)}}function W(){p.alertTimeReach(j.getEle("editAlertTime").data("oldValue"));p.viewEditAlertTime(false)}function K(){j.getEle("editAlertTime").data("oldValue",p.alertTimeReach());p.viewEditAlertTime(true)}function U(){if(j.getEle("alertTimeReach").valid()){p.viewEditAlertTime(false)}}function E(){j.getEle("editTotalData").data("oldValue",p.limitDataMonth());j.getEle("selectedDataUnit").data("oldValue",p.selectedDataUnit());p.viewEditTotalData(true)}function s(){if(j.getEle("limitDataMonth").valid()){p.usedDataText(transUnit(p.limitDataMonth()*p.selectedDataUnit()*1048576,false));p.viewEditTotalData(false)}}function Q(){p.limitDataMonth(j.getEle("editTotalData").data("oldValue"));p.selectedDataUnit(j.getEle("selectedDataUnit").data("oldValue"));p.viewEditTotalData(false)}function P(){p.limitTimeMonth(j.getEle("editTotalTime").data("oldValue"));p.viewEditTotalTime(false)}function D(){j.getEle("editTotalTime").data("oldValue",p.limitTimeMonth());p.viewEditTotalTime(true)}function ab(){if(j.getEle("limitTimeMonth").valid()){p.viewEditTotalTime(false)}}function G(){p.dataUsed(j.getEle("editUsedData").data("oldValue"));p.selectedDataUsedUnit(j.getEle("selectedDataUsedUnit").data("oldValue"));j.getEle("editUsedDataCancel").siblings("label.error").hide();p.viewEditUsedData(false)}function x(){j.getEle("editUsedData").data("oldValue",p.dataUsed());j.getEle("selectedDataUsedUnit").data("oldValue",p.selectedDataUsedUnit());p.dataUsed(p.dataUsed());p.viewEditUsedData(true)}function aa(){if(j.getEle("dataUsed").valid()){b=true;p.viewEditUsedData(false)}}function C(){p.usedTime(j.getEle("editUsedTime").data("oldValue"));p.viewEditUsedTime(false)}function v(){j.getEle("editUsedTime").data("oldValue",p.usedTime());p.viewEditUsedTime(true)}function O(){if(j.getEle("usedTime").valid()){p.monthlyConnectedTime(transSecond2Time(parseFloat(p.usedTime())*p.selectedTimeUsedUnit()));p.viewEditUsedTime(false);d=true}}function N(){var ac=(p.limitDataMonth()*p.selectedDataUnit()-p.dataUsed()*p.selectedDataUsedUnit())*1048576;if(ac<0){ac=0}if(isNaN(ac)){p.leftDataDescData("");return h.i18n.prop("traffic_data_left_text"," ")}p.leftDataDescData(transUnit(ac,false));return h.i18n.prop("traffic_data_left_text",transUnit(ac,false))}function y(){var ac=p.limitTimeMonth()*p.selectedTimeUnit()-j.getTrafficTimeToSeconds(p.monthlyConnectedTime());if(ac<0){ac=0}if(isNaN(ac)){p.leftTimeDescData(" ");return h.i18n.prop("traffic_data_left_text"," ")}p.leftTimeDescData(transSecond2Time(ac));return h.i18n.prop("traffic_data_left_text",transSecond2Time(ac))}function Y(){if(isNaN(p.limitDataMonth())){p.limitDataMonthDescData("");return h.i18n.prop("traffic_limit_data_text"," ")}else{}p.limitDataMonthDescData(p.limitDataMonth()+j.getTrafficUnitByScale(p.selectedDataUnit()));return h.i18n.prop("traffic_limit_data_text",p.limitDataMonth()+j.getTrafficUnitByScale(p.selectedDataUnit()))}function w(){if(isNaN(p.limitTimeMonth())){p.limitTimeMonthDescData(" ");p.limitTimeMonthDescText("traffic_limit_time_h");return h.i18n.prop("traffic_limit_time_h"," ")}else{}p.limitTimeMonthDescData(p.limitTimeMonth());if(p.selectedTimeUnit()=="60"){p.limitTimeMonthDescText("traffic_limit_time_m");return h.i18n.prop("traffic_limit_time_m",p.limitTimeMonth())}else{p.limitTimeMonthDescText("traffic_limit_time_h");return h.i18n.prop("traffic_limit_time_h",p.limitTimeMonth())}}function z(){if(j.isFormEditable(p)&&p.dataLimitChecked()=="1"){return false}if(p.selectedDataUnit()=="1"&&p.selectedDataUsedUnit()=="1048576"&&p.dataLimitTypeChecked()=="1"&&p.dataLimitChecked()=="1"&&!(parseInt(p.dataUsed(),10)<parseInt("4096",10))){showAlert("traffic_over_note");return false}showLoading();k.setTrafficAlertInfo({alertDataReach:parseInt(p.alertDataReach(),10),alertTimeReach:parseInt(p.alertTimeReach(),10),dataLimitChecked:p.dataLimitChecked(),dataLimitTypeChecked:p.dataLimitTypeChecked(),limitDataMonth:p.limitDataMonth()+"_"+p.selectedDataUnit(),limitTimeMonth:p.selectedTimeUnit()=="60"?p.limitTimeMonth()/60:p.limitTimeMonth()},function(ac){if(ac.result=="success"){if(p.dataLimitTypeChecked()=="1"&&b){p.saveUsedData()}else{if(p.dataLimitTypeChecked()=="0"&&d){p.saveUsedTime()}else{j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);f.setTrafficAlertPopuped(false);successOverlay()}}}else{errorOverlay()}},function(){j.refreshFlowDiagramInfo(p);errorOverlay()})}function M(){var ac=p.dataUsed()*p.selectedDataUsedUnit();k.trafficCalibration({way:"data",value:ac},function(){j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);successOverlay();p.viewEditUsedData(false);f.setTrafficAlertPopuped(false);b=false},function(){j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);errorOverlay()})}function J(){k.trafficCalibration({way:"time",value:p.selectedTimeUsedUnit()=="60"?parseFloat(p.usedTime())/60:p.usedTime()},function(){j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);successOverlay();p.monthlyConnectedTime(transSecond2Time(parseFloat(p.usedTime())*p.selectedTimeUsedUnit()));p.viewEditUsedTime(false);f.setTrafficAlertPopuped(false);d=false},function(){j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);errorOverlay()})}function H(){if(isNaN(p.dataUsed())){p.usedDataTextDescData("");return h.i18n.prop("traffic_used_text"," ")}p.usedDataTextDescData(p.dataUsed()+j.getTrafficUnitByScale(p.selectedDataUsedUnit()));return h.i18n.prop("traffic_used_text",p.dataUsed()+j.getTrafficUnitByScale(p.selectedDataUsedUnit()))}function T(){p.usedTimeTextDescData(p.monthlyConnectedTime());return h.i18n.prop("traffic_used_text",p.monthlyConnectedTime())}}function m(){l=e.init(h("#traffic_graphic")[0]);window.onresize=l.resize;var r=h("#container");n.cleanNode(r[0]);var q=new c;n.applyBindings(q,r[0]);h("#trafficAlertForm").validate({submitHandler:function(){q.save()},errorPlacement:function(t,s){if(s.attr("name")=="alertDataReach"){t.insertAfter("#editAlertDataDiv")}else{if(s.attr("name")=="alertTimeReach"){t.insertAfter("#editAlertTimeDiv")}else{if(s.attr("name")=="dataUsed"){t.insertAfter("#editUsedDataDiv")}else{if(s.attr("name")=="limitDataMonth"){t.insertAfter("#editTotalDataDiv")}else{if(s.attr("name")=="limitTimeMonth"){t.insertAfter("#editTotalTimeDiv")}else{if(s.attr("name")=="usedTime"){t.insertAfter("#editUsedTimeDiv")}else{t.insertAfter(s)}}}}}}},rules:{alertDataReach:{range:[1,100],digits:true},alertTimeReach:{range:[1,100],digits:true},dataUsed:{range:[0,9999],decimalRange:true},limitDataMonth:{range:[1,9999],decimalRange:true},limitTimeMonth:{range:[1,9999],decimalRange:true},usedTime:{range:[0,9999],decimalRange:true}}});var p=window.language;window.setInterval(function(){if(p!=window.language){p=window.language;j.refreshFlowDiagramInfo(q)}},1e3)}return{init:m}});define("tooltip",["jquery"],function(b){function a(g,j,f){var l=g.offset().top;var k=g.offset().left;var e=f.position[0];var d=j.outerHeight()+g.outerHeight();var h=j.outerWidth()+g.outerWidth();l-=j.outerHeight()-f.offset[0];k+=g.outerWidth()+f.offset[1];if(/iPad/i.test(navigator.userAgent)){l-=b(window).scrollTop()}if(e=="center"){l+=d/2}if(e=="bottom"){l+=d}e=f.position[1];if(e=="center"){k-=h/2}else{if(e=="left"){k-=h}}return{top:l,left:k}}function c(){b(".statusItem","#statusBar").each(function(d,f){var e=b(this);e.attr("tipTitle",e.attr("title")).removeAttr("title")}).hover(function(){var e=b(this);var f=e.attr("tipTitle");var d=b("<div>").addClass("tooltip in").appendTo(document.body).hide().append(e.attr("i18n")?b.i18n.prop(f):f);if(e.attr("i18n")){d.attr("data-trans",f).attr("id","tooltip_"+e.attr("id"))}var g=a(e,d,{position:["bottom","center"],offset:[0,0]});d.css({position:"absolute",top:g.top,left:g.left}).show()},function(){b(".tooltip").hide().remove()})}return{init:c}});define("menu","set service knockout underscore jquery".split(" "),function(p,r,q,u,j){var k=false;var e;var f=[];var b="";function l(w){for(var v=0;v<f.length;v++){if(f[v].path==w){return true}}return false}function m(){var v=r.getLoginStatus();return v.status=="loggedIn"}function s(){var v=m();var w=u.filter(f,function(x){return x.level=="1"&&(x.requireLogin&&v||!x.requireLogin)&&x.hash!="#entry"});e.menuMain(w);e.loggedIn(v);g(e.menuMain().length);e.showMenu(v||k);j("#nav").translate()}function g(v){var w=100/v;j("ul#list-nav li").each(function(){j(this).css("width",w+"%")})}function n(){var w=window.location.hash;var x=u.find(f,function(y){return y.hash==w});while(x.parent){x=u.find(f,function(y){return y.hash==x.parent})}if(!x.parent){j("#list-nav li").removeClass("active");var v=x.hash.substring(1,x.hash.length);j("#list-nav li[mid="+v+"]").addClass("active")}e.changeMenu(x)}function o(w){w=w||window.location.hash;var v=m();return u.filter(f,function(x){return w==x.hash&&(x.requireLogin&&v||!x.requireLogin)})}function h(x,w){var v=u.find(f,function(y){return y.parent==w.hash&&y.path==w.path});j(".menu-"+x+"-level").removeClass("active");if(v){if(x=="two"){h("three",v);a(v.hash,x)}j(".menu-"+x+"-level."+v.hash.substring(1)).addClass("active")}}function t(){var v=window.location.hash;var w=u.find(f,function(x){return x.hash==v});if(w.level==1){h("two",w)}if(w.level==2){h("three",w);a(w.hash,w.level)}if(w.level==3){a(w.parent,w.level);j(".menu-three-level").removeClass("active");j(".menu-three-level."+w.hash.substring(1)).addClass("active")}}function a(w,x){libjqobj=j(".menu-two-level."+w.substring(1));var v=["3","three","2","two"];if(u.indexOf(v,x)!=-1&&libjqobj.hasClass("active")){return}libjqobj.siblings().removeClass("active");libjqobj.addClass("active");libjqobj.siblings().not(".menu-two-level").slideUp();libjqobj.next().has("ul li").slideDown()}p.blc_wan_mode=r.getOpMode().blc_wan_mode;if(!p.RJ45_SUPPORT){b="menu"}else{switch(p.blc_wan_mode){case"PPPOE":case"AUTO_PPPOE":b="menu_pppoe";break;default:b="menu";break}}require([p.DEVICE+"/"+b],function(v){f=v;if(p.SD_CARD_SUPPORT){f=f.concat([{hash:"#httpshare_guest",path:"sd_httpshare",level:"",requireLogin:false,checkSIMStatus:false},{hash:"#sdcard",path:"sd",level:"",requireLogin:true,checkSIMStatus:false},{hash:"#httpshare",path:"sd_httpshare",level:"",requireLogin:true,checkSIMStatus:false}])}});function d(){e=new c}function c(){var v=m();var x=this;x.loggedIn=q.observable(v);x.showMenu=q.observable(v||k);var y=u.filter(f,function(z){return z.level=="1"&&(z.requireLogin&&x.loggedIn()||!z.requireLogin)&&z.hash!="#entry"});x.menuMain=q.observableArray(y);x.secondMenu=q.observableArray([]);x.changeMenu=function(z){var A=w(z);if(A.length==0){j("#container").addClass("fixContainerWidth")}else{j("#container").removeClass("fixContainerWidth")}x.secondMenu(A);return true};x.thirdMenu=function(){return x.curThirdMenu};x.getThirdMenu=function(z){x.curThirdMenu=w(z)};function w(z){return u.filter(f,function(A){return A.parent&&A.parent==z.hash&&(A.requireLogin&&x.loggedIn()||!A.requireLogin)})}}return{activeSubMenu:t,checkIsMenuExist:l,findMenu:o,rebuild:s,refreshMenu:n,init:d}});