-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path78fjh45jhg4g545.min.js
3 lines (2 loc) · 105 KB
/
78fjh45jhg4g545.min.js
1
2
3
/*! ChromebookRedirector 2021-06-09 */
function e(e){this.size=0,this.limit=e,this._keymap={}}function t(){var e=window.navigator.userAgent,t=e.indexOf(";"),r=e.indexOf(")");return-1!==t||-1!==r?e.substring(t+1,r).trim():c}function r(){var e=window.navigator.userAgent;return-1!==e.indexOf("X11; CrOS")||-1!==e.indexOf("Edg/")}function i(){chrome.tabs.query({currentWindow:!0},e=>{e.forEach(e=>{e.url&&chrome.tabs.update(e.id,{url:e.url})})})}e.prototype.put=function(e,t){var r={key:e,value:t};if(this._keymap[e]=r,this.tail?(this.tail.newer=r,r.older=this.tail):this.head=r,this.tail=r,this.size===this.limit)return this.shift();this.size++},e.prototype.shift=function(){var e=this.head;return e&&(this.head.newer?(this.head=this.head.newer,this.head.older=void 0):(this.head=void 0,this.tail=void 0),e.newer=e.older=void 0,delete this._keymap[e.key],this.size--),e},e.prototype.remove=function(e){var t=this._keymap[e];if(t)return delete this._keymap[t.key],t.newer&&t.older?(t.older.newer=t.newer,t.newer.older=t.older):t.newer?(t.newer.older=void 0,this.head=t.newer):t.older?(t.older.newer=void 0,this.tail=t.older):this.head=this.tail=void 0,this.size--,t.value},String.prototype.endsWith=function(e){return-1!==this.indexOf(e,this.length-e.length)},String.prototype.startsWith=function(e){return 0===this.indexOf(e)};const o="normal",n="edu",s="gen4_saml",a="gen4_auto",u="5.3.205",c="CrOS",l="0.0.0.0",d=5e3,h=5e3,g=5e3,p=[159,61,137,38,239,186,130,131,221,204,40,64,173,220,249,14],f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],m="/autoLogin?ibssoidreg=",y="ibssoid",v=5e3,S=4e3,C=120,P="_",A="overrideTimeoutAlarm",b="checkLocationAlarm",w=10,R="netIDLoginAlarm",O=10,U="The Cloud Connector is initializing, please try your request again shortly",I="The Cloud Connector has not been setup properly, please contact your administrator for help",E="The Cloud Connector has not obtained the user email properly, please contact your administrator for help",L="Unable to contact the server, please try your request again shortly",x="Connection Aborted",D="Device is currently offline with no network connection",k="Device is currently off-premise, and current rules prohibit off-premise usage",G="Device is currently initializing, please try your request again shortly",_="An internal error occurred, please try your request again shortly",T="The NetIDLogon command failed with the following message: ",M="The override logout command failed with the following message: ",H="Unable to perform a NetID Login at this time",N="Unable to perform a NetID Login with backup host at this time",W="No username found for NetID Login",B="Unable to request a URL Exception at this time",F="Please enter your email to request a URL Exception",q="Invalid URL Exception request",K="Unable to request an override at this time",V="Please enter an override username",X="Please enter an override password",j="An override session is already active",z="Settings is invalidated, passing traffic through.",$="Configuration issue. Please check your Settings",J="Setup information not received",Y="Override Login Active",Q="Cloud Connector Error - ",Z="Request Override Login",ee="Override Login in Progress",te="Location check in progress",re="On-Premise mode",ie="Cloud Connector is in Gen4 mode",oe="http://clients3.google.com/generate_204",ne="http://myiboss.net/",se="http://www.msftncsi.com/ncsi.txt",ae="Microsoft NCSI",ue="Unavailable";var ce={LOGGED_IN:"loggedIn",LOGGED_OUT:"loggedOut",LOGGING_IN:"loggingIn",ON_OFF_PREM_CHECK:"onOffPremCheck",ON_PREM:"onPrem",ERROR:"error",HIDDEN:"hidden",GEN4:"gen4"};const le=2,de=5e3,he=1e3,ge=6e4,pe=1e4,fe=180,me=900,ye=3600,ve=8887,Se=-1,Ce="__NO_CHANGE__";var Pe={WebSecurityKey:void 0,WebSecurityHost:void 0,WebSecurityCustomBlockPageURL:void 0,SSOSecurityKey:void 0,SSOHost:void 0,SSOBackupHost:void 0,SSOLoginIntervalMinutes:void 0,UseSSL:!1,AllowOffPremUsage:!0,FilterWhenOffPrem:!0,BlockOnUnsuccessfulConnection:!1,FilterPerformance:"HIGH",SendCompleteEmail:!0,HTTPPort:8025,HTTPSPort:8026,NetIDPort:8015,UseLocalPac:!1,SecureNetIDPort:8016,OverrideUsername:void 0,OverrideGroupName:void 0,OverrideGroupNumber:void 0,OverrideExpirationTime:void 0,OriginalWebSecurityKey:void 0,CompatibilityAppPluginID:"oejigobjchedidhlafnpdpccihgbmbka",RunTimeMode:"normal",CompatibilityAppMode:"pac",Gen4ProxyHost:void 0,Gen4ProxyPort:8009,PACServerPort:9003,PACServerFailCount:0,PACServerFailCountMax:3,Gen4ProxyBypass:[],Gen4ProxyAutoConfigurationScriptURL:void 0,Gen4AutoRegisterPort:8015,Gen4AutoRegisterSecurePort:8016,Gen4AutoLoginSecurityGroups:void 0,Gen4AutoLoginComputerOverridesUser:0,Gen4AutoLoginEncryptionRegistration:0,Gen4ProxyMonitorInterval:5e3,Gen4AutoLoginCaptivePortalDetectionInterval:5e3,Gen4AutoLoginCaptivePortalDetection:0,PolicyUpdateDetection:0,PolicyUpdateDetectionInterval:6e4,IpAddressResolutionInterval:900,ChromeBridgeIP:void 0,ReloadTabs:!0,Gen3AlwaysMobile:!1,LocalProxyAutoConfigurationScriptURL:"http://127.0.0.1:9003/local.pac",FailsafePACServerPort:9003,MitmCertChecksum:"",MtagedMitmCertChecksum:"",CachedManagedSettings:"",init:function(){return chrome.storage.managed.get(null,function(e){console.log("Loading managed settings..."),chrome.storage.local.get(null,function(t){rr.processSettingsLoad(e,t),0!=rr.PolicyUpdateDetection&&rr.PolicyUpdateDetectionInterval>0&&chrome.storage.managed.get(null,function(e){rr.CachedManagedSettings=JSON.stringify(e),setInterval(rr.monitorPolicySettings,rr.PolicyUpdateDetectionInterval)})})}),!0},clearCachedCloudSettings:function(){chrome.storage.local.remove(["CloudUseMachineNameForUsername","CloudProxyAutoConfigScript","CloudSecurityGroupNames","CloudCaptivePortalDetection","CloudCaptivePortalMonitorInterval"],function(){var e=chrome.runtime.lastError;e&&console.error(e)})},loadCloudSettings:function(e){e&&void 0!=e&&0!==Object.keys(e).length&&(e.CloudGen4AutoLoginComputerOverridesUser&&void 0!=e.CloudGen4AutoLoginComputerOverridesUser&&""!=e.CloudGen4AutoLoginComputerOverridesUser&&(rr.Gen4AutoLoginComputerOverridesUser=e.CloudGen4AutoLoginComputerOverridesUser),e.CloudGen4ProxyAutoConfigurationScriptURL&&void 0!=e.CloudGen4ProxyAutoConfigurationScriptURL&&""!=e.CloudGen4ProxyAutoConfigurationScriptURL&&(rr.Gen4ProxyAutoConfigurationScriptURL=e.CloudGen4ProxyAutoConfigurationScriptURL),e.CloudGen4AutoLoginSecurityGroups&&void 0!=e.CloudGen4AutoLoginSecurityGroups&&""!=e.CloudGen4AutoLoginSecurityGroups&&(rr.Gen4AutoLoginSecurityGroups=e.CloudGen4AutoLoginSecurityGroups),e.CloudGen4AutoLoginRegistrationInterval&&void 0!=e.CloudGen4AutoLoginRegistrationInterval&&""!=e.CloudGen4AutoLoginRegistrationInterval&&(rr.Gen4AutoLoginRegistrationInterval=e.CloudGen4AutoLoginRegistrationInterval),e.CloudGen4AutoLoginCaptivePortalDetection&&void 0!=e.CloudGen4AutoLoginCaptivePortalDetection&&""!=e.CloudGen4AutoLoginCaptivePortalDetection&&(rr.Gen4AutoLoginCaptivePortalDetection=e.CloudGen4AutoLoginCaptivePortalDetection),e.CloudGen4AutoLoginCaptivePortalDetectionInterval&&void 0!=e.CloudGen4AutoLoginCaptivePortalDetectionInterval&&""!=e.CloudGen4AutoLoginCaptivePortalDetectionInterval&&(rr.Gen4AutoLoginCaptivePortalDetectionInterval=e.CloudGen4AutoLoginCaptivePortalDetectionInterval),e.CloudPolicyUpdateDetection&&void 0!=e.CloudPolicyUpdateDetection&&""!=e.CloudPolicyUpdateDetection&&(rr.PolicyUpdateDetection=e.CloudPolicyUpdateDetection),e.CloudPolicyUpdateDetectionInterval&&void 0!=e.CloudPolicyUpdateDetectionInterval&&""!=e.CloudPolicyUpdateDetectionInterval&&(rr.PolicyUpdateDetectionInterval=e.CloudPolicyUpdateDetectionInterval))},storeCloudSettings:function(e){chrome.storage.local.set(e,function(){console.log("Updated cloud settings."),chrome.storage.managed.get(null,function(e){console.log("Loading managed settings..."),chrome.storage.local.get(null,function(t){rr.extractSettings(e,t)})})})},processSettingsLoad:function(e,t){return chrome.runtime.lastError?(console.log("Error loading settings: "+chrome.runtime.lastError.message),ir.setChromeExtensionIcon(ce.ERROR),ir.init(),!1):0===Object.keys(e).length?(console.log("Failed to find settings. Settings length: "+Object.keys(e).length),ir.setChromeExtensionIcon(ce.ERROR),ir.init(),!1):(ir.setChromeExtensionIcon(ce.loggedIn),rr.extractSettings(e,t),void ir.init())},getSettingsString:function(e,t,r){return e[t]?"_"==e[t]?r:e[t]:r},getSettingsArray:function(e,t,r){return e[t]?e[t]:r},getSettingsURL:function(e,t,r){if(!e[t])return r;if("_"==e[t])return r;try{new URL(e[t]);return e[t]}catch(i){return console.error("Adjusting invalid URL value: "+e[t]+" : "+i.message),r}},getSettingsInt:function(e,t,r){return void 0===e[t]?r:parseInt(e[t])},getSettingsBool:function(e,t,r){return void 0===e[t]?r:e[t]},extractSettings:function(e,t){if(rr.WebSecurityKey=rr.getSettingsString(e,"WebSecurityKey",void 0),rr.WebSecurityHost=rr.getSettingsString(e,"WebSecurityHost",void 0),rr.WebSecurityCustomBlockPageURL=rr.getSettingsURL(e,"WebSecurityCustomBlockPageURL",""),rr.SSOSecurityKey=rr.getSettingsString(e,"SSOSecurityKey",void 0),rr.SSOHost=rr.getSettingsString(e,"SSOHost",void 0),rr.SSOBackupHost=rr.getSettingsString(e,"SSOBackupHost",void 0),rr.ChromeBridgeIP=rr.getSettingsString(e,"ChromeBridgeIP","100.115.92.0"),rr.HTTPPort=rr.getSettingsInt(e,"HTTPPort",8025),rr.HTTPSPort=rr.getSettingsInt(e,"HTTPSPort",8026),rr.NetIDPort=rr.getSettingsInt(e,"NetIDPort",8015),rr.SecureNetIDPort=rr.getSettingsInt(e,"SecureNetIDPort",8016),8015==rr.HTTPPort&&(rr.HTTPPort=8025),8016==rr.HTTPSPort&&(rr.HTTPSPort=8026),rr.UseSSL=rr.getSettingsBool(e,"UseSSL",!1),rr.AllowOffPremUsage=rr.getSettingsBool(e,"AllowOffPremUsage",!0),rr.FilterWhenOffPrem=rr.getSettingsBool(e,"FilterWhenOffPrem",!0),rr.SSOLoginIntervalMinutes=rr.getSettingsInt(e,"SSOLoginIntervalMinutes",void 0),rr.BlockOnUnsuccessfulConnection=rr.getSettingsBool(e,"BlockOnUnsuccessfulConnection",!1),rr.FilterPerformance=rr.getSettingsString(e,"FilterPerformance","HIGH"),rr.SendCompleteEmail=rr.getSettingsBool(e,"SendCompleteEmail",!0),rr.RunTimeMode=rr.getSettingsString(e,"RunTimeMode","normal"),rr.CompatibilityAppMode=rr.getSettingsString(e,"CompatibilityAppMode","pac"),rr.CompatibilityAppPluginID=rr.getSettingsString(e,"CompatibilityAppPluginID","oejigobjchedidhlafnpdpccihgbmbka"),"gen4_saml"===rr.RunTimeMode&&(rr.RunTimeMode="normal"),"edu"===rr.RunTimeMode&&(console.log("Running in EDU Mode"),rr.RunTimeMode="normal"),rr.Gen4ProxyHost=rr.getSettingsString(e,"Gen4ProxyHost",void 0),rr.Gen4ProxyPort=rr.getSettingsInt(e,"Gen4ProxyPort",8009),rr.PACServerPort=rr.getSettingsInt(e,"PACServerPort",9003),rr.PACServerPort<=65535&&rr.PACServerPort>=1024&&(rr.LocalProxyAutoConfigurationScriptURL="http://127.0.0.1:"+rr.PACServerPort+"/local.pac"),rr.Gen4ProxyBypass=rr.getSettingsArray(e,"Gen4ProxyBypass",[]),rr.Gen4AutoRegisterPort=rr.getSettingsInt(e,"Gen4AutoRegisterPort",8015),rr.Gen4AutoRegisterSecurePort=rr.getSettingsInt(e,"Gen4AutoRegisterSecurePort",8016),rr.Gen4ProxyAutoConfigurationScriptURL=rr.getSettingsString(e,"Gen4ProxyAutoConfigurationScriptURL",void 0),rr.Gen4AutoLoginSecurityGroups=rr.getSettingsString(e,"Gen4AutoLoginSecurityGroups",void 0),rr.Gen4AutoLoginComputerOverridesUser=rr.getSettingsInt(e,"Gen4AutoLoginComputerOverridesUser",0),rr.Gen4AutoLoginEncryptionRegistration=rr.getSettingsInt(e,"Gen4AutoLoginEncryptionRegistration",0),void 0!=rr.Gen4ProxyAutoConfigurationScriptURL&&""!=rr.Gen4ProxyAutoConfigurationScriptURL){var r=new URL(rr.Gen4ProxyAutoConfigurationScriptURL).hostname;void 0!=r&&""!=r&&rr.Gen4ProxyBypass.push(r)}return rr.Gen4ProxyMonitorInterval=rr.getSettingsInt(e,"Gen4ProxyMonitorInterval",5e3),rr.Gen4ProxyMonitorInterval<=5e3&&(rr.Gen4ProxyMonitorInterval=5e3),rr.Gen4AutoLoginRegistrationInterval=rr.getSettingsInt(e,"Gen4AutoLoginRegistrationInterval",3600),rr.ReloadTabs=rr.getSettingsBool(e,"ReloadTabs",!1),rr.Gen3AlwaysMobile=rr.getSettingsBool(e,"Gen3AlwaysMobile",!1),rr.Gen4AutoLoginCaptivePortalDetection=rr.getSettingsInt(e,"Gen4AutoLoginCaptivePortalDetection",0),rr.Gen4AutoLoginCaptivePortalDetectionInterval=rr.getSettingsInt(e,"Gen4AutoLoginCaptivePortalDetectionInterval",1e3),rr.Gen4AutoLoginCaptivePortalDetectionInterval<=0&&(rr.Gen4AutoLoginCaptivePortalDetectionInterval=1e3),rr.PolicyUpdateDetection=rr.getSettingsInt(e,"PolicyUpdateDetection",0),rr.PolicyUpdateDetectionInterval=rr.getSettingsInt(e,"PolicyUpdateDetectionInterval",6e4),rr.PolicyUpdateDetectionInterval<1e4&&(rr.PolicyUpdateDetectionInterval=1e4),rr.IpAddressResolutionInterval=rr.getSettingsInt(e,"IpAddressResolutionInterval",void 0),void 0==rr.IpAddressResolutionInterval&&(rr.IpAddressResolutionInterval=rr.getSettingsInt(e,"IpAddressCheckInterval",900)),rr.IpAddressResolutionInterval>=0&&rr.IpAddressResolutionInterval<180&&(rr.IpAddressResolutionInterval=180),rr.Gen4AutoLoginRegistrationInterval<=0&&(rr.Gen4AutoLoginRegistrationInterval=3600),rr.loadCloudSettings(t),!0},runtimeModeRequiresProxySettings:function(){return"gen4_auto"===rr.RunTimeMode},runtimeModeRequiresCloudRegistration:function(){return"gen4_auto"===rr.RunTimeMode&&"pac"===rr.CompatibilityAppMode},isEmptyGen4ProxyAutoConfigurationScriptURL:function(){return!rr.Gen4ProxyAutoConfigurationScriptURL||"_"===rr.Gen4ProxyAutoConfigurationScriptURL},monitorPolicySettings:function(){0!=rr.PolicyUpdateDetection&&chrome.storage.managed.get(null,function(e){var t=JSON.stringify(e);t!=rr.CachedManagedSettings&&(console.log("Detected parameter change. Initiating restart"),rr.CachedManagedSettings=t,chrome.runtime.reload())})}},Ae={ibossConnectStartTime:Date.now(),isInErrorState:!1,useLocalPac:!1,useDefaultLocalProxy:!1,disableRegistration:!1,currentIpAddress:"0.0.0.0",currentUsername:void 0,currentDeviceUUID:void 0,currentCloudRegistrationToken:void 0,currentCloudRegistrationTokenExpirationTime:void 0,ipExtractExp:new RegExp("^candidate:.+ (\\S+) \\d+ typ"),init:function(){ir.refreshUsername()},refreshUsername:function(){chrome.identity.getProfileUserInfo(function(e){if(null!==e&&null!==e.email&&e.email.length>0){rr.SendCompleteEmail?ir.currentUsername=e.email:ir.currentUsername=e.email.match(/^(.+)@/)[1],ir.currentUsername=ir.currentUsername.trim().toLowerCase();var t=ir.currentUsername+"-token";chrome.storage.local.get(t,function(e){ir.currentCloudRegistrationToken=e[t],ir.currentCloudRegistrationToken,tr.running?rr.runtimeModeRequiresCloudRegistration()&&sr.registerWithCloudGetUsernameCallback():tr.run()})}})},setCurrentUserCloudRegistrationToken:function(e,t,r){if(e&&t){ir.currentCloudRegistrationToken=t,ir.currentCloudRegistrationTokenExpirationTime=r;var i=e+"-ExpirationTime-token",o={};o[e+"-token"]=t,o[i]=r,chrome.storage.local.set(o,function(){})}},refreshIpAddress:function(){var e=new(window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection)({iceServers:[]}),t=ir.currentIpAddress;e.createDataChannel("",{reliable:!1}),e.createOffer(function(t){e.setLocalDescription(t)},function(e){}),e.onicecandidate=function(r){if(r&&r.candidate&&r.candidate.candidate){var i=ir.ipExtractExp.exec(r.candidate.candidate);if(i&&!(i.length<2)){var o=i[1],n=rr.ChromeBridgeIP.split("."),s=o.split(".");return o.match(/^10\./)||o.match(/^192\.168\./)||o.match(/^172\.((1[6-9])|(2[0-9])|(3[0-1]))/)||s[0]!==n[0]||s[1]!==n[1]||s[2]!==n[2]?(ir.currentIpAddress=o,e.close(),void(tr.running&&t.localeCompare(o)&&rr.runtimeModeRequiresCloudRegistration()&&sr.registerWithCloudGetIpAddressCallback())):void 0}}else e.close()}},refreshDeviceUUID:function(){try{chrome.enterprise.deviceAttributes.getDirectoryDeviceId(function(e){e?ir.currentDeviceUUID=e:ir.getAutoGeneratedDeviceUUID(),sr.registerWithCloudGetDeviceIdCallback()})}catch(e){console.log("Could not retrieve UUID from device for Cloud Connector registration. This device may not be joined to a Google domain. Exception: "+e),ir.getAutoGeneratedDeviceUUID(),sr.registerWithCloudGetDeviceIdCallback()}},getAutoGeneratedDeviceUUID:function(){chrome.storage.local.get("device-uuid",function(e){e&&e["device-uuid"]?ir.currentDeviceUUID=e["device-uuid"]:(console.log("Device UUID is not found in local storage, will generate new UUID."),ir.currentDeviceUUID=(new DeviceUUID).get(Date.now()),chrome.storage.local.set({"device-uuid":ir.currentDeviceUUID},function(){console.log("Generated and stored device UUID: "+ir.currentDeviceUUID)}))})},hasValidIpAddress:function(){return ir.currentIpAddress&&"0.0.0.0"!==ir.currentIpAddress},setChromeExtensionOverrideState:function(e,t,r,i,o,n){e===ce.LOGGED_OUT||e===ce.LOGGING_IN||e===ce.ON_OFF_PREM_CHECK||e===ce.LOGGED_IN||e===ce.ON_PREM||e===ce.HIDDEN||e===ce.ERROR||e===ce.GEN4?(e===ce.ERROR?ir.isInErrorState=!0:ir.isInErrorState=!1,ir.setChromeExtensionIcon(e),chrome.storage.local.set({overrideState:e}),t?chrome.storage.local.set({overrideStateError:t}):chrome.storage.local.remove("overrideStateError"),r?chrome.storage.local.set({overrideGroupNumber:r}):chrome.storage.local.remove("overrideGroupNumber"),i?chrome.storage.local.set({overrideGroupName:i}):chrome.storage.local.remove("overrideGroupName"),o?chrome.storage.local.set({overrideUsername:o}):chrome.storage.local.remove("overrideUsername"),e===ce.HIDDEN||e===ce.ON_PREM?(chrome.browserAction.setPopup({popup:""}),e===ce.HIDDEN?chrome.browserAction.setTitle({title:""}):e===ce.ON_PREM&&chrome.browserAction.setTitle({title:"On-Premise mode"})):(n||chrome.browserAction.setPopup({popup:"override.html"}),e===ce.LOGGED_OUT?chrome.browserAction.setTitle({title:"Request Override Login"}):e===ce.LOGGING_IN?chrome.browserAction.setTitle({title:"Override Login in Progress"}):e===ce.ON_OFF_PREM_CHECK?(chrome.browserAction.setTitle({title:"Location check in progress"}),chrome.browserAction.setPopup({popup:""})):e===ce.LOGGED_IN?chrome.browserAction.setTitle({title:"Override Login Active"}):e===ce.ERROR?chrome.browserAction.setTitle({title:"Cloud Connector Error - "+t}):e===ce.GEN4&&(chrome.browserAction.setTitle({title:ie}),chrome.browserAction.setPopup({popup:""})))):console.error("Invalid chromeExtensionOverrideState: "+e)},setChromeExtensionIcon:function(e){var t=document.createElement("canvas");t.width=19,t.height=19;var r=t.getContext("2d");window.blinkInterval&&clearInterval(window.blinkInterval);r.clearRect(0,0,t.width,t.height),r.lineCap="butt",r.lineJoin="miter",r.miterLimit=4,r.fillStyle={loggedIn:"#58863C",loggedOut:"#777777",hidden:"#777777",loggingIn:"#888888",onOffPremCheck:"#888888",error:"#AD1818",onPrem:"#58863C",gen4:"#58863C"}[e],r.beginPath(),r.moveTo(11.3,.5),r.bezierCurveTo(10.700000000000001,.4,10.100000000000001,.4,9.5,.4),r.bezierCurveTo(8.9,.4,8.3,.5,7.7,.5),r.lineTo(7.7,10.5),r.lineTo(11.4,10.5),r.lineTo(11.4,.5),r.closePath(),r.moveTo(13,1.4),r.lineTo(13,5.4),r.bezierCurveTo(14.4,6.4,15.4,7.9,15.4,9.7),r.bezierCurveTo(15.4,12.7,12.8,15.1,9.5,15.1),r.bezierCurveTo(6.199999999999999,15.1,3.5999999999999996,12.7,3.5999999999999996,9.7),r.bezierCurveTo(3.5999999999999996,7.8999999999999995,4.5,6.3999999999999995,6,5.3999999999999995),r.lineTo(6,1.3999999999999995),r.bezierCurveTo(2.5,2.7,0,5.9,0,9.7),r.bezierCurveTo(0,14.7,4.3,18.7,9.5,18.7),r.bezierCurveTo(14.7,18.7,19,14.7,19,9.7),r.bezierCurveTo(19,5.9,16.5,2.7,13,1.4),r.closePath(),r.fill(),"onPrem"===e&&(r.beginPath(),r.moveTo(10,15),r.lineTo(14,11),r.lineTo(18,15),r.lineTo(16,15),r.lineTo(16,18),r.lineTo(15,18),r.lineTo(15,16),r.lineTo(13,16),r.lineTo(13,18),r.lineTo(12,18),r.lineTo(12,15),r.fillStyle="#FFFF00",r.lineWidth=1,r.strokeStyle="#000000",r.stroke(),r.fill()),"loggingIn"!==e&&"onOffPremCheck"!==e||function(e){var r=.5;window.blinkInterval=window.setInterval(function(){e.clearRect(0,0,t.width,t.height),e.fillStyle="rgba(88,134,60,"+r+")",(r+=.03)>=1&&(r=.5),e.fill(),chrome.browserAction.setIcon({imageData:e.getImageData(0,0,19,19)})},100)}(r),chrome.browserAction.setIcon({imageData:r.getImageData(0,0,19,19)})}},be={isCaptivePortalMode:!1,currentNumberOfCaptivePortalCheckFailures:0,forceTabReload:!1,isOnError:!1,init:function(){ar.currentNumberOfCaptivePortalCheckFailures=0,1===rr.Gen4AutoLoginCaptivePortalDetection&&setInterval(ar.checkForCaptivePortal,rr.Gen4AutoLoginCaptivePortalDetectionInterval)},checkForCaptivePortal:function(){var e=new XMLHttpRequest;e.open("GET",se,!0),e.timeout=4e3;e.setRequestHeader("Cache-Control","no-cache"),e.onload=function(){4===e.readyState&&("Microsoft NCSI"===e.responseText?(1==ar.isCaptivePortalMode&&1==ar.isOnError&&1==rr.ReloadTabs&&(ar.forceTabReload=!0),ar.isOnError=!1,ar.currentNumberOfCaptivePortalCheckFailures=0,ar.isCaptivePortalMode=!1):(ar.currentNumberOfCaptivePortalCheckFailures++,ar.currentNumberOfCaptivePortalCheckFailures>=2&&(ar.isCaptivePortalMode=!0)))},e.onerror=function(){ar.currentNumberOfCaptivePortalCheckFailures++,ar.currentNumberOfCaptivePortalCheckFailures>=2&&(ar.isCaptivePortalMode=!0,ar.isOnError=!0)},e.ontimeout=function(){ar.currentNumberOfCaptivePortalCheckFailures++,ar.currentNumberOfCaptivePortalCheckFailures>=2&&(ar.isCaptivePortalMode=!0)},e.onabort=function(){ar.currentNumberOfCaptivePortalCheckFailures++,ar.currentNumberOfCaptivePortalCheckFailures>=2&&(ar.isCaptivePortalMode=!0)},e.send()}},we={isProxyEnabled:!1,isStartUp:!0,init:function(){if(ar.init(),"gen4_auto"==rr.RunTimeMode&&or.init(),rr.runtimeModeRequiresProxySettings()?(nr.isForwardProxyRunning()||ir.currentCloudRegistrationToken?nr.enableProxy():nr.disableProxy(),setInterval(nr.monitorProxySettingsAndNetwork,rr.Gen4ProxyMonitorInterval)):nr.disableProxy(),rr.IpAddressResolutionInterval>0&&"pac"==rr.CompatibilityAppMode){var e=1e3*rr.IpAddressResolutionInterval;setInterval(ir.refreshIpAddress,e)}},isCaptivePortalDetected:function(){return ar.isCaptivePortalMode},isForwardProxyRunning:function(){return ir.useLocalPac&&1==ir.useLocalPac&&ir.disableRegistration&&1==ir.disableRegistration},isDefaultProxy:function(){return nr.isForwardProxyRunning()&&ir.useDefaultLocalProxy},monitorProxySettingsAndNetwork:function(){rr.runtimeModeRequiresProxySettings()&&(ar.isCaptivePortalMode||!nr.isForwardProxyRunning()&&!ir.currentCloudRegistrationToken||sr.isFailingToRegister()?nr.isProxyEnabled&&nr.disableProxy():(nr.enableProxy(),1==ar.forceTabReload&&(i(),ar.forceTabReload=!1)))},disableProxy:function(){if(rr.runtimeModeRequiresProxySettings()){chrome.proxy.settings.set({value:{mode:"direct"},scope:"regular"},function(){nr.isProxyEnabled=!1})}},enableProxy:function(){if(rr.runtimeModeRequiresProxySettings()&&(nr.isForwardProxyRunning()||ir.currentCloudRegistrationToken)){if(nr.isProxyEnabled=!0,!nr.isForwardProxyRunning()&&rr.isEmptyGen4ProxyAutoConfigurationScriptURL()){if(!rr.Gen4ProxyHost)return void ir.setChromeExtensionOverrideState(ce.ERROR,"Gen4ProxyHost is undefined - cannot set proxy!");if(!rr.Gen4ProxyPort)return void ir.setChromeExtensionOverrideState(ce.ERROR,"Gen4ProxyPort is undefined - cannot set proxy!")}chrome.proxy.settings.get({incognito:!1},function(e){nr.areProxySettingsDifferentFromConfig(e)&&chrome.proxy.settings.clear({scope:"regular"},function(){var e=nr.getProxySettingsFromConfig();chrome.proxy.settings.set({value:e,scope:"regular"},function(){rr.ReloadTabs&&nr.isStartUp&&(i(),nr.isStartUp=!1)})}),ir.isInErrorState&&ir.setChromeExtensionOverrideState(ce.GEN4)})}},getProxySettingsFromConfig:function(){return nr.isForwardProxyRunning()?nr.isDefaultProxy()?{mode:"fixed_servers",rules:{singleProxy:{host:"127.0.0.1",port:rr.PACServerPort},bypassList:rr.Gen4ProxyBypass}}:{mode:"pac_script",pacScript:{url:rr.LocalProxyAutoConfigurationScriptURL,mandatory:!0}}:rr.isEmptyGen4ProxyAutoConfigurationScriptURL()?{mode:"fixed_servers",rules:{singleProxy:{host:rr.Gen4ProxyHost,port:rr.Gen4ProxyPort},bypassList:rr.Gen4ProxyBypass}}:{mode:"pac_script",pacScript:{url:rr.Gen4ProxyAutoConfigurationScriptURL,mandatory:!0}}},areProxySettingsDifferentFromConfig:function(e){if(!rr.runtimeModeRequiresProxySettings())return!1;var t=!0;if(nr.isForwardProxyRunning())e.value&&"pac_script"==e.value.mode&&e.value.pacScript.url==rr.LocalProxyAutoConfigurationScriptURL&&(t=!1);else if(rr.isEmptyGen4ProxyAutoConfigurationScriptURL()){if(e.value&&"fixed_servers"==e.value.mode&&e.value.rules.singleProxy&&e.value.rules.singleProxy.host==rr.Gen4ProxyHost&&e.value.rules.singleProxy.port==rr.Gen4ProxyPort){var r=0;if(e.value.rules.bypassList&&(r=e.value.rules.bypassList.length),rr.Gen4ProxyBypass.length==r){for(var i=0,o=0;o<rr.Gen4ProxyBypass.length;o++)for(var n=0;n<r;n++)if(rr.Gen4ProxyBypass[o]==e.value.rules.bypassList[n]){i++;break}i==rr.Gen4ProxyBypass.length&&(t=!1)}}}else e.value&&"pac_script"==e.value.mode&&e.value.pacScript.url==rr.Gen4ProxyAutoConfigurationScriptURL&&(t=!1);return t}},Re={previousRequestSuccessful:!0,sentFailsafeRequest:!1,init:function(){console.log("Monitoring: "+rr.Gen4ProxyMonitorInterval),console.log("Path: "+rr.LocalProxyAutoConfigurationScriptURL),setInterval(or.headPACFile,rr.Gen4ProxyMonitorInterval)},headPACFile:function(){var e=new XMLHttpRequest;or.previousRequestSuccessful||(rr.PACServerFailCount>2&&console.error("Compatibility app cannot be reached. Fail count: "+rr.PACServerFailCount),rr.PACServerFailCount++,chrome.management.launchApp(rr.CompatibilityAppPluginID),1==or.sentFailsafeRequest&&(console.log("Compatibility App is unresponsive. Restarting Compatability App"),chrome.management.setEnabled(rr.CompatibilityAppPluginID,!1,function(){chrome.management.setEnabled(rr.CompatibilityAppPluginID,!0)}))),or.previousRequestSuccessful=!1,or.sentFailsafeRequest=!1,rr.PACServerFailCount>rr.PACServerFailCountMax?(e.open("GET","http://127.0.0.1:"+String(rr.FailsafePACServerPort)+"/local.pac/checkin",!0),or.sentFailsafeRequest=!0,rr.PACServerFailCount=0):e.open("GET",rr.LocalProxyAutoConfigurationScriptURL+"/checkin",!0);var t=or.sentFailsafeRequest;e.setRequestHeader("Content-Type","application/json; charset=utf-8"),e.setRequestHeader("Cache-Control","no-cache, max-age:600"),e.timeout=5e3,e.onreadystatechange=function(){if(4===e.readyState&&(200===e.status&&e.getResponseHeader("content-length")>0&&(ir.useLocalPac=!0,or.previousRequestSuccessful=!0,rr.PACServerFailCount=0,e.responseText))){var r={};try{void 0!=(r=JSON.parse(e.responseText)).useDefaultLocalProxy&&"true"==r.useDefaultLocalProxy?ir.useDefaultLocalProxy=!0:ir.useDefaultLocalProxy=!1,void 0!=r.IsRestartNeeded&&"true"==r.IsRestartNeeded&&(console.log("Compatibility App requested restart. Restarting Compatability App"),chrome.management.setEnabled(rr.CompatibilityAppPluginID,!1,function(){chrome.management.setEnabled(rr.CompatibilityAppPluginID,!0)})),"proxy"==r.runtimeMode?(ir.disableRegistration=!0,"pac"==rr.CompatibilityAppMode&&(console.log("Extension is configured for pac, but app is running as proxy; changing compatibility mode to proxy"),rr.CompatibilityAppMode="proxy"),1==t&&(console.log("Compatibility App may have an incorrect port configuration. Restarting Compatability App"),chrome.management.setEnabled(rr.CompatibilityAppPluginID,!1,function(){chrome.management.setEnabled(rr.CompatibilityAppPluginID,!0)}))):"unknown"==r.runtimeMode?(console.log("Sending failsafe parameters to Compatibility App"),or.sendFailsafeParams(),rr.CompatibilityAppMode="proxy"):"proxy"==rr.CompatibilityAppMode&&(console.log("Extension is configured for proxy, but app is running as pac; changing compatibility mode to pac"),rr.CompatibilityAppMode="pac")}catch(e){}}chrome.runtime.sendMessage(rr.CompatibilityAppPluginID,"Hello from iboss cloud Enterprise"),"proxy"==rr.CompatibilityAppMode&&0==ir.disableRegistration&&console.error("Extension compatibility mode is set to proxy, but compatibility app cannot be reached.")},e.send(null)},sendFailsafeParams:function(){var e=new XMLHttpRequest,t={Gen4ProxyPort:rr.Gen4ProxyPort,Gen4ProxyAutoConfigurationScriptURL:rr.Gen4ProxyAutoConfigurationScriptURL,RunTimeMode:rr.RunTimeMode,Gen4AutoLoginComputerOverridesUser:rr.Gen4AutoLoginComputerOverridesUser,Gen4AutoLoginSecurityGroups:rr.Gen4AutoLoginSecurityGroups,WebSecurityKey:rr.WebSecurityKey,Gen4AutoLoginRegistrationInterval:rr.Gen4AutoLoginRegistrationInterval,Gen4AutoLoginCaptivePortalDetection:rr.Gen4AutoLoginCaptivePortalDetection,Gen4AutoLoginCaptivePortalDetectionInterval:rr.Gen4AutoLoginCaptivePortalDetectionInterval,PolicyUpdateDetection:rr.PolicyUpdateDetection,PolicyUpdateDetectionInterval:rr.PolicyUpdateDetectionInterval,ChromeBridgeIP:rr.ChromeBridgeIP,IpAddressCheckInterval:rr.IpAddressCheckInterval,PACServerPort:rr.PACServerPort,CompatibilityAppMode:rr.CompatibilityAppMode,Gen4AutoLoginEncryptionRegistration:rr.Gen4AutoLoginEncryptionRegistration,Gen4AutoRegisterPort:rr.Gen4AutoRegisterPort,Gen4AutoRegisterSecurePort:rr.Gen4AutoRegisterSecurePort,Gen4ProxyHost:rr.Gen4ProxyHost,GatewayLoadBalancing:rr.GatewayLoadBalancing},r="http://127.0.0.1:"+String(rr.FailsafePACServerPort)+"/local.pac/parameterExchange="+encodeURIComponent(JSON.stringify(t));e.open("GET",r,!0),e.setRequestHeader("Content-Type","application/json; charset=utf-8"),e.setRequestHeader("Cache-Control","no-cache, max-age:600"),e.timeout=5e3,e.onreadystatechange=function(){4===e.readyState&&(200===e.status&&(e.getResponseHeader("content-length")>0||console.error("Failsafe parameter exchange failure")))},e.send(null)}},Oe=!1,Ue={httpHeaderCache:new e(20),ibossLastSettings:void 0,locationOnPrem:"NO",locationOnPremCounter:0,webRequestCount:0,init:function(){ur.registerLoginAndLogoutListener(),ur.registerOnBeforeRequest(),ur.initMsgProcessing(),ur.monitorSWGState(),setInterval(ur.monitorSWGState,5e3),setTimeout(ur.refreshOnError,3e4)},PerformUrlFilteringResponse:function(){this.blockUrl=void 0,this.doRedirectUrl=void 0,this.redirectUrl=void 0,this.doHttpHeaderManipulation=void 0,this.httpHeaders=void 0,this.acceptExceptionRequests=void 0,this.loginAsDifferentUser=void 0,this.blockReason=void 0,this.groupName=void 0,this.groupNumber=void 0,this.errorCode=void 0,this.errorMessage=void 0},UrlExceptionRequest:function(){this.blockedUrl=void 0,this.reasonMessage=void 0,this.userEmail=void 0,this.securityKey=void 0,this.overrideUser=void 0,this.ipAddress=void 0},UrlExceptionResponse:function(){this.errorCode=void 0,this.errorMessage=void 0},RequestOverrideRequest:function(){this.username=void 0,this.password=void 0,this.userEmail=void 0,this.securityKey=void 0},RequestOverrideResponse:function(){this.securityKey=void 0,this.groupName=void 0,this.groupNumber=void 0,this.errorCode=void 0,this.errorMessage=void 0},RequestOverrideLogoutRequest:function(){this.userEmail=void 0,this.securityKey=void 0},NetIDLoginResponse:function(){this.errorCode=void 0,this.errorMessage=void 0},checkDeviceOffPremise:function(e){if(navigator.onLine&&!nr.isCaptivePortalDetected()){var t=new XMLHttpRequest;t.open("GET",ne,!0),t.timeout=4e3,t.setRequestHeader("Cache-Control","no-cache"),t.onload=function(){if(4===t.readyState){var r=t.responseURL;200===t.status&&(!r||-1==r.indexOf("/swg/")&&-1==r.indexOf("accounts.iboss.com/ibossauth/index.html")?r&&-1!=r.indexOf(ne)?e(!0):ur.determineOnOffPremViaNetID(e):e(!1))}},t.onerror=function(){ur.determineOnOffPremViaNetID(e)},t.ontimeout=function(){ur.determineOnOffPremViaNetID(e)},t.onabort=function(){ur.determineOnOffPremViaNetID(e)},t.send()}else e("NONET")},determineOnOffPremViaNetID:function(e){ur.sendIbossNetIDRequest(ir.currentUsername,function(t){e(!t&&void 0)})},sendIbossNetIDRequest:function(e,t,r){if(!rr||!rr.SSOSecurityKey||"_"===rr.SSOSecurityKey||!rr.SSOHost||"_"===rr.SSOHost)return console.error(H),void(t&&t(!1));if(r&&(!rr.SSOBackupHost||"_"===rr.SSOBackupHost))return console.error(N),void(t&&t(!1));if(!e||0===e.length)return console.error("No username found for NetID Login"),void(t&&t(!1));if(!navigator.onLine||nr.isCaptivePortalDetected())return console.log(T+D),void(t&&t(!1));var i;i=r?rr.UseSSL?"https://"+rr.SSOBackupHost+":"+rr.SecureNetIDPort+"/chromeNetId":"http://"+rr.SSOBackupHost+":"+rr.NetIDPort+"/chromeNetId":rr.UseSSL?"https://"+rr.SSOHost+":"+rr.SecureNetIDPort+"/chromeNetId":"http://"+rr.SSOHost+":"+rr.NetIDPort+"/chromeNetId",i+="?action=logon",i+="&user="+encodeURIComponent(e),i+="&key="+encodeURIComponent(rr.SSOSecurityKey);var o=new XMLHttpRequest;o.open("GET",i,!0),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.setRequestHeader("Cache-Control","no-cache"),o.timeout=5e3,o.onload=function(){if(4===o.readyState){var e=!1;200===o.status?"SUCCESS"!=o.responseText?console.error(T+o.responseText):e=!0:console.error(T+_),t&&t(e)}},o.onerror=function(){console.error(T+L),r?t&&t(!1):ur.sendIbossNetIDRequest(e,t,!0)},o.ontimeout=function(){r?t&&t(!1):ur.sendIbossNetIDRequest(e,t,!0)},o.onabort=function(){r?t&&t(!1):ur.sendIbossNetIDRequest(e,t,!0)},o.send()},checkUrlRequest:function(e,t,r){var i=new this.PerformUrlFilteringResponse;if(!navigator.onLine)return i.blockUrl=!1,i.errorMessage=D,i.errorCode=0,ur.checkUrlResponse(e,i,t,r);if(e.startsWith(ne))return i.blockUrl=!1,ur.checkUrlResponse(e,i,t,r);if(!rr){if(!ir.isInErrorState)return i.blockUrl=!1,i.errorMessage=U,i.errorCode=0,ur.checkUrlResponse(e,i,t,r);i.blockUrl=!1,i.errorMessage=z,i.errorCode=0}var o=void 0,n=void 0;if(rr.UseSSL?(rr.SSOHost&&"_"!=rr.SSOHost&&(o="https://"+rr.SSOHost+":"+rr.SecureNetIDPort),rr.WebSecurityHost&&"_"!=rr.WebSecurityHost&&(n="https://"+rr.WebSecurityHost+":"+rr.HTTPSPort)):(rr.SSOHost&&"_"!=rr.SSOHost&&(o="http://"+rr.SSOHost+":"+rr.NetIDPort),rr.WebSecurityHost&&"_"!=rr.WebSecurityHost&&(n="http://"+rr.WebSecurityHost+":"+rr.HTTPPort)),o&&e.startsWith(o)||n&&e.startsWith(n))return i.blockUrl=!1,ur.checkUrlResponse(e,i,t,r);if(!ur.locationOnPrem)return i.blockUrl=!1,i.errorMessage=G,i.errorCode=-1,ur.checkUrlResponse(e,i,t,r);if("YES"===ur.locationOnPrem)return i.blockUrl=!1,ur.checkUrlResponse(e,i,t,r);if(void 0!=rr.AllowOffPremUsage&&1!=rr.AllowOffPremUsage)return i.blockUrl=!0,i.errorMessage=k,i.errorCode=0,ur.checkUrlResponse(e,i,t,r);if(!rr.WebSecurityKey||"_"===rr.WebSecurityKey||!n)return i.blockUrl=!1,i.errorMessage=I,i.errorCode=0,ur.checkUrlResponse(e,i,t,r);var s=n+"/json/mobileClient/performUrlFiltering";s+="?securityKey="+encodeURIComponent(rr.WebSecurityKey),rr.OverrideUsername?(s+="&overrideRequest=true",s+="&userEmail="+encodeURIComponent(rr.OverrideUsername)):(s+="&overrideRequest=false",ir.currentUsername&&(s+="&userEmail="+encodeURIComponent(ir.currentUsername))),ir.hasValidIpAddress()&&(s+="&ipAddress="+encodeURIComponent(ir.currentIpAddress)),s+="&url="+encodeURIComponent(e);var a=Date.now()-ir.ibossConnectStartTime,u=!1;if(ur.isBadURL&&a<=5e3)return i.blockUrl=!1,i.errorMessage=U,i.errorCode=0,ur.checkUrlResponse(e,i,t,r);try{var c=new XMLHttpRequest;if(c.open("GET",s,!1),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),c.setRequestHeader("Cache-Control","no-cache"),c.send(),ur.isBadURL=!1,200===c.status){if((i=JSON.parse(c.responseText)).blockUrl||i.errorCode&&i.errorMessage)return 1===i.blockUrl?(i.blockUrl=!0,i.doRedirectUrl=!1,i.doHttpHeaderManipulation=!1):2===i.blockUrl?(i.blockUrl=!0,i.doRedirectUrl=!0,i.doHttpHeaderManipulation=!1):3===i.blockUrl?(i.blockUrl=!1,i.doRedirectUrl=!1,i.doHttpHeaderManipulation=!0):(i.blockUrl=!1,i.doRedirectUrl=!1,i.doHttpHeaderManipulation=!1),1===i.acceptExceptionRequests?i.acceptExceptionRequests=!0:i.acceptExceptionRequests=!1,1===i.loginAsDifferentUser?i.loginAsDifferentUser=!0:i.loginAsDifferentUser=!1,ur.ibossLastSettings=JSON.parse(JSON.stringify(rr)),ur.checkUrlResponse(e,i,t,r)}else 401!==c.status&&422!==c.status||!rr.OverrideUsername||ur.requestOverrideLogout(!1)}catch(e){ur.isBadURL=!0,u=!0}return u?void 0!=rr.BlockOnUnsuccessfulConnection?!1===rr.BlockOnUnsuccessfulConnection?i.blockUrl=!1:(i.blockUrl=!0,i.errorCode=0,i.errorMessage=L):(i.blockUrl=!1,i.errorMessage=$):(i.blockUrl=!1,i.errorMessage=_),ur.checkUrlResponse(e,i,t,r)},requestUrlException:function(e,t,r,i){if(rr&&rr.WebSecurityKey&&"_"!==rr.WebSecurityKey&&rr.WebSecurityHost&&"_"!==rr.WebSecurityHost)if(e&&0!==e.length)if(t&&0!==t.length){var o,n=new ur.UrlExceptionRequest;n.blockedUrl=e,n.securityKey=rr.WebSecurityKey,n.userEmail=t,ir.hasValidIpAddress()&&(n.ipAddress=ir.currentIpAddress),rr.OverrideUsername&&(n.overrideUser=rr.OverrideUsername),r&&r.length>0&&(n.reasonMessage=r),o=rr.UseSSL?"https://"+rr.WebSecurityHost+":"+rr.HTTPSPort+"/json/mobileClient/urlExceptionRequest":"http://"+rr.WebSecurityHost+":"+rr.HTTPPort+"/json/mobileClient/urlExceptionRequest";var s=new XMLHttpRequest;s.open("POST",o,!0),s.setRequestHeader("Content-Type","application/json; charset=utf-8"),s.setRequestHeader("Cache-Control","no-cache"),s.timeout=5e3,s.onload=function(){if(4===s.readyState&&(200===s.status||422===s.status))if("SUCCESS"===s.responseText)i(!0);else{var e=JSON.parse(s.responseText);ur.hasErrorResponse(e)&&i(ur.extractErrorMessage(e))}},s.onerror=function(){i(L)},s.ontimeout=function(){i(L)},s.onabort=function(){i("Connection Aborted")},s.send(JSON.stringify(n))}else i(F);else i("Invalid URL Exception request");else i("Unable to request a URL Exception at this time")},isValidOverrideLoginSettings:function(e){return!!(e&&e.WebSecurityKey&&"_"!==e.WebSecurityKey&&e.WebSecurityHost&&"_"!==e.WebSecurityHost)},requestOverrideLogin:function(e,t,r,i){if(!ur.isValidOverrideLoginSettings(rr)){if(!ur.isValidOverrideLoginSettings(ur.ibossLastSettings))return ir.setChromeExtensionOverrideState(ce.ERROR,"Unable to request an override at this time"),void i({retVal:void 0});rr=ur.ibossLastSettings}if(rr.OriginalWebSecurityKey)return ir.setChromeExtensionOverrideState(ce.ERROR,"An override session is already active"),void i({retVal:void 0});if(!e||0===e.length)return ir.setChromeExtensionOverrideState(ce.LOGGED_OUT),void i({retVal:"Please enter an override username"});if(!t||0===t.length)return ir.setChromeExtensionOverrideState(ce.LOGGED_OUT),void i({retVal:"Please enter an override password"});var o=parseInt(r);(!o||o<5)&&(o=5);var n,s=new ur.RequestOverrideRequest;s.username=e,s.password=t,s.userEmail=ir.currentUsername,s.securityKey=rr.WebSecurityKey,n=rr.UseSSL?"https://"+rr.WebSecurityHost+":"+rr.HTTPSPort+"/json/mobileClient/requestOverride":"http://"+rr.WebSecurityHost+":"+rr.HTTPPort+"/json/mobileClient/requestOverride";var a=new XMLHttpRequest;a.open("POST",n,!0),a.setRequestHeader("Content-Type","application/json; charset=utf-8"),a.setRequestHeader("Cache-Control","no-cache"),a.timeout=5e3,a.onload=function(){if(4===a.readyState)if(200===a.status||422===a.status||401===a.status){var t=JSON.parse(a.responseText);ur.hasErrorResponse(t)?(ir.setChromeExtensionOverrideState(ce.LOGGED_OUT),i({retVal:ur.extractErrorMessage(t)})):t.securityKey&&""!==t.securityKey&&t.groupName&&""!==t.groupName&&t.groupNumber&&0!==t.groupNumber?(rr.OverrideUsername=e,rr.OverrideGroupName=t.groupName,rr.OverrideGroupNumber=t.groupNumber,rr.OriginalWebSecurityKey=rr.WebSecurityKey,rr.WebSecurityKey=t.securityKey,chrome.alarms.create("overrideTimeoutAlarm",{delayInMinutes:o}),ir.setChromeExtensionOverrideState(ce.LOGGED_IN,void 0,t.groupNumber,t.groupName,e),i({retVal:void 0})):(ir.setChromeExtensionOverrideState(ce.LOGGED_OUT),i({retVal:_}))}else ir.setChromeExtensionOverrideState(ce.LOGGED_OUT),i({retVal:_})},a.onerror=function(){ir.setChromeExtensionOverrideState(ce.LOGGED_OUT),i({retVal:L})},a.ontimeout=function(){ir.setChromeExtensionOverrideState(ce.LOGGED_OUT),i({retVal:L})},a.onabort=function(){i({retVal:"Connection Aborted"})},a.send(JSON.stringify(s))},requestOverrideLogout:function(e){if(rr&&rr.WebSecurityHost&&"_"!=rr.WebSecurityHost){if(e){var t,r=new ur.RequestOverrideLogoutRequest;r.securityKey=rr.WebSecurityKey,rr.OverrideUsername?r.userEmail=rr.OverrideUsername:r.userEmail=ir.currentUsername,t=rr.UseSSL?"https://"+rr.WebSecurityHost+":"+rr.HTTPSPort+"/json/mobileClient/requestOverrideLogout":"http://"+rr.WebSecurityHost+":"+rr.HTTPPort+"/json/mobileClient/requestOverrideLogout";var i=new XMLHttpRequest;i.open("POST",t,!0),i.setRequestHeader("Content-Type","application/json; charset=utf-8"),i.setRequestHeader("Cache-Control","no-cache"),i.timeout=5e3,i.onload=function(){4===i.readyState&&200!=i.status&&console.error(M+"HTTP Status Code: "+i.status)},i.onerror=function(){console.error(M+L)},i.ontimeout=function(){console.error(M+L)},i.onabort=function(){console.error("Connection Aborted")},i.send(JSON.stringify(r))}rr.OriginalWebSecurityKey&&(rr.WebSecurityKey=rr.OriginalWebSecurityKey,rr.OriginalWebSecurityKey=void 0,"NO"==ur.locationOnPrem&&ir.setChromeExtensionOverrideState(ce.LOGGED_OUT)),rr.OverrideUsername=void 0,rr.OverrideGroupName=void 0,rr.OverrideGroupNumber=void 0,rr.OverrideExpirationTime=void 0,chrome.alarms.clear("overrideTimeoutAlarm")}},hasErrorResponse:function(e){return e.errorCode&&e.errorMessage},extractErrorMessage:function(e){var t="";return e.errorCode&&(t+=e.errorCode+" - "),t+=e.errorMessage},checkUrlResponse:function(e,t,r,i){if(t.doRedirectUrl&&!0===t.doRedirectUrl&&t.redirectUrl)return{redirectUrl:t.redirectUrl};if(t.doHttpHeaderManipulation&&!0===t.doHttpHeaderManipulation&&t.httpHeaders)return ur.httpHeaderCache.put(r.requestId,t.httpHeaders),{cancel:!1};if(!t.blockUrl)return{cancel:!1};if("main_frame"!=r.type)return{cancel:!0};var o=chrome.extension.getURL("/restricted.html");return i&&(o=i),o+="?bu="+encodeURIComponent(e),t.groupNumber&&(o+="&fn="+encodeURIComponent(t.groupNumber)),t.groupName&&(o+="&fp="+encodeURIComponent(t.groupName)),ir.hasValidIpAddress()&&(o+="&ip="+encodeURIComponent(ir.currentIpAddress)),rr.WebSecurityHost&&"_"!=rr.WebSecurityHost&&(o+="&ibip="+encodeURIComponent(rr.WebSecurityHost)),t.loginAsDifferentUser&&t.loginAsDifferentUser?o+="&ldu=1":o+="&ldu=0",t.acceptExceptionRequests&&t.acceptExceptionRequests?o+="&re=1":o+="&re=0",ir.currentUsername&&(o+="&ce="+encodeURIComponent(ir.currentUsername)),t.blockReason?o+="&bc="+encodeURIComponent(t.blockReason):ur.hasErrorResponse(t)&&(o+="&bc="+encodeURIComponent(ur.extractErrorMessage(t))),{redirectUrl:o}},refreshOnError:function(){ir.isInErrorState&&chrome.runtime.reload(),setTimeout(function(){ur.refreshOnError()},6e4)},monitorSWGState:function(){var e=void 0;if(rr)if(ur.locationOnPrem&&"YES"!=ur.locationOnPrem){if(rr.UseSSL?rr.WebSecurityHost&&"_"!=rr.WebSecurityHost&&(e="https://"+rr.WebSecurityHost+":"+rr.HTTPSPort):rr.WebSecurityHost&&"_"!=rr.WebSecurityHost&&(e="http://"+rr.WebSecurityHost+":"+rr.HTTPPort),e){var t=new XMLHttpRequest;t.open("HEAD",e,!0),t.setRequestHeader("Cache-Control","no-cache"),t.timeout=5e3,t.onload=function(){Oe=!1},t.onerror=function(){Oe=!0},t.ontimeout=function(){Oe=!0},t.onabort=function(){Oe=!0},t.send()}}else ur.isBadURL=!0},processMessage:function(e,t,r){if("CURRENT_USER_EMAIL"==e.type)r({retVal:ir.currentUsername});else if("CURRENT_USER_IP_ADDRESS"==e.type)r({retVal:ir.currentIpAddress});else{if("EXCEPTION_REQUEST"==e.type)return ur.requestUrlException(e.url,e.email,e.reason,r),!0;if("OVERRIDE_LOGIN"==e.type)return ir.setChromeExtensionOverrideState(ce.LOGGING_IN),ur.requestOverrideLogin(e.username,e.password,e.timeoutMinutes,r),!0;"OVERRIDE_LOGOUT"==e.type?ur.requestOverrideLogout(!0):console.error("Received unknown type of inter-extension message")}},initMsgProcessing:function(){chrome.runtime.onMessage.removeListener(ur.processMessage),chrome.runtime.onMessage.addListener(ur.processMessage),ur.initAlarmProcessing()},processAlarms:function(e){"overrideTimeoutAlarm"==e.name?ur.requestOverrideLogout(!0):"checkLocationAlarm"==e.name?ur.checkDeviceOffPremise(function(e){var t=e;void 0!==e&&"NONET"!==e||(void 0!=ur.locationOnPrem?ur.locationOnPremCounter<4?("NO"===ur.locationOnPrem?e=!0:"YES"===ur.locationOnPrem&&(e=!1),"NONET"!=t&&ur.locationOnPremCounter++):ur.locationOnPremCounter=0:e=!0),"1"==rr.AlwaysMobile?ur.locationOnPrem="NO":void 0===e||nr.isCaptivePortalDetected()?(ur.locationOnPrem="NO",chrome.alarms.clear("netIDLoginAlarm"),chrome.alarms.clear("checkLocationAlarm"),chrome.alarms.create("checkLocationAlarm",{when:Date.now()+5e3,periodInMinutes:10}),ir.setChromeExtensionOverrideState(ce.ON_OFF_PREM_CHECK)):e?(ur.locationOnPrem="NO",chrome.alarms.clear("netIDLoginAlarm"),rr.OriginalWebSecurityKey?ir.setChromeExtensionOverrideState(ce.LOGGED_IN):ir.setChromeExtensionOverrideState(ce.LOGGED_OUT)):rr?(ur.locationOnPrem="YES",chrome.alarms.get("netIDLoginAlarm",function(e){var t=10;rr&&rr.SSOLoginIntervalMinutes&&(t=rr.SSOLoginIntervalMinutes),e&&e.periodInMinutes==t||!rr.SSOHost||"_"==rr.SSOHost||(chrome.alarms.clear("netIDLoginAlarm"),chrome.alarms.create("netIDLoginAlarm",{when:Date.now(),periodInMinutes:t}))}),ir.setChromeExtensionOverrideState(ce.ON_PREM),rr.OriginalWebSecurityKey&&ur.requestOverrideLogout(!0)):ir.setChromeExtensionOverrideState(ce.HIDDEN)}):"netIDLoginAlarm"==e.name&&ur.sendIbossNetIDRequest(ir.currentUsername)},restartLocationNetIDAlarms:function(e){chrome.alarms.clear("checkLocationAlarm"),chrome.alarms.clear("netIDLoginAlarm"),(void 0==e||e)&&(rr&&rr.SSOHost&&"_"!=rr.SSOHost&&rr.SSOSecurityKey&&"_"!=rr.SSOSecurityKey?(ir.setChromeExtensionIcon(ce.ON_OFF_PREM_CHECK),chrome.alarms.create("checkLocationAlarm",{when:Date.now(),periodInMinutes:10})):ur.locationOnPrem="NO")},processNetworkStateChange:function(){navigator.onLine&&ur.restartLocationNetIDAlarms(!0)},initAlarmProcessing:function(){chrome.alarms.onAlarm.removeListener(ur.processAlarms),chrome.alarms.onAlarm.addListener(ur.processAlarms),ur.restartLocationNetIDAlarms(!0),window.removeEventListener("online",ur.processNetworkStateChange,!1),window.removeEventListener("offline",ur.processNetworkStateChange,!1),window.addEventListener("online",ur.processNetworkStateChange,!1),window.addEventListener("offline",ur.processNetworkStateChange,!1),ur.initIdleStateProcessing()},processIdleStateUpdate:function(e){"active"==e?ur.restartLocationNetIDAlarms(!0):"idle"!=e&&"locked"!=e||ur.restartLocationNetIDAlarms(!1)},initIdleStateProcessing:function(){chrome.idle.setDetectionInterval(120),chrome.idle.onStateChanged.removeListener(ur.processIdleStateUpdate),chrome.idle.onStateChanged.addListener(ur.processIdleStateUpdate),ur.afterRedirectorInit()},isValidAfterRedirectSettings:function(e){return!!(e&&(e.SSOHost&&"_"!=e.SSOHost||e.WebSecurityHost&&"_"!=e.WebSecurityHost)&&(e.SSOSecurityKey&&"_"!=e.SSOSecurityKey||e.WebSecurityKey&&"_"!=e.WebSecurityKey))},afterRedirectorInit:function(){if(!ur.isValidAfterRedirectSettings(rr)){if(!ur.isValidAfterRedirectSettings(ur.ibossLastSettings))return void ir.setChromeExtensionOverrideState(ce.ERROR,"Setup information not received",void 0,void 0,void 0,!0);rr=ur.ibossLastSettings}ir.currentUsername?ir.setChromeExtensionOverrideState(ce.ON_OFF_PREM_CHECK):ir.setChromeExtensionOverrideState(ce.ERROR,E,void 0,void 0,void 0,!0)},registerLoginAndLogoutListener:function(){chrome.identity.onSignInChanged.addListener(function(e,t){t&&ir.refreshUsername()})},registerOnBeforeRequest:function(){chrome.webRequest.onBeforeRequest.addListener(function(e){var t=e.url;if(rr.FilterPerformance&&("MEDIUM"==rr.FilterPerformance||"HIGH"==rr.FilterPerformance)){if("script"==e.type||"xmlhttprequest"==e.type)return{cancel:!1};if("HIGH"==rr.FilterPerformance){if("object"==e.type||"other"==e.type)return{cancel:!1};if("image"==e.type&&-1==t.indexOf("images?q=tbn"))return{cancel:!1}}}if(ur.locationOnPrem&&"YES"===ur.locationOnPrem||nr.isCaptivePortalDetected()||0==t.indexOf(ne)||0==t.indexOf(oe)||void 0!=rr.AllowOffPremUsage&&!0===rr.AllowOffPremUsage&&!1===rr.FilterWhenOffPrem||0==t.indexOf(chrome.extension.getURL(""))||0==t.indexOf("https://www.googleapis.com/")||0==t.indexOf("http://www.gstatic.com/")||-1!=t.indexOf("googleusercontent.com/crx/blobs"))return{cancel:!1};var r=void 0,i=void 0,o=void 0,n=void 0;if(rr.UseSSL?(rr.SSOHost&&"_"!=rr.SSOHost&&(r="https://"+rr.SSOHost+":"+rr.SecureNetIDPort),rr.SSOBackupHost&&"_"!=rr.SSOBackupHost&&(i="https://"+rr.SSOBackupHost+":"+rr.SecureNetIDPort),rr.WebSecurityHost&&"_"!=rr.WebSecurityHost&&(o="https://"+rr.WebSecurityHost+":"+rr.HTTPSPort)):(rr.SSOHost&&"_"!=rr.SSOHost&&(r="http://"+rr.SSOHost+":"+rr.NetIDPort),rr.SSOBackupHost&&"_"!=rr.SSOBackupHost&&(i="http://"+rr.SSOBackupHost+":"+rr.NetIDPort),rr.WebSecurityHost&&"_"!=rr.WebSecurityHost&&(o="http://"+rr.WebSecurityHost+":"+rr.HTTPPort)),rr.WebSecurityCustomBlockPageURL&&"_"!=rr.WebSecurityCustomBlockPageURL&&""!=rr.WebSecurityCustomBlockPageURL&&(n=rr.WebSecurityCustomBlockPageURL),r&&t.startsWith(r)||i&&t.startsWith(i)||o&&t.startsWith(o)||n&&t.startsWith(n))return{cancel:!1};if(!ur.locationOnPrem){var s=chrome.extension.getURL("/loader.html");return{redirectUrl:s+="?rl="+t}}return ur.checkUrlRequest(t,e,n)},{urls:["<all_urls>"],types:["main_frame","sub_frame","script","image","object","xmlhttprequest","other"]},["blocking"])},registerOnBeforeSendHeaders:function(){chrome.webRequest.onBeforeSendHeaders.addListener(function(e){},{urls:["<all_urls>"],types:["main_frame","sub_frame","script","image","object","xmlhttprequest","other"]},["blocking","requestHeaders"])}},Ie={init:function(){cr.registerOnAuthRequired(),cr.registerLoginAndLogoutListener()},registerLoginAndLogoutListener:function(){chrome.identity.onSignInChanged.addListener(function(e,t){t&&sr.reRegisterWithCloud()})},registerOnAuthRequired:function(){chrome.webRequest.onAuthRequired.addListener(cr.onAuthRequired,{urls:["<all_urls>"]},["blocking"])},onAuthRequired:function(e){return e.isProxy&&e.realm?-1==e.realm.indexOf("iboss")?{}:nr.isForwardProxyRunning()?{cancel:!0}:ir.currentCloudRegistrationToken?{authCredentials:{username:ir.currentCloudRegistrationToken,password:"ibssoid"}}:{cancel:!0}:{}}},Ee={running:!1,init:function(){console.log("Starting iboss cloud connector..."),rr.init()},run:function(){console.log("Finalizing iboss cloud connector startup at "+new Date),tr.running=!0,sr.init(),"gen4_auto"===rr.RunTimeMode?cr.init():ur.init(),nr.init()}},Le={hasRegisteredToCloud:!1,failedCloudConnectAttempts:0,init:function(){if(rr.runtimeModeRequiresCloudRegistration()){sr.registerWithCloud();var e=1e3*rr.Gen4AutoLoginRegistrationInterval;e>0&&setInterval(sr.registerOnInterval,e)}},isFailingToRegister:function(){return tr.failedCloudConnectAttempts>=2},registerOnInterval:function(){ir.disableRegistration||sr.hasRegisteredToCloud&&sr.registerWithCloud()},getRegistrationParameters:function(e,r,i){var o=e+";"+rr.WebSecurityKey+";"+e;return rr.Gen4AutoLoginSecurityGroups?o+=";"+rr.Gen4AutoLoginSecurityGroups:o+=";",o+=";"+rr.Gen4AutoLoginComputerOverridesUser+";"+i+";;;;Unavailable;"+r+";"+t()+";"+u+";;;;;chromebook;1;"+rr.MitmCertChecksum+";"+rr.StagedMitmCertChecksum+";;"},getRequestUrl:function(e,t,r){var i=sr.getRegistrationParameters(e,t,r),o="https://"+rr.Gen4ProxyHost+":"+rr.Gen4AutoRegisterSecurePort+m;if("gen4_auto"==rr.RunTimeMode&&0==rr.Gen4AutoRegisterSecurePort&&(o="http://"+rr.Gen4ProxyHost+":"+rr.Gen4AutoRegisterPort+m),rr.Gen4AutoLoginEncryptionRegistration){var n=new Te(p,"cbc").encrypt(i,p.length,f);o=o+"v2c="+encodeURIComponent(n.toString("base64"))}else o+=encodeURIComponent(i);return o},reRegisterWithCloud:function(){ir.disableRegistration||(sr.hasRegisteredToCloud=!1,sr.failedCloudConnectAttempts=0,sr.registerWithCloud())},registerWithCloud:function(){ir.disableRegistration||rr.runtimeModeRequiresCloudRegistration()&&ir.refreshUsername()},registerWithCloudGetUsernameCallback:function(){ir.refreshDeviceUUID()},registerWithCloudGetIpAddressCallback:function(){ir.refreshDeviceUUID()},registerWithCloudGetDeviceIdCallback:function(){sr.registerWithCloudPerformRequest()},updateSettingsFromCloudRegResponse:function(e){if(console.log("Updating settings from cloud registration response..."),!e||void 0==e)return console.log("Registration response does not include settings data."),!1;var t=!1,r=atob(e),i=JSON.parse(r);console.log("Decoded agent settings from cloud reg response: "+r);var o={CloudGen4AutoLoginComputerOverridesUser:rr.Gen4AutoLoginComputerOverridesUser,CloudGen4ProxyAutoConfigurationScriptURL:rr.Gen4ProxyAutoConfigurationScriptURL,CloudGen4AutoLoginSecurityGroups:rr.Gen4AutoLoginSecurityGroups,CloudGen4AutoLoginRegistrationInterval:rr.Gen4AutoLoginRegistrationInterval,CloudGen4AutoLoginCaptivePortalDetection:rr.Gen4AutoLoginCaptivePortalDetection,CloudGen4AutoLoginCaptivePortalDetectionInterval:rr.Gen4AutoLoginCaptivePortalDetectionInterval,CloudPolicyUpdateDetection:rr.PolicyUpdateDetection,CloudPolicyUpdateDetectionInterval:rr.PolicyUpdateDetectionInterval};return void 0!=i.UseMachineNameForUsername&&-1!=i.UseMachineNameForUsername&&rr.Gen4AutoLoginComputerOverridesUser!=i.UseMachineNameForUsername&&(console.log("Updating UseMachineNameForUsername from cloud registration response."),o.CloudGen4AutoLoginComputerOverridesUser=i.UseMachineNameForUsername,t=!0,!0),void 0!=i.ProxyAutoConfigScript&&"__NO_CHANGE__"!=i.ProxyAutoConfigScript&&rr.Gen4ProxyAutoConfigurationScriptURL!=i.ProxyAutoConfigScript&&(console.log("Updating AutoProxyURL from cloud registration response."),o.CloudGen4ProxyAutoConfigurationScriptURL=i.ProxyAutoConfigScript,t=!0),void 0!=i.SecurityGroupNames&&"__NO_CHANGE__"!=i.SecurityGroupNames&&rr.Gen4AutoLoginSecurityGroups!=i.SecurityGroupNames&&(console.log("Updating SecurityGroupNames from cloud registration response."),o.CloudGen4AutoLoginSecurityGroups=i.SecurityGroupNames,t=!0,!0),void 0!=i.RegistrationInterval&&-1!=i.RegistrationInterval&&rr.Gen4AutoLoginRegistrationInterval!=i.RegistrationInterval&&(console.log("Updating RegistrationInterval from cloud registration response."),o.CloudGen4AutoLoginRegistrationInterval=i.RegistrationInterval,t=!0),void 0!=i.CaptivePortalDetection&&-1!=i.CaptivePortalDetection&&rr.Gen4AutoLoginCaptivePortalDetection!=i.CaptivePortalDetection&&(console.log("Updating CaptivePortalDetection from cloud registration response."),o.CloudGen4AutoLoginCaptivePortalDetection=i.CaptivePortalDetection,t=!0),void 0!=i.CaptivePortalDetection&&i.CaptivePortalDetection>0&&rr.Gen4AutoLoginCaptivePortalDetectionInterval!=i.CaptivePortalMonitorInterval&&(console.log("Updating CaptivePortalDetectionInterval from cloud registration response."),i.CaptivePortalMonitorInterval<1e3&&(i.CaptivePortalMonitorInterval=1e3),o.CloudGen4AutoLoginCaptivePortalDetectionInterval=i.CaptivePortalMonitorInterval,t=!0),void 0!=i.PolicyUpdateDetection&&-1!=i.PolicyUpdateDetection&&rr.PolicyUpdateDetection!=i.PolicyUpdateDetection&&(console.log("Updating PolicyUpdateDetection from cloud registration response."),o.CloudPolicyUpdateDetection=i.PolicyUpdateDetection,t=!0),void 0!=i.PolicyUpdateDetection&&i.PolicyUpdateDetection>0&&rr.PolicyUpdateDetectionInterval!=i.PolicyUpdateDetectionInterval&&(console.log("Updating PolicyUpdateDetectionInterval from cloud registration response."),i.PolicyUpdateDetectionInterval<1e4&&(i.PolicyUpdateDetectionInterval=1e4),o.CloudPolicyUpdateDetectionInterval=i.PolicyUpdateDetectionInterval,t=!0),t&&rr.storeCloudSettings(o),t},registerWithCloudPerformRequest:function(){if(!ir.disableRegistration&&rr.runtimeModeRequiresCloudRegistration()){var e=ir.currentUsername,t=ir.currentDeviceUUID,r=ir.currentIpAddress;r||(r="0.0.0.0");var i=sr.getRequestUrl(e,t,r),o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===this.readyState){var t={};try{t=JSON.parse(o.responseText)}catch(e){t.success=0}200===this.status&&t.success&&t.sessionKey?(t.agentSettings&&sr.updateSettingsFromCloudRegResponse(t.agentSettings),ir.setCurrentUserCloudRegistrationToken(e,t.sessionKey),sr.failedCloudConnectAttempts=0,sr.hasRegisteredToCloud=!0):sr.isFailingToRegister()||(sr.failedCloudConnectAttempts++,setTimeout(sr.registerWithCloud,1e3))}},o.open("GET",i,!0),o.send()}}},xe=e=>Array.isArray(e)?e.slice():[...ot.from(e)];const De=[16,24,32],ke={16:{16:10,24:12,32:14},24:{16:12,24:12,32:14},32:{16:14,24:14,32:14}};class Ge{constructor(e){let t=e.length;if(!De.includes(t))throw"Unsupported key size: "+8*t+"bit";this.key=xe(e),this.keySize=t}ExpandKey(e){let t=this.key.length,r=ke[e][t],i=new Array((r+1)*e);for(let e=0;e<t;e++)i[e]=this.key[e];let o=0;for(let e=t;e<i.length;e+=4){let r=i.slice(e-4,e);if(e%t==0&&(r=[Me[r[1]]^He[o],Me[r[2]],Me[r[3]],Me[r[0]]],o++),e%t<16)for(let o=0;o<4;o++)i[e+o]=i[e-t+o]^r[o];if(16!==t)if(32===t&&e%t==16){r=[Me[r[0]],Me[r[1]],Me[r[2]],Me[r[3]]];for(let o=0;o<4;o++)i[e+o]=i[e-t+o]^r[o]}else for(let o=0;o<4;o++)i[e+o]=i[e-t+o]^r[o]}return i}AddRoundKey(e,t,r){let i=e.length;for(let o=0;o<i;o++)e[o]^=t[r*i+o]}SubBytes(e){for(let t=0;t<e.length;t++)e[t]=Me[e[t]]}SubBytesReversed(e){for(let t=0;t<e.length;t++)e[t]=Me.indexOf(e[t])}ShiftRows(e){let t=[];for(let r=0;r<e.length;r++)t[r]=e[Ne[e.length][r]];for(let r=0;r<e.length;r++)e[r]=t[r]}ShiftRowsReversed(e){let t=[];for(let r=0;r<e.length;r++)t[r]=e[Ne[e.length].indexOf(r)];for(let r=0;r<e.length;r++)e[r]=t[r]}MixColumns(e){for(let t=0;t<e.length;t+=4){let r=e.slice(t,t+4),i=[We[r[0]]^Be[r[1]]^r[2]^r[3],r[0]^We[r[1]]^Be[r[2]]^r[3],r[0]^r[1]^We[r[2]]^Be[r[3]],Be[r[0]]^r[1]^r[2]^We[r[3]]];e[t+0]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3]}}MixColumnsReversed(e){for(let t=0;t<e.length;t+=4){let r=e.slice(t,t+4),i=[Ve[r[0]]^qe[r[1]]^Ke[r[2]]^Fe[r[3]],Fe[r[0]]^Ve[r[1]]^qe[r[2]]^Ke[r[3]],Ke[r[0]]^Fe[r[1]]^Ve[r[2]]^qe[r[3]],qe[r[0]]^Ke[r[1]]^Fe[r[2]]^Ve[r[3]]];e[t+0]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3]}}encrypt(e){let t=xe(e),r=t.length,i=this.keySize,o=ke[r][i];if(!De.includes(r))throw"Unsupported block size: "+8*r+"bit";let n=t.slice(),s=this.ExpandKey(r);this.AddRoundKey(n,s,0);for(let e=1;e<o;e++)this.SubBytes(n),this.ShiftRows(n),this.MixColumns(n),this.AddRoundKey(n,s,e);return this.SubBytes(n),this.ShiftRows(n),this.AddRoundKey(n,s,o),n}decrypt(e){let t=xe(e),r=t.length,i=this.keySize,o=ke[r][i];if(!De.includes(r))throw"Unsupported block size: "+8*r+"bit";let n=t.slice(),s=this.ExpandKey(r);this.AddRoundKey(n,s,o),this.ShiftRowsReversed(n),this.SubBytesReversed(n);for(let e=o-1;1<=e;e--)this.AddRoundKey(n,s,e),this.MixColumnsReversed(n),this.ShiftRowsReversed(n),this.SubBytesReversed(n);return this.AddRoundKey(n,s,0),n}}const _e=["ecb","cbc"];class Te{constructor(e,t){let r=e.length;if(!De.includes(r))throw`Unsupported key size: ${8*r} bit`;if(!_e.includes(t))throw`Unsupported mode: ${t}`;this.key=xe(e),this.keySize=r,this.mode=t}encrypt(e,t,r){if((t=parseInt(t))<=32&&!De.includes(t))throw`Unsupported block size: ${8*t} bit`;if(32<t&&(t/=8,!De.includes(t)))throw`Unsupported block size: ${t} bit`;if("cbc"===this.mode){if(!r)throw`IV is required for mode ${this.mode}`;if(r.length!==t)throw`IV size should match with block size (${8*t} bit)`}let i=xe(e),o=i.length%t;for(0!==o&&(o=t-o);o-- >0;)i.push(0);let n=i.length/t,s=new Array(i.length),a=new Ge(this.key);switch(this.mode){case"ecb":for(let e=0;e<n;e++){let r=e*t,o=(e+1)*t,n=i.slice(r,o),u=a.encrypt(n);for(let e=0;e<t;e++)s[r+e]=u[e]}break;case"cbc":let e=xe(r);for(let r=0;r<n;r++){let o=r*t,n=(r+1)*t,u=i.slice(o,n);for(let r=0;r<t;r++)u[r]^=e[r];let c=a.encrypt(u);for(let e=0;e<t;e++)s[o+e]=c[e];e=c.slice()}}return ot.from(s)}decrypt(e,t,r){if((t=parseInt(t))<=32&&!De.includes(t))throw`Unsupported block size: ${8*t} bit`;if(32<t&&(t/=8,!De.includes(t)))throw`Unsupported block size: ${t} bit`;if("cbc"===this.mode){if(!r)throw`IV is required for mode ${this.mode}`;if(r.length!==t)throw`IV size should match with block size (${8*t} bit)`}let i=xe(e);if(i.length%t!=0)throw`Ciphertext length should be multiple of ${8*t} bit`;let o=i.length/t,n=new Array(i.length),s=new Ge(this.key);switch(this.mode){case"ecb":for(let e=0;e<o;e++){let r=e*t,o=(e+1)*t,a=i.slice(r,o),u=s.decrypt(a);for(let e=0;e<t;e++)n[r+e]=u[e]}break;case"cbc":let e=xe(r);for(let r=0;r<o;r++){let o=r*t,a=(r+1)*t,u=i.slice(o,a),c=s.decrypt(u);for(let r=0;r<t;r++)n[o+r]=c[r]^e[r];e=u.slice()}}return ot.from(n)}}const Me=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],He=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Ne={16:[0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11],24:[0,5,10,15,4,9,14,19,8,13,18,23,12,17,22,3,16,21,2,7,20,1,6,11],32:[0,5,14,19,4,9,18,23,8,13,22,27,12,17,26,31,16,21,30,3,20,25,2,7,24,29,6,11,28,1,10,15]},We=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254,27,25,31,29,19,17,23,21,11,9,15,13,3,1,7,5,59,57,63,61,51,49,55,53,43,41,47,45,35,33,39,37,91,89,95,93,83,81,87,85,75,73,79,77,67,65,71,69,123,121,127,125,115,113,119,117,107,105,111,109,99,97,103,101,155,153,159,157,147,145,151,149,139,137,143,141,131,129,135,133,187,185,191,189,179,177,183,181,171,169,175,173,163,161,167,165,219,217,223,221,211,209,215,213,203,201,207,205,195,193,199,197,251,249,255,253,243,241,247,245,235,233,239,237,227,225,231,229],Be=[0,3,6,5,12,15,10,9,24,27,30,29,20,23,18,17,48,51,54,53,60,63,58,57,40,43,46,45,36,39,34,33,96,99,102,101,108,111,106,105,120,123,126,125,116,119,114,113,80,83,86,85,92,95,90,89,72,75,78,77,68,71,66,65,192,195,198,197,204,207,202,201,216,219,222,221,212,215,210,209,240,243,246,245,252,255,250,249,232,235,238,237,228,231,226,225,160,163,166,165,172,175,170,169,184,187,190,189,180,183,178,177,144,147,150,149,156,159,154,153,136,139,142,141,132,135,130,129,155,152,157,158,151,148,145,146,131,128,133,134,143,140,137,138,171,168,173,174,167,164,161,162,179,176,181,182,191,188,185,186,251,248,253,254,247,244,241,242,227,224,229,230,239,236,233,234,203,200,205,206,199,196,193,194,211,208,213,214,223,220,217,218,91,88,93,94,87,84,81,82,67,64,69,70,79,76,73,74,107,104,109,110,103,100,97,98,115,112,117,118,127,124,121,122,59,56,61,62,55,52,49,50,35,32,37,38,47,44,41,42,11,8,13,14,7,4,1,2,19,16,21,22,31,28,25,26],Fe=[0,9,18,27,36,45,54,63,72,65,90,83,108,101,126,119,144,153,130,139,180,189,166,175,216,209,202,195,252,245,238,231,59,50,41,32,31,22,13,4,115,122,97,104,87,94,69,76,171,162,185,176,143,134,157,148,227,234,241,248,199,206,213,220,118,127,100,109,82,91,64,73,62,55,44,37,26,19,8,1,230,239,244,253,194,203,208,217,174,167,188,181,138,131,152,145,77,68,95,86,105,96,123,114,5,12,23,30,33,40,51,58,221,212,207,198,249,240,235,226,149,156,135,142,177,184,163,170,236,229,254,247,200,193,218,211,164,173,182,191,128,137,146,155,124,117,110,103,88,81,74,67,52,61,38,47,16,25,2,11,215,222,197,204,243,250,225,232,159,150,141,132,187,178,169,160,71,78,85,92,99,106,113,120,15,6,29,20,43,34,57,48,154,147,136,129,190,183,172,165,210,219,192,201,246,255,228,237,10,3,24,17,46,39,60,53,66,75,80,89,102,111,116,125,161,168,179,186,133,140,151,158,233,224,251,242,205,196,223,214,49,56,35,42,21,28,7,14,121,112,107,98,93,84,79,70],qe=[0,11,22,29,44,39,58,49,88,83,78,69,116,127,98,105,176,187,166,173,156,151,138,129,232,227,254,245,196,207,210,217,123,112,109,102,87,92,65,74,35,40,53,62,15,4,25,18,203,192,221,214,231,236,241,250,147,152,133,142,191,180,169,162,246,253,224,235,218,209,204,199,174,165,184,179,130,137,148,159,70,77,80,91,106,97,124,119,30,21,8,3,50,57,36,47,141,134,155,144,161,170,183,188,213,222,195,200,249,242,239,228,61,54,43,32,17,26,7,12,101,110,115,120,73,66,95,84,247,252,225,234,219,208,205,198,175,164,185,178,131,136,149,158,71,76,81,90,107,96,125,118,31,20,9,2,51,56,37,46,140,135,154,145,160,171,182,189,212,223,194,201,248,243,238,229,60,55,42,33,16,27,6,13,100,111,114,121,72,67,94,85,1,10,23,28,45,38,59,48,89,82,79,68,117,126,99,104,177,186,167,172,157,150,139,128,233,226,255,244,197,206,211,216,122,113,108,103,86,93,64,75,34,41,52,63,14,5,24,19,202,193,220,215,230,237,240,251,146,153,132,143,190,181,168,163],Ke=[0,13,26,23,52,57,46,35,104,101,114,127,92,81,70,75,208,221,202,199,228,233,254,243,184,181,162,175,140,129,150,155,187,182,161,172,143,130,149,152,211,222,201,196,231,234,253,240,107,102,113,124,95,82,69,72,3,14,25,20,55,58,45,32,109,96,119,122,89,84,67,78,5,8,31,18,49,60,43,38,189,176,167,170,137,132,147,158,213,216,207,194,225,236,251,246,214,219,204,193,226,239,248,245,190,179,164,169,138,135,144,157,6,11,28,17,50,63,40,37,110,99,116,121,90,87,64,77,218,215,192,205,238,227,244,249,178,191,168,165,134,139,156,145,10,7,16,29,62,51,36,41,98,111,120,117,86,91,76,65,97,108,123,118,85,88,79,66,9,4,19,30,61,48,39,42,177,188,171,166,133,136,159,146,217,212,195,206,237,224,247,250,183,186,173,160,131,142,153,148,223,210,197,200,235,230,241,252,103,106,125,112,83,94,73,68,15,2,21,24,59,54,33,44,12,1,22,27,56,53,34,47,100,105,126,115,80,93,74,71,220,209,198,203,232,229,242,255,180,185,174,163,128,141,154,151],Ve=[0,14,28,18,56,54,36,42,112,126,108,98,72,70,84,90,224,238,252,242,216,214,196,202,144,158,140,130,168,166,180,186,219,213,199,201,227,237,255,241,171,165,183,185,147,157,143,129,59,53,39,41,3,13,31,17,75,69,87,89,115,125,111,97,173,163,177,191,149,155,137,135,221,211,193,207,229,235,249,247,77,67,81,95,117,123,105,103,61,51,33,47,5,11,25,23,118,120,106,100,78,64,82,92,6,8,26,20,62,48,34,44,150,152,138,132,174,160,178,188,230,232,250,244,222,208,194,204,65,79,93,83,121,119,101,107,49,63,45,35,9,7,21,27,161,175,189,179,153,151,133,139,209,223,205,195,233,231,245,251,154,148,134,136,162,172,190,176,234,228,246,248,210,220,206,192,122,116,102,104,66,76,94,80,10,4,22,24,50,60,46,32,236,226,240,254,212,218,200,198,156,146,128,142,164,170,184,182,12,2,16,30,52,58,40,38,124,114,96,110,68,74,88,86,55,57,43,37,15,1,19,29,71,73,91,85,127,113,99,109,215,217,203,197,239,225,243,253,167,169,187,181,159,145,131,141];for(var Xe=[],je=[],ze="undefined"!=typeof Uint8Array?Uint8Array:Array,$e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Je=0,Ye=$e.length;Je<Ye;++Je)Xe[Je]=$e[Je],je[$e.charCodeAt(Je)]=Je;function Qe(){}function Ze(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function et(e){var t=Ze(e),r=t[0],i=t[1];return 3*(r+i)/4-i}function tt(e,t,r){return 3*(t+r)/4-r}function rt(e){return Xe[e>>18&63]+Xe[e>>12&63]+Xe[e>>6&63]+Xe[63&e]}function it(e,t,r){for(var i,o=[],n=t;n<r;n+=3)i=(e[n]<<16&16711680)+(e[n+1]<<8&65280)+(255&e[n+2]),o.push(rt(i));return o.join("")}je["-".charCodeAt(0)]=62,je["_".charCodeAt(0)]=63,Qe.prototype.toByteArray=function(e){for(var t,r=Ze(e),i=r[0],o=r[1],n=new ze(tt(e,i,o)),s=0,a=o>0?i-4:i,u=0;u<a;u+=4)t=je[e.charCodeAt(u)]<<18|je[e.charCodeAt(u+1)]<<12|je[e.charCodeAt(u+2)]<<6|je[e.charCodeAt(u+3)],n[s++]=t>>16&255,n[s++]=t>>8&255,n[s++]=255&t;return 2===o&&(t=je[e.charCodeAt(u)]<<2|je[e.charCodeAt(u+1)]>>4,n[s++]=255&t),1===o&&(t=je[e.charCodeAt(u)]<<10|je[e.charCodeAt(u+1)]<<4|je[e.charCodeAt(u+2)]>>2,n[s++]=t>>8&255,n[s++]=255&t),n},Qe.prototype.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],n=0,s=r-i;n<s;n+=16383)o.push(it(e,n,n+16383>s?s:n+16383));return 1===i?(t=e[r-1],o.push(Xe[t>>2]+Xe[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(Xe[t>>10]+Xe[t>>4&63]+Xe[t<<2&63]+"=")),o.join("")};var ot,Qe=Qe.prototype,nt=nt;const st=50;var at=2147483647,ut=at;function ct(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}function lt(e){if(e>at)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=ot.prototype,t}function ot(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return pt(e)}return dt(e,t,r)}function dt(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return Yt(e)||e&&Yt(e.buffer)?yt(e,t,r):"string"==typeof e?ft(e,t):vt(e)}function ht(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('"size" argument must not be negative')}function gt(e,t,r){return ht(e),e<=0?lt(e):void 0!==t?"string"==typeof r?lt(e).fill(t,r):lt(e).fill(t):lt(e)}function pt(e){return ht(e),lt(e<0?0:0|St(e))}function ft(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!ot.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|et(e,t),i=lt(r),o=i.write(e,t);return o!==r&&(i=i.slice(0,o)),i}function mt(e){for(var t=e.length<0?0:0|St(e.length),r=lt(t),i=0;i<t;i+=1)r[i]=255&e[i];return r}function yt(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return(i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=ot.prototype,i}function vt(e){if(ot.isBuffer(e)){var t=0|St(e.length),r=lt(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}if(e){if(ArrayBuffer.isView(e)||"length"in e)return"number"!=typeof e.length||Qt(e.length)?lt(0):mt(e);if("Buffer"===e.type&&Array.isArray(e.data))return mt(e.data)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.")}function St(e){if(e>=at)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+at.toString(16)+" bytes");return 0|e}function nt(e){return+e!=e&&(e=0),ot.alloc(+e)}function et(e,t){if(ot.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Yt(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Xt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $t(e).length;default:if(i)return Xt(e).length;t=(""+t).toLowerCase(),i=!0}}function Ct(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Tt(this,t,r);case"utf8":case"utf-8":return xt(this,t,r);case"ascii":return Gt(this,t,r);case"latin1":case"binary":return _t(this,t,r);case"base64":return Lt(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mt(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function Pt(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function At(e,t,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Qt(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=ot.from(t,i)),ot.isBuffer(t))return 0===t.length?-1:bt(e,t,r,i,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):bt(e,[t],r,i,o);throw new TypeError("val must be string, number or Buffer")}function bt(e,t,r,i,o){var n,s=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var l=-1;for(n=r;n<a;n++)if(c(e,n)===c(t,-1===l?0:n-l)){if(-1===l&&(l=n),n-l+1===u)return l*s}else-1!==l&&(n-=n-l),l=-1}else for(r+u>a&&(r=a-u),n=r;n>=0;n--){for(var d=!0,h=0;h<u;h++)if(c(e,n+h)!==c(t,h)){d=!1;break}if(d)return n}return-1}function wt(e,t,r,i){r=Number(r)||0;var o=e.length-r;i?(i=Number(i))>o&&(i=o):i=o;var n=t.length;i>n/2&&(i=n/2);for(var s=0;s<i;++s){var a=parseInt(t.substr(2*s,2),16);if(Qt(a))return s;e[r+s]=a}return s}function Rt(e,t,r,i){return Jt(Xt(t,e.length-r),e,r,i)}function Ot(e,t,r,i){return Jt(jt(t),e,r,i)}function Ut(e,t,r,i){return Ot(e,t,r,i)}function It(e,t,r,i){return Jt($t(t),e,r,i)}function Et(e,t,r,i){return Jt(zt(t,e.length-r),e,r,i)}function Lt(e,t,r){return 0===t&&r===e.length?Qe.fromByteArray(e):Qe.fromByteArray(e.slice(t,r))}function xt(e,t,r){r=Math.min(e.length,r);for(var i=[],o=t;o<r;){var n,s,a,u,c=e[o],l=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(n=e[o+1]))&&(u=(31&c)<<6|63&n)>127&&(l=u);break;case 3:n=e[o+1],s=e[o+2],128==(192&n)&&128==(192&s)&&(u=(15&c)<<12|(63&n)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:n=e[o+1],s=e[o+2],a=e[o+3],128==(192&n)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&n)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|1023&l),i.push(l),o+=d}return kt(i)}(ot=ot).TYPED_ARRAY_SUPPORT=ct(),ot.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(ot.prototype,"parent",{get:function(){if(this instanceof ot)return this.buffer}}),Object.defineProperty(ot.prototype,"offset",{get:function(){if(this instanceof ot)return this.byteOffset}}),"undefined"!=typeof Symbol&&Symbol.species&&ot[Symbol.species]===ot&&Object.defineProperty(ot,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),ot.poolSize=8192,ot.from=function(e,t,r){return dt(e,t,r)},ot.prototype.__proto__=Uint8Array.prototype,ot.__proto__=Uint8Array,ot.alloc=function(e,t,r){return gt(e,t,r)},ot.allocUnsafe=function(e){return pt(e)},ot.allocUnsafeSlow=function(e){return pt(e)},ot.isBuffer=function(e){return null!=e&&!0===e._isBuffer},ot.compare=function(e,t){if(!ot.isBuffer(e)||!ot.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,i=t.length,o=0,n=Math.min(r,i);o<n;++o)if(e[o]!==t[o]){r=e[o],i=t[o];break}return r<i?-1:i<r?1:0},ot.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ot.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return ot.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var i=ot.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var n=e[r];if(ArrayBuffer.isView(n)&&(n=ot.from(n)),!ot.isBuffer(n))throw new TypeError('"list" argument must be an Array of Buffers');n.copy(i,o),o+=n.length}return i},ot.byteLength=et,ot.prototype._isBuffer=!0,ot.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Pt(this,t,t+1);return this},ot.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Pt(this,t,t+3),Pt(this,t+1,t+2);return this},ot.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Pt(this,t,t+7),Pt(this,t+1,t+6),Pt(this,t+2,t+5),Pt(this,t+3,t+4);return this},ot.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?xt(this,0,e):Ct.apply(this,arguments)},ot.prototype.toLocaleString=ot.prototype.toString,ot.prototype.equals=function(e){if(!ot.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===ot.compare(this,e)},ot.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},ot.prototype.compare=function(e,t,r,i,o){if(!ot.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=r)return 0;if(i>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var n=o-i,s=r-t,a=Math.min(n,s),u=this.slice(i,o),c=e.slice(t,r),l=0;l<a;++l)if(u[l]!==c[l]){n=u[l],s=c[l];break}return n<s?-1:s<n?1:0},ot.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},ot.prototype.indexOf=function(e,t,r){return At(this,e,t,r,!0)},ot.prototype.lastIndexOf=function(e,t,r){return At(this,e,t,r,!1)},ot.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return wt(this,e,t,r);case"utf8":case"utf-8":return Rt(this,e,t,r);case"ascii":return Ot(this,e,t,r);case"latin1":case"binary":return Ut(this,e,t,r);case"base64":return It(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},ot.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Dt=4096;function kt(e){var t=e.length;if(t<=Dt)return String.fromCharCode.apply(String,e);for(var r="",i=0;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=Dt));return r}function Gt(e,t,r){var i="";r=Math.min(e.length,r);for(var o=t;o<r;++o)i+=String.fromCharCode(127&e[o]);return i}function _t(e,t,r){var i="";r=Math.min(e.length,r);for(var o=t;o<r;++o)i+=String.fromCharCode(e[o]);return i}function Tt(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var o="",n=t;n<r;++n)o+=Vt(e[n]);return o}function Mt(e,t,r){for(var i=e.slice(t,r),o="",n=0;n<i.length;n+=2)o+=String.fromCharCode(i[n]+256*i[n+1]);return o}function Ht(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function Nt(e,t,r,i,o,n){if(!ot.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<n)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function Wt(e,t,r,i,o,n){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Bt(e,t,r,i,o){return t=+t,r>>>=0,o||Wt(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),er(e,t,r,i,23,4),r+4}function Ft(e,t,r,i,o){return t=+t,r>>>=0,o||Wt(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),er(e,t,r,i,52,8),r+8}ot.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var i=this.subarray(e,t);return i.__proto__=ot.prototype,i},ot.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||Ht(e,t,this.length);for(var i=this[e],o=1,n=0;++n<t&&(o*=256);)i+=this[e+n]*o;return i},ot.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||Ht(e,t,this.length);for(var i=this[e+--t],o=1;t>0&&(o*=256);)i+=this[e+--t]*o;return i},ot.prototype.readUInt8=function(e,t){return e>>>=0,t||Ht(e,1,this.length),this[e]},ot.prototype.readUInt16LE=function(e,t){return e>>>=0,t||Ht(e,2,this.length),this[e]|this[e+1]<<8},ot.prototype.readUInt16BE=function(e,t){return e>>>=0,t||Ht(e,2,this.length),this[e]<<8|this[e+1]},ot.prototype.readUInt32LE=function(e,t){return e>>>=0,t||Ht(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},ot.prototype.readUInt32BE=function(e,t){return e>>>=0,t||Ht(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},ot.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||Ht(e,t,this.length);for(var i=this[e],o=1,n=0;++n<t&&(o*=256);)i+=this[e+n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},ot.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||Ht(e,t,this.length);for(var i=t,o=1,n=this[e+--i];i>0&&(o*=256);)n+=this[e+--i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},ot.prototype.readInt8=function(e,t){return e>>>=0,t||Ht(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},ot.prototype.readInt16LE=function(e,t){e>>>=0,t||Ht(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},ot.prototype.readInt16BE=function(e,t){e>>>=0,t||Ht(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},ot.prototype.readInt32LE=function(e,t){return e>>>=0,t||Ht(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},ot.prototype.readInt32BE=function(e,t){return e>>>=0,t||Ht(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},ot.prototype.readFloatLE=function(e,t){return e>>>=0,t||Ht(e,4,this.length),Zt(this,e,!0,23,4)},ot.prototype.readFloatBE=function(e,t){return e>>>=0,t||Ht(e,4,this.length),Zt(this,e,!1,23,4)},ot.prototype.readDoubleLE=function(e,t){return e>>>=0,t||Ht(e,8,this.length),Zt(this,e,!0,52,8)},ot.prototype.readDoubleBE=function(e,t){return e>>>=0,t||Ht(e,8,this.length),Zt(this,e,!1,52,8)},ot.prototype.writeUIntLE=function(e,t,r,i){(e=+e,t>>>=0,r>>>=0,i)||Nt(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,n=0;for(this[t]=255&e;++n<r&&(o*=256);)this[t+n]=e/o&255;return t+r},ot.prototype.writeUIntBE=function(e,t,r,i){(e=+e,t>>>=0,r>>>=0,i)||Nt(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,n=1;for(this[t+o]=255&e;--o>=0&&(n*=256);)this[t+o]=e/n&255;return t+r},ot.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,1,255,0),this[t]=255&e,t+1},ot.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},ot.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},ot.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},ot.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},ot.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var o=Math.pow(2,8*r-1);Nt(this,e,t,r,o-1,-o)}var n=0,s=1,a=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/s>>0)-a&255;return t+r},ot.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var o=Math.pow(2,8*r-1);Nt(this,e,t,r,o-1,-o)}var n=r-1,s=1,a=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/s>>0)-a&255;return t+r},ot.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},ot.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},ot.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},ot.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},ot.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Nt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},ot.prototype.writeFloatLE=function(e,t,r){return Bt(this,e,t,!0,r)},ot.prototype.writeFloatBE=function(e,t,r){return Bt(this,e,t,!1,r)},ot.prototype.writeDoubleLE=function(e,t,r){return Ft(this,e,t,!0,r)},ot.prototype.writeDoubleBE=function(e,t,r){return Ft(this,e,t,!1,r)},ot.prototype.copy=function(e,t,r,i){if(!ot.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var o=i-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,i);else if(this===e&&r<t&&t<i)for(var n=o-1;n>=0;--n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return o},ot.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!ot.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{var s=ot.isBuffer(e)?e:new ot(e,i),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=s[n%a]}return this};var qt=/[^+/0-9A-Za-z-_]/g;function Kt(e){if((e=(e=e.split("=")[0]).trim().replace(qt,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function Vt(e){return e<16?"0"+e.toString(16):e.toString(16)}function Xt(e,t){var r;t=t||1/0;for(var i=e.length,o=null,n=[],s=0;s<i;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&n.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&n.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function jt(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function zt(e,t){for(var r,i,o,n=[],s=0;s<e.length&&!((t-=2)<0);++s)i=(r=e.charCodeAt(s))>>8,o=r%256,n.push(o),n.push(i);return n}function $t(e){return Qe.toByteArray(Kt(e))}function Jt(e,t,r,i){for(var o=0;o<i&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Yt(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function Qt(e){return e!=e}var Zt=function(e,t,r,i,o){var n,s,a=8*o-i-1,u=(1<<a)-1,c=u>>1,l=-7,d=r?o-1:0,h=r?-1:1,g=e[t+d];for(d+=h,n=g&(1<<-l)-1,g>>=-l,l+=a;l>0;n=256*n+e[t+d],d+=h,l-=8);for(s=n&(1<<-l)-1,n>>=-l,l+=i;l>0;s=256*s+e[t+d],d+=h,l-=8);if(0===n)n=1-c;else{if(n===u)return s?NaN:1/0*(g?-1:1);s+=Math.pow(2,i),n-=c}return(g?-1:1)*s*Math.pow(2,n-i)},er=function(e,t,r,i,o,n){var s,a,u,c=8*n-o-1,l=(1<<c)-1,d=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,g=i?0:n-1,p=i?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*u-1)*Math.pow(2,o),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;e[r+g]=255&a,g+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[r+g]=255&s,g+=p,s/=256,c-=8);e[r+g-p]|=128*f};!function(e){"use strict";var t=new RegExp("^.*("+["\\+https:\\/\\/developers.google.com\\/\\+\\/web\\/snippet\\/","googlebot","baiduspider","gurujibot","yandexbot","slurp","msnbot","bingbot","facebookexternalhit","linkedinbot","twitterbot","slackbot","telegrambot","applebot","pingdom","tumblr ","Embedly","spbot"].join("|")+").*$"),r=function(e){e=e||{};var i={version:!1,language:!1,platform:!0,os:!0,pixelDepth:!0,colorDepth:!0,resolution:!1,isAuthoritative:!0,silkAccelerated:!0,isKindleFire:!0,isDesktop:!0,isMobile:!0,isTablet:!0,isWindows:!0,isLinux:!0,isLinux64:!0,isChromeOS:!0,isMac:!0,isiPad:!0,isiPhone:!0,isiPod:!0,isAndroid:!0,isSamsung:!0,isSmartTV:!0,isRaspberry:!0,isBlackberry:!0,isTouchScreen:!0,isOpera:!1,isIE:!1,isEdge:!1,isIECompatibilityMode:!1,isSafari:!1,isFirefox:!1,isWebkit:!1,isChrome:!1,isKonqueror:!1,isOmniWeb:!1,isSeaMonkey:!1,isFlock:!1,isAmaya:!1,isPhantomJS:!1,isEpiphany:!1,source:!1,cpuCores:!1};for(var o in e)e.hasOwnProperty(o)&&void 0!==i[o]&&(i[o]=e[o]);return this.options=i,this.version="1.0.0",this._Versions={Edge:/Edge\/([\d\w\.\-]+)/i,Firefox:/firefox\/([\d\w\.\-]+)/i,IE:/msie\s([\d\.]+[\d])|trident\/\d+\.\d+;.*[rv:]+(\d+\.\d)/i,Chrome:/chrome\/([\d\w\.\-]+)/i,Chromium:/(?:chromium|crios)\/([\d\w\.\-]+)/i,Safari:/version\/([\d\w\.\-]+)/i,Opera:/version\/([\d\w\.\-]+)|OPR\/([\d\w\.\-]+)/i,Ps3:/([\d\w\.\-]+)\)\s*$/i,Psp:/([\d\w\.\-]+)\)?\s*$/i,Amaya:/amaya\/([\d\w\.\-]+)/i,SeaMonkey:/seamonkey\/([\d\w\.\-]+)/i,OmniWeb:/omniweb\/v([\d\w\.\-]+)/i,Flock:/flock\/([\d\w\.\-]+)/i,Epiphany:/epiphany\/([\d\w\.\-]+)/i,WinJs:/msapphost\/([\d\w\.\-]+)/i,PhantomJS:/phantomjs\/([\d\w\.\-]+)/i,UC:/UCBrowser\/([\d\w\.]+)/i},this._Browsers={Edge:/edge/i,Amaya:/amaya/i,Konqueror:/konqueror/i,Epiphany:/epiphany/i,SeaMonkey:/seamonkey/i,Flock:/flock/i,OmniWeb:/omniweb/i,Chromium:/chromium|crios/i,Chrome:/chrome/i,Safari:/safari/i,IE:/msie|trident/i,Opera:/opera|OPR/i,PS3:/playstation 3/i,PSP:/playstation portable/i,Firefox:/firefox/i,WinJs:/msapphost/i,PhantomJS:/phantomjs/i,UC:/UCBrowser/i},this._OS={Windows10:/windows nt 10\.0/i,Windows81:/windows nt 6\.3/i,Windows8:/windows nt 6\.2/i,Windows7:/windows nt 6\.1/i,UnknownWindows:/windows nt 6\.\d+/i,WindowsVista:/windows nt 6\.0/i,Windows2003:/windows nt 5\.2/i,WindowsXP:/windows nt 5\.1/i,Windows2000:/windows nt 5\.0/i,WindowsPhone8:/windows phone 8\./,OSXCheetah:/os x 10[._]0/i,OSXPuma:/os x 10[._]1(\D|$)/i,OSXJaguar:/os x 10[._]2/i,OSXPanther:/os x 10[._]3/i,OSXTiger:/os x 10[._]4/i,OSXLeopard:/os x 10[._]5/i,OSXSnowLeopard:/os x 10[._]6/i,OSXLion:/os x 10[._]7/i,OSXMountainLion:/os x 10[._]8/i,OSXMavericks:/os x 10[._]9/i,OSXYosemite:/os x 10[._]10/i,OSXElCapitan:/os x 10[._]11/i,OSXSierra:/os x 10[._]12/i,Mac:/os x/i,Linux:/linux/i,Linux64:/linux x86_64/i,ChromeOS:/cros/i,Wii:/wii/i,PS3:/playstation 3/i,PSP:/playstation portable/i,iPad:/\(iPad.*os (\d+)[._](\d+)/i,iPhone:/\(iPhone.*os (\d+)[._](\d+)/i,Bada:/Bada\/(\d+)\.(\d+)/i,Curl:/curl\/(\d+)\.(\d+)\.(\d+)/i},this._Platform={Windows:/windows nt/i,WindowsPhone:/windows phone/i,Mac:/macintosh/i,Linux:/linux/i,Wii:/wii/i,Playstation:/playstation/i,iPad:/ipad/i,iPod:/ipod/i,iPhone:/iphone/i,Android:/android/i,Blackberry:/blackberry/i,Samsung:/samsung/i,Curl:/curl/i},this.DefaultAgent={isAuthoritative:!0,isMobile:!1,isTablet:!1,isiPad:!1,isiPod:!1,isiPhone:!1,isAndroid:!1,isBlackberry:!1,isOpera:!1,isIE:!1,isEdge:!1,isIECompatibilityMode:!1,isSafari:!1,isFirefox:!1,isWebkit:!1,isChrome:!1,isKonqueror:!1,isOmniWeb:!1,isSeaMonkey:!1,isFlock:!1,isAmaya:!1,isPhantomJS:!1,isEpiphany:!1,isDesktop:!1,isWindows:!1,isLinux:!1,isLinux64:!1,isMac:!1,isChromeOS:!1,isBada:!1,isSamsung:!1,isRaspberry:!1,isBot:!1,isCurl:!1,isAndroidTablet:!1,isWinJs:!1,isKindleFire:!1,isSilk:!1,isCaptive:!1,isSmartTV:!1,isUC:!1,isTouchScreen:!1,silkAccelerated:!1,colorDepth:-1,pixelDepth:-1,resolution:[],cpuCores:-1,language:"unknown",browser:"unknown",version:"unknown",os:"unknown",platform:"unknown",geoIp:{},source:"",hashInt:function(e){var t,r,i=0;if(0===e.length)return i;for(t=0,r=e.length;t<r;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return i},hashMD5:function(e){function t(e,t){return e<<t|e>>>32-t}function r(e,t){var r,i,o,n,s;return o=2147483648&e,n=2147483648&t,s=(1073741823&e)+(1073741823&t),(r=1073741824&e)&(i=1073741824&t)?2147483648^s^o^n:r|i?1073741824&s?3221225472^s^o^n:1073741824^s^o^n:s^o^n}function i(e,i,o,n,s,a,u){return r(t(e=r(e,r(r(function(e,t,r){return e&t|~e&r}(i,o,n),s),u)),a),i)}function o(e,i,o,n,s,a,u){return r(t(e=r(e,r(r(function(e,t,r){return e&r|t&~r}(i,o,n),s),u)),a),i)}function n(e,i,o,n,s,a,u){return r(t(e=r(e,r(r(function(e,t,r){return e^t^r}(i,o,n),s),u)),a),i)}function s(e,i,o,n,s,a,u){return r(t(e=r(e,r(r(function(e,t,r){return t^(e|~r)}(i,o,n),s),u)),a),i)}function a(e){var t,r="",i="";for(t=0;t<=3;t++)r+=(i="0"+(e>>>8*t&255).toString(16)).substr(i.length-2,2);return r}var u,c,l,d,h,g,p,f,m,y;for(u=function(e){for(var t,r=e.length,i=r+8,o=16*((i-i%64)/64+1),n=new Array(o-1),s=0,a=0;a<r;)s=a%4*8,n[t=(a-a%4)/4]=n[t]|e.charCodeAt(a)<<s,a++;return s=a%4*8,n[t=(a-a%4)/4]=n[t]|128<<s,n[o-2]=r<<3,n[o-1]=r>>>29,n}(e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128))}return t}(e)),p=1732584193,f=4023233417,m=2562383102,y=271733878,c=0;c<u.length;c+=16)l=p,d=f,h=m,g=y,f=s(f=s(f=s(f=s(f=n(f=n(f=n(f=n(f=o(f=o(f=o(f=o(f=i(f=i(f=i(f=i(f,m=i(m,y=i(y,p=i(p,f,m,y,u[c+0],7,3614090360),f,m,u[c+1],12,3905402710),p,f,u[c+2],17,606105819),y,p,u[c+3],22,3250441966),m=i(m,y=i(y,p=i(p,f,m,y,u[c+4],7,4118548399),f,m,u[c+5],12,1200080426),p,f,u[c+6],17,2821735955),y,p,u[c+7],22,4249261313),m=i(m,y=i(y,p=i(p,f,m,y,u[c+8],7,1770035416),f,m,u[c+9],12,2336552879),p,f,u[c+10],17,4294925233),y,p,u[c+11],22,2304563134),m=i(m,y=i(y,p=i(p,f,m,y,u[c+12],7,1804603682),f,m,u[c+13],12,4254626195),p,f,u[c+14],17,2792965006),y,p,u[c+15],22,1236535329),m=o(m,y=o(y,p=o(p,f,m,y,u[c+1],5,4129170786),f,m,u[c+6],9,3225465664),p,f,u[c+11],14,643717713),y,p,u[c+0],20,3921069994),m=o(m,y=o(y,p=o(p,f,m,y,u[c+5],5,3593408605),f,m,u[c+10],9,38016083),p,f,u[c+15],14,3634488961),y,p,u[c+4],20,3889429448),m=o(m,y=o(y,p=o(p,f,m,y,u[c+9],5,568446438),f,m,u[c+14],9,3275163606),p,f,u[c+3],14,4107603335),y,p,u[c+8],20,1163531501),m=o(m,y=o(y,p=o(p,f,m,y,u[c+13],5,2850285829),f,m,u[c+2],9,4243563512),p,f,u[c+7],14,1735328473),y,p,u[c+12],20,2368359562),m=n(m,y=n(y,p=n(p,f,m,y,u[c+5],4,4294588738),f,m,u[c+8],11,2272392833),p,f,u[c+11],16,1839030562),y,p,u[c+14],23,4259657740),m=n(m,y=n(y,p=n(p,f,m,y,u[c+1],4,2763975236),f,m,u[c+4],11,1272893353),p,f,u[c+7],16,4139469664),y,p,u[c+10],23,3200236656),m=n(m,y=n(y,p=n(p,f,m,y,u[c+13],4,681279174),f,m,u[c+0],11,3936430074),p,f,u[c+3],16,3572445317),y,p,u[c+6],23,76029189),m=n(m,y=n(y,p=n(p,f,m,y,u[c+9],4,3654602809),f,m,u[c+12],11,3873151461),p,f,u[c+15],16,530742520),y,p,u[c+2],23,3299628645),m=s(m,y=s(y,p=s(p,f,m,y,u[c+0],6,4096336452),f,m,u[c+7],10,1126891415),p,f,u[c+14],15,2878612391),y,p,u[c+5],21,4237533241),m=s(m,y=s(y,p=s(p,f,m,y,u[c+12],6,1700485571),f,m,u[c+3],10,2399980690),p,f,u[c+10],15,4293915773),y,p,u[c+1],21,2240044497),m=s(m,y=s(y,p=s(p,f,m,y,u[c+8],6,1873313359),f,m,u[c+15],10,4264355552),p,f,u[c+6],15,2734768916),y,p,u[c+13],21,1309151649),m=s(m,y=s(y,p=s(p,f,m,y,u[c+4],6,4149444226),f,m,u[c+11],10,3174756917),p,f,u[c+2],15,718787259),y,p,u[c+9],21,3951481745),p=r(p,l),f=r(f,d),m=r(m,h),y=r(y,g);return(a(p)+a(f)+a(m)+a(y)).toLowerCase()}},this.Agent={},this.getBrowser=function(e){switch(!0){case this._Browsers.Edge.test(e):return this.Agent.isEdge=!0,"Edge";case this._Browsers.PhantomJS.test(e):return this.Agent.isPhantomJS=!0,"PhantomJS";case this._Browsers.Konqueror.test(e):return this.Agent.isKonqueror=!0,"Konqueror";case this._Browsers.Amaya.test(e):return this.Agent.isAmaya=!0,"Amaya";case this._Browsers.Epiphany.test(e):return this.Agent.isEpiphany=!0,"Epiphany";case this._Browsers.SeaMonkey.test(e):return this.Agent.isSeaMonkey=!0,"SeaMonkey";case this._Browsers.Flock.test(e):return this.Agent.isFlock=!0,"Flock";case this._Browsers.OmniWeb.test(e):return this.Agent.isOmniWeb=!0,"OmniWeb";case this._Browsers.Opera.test(e):return this.Agent.isOpera=!0,"Opera";case this._Browsers.Chromium.test(e):return this.Agent.isChrome=!0,"Chromium";case this._Browsers.Chrome.test(e):return this.Agent.isChrome=!0,"Chrome";case this._Browsers.Safari.test(e):return this.Agent.isSafari=!0,"Safari";case this._Browsers.WinJs.test(e):return this.Agent.isWinJs=!0,"WinJs";case this._Browsers.IE.test(e):return this.Agent.isIE=!0,"IE";case this._Browsers.PS3.test(e):return"ps3";case this._Browsers.PSP.test(e):return"psp";case this._Browsers.Firefox.test(e):return this.Agent.isFirefox=!0,"Firefox";case this._Browsers.UC.test(e):return this.Agent.isUC=!0,"UCBrowser";default:return 0!==e.indexOf("Mozilla")&&/^([\d\w\-\.]+)\/[\d\w\.\-]+/i.test(e)?(this.Agent.isAuthoritative=!1,RegExp.$1):"unknown"}},this.getBrowserVersion=function(e){switch(this.Agent.browser){case"Edge":if(this._Versions.Edge.test(e))return RegExp.$1;break;case"PhantomJS":if(this._Versions.PhantomJS.test(e))return RegExp.$1;break;case"Chrome":if(this._Versions.Chrome.test(e))return RegExp.$1;break;case"Chromium":if(this._Versions.Chromium.test(e))return RegExp.$1;break;case"Safari":if(this._Versions.Safari.test(e))return RegExp.$1;break;case"Opera":if(this._Versions.Opera.test(e))return RegExp.$1?RegExp.$1:RegExp.$2;break;case"Firefox":if(this._Versions.Firefox.test(e))return RegExp.$1;break;case"WinJs":if(this._Versions.WinJs.test(e))return RegExp.$1;break;case"IE":if(this._Versions.IE.test(e))return RegExp.$2?RegExp.$2:RegExp.$1;break;case"ps3":if(this._Versions.Ps3.test(e))return RegExp.$1;break;case"psp":if(this._Versions.Psp.test(e))return RegExp.$1;break;case"Amaya":if(this._Versions.Amaya.test(e))return RegExp.$1;break;case"Epiphany":if(this._Versions.Epiphany.test(e))return RegExp.$1;break;case"SeaMonkey":if(this._Versions.SeaMonkey.test(e))return RegExp.$1;break;case"Flock":if(this._Versions.Flock.test(e))return RegExp.$1;break;case"OmniWeb":if(this._Versions.OmniWeb.test(e))return RegExp.$1;break;case"UCBrowser":if(this._Versions.UC.test(e))return RegExp.$1;break;default:if("unknown"!==this.Agent.browser&&new RegExp(this.Agent.browser+"[\\/ ]([\\d\\w\\.\\-]+)","i").test(e))return RegExp.$1}},this.getOS=function(e){switch(!0){case this._OS.WindowsVista.test(e):return this.Agent.isWindows=!0,"Windows Vista";case this._OS.Windows7.test(e):return this.Agent.isWindows=!0,"Windows 7";case this._OS.Windows8.test(e):return this.Agent.isWindows=!0,"Windows 8";case this._OS.Windows81.test(e):return this.Agent.isWindows=!0,"Windows 8.1";case this._OS.Windows10.test(e):return this.Agent.isWindows=!0,"Windows 10.0";case this._OS.Windows2003.test(e):return this.Agent.isWindows=!0,"Windows 2003";case this._OS.WindowsXP.test(e):return this.Agent.isWindows=!0,"Windows XP";case this._OS.Windows2000.test(e):return this.Agent.isWindows=!0,"Windows 2000";case this._OS.WindowsPhone8.test(e):return"Windows Phone 8";case this._OS.Linux64.test(e):return this.Agent.isLinux=!0,this.Agent.isLinux64=!0,"Linux 64";case this._OS.Linux.test(e):return this.Agent.isLinux=!0,"Linux";case this._OS.ChromeOS.test(e):return this.Agent.isChromeOS=!0,"Chrome OS";case this._OS.Wii.test(e):return"Wii";case this._OS.PS3.test(e):case this._OS.PSP.test(e):return"Playstation";case this._OS.OSXCheetah.test(e):return this.Agent.isMac=!0,"OS X Cheetah";case this._OS.OSXPuma.test(e):return this.Agent.isMac=!0,"OS X Puma";case this._OS.OSXJaguar.test(e):return this.Agent.isMac=!0,"OS X Jaguar";case this._OS.OSXPanther.test(e):return this.Agent.isMac=!0,"OS X Panther";case this._OS.OSXTiger.test(e):return this.Agent.isMac=!0,"OS X Tiger";case this._OS.OSXLeopard.test(e):return this.Agent.isMac=!0,"OS X Leopard";case this._OS.OSXSnowLeopard.test(e):return this.Agent.isMac=!0,"OS X Snow Leopard";case this._OS.OSXLion.test(e):return this.Agent.isMac=!0,"OS X Lion";case this._OS.OSXMountainLion.test(e):return this.Agent.isMac=!0,"OS X Mountain Lion";case this._OS.OSXMavericks.test(e):return this.Agent.isMac=!0,"OS X Mavericks";case this._OS.OSXYosemite.test(e):return this.Agent.isMac=!0,"OS X Yosemite";case this._OS.OSXElCapitan.test(e):return this.Agent.isMac=!0,"OS X El Capitan";case this._OS.OSXSierra.test(e):return this.Agent.isMac=!0,"macOS Sierra";case this._OS.Mac.test(e):return this.Agent.isMac=!0,"OS X";case this._OS.iPad.test(e):return this.Agent.isiPad=!0,e.match(this._OS.iPad)[0].replace("_",".");case this._OS.iPhone.test(e):return this.Agent.isiPhone=!0,e.match(this._OS.iPhone)[0].replace("_",".");case this._OS.Bada.test(e):return this.Agent.isBada=!0,"Bada";case this._OS.Curl.test(e):return this.Agent.isCurl=!0,"Curl";default:return"unknown"}},this.getPlatform=function(e){switch(!0){case this._Platform.Windows.test(e):return"Microsoft Windows";case this._Platform.WindowsPhone.test(e):return this.Agent.isWindowsPhone=!0,"Microsoft Windows Phone";case this._Platform.Mac.test(e):return"Apple Mac";case this._Platform.Curl.test(e):return"Curl";case this._Platform.Android.test(e):return this.Agent.isAndroid=!0,"Android";case this._Platform.Blackberry.test(e):return this.Agent.isBlackberry=!0,"Blackberry";case this._Platform.Linux.test(e):return"Linux";case this._Platform.Wii.test(e):return"Wii";case this._Platform.Playstation.test(e):return"Playstation";case this._Platform.iPad.test(e):return this.Agent.isiPad=!0,"iPad";case this._Platform.iPod.test(e):return this.Agent.isiPod=!0,"iPod";case this._Platform.iPhone.test(e):return this.Agent.isiPhone=!0,"iPhone";case this._Platform.Samsung.test(e):return this.Agent.isiSamsung=!0,"Samsung";default:return"unknown"}},this.testCompatibilityMode=function(){var e=this;if(this.Agent.isIE&&/Trident\/(\d)\.0/i.test(e.Agent.source)){var t=parseInt(RegExp.$1,10),r=parseInt(e.Agent.version,10);7===r&&7===t&&(e.Agent.isIECompatibilityMode=!0,e.Agent.version=11),7===r&&6===t&&(e.Agent.isIECompatibilityMode=!0,e.Agent.version=10),7===r&&5===t&&(e.Agent.isIECompatibilityMode=!0,e.Agent.version=9),7===r&&4===t&&(e.Agent.isIECompatibilityMode=!0,e.Agent.version=8)}},this.testSilk=function(){switch(!0){case new RegExp("silk","gi").test(this.Agent.source):this.Agent.isSilk=!0}return/Silk-Accelerated=true/gi.test(this.Agent.source)&&(this.Agent.SilkAccelerated=!0),!!this.Agent.isSilk&&"Silk"},this.testKindleFire=function(){var e=this;switch(!0){case/KFOT/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire";case/KFTT/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD";case/KFJWI/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 8.9";case/KFJWA/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 8.9 4G";case/KFSOWI/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 7";case/KFTHWI/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 7";case/KFTHWA/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 7 4G";case/KFAPWI/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 8.9";case/KFAPWA/gi.test(e.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 8.9 4G";default:return!1}},this.testCaptiveNetwork=function(){switch(!0){case/CaptiveNetwork/gi.test(this.Agent.source):return this.Agent.isCaptive=!0,this.Agent.isMac=!0,this.Agent.platform="Apple Mac","CaptiveNetwork";default:return!1}},this.testMobile=function(){var e=this;switch(!0){case e.Agent.isWindows:case e.Agent.isLinux:case e.Agent.isMac:case e.Agent.isChromeOS:e.Agent.isDesktop=!0;break;case e.Agent.isAndroid:case e.Agent.isSamsung:e.Agent.isMobile=!0,e.Agent.isDesktop=!1}switch(!0){case e.Agent.isiPad:case e.Agent.isiPod:case e.Agent.isiPhone:case e.Agent.isBada:case e.Agent.isBlackberry:case e.Agent.isAndroid:case e.Agent.isWindowsPhone:e.Agent.isMobile=!0,e.Agent.isDesktop=!1}/mobile/i.test(e.Agent.source)&&(e.Agent.isMobile=!0,e.Agent.isDesktop=!1)},this.testTablet=function(){var e=this;switch(!0){case e.Agent.isiPad:case e.Agent.isAndroidTablet:case e.Agent.isKindleFire:e.Agent.isTablet=!0}/tablet/i.test(e.Agent.source)&&(e.Agent.isTablet=!0)},this.testNginxGeoIP=function(e){var t=this;Object.keys(e).forEach(function(r){/^GEOIP/i.test(r)&&(t.Agent.geoIp[r]=e[r])})},this.testBot=function(){var e=this,r=t.exec(e.Agent.source.toLowerCase());r?e.Agent.isBot=r[1]:e.Agent.isAuthoritative||(e.Agent.isBot=/bot/i.test(e.Agent.source))},this.testSmartTV=function(){var e=new RegExp("smart-tv|smarttv|googletv|appletv|hbbtv|pov_tv|netcast.tv","gi").exec(this.Agent.source.toLowerCase());e&&(this.Agent.isSmartTV=e[1])},this.testAndroidTablet=function(){this.Agent.isAndroid&&!/mobile/i.test(this.Agent.source)&&(this.Agent.isAndroidTablet=!0)},this.testTouchSupport=function(){this.Agent.isTouchScreen="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},this.getLaguage=function(){this.Agent.language=(navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"").toLowerCase()},this.getColorDepth=function(){this.Agent.colorDepth=screen.colorDepth||-1},this.getScreenResolution=function(){this.Agent.resolution=[screen.availWidth,screen.availHeight]},this.getPixelDepth=function(){this.Agent.pixelDepth=screen.pixelDepth||-1},this.getCPU=function(){this.Agent.cpuCores=navigator.hardwareConcurrency||-1},this.reset=function(){var e=this;for(var t in e.DefaultAgent)e.DefaultAgent.hasOwnProperty(t)&&(e.Agent[t]=e.DefaultAgent[t]);return e},this.parse=function(e){e=e||navigator.userAgent;var t=new r;return t.Agent.source=e.replace(/^\s*/,"").replace(/\s*$/,""),t.Agent.os=t.getOS(t.Agent.source),t.Agent.platform=t.getPlatform(t.Agent.source),t.Agent.browser=t.getBrowser(t.Agent.source),t.Agent.version=t.getBrowserVersion(t.Agent.source),t.testBot(),t.testSmartTV(),t.testMobile(),t.testAndroidTablet(),t.testTablet(),t.testCompatibilityMode(),t.testSilk(),t.testKindleFire(),t.testCaptiveNetwork(),t.testTouchSupport(),t.getLaguage(),t.getColorDepth(),t.getPixelDepth(),t.getScreenResolution(),t.getCPU(),t.Agent},this.get=function(e){var t=this.parse(),r=[];for(var i in this.options)this.options.hasOwnProperty(i)&&!0===this.options[i]&&r.push(t[i]);e&&r.push(e),!this.options.resolution&&t.isMobile&&r.push(t.resolution);var o=t.hashMD5(r.join(":"));return[o.slice(0,8),o.slice(8,12),"4"+o.slice(12,15),"b"+o.slice(15,18),o.slice(20)].join("-")},this.Agent=this.DefaultAgent,this};e.DeviceUUID=r,new r(navigator.userAgent)}(this);var tr=Object.create(Ee),rr=Object.create(Pe),ir=Object.create(Ae),or=Object.create(Re),nr=Object.create(we),sr=Object.create(Le),ar=Object.create(be),ur=Object.create(Ue),cr=Object.create(Ie);r()?tr.init():ir.setChromeExtensionOverrideState(ce.HIDDEN);