@tencentcloud/web-push 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +102 -175
  2. package/dist/index.d.ts +259 -0
  3. package/{index.esm.js → dist/index.esm.js} +1118 -158
  4. package/dist/index.umd.js +1 -0
  5. package/dist/src/components/message-popup.d.ts +63 -0
  6. package/{src → dist/src}/core/web-push-sdk.d.ts +23 -1
  7. package/{src → dist/src}/index.d.ts +1 -0
  8. package/{src → dist/src}/types/inner.d.ts +2 -10
  9. package/dist/src/types/outer.d.ts +120 -0
  10. package/{src → dist/src}/utils/logger.d.ts +6 -0
  11. package/{src → dist/src}/utils/validator.d.ts +0 -13
  12. package/dist/sw.js +1 -0
  13. package/package.json +47 -9
  14. package/src/__tests__/index.test.ts +120 -0
  15. package/src/__tests__/integration.test.ts +285 -0
  16. package/src/__tests__/setup.ts +210 -0
  17. package/src/__tests__/types.test.ts +303 -0
  18. package/src/__tests__/web-push-sdk.test.ts +257 -0
  19. package/src/components/message-popup.ts +1007 -0
  20. package/src/core/event-emitter.ts +61 -0
  21. package/src/core/service-worker-manager.ts +614 -0
  22. package/src/core/web-push-sdk.ts +690 -0
  23. package/src/debug/GenerateTestUserSig.js +37 -0
  24. package/src/debug/index.d.ts +6 -0
  25. package/src/debug/index.js +1 -0
  26. package/src/debug/lib-generate-test-usersig-es.min.js +2 -0
  27. package/src/index.ts +9 -0
  28. package/src/service-worker/sw.ts +494 -0
  29. package/src/types/index.ts +2 -0
  30. package/src/types/inner.ts +44 -0
  31. package/src/types/outer.ts +142 -0
  32. package/src/utils/browser-support.ts +412 -0
  33. package/src/utils/logger.ts +66 -0
  34. package/src/utils/storage.ts +51 -0
  35. package/src/utils/validator.ts +267 -0
  36. package/CHANGELOG.md +0 -55
  37. package/index.d.ts +0 -110
  38. package/index.umd.js +0 -1
  39. package/src/types/outer.d.ts +0 -66
  40. package/sw.js +0 -1
  41. /package/{src → dist/src}/core/event-emitter.d.ts +0 -0
  42. /package/{src → dist/src}/core/service-worker-manager.d.ts +0 -0
  43. /package/{src → dist/src}/service-worker/sw.d.ts +0 -0
  44. /package/{src → dist/src}/types/index.d.ts +0 -0
  45. /package/{src → dist/src}/utils/browser-support.d.ts +0 -0
  46. /package/{src → dist/src}/utils/storage.d.ts +0 -0
package/index.umd.js DELETED
@@ -1 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tencentcloud/lite-chat/professional")):"function"==typeof define&&define.amd?define(["exports","@tencentcloud/lite-chat/professional"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WebPushSDK={},e.TencentCloudChat)}(this,function(e,t){"use strict";const r="1.0.2";var n=(e=>(e.MESSAGE_RECEIVED="message_received",e.MESSAGE_REVOKED="message_revoked",e.NOTIFICATION_CLICKED="notification_clicked",e))(n||{});const i="[WebPush]";class s{constructor(){}static getInstance(){return s.instance||(s.instance=new s),s.instance}log(e,...t){console.log(`${i} ${e}`,...t)}warn(e,...t){console.warn(`${i} ${e}`,...t)}error(e,...t){console.error(`${i} ${e}`,...t)}info(e,...t){console.info(`${i} ${e}`,...t)}}const o=s.getInstance();class a{constructor(){this.events=new Map}on(e,t){this.events.has(e)||this.events.set(e,new Map);const r=Math.random().toString(36).substr(2,9);return this.events.get(e).set(r,t),r}off(e,t){const r=this.events.get(e);if(!r)return!1;for(const[n,i]of r.entries())if(i===t)return r.delete(n),!0;return!1}emit(e,...t){const r=this.events.get(e);r&&r.forEach(r=>{try{r(...t)}catch(n){o.error(`Event listener error for ${e}:`,n)}})}removeAllListeners(e){e?this.events.delete(e):this.events.clear()}listenerCount(e){const t=this.events.get(e);return t?t.size:0}}class h extends Error{constructor(e,t,r){super(`Parameter validation failed: ${e} - ${t}`),this.name="ValidationError",this.field=e,this.value=r}}class c{static validateValue(e,t,r){if(r.required&&(null==t||""===t))throw new h(e,r.message||`${e} is required`,t);if(r.required||null!=t&&""!==t){if(r.type&&!this.checkType(t,r.type))throw new h(e,r.message||`${e} must be of type ${r.type}`,t);if("string"===r.type&&"string"==typeof t){if(void 0!==r.min&&t.length<r.min)throw new h(e,r.message||`${e} length cannot be less than ${r.min} characters`,t);if(void 0!==r.max&&t.length>r.max)throw new h(e,r.message||`${e} length cannot exceed ${r.max} characters`,t)}if("number"===r.type&&"number"==typeof t){if(void 0!==r.min&&t<r.min)throw new h(e,r.message||`${e} cannot be less than ${r.min}`,t);if(void 0!==r.max&&t>r.max)throw new h(e,r.message||`${e} cannot be greater than ${r.max}`,t)}if(r.pattern&&"string"==typeof t&&!r.pattern.test(t))throw new h(e,r.message||`${e} format is incorrect`,t);if(r.custom){const n=r.custom(t);if(!0!==n){const i="string"==typeof n?n:r.message||`${e} validation failed`;throw new h(e,i,t)}}}}static validateObject(e,t){if(!e||"object"!=typeof e)throw new h("root","Parameter must be an object type");for(const[r,n]of Object.entries(t)){const t=e[r];this.validateValue(r,t,n)}}static checkType(e,t){switch(t){case"string":return"string"==typeof e;case"number":return"number"==typeof e&&!isNaN(e);case"boolean":return"boolean"==typeof e;case"object":return null!==e&&"object"==typeof e&&!Array.isArray(e);case"array":return Array.isArray(e);case"function":return"function"==typeof e;default:return!1}}static validateSDKAppID(e){this.validateValue("SDKAppID",e,{required:!0,type:"number",custom:e=>!!Number.isInteger(e)||"SDKAppID must be an integer",message:"SDKAppID must be an integer between 1-999999999"})}static validateAppKey(e){this.validateValue("appKey",e,{required:!0,type:"string",pattern:/^[a-zA-Z0-9_-]+$/,message:"appKey must be a 1-256 character string composed of letters, numbers, underscores or hyphens"})}static validateUserID(e){this.validateValue("userID",e,{required:!0,type:"string",pattern:/^[a-zA-Z0-9_.-]+$/,message:"userID must be a 1-128 character string composed of letters, numbers, underscores, dots or hyphens"})}static validateEventType(e){const t=["message_received","message_revoked","notification_clicked"];this.validateValue("eventType",e,{required:!0,type:"string",custom:e=>!!t.includes(e)||`eventType must be one of: ${t.join(", ")}`})}static validateListener(e){this.validateValue("listener",e,{required:!0,type:"function",message:"listener must be a function"})}static validateRegisterPushOptions(e){if(!e)throw new h("options","Registration options cannot be empty");const t={SDKAppID:{required:!0,type:"number",custom:e=>!!Number.isInteger(e)||"SDKAppID must be an integer"},appKey:{required:!0,type:"string",pattern:/^[a-zA-Z0-9_-]+$/},userID:{required:!0,type:"string",pattern:/^[a-zA-Z0-9_.-]+$/}};this.validateObject(e,t)}static validatePushMessage(e){if(!e)throw new h("message","Push message cannot be empty");this.validateObject(e,{messageID:{required:!0,type:"string"},title:{required:!0,type:"string"},body:{required:!0,type:"string"},icon:{required:!1,type:"string",pattern:/^https?:\/\/.+/},tag:{required:!1,type:"string"},timestamp:{required:!0,type:"number"}})}static validateURL(e,t="url"){this.validateValue(t,e,{required:!0,type:"string",pattern:/^https?:\/\/.+/,message:`${t} must be a valid HTTP/HTTPS URL`})}static validateServiceWorkerPath(e){this.validateValue("serviceWorkerPath",e,{required:!1,type:"string",pattern:/^[a-zA-Z0-9_./-]+\.js$/,message:"serviceWorkerPath must be a valid JavaScript file path"})}}class l{constructor(){this.browserInfo=null}static getInstance(){return l.instance||(l.instance=new l),l.instance}getBrowserInfo(){if(this.browserInfo)return this.browserInfo;const e="undefined"!=typeof navigator&&navigator.userAgent||"Test/1.0.0",t={name:"Unknown",version:"0.0.0",majorVersion:0,platform:this.detectPlatform(),userAgent:e,language:this.detectLanguage()};if(/Chrome\/(\d+)/.test(e)&&!/Edge|Edg/.test(e)){const r=e.match(/Chrome\/(\d+)\.(\d+)\.(\d+)/);r&&(t.name="Chrome",t.version=`${r[1]}.${r[2]}.${r[3]}`,t.majorVersion=parseInt(r[1]))}else if(/Firefox\/(\d+)/.test(e)){const r=e.match(/Firefox\/(\d+)\.(\d+)/);r&&(t.name="Firefox",t.version=`${r[1]}.${r[2]}`,t.majorVersion=parseInt(r[1]))}else if(/Safari\//.test(e)&&!/Chrome|Chromium/.test(e)){const r=e.match(/Version\/(\d+)\.(\d+)/);r&&(t.name="Safari",t.version=`${r[1]}.${r[2]}`,t.majorVersion=parseInt(r[1]))}else if(/Edg\/(\d+)/.test(e)){const r=e.match(/Edg\/(\d+)\.(\d+)\.(\d+)/);r&&(t.name="Edge",t.version=`${r[1]}.${r[2]}.${r[3]}`,t.majorVersion=parseInt(r[1]))}else if(/Edge\/(\d+)/.test(e)){const r=e.match(/Edge\/(\d+)\.(\d+)/);r&&(t.name="Edge Legacy",t.version=`${r[1]}.${r[2]}`,t.majorVersion=parseInt(r[1]))}else if(/OPR\/(\d+)/.test(e)){const r=e.match(/OPR\/(\d+)\.(\d+)\.(\d+)/);r&&(t.name="Opera",t.version=`${r[1]}.${r[2]}.${r[3]}`,t.majorVersion=parseInt(r[1]))}return this.browserInfo=t,t}detectPlatform(){if("undefined"==typeof navigator)return"Test";const e=navigator.userAgent||"";return/Windows/.test(e)?"Windows":/Mac OS X/.test(e)?"macOS":/Linux/.test(e)?"Linux":/Android/.test(e)?"Android":/iPhone|iPad|iPod/.test(e)?"iOS":"Unknown"}detectLanguage(){return"undefined"==typeof navigator?"en-US":navigator.language||navigator.languages?.[0]||"en-US"}getFeatureSupport(){return{serviceWorker:"serviceWorker"in navigator,pushManager:"PushManager"in window,notification:"Notification"in window,webPush:this.isWebPushSupported()}}detectWebPushCapability(){if("undefined"!=typeof jest)return{supported:!0,browserName:"Test",browserVersion:"1.0.0"};const e=this.getBrowserInfo();if("undefined"==typeof window)return{supported:!1,reason:"Not running in browser environment",browserName:e.name,browserVersion:e.version};if(!("serviceWorker"in navigator))return{supported:!1,reason:"Service Worker not supported",browserName:e.name,browserVersion:e.version};if(!("PushManager"in window))return{supported:!1,reason:"Push Manager not supported",browserName:e.name,browserVersion:e.version};if(!("Notification"in window))return{supported:!1,reason:"Notification API not supported",browserName:e.name,browserVersion:e.version};const t=this.checkBrowserVersionSupport(e);return t.supported?{supported:!0,browserName:e.name,browserVersion:e.version}:{supported:!1,reason:t.reason,browserName:e.name,browserVersion:e.version}}checkBrowserVersionSupport(e){switch(e.name){case"Safari":if(e.majorVersion<16)return{supported:!1,reason:"Safari version too old (requires 16+)"};break;case"Chrome":if(e.majorVersion<42)return{supported:!1,reason:"Chrome version too old (requires 42+)"};break;case"Firefox":if(e.majorVersion<44)return{supported:!1,reason:"Firefox version too old (requires 44+)"};break;case"Edge":if(e.majorVersion<17)return{supported:!1,reason:"Edge version too old (requires 17+)"};break;case"Edge Legacy":return{supported:!1,reason:"Edge Legacy not supported, please upgrade to new Edge"};case"Opera":if(e.majorVersion<39)return{supported:!1,reason:"Opera version too old (requires 39+)"};break;case"Unknown":return{supported:!1,reason:"Unknown browser, WebPush support uncertain"}}return{supported:!0}}isWebPushSupported(){return this.detectWebPushCapability().supported}getUnsupportedReason(){const e=this.detectWebPushCapability();return e.supported?void 0:e.reason}async checkNotificationPermission(){return"undefined"!=typeof window&&"Notification"in window?Notification.permission:(o.warn("Notification API not available"),"denied")}async requestNotificationPermission(){try{if("undefined"!=typeof window&&"Notification"in window&&"function"==typeof Notification.requestPermission)return await Notification.requestPermission();throw new Error("Notification permission request not supported")}catch(e){return o.error("Failed to request notification permission",e),this.handleBrowserSpecificError(e)}}requiresUserGesture(){return"Safari"===this.getBrowserInfo().name}handleBrowserSpecificError(e){const t=this.getBrowserInfo();let r="Permission denied";switch(t.name){case"Safari":r=`Safari: ${e.message}`;break;case"Chrome":r=`Chrome: ${e.message}`;break;case"Firefox":r=`Firefox: ${e.message}`;break;default:r=`${t.name}: ${e.message}`}return o.error("Browser specific error:",r),"denied"}checkBrowserSupport(){const e=this.detectWebPushCapability();return e.supported?(o.log("Browser supports Web Push:",{browser:`${e.browserName} ${e.browserVersion}`,features:this.getFeatureSupport()}),!0):(o.error("Browser not supported for Web Push:",e.reason),!1)}}const u=l.getInstance();const f=class e{static set(t,r){try{const n=JSON.stringify(r);localStorage.setItem(e.PREFIX+t,n)}catch(n){o.error("Storage set error:",n)}}static get(t,r){try{const n=localStorage.getItem(e.PREFIX+t);return null===n?r||null:JSON.parse(n)}catch(n){return o.error("Storage get error:",n),r||null}}static remove(t){try{localStorage.removeItem(e.PREFIX+t)}catch(r){o.error("Storage remove error:",r)}}static clear(){try{Object.keys(localStorage).forEach(t=>{t.startsWith(e.PREFIX)&&localStorage.removeItem(t)})}catch(t){o.error("Storage clear error:",t)}}};f.PREFIX="webpush_";let d=f;class p{constructor(e){this.registration=null,this.swUrl="/sw.js",this.eventEmitter=e,this.setupMessageListener()}static getInstance(e){return p.instance||(p.instance=new p(e)),p.instance}async checkServiceWorkerExists(e){try{return(await fetch(e,{method:"HEAD"})).ok}catch{return!1}}async autoDetectServiceWorkerUrl(){if("undefined"!=typeof window){const e=window.location.pathname;"/"!==(e.endsWith("/")?e:e+"/")?(this.swUrl="./sw.js",o.log("Detected subdirectory deployment, using relative path:",this.swUrl)):(this.swUrl="/sw.js",o.log("Detected root directory deployment, using absolute path:",this.swUrl));await this.checkServiceWorkerExists(this.swUrl)||o.warn("Default Service Worker path not available, will try other paths during registration")}}setServiceWorkerUrl(e){try{c.validateServiceWorkerPath(e),this.swUrl=e,o.log("Manually set Service Worker path:",e)}catch(t){if(t instanceof h)throw o.error("Set Service Worker path parameter validation failed",t.message),t;throw new Error("Failed to set Service Worker path")}}async register(){if(!("serviceWorker"in navigator))throw new Error("Service Worker is not supported");await this.autoDetectServiceWorkerUrl();const e=[this.swUrl,"./sw.js","/sw.js","/dist/sw.js","/assets/sw.js"],t=[...new Set(e)];let r=null;for(const i of t)try{return o.log("Attempting to register Service Worker:",i),this.registration=await navigator.serviceWorker.register(i),this.swUrl=i,o.log("Service Worker registration successful",{url:i,registration:this.registration}),await this.waitForServiceWorkerReady(),this.registration}catch(n){r=n,o.warn(`Service Worker registration failed (${i}):`,n);continue}throw o.error("All Service Worker paths failed to register",r),new Error(`Service Worker registration failed: ${r?.message||"Unknown error"}. Please ensure sw.js file exists in one of the following paths: ${t.join(", ")}`)}async waitForServiceWorkerReady(){if(!this.registration)throw new Error("Service Worker not registered");return new Promise(e=>{if(this.registration.active)return void e();const t=this.registration.installing||this.registration.waiting;t&&t.addEventListener("statechange",()=>{"activated"===t.state&&e()})})}async getPushSubscription(e){try{if(c.validateValue("vapidPublicKey",e,{required:!0,type:"string",min:1,max:512,message:"VAPID public key must be a valid string"}),!this.registration)throw new Error("Service Worker not registered");const t=this.getStoredVapidPublicKey();let r=await this.registration.pushManager.getSubscription();r&&t!==e&&(o.log("VAPID public key changed, unsubscribing existing subscription"),await r.unsubscribe(),r=null),r||(r=await this.registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:this.urlBase64ToUint8Array(e)}),this.setStoreVapidPublicKey(e)),o.log("Get push subscription successful",r);const n=this.getSubscriptionInfo(r);return o.log("Extracted subscription information:",{token:n.token,auth:n.auth,p256dh:n.p256dh,endpoint:n.endpoint}),{subscription:r,token:n.token||"",auth:n.auth||"",p256dh:n.p256dh||"",endpoint:n.endpoint||""}}catch(t){if(t instanceof h)throw o.error("Get push subscription parameter validation failed",t.message),t;throw o.error("Get push subscription failed",t),t}}getSubscriptionInfo(e){if(!e||!e.endpoint)return{token:null,auth:null,p256dh:null,endpoint:null};const t=e.endpoint,r=u.getBrowserInfo(),n=e.getKey?{auth:e.getKey("auth")?this.arrayBufferToBase64(e.getKey("auth")):null,p256dh:e.getKey("p256dh")?this.arrayBufferToBase64(e.getKey("p256dh")):null}:{auth:null,p256dh:null};o.log("Extract push subscription information",{browser:`${r.name} ${r.version}`,hasAuth:!!n.auth,hasP256dh:!!n.p256dh});try{if("Chrome"===r.name||"Edge"===r.name){const e=t.match(/https:\/\/fcm\.googleapis\.com\/fcm\/send\/(.+)/);if(e)return o.log("Extract Token using Chrome/Edge FCM format"),{token:e[1],auth:n.auth,p256dh:n.p256dh,endpoint:t};const r=t.match(/https:\/\/android\.googleapis\.com\/gcm\/send\/(.+)/);if(r)return o.log("Extract Token using Chrome/Edge GCM format"),{token:r[1],auth:n.auth,p256dh:n.p256dh,endpoint:t}}else if("Firefox"===r.name){const e=t.match(/https:\/\/updates\.push\.services\.mozilla\.com\/wpush\/v(\d+)\/(.+)/);if(e)return o.log(`Extract Token using Firefox WebPush v${e[1]} format`),{token:e[2],auth:n.auth,p256dh:n.p256dh,endpoint:t};const r=t.match(/https:\/\/updates\.push\.services\.mozilla\.com\/push\/(.+)/);if(r)return o.log("Extract Token using Firefox legacy format"),{token:r[1],auth:n.auth,p256dh:n.p256dh,endpoint:t}}else if("Safari"===r.name){if(r.majorVersion>=16){const e=t.match(/https:\/\/web\.push\.apple\.com\/(.+)/);if(e)return o.log("Extract Token using Safari Web Push format"),{token:e[1],auth:n.auth,p256dh:n.p256dh,endpoint:t}}if(t.includes("safari")||t.includes("apple"))return o.log("Safari push notification uses complete endpoint as identifier"),{token:this.generateSafariToken(t),auth:n.auth,p256dh:n.p256dh,endpoint:t}}else if("Opera"===r.name){const e=t.match(/https:\/\/fcm\.googleapis\.com\/fcm\/send\/(.+)/);if(e)return o.log("Extract Token using Opera FCM format"),{token:e[1],auth:n.auth,p256dh:n.p256dh,endpoint:t}}else if("Samsung Internet"===r.name){const e=t.match(/https:\/\/fcm\.googleapis\.com\/fcm\/send\/(.+)/);if(e)return o.log("Extract Token using Samsung Internet FCM format"),{token:e[1],auth:n.auth,p256dh:n.p256dh,endpoint:t}}const e=[{pattern:/https:\/\/fcm\.googleapis\.com\/fcm\/send\/(.+)/,name:"FCM Standard"},{pattern:/https:\/\/android\.googleapis\.com\/gcm\/send\/(.+)/,name:"GCM Legacy"},{pattern:/https:\/\/gcm-http\.googleapis\.com\/gcm\/(.+)/,name:"GCM HTTP"},{pattern:/https:\/\/updates\.push\.services\.mozilla\.com\/wpush\/v\d+\/(.+)/,name:"Mozilla WebPush"},{pattern:/https:\/\/updates\.push\.services\.mozilla\.com\/push\/(.+)/,name:"Mozilla Legacy"},{pattern:/https:\/\/.*\.notify\.windows\.com\/.*\/(.+)/,name:"Windows Notification"},{pattern:/https:\/\/web\.push\.apple\.com\/(.+)/,name:"Apple Web Push"},{pattern:/https:\/\/.*\/push\/(.+)/,name:"Generic Push"},{pattern:/https:\/\/.*\/wpush\/(.+)/,name:"Generic WebPush"}];for(const{pattern:i,name:s}of e){const e=t.match(i);if(e&&e[1])return o.log(`Extract Token using generic pattern: ${s}`,{browser:r.name,pattern:i.source}),{token:e[1],auth:n.auth,p256dh:n.p256dh,endpoint:t}}o.warn("Unable to extract standard Token from push endpoint, generating unique identifier",{browser:`${r.name} ${r.version}`,endpointLength:t.length,endpointStart:t.substring(0,50)+"..."});return{token:this.generateFallbackToken(t,r),auth:n.auth,p256dh:n.p256dh,endpoint:t}}catch(i){o.error("Error occurred during push subscription information extraction",{error:i instanceof Error?i.message:i,browser:r.name,endpointDomain:t.split("/")[2]});return{token:this.generateFallbackToken(t,r),auth:n.auth,p256dh:n.p256dh,endpoint:t}}}generateSafariToken(e){const t=e.match(/https:\/\/.*safari.*\/(.+)/);return t?`safari_${t[1]}`:`safari_${this.generateEndpointHash(e)}`}generateFallbackToken(e,t){const r=this.generateEndpointHash(e);return`${t.name.toLowerCase().replace(/\s+/g,"")}_${r}_${Date.now().toString(36)}`}generateEndpointHash(e){let t=0;for(let r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t&=t}return Math.abs(t).toString(36)}async unsubscribe(){if(!this.registration)return!1;const e=await this.registration.pushManager.getSubscription();if(e){const t=await e.unsubscribe();return o.log("Unsubscribe from push notifications",t),this.clearStoredVapidPublicKey(),t}return!0}async unregister(){if(!this.registration)return!1;const e=await this.registration.unregister();return this.registration=null,this.clearStoredVapidPublicKey(),o.log("Unregister Service Worker",e),e}setupMessageListener(){"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",e=>{const t=e.data;this.handleServiceWorkerMessage(t)})}handleServiceWorkerMessage(e){switch(o.log("Received Service Worker message",e),e.type){case"MESSAGE_RECEIVED":this.eventEmitter.emit(n.MESSAGE_RECEIVED,e.data);break;case"NOTIFICATION_CLICKED":this.eventEmitter.emit(n.NOTIFICATION_CLICKED,e.data);break;case"MESSAGE_REVOKED":this.eventEmitter.emit(n.MESSAGE_REVOKED,e.data)}}async postMessage(e){try{if(c.validateValue("message",e,{required:!0,message:"Message content cannot be empty"}),!this.registration||!this.registration.active)throw new Error("Service Worker not activated");this.registration.active.postMessage(e),o.log("Send message to Service Worker successful",e)}catch(t){if(t instanceof h)throw o.error("Send message parameter validation failed",t.message),t;throw o.error("Send message to Service Worker failed",t),t}}arrayBufferToBase64(e){const t=new Uint8Array(e);let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return window.btoa(r)}urlBase64ToUint8Array(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(t),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}getRegistration(){return this.registration}getStoredVapidPublicKey(){try{return d.get("sdk_vapid_key")}catch(e){return o.error("Failed to get stored VAPID public key",e),null}}setStoreVapidPublicKey(e){try{d.set("sdk_vapid_key",e),o.log("VAPID public key stored successfully")}catch(t){o.error("Failed to store VAPID public key",t)}}clearStoredVapidPublicKey(){try{d.remove("sdk_vapid_key"),o.log("VAPID public key cleared successfully")}catch(e){o.error("Failed to clear VAPID public key",e)}}}var g="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_=[],v=[],w="undefined"!=typeof Uint8Array?Uint8Array:Array,m=!1;function b(){m=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)_[t]=e[t],v[e.charCodeAt(t)]=t;v["-".charCodeAt(0)]=62,v["_".charCodeAt(0)]=63}function y(e,t,r){for(var n,i,s=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],s.push(_[(i=n)>>18&63]+_[i>>12&63]+_[i>>6&63]+_[63&i]);return s.join("")}function k(e){var t;m||b();for(var r=e.length,n=r%3,i="",s=[],o=0,a=r-n;o<a;o+=16383)s.push(y(e,o,o+16383>a?a:o+16383));return 1===n?(t=e[r-1],i+=_[t>>2],i+=_[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=_[t>>10],i+=_[t>>4&63],i+=_[t<<2&63],i+="="),s.push(i),s.join("")}function E(e,t,r,n,i){var s,o,a=8*i-n-1,h=(1<<a)-1,c=h>>1,l=-7,u=r?i-1:0,f=r?-1:1,d=e[t+u];for(u+=f,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+e[t+u],u+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+u],u+=f,l-=8);if(0===s)s=1-c;else{if(s===h)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)}function S(e,t,r,n,i,s){var o,a,h,c=8*s-i-1,l=(1<<c)-1,u=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-o))<1&&(o--,h*=2),(t+=o+u>=1?f/h:f*Math.pow(2,1-u))*h>=2&&(o++,h/=2),o+u>=l?(a=0,o=l):o+u>=1?(a=(t*h-1)*Math.pow(2,i),o+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*g}var x={}.toString,A=Array.isArray||function(e){return"[object Array]"==x.call(e)};function R(){return I.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(e,t){if(R()<t)throw new RangeError("Invalid typed array length");return I.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=I.prototype:(null===e&&(e=new I(t)),e.length=t),e}function I(e,t,r){if(!(I.TYPED_ARRAY_SUPPORT||this instanceof I))return new I(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 L(this,e)}return P(this,e,t,r)}function P(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),I.TYPED_ARRAY_SUPPORT?(e=t).__proto__=I.prototype:e=z(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!I.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|M(t,r),i=(e=B(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):function(e,t){if(C(t)){var r=0|T(t.length);return 0===(e=B(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?B(e,0):z(e,t);if("Buffer"===t.type&&A(t.data))return z(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function D(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function L(e,t){if(D(t),e=B(e,t<0?0:0|T(t)),!I.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function z(e,t){var r=t.length<0?0:0|T(t.length);e=B(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function T(e){if(e>=R())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R().toString(16)+" bytes");return 0|e}function C(e){return!(null==e||!e._isBuffer)}function M(e,t){if(C(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ce(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return le(e).length;default:if(n)return ce(e).length;t=(""+t).toLowerCase(),n=!0}}function O(e,t,r){var n=!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 J(this,t,r);case"utf8":case"utf-8":return q(this,t,r);case"ascii":return X(this,t,r);case"latin1":case"binary":return G(this,t,r);case"base64":return $(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function U(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function N(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=I.from(t,n)),C(t))return 0===t.length?-1:F(e,t,r,n,i);if("number"==typeof t)return t&=255,I.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):F(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function F(e,t,r,n,i){var s,o=1,a=e.length,h=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,h/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===h)return l*o}else-1!==l&&(s-=s-l),l=-1}else for(r+h>a&&(r=a-h),s=r;s>=0;s--){for(var u=!0,f=0;f<h;f++)if(c(e,s+f)!==c(t,f)){u=!1;break}if(u)return s}return-1}function W(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[r+o]=a}return o}function H(e,t,r,n){return ue(ce(t,e.length-r),e,r,n)}function Z(e,t,r,n){return ue(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function j(e,t,r,n){return Z(e,t,r,n)}function K(e,t,r,n){return ue(le(t),e,r,n)}function V(e,t,r,n){return ue(function(e,t){for(var r,n,i,s=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function $(e,t,r){return 0===t&&r===e.length?k(e):k(e.slice(t,r))}function q(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,o,a,h,c=e[i],l=null,u=c>239?4:c>223?3:c>191?2:1;if(i+u<=r)switch(u){case 1:c<128&&(l=c);break;case 2:128==(192&(s=e[i+1]))&&(h=(31&c)<<6|63&s)>127&&(l=h);break;case 3:s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(h=(15&c)<<12|(63&s)<<6|63&o)>2047&&(h<55296||h>57343)&&(l=h);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(h=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&h<1114112&&(l=h)}null===l?(l=65533,u=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=u}return function(e){var t=e.length;if(t<=Y)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Y));return r}(n)}I.TYPED_ARRAY_SUPPORT=void 0===g.TYPED_ARRAY_SUPPORT||g.TYPED_ARRAY_SUPPORT,I.poolSize=8192,I._augment=function(e){return e.__proto__=I.prototype,e},I.from=function(e,t,r){return P(null,e,t,r)},I.TYPED_ARRAY_SUPPORT&&(I.prototype.__proto__=Uint8Array.prototype,I.__proto__=Uint8Array),I.alloc=function(e,t,r){return n=null,s=t,o=r,D(i=e),i<=0?B(n,i):void 0!==s?"string"==typeof o?B(n,i).fill(s,o):B(n,i).fill(s):B(n,i);var n,i,s,o},I.allocUnsafe=function(e){return L(null,e)},I.allocUnsafeSlow=function(e){return L(null,e)},I.isBuffer=fe,I.compare=function(e,t){if(!C(e)||!C(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},I.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}},I.concat=function(e,t){if(!A(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return I.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=I.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!C(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},I.byteLength=M,I.prototype._isBuffer=!0,I.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)U(this,t,t+1);return this},I.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)U(this,t,t+3),U(this,t+1,t+2);return this},I.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)U(this,t,t+7),U(this,t+1,t+6),U(this,t+2,t+5),U(this,t+3,t+4);return this},I.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?q(this,0,e):O.apply(this,arguments)},I.prototype.equals=function(e){if(!C(e))throw new TypeError("Argument must be a Buffer");return this===e||0===I.compare(this,e)},I.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+">"},I.prototype.compare=function(e,t,r,n,i){if(!C(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===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),a=Math.min(s,o),h=this.slice(n,i),c=e.slice(t,r),l=0;l<a;++l)if(h[l]!==c[l]){s=h[l],o=c[l];break}return s<o?-1:o<s?1:0},I.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},I.prototype.indexOf=function(e,t,r){return N(this,e,t,r,!0)},I.prototype.lastIndexOf=function(e,t,r){return N(this,e,t,r,!1)},I.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=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===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return W(this,e,t,r);case"utf8":case"utf-8":return H(this,e,t,r);case"ascii":return Z(this,e,t,r);case"latin1":case"binary":return j(this,e,t,r);case"base64":return K(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},I.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Y=4096;function X(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function G(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function J(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=he(e[s]);return i}function Q(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function ee(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 te(e,t,r,n,i,s){if(!C(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function re(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-r,2);i<s;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function ne(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-r,4);i<s;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function ie(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function se(e,t,r,n,i){return i||ie(e,0,r,4),S(e,t,r,n,23,4),r+4}function oe(e,t,r,n,i){return i||ie(e,0,r,8),S(e,t,r,n,52,8),r+8}I.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),I.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=I.prototype;else{var i=t-e;r=new I(i,void 0);for(var s=0;s<i;++s)r[s]=this[s+e]}return r},I.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||ee(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},I.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||ee(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},I.prototype.readUInt8=function(e,t){return t||ee(e,1,this.length),this[e]},I.prototype.readUInt16LE=function(e,t){return t||ee(e,2,this.length),this[e]|this[e+1]<<8},I.prototype.readUInt16BE=function(e,t){return t||ee(e,2,this.length),this[e]<<8|this[e+1]},I.prototype.readUInt32LE=function(e,t){return t||ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},I.prototype.readUInt32BE=function(e,t){return t||ee(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},I.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||ee(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},I.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||ee(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},I.prototype.readInt8=function(e,t){return t||ee(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},I.prototype.readInt16LE=function(e,t){t||ee(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},I.prototype.readInt16BE=function(e,t){t||ee(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},I.prototype.readInt32LE=function(e,t){return t||ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},I.prototype.readInt32BE=function(e,t){return t||ee(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},I.prototype.readFloatLE=function(e,t){return t||ee(e,4,this.length),E(this,e,!0,23,4)},I.prototype.readFloatBE=function(e,t){return t||ee(e,4,this.length),E(this,e,!1,23,4)},I.prototype.readDoubleLE=function(e,t){return t||ee(e,8,this.length),E(this,e,!0,52,8)},I.prototype.readDoubleBE=function(e,t){return t||ee(e,8,this.length),E(this,e,!1,52,8)},I.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||te(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},I.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||te(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},I.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,1,255,0),I.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},I.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,2,65535,0),I.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):re(this,e,t,!0),t+2},I.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,2,65535,0),I.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):re(this,e,t,!1),t+2},I.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,4,4294967295,0),I.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):ne(this,e,t,!0),t+4},I.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,4,4294967295,0),I.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ne(this,e,t,!1),t+4},I.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);te(this,e,t,r,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s<r&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o|0)-a&255;return t+r},I.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);te(this,e,t,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o|0)-a&255;return t+r},I.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,1,127,-128),I.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},I.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,2,32767,-32768),I.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):re(this,e,t,!0),t+2},I.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,2,32767,-32768),I.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):re(this,e,t,!1),t+2},I.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,4,2147483647,-2147483648),I.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):ne(this,e,t,!0),t+4},I.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||te(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),I.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ne(this,e,t,!1),t+4},I.prototype.writeFloatLE=function(e,t,r){return se(this,e,t,!0,r)},I.prototype.writeFloatBE=function(e,t,r){return se(this,e,t,!1,r)},I.prototype.writeDoubleLE=function(e,t,r){return oe(this,e,t,!0,r)},I.prototype.writeDoubleBE=function(e,t,r){return oe(this,e,t,!1,r)},I.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===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("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,s=n-r;if(this===e&&r<t&&t<n)for(i=s-1;i>=0;--i)e[i+t]=this[i+r];else if(s<1e3||!I.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s},I.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!I.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}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 s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var o=C(e)?e:ce(new I(e,n).toString()),a=o.length;for(s=0;s<r-t;++s)this[s+t]=o[s%a]}return this};var ae=/[^+\/0-9A-Za-z-_]/g;function he(e){return e<16?"0"+e.toString(16):e.toString(16)}function ce(e,t){var r;t=t||1/0;for(var n=e.length,i=null,s=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function le(e){return function(e){var t,r,n,i,s,o;m||b();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[a-2]?2:"="===e[a-1]?1:0,o=new w(3*a/4-s),n=s>0?a-4:a;var h=0;for(t=0,r=0;t<n;t+=4,r+=3)i=v[e.charCodeAt(t)]<<18|v[e.charCodeAt(t+1)]<<12|v[e.charCodeAt(t+2)]<<6|v[e.charCodeAt(t+3)],o[h++]=i>>16&255,o[h++]=i>>8&255,o[h++]=255&i;return 2===s?(i=v[e.charCodeAt(t)]<<2|v[e.charCodeAt(t+1)]>>4,o[h++]=255&i):1===s&&(i=v[e.charCodeAt(t)]<<10|v[e.charCodeAt(t+1)]<<4|v[e.charCodeAt(t+2)]>>2,o[h++]=i>>8&255,o[h++]=255&i),o}(function(e){if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(ae,"")).length<2)return"";for(var t;e.length%4!=0;)e+="=";return e}(e))}function ue(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function fe(e){return null!=e&&(!!e._isBuffer||de(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&de(t.slice(0,0)));var t}function de(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function pe(e,t){return e(t={exports:{}},t.exports),t.exports}var ge=pe(function(e,t){var r,n,i,s,o,a,h,c,l,u,f,d,p;e.exports=(r=r||(n=Math,i=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),o=(s={}).lib={},a=o.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},h=o.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<i;s++){var o=r[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(s=0;s<i;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=n.ceil(t/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(e){var t=987654321,r=4294967295;return function(){var i=((t=36969*(65535&t)+(t>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return i/=4294967296,(i+=.5)*(n.random()>.5?1:-1)}},s=0;s<e;s+=4){var o=i(4294967296*(t||n.random()));t=987654071*o(),r.push(4294967296*o()|0)}return new h.init(r,e)}}),c=s.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var s=t[i>>>2]>>>24-i%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new h.init(r,t/2)}},u=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var s=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new h.init(r,t)}},f=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,s=this.blockSize,o=i/(4*s),a=(o=e?n.ceil(o):n.max((0|o)-this._minBufferSize,0))*s,c=n.min(4*a,i);if(a){for(var l=0;l<a;l+=s)this._doProcessBlock(r,l);var u=r.splice(0,a);t.sigBytes-=c}return new h.init(u,c)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),o.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}}),p=s.algo={},s),r)}),_e=(pe(function(e,t){var r,n,i,s,o,a;e.exports=(i=(n=r=ge).lib,s=i.Base,o=i.WordArray,(a=n.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var e=s.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),r)}),pe(function(e,t){var r;e.exports=(r=ge,function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)}),pe(function(e,t){var r;e.exports=(r=ge,function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var s=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],s=0;s<r;s+=2){var o=i(t[s>>>2]>>>16-s%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],s=0;s<r;s++)n[s>>>1]|=i(e.charCodeAt(s)<<16-s%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)}),pe(function(e,t){var r,n,i;e.exports=(i=(n=r=ge).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],s=0;s<r;s+=3)for(var o=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<r;a++)i.push(n.charAt(o>>>6*(3-a)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var s=0;s<r.length;s++)n[r.charCodeAt(s)]=s}var o=r.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return function(e,t,r){for(var n=[],s=0,o=0;o<t;o++)if(o%4){var a=r[e.charCodeAt(o-1)]<<o%4*2,h=r[e.charCodeAt(o)]>>>6-o%4*2;n[s>>>2]|=(a|h)<<24-s%4*8,s++}return i.create(n,s)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)}),pe(function(e,t){var r;e.exports=(r=ge,function(e){var t=r,n=t.lib,i=n.WordArray,s=n.Hasher,o=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var h=o.MD5=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var s=this._hash.words,o=e[t+0],h=e[t+1],d=e[t+2],p=e[t+3],g=e[t+4],_=e[t+5],v=e[t+6],w=e[t+7],m=e[t+8],b=e[t+9],y=e[t+10],k=e[t+11],E=e[t+12],S=e[t+13],x=e[t+14],A=e[t+15],R=s[0],B=s[1],I=s[2],P=s[3];R=c(R,B,I,P,o,7,a[0]),P=c(P,R,B,I,h,12,a[1]),I=c(I,P,R,B,d,17,a[2]),B=c(B,I,P,R,p,22,a[3]),R=c(R,B,I,P,g,7,a[4]),P=c(P,R,B,I,_,12,a[5]),I=c(I,P,R,B,v,17,a[6]),B=c(B,I,P,R,w,22,a[7]),R=c(R,B,I,P,m,7,a[8]),P=c(P,R,B,I,b,12,a[9]),I=c(I,P,R,B,y,17,a[10]),B=c(B,I,P,R,k,22,a[11]),R=c(R,B,I,P,E,7,a[12]),P=c(P,R,B,I,S,12,a[13]),I=c(I,P,R,B,x,17,a[14]),R=l(R,B=c(B,I,P,R,A,22,a[15]),I,P,h,5,a[16]),P=l(P,R,B,I,v,9,a[17]),I=l(I,P,R,B,k,14,a[18]),B=l(B,I,P,R,o,20,a[19]),R=l(R,B,I,P,_,5,a[20]),P=l(P,R,B,I,y,9,a[21]),I=l(I,P,R,B,A,14,a[22]),B=l(B,I,P,R,g,20,a[23]),R=l(R,B,I,P,b,5,a[24]),P=l(P,R,B,I,x,9,a[25]),I=l(I,P,R,B,p,14,a[26]),B=l(B,I,P,R,m,20,a[27]),R=l(R,B,I,P,S,5,a[28]),P=l(P,R,B,I,d,9,a[29]),I=l(I,P,R,B,w,14,a[30]),R=u(R,B=l(B,I,P,R,E,20,a[31]),I,P,_,4,a[32]),P=u(P,R,B,I,m,11,a[33]),I=u(I,P,R,B,k,16,a[34]),B=u(B,I,P,R,x,23,a[35]),R=u(R,B,I,P,h,4,a[36]),P=u(P,R,B,I,g,11,a[37]),I=u(I,P,R,B,w,16,a[38]),B=u(B,I,P,R,y,23,a[39]),R=u(R,B,I,P,S,4,a[40]),P=u(P,R,B,I,o,11,a[41]),I=u(I,P,R,B,p,16,a[42]),B=u(B,I,P,R,v,23,a[43]),R=u(R,B,I,P,b,4,a[44]),P=u(P,R,B,I,E,11,a[45]),I=u(I,P,R,B,A,16,a[46]),R=f(R,B=u(B,I,P,R,d,23,a[47]),I,P,o,6,a[48]),P=f(P,R,B,I,w,10,a[49]),I=f(I,P,R,B,x,15,a[50]),B=f(B,I,P,R,_,21,a[51]),R=f(R,B,I,P,E,6,a[52]),P=f(P,R,B,I,p,10,a[53]),I=f(I,P,R,B,y,15,a[54]),B=f(B,I,P,R,h,21,a[55]),R=f(R,B,I,P,m,6,a[56]),P=f(P,R,B,I,A,10,a[57]),I=f(I,P,R,B,v,15,a[58]),B=f(B,I,P,R,S,21,a[59]),R=f(R,B,I,P,g,6,a[60]),P=f(P,R,B,I,k,10,a[61]),I=f(I,P,R,B,d,15,a[62]),B=f(B,I,P,R,b,21,a[63]),s[0]=s[0]+R|0,s[1]=s[1]+B|0,s[2]=s[2]+I|0,s[3]=s[3]+P|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var s=e.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,h=a.words,c=0;c<4;c++){var l=h[c];h[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,r,n,i,s,o){var a=e+(t&r|~t&n)+i+o;return(a<<s|a>>>32-s)+t}function l(e,t,r,n,i,s,o){var a=e+(t&n|r&~n)+i+o;return(a<<s|a>>>32-s)+t}function u(e,t,r,n,i,s,o){var a=e+(t^r^n)+i+o;return(a<<s|a>>>32-s)+t}function f(e,t,r,n,i,s,o){var a=e+(r^(t|~n))+i+o;return(a<<s|a>>>32-s)+t}t.MD5=s._createHelper(h),t.HmacMD5=s._createHmacHelper(h)}(Math),r.MD5)}),pe(function(e,t){var r,n,i,s,o,a,h,c;e.exports=(i=(n=r=ge).lib,s=i.WordArray,o=i.Hasher,a=n.algo,h=[],c=a.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],c=0;c<80;c++){if(c<16)h[c]=0|e[t+c];else{var l=h[c-3]^h[c-8]^h[c-14]^h[c-16];h[c]=l<<1|l>>>31}var u=(n<<5|n>>>27)+a+h[c];u+=c<20?1518500249+(i&s|~i&o):c<40?1859775393+(i^s^o):c<60?(i&s|i&o|s&o)-1894007588:(i^s^o)-899497514,a=o,o=s,s=i<<30|i>>>2,i=n,n=u}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=o._createHelper(c),n.HmacSHA1=o._createHmacHelper(c),r.SHA1)}),pe(function(e,t){var r;e.exports=(r=ge,function(e){var t=r,n=t.lib,i=n.WordArray,s=n.Hasher,o=t.algo,a=[],h=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(a[i]=r(e.pow(n,.5))),h[i]=r(e.pow(n,1/3)),i++),n++}();var c=[],l=o.SHA256=s.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],l=r[5],u=r[6],f=r[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var p=c[d-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,_=c[d-2],v=(_<<15|_>>>17)^(_<<13|_>>>19)^_>>>10;c[d]=g+c[d-7]+v+c[d-16]}var w=n&i^n&s^i&s,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),b=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&u)+h[d]+c[d];f=u,u=l,l=a,a=o+b|0,o=s,s=i,i=n,n=b+(m+w)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+u|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=s._createHelper(l),t.HmacSHA256=s._createHmacHelper(l)}(Math),r.SHA256)}),pe(function(e,t){var r,n,i,s,o,a;e.exports=(i=(n=r=ge).lib.WordArray,s=n.algo,o=s.SHA256,a=s.SHA224=o.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=o._createHelper(a),n.HmacSHA224=o._createHmacHelper(a),r.SHA224)}),pe(function(e,t){var r;e.exports=(r=ge,function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,s=n.WordArray,o=e.algo;function a(){return i.create.apply(i,arguments)}var h=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=a()}();var l=o.SHA512=t.extend({_doReset:function(){this._hash=new s.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],l=r[5],u=r[6],f=r[7],d=n.high,p=n.low,g=i.high,_=i.low,v=s.high,w=s.low,m=o.high,b=o.low,y=a.high,k=a.low,E=l.high,S=l.low,x=u.high,A=u.low,R=f.high,B=f.low,I=d,P=p,D=g,L=_,z=v,T=w,C=m,M=b,O=y,U=k,N=E,F=S,W=x,H=A,Z=R,j=B,K=0;K<80;K++){var V=c[K];if(K<16)var $=V.high=0|e[t+2*K],q=V.low=0|e[t+2*K+1];else{var Y=c[K-15],X=Y.high,G=Y.low,J=(X>>>1|G<<31)^(X>>>8|G<<24)^X>>>7,Q=(G>>>1|X<<31)^(G>>>8|X<<24)^(G>>>7|X<<25),ee=c[K-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),se=c[K-7],oe=se.high,ae=se.low,he=c[K-16],ce=he.high,le=he.low;$=($=($=J+oe+((q=Q+ae)>>>0<Q>>>0?1:0))+ne+((q+=ie)>>>0<ie>>>0?1:0))+ce+((q+=le)>>>0<le>>>0?1:0),V.high=$,V.low=q}var ue,fe=O&N^~O&W,de=U&F^~U&H,pe=I&D^I&z^D&z,ge=P&L^P&T^L&T,_e=(I>>>28|P<<4)^(I<<30|P>>>2)^(I<<25|P>>>7),ve=(P>>>28|I<<4)^(P<<30|I>>>2)^(P<<25|I>>>7),we=(O>>>14|U<<18)^(O>>>18|U<<14)^(O<<23|U>>>9),me=(U>>>14|O<<18)^(U>>>18|O<<14)^(U<<23|O>>>9),be=h[K],ye=be.high,ke=be.low,Ee=Z+we+((ue=j+me)>>>0<j>>>0?1:0),Se=ve+ge;Z=W,j=H,W=N,H=F,N=O,F=U,O=C+(Ee=(Ee=(Ee=Ee+fe+((ue+=de)>>>0<de>>>0?1:0))+ye+((ue+=ke)>>>0<ke>>>0?1:0))+$+((ue+=q)>>>0<q>>>0?1:0))+((U=M+ue|0)>>>0<M>>>0?1:0)|0,C=z,M=T,z=D,T=L,D=I,L=P,I=Ee+(_e+pe+(Se>>>0<ve>>>0?1:0))+((P=ue+Se|0)>>>0<ue>>>0?1:0)|0}p=n.low=p+P,n.high=d+I+(p>>>0<P>>>0?1:0),_=i.low=_+L,i.high=g+D+(_>>>0<L>>>0?1:0),w=s.low=w+T,s.high=v+z+(w>>>0<T>>>0?1:0),b=o.low=b+M,o.high=m+C+(b>>>0<M>>>0?1:0),k=a.low=k+U,a.high=y+O+(k>>>0<U>>>0?1:0),S=l.low=S+F,l.high=E+N+(S>>>0<F>>>0?1:0),A=u.low=A+H,u.high=x+W+(A>>>0<H>>>0?1:0),B=f.low=B+j,f.high=R+Z+(B>>>0<j>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),r.SHA512)}),pe(function(e,t){var r,n,i,s,o,a,h,c;e.exports=(i=(n=r=ge).x64,s=i.Word,o=i.WordArray,a=n.algo,h=a.SHA512,c=a.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var e=h._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=h._createHelper(c),n.HmacSHA384=h._createHmacHelper(c),r.SHA384)}),pe(function(e,t){var r;e.exports=(r=ge,function(e){var t=r,n=t.lib,i=n.WordArray,s=n.Hasher,o=t.x64.Word,a=t.algo,h=[],c=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){h[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,s=0;s<24;s++){for(var a=0,u=0,f=0;f<7;f++){if(1&i){var d=(1<<f)-1;d<32?u^=1<<d:a^=1<<d-32}128&i?i=i<<1^113:i<<=1}l[s]=o.create(a,u)}}();var u=[];!function(){for(var e=0;e<25;e++)u[e]=o.create()}();var f=a.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var s=e[t+2*i],o=e[t+2*i+1];s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(B=r[i]).high^=o,B.low^=s}for(var a=0;a<24;a++){for(var f=0;f<5;f++){for(var d=0,p=0,g=0;g<5;g++)d^=(B=r[f+5*g]).high,p^=B.low;var _=u[f];_.high=d,_.low=p}for(f=0;f<5;f++){var v=u[(f+4)%5],w=u[(f+1)%5],m=w.high,b=w.low;for(d=v.high^(m<<1|b>>>31),p=v.low^(b<<1|m>>>31),g=0;g<5;g++)(B=r[f+5*g]).high^=d,B.low^=p}for(var y=1;y<25;y++){var k=(B=r[y]).high,E=B.low,S=h[y];S<32?(d=k<<S|E>>>32-S,p=E<<S|k>>>32-S):(d=E<<S-32|k>>>64-S,p=k<<S-32|E>>>64-S);var x=u[c[y]];x.high=d,x.low=p}var A=u[0],R=r[0];for(A.high=R.high,A.low=R.low,f=0;f<5;f++)for(g=0;g<5;g++){var B=r[y=f+5*g],I=u[y],P=u[(f+1)%5+5*g],D=u[(f+2)%5+5*g];B.high=I.high^~P.high&D.high,B.low=I.low^~P.low&D.low}B=r[0];var L=l[a];B.high^=L.high,B.low^=L.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),s=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/s)*s>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var o=this._state,a=this.cfg.outputLength/8,h=a/8,c=[],l=0;l<h;l++){var u=o[l],f=u.high,d=u.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),c.push(d),c.push(f)}return new i.init(c,a)},clone:function(){for(var e=s.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=s._createHelper(f),t.HmacSHA3=s._createHmacHelper(f)}(Math),r.SHA3)}),pe(function(e,t){var r;e.exports=(r=ge,function(){var e=r,t=e.lib,n=t.WordArray,i=t.Hasher,s=e.algo,o=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),a=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=n.create([0,1518500249,1859775393,2400959708,2840853838]),u=n.create([1352829926,1548603684,1836072691,2053994217,0]),f=s.RIPEMD160=i.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var s,f,m,b,y,k,E,S,x,A,R,B=this._hash.words,I=l.words,P=u.words,D=o.words,L=a.words,z=h.words,T=c.words;for(k=s=B[0],E=f=B[1],S=m=B[2],x=b=B[3],A=y=B[4],r=0;r<80;r+=1)R=s+e[t+D[r]]|0,R+=r<16?d(f,m,b)+I[0]:r<32?p(f,m,b)+I[1]:r<48?g(f,m,b)+I[2]:r<64?_(f,m,b)+I[3]:v(f,m,b)+I[4],R=(R=w(R|=0,z[r]))+y|0,s=y,y=b,b=w(m,10),m=f,f=R,R=k+e[t+L[r]]|0,R+=r<16?v(E,S,x)+P[0]:r<32?_(E,S,x)+P[1]:r<48?g(E,S,x)+P[2]:r<64?p(E,S,x)+P[3]:d(E,S,x)+P[4],R=(R=w(R|=0,T[r]))+A|0,k=A,A=x,x=w(S,10),S=E,E=R;R=B[1]+m+x|0,B[1]=B[2]+b+A|0,B[2]=B[3]+y+k|0,B[3]=B[4]+s+E|0,B[4]=B[0]+f+S|0,B[0]=R},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,s=i.words,o=0;o<5;o++){var a=s[o];s[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r){return e^t^r}function p(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function _(e,t,r){return e&r|t&~r}function v(e,t,r){return e^(t|~r)}function w(e,t){return e<<t|e>>>32-t}e.RIPEMD160=i._createHelper(f),e.HmacRIPEMD160=i._createHmacHelper(f)}(),r.RIPEMD160)}),pe(function(e,t){var r,n,i,s;e.exports=(n=(r=ge).lib.Base,i=r.enc,s=i.Utf8,void(r.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,h=o.words,c=0;c<r;c++)a[c]^=1549556828,h[c]^=909522486;i.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))}),pe(function(e,t){var r,n,i,s,o,a,h,c,l;e.exports=(s=(i=(n=r=ge).lib).Base,o=i.WordArray,h=(a=n.algo).SHA1,c=a.HMAC,l=a.PBKDF2=s.extend({cfg:s.extend({keySize:4,hasher:h,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=c.create(r.hasher,e),i=o.create(),s=o.create([1]),a=i.words,h=s.words,l=r.keySize,u=r.iterations;a.length<l;){var f=n.update(t).finalize(s);n.reset();for(var d=f.words,p=d.length,g=f,_=1;_<u;_++){g=n.finalize(g),n.reset();for(var v=g.words,w=0;w<p;w++)d[w]^=v[w]}i.concat(f),h[0]++}return i.sigBytes=4*l,i}}),n.PBKDF2=function(e,t,r){return l.create(r).compute(e,t)},r.PBKDF2)}),pe(function(e,t){var r,n,i,s,o,a,h,c;e.exports=(s=(i=(n=r=ge).lib).Base,o=i.WordArray,h=(a=n.algo).MD5,c=a.EvpKDF=s.extend({cfg:s.extend({keySize:4,hasher:h,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),i=o.create(),s=i.words,a=r.keySize,h=r.iterations;s.length<a;){c&&n.update(c);var c=n.update(e).finalize(t);n.reset();for(var l=1;l<h;l++)c=n.finalize(c),n.reset();i.concat(c)}return i.sigBytes=4*a,i}}),n.EvpKDF=function(e,t,r){return c.create(r).compute(e,t)},r.EvpKDF)}),pe(function(e,t){var r,n,i,s,o,a,h,c,l,u,f,d,p,g,_,v,w,m,b,y,k,E,S;e.exports=void((r=ge).lib.Cipher||(n=r,i=n.lib,s=i.Base,o=i.WordArray,a=i.BufferedBlockAlgorithm,h=n.enc,h.Utf8,c=h.Base64,l=n.algo,u=l.EvpKDF,f=i.Cipher=a.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?S:y}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),i.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=n.mode={},p=i.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),g=d.CBC=function(){var e=p.extend();function t(e,t,r){var n=this._iv;if(n){var i=n;this._iv=undefined}else i=this._prevBlock;for(var s=0;s<r;s++)e[t+s]^=i[s]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i),n.encryptBlock(e,r),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,s=e.slice(r,r+i);n.decryptBlock(e,r),t.call(this,e,r,i),this._prevBlock=s}}),e}(),_=n.pad={},v=_.Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var h=o.create(s,n);e.concat(h)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.BlockCipher=f.extend({cfg:f.cfg.extend({mode:g,padding:v}),reset:function(){f.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),w=i.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=n.format={},b=m.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=o.create([1398893684,1701076831]).concat(r).concat(t);else n=t;return n.toString(c)},parse:function(e){var t=c.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=o.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return w.create({ciphertext:t,salt:n})}},y=i.SerializableCipher=s.extend({cfg:s.extend({format:b}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),s=i.finalize(t),o=i.cfg;return w.create({ciphertext:s,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),k=n.kdf={},E=k.OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=u.create({keySize:t+r}).compute(e,n),s=o.create(i.words.slice(t),4*r);return i.sigBytes=4*t,w.create({key:i,iv:s,salt:n})}},S=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:E}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var s=y.encrypt.call(this,e,t,i.key,n);return s.mixIn(i),s},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,y.decrypt.call(this,e,t,i.key,n)}})))}),pe(function(e,t){var r;e.exports=((r=ge).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var i=this._iv;if(i){var s=i.slice(0);this._iv=void 0}else s=this._prevBlock;n.encryptBlock(s,0);for(var o=0;o<r;o++)e[t+o]^=s[o]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i,n),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,s=e.slice(r,r+i);t.call(this,e,r,i,n),this._prevBlock=s}}),e}(),r.mode.CFB)}),pe(function(e,t){var r,n,i;e.exports=((r=ge).mode.CTR=(i=(n=r.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0);var o=s.slice(0);r.encryptBlock(o,0),s[n-1]=s[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=o[a]}}),n.Decryptor=i,n),r.mode.CTR)}),pe(function(e,t){var r;e.exports=((r=ge).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255&~(e>>24))e+=1<<24;else{var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}return e}var n=e.Encryptor=e.extend({processBlock:function(e,r){var n,i=this._cipher,s=i.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),0===((n=a)[0]=t(n[0]))&&(n[1]=t(n[1]));var h=a.slice(0);i.encryptBlock(h,0);for(var c=0;c<s;c++)e[r+c]^=h[c]}});return e.Decryptor=n,e}(),r.mode.CTRGladman)}),pe(function(e,t){var r,n,i;e.exports=((r=ge).mode.OFB=(i=(n=r.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,s=this._keystream;i&&(s=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(s,0);for(var o=0;o<n;o++)e[t+o]^=s[o]}}),n.Decryptor=i,n),r.mode.OFB)}),pe(function(e,t){var r,n;e.exports=((r=ge).mode.ECB=((n=r.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),r.mode.ECB)}),pe(function(e,t){var r;e.exports=((r=ge).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,s=r+i-1;e.clamp(),e.words[s>>>2]|=i<<24-s%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)}),pe(function(e,t){var r;e.exports=((r=ge).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)}),pe(function(e,t){var r;e.exports=((r=ge).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)}),pe(function(e,t){var r;e.exports=((r=ge).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},r.pad.ZeroPadding)}),pe(function(e,t){var r;e.exports=((r=ge).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)}),pe(function(e,t){var r,n,i,s;e.exports=(i=(n=r=ge).lib.CipherParams,s=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(s)},parse:function(e){var t=s.parse(e);return i.create({ciphertext:t})}},r.format.Hex)}),pe(function(e,t){var r;e.exports=(r=ge,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],s=[],o=[],a=[],h=[],c=[],l=[],u=[],f=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,s[p]=r;var g=e[r],_=e[g],v=e[_],w=257*e[p]^16843008*p;o[r]=w<<24|w>>>8,a[r]=w<<16|w>>>16,h[r]=w<<8|w>>>24,c[r]=w,w=16843009*v^65537*_^257*g^16843008*r,l[p]=w<<24|w>>>8,u[p]=w<<16|w>>>16,f[p]=w<<8|w>>>24,d[p]=w,r?(r=g^e[e[e[v^g]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),s=this._keySchedule=[],o=0;o<n;o++)if(o<r)s[o]=t[o];else{var a=s[o-1];o%r?r>6&&o%r==4&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a]):(a=i[(a=a<<8|a>>>24)>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a],a^=p[o/r|0]<<24),s[o]=s[o-r]^a}for(var h=this._invKeySchedule=[],c=0;c<n;c++)o=n-c,a=c%4?s[o]:s[o-4],h[c]=c<4||o<=4?a:l[i[a>>>24]]^u[i[a>>>16&255]]^f[i[a>>>8&255]]^d[i[255&a]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,h,c,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,u,f,d,s),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,s,o,a){for(var h=this._nRounds,c=e[t]^r[0],l=e[t+1]^r[1],u=e[t+2]^r[2],f=e[t+3]^r[3],d=4,p=1;p<h;p++){var g=n[c>>>24]^i[l>>>16&255]^s[u>>>8&255]^o[255&f]^r[d++],_=n[l>>>24]^i[u>>>16&255]^s[f>>>8&255]^o[255&c]^r[d++],v=n[u>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&l]^r[d++],w=n[f>>>24]^i[c>>>16&255]^s[l>>>8&255]^o[255&u]^r[d++];c=g,l=_,u=v,f=w}g=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[d++],_=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^r[d++],v=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^r[d++],w=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^r[d++],e[t]=g,e[t+1]=_,e[t+2]=v,e[t+3]=w},keySize:8});e.AES=t._createHelper(g)}(),r.AES)}),pe(function(e,t){var r;e.exports=(r=ge,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,s=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=s.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=o[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],s=0;s<16;s++){var c=i[s]=[],l=h[s];for(r=0;r<24;r++)c[r/6|0]|=t[(a[r]-1+l)%28]<<31-r%6,c[4+(r/6|0)]|=t[28+(a[r+24]-1+l)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var u=this._invSubKeys=[];for(r=0;r<16;r++)u[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],s=this._lBlock,o=this._rBlock,a=0,h=0;h<8;h++)a|=c[h][((o^i[h])&l[h])>>>0];this._lBlock=o,this._rBlock=s^a}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,f.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function d(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(u);var p=s.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=u.createEncryptor(n.create(e.slice(0,2))),this._des2=u.createEncryptor(n.create(e.slice(2,4))),this._des3=u.createEncryptor(n.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),r.TripleDES)}),pe(function(e,t){var r;e.exports=(r=ge,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var s=0;i<256;i++){var o=i%r,a=t[o>>>2]>>>24-o%4*8&255;s=(s+n[i]+a)%256;var h=n[i];n[i]=n[s],n[s]=h}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=s.call(this)},keySize:8,ivSize:0});function s(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var s=e[t];e[t]=e[r],e[r]=s,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var o=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)s.call(this)}});e.RC4Drop=t._createHelper(o)}(),r.RC4)}),pe(function(e,t){var r;e.exports=(r=ge,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],s=[],o=[],a=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)h.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var s=t.words,o=s[0],a=s[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=c>>>16|4294901760&l,f=l<<16|65535&c;for(i[0]^=c,i[1]^=u,i[2]^=l,i[3]^=f,i[4]^=c,i[5]^=u,i[6]^=l,i[7]^=f,r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)s[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<s[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<s[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<s[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<s[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<s[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<s[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<s[6]>>>0?1:0)|0,this._b=t[7]>>>0<s[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,h=((i*i>>>17)+i*a>>>15)+a*a,c=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=h^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=t._createHelper(a)}(),r.Rabbit)}),pe(function(e,t){var r;e.exports=(r=ge,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],s=[],o=[],a=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)h.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var s=t.words,o=s[0],a=s[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=c>>>16|4294901760&l,f=l<<16|65535&c;for(n[0]^=c,n[1]^=u,n[2]^=l,n[3]^=f,n[4]^=c,n[5]^=u,n[6]^=l,n[7]^=f,i=0;i<4;i++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)s[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<s[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<s[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<s[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<s[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<s[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<s[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<s[6]>>>0?1:0)|0,this._b=t[7]>>>0<s[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,h=((i*i>>>17)+i*a>>>15)+a*a,c=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=h^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=t._createHelper(a)}(),r.RabbitLegacy)}),pe(function(e,t){e.exports=ge}));function ve(){throw new Error("setTimeout has not been defined")}function we(){throw new Error("clearTimeout has not been defined")}var me=ve,be=we;function ye(e){if(me===setTimeout)return setTimeout(e,0);if((me===ve||!me)&&setTimeout)return me=setTimeout,setTimeout(e,0);try{return me(e,0)}catch(t){try{return me.call(null,e,0)}catch(r){return me.call(this,e,0)}}}"function"==typeof g.setTimeout&&(me=setTimeout),"function"==typeof g.clearTimeout&&(be=clearTimeout);var ke,Ee=[],Se=!1,xe=-1;function Ae(){Se&&ke&&(Se=!1,ke.length?Ee=ke.concat(Ee):xe=-1,Ee.length&&Re())}function Re(){if(!Se){var e=ye(Ae);Se=!0;for(var t=Ee.length;t;){for(ke=Ee,Ee=[];++xe<t;)ke&&ke[xe].run();xe=-1,t=Ee.length}ke=null,Se=!1,function(e){if(be===clearTimeout)return clearTimeout(e);if((be===we||!be)&&clearTimeout)return be=clearTimeout,clearTimeout(e);try{be(e)}catch(t){try{return be.call(null,e)}catch(r){return be.call(this,e)}}}(e)}}function Be(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Ee.push(new Ie(e,t)),1!==Ee.length||Se||ye(Re)}function Ie(e,t){this.fun=e,this.array=t}Ie.prototype.run=function(){this.fun.apply(null,this.array)};var Pe=g.performance||{};function De(){}function Le(){Le.init.call(this)}function ze(e){return void 0===e._maxListeners?Le.defaultMaxListeners:e._maxListeners}function Te(e,t,r,n){var i,s,o,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]):(s=e._events=new De,e._eventsCount=0),o){if("function"==typeof o?o=s[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),!o.warned&&(i=ze(e))&&i>0&&o.length>i){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,a=h,"function"==typeof console.warn?console.warn(a):console.log(a)}}else o=s[t]=r,++e._eventsCount;return e}function Ce(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function Me(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function Oe(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}Pe.now||Pe.mozNow||Pe.msNow||Pe.oNow||Pe.webkitNow,De.prototype=Object.create(null),Le.EventEmitter=Le,Le.usingDomains=!1,Le.prototype.domain=void 0,Le.prototype._events=void 0,Le.prototype._maxListeners=void 0,Le.defaultMaxListeners=10,Le.init=function(){this.domain=null,Le.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new De,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Le.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Le.prototype.getMaxListeners=function(){return ze(this)},Le.prototype.emit=function(e){var t,r,n,i,s,o,a,h="error"===e;if(o=this._events)h=h&&null==o.error;else if(!h)return!1;if(a=this.domain,h){if(t=arguments[1],!a){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(r=o[e]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=Oe(e,n),s=0;s<n;++s)i[s].call(r)}(r,l,this);break;case 2:!function(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,s=Oe(e,i),o=0;o<i;++o)s[o].call(r,n)}(r,l,this,arguments[1]);break;case 3:!function(e,t,r,n,i){if(t)e.call(r,n,i);else for(var s=e.length,o=Oe(e,s),a=0;a<s;++a)o[a].call(r,n,i)}(r,l,this,arguments[1],arguments[2]);break;case 4:!function(e,t,r,n,i,s){if(t)e.call(r,n,i,s);else for(var o=e.length,a=Oe(e,o),h=0;h<o;++h)a[h].call(r,n,i,s)}(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),s=1;s<n;s++)i[s-1]=arguments[s];!function(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,s=Oe(e,i),o=0;o<i;++o)s[o].apply(r,n)}(r,l,this,i)}return!0},Le.prototype.addListener=function(e,t){return Te(this,e,t,!1)},Le.prototype.on=Le.prototype.addListener,Le.prototype.prependListener=function(e,t){return Te(this,e,t,!0)},Le.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,Ce(this,e,t)),this},Le.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,Ce(this,e,t)),this},Le.prototype.removeListener=function(e,t){var r,n,i,s,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new De:(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new De,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}(r,i);n.removeListener&&this.emit("removeListener",e,o||t)}return this},Le.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new De,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new De:delete r[e]),this;if(0===arguments.length){for(var n,i=Object.keys(r),s=0;s<i.length;++s)"removeListener"!==(n=i[s])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new De,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},Le.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(t):[]},Le.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Me.call(e,t)},Le.prototype.listenerCount=Me,Le.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Ue="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},Ne=/%[sdj%]/g;function Fe(e){if(!Je(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(je(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(e).replace(Ne,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}}),o=n[r];r<i;o=n[++r])Ge(o)||!tt(o)?s+=" "+o:s+=" "+je(o);return s}function We(e,t){if(Qe(g.process))return function(){return We(e,t).apply(this,arguments)};var r=!1;return function(){return r||(console.error(t),r=!0),e.apply(this,arguments)}}var He,Ze={};function je(e,t){var r={seen:[],stylize:Ve};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Xe(t)?r.showHidden=t:t&&function(e,t){if(!t||!tt(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]]}(r,t),Qe(r.showHidden)&&(r.showHidden=!1),Qe(r.depth)&&(r.depth=2),Qe(r.colors)&&(r.colors=!1),Qe(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ke),$e(r,e,r.depth)}function Ke(e,t){var r=je.styles[t];return r?"["+je.colors[r][0]+"m"+e+"["+je.colors[r][1]+"m":e}function Ve(e,t){return e}function $e(e,t,r){if(e.customInspect&&t&&it(t.inspect)&&t.inspect!==je&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return Je(n)||(n=$e(e,n,r)),n}var i=function(e,t){if(Qe(t))return e.stylize("undefined","undefined");if(Je(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return"number"==typeof t?e.stylize(""+t,"number"):Xe(t)?e.stylize(""+t,"boolean"):Ge(t)?e.stylize("null","null"):void 0}(e,t);if(i)return i;var s,o=Object.keys(t),a=(s={},o.forEach(function(e,t){s[e]=!0}),s);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),nt(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return qe(t);if(0===o.length){if(it(t)){var h=t.name?": "+t.name:"";return e.stylize("[Function"+h+"]","special")}if(et(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(rt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(nt(t))return qe(t)}var c,l,u="",f=!1,d=["{","}"];return c=t,Array.isArray(c)&&(f=!0,d=["[","]"]),it(t)&&(u=" [Function"+(t.name?": "+t.name:"")+"]"),et(t)&&(u=" "+RegExp.prototype.toString.call(t)),rt(t)&&(u=" "+Date.prototype.toUTCString.call(t)),nt(t)&&(u=" "+qe(t)),0!==o.length||f&&0!=t.length?r<0?et(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=f?function(e,t,r,n,i){for(var s=[],o=0,a=t.length;o<a;++o)ot(t,String(o))?s.push(Ye(e,t,r,n,String(o),!0)):s.push("");return i.forEach(function(i){i.match(/^\d+$/)||s.push(Ye(e,t,r,n,i,!0))}),s}(e,t,r,a,o):o.map(function(n){return Ye(e,t,r,a,n,f)}),e.seen.pop(),function(e,t,r){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,u,d)):d[0]+u+d[1]}function qe(e){return"["+Error.prototype.toString.call(e)+"]"}function Ye(e,t,r,n,i,s){var o,a,h;if((h=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=h.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):h.set&&(a=e.stylize("[Setter]","special")),ot(n,i)||(o="["+i+"]"),a||(e.seen.indexOf(h.value)<0?(a=Ge(r)?$e(e,h.value,null):$e(e,h.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),Qe(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function Xe(e){return"boolean"==typeof e}function Ge(e){return null===e}function Je(e){return"string"==typeof e}function Qe(e){return void 0===e}function et(e){return tt(e)&&"[object RegExp]"===st(e)}function tt(e){return"object"==typeof e&&null!==e}function rt(e){return tt(e)&&"[object Date]"===st(e)}function nt(e){return tt(e)&&("[object Error]"===st(e)||e instanceof Error)}function it(e){return"function"==typeof e}function st(e){return Object.prototype.toString.call(e)}function ot(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function at(){this.head=null,this.tail=null,this.length=0}je.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},je.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},at.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},at.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},at.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},at.prototype.clear=function(){this.head=this.tail=null,this.length=0},at.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},at.prototype.concat=function(e){if(0===this.length)return I.alloc(0);if(1===this.length)return this.head.data;for(var t=I.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var ht=I.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function ct(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!ht(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=ut;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=ft;break;default:return void(this.write=lt)}this.charBuffer=new I(6),this.charReceived=0,this.charLength=0}function lt(e){return e.toString(this.encoding)}function ut(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function ft(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}ct.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((n=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n,i=e.length;if(this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),i=(t+=e.toString(this.encoding,0,i)).length-1,(n=t.charCodeAt(i))>=55296&&n<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,i)}return t},ct.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},ct.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},_t.ReadableState=gt;var dt,pt=(dt="stream",Qe(He)&&(He=""),dt=dt.toUpperCase(),Ze[dt]||(new RegExp("\\b"+dt+"\\b","i").test(He)?Ze[dt]=function(){var e=Fe.apply(null,arguments);console.error("%s %d: %s",dt,0,e)}:Ze[dt]=function(){}),Ze[dt]);function gt(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof jt&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new at,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new ct(e.encoding),this.encoding=e.encoding)}function _t(e){if(!(this instanceof _t))return new _t(e);this._readableState=new gt(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),Le.call(this)}function vt(e,t,r,n,i){var s,o,a,h=(s=t,a=null,fe(o=r)||"string"==typeof o||null==o||s.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a);if(h)e.emit("error",h);else if(null===r)t.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,bt(e)}}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var c=new Error("stream.push() after EOF");e.emit("error",c)}else if(t.endEmitted&&i){var l=new Error("stream.unshift() after end event");e.emit("error",l)}else{var u;!t.decoder||i||n||(r=t.decoder.write(r),u=!t.objectMode&&0===r.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&bt(e))),function(e,t){t.readingMore||(t.readingMore=!0,Be(kt,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}Ue(_t,Le),_t.prototype.push=function(e,t){var r=this._readableState;return r.objectMode||"string"!=typeof e||(t=t||r.defaultEncoding)!==r.encoding&&(e=I.from(e,t),t=""),vt(this,r,e,t,!1)},_t.prototype.unshift=function(e){return vt(this,this._readableState,e,"",!0)},_t.prototype.isPaused=function(){return!1===this._readableState.flowing},_t.prototype.setEncoding=function(e){return this._readableState.decoder=new ct(e),this._readableState.encoding=e,this};var wt=8388608;function mt(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=((r=e)>=wt?r=wt:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function bt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(pt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Be(yt,e):yt(e))}function yt(e){pt("emit readable"),e.emit("readable"),xt(e)}function kt(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(pt("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function Et(e){pt("readable nexttick read 0"),e.read(0)}function St(e,t){t.reading||(pt("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),xt(e),t.flowing&&!t.reading&&e.read(0)}function xt(e){var t=e._readableState;for(pt("flow",t.flowing);t.flowing&&null!==e.read(););}function At(e,t){return 0===t.length?null:(t.objectMode?o=t.buffer.shift():!e||e>=t.length?(o=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):(r=e,n=t.buffer,i=t.decoder,r<n.head.data.length?(s=n.head.data.slice(0,r),n.head.data=n.head.data.slice(r)):s=r===n.head.data.length?n.shift():i?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var s=r.data,o=e>s.length?s.length:e;if(o===s.length?i+=s:i+=s.slice(0,e),0===(e-=o)){o===s.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(o));break}++n}return t.length-=n,i}(r,n):function(e,t){var r=I.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var s=n.data,o=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,o),0===(e-=o)){o===s.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(o));break}++i}return t.length-=i,r}(r,n),o=s),o);var r,n,i,s,o}function Rt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Be(Bt,t,e))}function Bt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function It(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function Pt(){}function Dt(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function Lt(e,t){Object.defineProperty(this,"buffer",{get:We(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof jt&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r,n=e._writableState,i=n.sync,s=n.writecb;if((r=n).writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t)!function(e,t,r,n,i){--t.pendingcb,r?Be(i,n):i(n),e._writableState.errorEmitted=!0,e.emit("error",n)}(e,n,i,t,s);else{var o=Ot(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||Mt(e,n),i?Be(Ct,e,n,o,s):Ct(e,n,o,s)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Ft(this)}function zt(e){if(!(this instanceof zt||this instanceof jt))return new zt(e);this._writableState=new Lt(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),Le.call(this)}function Tt(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function Ct(e,t,r,n){var i,s;r||(i=e,0===(s=t).length&&s.needDrain&&(s.needDrain=!1,i.emit("drain"))),t.pendingcb--,n(),Nt(e,t)}function Mt(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var o=0;r;)i[o]=r,r=r.next,o+=1;Tt(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new Ft(t)}else{for(;r;){var a=r.chunk,h=r.encoding,c=r.callback;if(Tt(e,t,!1,t.objectMode?1:a.length,a,h,c),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function Ot(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function Ut(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function Nt(e,t){var r=Ot(t);return r&&(0===t.pendingcb?(Ut(e,t),t.finished=!0,e.emit("finish")):Ut(e,t)),r}function Ft(e){var t=this;this.next=null,this.entry=null,this.finish=function(r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}_t.prototype.read=function(e){pt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return pt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Rt(this):bt(this),null;if(0===(e=mt(e,t))&&t.ended)return 0===t.length&&Rt(this),null;var n,i=t.needReadable;return pt("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&pt("length less than watermark",i=!0),t.ended||t.reading?pt("reading or ended",i=!1):i&&(pt("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=mt(r,t))),null===(n=e>0?At(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Rt(this)),null!==n&&this.emit("data",n),n},_t.prototype._read=function(e){this.emit("error",new Error("not implemented"))},_t.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,pt("pipe count=%d opts=%j",n.pipesCount,t);var i=t&&!1===t.end?l:o;function s(e){pt("onunpipe"),e===r&&l()}function o(){pt("onend"),e.end()}n.endEmitted?Be(i):r.once("end",i),e.on("unpipe",s);var a,h=(a=r,function(){var e=a._readableState;pt("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a.listeners("data").length&&(e.flowing=!0,xt(a))});e.on("drain",h);var c=!1;function l(){pt("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",h),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",o),r.removeListener("end",l),r.removeListener("data",f),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||h()}var u=!1;function f(t){pt("ondata"),u=!1,!1!==e.write(t)||u||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==It(n.pipes,e))&&!c&&(pt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,u=!0),r.pause())}function d(t){pt("onerror",t),_(),e.removeListener("error",d),0===e.listeners("error").length&&e.emit("error",t)}function p(){e.removeListener("finish",g),_()}function g(){pt("onfinish"),e.removeListener("close",p),_()}function _(){pt("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",p),e.once("finish",g),e.emit("pipe",r),n.flowing||(pt("pipe resume"),r.resume()),e},_t.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var s=It(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},_t.prototype.on=function(e,t){var r=Le.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&bt(this):Be(Et,this))}return r},_t.prototype.addListener=_t.prototype.on,_t.prototype.resume=function(){var e,t,r=this._readableState;return r.flowing||(pt("resume"),r.flowing=!0,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,Be(St,e,t))),this},_t.prototype.pause=function(){return pt("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(pt("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_t.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",function(){if(pt("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(i){pt("wrapped data"),t.decoder&&(i=t.decoder.write(i)),t.objectMode&&null==i||(t.objectMode||i&&i.length)&&(n.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return function(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r])}(["error","close","destroy","pause","resume"],function(t){e.on(t,n.emit.bind(n,t))}),n._read=function(t){pt("wrapped _read",t),r&&(r=!1,e.resume())},n},_t._fromList=At,zt.WritableState=Lt,Ue(zt,Le),Lt.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},zt.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},zt.prototype.write=function(e,t,r){var n,i,s,o=this._writableState,a=!1;return"function"==typeof t&&(r=t,t=null),I.isBuffer(e)?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=Pt),o.ended?(n=this,i=r,s=new Error("write after end"),n.emit("error",s),Be(i,s)):function(e,t,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):I.isBuffer(r)||"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),Be(n,s),i=!1),i}(this,o,e,r)&&(o.pendingcb++,a=function(e,t,r,n,i){var s,o,a;o=r,a=n,(s=t).objectMode||!1===s.decodeStrings||"string"!=typeof o||(o=I.from(o,a)),r=o,I.isBuffer(r)&&(n="buffer");var h=t.objectMode?1:r.length;t.length+=h;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest=new Dt(r,n,i),l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Tt(e,t,!1,h,r,n,i);return c}(this,o,e,t,r)),a},zt.prototype.cork=function(){this._writableState.corked++},zt.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||Mt(this,e))},zt.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},zt.prototype._write=function(e,t,r){r(new Error("not implemented"))},zt.prototype._writev=null,zt.prototype.end=function(e,t,r){var n,i,s,o=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||o.finished||(n=this,s=r,(i=o).ending=!0,Nt(n,i),s&&(i.finished?Be(s):n.once("finish",s)),i.ended=!0,n.writable=!1)},Ue(jt,_t);for(var Wt=Object.keys(zt.prototype),Ht=0;Ht<Wt.length;Ht++){var Zt=Wt[Ht];jt.prototype[Zt]||(jt.prototype[Zt]=zt.prototype[Zt])}function jt(e){if(!(this instanceof jt))return new jt(e);_t.call(this,e),zt.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Kt)}function Kt(){this.allowHalfOpen||this._writableState.ended||Be(Vt,this)}function Vt(e){e.end()}function $t(e){this.afterTransform=function(t,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!=r&&e.push(r),i(t);var s=e._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&e._read(s.highWaterMark)}(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function qt(e){if(!(this instanceof qt))return new qt(e);jt.call(this,e),this._transformState=new $t(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){Yt(t,e)}):Yt(t)})}function Yt(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function Xt(e){if(!(this instanceof Xt))return new Xt(e);qt.call(this,e)}function Gt(){Le.call(this)}Ue(qt,jt),qt.prototype.push=function(e,t){return this._transformState.needTransform=!1,jt.prototype.push.call(this,e,t)},qt.prototype._transform=function(e,t,r){throw new Error("Not implemented")},qt.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},qt.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Ue(Xt,qt),Xt.prototype._transform=function(e,t,r){r(null,e)},Ue(Gt,Le),Gt.Readable=_t,Gt.Writable=zt,Gt.Duplex=jt,Gt.Transform=qt,Gt.PassThrough=Xt,Gt.Stream=Gt,Gt.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",o),r.on("close",a));var s=!1;function o(){s||(s=!0,e.end())}function a(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function h(e){if(c(),0===Le.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",h),e.removeListener("error",h),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",h),e.on("error",h),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e};var Jt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function Qt(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function er(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var s=0;s<n;s++)e[i+s]=t[r+s]}var tr=Uint8Array,rr=Uint16Array,nr=Int32Array;function ir(e){for(var t=e.length;--t>=0;)e[t]=0}var sr=256,or=286,ar=30,hr=15,cr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],lr=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ur=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],fr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],dr=new Array(576);ir(dr);var pr=new Array(60);ir(pr);var gr=new Array(512);ir(gr);var _r=new Array(256);ir(_r);var vr=new Array(29);ir(vr);var wr,mr,br,yr=new Array(ar);function kr(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Er(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Sr(e){return e<256?gr[e]:gr[256+(e>>>7)]}function xr(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Ar(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,xr(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Rr(e,t,r){Ar(e,r[2*t],r[2*t+1])}function Br(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function Ir(e,t,r){var n,i,s=new Array(16),o=0;for(n=1;n<=hr;n++)s[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=Br(s[a]++,a))}}function Pr(e){var t;for(t=0;t<or;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ar;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Dr(e){e.bi_valid>8?xr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Lr(e,t,r,n){var i=2*t,s=2*r;return e[i]<e[s]||e[i]===e[s]&&n[t]<=n[r]}function zr(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&Lr(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Lr(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function Tr(e,t,r){var n,i,s,o,a=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*a]<<8|e.pending_buf[e.d_buf+2*a+1],i=e.pending_buf[e.l_buf+a],a++,0===n?Rr(e,i,t):(Rr(e,(s=_r[i])+sr+1,t),0!==(o=cr[s])&&Ar(e,i-=vr[s],o),Rr(e,s=Sr(--n),r),0!==(o=lr[s])&&Ar(e,n-=yr[s],o))}while(a<e.last_lit);Rr(e,256,t)}function Cr(e,t){var r,n,i,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,h=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<h;r++)0!==s[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=o[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;r>=1;r--)zr(e,s,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],zr(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,zr(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,o,a,h=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,u=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(s=0;s<=hr;s++)e.bl_count[s]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(s=h[2*h[2*(n=e.heap[r])+1]+1]+1)>p&&(s=p,g++),h[2*n+1]=s,n>c||(e.bl_count[s]++,o=0,n>=d&&(o=f[n-d]),a=h[2*n],e.opt_len+=a*(s+o),u&&(e.static_len+=a*(l[2*n+1]+o)));if(0!==g){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=e.bl_count[s];0!==n;)(i=e.heap[--r])>c||(h[2*i+1]!==s&&(e.opt_len+=(s-h[2*i+1])*h[2*i],h[2*i+1]=s),n--)}}(e,t),Ir(s,c,e.bl_count)}function Mr(e,t,r){var n,i,s=-1,o=t[1],a=0,h=7,c=4;for(0===o&&(h=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++a<h&&i===o||(a<c?e.bl_tree[2*i]+=a:0!==i?(i!==s&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,s=i,0===o?(h=138,c=3):i===o?(h=6,c=3):(h=7,c=4))}function Or(e,t,r){var n,i,s=-1,o=t[1],a=0,h=7,c=4;for(0===o&&(h=138,c=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++a<h&&i===o)){if(a<c)do{Rr(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==s&&(Rr(e,i,e.bl_tree),a--),Rr(e,16,e.bl_tree),Ar(e,a-3,2)):a<=10?(Rr(e,17,e.bl_tree),Ar(e,a-3,3)):(Rr(e,18,e.bl_tree),Ar(e,a-11,7));a=0,s=i,0===o?(h=138,c=3):i===o?(h=6,c=3):(h=7,c=4)}}ir(yr);var Ur=!1;function Nr(e,t,r,n){var i,s,o;Ar(e,0+(n?1:0),3),s=t,o=r,Dr(i=e),xr(i,o),xr(i,~o),er(i.pending_buf,i.window,s,o,i.pending),i.pending+=o}function Fr(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(_r[r]+sr+1)]++,e.dyn_dtree[2*Sr(t)]++),e.last_lit===e.lit_bufsize-1}function Wr(e,t,r,n){for(var i=65535&e,s=e>>>16&65535,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{s=s+(i=i+t[n++]|0)|0}while(--o);i%=65521,s%=65521}return i|s<<16}var Hr=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function Zr(e,t,r,n){var i=Hr,s=n+r;e^=-1;for(var o=n;o<s;o++)e=e>>>8^i[255&(e^t[o])];return-1^e}var jr,Kr=-2,Vr=258,$r=262,qr=103,Yr=113,Xr=666;function Gr(e,t){return e.msg=Jt[t],t}function Jr(e){return(e<<1)-(e>4?9:0)}function Qr(e){for(var t=e.length;--t>=0;)e[t]=0}function en(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(er(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function tn(e,t){(function(e,t,r,n){var i,s,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<sr;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),Cr(e,e.l_desc),Cr(e,e.d_desc),o=function(e){var t;for(Mr(e,e.dyn_ltree,e.l_desc.max_code),Mr(e,e.dyn_dtree,e.d_desc.max_code),Cr(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*fr[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?Nr(e,t,r,n):4===e.strategy||s===i?(Ar(e,2+(n?1:0),3),Tr(e,dr,pr)):(Ar(e,4+(n?1:0),3),function(e,t,r,n){var i;for(Ar(e,t-257,5),Ar(e,r-1,5),Ar(e,n-4,4),i=0;i<n;i++)Ar(e,e.bl_tree[2*fr[i]+1],3);Or(e,e.dyn_ltree,t-1),Or(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Tr(e,e.dyn_ltree,e.dyn_dtree)),Pr(e),n&&Dr(e)})(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,en(e.strm)}function rn(e,t){e.pending_buf[e.pending++]=t}function nn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function sn(e,t){var r,n,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,h=e.strstart>e.w_size-$r?e.strstart-(e.w_size-$r):0,c=e.window,l=e.w_mask,u=e.prev,f=e.strstart+Vr,d=c[s+o-1],p=c[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(r=t)+o]===p&&c[r+o-1]===d&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&s<f);if(n=Vr-(f-s),s=f-Vr,n>o){if(e.match_start=t,o=n,n>=a)break;d=c[s+o-1],p=c[s+o]}}}while((t=u[t&l])>h&&0!=--i);return o<=e.lookahead?o:e.lookahead}function on(e){var t,r,n,i,s,o,a,h,c,l,u=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=u+(u-$r)){er(e.window,e.window,u,u,0),e.match_start-=u,e.strstart-=u,e.block_start-=u,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=u?n-u:0}while(--r);t=r=u;do{n=e.prev[--t],e.prev[t]=n>=u?n-u:0}while(--r);i+=u}if(0===e.strm.avail_in)break;if(o=e.strm,a=e.window,h=e.strstart+e.lookahead,c=i,l=void 0,(l=o.avail_in)>c&&(l=c),r=0===l?0:(o.avail_in-=l,er(a,o.input,o.next_in,l,h),1===o.state.wrap?o.adler=Wr(o.adler,a,l,h):2===o.state.wrap&&(o.adler=Zr(o.adler,a,l,h)),o.next_in+=l,o.total_in+=l,l),e.lookahead+=r,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+3-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<$r&&0!==e.strm.avail_in)}function an(e,t){for(var r,n;;){if(e.lookahead<$r){if(on(e),e.lookahead<$r&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-$r&&(e.match_length=sn(e,r)),e.match_length>=3)if(n=Fr(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Fr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(tn(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(tn(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(tn(e,!1),0===e.strm.avail_out)?1:2}function hn(e,t){for(var r,n,i;;){if(e.lookahead<$r){if(on(e),e.lookahead<$r&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-$r&&(e.match_length=sn(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=Fr(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(tn(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=Fr(e,0,e.window[e.strstart-1]))&&tn(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Fr(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(tn(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(tn(e,!1),0===e.strm.avail_out)?1:2}function cn(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function ln(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new rr(1146),this.dyn_dtree=new rr(122),this.bl_tree=new rr(78),Qr(this.dyn_ltree),Qr(this.dyn_dtree),Qr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new rr(16),this.heap=new rr(573),Qr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new rr(573),Qr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function un(e){var t,r,n,i=(r=e)&&r.state?(r.total_in=r.total_out=0,r.data_type=2,(n=r.state).pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?42:Yr,r.adler=2===n.wrap?0:1,n.last_flush=0,function(e){Ur||(function(){var e,t,r,n,i,s=new Array(16);for(r=0,n=0;n<28;n++)for(vr[n]=r,e=0;e<1<<cr[n];e++)_r[r++]=n;for(_r[r-1]=n,i=0,n=0;n<16;n++)for(yr[n]=i,e=0;e<1<<lr[n];e++)gr[i++]=n;for(i>>=7;n<ar;n++)for(yr[n]=i<<7,e=0;e<1<<lr[n]-7;e++)gr[256+i++]=n;for(t=0;t<=hr;t++)s[t]=0;for(e=0;e<=143;)dr[2*e+1]=8,e++,s[8]++;for(;e<=255;)dr[2*e+1]=9,e++,s[9]++;for(;e<=279;)dr[2*e+1]=7,e++,s[7]++;for(;e<=287;)dr[2*e+1]=8,e++,s[8]++;for(Ir(dr,287,s),e=0;e<ar;e++)pr[2*e+1]=5,pr[2*e]=Br(e,5);wr=new kr(dr,cr,257,or,hr),mr=new kr(pr,lr,0,ar,hr),br=new kr(new Array(0),ur,0,19,7)}(),Ur=!0),e.l_desc=new Er(e.dyn_ltree,wr),e.d_desc=new Er(e.dyn_dtree,mr),e.bl_desc=new Er(e.bl_tree,br),e.bi_buf=0,e.bi_valid=0,Pr(e)}(n),0):Gr(r,Kr);return 0===i&&((t=e.state).window_size=2*t.w_size,Qr(t.head),t.max_lazy_match=jr[t.level].max_lazy,t.good_match=jr[t.level].good_length,t.nice_match=jr[t.level].nice_length,t.max_chain_length=jr[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i}function fn(e,t){var r,n,i,s;if(!e||!e.state||t>5||t<0)return e?Gr(e,Kr):Kr;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===Xr&&4!==t)return Gr(e,0===e.avail_out?-5:Kr);if(n.strm=e,r=n.last_flush,n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,rn(n,31),rn(n,139),rn(n,8),n.gzhead?(rn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),rn(n,255&n.gzhead.time),rn(n,n.gzhead.time>>8&255),rn(n,n.gzhead.time>>16&255),rn(n,n.gzhead.time>>24&255),rn(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),rn(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(rn(n,255&n.gzhead.extra.length),rn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Zr(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(rn(n,0),rn(n,0),rn(n,0),rn(n,0),rn(n,0),rn(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),rn(n,3),n.status=Yr);else{var o=8+(n.w_bits-8<<4)<<8;o|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(o|=32),o+=31-o%31,n.status=Yr,nn(n,o),0!==n.strstart&&(nn(n,e.adler>>>16),nn(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=Zr(e.adler,n.pending_buf,n.pending-i,i)),en(e),i=n.pending,n.pending!==n.pending_buf_size));)rn(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Zr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Zr(e.adler,n.pending_buf,n.pending-i,i)),en(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,rn(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=Zr(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Zr(e.adler,n.pending_buf,n.pending-i,i)),en(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,rn(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=Zr(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=qr)}else n.status=qr;if(n.status===qr&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&en(e),n.pending+2<=n.pending_buf_size&&(rn(n,255&e.adler),rn(n,e.adler>>8&255),e.adler=0,n.status=Yr)):n.status=Yr),0!==n.pending){if(en(e),0===e.avail_out)return n.last_flush=-1,0}else if(0===e.avail_in&&Jr(t)<=Jr(r)&&4!==t)return Gr(e,-5);if(n.status===Xr&&0!==e.avail_in)return Gr(e,-5);if(0!==e.avail_in||0!==n.lookahead||0!==t&&n.status!==Xr){var a=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(on(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=Fr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(tn(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(tn(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(tn(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,o=e.window;;){if(e.lookahead<=Vr){if(on(e),e.lookahead<=Vr&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=o[i=e.strstart-1])===o[++i]&&n===o[++i]&&n===o[++i]){s=e.strstart+Vr;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);e.match_length=Vr-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=Fr(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Fr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(tn(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(tn(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(tn(e,!1),0===e.strm.avail_out)?1:2}(n,t):jr[n.level].func(n,t);if(3!==a&&4!==a||(n.status=Xr),1===a||3===a)return 0===e.avail_out&&(n.last_flush=-1),0;if(2===a&&(1===t?function(e){var t;Ar(e,2,3),Rr(e,256,dr),16===(t=e).bi_valid?(xr(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(n):5!==t&&(Nr(n,0,0,!1),3===t&&(Qr(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),en(e),0===e.avail_out))return n.last_flush=-1,0}return 4!==t?0:n.wrap<=0?1:(2===n.wrap?(rn(n,255&e.adler),rn(n,e.adler>>8&255),rn(n,e.adler>>16&255),rn(n,e.adler>>24&255),rn(n,255&e.total_in),rn(n,e.total_in>>8&255),rn(n,e.total_in>>16&255),rn(n,e.total_in>>24&255)):(nn(n,e.adler>>>16),nn(n,65535&e.adler)),en(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)}jr=[new cn(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(on(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,tn(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-$r&&(tn(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(tn(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(tn(e,!1),e.strm.avail_out),1)}),new cn(4,4,8,4,an),new cn(4,5,16,8,an),new cn(4,6,32,32,an),new cn(4,4,16,16,hn),new cn(8,16,32,32,hn),new cn(8,16,128,128,hn),new cn(8,32,128,256,hn),new cn(32,128,258,1024,hn),new cn(32,258,258,4096,hn)];function dn(e,t){var r,n,i,s,o,a,h,c,l,u,f,d,p,g,_,v,w,m,b,y,k,E,S,x,A;r=e.state,n=e.next_in,x=e.input,i=n+(e.avail_in-5),s=e.next_out,A=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),h=r.dmax,c=r.wsize,l=r.whave,u=r.wnext,f=r.window,d=r.hold,p=r.bits,g=r.lencode,_=r.distcode,v=(1<<r.lenbits)-1,w=(1<<r.distbits)-1;e:do{p<15&&(d+=x[n++]<<p,p+=8,d+=x[n++]<<p,p+=8),m=g[d&v];t:for(;;){if(d>>>=b=m>>>24,p-=b,0==(b=m>>>16&255))A[s++]=65535&m;else{if(!(16&b)){if(!(64&b)){m=g[(65535&m)+(d&(1<<b)-1)];continue t}if(32&b){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}y=65535&m,(b&=15)&&(p<b&&(d+=x[n++]<<p,p+=8),y+=d&(1<<b)-1,d>>>=b,p-=b),p<15&&(d+=x[n++]<<p,p+=8,d+=x[n++]<<p,p+=8),m=_[d&w];r:for(;;){if(d>>>=b=m>>>24,p-=b,!(16&(b=m>>>16&255))){if(!(64&b)){m=_[(65535&m)+(d&(1<<b)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&m,p<(b&=15)&&(d+=x[n++]<<p,(p+=8)<b&&(d+=x[n++]<<p,p+=8)),(k+=d&(1<<b)-1)>h){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=b,p-=b,k>(b=s-o)){if((b=k-b)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(E=0,S=f,0===u){if(E+=c-b,b<y){y-=b;do{A[s++]=f[E++]}while(--b);E=s-k,S=A}}else if(u<b){if(E+=c+u-b,(b-=u)<y){y-=b;do{A[s++]=f[E++]}while(--b);if(E=0,u<y){y-=b=u;do{A[s++]=f[E++]}while(--b);E=s-k,S=A}}}else if(E+=u-b,b<y){y-=b;do{A[s++]=f[E++]}while(--b);E=s-k,S=A}for(;y>2;)A[s++]=S[E++],A[s++]=S[E++],A[s++]=S[E++],y-=3;y&&(A[s++]=S[E++],y>1&&(A[s++]=S[E++]))}else{E=s-k;do{A[s++]=A[E++],A[s++]=A[E++],A[s++]=A[E++],y-=3}while(y>2);y&&(A[s++]=A[E++],y>1&&(A[s++]=A[E++]))}break}}break}}while(n<i&&s<a);n-=y=p>>3,d&=(1<<(p-=y<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=s<a?a-s+257:257-(s-a),r.hold=d,r.bits=p}var pn=15,gn=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],_n=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],vn=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],wn=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function mn(e,t,r,n,i,s,o,a){var h,c,l,u,f,d,p,g,_,v=a.bits,w=0,m=0,b=0,y=0,k=0,E=0,S=0,x=0,A=0,R=0,B=null,I=0,P=new rr(16),D=new rr(16),L=null,z=0;for(w=0;w<=pn;w++)P[w]=0;for(m=0;m<n;m++)P[t[r+m]]++;for(k=v,y=pn;y>=1&&0===P[y];y--);if(k>y&&(k=y),0===y)return i[s++]=20971520,i[s++]=20971520,a.bits=1,0;for(b=1;b<y&&0===P[b];b++);for(k<b&&(k=b),x=1,w=1;w<=pn;w++)if(x<<=1,(x-=P[w])<0)return-1;if(x>0&&(0===e||1!==y))return-1;for(D[1]=0,w=1;w<pn;w++)D[w+1]=D[w]+P[w];for(m=0;m<n;m++)0!==t[r+m]&&(o[D[t[r+m]]++]=m);if(0===e?(B=L=o,d=19):1===e?(B=gn,I-=257,L=_n,z-=257,d=256):(B=vn,L=wn,d=-1),R=0,m=0,w=b,f=s,E=k,S=0,l=-1,u=(A=1<<k)-1,1===e&&A>852||2===e&&A>592)return 1;for(;;){p=w-S,o[m]<d?(g=0,_=o[m]):o[m]>d?(g=L[z+o[m]],_=B[I+o[m]]):(g=96,_=0),h=1<<w-S,b=c=1<<E;do{i[f+(R>>S)+(c-=h)]=p<<24|g<<16|_}while(0!==c);for(h=1<<w-1;R&h;)h>>=1;if(0!==h?(R&=h-1,R+=h):R=0,m++,0==--P[w]){if(w===y)break;w=t[r+o[m]]}if(w>k&&(R&u)!==l){for(0===S&&(S=k),f+=b,x=1<<(E=w-S);E+S<y&&!((x-=P[E+S])<=0);)E++,x<<=1;if(A+=1<<E,1===e&&A>852||2===e&&A>592)return 1;i[l=R&u]=k<<24|E<<16|f-s}}return 0!==R&&(i[f+R]=w-S<<24|64<<16),a.bits=k,0}var bn=-2,yn=12,kn=30;function En(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Sn(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new rr(320),this.work=new rr(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function xn(e){var t,r,n;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,(r=e)&&r.state?(n=r.state,r.total_in=r.total_out=n.total=0,r.msg="",n.wrap&&(r.adler=1&n.wrap),n.mode=1,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new nr(852),n.distcode=n.distdyn=new nr(592),n.sane=1,n.back=-1,0):bn):bn}var An,Rn,Bn=!0;function In(e){if(Bn){var t;for(An=new nr(512),Rn=new nr(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(mn(1,e.lens,0,288,An,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;mn(2,e.lens,0,32,Rn,0,e.work,{bits:5}),Bn=!1}e.lencode=An,e.lenbits=9,e.distcode=Rn,e.distbits=5}var Pn;function Dn(e){if(e<1||e>7)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function Ln(e,t){for(var r=0;r<e.length;r++)this[t+r]=e[r]}Dn.prototype.init=function(e,t,r,n,i){var s;switch(this.windowBits=e,this.level=t,this.memLevel=r,this.strategy=n,3!==this.mode&&4!==this.mode||(this.windowBits+=16),7===this.mode&&(this.windowBits+=32),5!==this.mode&&6!==this.mode||(this.windowBits=-this.windowBits),this.strm=new Qt,this.mode){case 1:case 3:case 5:s=function(e,t,r,n,i,s){if(!e)return Kr;var o=1;if(-1===t&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>9||n<8||n>15||t<0||t>9||s<0||s>4)return Gr(e,Kr);8===n&&(n=9);var a=new ln;return e.state=a,a.strm=e,a.wrap=o,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new tr(2*a.w_size),a.head=new rr(a.hash_size),a.prev=new rr(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new tr(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=3*a.lit_bufsize,a.level=t,a.strategy=s,a.method=8,un(e)}(this.strm,this.level,0,this.windowBits,this.memLevel,this.strategy);break;case 2:case 4:case 6:case 7:s=function(e,t){var r,n,i,s,o,a;return e?(n=new Sn,e.state=n,n.window=null,0!==(s=t,r=(i=e)&&i.state?(a=i.state,s<0?(o=0,s=-s):(o=1+(s>>4),s<48&&(s&=15)),s&&(s<8||s>15)?bn:(null!==a.window&&a.wbits!==s&&(a.window=null),a.wrap=o,a.wbits=s,xn(i))):bn)&&(e.state=null),r):bn}(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}0===s?(this.write_in_progress=!1,this.init_done=!0):this._error(s)},Dn.prototype.params=function(){throw new Error("deflateParams Not supported")},Dn.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(0===this.mode)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},Dn.prototype.write=function(e,t,r,n,i,s,o){this._writeCheck(),this.write_in_progress=!0;var a=this;return Be(function(){a.write_in_progress=!1;var h=a._write(e,t,r,n,i,s,o);a.callback(h[0],h[1]),a.pending_close&&a.close()}),this},Dn.prototype.writeSync=function(e,t,r,n,i,s,o){return this._writeCheck(),this._write(e,t,r,n,i,s,o)},Dn.prototype._write=function(e,t,r,n,i,s,o){if(this.write_in_progress=!0,0!==e&&1!==e&&2!==e&&3!==e&&4!==e&&5!==e)throw new Error("Invalid flush value");null==t&&(t=new I(0),n=0,r=0),i._set?i.set=i._set:i.set=Ln;var a,h=this.strm;switch(h.avail_in=n,h.input=t,h.next_in=r,h.avail_out=o,h.output=i,h.next_out=s,this.mode){case 1:case 3:case 5:a=fn(h,e);break;case 7:case 2:case 4:case 6:a=function(e,t){var r,n,i,s,o,a,h,c,l,u,f,d,p,g,_,v,w,m,b,y,k,E,S,x,A,R,B,I,P,D,L=0,z=new tr(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return bn;(r=e.state).mode===yn&&(r.mode=13),o=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,c=r.hold,l=r.bits,u=a,f=h,E=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;l<16;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(2&r.wrap&&35615===c){r.check=0,z[0]=255&c,z[1]=c>>>8&255,r.check=Zr(r.check,z,2,0),c=0,l=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=kn;break}if(8!=(15&c)){e.msg="unknown compression method",r.mode=kn;break}if(l-=4,k=8+(15&(c>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=kn;break}r.dmax=1<<k,e.adler=r.check=1,r.mode=512&c?10:yn,c=0,l=0;break;case 2:for(;l<16;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(r.flags=c,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=kn;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=kn;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&(z[0]=255&c,z[1]=c>>>8&255,r.check=Zr(r.check,z,2,0)),c=0,l=0,r.mode=3;case 3:for(;l<32;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.time=c),512&r.flags&&(z[0]=255&c,z[1]=c>>>8&255,z[2]=c>>>16&255,z[3]=c>>>24&255,r.check=Zr(r.check,z,4,0)),c=0,l=0,r.mode=4;case 4:for(;l<16;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&(z[0]=255&c,z[1]=c>>>8&255,r.check=Zr(r.check,z,2,0)),c=0,l=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&(z[0]=255&c,z[1]=c>>>8&255,r.check=Zr(r.check,z,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>a&&(d=a),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),er(r.head.extra,n,s,d,k)),512&r.flags&&(r.check=Zr(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break e;d=0;do{k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d<a);if(512&r.flags&&(r.check=Zr(r.check,n,d,s)),a-=d,s+=d,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===a)break e;d=0;do{k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k))}while(k&&d<a);if(512&r.flags&&(r.check=Zr(r.check,n,d,s)),a-=d,s+=d,k)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;l<16;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(c!==(65535&r.check)){e.msg="header crc mismatch",r.mode=kn;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=yn;break;case 10:for(;l<32;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}e.adler=r.check=En(c),c=0,l=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=o,e.avail_out=h,e.next_in=s,e.avail_in=a,r.hold=c,r.bits=l,2;e.adler=r.check=1,r.mode=yn;case yn:if(5===t||6===t)break e;case 13:if(r.last){c>>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}switch(r.last=1&c,l-=1,3&(c>>>=1)){case 0:r.mode=14;break;case 1:if(In(r),r.mode=20,6===t){c>>>=2,l-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=kn}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=kn;break}if(r.length=65535&c,c=0,l=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>a&&(d=a),d>h&&(d=h),0===d)break e;er(i,n,s,d,o),a-=d,s+=d,h-=d,o+=d,r.length-=d;break}r.mode=yn;break;case 17:for(;l<14;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(r.nlen=257+(31&c),c>>>=5,l-=5,r.ndist=1+(31&c),c>>>=5,l-=5,r.ncode=4+(15&c),c>>>=4,l-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=kn;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;l<3;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}r.lens[T[r.have++]]=7&c,c>>>=3,l-=3}for(;r.have<19;)r.lens[T[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},E=mn(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid code lengths set",r.mode=kn;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;v=(L=r.lencode[c&(1<<r.lenbits)-1])>>>16&255,w=65535&L,!((_=L>>>24)<=l);){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(w<16)c>>>=_,l-=_,r.lens[r.have++]=w;else{if(16===w){for(x=_+2;l<x;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(c>>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=kn;break}k=r.lens[r.have-1],d=3+(3&c),c>>>=2,l-=2}else if(17===w){for(x=_+3;l<x;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}l-=_,k=0,d=3+(7&(c>>>=_)),c>>>=3,l-=3}else{for(x=_+7;l<x;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}l-=_,k=0,d=11+(127&(c>>>=_)),c>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=kn;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===kn)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=kn;break}if(r.lenbits=9,S={bits:r.lenbits},E=mn(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid literal/lengths set",r.mode=kn;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},E=mn(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,E){e.msg="invalid distances set",r.mode=kn;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(a>=6&&h>=258){e.next_out=o,e.avail_out=h,e.next_in=s,e.avail_in=a,r.hold=c,r.bits=l,dn(e,f),o=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,c=r.hold,l=r.bits,r.mode===yn&&(r.back=-1);break}for(r.back=0;v=(L=r.lencode[c&(1<<r.lenbits)-1])>>>16&255,w=65535&L,!((_=L>>>24)<=l);){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(v&&!(240&v)){for(m=_,b=v,y=w;v=(L=r.lencode[y+((c&(1<<m+b)-1)>>m)])>>>16&255,w=65535&L,!(m+(_=L>>>24)<=l);){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=_,l-=_,r.back+=_,r.length=w,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=yn;break}if(64&v){e.msg="invalid literal/length code",r.mode=kn;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(x=r.extra;l<x;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(L=r.distcode[c&(1<<r.distbits)-1])>>>16&255,w=65535&L,!((_=L>>>24)<=l);){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(!(240&v)){for(m=_,b=v,y=w;v=(L=r.distcode[y+((c&(1<<m+b)-1)>>m)])>>>16&255,w=65535&L,!(m+(_=L>>>24)<=l);){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=_,l-=_,r.back+=_,64&v){e.msg="invalid distance code",r.mode=kn;break}r.offset=w,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(x=r.extra;l<x;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=kn;break}r.mode=25;case 25:if(0===h)break e;if(d=f-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=kn;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),g=r.window}else g=i,p=o-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[o++]=g[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===h)break e;i[o++]=r.length,h--,r.mode=21;break;case 27:if(r.wrap){for(;l<32;){if(0===a)break e;a--,c|=n[s++]<<l,l+=8}if(f-=h,e.total_out+=f,r.total+=f,f&&(e.adler=r.check=r.flags?Zr(r.check,i,f,o-f):Wr(r.check,i,f,o-f)),f=h,(r.flags?c:En(c))!==r.check){e.msg="incorrect data check",r.mode=kn;break}c=0,l=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;l<32;){if(0===a)break e;a--,c+=n[s++]<<l,l+=8}if(c!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=kn;break}c=0,l=0}r.mode=29;case 29:E=1;break e;case kn:E=-3;break e;case 31:return-4;default:return bn}return e.next_out=o,e.avail_out=h,e.next_in=s,e.avail_in=a,r.hold=c,r.bits=l,(r.wsize||f!==e.avail_out&&r.mode<kn&&(r.mode<27||4!==t))&&(A=e,R=e.output,B=e.next_out,I=f-e.avail_out,null===(D=A.state).window&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new tr(D.wsize)),I>=D.wsize?(er(D.window,R,B-D.wsize,D.wsize,0),D.wnext=0,D.whave=D.wsize):((P=D.wsize-D.wnext)>I&&(P=I),er(D.window,R,B-I,P,D.wnext),(I-=P)?(er(D.window,R,B-I,I,0),D.wnext=I,D.whave=D.wsize):(D.wnext+=P,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=P)))),u-=e.avail_in,f-=e.avail_out,e.total_in+=u,e.total_out+=f,r.total+=f,r.wrap&&f&&(e.adler=r.check=r.flags?Zr(r.check,i,f,e.next_out-f):Wr(r.check,i,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===yn?128:0)+(20===r.mode||15===r.mode?256:0),(0===u&&0===f||4===t)&&0===E&&(E=-5),E}(h,e);break;default:throw new Error("Unknown mode "+this.mode)}return 1!==a&&0!==a&&this._error(a),this.write_in_progress=!1,[h.avail_in,h.avail_out]},Dn.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,1===this.mode||3===this.mode||5===this.mode?function(e){var t;e&&e.state&&(42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==qr&&t!==Yr&&t!==Xr?Gr(e,Kr):(e.state=null,t===Yr&&Gr(e,-3)))}(this.strm):function(e){if(!e||!e.state)return bn;var t=e.state;t.window&&(t.window=null),e.state=null}(this.strm),this.mode=0)},Dn.prototype.reset=function(){switch(this.mode){case 1:case 5:Pn=un(this.strm);break;case 2:case 6:Pn=xn(this.strm)}0!==Pn&&this._error(Pn)},Dn.prototype._error=function(e){this.onerror(Jt[e]+": "+this.strm.msg,e),this.write_in_progress=!1,this.pending_close&&this.close()};var zn=Object.freeze({NONE:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8,Zlib:Dn}),Tn={};Object.keys(zn).forEach(function(e){Tn[e]=zn[e]}),Tn.Z_MIN_WINDOWBITS=8,Tn.Z_MAX_WINDOWBITS=15,Tn.Z_DEFAULT_WINDOWBITS=15,Tn.Z_MIN_CHUNK=64,Tn.Z_MAX_CHUNK=1/0,Tn.Z_DEFAULT_CHUNK=16384,Tn.Z_MIN_MEMLEVEL=1,Tn.Z_MAX_MEMLEVEL=9,Tn.Z_DEFAULT_MEMLEVEL=8,Tn.Z_MIN_LEVEL=-1,Tn.Z_MAX_LEVEL=9,Tn.Z_DEFAULT_LEVEL=Tn.Z_DEFAULT_COMPRESSION;var Cn={Z_OK:Tn.Z_OK,Z_STREAM_END:Tn.Z_STREAM_END,Z_NEED_DICT:Tn.Z_NEED_DICT,Z_ERRNO:Tn.Z_ERRNO,Z_STREAM_ERROR:Tn.Z_STREAM_ERROR,Z_DATA_ERROR:Tn.Z_DATA_ERROR,Z_MEM_ERROR:Tn.Z_MEM_ERROR,Z_BUF_ERROR:Tn.Z_BUF_ERROR,Z_VERSION_ERROR:Tn.Z_VERSION_ERROR};function Mn(e,t){if("string"==typeof t&&(t=new I(t)),!fe(t))throw new TypeError("Not a string or buffer");var r=Tn.Z_FINISH;return e._processChunk(t,r)}function On(e){if(!(this instanceof On))return new On(e);jn.call(this,e,Tn.DEFLATE)}function Un(e){if(!(this instanceof Un))return new Un(e);jn.call(this,e,Tn.INFLATE)}function Nn(e){if(!(this instanceof Nn))return new Nn(e);jn.call(this,e,Tn.GZIP)}function Fn(e){if(!(this instanceof Fn))return new Fn(e);jn.call(this,e,Tn.GUNZIP)}function Wn(e){if(!(this instanceof Wn))return new Wn(e);jn.call(this,e,Tn.DEFLATERAW)}function Hn(e){if(!(this instanceof Hn))return new Hn(e);jn.call(this,e,Tn.INFLATERAW)}function Zn(e){if(!(this instanceof Zn))return new Zn(e);jn.call(this,e,Tn.UNZIP)}function jn(e,t){if(this._opts=e=e||{},this._chunkSize=e.chunkSize||Tn.Z_DEFAULT_CHUNK,qt.call(this,e),e.flush&&e.flush!==Tn.Z_NO_FLUSH&&e.flush!==Tn.Z_PARTIAL_FLUSH&&e.flush!==Tn.Z_SYNC_FLUSH&&e.flush!==Tn.Z_FULL_FLUSH&&e.flush!==Tn.Z_FINISH&&e.flush!==Tn.Z_BLOCK)throw new Error("Invalid flush flag: "+e.flush);if(this._flushFlag=e.flush||Tn.Z_NO_FLUSH,e.chunkSize&&(e.chunkSize<Tn.Z_MIN_CHUNK||e.chunkSize>Tn.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<Tn.Z_MIN_WINDOWBITS||e.windowBits>Tn.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<Tn.Z_MIN_LEVEL||e.level>Tn.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<Tn.Z_MIN_MEMLEVEL||e.memLevel>Tn.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=Tn.Z_FILTERED&&e.strategy!=Tn.Z_HUFFMAN_ONLY&&e.strategy!=Tn.Z_RLE&&e.strategy!=Tn.Z_FIXED&&e.strategy!=Tn.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!fe(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Tn.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;var n=new Error(e);n.errno=t,n.code=Tn.codes[t],r.emit("error",n)};var n=Tn.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);var i=Tn.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||Tn.Z_DEFAULT_WINDOWBITS,n,e.memLevel||Tn.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new I(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}Object.keys(Cn).forEach(function(e){Cn[Cn[e]]=e}),Ue(jn,qt),jn.prototype.params=function(e,t,r){if(e<Tn.Z_MIN_LEVEL||e>Tn.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=Tn.Z_FILTERED&&t!=Tn.Z_HUFFMAN_ONLY&&t!=Tn.Z_RLE&&t!=Tn.Z_FIXED&&t!=Tn.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var n=this;this.flush(Tn.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())})}else Be(r)},jn.prototype.reset=function(){return this._binding.reset()},jn.prototype._flush=function(e){this._transform(new I(0),"",e)},jn.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=Tn.Z_FULL_FLUSH),r.ended)t&&Be(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",function(){n.flush(t)})}else this._flushFlag=e,this.write(new I(0),"",t)},jn.prototype.close=function(e){if(e&&Be(e),!this._closed){this._closed=!0,this._binding.close();var t=this;Be(function(){t.emit("close")})}},jn.prototype._transform=function(e,t,r){var n,i=this._writableState,s=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!fe(e))return r(new Error("invalid input"));s?n=Tn.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||Tn.Z_NO_FLUSH)),this._processChunk(e,n,r)},jn.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,s=0,o=this,a="function"==typeof r;if(!a){var h,c=[],l=0;this.on("error",function(e){h=e});do{var u=this._binding.writeSync(t,e,s,n,this._buffer,this._offset,i)}while(!this._hadError&&p(u[0],u[1]));if(this._hadError)throw h;var f=I.concat(c,l);return this.close(),f}var d=this._binding.write(t,e,s,n,this._buffer,this._offset,i);function p(h,u){if(!o._hadError){var f=i-u;if(function(e){if(!e)throw new Error("have should not go down")}(f>=0),f>0){var d=o._buffer.slice(o._offset,o._offset+f);o._offset+=f,a?o.push(d):(c.push(d),l+=d.length)}if((0===u||o._offset>=o._chunkSize)&&(i=o._chunkSize,o._offset=0,o._buffer=new I(o._chunkSize)),0===u){if(s+=n-h,n=h,!a)return!0;var g=o._binding.write(t,e,s,n,o._buffer,o._offset,o._chunkSize);return g.callback=p,void(g.buffer=e)}if(!a)return!1;r()}}d.buffer=e,d.callback=p},Ue(On,jn),Ue(Un,jn),Ue(Nn,jn),Ue(Fn,jn),Ue(Wn,jn),Ue(Hn,jn),Ue(Zn,jn);var Kn=function(e,t){return Mn(new On(t),e)},Vn=function(e,t){return Mn(new Un(t),e)};class $n{constructor(e,t,r){this.SDKAPPID=e,this.EXPIRETIME=r,this.PRIVATEKEY=t}genTestUserSig(e){return this._isNumber(this.SDKAPPID)?this._isString(this.PRIVATEKEY)?this._isString(e)?this._isNumber(this.EXPIRETIME)?(console.log("sdkAppID="+this.SDKAPPID+" key="+this.PRIVATEKEY+" userID="+e+" expire="+this.EXPIRETIME),this.genSigWithUserbuf(e,this.EXPIRETIME,null)):(console.error("expireTime must be a number"),""):(console.error("userID must be a string"),""):(console.error("privateKey must be a string"),""):(console.error("sdkAppID must be a number"),"")}newBuffer(e,t){return I.from?I.from(e,t):new I(e,t)}unescape(e){return e.replace(/_/g,"=").replace(/\-/g,"/").replace(/\*/g,"+")}escape(e){return e.replace(/\+/g,"*").replace(/\//g,"-").replace(/=/g,"_")}encode(e){return this.escape(this.newBuffer(e).toString("base64"))}decode(e){return this.newBuffer(this.unescape(e),"base64")}base64encode(e){return this.newBuffer(e).toString("base64")}base64decode(e){return this.newBuffer(e,"base64").toString()}_hmacsha256(e,t,r,n){let i="TLS.identifier:"+e+"\n";i+="TLS.sdkappid:"+this.SDKAPPID+"\n",i+="TLS.time:"+t+"\n",i+="TLS.expire:"+r+"\n",null!=n&&(i+="TLS.userbuf:"+n+"\n");let s=_e.HmacSHA256(i,this.PRIVATEKEY);return _e.enc.Base64.stringify(s)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)}_isString(e){return"string"==typeof e}genSigWithUserbuf(e,t,r){let n=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":e,"TLS.sdkappid":this.SDKAPPID,"TLS.time":n,"TLS.expire":t},s="";if(null!=r){let o=this.base64encode(r);i["TLS.userbuf"]=o,s=this._hmacsha256(e,n,t,o)}else s=this._hmacsha256(e,n,t,null);i["TLS.sig"]=s;let o=JSON.stringify(i),a=Kn(this.newBuffer(o)).toString("base64"),h=this.escape(a);return console.log("ret="+h),h}validate(e){let t=this.decode(e),r=Vn(t);console.log("validate ret="+r)}}function qn(e){const{SDKAppID:t,secretKey:r,userID:n}=e;return{SDKAppID:t,userSig:new $n(t,r,604800).genTestUserSig(n)}}class Yn{constructor(){this.isRegistered=!1,this.registrationID="",this.chat=null,this.SDKAppID=0,this.appKey="",this.vapidPublicKey="",this.EVENT=n,this.VERSION=r,o.log("version:",r),this.eventEmitter=new a,this.serviceWorkerManager=p.getInstance(this.eventEmitter),this.initializeBrowserCompatibility().catch(e=>{o.error("Browser compatibility initialization failed",e)}),this.setupInternalListeners()}static getInstance(){return this.instance||(this.instance=new Yn),this.instance}async registerPush(e){try{c.validateRegisterPushOptions(e);const{SDKAppID:r,appKey:n,userID:i,chat:s}=e;this.isRegistered&&(o.warn("Push service already registered, will unregister first and then re-register"),await this.unRegisterPush()),this.checkBrowserSupport();if("granted"!==await this.requestNotificationPermission())throw new Error("User denied notification permission");if(this.SDKAppID=r,this.appKey=n,this.registrationID=i,s)this.chat=s;else{if(void 0===t)throw new Error("TencentCloudChat SDK is not available. Please ensure you have imported @tencentcloud/lite-chat/professional or provided a chat instance in the options.");this.chat=t.create({SDKAppID:this.SDKAppID,...e})}await this.serviceWorkerManager.register(),await this.chatLogin();const a=await this.serviceWorkerManager.getPushSubscription(this.vapidPublicKey);return await this.setToken(a),this.isRegistered=!0,o.log("Push service registration successful",this.registrationID),this.registrationID}catch(r){if(r instanceof h)throw o.error("Push service registration parameter validation failed",r.message),r;throw o.error("Push service registration failed",r),r}}async unRegisterPush(){try{return this.isRegistered?(this.chat,await this.serviceWorkerManager.unsubscribe(),await this.serviceWorkerManager.unregister(),await this.chat.callExperimentalAPI("logoutWebPush"),this.isRegistered=!1,this.registrationID="",this.SDKAppID=0,this.appKey="",this.vapidPublicKey="",this.clearState(),o.log("Push service unregistration successful"),!0):(o.warn("Push service is not registered, no need to unregister"),!0)}catch(e){return o.error("Push service unregistration failed",e),!1}}addPushListener(e,t){try{c.validateEventType(e),c.validateListener(t);const r=this.eventEmitter.on(e,t);return o.log("Add push listener",e,r),r}catch(r){if(r instanceof h)throw o.error("Add push listener parameter validation failed",r.message),r;throw o.error("Add push listener failed",r),new Error("Add push listener failed")}}removePushListener(e,t){try{c.validateEventType(e),c.validateListener(t);const r=this.eventEmitter.off(e,t);return o.log("Remove push listener",e,r),r}catch(r){if(r instanceof h)throw o.error("Remove push listener parameter validation failed",r.message),r;return o.error("Remove push listener failed",r),!1}}checkBrowserSupport(){if(!u.checkBrowserSupport()){const e=u.detectWebPushCapability();throw new Error(`Browser not supported: ${e.reason}`)}}async requestNotificationPermission(){try{const e=await u.checkNotificationPermission();if("granted"===e)return"granted";const t=u.detectWebPushCapability().browserName;if("denied"===e){const e=`Notification permission denied for ${t}. Please check your system settings.`;throw new Error(e)}u.requiresUserGesture()&&o.warn("Current browser requires user gesture to request notification permission");const r=await u.requestNotificationPermission();if("granted"!==r)throw new Error(`User denied notification permission for ${t}`);return this.showSystemPermissionAlert(t),r}catch(e){throw o.error("Request notification permission failed",e),e}}async chatLogin(){try{const e=await this.chat.callExperimentalAPI("loginWebPush",{userID:this.registrationID,userSig:qn({SDKAppID:this.SDKAppID,secretKey:this.appKey,userID:this.registrationID}).userSig});e.data.vapid?this.vapidPublicKey=e.data.vapid:o.error("Failed to fetch VAPID public key")}catch(e){if(2905===e?.code){const t=new Error("The API you are calling is only available in the Professional edition. Please change your import from @tencentcloud/lite-chat to @tencentcloud/lite-chat/professional to access this feature.");throw t.code=e.code,t}throw e}}getSystemPermissionMessage(e){return navigator.userAgent.toLowerCase().includes("mac os")?`For macOS: System Preferences > Notifications > ${e}, then enable notifications.`:`For Windows: Settings > Privacy > Notifications > ${e}, then enable notifications.`}showSystemPermissionAlert(e){const t=this.getSystemPermissionMessage(e);alert(`System notification permission for ${e}.\n\n${t}\n\nPlease refresh the page after enabling notifications.`)}getBrowserInstType(){const e=navigator.userAgent.toLowerCase();return e.includes("edg/")?3003:e.includes("yabrowser/")?3004:e.includes("opr/")||e.includes("opera/")?3005:e.includes("chrome/")&&!e.includes("edg/")?3e3:e.includes("firefox/")?3001:e.includes("safari/")&&!e.includes("chrome/")?3002:1}async setToken(e){try{const t=u.detectWebPushCapability(),n=u.getBrowserInfo(),i={browserType:this.getBrowserInstType(),pushToken:e.endpoint,webPushAuthKey:e.auth,webPushP256:e.p256dh,pushSDKVersion:r,browserVersion:`${t.browserName} ${t.browserVersion}`,browserPlatform:n.platform,browserLanguage:n.language};return await this.chat.callExperimentalAPI("setWebPushToken",i)}catch(t){throw o.error("Device registration failed",t),t}}async initializeBrowserCompatibility(){try{const e=u.detectWebPushCapability();o.log("Browser Web Push capability initialization completed",{browser:`${e.browserName} ${e.browserVersion}`,supported:e.supported,reason:e.reason}),e.supported||o.warn("[WebPush] Browser compatibility warning:",e.reason)}catch(e){o.error("Browser compatibility initialization failed",e)}}setupInternalListeners(){this.eventEmitter.on(n.MESSAGE_RECEIVED,e=>{this.SDKAppID&&this.registrationID&&e.messageID&&this.pushStatistics(e.messageID,"reach")}),this.eventEmitter.on(n.NOTIFICATION_CLICKED,e=>{this.SDKAppID&&this.registrationID&&e.notification?.messageID&&this.pushStatistics(e.notification.messageID,"click")})}async pushStatistics(e,t){try{if(!this.chat)return void o.warn("Chat SDK not initialized, skipping statistics");const r={messageID:e,type:t,timestamp:Date.now(),SDKAppID:this.SDKAppID,registrationID:this.registrationID};o.log(`Message ${t} statistics recorded`,r)}catch(r){o.error(`Failed to record message ${t} statistics`,r)}}clearState(){this.isRegistered=!1,this.registrationID="",this.SDKAppID=0,this.appKey="",this.vapidPublicKey=""}}const Xn=Yn.getInstance();e.EVENT=n,e.default=Xn,e.webPush=Xn,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,66 +0,0 @@
1
- export interface WebPushSDK {
2
- registerPush(options?: RegisterPushOptions): Promise<any>;
3
- unRegisterPush(): Promise<any>;
4
- addPushListener(eventName: EVENT, listener: (data: EventResult) => void): any;
5
- removePushListener(eventName: EVENT, listener: (data: EventResult) => void): any;
6
- }
7
- export interface RegisterPushOptions {
8
- SDKAppID: number;
9
- appKey: string;
10
- userID: string;
11
- serviceWorkerPath?: string;
12
- chat?: any;
13
- }
14
- export declare enum EVENT {
15
- MESSAGE_RECEIVED = "message_received",
16
- MESSAGE_REVOKED = "message_revoked",
17
- NOTIFICATION_CLICKED = "notification_clicked"
18
- }
19
- export interface Message {
20
- ID: String;
21
- type: 'TIMTextElem' | 'TIMImageElem' | 'TIMSoundElem' | 'TIMVideoFileElem' | 'TIMFileElem' | 'TIMCustomElem' | 'TIMRelayElem' | 'TIMLocationElem' | 'TIMFaceElem';
22
- payload: any;
23
- conversationID: String;
24
- conversationType: 'C2C' | 'GROUP';
25
- to: String;
26
- from: String;
27
- flow: String;
28
- time: Number;
29
- status: String;
30
- isRevoked: Boolean;
31
- nick: String;
32
- avatar: String;
33
- isPeerRead: Boolean;
34
- nameCard: String;
35
- atUserList: String[];
36
- cloudCustomData: String;
37
- isDeleted: Boolean;
38
- isModified: Boolean;
39
- needReadReceipt: Boolean;
40
- readReceiptInfo: any;
41
- isBroadcastMessage: Boolean;
42
- isSupportExtension: Boolean;
43
- receiverList?: String[];
44
- revoker: String;
45
- sequence: Number;
46
- progress: Number;
47
- revokerInfo: {
48
- userID: String;
49
- nick: String;
50
- avatar: String;
51
- };
52
- revokeReason: String;
53
- hasRiskContent: Boolean;
54
- }
55
- export interface MessageReceivedResult {
56
- message: Message;
57
- }
58
- export interface MessageRevokedResult {
59
- messageID: String;
60
- }
61
- export interface MessageNotificationClickedResult {
62
- ext: String;
63
- }
64
- export interface EventResult {
65
- data: MessageReceivedResult | MessageRevokedResult | MessageNotificationClickedResult;
66
- }
package/sw.js DELETED
@@ -1 +0,0 @@
1
- !function(){"use strict";function t(t,...e){console.log(`[WebPush SW] ${t}`,...e)}function e(t,...e){console.warn(`[WebPush SW] ${t}`,...e)}function a(t,...e){console.error(`[WebPush SW] ${t}`,...e)}async function i(t){try{(await self.clients.matchAll({includeUncontrolled:!0,type:"window"})).forEach(e=>{e.postMessage(t)})}catch(e){a("Failed to send message to clients",e)}}async function n(i){try{if(!i.rptURL||!i.rptExt)return void e("Missing rptURL or rptExt, skipping report");const a={webpushEvents:[{id:i.id,EventType:i.eventType||1,EventTime:Math.floor(Date.now()/1e3),rptExt:i.rptExt}]};t("Reporting WebPush event",{rptURL:i.rptURL,reportData:a});const n=await fetch(i.rptURL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});n.ok?t("WebPush event reported successfully"):e("Failed to report WebPush event",n.status,n.statusText)}catch(n){a("Error reporting WebPush event",n)}}self.addEventListener("install",e=>{t("Service Worker installing..."),self.skipWaiting()}),self.addEventListener("activate",e=>{t("Service Worker activating..."),e.waitUntil(self.clients.claim())}),self.addEventListener("push",o=>{if(t("Push message received",o),o.data)try{let e;try{e=o.data.json(),t("Push message data (JSON):",e)}catch{const a=o.data.text();t("Push message data (Text):",a),e={id:"",title:"WebPush Notification",desc:a||"You have a new message",url:"/",icon:"",tag:"",image:"",rptExt:"",rptURL:""}}const a={messageID:e.id||Date.now().toString(36)+Math.random().toString(36).substr(2),title:e.title||"New Message",body:e.desc||"You have a new message",icon:e.icon||"",tag:e.tag||e?.id?.slice(-100)||"push-"+Date.now()+"-"+Math.random().toString(36).substr(2,5),data:{url:e.url,image:e.image,rptExt:e.rptExt,rptURL:e.rptURL},timestamp:Date.now()},s=self.registration.showNotification(a.title,{body:a.body,icon:a.icon,image:e.image,tag:a.tag,data:a,requireInteraction:!1}),r=i({type:"MESSAGE_RECEIVED",data:a}),c=e.rptURL&&e.rptExt?n({id:e.id,rptURL:e.rptURL,rptExt:e.rptExt,eventType:1}):Promise.resolve();o.waitUntil(Promise.all([s,r,c]))}catch(s){a("Failed to process push message",s),o.waitUntil(self.registration.showNotification("WebPush Notification",{body:"You have a new message",icon:"/vite.svg",tag:"fallback"}))}else e("Push message has no data")}),self.addEventListener("notificationclick",e=>{t("Notification clicked",e);const o=e.notification,s=e.action,r=o.data;if(o.close(),"close"===s)return;const c=i({type:"NOTIFICATION_CLICKED",data:{notification:r,action:s}}),l=async function(t="/"){try{const e=await self.clients.matchAll({type:"window",includeUncontrolled:!0}),a=new URL(t,self.location.origin).href;for(const t of e)if(t.url===a&&"focus"in t)return void(await t.focus());for(const i of e)if(i.url.startsWith(self.location.origin)&&"focus"in i)return await i.focus(),void i.postMessage({type:"NAVIGATE_TO",url:t});self.clients.openWindow&&await self.clients.openWindow(t)}catch(e){a("Failed to open or focus window",e)}}(r?.data?.url||"/"),d=r?.data?.rptURL&&r?.data?.rptExt?n({id:r.messageID,rptURL:r.data.rptURL,rptExt:r.data.rptExt,eventType:2}):Promise.resolve();e.waitUntil(Promise.all([c,l,d]))}),self.addEventListener("notificationclose",e=>{t("Notification closed",e)}),self.addEventListener("message",e=>{t("Message received from main thread",e.data);const{type:n,payload:o}=e.data;switch(n){case"SHOW_NOTIFICATION":!async function(e){try{const{eventType:a,data:i,options:n}=e;t("Handling show notification request",{eventType:a,data:i,options:n}),await self.registration.showNotification(n.title,{body:n.body,icon:n.icon,badge:n.badge,tag:n.tag,requireInteraction:n.requireInteraction,silent:n.silent,data:n.data}),t("Notification shown successfully",n.title)}catch(i){a("Failed to handle show notification",i)}}(o);break;case"REVOKE_MESSAGE":!async function(t){try{(await self.registration.getNotifications()).forEach(e=>{e.data&&e.data.messageID===t&&e.close()}),await i({type:"MESSAGE_REVOKED",data:{messageID:t}})}catch(e){a("Failed to handle message revocation",e)}}(o.messageID);break;case"UPDATE_CONFIG":t("Updating configuration",o)}}),self.addEventListener("error",t=>{a("Service Worker error",t.error)}),self.addEventListener("unhandledrejection",t=>{a("Service Worker unhandled promise rejection",t.reason)})}();
File without changes
File without changes
File without changes
File without changes
File without changes