/** * Copyright 2016 Amazon.com, * Inc. or its affiliates. All Rights Reserved. * * Licensed under the Amazon Software License (the "License"). * You may not use this file except in compliance with the * License. A copy of the License is located at * * http://aws.amazon.com/asl/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, express or implied. See the License * for the specific language governing permissions and * limitations under the License. */ !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gthis.expireTime)||(this.expired||!this.accessKeyId||!this.secretAccessKey)},get:function(a){var b=this;this.needsRefresh()?this.refresh(function(c){c||(b.expired=!1),a&&a(c)}):a&&a()},refresh:function(a){this.expired=!1,a()}})},{"./core":11}],13:[function(a,b,c){var d=a("../core"),e=a("../../clients/cognitoidentity"),f=a("../../clients/sts");d.CognitoIdentityCredentials=d.util.inherit(d.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function(a){d.Credentials.call(this),this.expired=!0,this.params=a,this.data=null,this.identityId=null,this.loadCachedId()},refresh:function(a){var b=this;b.createClients(),b.data=null,b.identityId=null,b.getId(function(c){c?(b.clearIdOnNotAuthorized(c),a(c)):b.params.RoleArn?b.getCredentialsFromSTS(a):b.getCredentialsForIdentity(a)})},clearCachedId:function(){this.identityId=null,delete this.params.IdentityId;var a=this.params.IdentityPoolId,b=this.params.LoginId||"";delete this.storage[this.localStorageKey.id+a+b],delete this.storage[this.localStorageKey.providers+a+b]},clearIdOnNotAuthorized:function(a){var b=this;"NotAuthorizedException"==a.code&&b.clearCachedId()},getId:function(a){var b=this;return"string"==typeof b.params.IdentityId?a(null,b.params.IdentityId):void b.cognito.getId(function(c,d){!c&&d.IdentityId?(b.params.IdentityId=d.IdentityId,a(null,d.IdentityId)):a(c)})},loadCredentials:function(a,b){a&&b&&(b.expired=!1,b.accessKeyId=a.Credentials.AccessKeyId,b.secretAccessKey=a.Credentials.SecretKey,b.sessionToken=a.Credentials.SessionToken,b.expireTime=a.Credentials.Expiration)},getCredentialsForIdentity:function(a){var b=this;b.cognito.getCredentialsForIdentity(function(c,d){c?b.clearIdOnNotAuthorized(c):(b.cacheId(d),b.data=d,b.loadCredentials(b.data,b)),a(c)})},getCredentialsFromSTS:function(a){var b=this;b.cognito.getOpenIdToken(function(c,d){c?(b.clearIdOnNotAuthorized(c),a(c)):(b.cacheId(d),b.params.WebIdentityToken=d.Token,b.webIdentityCredentials.refresh(function(c){c||(b.data=b.webIdentityCredentials.data,b.sts.credentialsFrom(b.data,b)),a(c)}))})},loadCachedId:function(){var a=this;if(d.util.isBrowser()&&!a.params.IdentityId){var b=a.getStorage("id");if(b&&a.params.Logins){var c=Object.keys(a.params.Logins),e=(a.getStorage("providers")||"").split(","),f=e.filter(function(a){return c.indexOf(a)!==-1});0!==f.length&&(a.params.IdentityId=b)}else b&&(a.params.IdentityId=b)}},createClients:function(){this.webIdentityCredentials=this.webIdentityCredentials||new d.WebIdentityCredentials(this.params),this.cognito=this.cognito||new e({params:this.params}),this.sts=this.sts||new f},cacheId:function(a){this.identityId=a.IdentityId,this.params.IdentityId=this.identityId,d.util.isBrowser()&&(this.setStorage("id",a.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},getStorage:function(a){return this.storage[this.localStorageKey[a]+this.params.IdentityPoolId+(this.params.LoginId||"")]},setStorage:function(a,b){try{this.storage[this.localStorageKey[a]+this.params.IdentityPoolId+(this.params.LoginId||"")]=b}catch(a){}},storage:function(){try{return d.util.isBrowser()&&null!==window.localStorage&&"object"==typeof window.localStorage?window.localStorage:{}}catch(a){return{}}}()})},{"../../clients/cognitoidentity":5,"../../clients/sts":6,"../core":11}],14:[function(a,b,c){var d=a("../core");d.CredentialProviderChain=d.util.inherit(d.Credentials,{constructor:function(a){a?this.providers=a:this.providers=d.CredentialProviderChain.defaultProviders.slice(0)},resolve:function(a){function b(e,f){if(!e&&f||c===d.length)return void a(e,f);var g=d[c++];f="function"==typeof g?g.call():g,f.get?f.get(function(a){b(a,a?null:f)}):b(null,f)}if(0===this.providers.length)return a(new Error("No providers")),this;var c=0,d=this.providers.slice(0);return b(),this}}),d.CredentialProviderChain.defaultProviders=[]},{"../core":11}],15:[function(a,b,c){var d=a("../core"),e=a("../../clients/sts");d.SAMLCredentials=d.util.inherit(d.Credentials,{constructor:function(a){d.Credentials.call(this),this.expired=!0,this.params=a},refresh:function(a){var b=this;b.createClients(),a||(a=function(a){if(a)throw a}),b.service.assumeRoleWithSAML(function(c,d){c||b.service.credentialsFrom(d,b),a(c)})},createClients:function(){this.service=this.service||new e({params:this.params})}})},{"../../clients/sts":6,"../core":11}],16:[function(a,b,c){var d=a("../core"),e=a("../../clients/sts");d.TemporaryCredentials=d.util.inherit(d.Credentials,{constructor:function(a){d.Credentials.call(this),this.loadMasterCredentials(),this.expired=!0,this.params=a||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},refresh:function(a){var b=this;b.createClients(),a||(a=function(a){if(a)throw a}),b.service.config.credentials=b.masterCredentials;var c=b.params.RoleArn?b.service.assumeRole:b.service.getSessionToken;c.call(b.service,function(c,d){c||b.service.credentialsFrom(d,b),a(c)})},loadMasterCredentials:function(){for(this.masterCredentials=d.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials},createClients:function(){this.service=this.service||new e({params:this.params})}})},{"../../clients/sts":6,"../core":11}],17:[function(a,b,c){var d=a("../core"),e=a("../../clients/sts");d.WebIdentityCredentials=d.util.inherit(d.Credentials,{constructor:function(a){d.Credentials.call(this),this.expired=!0,this.params=a,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null},refresh:function(a){var b=this;b.createClients(),a||(a=function(a){if(a)throw a}),b.service.assumeRoleWithWebIdentity(function(c,d){b.data=null,c||(b.data=d,b.service.credentialsFrom(d,b)),a(c)})},createClients:function(){this.service=this.service||new e({params:this.params})}})},{"../../clients/sts":6,"../core":11}],18:[function(a,b,c){var d=a("./core"),e=a("./sequential_executor");d.EventListeners={Core:{}},d.EventListeners={Core:(new e).addNamedListeners(function(a,b){b("VALIDATE_CREDENTIALS","validate",function(a,b){return a.service.api.signatureVersion?void a.service.config.getCredentials(function(c){c&&(a.response.error=d.util.error(c,{code:"CredentialsError",message:"Missing credentials in config"})),b()}):b()}),a("VALIDATE_REGION","validate",function(a){a.service.config.region||a.service.isGlobalEndpoint||(a.response.error=d.util.error(new Error,{code:"ConfigError",message:"Missing region in config"}))}),a("VALIDATE_PARAMETERS","validate",function(a){var b=a.service.api.operations[a.operation].input,c=a.service.config.paramValidation;new d.ParamValidator(c).validate(b,a.params)}),b("COMPUTE_SHA256","afterBuild",function(a,b){if(a.haltHandlersOnError(),!a.service.api.signatureVersion)return b();if(a.service.getSignerClass(a)===d.Signers.V4){var c=a.httpRequest.body||"";d.util.computeSha256(c,function(c,d){c?b(c):(a.httpRequest.headers["X-Amz-Content-Sha256"]=d,b())})}else b()}),a("SET_CONTENT_LENGTH","afterBuild",function(a){if(void 0===a.httpRequest.headers["Content-Length"]){var b=d.util.string.byteLength(a.httpRequest.body);a.httpRequest.headers["Content-Length"]=b}}),a("SET_HTTP_HOST","afterBuild",function(a){a.httpRequest.headers.Host=a.httpRequest.endpoint.host}),a("RESTART","restart",function(){var a=this.response.error;a&&a.retryable&&(this.httpRequest=new d.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount=600?this.emit("sign",[this],function(a){a?b(a):g()}):g()}),a("HTTP_HEADERS","httpHeaders",function(a,b,c){c.httpResponse.statusCode=a,c.httpResponse.headers=b,c.httpResponse.body=new d.util.Buffer(""),c.httpResponse.buffers=[],c.httpResponse.numBytes=0;var e=b.date||b.Date;if(e){var f=Date.parse(e);c.request.service.config.correctClockSkew&&d.util.isClockSkewed(f)&&d.util.applyClockOffset(f)}}),a("HTTP_DATA","httpData",function(a,b){if(a){if(d.util.isNode()){b.httpResponse.numBytes+=a.length;var c=b.httpResponse.headers["content-length"],e={loaded:b.httpResponse.numBytes,total:c};b.request.emit("httpDownloadProgress",[e,b])}b.httpResponse.buffers.push(new d.util.Buffer(a))}}),a("HTTP_DONE","httpDone",function(a){if(a.httpResponse.buffers&&a.httpResponse.buffers.length>0){var b=d.util.buffer.concat(a.httpResponse.buffers);a.httpResponse.body=b}delete a.httpResponse.numBytes,delete a.httpResponse.buffers}),a("FINALIZE_ERROR","retry",function(a){a.httpResponse.statusCode&&(a.error.statusCode=a.httpResponse.statusCode,void 0===a.error.retryable&&(a.error.retryable=this.service.retryableError(a.error,this)))}),a("INVALIDATE_CREDENTIALS","retry",function(a){if(a.error)switch(a.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":a.error.retryable=!0,a.request.service.config.credentials.expired=!0}}),a("EXPIRED_SIGNATURE","retry",function(a){var b=a.error;b&&"string"==typeof b.code&&"string"==typeof b.message&&b.code.match(/Signature/)&&b.message.match(/expired/)&&(a.error.retryable=!0)}),a("CLOCK_SKEWED","retry",function(a){a.error&&this.service.clockSkewError(a.error)&&this.service.config.correctClockSkew&&d.config.isClockSkewed&&(a.error.retryable=!0)}),a("REDIRECT","retry",function(a){a.error&&a.error.statusCode>=300&&a.error.statusCode<400&&a.httpResponse.headers.location&&(this.httpRequest.endpoint=new d.Endpoint(a.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,a.error.redirect=!0,a.error.retryable=!0)}),a("RETRY_CHECK","retry",function(a){a.error&&(a.error.redirect&&a.redirectCount=this.HEADERS_RECEIVED&&!l){try{k.responseType="arraybuffer"}catch(a){}i.statusCode=k.status,i.headers=g.parseHeaders(k.getAllResponseHeaders()),i.emit("headers",i.statusCode,i.headers),l=!0}this.readyState===this.DONE&&g.finishRequest(k,i)},!1),k.upload.addEventListener("progress",function(a){i.emit("sendProgress",a)}),k.addEventListener("progress",function(a){i.emit("receiveProgress",a)},!1),k.addEventListener("timeout",function(){f(d.util.error(new Error("Timeout"),{code:"TimeoutError"}))},!1),k.addEventListener("error",function(){f(d.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},!1),c(i),k.open(a.method,j,b.xhrAsync!==!1),d.util.each(a.headers,function(a,b){"Content-Length"!==a&&"User-Agent"!==a&&"Host"!==a&&k.setRequestHeader(a,b)}),b.timeout&&b.xhrAsync!==!1&&(k.timeout=b.timeout),b.xhrWithCredentials&&(k.withCredentials=!0);try{k.send(a.body)}catch(b){if(!a.body||"object"!=typeof a.body.buffer)throw b;k.send(a.body.buffer)}return i},parseHeaders:function(a){var b={};return d.util.arrayEach(a.split(/\r?\n/),function(a){var c=a.split(":",1)[0],d=a.substring(c.length+2);c.length>0&&(b[c.toLowerCase()]=d)}),b},finishRequest:function(a,b){var c;if("arraybuffer"===a.responseType&&a.response){var e=a.response;c=new d.util.Buffer(e.byteLength);for(var f=new Uint8Array(e),g=0;g1){var e=this.errors.join("\n* ");throw e="There were "+this.errors.length+" validation errors:\n* "+e,d.util.error(new Error(e),{code:"MultipleValidationErrors",errors:this.errors})}if(1===this.errors.length)throw this.errors[0];return!0}, fail:function(a,b){this.errors.push(d.util.error(new Error(b),{code:a}))},validateStructure:function(a,b,c){this.validateType(b,c,["object"],"structure");for(var d,e=0;a.required&&e= "+a.min+", but found "+b+" for "+c),this.validation.max&&void 0!==a.max&&b>a.max&&this.fail("MaxRangeError","Expected "+d+" <= "+a.max+", but found "+b+" for "+c)},validateEnum:function(a,b,c){this.validation.enum&&void 0!==a.enum&&a.enum.indexOf(b)===-1&&this.fail("EnumError","Found string value of "+b+", but expected "+a.enum.join("|")+" for "+c)},validateType:function(a,b,c,e){if(null===a||void 0===a)return!1;for(var f=!1,g=0;g0){var d=JSON.parse(c.body.toString());(d.__type||d.code)&&(b.code=(d.__type||d.code).split("#").pop()),"RequestEntityTooLarge"===b.code?b.message="Request body must be less than 1 MB":b.message=d.message||d.Message||null}else b.statusCode=c.statusCode,b.message=c.statusCode.toString();a.error=g.error(new Error,b)}function f(a){var b=a.httpResponse.body.toString()||"{}";if(a.request.service.config.convertResponseTypes===!1)a.data=JSON.parse(b);else{var c=a.request.service.api.operations[a.request.operation],d=c.output||{},e=new i;a.data=e.parse(b,d)}}var g=a("../util"),h=a("../json/builder"),i=a("../json/parser");b.exports={buildRequest:d,extractError:e,extractData:f}},{"../json/builder":21,"../json/parser":22,"../util":53}],31:[function(a,b,c){function d(a){var b=a.service.api.operations[a.operation],c=a.httpRequest;c.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",c.params={Version:a.service.api.apiVersion,Action:b.name};var d=new i;d.serialize(a.params,b.input,function(a,b){c.params[a]=b}),c.body=h.queryParamsToString(c.params)}function e(a){var b,c=a.httpResponse.body.toString();b=c.match("=0?"&":"?";var g=[];j.arrayEach(Object.keys(e).sort(),function(a){Array.isArray(e[a])||(e[a]=[e[a]]);for(var b=0;b0){b=new h.XML.Parser;var l=b.parse(d.toString(),f);i.update(a.data,l)}}var h=a("../core"),i=a("../util"),j=a("./rest");b.exports={buildRequest:e,extractError:f,extractData:g}},{"../core":11,"../util":53,"./rest":32}],35:[function(a,b,c){function d(){}function e(a){return a.isQueryName||"ec2"!==a.api.protocol?a.name:a.name[0].toUpperCase()+a.name.substr(1)}function f(a,b,c,d){j.each(c.members,function(c,f){var g=b[c];if(null!==g&&void 0!==g){var h=e(f);h=a?a+"."+h:h,i(h,g,f,d)}})}function g(a,b,c,d){var e=1;j.each(b,function(b,f){var g=c.flattened?".":".entry.",h=g+e++ +".",j=h+(c.key.name||"key"),k=h+(c.value.name||"value");i(a+j,b,c.key,d),i(a+k,f,c.value,d)})}function h(a,b,c,d){var f=c.member||{};return 0===b.length?void d.call(this,a,null):void j.arrayEach(b,function(b,g){var h="."+(g+1);if("ec2"===c.api.protocol)h+="";else if(c.flattened){if(f.name){var j=a.split(".");j.pop(),j.push(e(f)),a=j.join(".")}}else h=".member"+h;i(a+h,b,f,d)})}function i(a,b,c,d){null!==b&&void 0!==b&&("structure"===c.type?f(a,b,c,d):"list"===c.type?h(a,b,c,d):"map"===c.type?g(a,b,c,d):d(a,c.toWireFormat(b).toString()))}var j=a("../util");d.prototype.serialize=function(a,b,c){f("",a,b,c)},b.exports=d},{"../util":53}],36:[function(a,b,c){function d(a){if(!a)return null;var b=a.split("-");return b.length<3?null:b.slice(0,b.length-2).join("-")+"-*"}function e(a){var b=a.config.region,c=d(b),e=a.api.endpointPrefix;return[[b,e],[c,e],[b,"*"],[c,"*"],["*",e],["*","*"]].map(function(a){return a[0]&&a[1]?a.join("/"):null})}function f(a,b){h.each(b,function(b,c){"globalEndpoint"!==b&&(void 0!==a.config[b]&&null!==a.config[b]||(a.config[b]=c))})}function g(a){for(var b=e(a),c=0;c=0){i=!0;var j=0}var k=function(){i&&j!==h?e.emit("error",d.util.error(new Error("Stream content length mismatch. Received "+j+" of "+h+" bytes."),{code:"StreamContentLengthMismatch"})):2===d.HttpClient.streamsApiVersion?e.end():e.emit("end")},l=g.httpResponse.createUnbufferedStream();if(2===d.HttpClient.streamsApiVersion)if(i){var m=new a.PassThrough;m._write=function(b){return b&&b.length&&(j+=b.length),a.PassThrough.prototype._write.apply(this,arguments)},m.on("end",k),l.pipe(m).pipe(e,{end:!1})}else l.pipe(e);else i&&l.on("data",function(a){a&&a.length&&(j+=a.length)}),l.on("data",function(a){e.emit("data",a)}),l.on("end",k);l.on("error",function(a){i=!1,e.emit("error",a)})}}),this.on("error",function(a){e.emit("error",a)}),e},emitEvent:function(a,b,c){"function"==typeof b&&(c=b,b=null),c||(c=function(){}),b||(b=this.eventParameters(a,this.response));var e=d.SequentialExecutor.prototype.emit;e.call(this,a,b,function(a){a&&(this.response.error=a),c.call(this,a)})},eventParameters:function(a){switch(a){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},presign:function(a,b){return b||"function"!=typeof a||(b=a,a=null),(new d.Signers.Presign).sign(this.toGet(),a,b)},isPresigned:function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},toUnauthenticated:function(){return this.removeListener("validate",d.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",d.EventListeners.Core.SIGN),this},toGet:function(){return"query"!==this.service.api.protocol&&"ec2"!==this.service.api.protocol||(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},buildAsGet:function(a){a.httpRequest.method="GET",a.httpRequest.path=a.service.endpoint.path+"?"+a.httpRequest.body,a.httpRequest.body="",delete a.httpRequest.headers["Content-Length"],delete a.httpRequest.headers["Content-Type"]},haltHandlersOnError:function(){this._haltHandlersOnError=!0}}),d.util.addPromisesToRequests(d.Request),d.util.mixin(d.Request,d.SequentialExecutor)}).call(this,a("FWaASH"))},{"./core":11,"./state_machine":52,FWaASH:62,jmespath:79}],39:[function(a,b,c){function d(a){var b=a.request._waiter,c=b.config.acceptors,d=!1,e="retry";c.forEach(function(c){if(!d){var f=b.matchers[c.matcher];f&&f(a,c.expected,c.argument)&&(d=!0,e=c.state)}}),!d&&a.error&&(e="failure"),"success"===e?b.setSuccess(a):b.setError(a,"retry"===e)}var e=a("./core"),f=e.util.inherit,g=a("jmespath");e.ResourceWaiter=f({constructor:function(a,b){this.service=a,this.state=b,this.loadWaiterConfig(this.state)},service:null,state:null,config:null,matchers:{path:function(a,b,c){var d=g.search(a.data,c);return g.strictDeepEqual(d,b)},pathAll:function(a,b,c){var d=g.search(a.data,c);Array.isArray(d)||(d=[d]);var e=d.length;if(!e)return!1;for(var f=0;f-1&&c.splice(e,1)}return this},removeAllListeners:function(a){return a?delete this._events[a]:this._events={},this},emit:function(a,b,c){c||(c=function(){});var d=this.listeners(a),e=d.length;return this.callListeners(d,b,c),e>0},callListeners:function(a,b,c,e){function f(e){return e&&(h=d.util.error(h||new Error,e),g._haltHandlersOnError)?c.call(g,h):void g.callListeners(a,b,c,h)}for(var g=this,h=e||null;a.length>0;){var i=a.shift();if(i._isAsync)return void i.apply(g,b.concat([f]));try{i.apply(g,b)}catch(a){h=d.util.error(h||new Error,a)}if(h&&g._haltHandlersOnError)return void c.call(g,h)}c.call(g,h)},addListeners:function(a){var b=this;return a._events&&(a=a._events),d.util.each(a,function(a,c){"function"==typeof c&&(c=[c]),d.util.arrayEach(c,function(c){b.on(a,c)})}),b},addNamedListener:function(a,b,c){return this[a]=c,this.addListener(b,c),this},addNamedAsyncListener:function(a,b,c){return c._isAsync=!0,this.addNamedListener(a,b,c)},addNamedListeners:function(a){var b=this;return a(function(){b.addNamedListener.apply(b,arguments)},function(){b.addNamedAsyncListener.apply(b,arguments)}),this}}),d.SequentialExecutor.prototype.addListener=d.SequentialExecutor.prototype.on,b.exports=d.SequentialExecutor},{"./core":11}],42:[function(a,b,c){var d=a("./core"),e=a("./model/api"),f=a("./region_config"),g=d.util.inherit,h=0;d.Service=g({constructor:function(a){if(!this.loadServiceClass)throw d.util.error(new Error,"Service must be constructed with `new' operator");var b=this.loadServiceClass(a||{});if(b){var c=d.util.copy(a),e=new b(a);return Object.defineProperty(e,"_originalConfig",{get:function(){return c},enumerable:!1,configurable:!0}),e._clientId=++h,e}this.initialize(a)},initialize:function(a){var b=d.config[this.serviceIdentifier];this.config=new d.Config(d.config),b&&this.config.update(b,!0),a&&this.config.update(a,!0),this.validateService(),this.config.endpoint||f(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint)},validateService:function(){},loadServiceClass:function(a){var b=a;if(d.util.isEmpty(this.api)){if(b.apiConfig)return d.Service.defineServiceApi(this.constructor,b.apiConfig);if(this.constructor.services){b=new d.Config(d.config),b.update(a,!0);var c=b.apiVersions[this.constructor.serviceIdentifier];return c=c||b.apiVersion,this.getLatestServiceClass(c)}return null}return null},getLatestServiceClass:function(a){return a=this.getLatestServiceVersion(a),null===this.constructor.services[a]&&d.Service.defineServiceApi(this.constructor,a),this.constructor.services[a]},getLatestServiceVersion:function(a){if(!this.constructor.services||0===this.constructor.services.length)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(a?d.util.isType(a,Date)&&(a=d.util.date.iso8601(a).split("T")[0]):a="latest",Object.hasOwnProperty(this.constructor.services,a))return a;for(var b=Object.keys(this.constructor.services).sort(),c=null,e=b.length-1;e>=0;e--)if("*"!==b[e][b[e].length-1]&&(c=b[e]),b[e].substr(0,10)<=a)return c;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+a+"'")},api:{},defaultRetryCount:3,makeRequest:function(a,b,c){if("function"==typeof b&&(c=b,b=null),b=b||{},this.config.params){var e=this.api.operations[a];e&&(b=d.util.copy(b),d.util.each(this.config.params,function(a,c){e.input.members[a]&&(void 0!==b[a]&&null!==b[a]||(b[a]=c))}))}var f=new d.Request(this,a,b);return this.addAllRequestListeners(f),c&&f.send(c),f},makeUnauthenticatedRequest:function(a,b,c){"function"==typeof b&&(c=b,b={});var d=this.makeRequest(a,b).toUnauthenticated();return c?d.send(c):d},waitFor:function(a,b,c){var e=new d.ResourceWaiter(this,a);return e.wait(b,c)},addAllRequestListeners:function(a){for(var b=[d.events,d.EventListeners.Core,this.serviceInterface(),d.EventListeners.CorePost],c=0;c=500))},networkingError:function(a){return"NetworkingError"===a.code},expiredCredentialsError:function(a){return"ExpiredTokenException"===a.code},clockSkewError:function(a){switch(a.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},throttledError:function(a){switch(a.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":return!0;default:return!1}},endpointFromTemplate:function(a){if("string"!=typeof a)return a;var b=a;return b=b.replace(/\{service\}/g,this.api.endpointPrefix),b=b.replace(/\{region\}/g,this.config.region),b=b.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function(a){this.endpoint=new d.Endpoint(a,this.config)},paginationConfig:function(a,b){var c=this.api.operations[a].paginator;if(!c){if(b){var e=new Error;throw d.util.error(e,"No pagination configuration for "+a)}return null}return c}}),d.util.update(d.Service,{defineMethods:function(a){d.util.each(a.prototype.api.operations,function(b){if(!a.prototype[b]){var c=a.prototype.api.operations[b];"none"===c.authtype?a.prototype[b]=function(a,c){return this.makeUnauthenticatedRequest(b,a,c)}:a.prototype[b]=function(a,c){return this.makeRequest(b,a,c)}}})},defineService:function(a,b,c){d.Service._serviceMap[a]=!0,Array.isArray(b)||(c=b,b=[]);var e=g(d.Service,c||{});if("string"==typeof a){d.Service.addVersions(e,b);var f=e.serviceIdentifier||a;e.serviceIdentifier=f}else e.prototype.api=a,d.Service.defineMethods(e);return e},addVersions:function(a,b){Array.isArray(b)||(b=[b]),a.services=a.services||{};for(var c=0;c604800){var d="Presigning does not support expiry time greater than a week with SigV4 signing.";throw f.util.error(new Error,{code:"InvalidExpiryTime",message:d,retryable:!1})}a.httpRequest.headers[h]=b}else{if(c!==f.Signers.S3)throw f.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});a.httpRequest.headers[h]=parseInt(f.util.date.unixTimestamp()+b,10).toString()}}function e(a){var b=a.httpRequest.endpoint,c=f.util.urlParse(a.httpRequest.path),d={};c.search&&(d=f.util.queryStringParse(c.search.substr(1))),f.util.each(a.httpRequest.headers,function(a,b){a===h&&(a="Expires"),0===a.indexOf("x-amz-meta-")&&(delete d[a],a=a.toLowerCase()),d[a]=b}),delete a.httpRequest.headers[h];var e=d.Authorization.split(" ");if("AWS"===e[0])e=e[1].split(":"),d.AWSAccessKeyId=e[0],d.Signature=e[1];else if("AWS4-HMAC-SHA256"===e[0]){e.shift();var g=e.join(" "),i=g.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];d["X-Amz-Signature"]=i,delete d.Expires}delete d.Authorization,delete d.Host,b.pathname=c.pathname,b.search=f.util.queryParamsToString(d)}var f=a("../core"),g=f.util.inherit,h="presigned-expires";f.Signers.Presign=g({sign:function(a,b,c){if(a.httpRequest.headers[h]=b||3600,a.on("build",d),a.on("sign",e),a.removeListener("afterBuild",f.EventListeners.Core.SET_CONTENT_LENGTH),a.removeListener("afterBuild",f.EventListeners.Core.COMPUTE_SHA256),a.emit("beforePresign",[a]),!c){if(a.build(),a.response.error)throw a.response.error;return f.util.urlFormat(a.httpRequest.endpoint)}a.build(function(){this.response.error?c(this.response.error):c(null,f.util.urlFormat(a.httpRequest.endpoint))})}}),b.exports=f.Signers.Presign},{"../core":11}],46:[function(a,b,c){var d=a("../core"),e=d.util.inherit;d.Signers.RequestSigner=e({constructor:function(a){this.request=a},setServiceClientId:function(a){this.serviceClientId=a},getServiceClientId:function(){return this.serviceClientId}}),d.Signers.RequestSigner.getVersion=function(a){switch(a){case"v2":return d.Signers.V2;case"v3":return d.Signers.V3;case"v4":return d.Signers.V4;case"s3":return d.Signers.S3;case"v3https":return d.Signers.V3Https}throw new Error("Unknown signing version "+a)},a("./v2"),a("./v3"),a("./v3https"),a("./v4"),a("./s3"),a("./presign")},{"../core":11,"./presign":45,"./s3":47,"./v2":48,"./v3":49,"./v3https":50,"./v4":51}],47:[function(a,b,c){var d=a("../core"),e=d.util.inherit;d.Signers.S3=e(d.Signers.RequestSigner,{subResources:{acl:1,accelerate:1,cors:1,lifecycle:1,delete:1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment:1,replication:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:function(a,b){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=d.util.date.rfc822(b)),a.sessionToken&&(this.request.headers["x-amz-security-token"]=a.sessionToken);var c=this.sign(a.secretAccessKey,this.stringToSign()),e="AWS "+a.accessKeyId+":"+c;this.request.headers.Authorization=e},stringToSign:function(){var a=this.request,b=[];b.push(a.method),b.push(a.headers["Content-MD5"]||""),b.push(a.headers["Content-Type"]||""),b.push(a.headers["presigned-expires"]||"");var c=this.canonicalizedAmzHeaders();return c&&b.push(c),b.push(this.canonicalizedResource()),b.join("\n")},canonicalizedAmzHeaders:function(){var a=[];d.util.each(this.request.headers,function(b){b.match(/^x-amz-/i)&&a.push(b)}),a.sort(function(a,b){return a.toLowerCase()=0?"&":"?";this.request.path+=f+d.util.queryParamsToString(e)},authorization:function(a,b){var c=[],d=this.credentialString(b);return c.push(this.algorithm+" Credential="+a.accessKeyId+"/"+d),c.push("SignedHeaders="+this.signedHeaders()),c.push("Signature="+this.signature(a,b)),c.join(", ")},signature:function(a,b){var c=null,e=this.serviceName+(this.getServiceClientId()?"_"+this.getServiceClientId():"");if(this.signatureCache){var c=f[e];c||(g.push(e),g.length>h&&delete f[g.shift()])}var i=b.substr(0,8);if(!c||c.akid!==a.accessKeyId||c.region!==this.request.region||c.date!==i){var j=a.secretAccessKey,k=d.util.crypto.hmac("AWS4"+j,i,"buffer"),l=d.util.crypto.hmac(k,this.request.region,"buffer"),m=d.util.crypto.hmac(l,this.serviceName,"buffer"),n=d.util.crypto.hmac(m,"aws4_request","buffer");if(!this.signatureCache)return d.util.crypto.hmac(n,this.stringToSign(b),"hex");f[e]={region:this.request.region,date:i,key:n,akid:a.accessKeyId}}var o=f[e].key;return d.util.crypto.hmac(o,this.stringToSign(b),"hex")},stringToSign:function(a){var b=[];return b.push("AWS4-HMAC-SHA256"),b.push(a),b.push(this.credentialString(a)),b.push(this.hexEncodedHash(this.canonicalString())),b.join("\n")},canonicalString:function(){var a=[],b=this.request.pathname();return"s3"!==this.serviceName&&(b=d.util.uriEscapePath(b)),a.push(this.request.method),a.push(b),a.push(this.request.search()),a.push(this.canonicalHeaders()+"\n"),a.push(this.signedHeaders()),a.push(this.hexEncodedBodyHash()),a.join("\n")},canonicalHeaders:function(){var a=[];d.util.each.call(this,this.request.headers,function(b,c){a.push([b,c])}),a.sort(function(a,b){return a[0].toLowerCase()=a.length)return b.push(null);var e=c+d;e>a.length&&(e=a.length),b.push(a.slice(c,e)),c=e},b},concat:function(a){var b,c=0,d=0,f=null;for(b=0;b>>8^b[255&(c^f)]}return(c^-1)>>>0},hmac:function(a,b,c,d){return c||(c="binary"),"buffer"===c&&(c=void 0),d||(d="sha256"),"string"==typeof b&&(b=new e.Buffer(b)),e.crypto.lib.createHmac(d,a).update(b).digest(c)},md5:function(a,b,c){return e.crypto.hash("md5",a,b,c)},sha256:function(a,b,c){return e.crypto.hash("sha256",a,b,c)},hash:function(a,b,c,d){var f=e.crypto.createHash(a);c||(c="binary"),"buffer"===c&&(c=void 0),"string"==typeof b&&(b=new e.Buffer(b));var g=e.arraySliceFn(b),h=e.Buffer.isBuffer(b);if(e.isBrowser()&&"undefined"!=typeof ArrayBuffer&&b&&b.buffer instanceof ArrayBuffer&&(h=!0),d&&"object"==typeof b&&"function"==typeof b.on&&!h)b.on("data",function(a){f.update(a)}),b.on("error",function(a){d(a)}),b.on("end",function(){d(null,f.digest(c))});else{if(!d||!g||h||"undefined"==typeof FileReader){e.isBrowser()&&"object"==typeof b&&!h&&(b=new e.Buffer(new Uint8Array(b)));var i=f.update(b).digest(c);return d&&d(null,i),i}var j=0,k=524288,l=new FileReader;l.onerror=function(){d(new Error("Failed to read data."))},l.onload=function(){var a=new e.Buffer(new Uint8Array(l.result));f.update(a),j+=a.length,l._continueReading()},l._continueReading=function(){if(j>=b.size)return void d(null,f.digest(c));var a=j+k;a>b.size&&(a=b.size),l.readAsArrayBuffer(g.call(b,j,a))},l._continueReading()}},toHex:function(a){for(var b=[],c=0;c=3e5,!1),d.config.isClockSkewed},applyClockOffset:function(a){a&&(d.config.systemClockOffset=a-(new Date).getTime())},extractRequestId:function(a){var b=a.httpResponse.headers["x-amz-request-id"]||a.httpResponse.headers["x-amzn-requestid"];!b&&a.data&&a.data.ResponseMetadata&&(b=a.data.ResponseMetadata.RequestId),b&&(a.requestId=b),a.error&&(a.error.requestId=b)},addPromisesToRequests:function(a,b){return b=b||null,b||"undefined"==typeof Promise||(b=Promise),"function"!=typeof b?void delete a.prototype.promise:void(a.prototype.promise=function(){var a=this;return new b(function(b,c){a.on("complete",function(a){a.error?c(a.error):b(a.data)}),a.runTo()})})},isDualstackAvailable:function(b){if(!b)return!1;var c=a("../apis/metadata.json");return"string"!=typeof b&&(b=b.serviceIdentifier),!("string"!=typeof b||!c.hasOwnProperty(b))&&!!c[b].dualstackAvailable},calculateRetryDelay:function(a,b){b||(b={});var c=b.customBackoff||null;if("function"==typeof c)return c(a);var d=b.base||100,e=Math.random()*(Math.pow(2,a)*d);return e},handleRequestWithRetries:function(a,b,f){b||(b={});var g=d.HttpClient.getInstance(),h=b.httpOptions||{},i=0,j=function(a){var c=b.maxRetries||0;if(a&&"TimeoutError"===a.code&&(a.retryable=!0),a&&a.retryable&&i=500||429===c});d&&g.retryable&&(g.retryAfter=d),j(g)}})},j)};c.nextTick(k)}};b.exports=e}).call(this,a("FWaASH"))},{"../apis/metadata.json":3,"./core":11,FWaASH:62,fs:56}],54:[function(a,b,c){function d(){}function e(a,b){switch(b||(b={}),b.type){case"structure":return f(a,b);case"map":return g(a,b);case"list":return h(a,b);case void 0:case null:return j(a);default:return i(a,b)}}function f(a,b){var c={};return null===a?c:(k.each(b.members,function(b,d){if(d.isXmlAttribute){if(Object.prototype.hasOwnProperty.call(a.attributes,d.name)){var f=a.attributes[d.name].value;c[b]=e({textContent:f},d)}}else{var g=d.flattened?a:a.getElementsByTagName(d.name)[0];g?c[b]=e(g,d):d.flattened||"list"!==d.type||(c[b]=d.defaultValue)}}),c)}function g(a,b){for(var c={},d=b.key.name||"key",f=b.value.name||"value",g=b.flattened?b.name:"entry",h=a.firstElementChild;h;){if(h.nodeName===g){var i=h.getElementsByTagName(d)[0].textContent,j=h.getElementsByTagName(f)[0];c[i]=e(j,b.value)}h=h.nextElementSibling}return c}function h(a,b){for(var c=[],d=b.flattened?b.name:b.member.name||"member",f=a.firstElementChild;f;)f.nodeName===d&&c.push(e(f,b.member)),f=f.nextElementSibling;return c}function i(a,b){if(a.getAttribute){var c=a.getAttribute("encoding");"base64"===c&&(b=new l.create({type:c}))}var d=a.textContent;return""===d&&(d=null),"function"==typeof b.toType?b.toType(d):d}function j(a){if(void 0===a||null===a)return"";if(!a.firstElementChild)return null===a.parentNode.parentNode?{}:0===a.childNodes.length?"":a.textContent;for(var b={type:"structure",members:{}},c=a.firstElementChild;c;){var d=c.nodeName;Object.prototype.hasOwnProperty.call(b.members,d)?b.members[d].type="list":b.members[d]={name:d},c=c.nextElementSibling}return f(a,b)}var k=a("../util"),l=a("../model/shape");d.prototype.parse=function(a,b){if(""===a.replace(/^\s+/,""))return{};var c,d;try{if(window.DOMParser){try{var f=new DOMParser;c=f.parseFromString(a,"text/xml")}catch(a){throw k.error(new Error("Parse error in document"),{originalError:a,code:"XMLParserError",retryable:!0})}if(null===c.documentElement)throw k.error(new Error("Cannot parse empty document."),{code:"XMLParserError",retryable:!0});var g=c.getElementsByTagName("parsererror")[0];if(g&&(g.parentNode===c||"body"===g.parentNode.nodeName||g.parentNode.parentNode===c||"body"===g.parentNode.parentNode.nodeName)){var h=g.getElementsByTagName("div")[0]||g;throw k.error(new Error(h.textContent||"Parser error in document"),{code:"XMLParserError",retryable:!0})}}else{if(!window.ActiveXObject)throw new Error("Cannot load XML parser");if(c=new window.ActiveXObject("Microsoft.XMLDOM"),c.async=!1,!c.loadXML(a))throw k.error(new Error("Parse error in document"),{code:"XMLParserError",retryable:!0})}}catch(a){d=a}if(c&&c.documentElement&&!d){var i=e(c.documentElement,b),j=c.getElementsByTagName("ResponseMetadata")[0];return j&&(i.ResponseMetadata=e(j,{})),i}if(d)throw k.error(d||new Error,{code:"XMLParserError",retryable:!0});return{}},b.exports=d},{"../model/shape":28,"../util":53}],55:[function(a,b,c){function d(){}function e(a,b,c){switch(c.type){case"structure":return f(a,b,c);case"map":return g(a,b,c);case"list":return h(a,b,c);default:return i(a,b,c)}}function f(a,b,c){k.arrayEach(c.memberNames,function(d){var f=c.members[d];if("body"===f.location){var g=b[d],h=f.name;if(void 0!==g&&null!==g)if(f.isXmlAttribute)a.att(h,g);else if(f.flattened)e(a,g,f);else{var i=a.ele(h);j(i,f),e(i,g,f)}}})}function g(a,b,c){var d=c.key.name||"key",f=c.value.name||"value";k.each(b,function(b,g){var h=a.ele(c.flattened?c.name:"entry");e(h.ele(d),b,c.key),e(h.ele(f),g,c.value)})}function h(a,b,c){c.flattened?k.arrayEach(b,function(b){var d=c.member.name||c.name,f=a.ele(d);e(f,b,c.member)}):k.arrayEach(b,function(b){var d=c.member.name||"member",f=a.ele(d);e(f,b,c.member)})}function i(a,b,c){a.txt(c.toWireFormat(b))}function j(a,b){var c,d="xmlns";b.xmlNamespaceUri?(c=b.xmlNamespaceUri,b.xmlNamespacePrefix&&(d+=":"+b.xmlNamespacePrefix)):a.isRoot&&b.api.xmlNamespaceUri&&(c=b.api.xmlNamespaceUri),c&&a.att(d,c)}var k=a("../util"),l=a("xmlbuilder");d.prototype.toXML=function(a,b,c,d){var f=l.create(c);return j(f,b),e(f,a,b),f.children.length>0||d?f.root().toString():""},b.exports=d},{"../util":53,xmlbuilder:100}],56:[function(a,b,c){},{}],57:[function(a,b,c){function d(a,b,c){if(!(this instanceof d))return new d(a,b,c);var e=typeof a;if("base64"===b&&"string"===e)for(a=C(a);a.length%4!==0;)a+="=";var f;if("number"===e)f=E(a);else if("string"===e)f=d.byteLength(a,b);else{if("object"!==e)throw new Error("First argument needs to be a number, array or string.");f=E(a.length)}var g;d._useTypedArrays?g=d._augment(new Uint8Array(f)):(g=this,g.length=f,g._isBuffer=!0);var h;if(d._useTypedArrays&&"number"==typeof a.byteLength)g._set(a);else if(G(a))for(h=0;hf&&(e=f)):e=f;var g=b.length;R(g%2===0,"Invalid hex string"),e>g/2&&(e=g/2);for(var h=0;hd)&&(c=d);for(var e="",f=b;f=e)){var f;return c?(f=a[b], b+1=e)){var f;return c?(b+2>>0)):(b+1>>0),f}}function s(a,b,c,d){d||(R("boolean"==typeof c,"missing or invalid endian"),R(void 0!==b&&null!==b,"missing offset"),R(b+1=e)){var f=q(a,b,c,!0),g=32768&f;return g?(65535-f+1)*-1:f}}function t(a,b,c,d){d||(R("boolean"==typeof c,"missing or invalid endian"),R(void 0!==b&&null!==b,"missing offset"),R(b+3=e)){var f=r(a,b,c,!0),g=2147483648&f;return g?(4294967295-f+1)*-1:f}}function u(a,b,c,d){return d||(R("boolean"==typeof c,"missing or invalid endian"),R(b+3=f))for(var g=0,h=Math.min(f-c,2);g>>8*(d?g:1-g)}function x(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+3=f))for(var g=0,h=Math.min(f-c,4);g>>8*(d?g:3-g)&255}function y(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+1=f||(b>=0?w(a,b,c,d,e):w(a,65535+b+1,c,d,e))}function z(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+3=f||(b>=0?x(a,b,c,d,e):x(a,4294967295+b+1,c,d,e))}function A(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+3=f||T.write(a,b,c,d,23,4)}function B(a,b,c,d,e){e||(R(void 0!==b&&null!==b,"missing value"),R("boolean"==typeof d,"missing or invalid endian"),R(void 0!==c&&null!==c,"missing offset"),R(c+7=f||T.write(a,b,c,d,52,8)}function C(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function D(a,b,c){return"number"!=typeof a?c:(a=~~a,a>=b?b:a>=0?a:(a+=b,a>=0?a:0))}function E(a){return a=~~Math.ceil(+a),a<0?0:a}function F(a){return(Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)})(a)}function G(a){return F(a)||d.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length}function H(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a){for(var b=[],c=0;c=55296&&d<=57343&&c++;for(var f=encodeURIComponent(a.slice(e,c+1)).substr(1).split("%"),g=0;g>8,d=b%256,e.push(d),e.push(c);return e}function L(a){return S.toByteArray(a)}function M(a,b,c,d){for(var e=0;e=b.length||e>=a.length);e++)b[e+c]=a[e];return e}function N(a){try{return decodeURIComponent(a)}catch(a){return String.fromCharCode(65533)}}function O(a,b){R("number"==typeof a,"cannot write a non-number as a number"),R(a>=0,"specified a negative value for writing an unsigned value"),R(a<=b,"value is larger than maximum value for type"),R(Math.floor(a)===a,"value has a fractional component")}function P(a,b,c){R("number"==typeof a,"cannot write a non-number as a number"),R(a<=b,"value larger than maximum allowed value"),R(a>=c,"value smaller than minimum allowed value"),R(Math.floor(a)===a,"value has a fractional component")}function Q(a,b,c){R("number"==typeof a,"cannot write a non-number as a number"),R(a<=b,"value larger than maximum allowed value"),R(a>=c,"value smaller than minimum allowed value")}function R(a,b){if(!a)throw new Error(b||"Failed assertion")}var S=a("base64-js"),T=a("ieee754");c.Buffer=d,c.SlowBuffer=d,c.INSPECT_MAX_BYTES=50,d.poolSize=8192,d._useTypedArrays=function(){try{var a=new ArrayBuffer(0),b=new Uint8Array(a);return b.foo=function(){return 42},42===b.foo()&&"function"==typeof b.subarray}catch(a){return!1}}(),d.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.isBuffer=function(a){return!(null===a||void 0===a||!a._isBuffer)},d.byteLength=function(a,b){var c;switch(a+="",b||"utf8"){case"hex":c=a.length/2;break;case"utf8":case"utf-8":c=I(a).length;break;case"ascii":case"binary":case"raw":c=a.length;break;case"base64":c=L(a).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":c=2*a.length;break;default:throw new Error("Unknown encoding")}return c},d.concat=function(a,b){if(R(F(a),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===a.length)return new d(0);if(1===a.length)return a[0];var c;if("number"!=typeof b)for(b=0,c=0;cl&&(c=l)):c=l,d=String(d||"utf8").toLowerCase();var m;switch(d){case"hex":m=e(this,a,b,c);break;case"utf8":case"utf-8":m=f(this,a,b,c);break;case"ascii":m=g(this,a,b,c);break;case"binary":m=h(this,a,b,c);break;case"base64":m=i(this,a,b,c);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":m=j(this,a,b,c);break;default:throw new Error("Unknown encoding")}return m},d.prototype.toString=function(a,b,c){var d=this;if(a=String(a||"utf8").toLowerCase(),b=Number(b)||0,c=void 0!==c?Number(c):c=d.length,c===b)return"";var e;switch(a){case"hex":e=o(d,b,c);break;case"utf8":case"utf-8":e=l(d,b,c);break;case"ascii":e=m(d,b,c);break;case"binary":e=n(d,b,c);break;case"base64":e=k(d,b,c);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":e=p(d,b,c);break;default:throw new Error("Unknown encoding")}return e},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},d.prototype.copy=function(a,b,c,e){var f=this;if(c||(c=0),e||0===e||(e=this.length),b||(b=0),e!==c&&0!==a.length&&0!==f.length){R(e>=c,"sourceEnd < sourceStart"),R(b>=0&&b=0&&c=0&&e<=f.length,"sourceEnd out of bounds"),e>this.length&&(e=this.length),a.length-b=this.length))return this[a]},d.prototype.readUInt16LE=function(a,b){return q(this,a,!0,b)},d.prototype.readUInt16BE=function(a,b){return q(this,a,!1,b)},d.prototype.readUInt32LE=function(a,b){return r(this,a,!0,b)},d.prototype.readUInt32BE=function(a,b){return r(this,a,!1,b)},d.prototype.readInt8=function(a,b){if(b||(R(void 0!==a&&null!==a,"missing offset"),R(a=this.length)){var c=128&this[a];return c?(255-this[a]+1)*-1:this[a]}},d.prototype.readInt16LE=function(a,b){return s(this,a,!0,b)},d.prototype.readInt16BE=function(a,b){return s(this,a,!1,b)},d.prototype.readInt32LE=function(a,b){return t(this,a,!0,b)},d.prototype.readInt32BE=function(a,b){return t(this,a,!1,b)},d.prototype.readFloatLE=function(a,b){return u(this,a,!0,b)},d.prototype.readFloatBE=function(a,b){return u(this,a,!1,b)},d.prototype.readDoubleLE=function(a,b){return v(this,a,!0,b)},d.prototype.readDoubleBE=function(a,b){return v(this,a,!1,b)},d.prototype.writeUInt8=function(a,b,c){c||(R(void 0!==a&&null!==a,"missing value"),R(void 0!==b&&null!==b,"missing offset"),R(b=this.length||(this[b]=a)},d.prototype.writeUInt16LE=function(a,b,c){w(this,a,b,!0,c)},d.prototype.writeUInt16BE=function(a,b,c){w(this,a,b,!1,c)},d.prototype.writeUInt32LE=function(a,b,c){x(this,a,b,!0,c)},d.prototype.writeUInt32BE=function(a,b,c){x(this,a,b,!1,c)},d.prototype.writeInt8=function(a,b,c){c||(R(void 0!==a&&null!==a,"missing value"),R(void 0!==b&&null!==b,"missing offset"),R(b=this.length||(a>=0?this.writeUInt8(a,b,c):this.writeUInt8(255+a+1,b,c))},d.prototype.writeInt16LE=function(a,b,c){y(this,a,b,!0,c)},d.prototype.writeInt16BE=function(a,b,c){y(this,a,b,!1,c)},d.prototype.writeInt32LE=function(a,b,c){z(this,a,b,!0,c)},d.prototype.writeInt32BE=function(a,b,c){z(this,a,b,!1,c)},d.prototype.writeFloatLE=function(a,b,c){A(this,a,b,!0,c)},d.prototype.writeFloatBE=function(a,b,c){A(this,a,b,!1,c)},d.prototype.writeDoubleLE=function(a,b,c){B(this,a,b,!0,c)},d.prototype.writeDoubleBE=function(a,b,c){B(this,a,b,!1,c)},d.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),"string"==typeof a&&(a=a.charCodeAt(0)),R("number"==typeof a&&!isNaN(a),"value is not a number"),R(c>=b,"end < start"),c!==b&&0!==this.length){R(b>=0&&b=0&&c<=this.length,"end out of bounds");for(var d=b;d"},d.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(d._useTypedArrays)return new d(this).buffer;for(var a=new Uint8Array(this.length),b=0,c=a.length;b0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new f(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,e=0;d>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function e(a){function b(a){return d.charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var e,f,g,h=a.length%3,i="";for(e=0,g=a.length-h;e>2),i+=b(f<<4&63),i+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],i+=b(f>>10),i+=b(f>>4&63),i+=b(f<<2&63),i+="="}return i}var f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="+".charCodeAt(0),h="/".charCodeAt(0),i="0".charCodeAt(0),j="a".charCodeAt(0),k="A".charCodeAt(0),l="-".charCodeAt(0),m="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=e}("undefined"==typeof c?this.base64js={}:c)},{}],59:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=b<0||0===b&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],60:[function(a,b,c){function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function e(a){return"function"==typeof a}function f(a){return"number"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){return void 0===a}b.exports=d,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._maxListeners=void 0,d.defaultMaxListeners=10,d.prototype.setMaxListeners=function(a){if(!f(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},d.prototype.emit=function(a){var b,c,d,f,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],h(c))return!1;if(e(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(d=arguments.length,f=new Array(d-1),i=1;i0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace())}return this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function c(){this.removeListener(a,c),d||(d=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var d=!1;return c.listener=b,this.on(a,c),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-- >0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(d<0)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.listenerCount=function(a,b){var c;return c=a._events&&a._events[b]?e(a._events[b])?1:a._events[b].length:0}},{}],61:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],62:[function(a,b,c){function d(){}var e=b.exports={};e.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};if(b){var c=[];return window.addEventListener("message",function(a){var b=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){var d=c.shift();d()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}return function(a){setTimeout(a,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=d,e.addListener=d,e.once=d,e.off=d,e.removeListener=d,e.removeAllListeners=d,e.emit=d,e.binding=function(a){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(a){throw new Error("process.chdir is not supported")}},{}],63:[function(a,b,c){(function(a){!function(d){function e(a){throw RangeError(H[a])}function f(a,b){for(var c=a.length;c--;)a[c]=b(a[c]);return a}function g(a,b){return f(a.split(G),b).join(".")}function h(a){for(var b,c,d=[],e=0,f=a.length;e=55296&&b<=56319&&e65535&&(a-=65536,b+=K(a>>>10&1023|55296),a=56320|1023&a),b+=K(a)}).join("")}function j(a){return a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:w}function k(a,b){return a+22+75*(a<26)-((0!=b)<<5)}function l(a,b,c){var d=0;for(a=c?J(a/A):a>>1,a+=J(a/b);a>I*y>>1;d+=w)a=J(a/I);return J(d+(I+1)*a/(a+z))}function m(a){var b,c,d,f,g,h,k,m,n,o,p=[],q=a.length,r=0,s=C,t=B;for(c=a.lastIndexOf(D),c<0&&(c=0),d=0;d=128&&e("not-basic"),p.push(a.charCodeAt(d));for(f=c>0?c+1:0;f=q&&e("invalid-input"),m=j(a.charCodeAt(f++)),(m>=w||m>J((v-r)/h))&&e("overflow"),r+=m*h,n=k<=t?x:k>=t+y?y:k-t,!(mJ(v/o)&&e("overflow"),h*=o;b=p.length+1,t=l(r-g,b,0==g),J(r/b)>v-s&&e("overflow"),s+=J(r/b),r%=b,p.splice(r++,0,s)}return i(p)}function n(a){var b,c,d,f,g,i,j,m,n,o,p,q,r,s,t,u=[];for(a=h(a),q=a.length,b=C,c=0,g=B,i=0;i=b&&pJ((v-c)/r)&&e("overflow"),c+=(j-b)*r,b=j,i=0;iv&&e("overflow"),p==b){for(m=c,n=w;o=n<=g?x:n>=g+y?y:n-g,!(m= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=w-x,J=Math.floor,K=String.fromCharCode;if(t={version:"1.2.4",ucs2:{decode:h,encode:i},decode:m,encode:n,toASCII:p,toUnicode:o},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return t});else if(q&&!q.nodeType)if(r)r.exports=t;else for(u in t)t.hasOwnProperty(u)&&(q[u]=t[u]);else d.punycode=t}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],64:[function(a,b,c){"use strict";function d(a,b){return Object.prototype.hasOwnProperty.call(a,b)}b.exports=function(a,b,c,f){b=b||"&",c=c||"=";var g={};if("string"!=typeof a||0===a.length)return g;var h=/\+/g;a=a.split(b);var i=1e3;f&&"number"==typeof f.maxKeys&&(i=f.maxKeys);var j=a.length;i>0&&j>i&&(j=i);for(var k=0;k=0?(l=p.substr(0,q),m=p.substr(q+1)):(l=p,m=""),n=decodeURIComponent(l),o=decodeURIComponent(m),d(g,n)?e(g[n])?g[n].push(o):g[n]=[g[n],o]:g[n]=o}return g};var e=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}},{}],65:[function(a,b,c){"use strict";function d(a,b){if(a.map)return a.map(b);for(var c=[],d=0;d=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),p(b)?d.showHidden=b:b&&c._extend(d,b),v(d.showHidden)&&(d.showHidden=!1),v(d.depth)&&(d.depth=2),v(d.colors)&&(d.colors=!1),v(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=f),i(d,a,d.depth)}function f(a,b){var c=e.styles[b];return c?"["+e.colors[c][0]+"m"+a+"["+e.colors[c][1]+"m":a}function g(a,b){return a}function h(a){var b={};return a.forEach(function(a,c){b[a]=!0}),b}function i(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d,a);return t(e)||(e=i(a,e,d)),e}var f=j(a,b);if(f)return f;var g=Object.keys(b),p=h(g);if(a.showHidden&&(g=Object.getOwnPropertyNames(b)),z(b)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return k(b);if(0===g.length){if(A(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(w(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(z(b))return k(b)}var r="",s=!1,u=["{","}"];if(o(b)&&(s=!0,u=["[","]"]),A(b)){var v=b.name?": "+b.name:"";r=" [Function"+v+"]"}if(w(b)&&(r=" "+RegExp.prototype.toString.call(b)),y(b)&&(r=" "+Date.prototype.toUTCString.call(b)),z(b)&&(r=" "+k(b)),0===g.length&&(!s||0==b.length))return u[0]+r+u[1];if(d<0)return w(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var x;return x=s?l(a,b,d,p,g):g.map(function(c){return m(a,b,d,p,c,s)}),a.seen.pop(),n(x,r,u)}function j(a,b){if(v(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return s(b)?a.stylize(""+b,"number"):p(b)?a.stylize(""+b,"boolean"):q(b)?a.stylize("null","null"):void 0}function k(a){return"["+Error.prototype.toString.call(a)+"]"}function l(a,b,c,d,e){for(var f=[],g=0,h=b.length;g-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),v(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function n(a,b,c){var d=0,e=a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0);return e>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function o(a){return Array.isArray(a)}function p(a){return"boolean"==typeof a}function q(a){return null===a}function r(a){return null==a}function s(a){return"number"==typeof a}function t(a){return"string"==typeof a}function u(a){return"symbol"==typeof a}function v(a){return void 0===a}function w(a){return x(a)&&"[object RegExp]"===C(a)}function x(a){return"object"==typeof a&&null!==a}function y(a){return x(a)&&"[object Date]"===C(a)}function z(a){return x(a)&&("[object Error]"===C(a)||a instanceof Error)}function A(a){return"function"==typeof a}function B(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function C(a){return Object.prototype.toString.call(a)}function D(a){return a<10?"0"+a.toString(10):a.toString(10)}function E(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),J[a.getMonth()],b].join(" ")}function F(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var G=/%[sdj%]/g;c.format=function(a){if(!t(a)){for(var b=[],c=0;c=f)return a;switch(a){case"%s":return String(d[c++]);case"%d":return Number(d[c++]);case"%j":try{return JSON.stringify(d[c++])}catch(a){return"[Circular]"}default:return a}}),h=d[c];c=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|a}function q(a){return+a!=a&&(a=0),g.alloc(+a)}function r(a,b){if(g.isBuffer(a))return a.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(a)||a instanceof ArrayBuffer))return a.byteLength;"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":case void 0:return T(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return W(a).length;default:if(d)return T(a).length;b=(""+b).toLowerCase(),d=!0}}function s(a,b,c){var d=!1;if((void 0===b||b<0)&&(b=0),b>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if(c>>>=0,b>>>=0,c<=b)return"";for(a||(a="utf8");;)switch(a){case"hex":return H(this,b,c);case"utf8":case"utf-8":return D(this,b,c);case"ascii":return F(this,b,c);case"latin1":case"binary":return G(this,b,c);case"base64":return C(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function t(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}function u(a,b,c,d,e){if(0===a.length)return-1;if("string"==typeof c?(d=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,isNaN(c)&&(c=e?0:a.length-1),c<0&&(c=a.length+c),c>=a.length){if(e)return-1;c=a.length-1}else if(c<0){if(!e)return-1;c=0}if("string"==typeof b&&(b=g.from(b,d)),g.isBuffer(b))return 0===b.length?-1:v(a,b,c,d,e);if("number"==typeof b)return b=255&b,g.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):v(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer")}function v(a,b,c,d,e){function f(a,b){return 1===g?a[b]:a.readUInt16BE(b*g)}var g=1,h=a.length,i=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(a.length<2||b.length<2)return-1;g=2,h/=2,i/=2,c/=2}var j;if(e){var k=-1;for(j=c;jh&&(c=h-i),j=c;j>=0;j--){for(var l=!0,m=0;me&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new TypeError("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(l<55296||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&l<1114112&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return E(d)}function E(a){var b=a.length;if(b<=aa)return String.fromCharCode.apply(String,a);for(var c="",d=0;dd)&&(c=d);for(var e="",f=b;fc)throw new RangeError("Trying to access beyond buffer length")}function K(a,b,c,d,e,f){if(!g.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||ba.length)throw new RangeError("Index out of range")}function L(a,b,c,d){b<0&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);e>>8*(d?e:1-e)}function M(a,b,c,d){b<0&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);e>>8*(d?e:3-e)&255}function N(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function O(a,b,c,d,e){return e||N(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(a,b,c,d,23,4),c+4}function P(a,b,c,d,e){return e||N(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(a,b,c,d,52,8),c+8}function Q(a){if(a=R(a).replace(ba,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function R(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function S(a){return a<16?"0"+a.toString(16):a.toString(16)}function T(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(c<56320){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}else if(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function U(a){for(var b=[],c=0;c>8,e=c%256,f.push(e),f.push(d);return f}function W(a){return Z.toByteArray(Q(a))}function X(a,b,c,d){for(var e=0;e=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function Y(a){return a!==a}var Z=a("base64-js"),$=a("ieee754"),_=a("isarray");c.Buffer=g,c.SlowBuffer=q,c.INSPECT_MAX_BYTES=50,g.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d(),c.kMaxLength=e(),g.poolSize=8192,g._augment=function(a){return a.__proto__=g.prototype,a},g.from=function(a,b,c){return h(null,a,b,c)},g.TYPED_ARRAY_SUPPORT&&(g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0})),g.alloc=function(a,b,c){return j(null,a,b,c)},g.allocUnsafe=function(a){return k(null,a)},g.allocUnsafeSlow=function(a){return k(null,a)},g.isBuffer=function(a){return!(null==a||!a._isBuffer)},g.compare=function(a,b){if(!g.isBuffer(a)||!g.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),""},g.prototype.compare=function(a,b,c,d,e){if(!g.isBuffer(a))throw new TypeError("Argument must be a Buffer");if(void 0===b&&(b=0),void 0===c&&(c=a?a.length:0),void 0===d&&(d=0),void 0===e&&(e=this.length),b<0||c>a.length||d<0||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;if(b>>>=0,c>>>=0,d>>>=0,e>>>=0,this===a)return 0;for(var f=e-d,h=c-b,i=Math.min(f,h),j=this.slice(d,e),k=a.slice(b,c),l=0;le)&&(c=e),a.length>0&&(c<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(var f=!1;;)switch(d){case"hex":return w(this,a,b,c);case"utf8":case"utf-8":return x(this,a,b,c);case"ascii":return y(this,a,b,c);case"latin1":case"binary":return z(this,a,b,c);case"base64":return A(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,a,b,c);default:if(f)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),f=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var aa=4096;g.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,a<0?(a+=c,a<0&&(a=0)):a>c&&(a=c),b<0?(b+=c,b<0&&(b=0)):b>c&&(b=c),b0&&(e*=256);)d+=this[a+--b]*e;return d},g.prototype.readUInt8=function(a,b){return b||J(a,1,this.length),this[a]},g.prototype.readUInt16LE=function(a,b){return b||J(a,2,this.length),this[a]|this[a+1]<<8},g.prototype.readUInt16BE=function(a,b){return b||J(a,2,this.length),this[a]<<8|this[a+1]},g.prototype.readUInt32LE=function(a,b){return b||J(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},g.prototype.readUInt32BE=function(a,b){return b||J(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},g.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||J(a,b,this.length);for(var d=this[a],e=1,f=0;++f=e&&(d-=Math.pow(2,8*b)),d},g.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||J(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},g.prototype.readInt8=function(a,b){return b||J(a,1,this.length),128&this[a]?(255-this[a]+1)*-1:this[a]},g.prototype.readInt16LE=function(a,b){b||J(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt16BE=function(a,b){b||J(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt32LE=function(a,b){return b||J(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},g.prototype.readInt32BE=function(a,b){return b||J(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},g.prototype.readFloatLE=function(a,b){return b||J(a,4,this.length),$.read(this,a,!0,23,4)},g.prototype.readFloatBE=function(a,b){return b||J(a,4,this.length),$.read(this,a,!1,23,4)},g.prototype.readDoubleLE=function(a,b){return b||J(a,8,this.length),$.read(this,a,!0,52,8)},g.prototype.readDoubleBE=function(a,b){return b||J(a,8,this.length),$.read(this,a,!1,52,8)},g.prototype.writeUIntLE=function(a,b,c,d){if(a=+a,b=0|b,c=0|c,!d){var e=Math.pow(2,8*c)-1;K(this,a,b,c,e,0)}var f=1,g=0;for(this[b]=255&a;++g=0&&(g*=256);)this[b+f]=a/g&255;return b+c},g.prototype.writeUInt8=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,1,255,0),g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=255&a,b+1},g.prototype.writeUInt16LE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):L(this,a,b,!0),b+2},g.prototype.writeUInt16BE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):L(this,a,b,!1),b+2},g.prototype.writeUInt32LE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a):M(this,a,b,!0),b+4},g.prototype.writeUInt32BE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):M(this,a,b,!1),b+4},g.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);K(this,a,b,c,e-1,-e)}var f=0,g=1,h=0;for(this[b]=255&a;++f>0)-h&255;return b+c},g.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);K(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0;for(this[b+f]=255&a;--f>=0&&(g*=256);)a<0&&0===h&&0!==this[b+f+1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},g.prototype.writeInt8=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,1,127,-128),g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),a<0&&(a=255+a+1),this[b]=255&a,b+1},g.prototype.writeInt16LE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):L(this,a,b,!0),b+2},g.prototype.writeInt16BE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):L(this,a,b,!1),b+2},g.prototype.writeInt32LE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,4,2147483647,-2147483648),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):M(this,a,b,!0),b+4},g.prototype.writeInt32BE=function(a,b,c){return a=+a,b=0|b,c||K(this,a,b,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):M(this,a,b,!1),b+4},g.prototype.writeFloatLE=function(a,b,c){return O(this,a,b,!0,c)},g.prototype.writeFloatBE=function(a,b,c){return O(this,a,b,!1,c)},g.prototype.writeDoubleLE=function(a,b,c){return P(this,a,b,!0,c)},g.prototype.writeDoubleBE=function(a,b,c){return P(this,a,b,!1,c)},g.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&d=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b=0;--e)a[e+b]=this[e+c];else if(f<1e3||!g.TYPED_ARRAY_SUPPORT)for(e=0;e>>=0,c=void 0===c?this.length:c>>>0,a||(a=0);var f;if("number"==typeof a)for(f=b;f0)throw new Error("Invalid string. Length must be a multiple of 4");f="="===a[h-2]?2:"="===a[h-1]?1:0,g=new k(3*h/4-f),d=f>0?h-4:h;var i=0;for(b=0,c=0;b>16&255,g[i++]=e>>8&255,g[i++]=255&e;return 2===f?(e=j[a.charCodeAt(b)]<<2|j[a.charCodeAt(b+1)]>>4,g[i++]=255&e):1===f&&(e=j[a.charCodeAt(b)]<<10|j[a.charCodeAt(b+1)]<<4|j[a.charCodeAt(b+2)]>>2,g[i++]=e>>8&255,g[i++]=255&e),g}function f(a){return i[a>>18&63]+i[a>>12&63]+i[a>>6&63]+i[63&a]}function g(a,b,c){for(var d,e=[],g=b;gk?k:j+h));return 1===d?(b=a[c-1],e+=i[b>>2],e+=i[b<<4&63],e+="=="):2===d&&(b=(a[c-2]<<8)+a[c-1],e+=i[b>>10],e+=i[b>>4&63],e+=i[b<<2&63],e+="="),f.push(e),f.join("")}c.toByteArray=e,c.fromByteArray=h;var i=[],j=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array;d()},{}],71:[function(a,b,c){b.exports=a(59)},{}],72:[function(a,b,c){var d={}.toString;b.exports=Array.isArray||function(a){return"[object Array]"==d.call(a)}},{}],73:[function(a,b,c){function d(a,b){if(a.length%h!==0){var c=a.length+(h-a.length%h);a=g.concat([a,i],c)}for(var d=[],e=b?a.readInt32BE:a.readInt32LE,f=0;fn?b=a(b):b.length>5]|=128<>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,k=271733878,l=0;l>16)+(b>>16)+(c>>16);return d<<16|65535&c}function k(a,b){return a<>>32-b}var l=a("./helpers");b.exports=function(a){return l.hash(a,d,16)}},{"./helpers":73}],76:[function(a,b,c){!function(){var a,c,d=this;a=function(a){for(var b,b,c=new Array(a),d=0;d>>((3&d)<<3)&255;return c},d.crypto&&crypto.getRandomValues&&(c=function(a){var b=new Uint8Array(a);return crypto.getRandomValues(b),b}),b.exports=c||a}()},{}],77:[function(a,b,c){function d(a,b){a[b>>5]|=128<<24-b%32,a[(b+64>>9<<4)+15]=b;for(var c=Array(80),d=1732584193,i=-271733879,j=-1732584194,k=271733878,l=-1009589776,m=0;m>16)+(b>>16)+(c>>16);return d<<16|65535&c}function h(a,b){return a<>>32-b}var i=a("./helpers");b.exports=function(a){return i.hash(a,d,20,!0)}},{"./helpers":73}],78:[function(a,b,c){var d=a("./helpers"),e=function(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c},f=function(a,b){return a>>>b|a<<32-b},g=function(a,b){return a>>>b},h=function(a,b,c){return a&b^~a&c},i=function(a,b,c){return a&b^a&c^b&c},j=function(a){return f(a,2)^f(a,13)^f(a,22)},k=function(a){return f(a,6)^f(a,11)^f(a,25)},l=function(a){return f(a,7)^f(a,18)^g(a,3)},m=function(a){return f(a,17)^f(a,19)^g(a,10)},n=function(a,b){var c,d,f,g,n,o,p,q,r,s,t,u,v=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),w=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),x=new Array(64);a[b>>5]|=128<<24-b%32,a[(b+64>>9<<4)+15]=b;for(var r=0;r="a"&&a<="z"||a>="A"&&a<="Z"||"_"===a}function h(a){return a>="0"&&a<="9"||"-"===a}function i(a){return a>="a"&&a<="z"||a>="A"&&a<="Z"||a>="0"&&a<="9"||"_"===a}function j(){}function k(){}function l(a){this.runtime=a}function m(a){this._interpreter=a,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[r]}]},avg:{_func:this._functionAvg,_signature:[{types:[z]}]},ceil:{_func:this._functionCeil,_signature:[{types:[r]}]},contains:{_func:this._functionContains,_signature:[{types:[t,u]},{types:[s]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[t]},{types:[t]}]},floor:{_func:this._functionFloor,_signature:[{types:[r]}]},length:{_func:this._functionLength,_signature:[{types:[t,u,v]}]},map:{_func:this._functionMap,_signature:[{types:[x]},{types:[u]}]},max:{_func:this._functionMax,_signature:[{types:[z,A]}]},merge:{_func:this._functionMerge,_signature:[{types:[v],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[u]},{types:[x]}]},sum:{_func:this._functionSum,_signature:[{types:[z]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[t]},{types:[t]}]},min:{_func:this._functionMin,_signature:[{types:[z,A]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[u]},{types:[x]}]},type:{_func:this._functionType,_signature:[{types:[s]}]},keys:{_func:this._functionKeys,_signature:[{types:[v]}]},values:{_func:this._functionValues,_signature:[{types:[v]}]},sort:{_func:this._functionSort,_signature:[{types:[A,z]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[u]},{types:[x]}]},join:{_func:this._functionJoin,_signature:[{types:[t]},{types:[A]}]},reverse:{_func:this._functionReverse,_signature:[{types:[t,u]}]},to_array:{_func:this._functionToArray,_signature:[{types:[s]}]},to_string:{_func:this._functionToString,_signature:[{types:[s]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[s]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[s],variadic:!0}]}}}function n(a){var b=new k,c=b.parse(a);return c}function o(a){var b=new j;return b.tokenize(a)}function p(a,b){var c=new k,d=new m,e=new l(d);d._interpreter=e;var f=c.parse(b);return e.search(f,a)}var q;q="function"==typeof String.prototype.trimLeft?function(a){return a.trimLeft()}:function(a){return a.match(/^\s*(.*)/)[1]};var r=0,s=1,t=2,u=3,v=4,w=5,x=6,y=7,z=8,A=9,B="EOF",C="UnquotedIdentifier",D="QuotedIdentifier",E="Rbracket",F="Rparen",G="Comma",H="Colon",I="Rbrace",J="Number",K="Current",L="Expref",M="Pipe",N="Or",O="And",P="EQ",Q="GT",R="LT",S="GTE",T="LTE",U="NE",V="Flatten",W="Star",X="Filter",Y="Dot",Z="Not",$="Lbrace",_="Lbracket",aa="Lparen",ba="Literal",ca={".":Y,"*":W,",":G,":":H,"{":$,"}":I,"]":E,"(":aa,")":F,"@":K},da={"<":!0,">":!0,"=":!0,"!":!0},ea={" ":!0,"\t":!0,"\n":!0};j.prototype={tokenize:function(a){var b=[];this._current=0;for(var c,d,e;this._current"===c?"="===a[this._current]?(this._current++,{type:S,value:">=",start:b}):{type:Q,value:">",start:b}:"="===c&&"="===a[this._current]?(this._current++,{type:P,value:"==",start:b}):void 0},_consumeLiteral:function(a){this._current++;for(var b,c=this._current,d=a.length;"`"!==a[this._current]&&this._current=0)return!0;if(c.indexOf(a)>=0)return!0;if(!(d.indexOf(a[0])>=0))return!1;try{return JSON.parse(a),!0}catch(a){return!1}}};var fa={};fa[B]=0,fa[C]=0,fa[D]=0,fa[E]=0,fa[F]=0,fa[G]=0,fa[I]=0,fa[J]=0,fa[K]=0,fa[L]=0,fa[M]=1,fa[N]=2,fa[O]=3,fa[P]=5,fa[Q]=5,fa[R]=5,fa[S]=5,fa[T]=5,fa[U]=5,fa[V]=9,fa[W]=20,fa[X]=21,fa[Y]=40,fa[Z]=45,fa[$]=50,fa[_]=55,fa[aa]=60,k.prototype={parse:function(a){this._loadTokens(a),this.index=0;var b=this.expression(0);if(this._lookahead(0)!==B){var c=this._lookaheadToken(0),d=new Error("Unexpected token type: "+c.type+", value: "+c.value);throw d.name="ParserError",d}return b},_loadTokens:function(a){var b=new j,c=b.tokenize(a);c.push({type:B,value:"",start:a.length}),this.tokens=c},expression:function(a){var b=this._lookaheadToken(0);this._advance();for(var c=this.nud(b),d=this._lookahead(0);a=0?this.expression(a):b===_?(this._match(_),this._parseMultiselectList()):b===$?(this._match($),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(a){var b;if(fa[this._lookahead(0)]<10)b={type:"Identity"};else if(this._lookahead(0)===_)b=this.expression(a);else if(this._lookahead(0)===X)b=this.expression(a);else{if(this._lookahead(0)!==Y){var c=this._lookaheadToken(0),d=new Error("Sytanx error, unexpected token: "+c.value+"("+c.type+")");throw d.name="ParserError",d}this._match(Y),b=this._parseDotRHS(a)}return b},_parseMultiselectList:function(){for(var a=[];this._lookahead(0)!==E;){var b=this.expression(0);if(a.push(b),this._lookahead(0)===G&&(this._match(G),this._lookahead(0)===E))throw new Error("Unexpected token Rbracket")}return this._match(E),{type:"MultiSelectList",children:a}},_parseMultiselectHash:function(){for(var a,b,c,d,e=[],f=[C,D];;){if(a=this._lookaheadToken(0),f.indexOf(a.type)<0)throw new Error("Expecting an identifier token, got: "+a.type);if(b=a.value,this._advance(),this._match(H),c=this.expression(0),d={type:"KeyValuePair",name:b,value:c},e.push(d),this._lookahead(0)===G)this._match(G);else if(this._lookahead(0)===I){this._match(I);break}}return{type:"MultiSelectHash",children:e}}},l.prototype={search:function(a,b){return this.visit(a,b)},visit:function(a,g){var h,i,j,k,l,m,n,o,p,q;switch(a.type){case"Field":return null===g?null:c(g)?(m=g[a.name],void 0===m?null:m):null;case"Subexpression":for(j=this.visit(a.children[0],g),q=1;q0)for(q=u;qv;q+=w)j.push(g[q]);return j;case"Projection":var x=this.visit(a.children[0],g);if(!b(x))return null;for(p=[],q=0;ql;break;case S:j=k>=l;break;case R:j=k=a&&(b=c<0?a-1:a),b}},m.prototype={callFunction:function(a,b){var c=this.functionTable[a];if(void 0===c)throw new Error("Unknown function: "+a+"()");return this._validateArgs(a,b,c._signature),c._func.call(this,b)},_validateArgs:function(a,b,c){var d;if(c[c.length-1].variadic){if(b.length=0;e--)d+=c[e];return d}var f=a[0].slice(0);return f.reverse(),f},_functionAbs:function(a){return Math.abs(a[0])},_functionCeil:function(a){return Math.ceil(a[0])},_functionAvg:function(a){for(var b=0,c=a[0],d=0;d=0},_functionFloor:function(a){return Math.floor(a[0])},_functionLength:function(a){return c(a[0])?Object.keys(a[0]).length:a[0].length},_functionMap:function(a){for(var b=[],c=this._interpreter,d=a[0],e=a[1],f=0;f0){var b=this._getTypeName(a[0][0]);if(b===r)return Math.max.apply(Math,a[0]);for(var c=a[0],d=c[0],e=1;e0){var b=this._getTypeName(a[0][0]);if(b===r)return Math.min.apply(Math,a[0]);for(var c=a[0],d=c[0],e=1;eh?1:gg&&(g=c,b=e[h]);return b},_functionMinBy:function(a){for(var b,c,d=a[1],e=a[0],f=this.createKeyFunction(d,[r,t]),g=1/0,h=0;h0&&i>h&&(i=h);for(var j=0;j=0?(k=o.substr(0,p),l=o.substr(p+1)):(k=o,l=""),m=decodeURIComponent(k),n=decodeURIComponent(l),d(f,m)?Array.isArray(f[m])?f[m].push(n):f[m]=[f[m],n]:f[m]=n}return f}},{}],81:[function(a,b,c){"use strict";var d=function(a){switch(typeof a){case"string":return a;case"boolean":return a?"true":"false";case"number":return isFinite(a)?a:"";default:return""}};b.exports=function(a,b,c,e){return b=b||"&",c=c||"=",null===a&&(a=void 0),"object"==typeof a?Object.keys(a).map(function(e){var f=encodeURIComponent(d(e))+c;return Array.isArray(a[e])?a[e].map(function(a){return f+encodeURIComponent(d(a))}).join(b):f+encodeURIComponent(d(a[e]))}).join(b):e?encodeURIComponent(d(e))+c+encodeURIComponent(d(a)):""}},{}],82:[function(a,b,c){arguments[4][66][0].apply(c,arguments)},{"./decode":80,"./encode":81}],83:[function(a,b,c){function d(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function e(a,b,c){if(a&&j(a)&&a instanceof d)return a;var e=new d;return e.parse(a,b,c),e}function f(a){return i(a)&&(a=e(a)),a instanceof d?a.format():d.prototype.format.call(a)}function g(a,b){return e(a,!1,!0).resolve(b)}function h(a,b){return a?e(a,!1,!0).resolveObject(b):b}function i(a){return"string"==typeof a}function j(a){return"object"==typeof a&&null!==a}function k(a){return null===a}function l(a){return null==a}var m=a("punycode");c.parse=e,c.resolve=g,c.resolveObject=h,c.format=f,c.Url=d;var n=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,p=["<",">",'"',"`"," ","\r","\n","\t"],q=["{","}","|","\\","^","`"].concat(p),r=["'"].concat(q),s=["%","/","?",";","#"].concat(r),t=["/","?","#"],u=255,v=/^[a-z0-9A-Z_-]{0,63}$/,w=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},z={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=a("querystring");d.prototype.parse=function(a,b,c){if(!i(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var d=a;d=d.trim();var e=n.exec(d);if(e){e=e[0];var f=e.toLowerCase();this.protocol=f,d=d.substr(e.length)}if(c||e||d.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===d.substr(0,2);!g||e&&y[e]||(d=d.substr(2),this.slashes=!0)}if(!y[e]&&(g||e&&!z[e])){for(var h=-1,j=0;j127?"x":C[E];if(!D.match(v)){var G=q.slice(0,j),H=q.slice(j+1),I=C.match(w);I&&(G.push(I[1]),H.unshift(I[2])),H.length&&(d="/"+H.join(".")+d),this.hostname=G.join(".");break}}}if(this.hostname.length>u?this.hostname="":this.hostname=this.hostname.toLowerCase(),!p){for(var J=this.hostname.split("."),K=[],j=0;j0)&&c.host.split("@");q&&(c.auth=q.shift(),c.host=c.hostname=q.shift())}return c.search=a.search,c.query=a.query,k(c.pathname)&&k(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.href=c.format(),c}if(!o.length)return c.pathname=null,c.search?c.path="/"+c.search:c.path=null,c.href=c.format(),c;for(var r=o.slice(-1)[0],s=(c.host||a.host)&&("."===r||".."===r)||""===r,t=0,u=o.length;u>=0;u--)r=o[u],"."==r?o.splice(u,1):".."===r?(o.splice(u,1),t++):t&&(o.splice(u,1),t--);if(!m&&!n)for(;t--;t)o.unshift("..");!m||""===o[0]||o[0]&&"/"===o[0].charAt(0)||o.unshift(""),s&&"/"!==o.join("/").substr(-1)&&o.push("");var v=""===o[0]||o[0]&&"/"===o[0].charAt(0);if(p){c.hostname=c.host=v?"":o.length?o.shift():"";var q=!!(c.host&&c.host.indexOf("@")>0)&&c.host.split("@");q&&(c.auth=q.shift(),c.host=c.hostname=q.shift())}return m=m||c.host&&o.length,m&&!v&&o.unshift(""),o.length?c.pathname=o.join("/"):(c.pathname=null,c.path=null),k(c.pathname)&&k(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.auth=a.auth||c.auth,c.slashes=c.slashes||a.slashes,c.href=c.format(),c},d.prototype.parseHost=function(){var a=this.host,b=o.exec(a);b&&(b=b[0],":"!==b&&(this.port=b.substr(1)),a=a.substr(0,a.length-b.length)),a&&(this.hostname=a)}},{punycode:63,querystring:66}],84:[function(a,b,c){(function(){var c,d;d=a("lodash/object/create"),b.exports=c=function(){function a(a,b,c){if(this.stringify=a.stringify,null==b)throw new Error("Missing attribute name of element "+a.name);if(null==c)throw new Error("Missing attribute value for attribute "+b+" of element "+a.name);this.name=this.stringify.attName(b),this.value=this.stringify.attValue(c)}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){return" "+this.name+'="'+this.value+'"'},a}()}).call(this)},{"lodash/object/create":143}],85:[function(a,b,c){(function(){var c,d,e,f,g;g=a("./XMLStringifier"),d=a("./XMLDeclaration"),e=a("./XMLDocType"),f=a("./XMLElement"),b.exports=c=function(){function a(a,b){var c,d;if(null==a)throw new Error("Root element needs a name");null==b&&(b={}),this.options=b,this.stringify=new g(b),d=new f(this,"doc"),c=d.element(a),c.isRoot=!0,c.documentObject=this,this.rootObject=c,b.headless||(c.declaration(b),null==b.pubID&&null==b.sysID||c.doctype(b))}return a.prototype.root=function(){return this.rootObject},a.prototype.end=function(a){return this.toString(a)},a.prototype.toString=function(a){var b,c,d,e,f,g,h,i;return e=(null!=a?a.pretty:void 0)||!1,b=null!=(g=null!=a?a.indent:void 0)?g:" ",d=null!=(h=null!=a?a.offset:void 0)?h:0,c=null!=(i=null!=a?a.newline:void 0)?i:"\n",f="",null!=this.xmldec&&(f+=this.xmldec.toString(a)),null!=this.doctype&&(f+=this.doctype.toString(a)),f+=this.rootObject.toString(a),e&&f.slice(-c.length)===c&&(f=f.slice(0,-c.length)),f},a}()}).call(this)},{"./XMLDeclaration":92,"./XMLDocType":93,"./XMLElement":94,"./XMLStringifier":98}],86:[function(a,b,c){(function(){var c,d,e,f=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},g={}.hasOwnProperty;e=a("lodash/object/create"),d=a("./XMLNode"),b.exports=c=function(a){function b(a,c){if(b.__super__.constructor.call(this,a),null==c)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(c)}return f(b,a),b.prototype.clone=function(){return e(b.prototype,this)},b.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},b}(d)}).call(this)},{"./XMLNode":95,"lodash/object/create":143}],87:[function(a,b,c){(function(){var c,d,e,f=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},g={}.hasOwnProperty;e=a("lodash/object/create"),d=a("./XMLNode"),b.exports=c=function(a){function b(a,c){if(b.__super__.constructor.call(this,a),null==c)throw new Error("Missing comment text");this.text=this.stringify.comment(c)}return f(b,a),b.prototype.clone=function(){return e(b.prototype,this)},b.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},b}(d)}).call(this)},{"./XMLNode":95,"lodash/object/create":143}],88:[function(a,b,c){(function(){var c,d;d=a("lodash/object/create"),b.exports=c=function(){function a(a,b,c,d,e,f){if(this.stringify=a.stringify,null==b)throw new Error("Missing DTD element name");if(null==c)throw new Error("Missing DTD attribute name");if(!d)throw new Error("Missing DTD attribute type");if(!e)throw new Error("Missing DTD attribute default");if(0!==e.indexOf("#")&&(e="#"+e),!e.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(f&&!e.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(b),this.attributeName=this.stringify.attName(c),this.attributeType=this.stringify.dtdAttType(d),this.defaultValue=this.stringify.dtdAttDefault(f),this.defaultValueType=e}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},a}()}).call(this)},{"lodash/object/create":143}],89:[function(a,b,c){(function(){var c,d,e;d=a("lodash/object/create"),e=a("lodash/lang/isArray"),b.exports=c=function(){function a(a,b,c){if(this.stringify=a.stringify,null==b)throw new Error("Missing DTD element name");c||(c="(#PCDATA)"),e(c)&&(c="("+c.join(",")+")"),this.name=this.stringify.eleName(b),this.value=this.stringify.dtdElementValue(c)}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},a}()}).call(this)},{"lodash/lang/isArray":135,"lodash/object/create":143}],90:[function(a,b,c){(function(){var c,d,e;d=a("lodash/object/create"),e=a("lodash/lang/isObject"),b.exports=c=function(){function a(a,b,c,d){if(this.stringify=a.stringify,null==c)throw new Error("Missing entity name");if(null==d)throw new Error("Missing entity value");if(this.pe=!!b,this.name=this.stringify.eleName(c),e(d)){if(!d.pubID&&!d.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(d.pubID&&!d.sysID)throw new Error("System identifier is required for a public external entity");if(null!=d.pubID&&(this.pubID=this.stringify.dtdPubID(d.pubID)),null!=d.sysID&&(this.sysID=this.stringify.dtdSysID(d.sysID)),null!=d.nData&&(this.nData=this.stringify.dtdNData(d.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(d)}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0, d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},a}()}).call(this)},{"lodash/lang/isObject":139,"lodash/object/create":143}],91:[function(a,b,c){(function(){var c,d;d=a("lodash/object/create"),b.exports=c=function(){function a(a,b,c){if(this.stringify=a.stringify,null==b)throw new Error("Missing notation name");if(!c.pubID&&!c.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(b),null!=c.pubID&&(this.pubID=this.stringify.dtdPubID(c.pubID)),null!=c.sysID&&(this.sysID=this.stringify.dtdSysID(c.sysID))}return a.prototype.clone=function(){return d(a.prototype,this)},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},a}()}).call(this)},{"lodash/object/create":143}],92:[function(a,b,c){(function(){var c,d,e,f,g=function(a,b){function c(){this.constructor=a}for(var d in b)h.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},h={}.hasOwnProperty;e=a("lodash/object/create"),f=a("lodash/lang/isObject"),d=a("./XMLNode"),b.exports=c=function(a){function b(a,c,d,e){var g;b.__super__.constructor.call(this,a),f(c)&&(g=c,c=g.version,d=g.encoding,e=g.standalone),c||(c="1.0"),null!=c&&(this.version=this.stringify.xmlVersion(c)),null!=d&&(this.encoding=this.stringify.xmlEncoding(d)),null!=e&&(this.standalone=this.stringify.xmlStandalone(e))}return g(b,a),b.prototype.clone=function(){return e(b.prototype,this)},b.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k;return f=(null!=a?a.pretty:void 0)||!1,c=null!=(h=null!=a?a.indent:void 0)?h:" ",e=null!=(i=null!=a?a.offset:void 0)?i:0,d=null!=(j=null!=a?a.newline:void 0)?j:"\n",b||(b=0),k=new Array(b+e+1).join(c),g="",f&&(g+=k),g+="",f&&(g+=d),g},b}(d)}).call(this)},{"./XMLNode":95,"lodash/lang/isObject":139,"lodash/object/create":143}],93:[function(a,b,c){(function(){var c,d,e,f,g,h,i,j,k,l;k=a("lodash/object/create"),l=a("lodash/lang/isObject"),c=a("./XMLCData"),d=a("./XMLComment"),e=a("./XMLDTDAttList"),g=a("./XMLDTDEntity"),f=a("./XMLDTDElement"),h=a("./XMLDTDNotation"),j=a("./XMLProcessingInstruction"),b.exports=i=function(){function a(a,b,c){var d,e;this.documentObject=a,this.stringify=this.documentObject.stringify,this.children=[],l(b)&&(d=b,b=d.pubID,c=d.sysID),null==c&&(e=[b,c],c=e[0],b=e[1]),null!=b&&(this.pubID=this.stringify.dtdPubID(b)),null!=c&&(this.sysID=this.stringify.dtdSysID(c))}return a.prototype.clone=function(){return k(a.prototype,this)},a.prototype.element=function(a,b){var c;return c=new f(this,a,b),this.children.push(c),this},a.prototype.attList=function(a,b,c,d,f){var g;return g=new e(this,a,b,c,d,f),this.children.push(g),this},a.prototype.entity=function(a,b){var c;return c=new g(this,!1,a,b),this.children.push(c),this},a.prototype.pEntity=function(a,b){var c;return c=new g(this,!0,a,b),this.children.push(c),this},a.prototype.notation=function(a,b){var c;return c=new h(this,a,b),this.children.push(c),this},a.prototype.cdata=function(a){var b;return b=new c(this,a),this.children.push(b),this},a.prototype.comment=function(a){var b;return b=new d(this,a),this.children.push(b),this},a.prototype.instruction=function(a,b){var c;return c=new j(this,a,b),this.children.push(c),this},a.prototype.root=function(){return this.documentObject.root()},a.prototype.document=function(){return this.documentObject},a.prototype.toString=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;if(i=(null!=a?a.pretty:void 0)||!1,e=null!=(k=null!=a?a.indent:void 0)?k:" ",h=null!=(l=null!=a?a.offset:void 0)?l:0,g=null!=(m=null!=a?a.newline:void 0)?m:"\n",b||(b=0),o=new Array(b+h+1).join(e),j="",i&&(j+=o),j+="0){for(j+=" [",i&&(j+=g),n=this.children,d=0,f=n.length;d",p&&(q+=n);else if(p&&1===this.children.length&&null!=this.children[0].value)q+=">",q+=this.children[0].value,q+="",q+=n;else{for(q+=">",p&&(q+=n),w=this.children,i=0,k=w.length;i",p&&(q+=n)}return q},b.prototype.att=function(a,b){return this.attribute(a,b)},b.prototype.ins=function(a,b){return this.instruction(a,b)},b.prototype.a=function(a,b){return this.attribute(a,b)},b.prototype.i=function(a,b){return this.instruction(a,b)},b}(e)}).call(this)},{"./XMLAttribute":84,"./XMLNode":95,"./XMLProcessingInstruction":96,"lodash/collection/every":101,"lodash/lang/isArray":135,"lodash/lang/isFunction":137,"lodash/lang/isObject":139,"lodash/object/create":143}],95:[function(a,b,c){(function(){var c,d,e,f,g,h,i,j,k,l,m,n,o={}.hasOwnProperty;n=a("lodash/lang/isObject"),k=a("lodash/lang/isArray"),m=a("lodash/lang/isFunction"),l=a("lodash/lang/isEmpty"),g=null,c=null,d=null,e=null,f=null,i=null,j=null,b.exports=h=function(){function b(b){this.parent=b,this.options=this.parent.options,this.stringify=this.parent.stringify,null===g&&(g=a("./XMLElement"),c=a("./XMLCData"),d=a("./XMLComment"),e=a("./XMLDeclaration"),f=a("./XMLDocType"),i=a("./XMLRaw"),j=a("./XMLText"))}return b.prototype.clone=function(){throw new Error("Cannot clone generic XMLNode")},b.prototype.element=function(a,b,c){var d,e,f,g,h,i,j;if(g=null,null==b&&(b={}),b=b.valueOf(),n(b)||(i=[b,c],c=i[0],b=i[1]),null!=a&&(a=a.valueOf()),k(a))for(e=0,h=a.length;e/))throw new Error("Invalid CDATA text: "+a);return this.assertLegalChar(a)},a.prototype.comment=function(a){if(a=""+a||"",a.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+a);return this.assertLegalChar(a)},a.prototype.raw=function(a){return""+a||""},a.prototype.attName=function(a){return""+a||""},a.prototype.attValue=function(a){return a=""+a||"",this.attEscape(a)},a.prototype.insTarget=function(a){return""+a||""},a.prototype.insValue=function(a){if(a=""+a||"",a.match(/\?>/))throw new Error("Invalid processing instruction value: "+a);return a},a.prototype.xmlVersion=function(a){if(a=""+a||"",!a.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+a);return a},a.prototype.xmlEncoding=function(a){if(a=""+a||"",!a.match(/[A-Za-z](?:[A-Za-z0-9._-]|-)*/))throw new Error("Invalid encoding: "+a);return a},a.prototype.xmlStandalone=function(a){return a?"yes":"no"},a.prototype.dtdPubID=function(a){return""+a||""},a.prototype.dtdSysID=function(a){return""+a||""},a.prototype.dtdElementValue=function(a){return""+a||""},a.prototype.dtdAttType=function(a){return""+a||""},a.prototype.dtdAttDefault=function(a){return null!=a?""+a||"":a},a.prototype.dtdEntityValue=function(a){return""+a||""},a.prototype.dtdNData=function(a){return""+a||""},a.prototype.convertAttKey="@",a.prototype.convertPIKey="?",a.prototype.convertTextKey="#text",a.prototype.convertCDataKey="#cdata",a.prototype.convertCommentKey="#comment",a.prototype.convertRawKey="#raw",a.prototype.convertListKey="#list",a.prototype.assertLegalChar=function(a){var b,c;if(b=this.allowSurrogateChars?/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/:/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/,c=a.match(b))throw new Error("Invalid character ("+c+") in string: "+a+" at index "+c.index);return a},a.prototype.elEscape=function(a){return a.replace(/&/g,"&").replace(//g,">").replace(/\r/g," ")},a.prototype.attEscape=function(a){return a.replace(/&/g,"&").replace(/3&&"function"==typeof g?(g=e(g,h,5),c-=2):(g=c>2&&"function"==typeof h?h:null,c-=g?1:0),i&&f(b[1],b[2],i)&&(g=3==c?null:g,c=2);for(var j=0;++ji))return!1;for(;k&&++h-1&&a%1==0&&a-1&&a%1==0&&a<=e}var e=Math.pow(2,53)-1;b.exports=d},{}],129:[function(a,b,c){function d(a){return a&&"object"==typeof a||!1}b.exports=d},{}],130:[function(a,b,c){function d(a){return a===a&&(0===a?1/a>0:!e(a))}var e=a("../lang/isObject");b.exports=d},{"../lang/isObject":139}],131:[function(a,b,c){(function(c){var d=a("../lang/isNative"),e=d(e=c.WeakMap)&&e,f=e&&new e;b.exports=f}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":138}],132:[function(a,b,c){function d(a){for(var b=i(a),c=b.length,d=c&&a.length,k=d&&h(d)&&(f(a)||j.nonEnumArgs&&e(a)),m=-1,n=[];++m0;++d