/** @license ms-rest-js * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt and ThirdPartyNotices.txt in the project root for license information. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.msRest={})}(this,function(N){"use strict";function r(e){return e.toLowerCase()}var p=(e.prototype.set=function(e,t){this._headersMap[r(e)]={name:e,value:t.toString()}},e.prototype.get=function(e){var t=this._headersMap[r(e)];return t?t.value:void 0},e.prototype.contains=function(e){return!!this._headersMap[r(e)]},e.prototype.remove=function(e){var t=this.contains(e);return delete this._headersMap[r(e)],t},e.prototype.rawHeaders=function(){var e={};for(var t in this._headersMap){var r=this._headersMap[t];e[r.name.toLowerCase()]=r.value}return e},e.prototype.headersArray=function(){var e=[];for(var t in this._headersMap)e.push(this._headersMap[t]);return e},e.prototype.headerNames=function(){for(var e=[],t=this.headersArray(),r=0;r>>((3&t)<<3)&255;return n}}}(t={exports:{}},t.exports),t.exports),o=[],n=0;n<256;++n)o[n]=(n+256).toString(16).substr(1);var u=function(e,t){var r=t||0,n=o;return[n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]]].join("")};var l=function(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var i=0;i<16;++i)t[n+i]=o[i];return t||u(o)},c={msRestVersion:"1.8.13",HTTP:"http:",HTTPS:"https:",HTTP_PROXY:"HTTP_PROXY",HTTPS_PROXY:"HTTPS_PROXY",HttpConstants:{HttpVerbs:{PUT:"PUT",GET:"GET",DELETE:"DELETE",POST:"POST",MERGE:"MERGE",HEAD:"HEAD",PATCH:"PATCH"},StatusCodes:{TooManyRequests:429}},HeaderConstants:{AUTHORIZATION:"authorization",AUTHORIZATION_SCHEME:"Bearer",RETRY_AFTER:"Retry-After",USER_AGENT:"User-Agent"}},f="undefined"!=typeof process&&!!process.version&&!!process.versions&&!!process.versions.node;function y(e){var t={};return t.body=e.bodyAsText,t.headers=e.headers,t.status=e.status,t}function m(e){var t=e.clone();return t.headers&&t.headers.remove("authorization"),t}function h(e){return new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","ig").test(e)}function v(){return l()}function d(t,r){return new Promise(function(e){return setTimeout(function(){return e(r)},t)})}var g=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function b(e){return g.test(e)}function E(e,t,r){return e&&t?e.split(t).join(r||""):e}var w=(R.prototype.validateConstraints=function(e,r,n){function t(e,t){throw new Error('"'+n+'" with value "'+r+'" should satisfy the constraint "'+e+'": '+t+".")}if(e.constraints&&null!=r){var o=e.constraints,i=o.ExclusiveMaximum,a=o.ExclusiveMinimum,s=o.InclusiveMaximum,u=o.InclusiveMinimum,l=o.MaxItems,c=o.MaxLength,f=o.MinItems,p=o.MinLength,h=o.MultipleOf,d=o.Pattern,y=o.UniqueItems;null!=i&&i<=r&&t("ExclusiveMaximum",i),null!=a&&r<=a&&t("ExclusiveMinimum",a),null!=s&&sl&&t("MaxItems",l),null!=c&&r.length>c&&t("MaxLength",c),null!=f&&r.lengtha[0]&&t[1]'+Z.serializeToString(r)}function te(e){for(var t=[],r=0,n=Object.keys(e);r> Request: "+JSON.stringify(t.request,void 0,2)),e.logger(">> Response status code: "+t.status);var r=t.bodyAsText;return e.logger(">> Body: "+r),Promise.resolve(t)}(t,e)})},St);function St(e,t,r){void 0===r&&(r=console.log);var n=Tt.call(this,e,t)||this;return n.logger=r,n}var Ot=c.HeaderConstants,xt=(Nt.prototype.signRequest=function(e){return e.headers||(e.headers=new p),e.headers.set(Ot.AUTHORIZATION,this.authorizationScheme+" "+this.token),Promise.resolve(e)},Nt);function Nt(e,t){if(void 0===t&&(t="Bearer"),this.authorizationScheme="Bearer",!e)throw new Error("token cannot be null or undefined.");this.token=e,this.authorizationScheme=t}var qt=c.HeaderConstants,At=(Ct.prototype.signRequest=function(e){var t=this.userName+":"+this.password,r=this.authorizationScheme+" "+function(e){return btoa(e)}(t);return e.headers||(e.headers=new p),e.headers.set(qt.AUTHORIZATION,r),Promise.resolve(e)},Ct);function Ct(e,t,r){if(void 0===r&&(r="Basic"),this.authorizationScheme="Basic",null==e||"string"!=typeof e.valueOf())throw new Error("userName cannot be null or undefined and must be of type string.");if(null==t||"string"!=typeof t.valueOf())throw new Error("password cannot be null or undefined and must be of type string.");this.userName=e,this.password=t,this.authorizationScheme=r}var Dt=(It.prototype.signRequest=function(e){if(!e)return Promise.reject(new Error('webResource cannot be null or undefined and must be of type "object".'));if(this.inHeader)for(var t in e.headers||(e.headers=new p),this.inHeader)e.headers.set(t,this.inHeader[t]);if(this.inQuery){if(!e.url)return Promise.reject(new Error("url cannot be null in the request object."));for(var r in e.url.indexOf("?")<0&&(e.url+="?"),this.inQuery)e.url.endsWith("?")||(e.url+="&"),e.url+=r+"="+this.inQuery[r]}return Promise.resolve(e)},It);function It(e){if(!e||e&&!e.inHeader&&!e.inQuery)throw new Error('options cannot be null or undefined. Either "inHeader" or "inQuery" property of the options object needs to be provided.');this.inHeader=e.inHeader,this.inQuery=e.inQuery}var Ut,Ht=(S(Mt,Ut=Dt),Mt);function Mt(e){if(!e||e&&"string"!=typeof e)throw new Error("topicKey cannot be null or undefined and must be of type string.");var t={inHeader:{"aeg-sas-key":e}};return Ut.call(this,t)||this}var zt,jt=(S(Lt,zt=Dt),Lt);function Lt(e){if(!e||e&&"string"!=typeof e)throw new Error("domainKey cannot be null or undefined and must be of type string.");var t={inHeader:{"aeg-sas-key":e}};return zt.call(this,t)||this}N.WebResource=A,N.DefaultHttpClient=k,N.HttpHeaders=p,N.RestError=z,N.ServiceClient=gt,N.flattenResponse=_t,N.Constants=c,N.logPolicy=function(r){return void 0===r&&(r=console.log),{create:function(e,t){return new Pt(e,t,r)}}},N.BaseRequestPolicy=re,N.RequestPolicyOptions=oe,N.generateClientRequestIdPolicy=ge,N.exponentialRetryPolicy=he,N.systemErrorRetryPolicy=tt,N.throttlingRetryPolicy=dt,N.getDefaultProxySettings=lt,N.proxyPolicy=ct,N.redirectPolicy=Fe,N.signingPolicy=Ge,N.userAgentPolicy=Pe,N.getDefaultUserAgentValue=Te,N.deserializationPolicy=ae,N.deserializeResponseBody=pe,N.MapperType=q,N.Serializer=w,N.serializeObject=function e(t){if(null!=t){if(t instanceof Uint8Array)return t=s(t);if(t instanceof Date)return t.toISOString();if(Array.isArray(t)){for(var r=[],n=0;n