Socket
Socket
Sign inDemoInstall

@angular/http

Package Overview
Dependencies
Maintainers
1
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/http - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

2

bundles/http-testing.umd.js
/**
* @license Angular v2.2.0
* @license Angular v2.2.1
* (c) 2010-2016 Google, Inc. https://angular.io/

@@ -4,0 +4,0 @@ * License: MIT

/**
* @license Angular v2.2.0
* @license Angular v2.2.1
* (c) 2010-2016 Google, Inc. https://angular.io/
* License: MIT
*/
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("rxjs/Observable"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs/Observable","@angular/platform-browser"],factory):factory((global.ng=global.ng||{},global.ng.http=global.ng.http||{}),global.ng.core,global.Rx,global.ng.platformBrowser)}(this,function(exports,_angular_core,rxjs_Observable,_angular_platformBrowser){"use strict";function isPresent(obj){return null!=obj}function isJsObject(o){return null!==o&&("function"==typeof o||"object"==typeof o)}function normalizeMethodName(method){if("string"!=typeof method)return method;switch(method.toUpperCase()){case"GET":return exports.RequestMethod.Get;case"POST":return exports.RequestMethod.Post;case"PUT":return exports.RequestMethod.Put;case"DELETE":return exports.RequestMethod.Delete;case"OPTIONS":return exports.RequestMethod.Options;case"HEAD":return exports.RequestMethod.Head;case"PATCH":return exports.RequestMethod.Patch}throw new Error('Invalid request method. The method "'+method+'" is not supported.')}function getResponseURL(xhr){return"responseURL"in xhr?xhr.responseURL:/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())?xhr.getResponseHeader("X-Request-URL"):void 0}function stringToArrayBuffer(input){for(var view=new Uint16Array(input.length),i=0,strLen=input.length;i<strLen;i++)view[i]=input.charCodeAt(i);return view.buffer}/**
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("rxjs/Observable"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs/Observable","@angular/platform-browser"],factory):factory((global.ng=global.ng||{},global.ng.http=global.ng.http||{}),global.ng.core,global.Rx,global.ng.platformBrowser)}(this,function(exports,_angular_core,rxjs_Observable,_angular_platformBrowser){"use strict";function normalizeMethodName(method){if("string"!=typeof method)return method;switch(method.toUpperCase()){case"GET":return exports.RequestMethod.Get;case"POST":return exports.RequestMethod.Post;case"PUT":return exports.RequestMethod.Put;case"DELETE":return exports.RequestMethod.Delete;case"OPTIONS":return exports.RequestMethod.Options;case"HEAD":return exports.RequestMethod.Head;case"PATCH":return exports.RequestMethod.Patch}throw new Error('Invalid request method. The method "'+method+'" is not supported.')}function getResponseURL(xhr){return"responseURL"in xhr?xhr.responseURL:/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())?xhr.getResponseHeader("X-Request-URL"):void 0}function stringToArrayBuffer(input){for(var view=new Uint16Array(input.length),i=0,strLen=input.length;i<strLen;i++)view[i]=input.charCodeAt(i);return view.buffer}/**
* @license

@@ -13,3 +13,3 @@ * Copyright Google Inc. All Rights Reserved.

*/
function paramParser(rawParams){void 0===rawParams&&(rawParams="");var map=new Map;if(rawParams.length>0){var params=rawParams.split("&");params.forEach(function(param){var eqIdx=param.indexOf("="),_a=eqIdx==-1?[param,""]:[param.slice(0,eqIdx),param.slice(eqIdx+1)],key=_a[0],val=_a[1],list=map.get(key)||[];list.push(val),map.set(key,list)})}return map}function standardEncoding(v){return encodeURIComponent(v).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}function _getJsonpConnections(){return null===_jsonpConnections&&(_jsonpConnections=global$1[JSONP_HOME]={}),_jsonpConnections}function httpRequest(backend,request){return backend.createConnection(request).response}function mergeOptions(defaultOpts,providedOpts,method,url){var newOptions=defaultOpts;return isPresent(providedOpts)?newOptions.merge(new RequestOptions({method:providedOpts.method||method,url:providedOpts.url||url,search:providedOpts.search,headers:providedOpts.headers,body:providedOpts.body,withCredentials:providedOpts.withCredentials,responseType:providedOpts.responseType})):isPresent(method)?newOptions.merge(new RequestOptions({method:method,url:url})):newOptions.merge(new RequestOptions({url:url}))}function _createDefaultCookieXSRFStrategy(){return new CookieXSRFStrategy}function httpFactory(xhrBackend,requestOptions){return new Http(xhrBackend,requestOptions)}function jsonpFactory(jsonpBackend,requestOptions){return new Jsonp(jsonpBackend,requestOptions)}var globalScope,BrowserXhr=function(){function BrowserXhr(){}return BrowserXhr.prototype.build=function(){return new XMLHttpRequest},BrowserXhr.decorators=[{type:_angular_core.Injectable}],BrowserXhr.ctorParameters=[],BrowserXhr}();globalScope="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:global:window;var global$1=globalScope;global$1.assert=function(condition){},/**
function paramParser(rawParams){void 0===rawParams&&(rawParams="");var map=new Map;if(rawParams.length>0){var params=rawParams.split("&");params.forEach(function(param){var eqIdx=param.indexOf("="),_a=eqIdx==-1?[param,""]:[param.slice(0,eqIdx),param.slice(eqIdx+1)],key=_a[0],val=_a[1],list=map.get(key)||[];list.push(val),map.set(key,list)})}return map}function standardEncoding(v){return encodeURIComponent(v).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}function _getJsonpConnections(){var w="object"==typeof window?window:{};return null===_jsonpConnections&&(_jsonpConnections=w[JSONP_HOME]={}),_jsonpConnections}function httpRequest(backend,request){return backend.createConnection(request).response}function mergeOptions(defaultOpts,providedOpts,method,url){var newOptions=defaultOpts;return providedOpts?newOptions.merge(new RequestOptions({method:providedOpts.method||method,url:providedOpts.url||url,search:providedOpts.search,headers:providedOpts.headers,body:providedOpts.body,withCredentials:providedOpts.withCredentials,responseType:providedOpts.responseType})):newOptions.merge(new RequestOptions({method:method,url:url}))}function _createDefaultCookieXSRFStrategy(){return new CookieXSRFStrategy}function httpFactory(xhrBackend,requestOptions){return new Http(xhrBackend,requestOptions)}function jsonpFactory(jsonpBackend,requestOptions){return new Jsonp(jsonpBackend,requestOptions)}var BrowserXhr=function(){function BrowserXhr(){}return BrowserXhr.prototype.build=function(){return new XMLHttpRequest},BrowserXhr.decorators=[{type:_angular_core.Injectable}],BrowserXhr.ctorParameters=[],BrowserXhr}();/**
* @license

@@ -28,2 +28,2 @@ * Copyright Google Inc. All Rights Reserved.

*/
var Headers=function(){function Headers(headers){var _this=this;if(this._headers=new Map,this._normalizedNames=new Map,headers)return headers instanceof Headers?void headers.forEach(function(values,name){values.forEach(function(value){return _this.append(name,value)})}):void Object.keys(headers).forEach(function(name){var values=Array.isArray(headers[name])?headers[name]:[headers[name]];_this.delete(name),values.forEach(function(value){return _this.append(name,value)})})}return Headers.fromResponseHeaderString=function(headersString){var headers=new Headers;return headersString.split("\n").forEach(function(line){var index=line.indexOf(":");if(index>0){var name_1=line.slice(0,index),value=line.slice(index+1).trim();headers.set(name_1,value)}}),headers},Headers.prototype.append=function(name,value){var values=this.getAll(name);null===values?this.set(name,value):values.push(value)},Headers.prototype.delete=function(name){var lcName=name.toLowerCase();this._normalizedNames.delete(lcName),this._headers.delete(lcName)},Headers.prototype.forEach=function(fn){var _this=this;this._headers.forEach(function(values,lcName){return fn(values,_this._normalizedNames.get(lcName),_this._headers)})},Headers.prototype.get=function(name){var values=this.getAll(name);return null===values?null:values.length>0?values[0]:null},Headers.prototype.has=function(name){return this._headers.has(name.toLowerCase())},Headers.prototype.keys=function(){return Array.from(this._normalizedNames.values())},Headers.prototype.set=function(name,value){Array.isArray(value)?value.length&&this._headers.set(name.toLowerCase(),[value.join(",")]):this._headers.set(name.toLowerCase(),[value]),this.mayBeSetNormalizedName(name)},Headers.prototype.values=function(){return Array.from(this._headers.values())},Headers.prototype.toJSON=function(){var _this=this,serialized={};return this._headers.forEach(function(values,name){var split=[];values.forEach(function(v){return split.push.apply(split,v.split(","))}),serialized[_this._normalizedNames.get(name)]=split}),serialized},Headers.prototype.getAll=function(name){return this.has(name)?this._headers.get(name.toLowerCase()):null},Headers.prototype.entries=function(){throw new Error('"entries" method is not implemented on Headers class')},Headers.prototype.mayBeSetNormalizedName=function(name){var lcName=name.toLowerCase();this._normalizedNames.has(lcName)||this._normalizedNames.set(lcName,name)},Headers}(),__extends$1=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},ResponseOptions=function(){function ResponseOptions(_a){var _b=void 0===_a?{}:_a,body=_b.body,status=_b.status,headers=_b.headers,statusText=_b.statusText,type=_b.type,url=_b.url;this.body=isPresent(body)?body:null,this.status=isPresent(status)?status:null,this.headers=isPresent(headers)?headers:null,this.statusText=isPresent(statusText)?statusText:null,this.type=isPresent(type)?type:null,this.url=isPresent(url)?url:null}return ResponseOptions.prototype.merge=function(options){return new ResponseOptions({body:isPresent(options)&&isPresent(options.body)?options.body:this.body,status:isPresent(options)&&isPresent(options.status)?options.status:this.status,headers:isPresent(options)&&isPresent(options.headers)?options.headers:this.headers,statusText:isPresent(options)&&isPresent(options.statusText)?options.statusText:this.statusText,type:isPresent(options)&&isPresent(options.type)?options.type:this.type,url:isPresent(options)&&isPresent(options.url)?options.url:this.url})},ResponseOptions}(),BaseResponseOptions=function(_super){function BaseResponseOptions(){_super.call(this,{status:200,statusText:"Ok",type:exports.ResponseType.Default,headers:new Headers})}return __extends$1(BaseResponseOptions,_super),BaseResponseOptions.decorators=[{type:_angular_core.Injectable}],BaseResponseOptions.ctorParameters=[],BaseResponseOptions}(ResponseOptions),ConnectionBackend=function(){function ConnectionBackend(){}return ConnectionBackend}(),Connection=function(){function Connection(){}return Connection}(),XSRFStrategy=function(){function XSRFStrategy(){}return XSRFStrategy}(),isSuccess=function(status){return status>=200&&status<300},QueryEncoder=function(){function QueryEncoder(){}return QueryEncoder.prototype.encodeKey=function(k){return standardEncoding(k)},QueryEncoder.prototype.encodeValue=function(v){return standardEncoding(v)},QueryEncoder}(),URLSearchParams=function(){function URLSearchParams(rawParams,queryEncoder){void 0===rawParams&&(rawParams=""),void 0===queryEncoder&&(queryEncoder=new QueryEncoder),this.rawParams=rawParams,this.queryEncoder=queryEncoder,this.paramsMap=paramParser(rawParams)}return URLSearchParams.prototype.clone=function(){var clone=new URLSearchParams("",this.queryEncoder);return clone.appendAll(this),clone},URLSearchParams.prototype.has=function(param){return this.paramsMap.has(param)},URLSearchParams.prototype.get=function(param){var storedParam=this.paramsMap.get(param);return Array.isArray(storedParam)?storedParam[0]:null},URLSearchParams.prototype.getAll=function(param){return this.paramsMap.get(param)||[]},URLSearchParams.prototype.set=function(param,val){if(void 0===val||null===val)return void this.delete(param);var list=this.paramsMap.get(param)||[];list.length=0,list.push(val),this.paramsMap.set(param,list)},URLSearchParams.prototype.setAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0,list.push(value[0]),_this.paramsMap.set(param,list)})},URLSearchParams.prototype.append=function(param,val){if(void 0!==val&&null!==val){var list=this.paramsMap.get(param)||[];list.push(val),this.paramsMap.set(param,list)}},URLSearchParams.prototype.appendAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){for(var list=_this.paramsMap.get(param)||[],i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.replaceAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0;for(var i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.toString=function(){var _this=this,paramsList=[];return this.paramsMap.forEach(function(values,k){values.forEach(function(v){return paramsList.push(_this.queryEncoder.encodeKey(k)+"="+_this.queryEncoder.encodeValue(v))})}),paramsList.join("&")},URLSearchParams.prototype.delete=function(param){this.paramsMap.delete(param)},URLSearchParams}(),Body=function(){function Body(){}return Body.prototype.json=function(){return"string"==typeof this._body?JSON.parse(this._body):this._body instanceof ArrayBuffer?JSON.parse(this.text()):this._body},Body.prototype.text=function(){return this._body instanceof URLSearchParams?this._body.toString():this._body instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(this._body)):null===this._body?"":isJsObject(this._body)?JSON.stringify(this._body,null,2):this._body.toString()},Body.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:stringToArrayBuffer(this.text())},Body.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},Body}(),__extends$2=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Response=function(_super){function Response(responseOptions){_super.call(this),this._body=responseOptions.body,this.status=responseOptions.status,this.ok=this.status>=200&&this.status<=299,this.statusText=responseOptions.statusText,this.headers=responseOptions.headers,this.type=responseOptions.type,this.url=responseOptions.url}return __extends$2(Response,_super),Response.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},Response}(Body),_nextRequestId=0,JSONP_HOME="__ng_jsonp__",_jsonpConnections=null,BrowserJsonp=function(){function BrowserJsonp(){}return BrowserJsonp.prototype.build=function(url){var node=document.createElement("script");return node.src=url,node},BrowserJsonp.prototype.nextRequestID=function(){return"__req"+_nextRequestId++},BrowserJsonp.prototype.requestCallback=function(id){return JSONP_HOME+"."+id+".finished"},BrowserJsonp.prototype.exposeConnection=function(id,connection){var connections=_getJsonpConnections();connections[id]=connection},BrowserJsonp.prototype.removeConnection=function(id){var connections=_getJsonpConnections();connections[id]=null},BrowserJsonp.prototype.send=function(node){document.body.appendChild(node)},BrowserJsonp.prototype.cleanup=function(node){node.parentNode&&node.parentNode.removeChild(node)},BrowserJsonp.decorators=[{type:_angular_core.Injectable}],BrowserJsonp.ctorParameters=[],BrowserJsonp}(),__extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},JSONP_ERR_NO_CALLBACK="JSONP injected script did not invoke callback.",JSONP_ERR_WRONG_METHOD="JSONP requests must use GET request method.",JSONPConnection=function(){function JSONPConnection(){}return JSONPConnection}(),JSONPConnection_=function(_super){function JSONPConnection_(req,_dom,baseResponseOptions){var _this=this;if(_super.call(this),this._dom=_dom,this.baseResponseOptions=baseResponseOptions,this._finished=!1,req.method!==exports.RequestMethod.Get)throw new TypeError(JSONP_ERR_WRONG_METHOD);this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){_this.readyState=exports.ReadyState.Loading;var id=_this._id=_dom.nextRequestID();_dom.exposeConnection(id,_this);var callback=_dom.requestCallback(_this._id),url=req.url;url.indexOf("=JSONP_CALLBACK&")>-1?url=url.replace("=JSONP_CALLBACK&","="+callback+"&"):url.lastIndexOf("=JSONP_CALLBACK")===url.length-"=JSONP_CALLBACK".length&&(url=url.substring(0,url.length-"=JSONP_CALLBACK".length)+("="+callback));var script=_this._script=_dom.build(url),onLoad=function(event){if(_this.readyState!==exports.ReadyState.Cancelled){if(_this.readyState=exports.ReadyState.Done,_dom.cleanup(script),!_this._finished){var responseOptions_1=new ResponseOptions({body:JSONP_ERR_NO_CALLBACK,type:exports.ResponseType.Error,url:url});return isPresent(baseResponseOptions)&&(responseOptions_1=baseResponseOptions.merge(responseOptions_1)),void responseObserver.error(new Response(responseOptions_1))}var responseOptions=new ResponseOptions({body:_this._responseData,url:url});isPresent(_this.baseResponseOptions)&&(responseOptions=_this.baseResponseOptions.merge(responseOptions)),responseObserver.next(new Response(responseOptions)),responseObserver.complete()}},onError=function(error){if(_this.readyState!==exports.ReadyState.Cancelled){_this.readyState=exports.ReadyState.Done,_dom.cleanup(script);var responseOptions=new ResponseOptions({body:error.message,type:exports.ResponseType.Error});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))}};return script.addEventListener("load",onLoad),script.addEventListener("error",onError),_dom.send(script),function(){_this.readyState=exports.ReadyState.Cancelled,script.removeEventListener("load",onLoad),script.removeEventListener("error",onError),isPresent(script)&&_this._dom.cleanup(script)}})}return __extends(JSONPConnection_,_super),JSONPConnection_.prototype.finished=function(data){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==exports.ReadyState.Cancelled&&(this._responseData=data)},JSONPConnection_}(JSONPConnection),JSONPBackend=function(_super){function JSONPBackend(){_super.apply(this,arguments)}return __extends(JSONPBackend,_super),JSONPBackend}(ConnectionBackend),JSONPBackend_=function(_super){function JSONPBackend_(_browserJSONP,_baseResponseOptions){_super.call(this),this._browserJSONP=_browserJSONP,this._baseResponseOptions=_baseResponseOptions}return __extends(JSONPBackend_,_super),JSONPBackend_.prototype.createConnection=function(request){return new JSONPConnection_(request,this._browserJSONP,this._baseResponseOptions)},JSONPBackend_.decorators=[{type:_angular_core.Injectable}],JSONPBackend_.ctorParameters=[{type:BrowserJsonp},{type:ResponseOptions}],JSONPBackend_}(JSONPBackend),XSSI_PREFIX=/^\)\]\}',?\n/,XHRConnection=function(){function XHRConnection(req,browserXHR,baseResponseOptions){var _this=this;this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){var _xhr=browserXHR.build();_xhr.open(exports.RequestMethod[req.method].toUpperCase(),req.url),isPresent(req.withCredentials)&&(_xhr.withCredentials=req.withCredentials);var onLoad=function(){var body=void 0===_xhr.response?_xhr.responseText:_xhr.response;"string"==typeof body&&(body=body.replace(XSSI_PREFIX,""));var headers=Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders()),url=getResponseURL(_xhr),status=1223===_xhr.status?204:_xhr.status;0===status&&(status=body?200:0);var statusText=_xhr.statusText||"OK",responseOptions=new ResponseOptions({body:body,status:status,headers:headers,statusText:statusText,url:url});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions));var response=new Response(responseOptions);return response.ok=isSuccess(status),response.ok?(responseObserver.next(response),void responseObserver.complete()):void responseObserver.error(response)},onError=function(err){var responseOptions=new ResponseOptions({body:err,type:exports.ResponseType.Error,status:_xhr.status,statusText:_xhr.statusText});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))};if(_this.setDetectedContentType(req,_xhr),isPresent(req.headers)&&req.headers.forEach(function(values,name){return _xhr.setRequestHeader(name,values.join(","))}),isPresent(req.responseType)&&isPresent(_xhr.responseType))switch(req.responseType){case exports.ResponseContentType.ArrayBuffer:_xhr.responseType="arraybuffer";break;case exports.ResponseContentType.Json:_xhr.responseType="json";break;case exports.ResponseContentType.Text:_xhr.responseType="text";break;case exports.ResponseContentType.Blob:_xhr.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return _xhr.addEventListener("load",onLoad),_xhr.addEventListener("error",onError),_xhr.send(_this.request.getBody()),function(){_xhr.removeEventListener("load",onLoad),_xhr.removeEventListener("error",onError),_xhr.abort()}})}return XHRConnection.prototype.setDetectedContentType=function(req,_xhr){if(!isPresent(req.headers)||!isPresent(req.headers.get("Content-Type")))switch(req.contentType){case ContentType.NONE:break;case ContentType.JSON:_xhr.setRequestHeader("content-type","application/json");break;case ContentType.FORM:_xhr.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case ContentType.TEXT:_xhr.setRequestHeader("content-type","text/plain");break;case ContentType.BLOB:var blob=req.blob();blob.type&&_xhr.setRequestHeader("content-type",blob.type)}},XHRConnection}(),CookieXSRFStrategy=function(){function CookieXSRFStrategy(_cookieName,_headerName){void 0===_cookieName&&(_cookieName="XSRF-TOKEN"),void 0===_headerName&&(_headerName="X-XSRF-TOKEN"),this._cookieName=_cookieName,this._headerName=_headerName}return CookieXSRFStrategy.prototype.configureRequest=function(req){var xsrfToken=_angular_platformBrowser.__platform_browser_private__.getDOM().getCookie(this._cookieName);xsrfToken&&req.headers.set(this._headerName,xsrfToken)},CookieXSRFStrategy}(),XHRBackend=function(){function XHRBackend(_browserXHR,_baseResponseOptions,_xsrfStrategy){this._browserXHR=_browserXHR,this._baseResponseOptions=_baseResponseOptions,this._xsrfStrategy=_xsrfStrategy}return XHRBackend.prototype.createConnection=function(request){return this._xsrfStrategy.configureRequest(request),new XHRConnection(request,this._browserXHR,this._baseResponseOptions)},XHRBackend.decorators=[{type:_angular_core.Injectable}],XHRBackend.ctorParameters=[{type:BrowserXhr},{type:ResponseOptions},{type:XSRFStrategy}],XHRBackend}(),__extends$3=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},RequestOptions=function(){function RequestOptions(_a){var _b=void 0===_a?{}:_a,method=_b.method,headers=_b.headers,body=_b.body,url=_b.url,search=_b.search,withCredentials=_b.withCredentials,responseType=_b.responseType;this.method=isPresent(method)?normalizeMethodName(method):null,this.headers=isPresent(headers)?headers:null,this.body=isPresent(body)?body:null,this.url=isPresent(url)?url:null,this.search=isPresent(search)?"string"==typeof search?new URLSearchParams(search):search:null,this.withCredentials=isPresent(withCredentials)?withCredentials:null,this.responseType=isPresent(responseType)?responseType:null}return RequestOptions.prototype.merge=function(options){return new RequestOptions({method:options&&isPresent(options.method)?options.method:this.method,headers:options&&isPresent(options.headers)?options.headers:this.headers,body:options&&isPresent(options.body)?options.body:this.body,url:options&&isPresent(options.url)?options.url:this.url,search:options&&isPresent(options.search)?"string"==typeof options.search?new URLSearchParams(options.search):options.search.clone():this.search,withCredentials:options&&isPresent(options.withCredentials)?options.withCredentials:this.withCredentials,responseType:options&&isPresent(options.responseType)?options.responseType:this.responseType})},RequestOptions}(),BaseRequestOptions=function(_super){function BaseRequestOptions(){_super.call(this,{method:exports.RequestMethod.Get,headers:new Headers})}return __extends$3(BaseRequestOptions,_super),BaseRequestOptions.decorators=[{type:_angular_core.Injectable}],BaseRequestOptions.ctorParameters=[],BaseRequestOptions}(RequestOptions),__extends$5=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Request=function(_super){function Request(requestOptions){_super.call(this);var url=requestOptions.url;if(this.url=requestOptions.url,isPresent(requestOptions.search)){var search=requestOptions.search.toString();if(search.length>0){var prefix="?";this.url.indexOf("?")!=-1&&(prefix="&"==this.url[this.url.length-1]?"":"&"),this.url=url+prefix+search}}this._body=requestOptions.body,this.method=normalizeMethodName(requestOptions.method),this.headers=new Headers(requestOptions.headers),this.contentType=this.detectContentType(),this.withCredentials=requestOptions.withCredentials,this.responseType=requestOptions.responseType}return __extends$5(Request,_super),Request.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return ContentType.JSON;case"application/x-www-form-urlencoded":return ContentType.FORM;case"multipart/form-data":return ContentType.FORM_DATA;case"text/plain":case"text/html":return ContentType.TEXT;case"application/octet-stream":return ContentType.BLOB;default:return this.detectContentTypeFromBody()}},Request.prototype.detectContentTypeFromBody=function(){return null==this._body?ContentType.NONE:this._body instanceof URLSearchParams?ContentType.FORM:this._body instanceof FormData?ContentType.FORM_DATA:this._body instanceof Blob$1?ContentType.BLOB:this._body instanceof ArrayBuffer$1?ContentType.ARRAY_BUFFER:this._body&&"object"==typeof this._body?ContentType.JSON:ContentType.TEXT},Request.prototype.getBody=function(){switch(this.contentType){case ContentType.JSON:return this.text();case ContentType.FORM:return this.text();case ContentType.FORM_DATA:return this._body;case ContentType.TEXT:return this.text();case ContentType.BLOB:return this.blob();case ContentType.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},Request}(Body),noop=function(){},w="object"==typeof window?window:noop,FormData=w.FormData||noop,Blob$1=w.Blob||noop,ArrayBuffer$1=w.ArrayBuffer||noop,__extends$4=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Http=function(){function Http(_backend,_defaultOptions){this._backend=_backend,this._defaultOptions=_defaultOptions}return Http.prototype.request=function(url,options){var responseObservable;if("string"==typeof url)responseObservable=httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url)));else{if(!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");responseObservable=httpRequest(this._backend,url)}return responseObservable},Http.prototype.get=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url)))},Http.prototype.post=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Post,url)))},Http.prototype.put=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Put,url)))},Http.prototype.delete=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Delete,url)))},Http.prototype.patch=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Patch,url)))},Http.prototype.head=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Head,url)))},Http.prototype.options=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Options,url)))},Http.decorators=[{type:_angular_core.Injectable}],Http.ctorParameters=[{type:ConnectionBackend},{type:RequestOptions}],Http}(),Jsonp=function(_super){function Jsonp(backend,defaultOptions){_super.call(this,backend,defaultOptions)}return __extends$4(Jsonp,_super),Jsonp.prototype.request=function(url,options){var responseObservable;if("string"==typeof url&&(url=new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url))),!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");if(url.method!==exports.RequestMethod.Get)throw new Error("JSONP requests must use GET request method.");return responseObservable=httpRequest(this._backend,url)},Jsonp.decorators=[{type:_angular_core.Injectable}],Jsonp.ctorParameters=[{type:ConnectionBackend},{type:RequestOptions}],Jsonp}(Http),HttpModule=function(){function HttpModule(){}return HttpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Http,useFactory:httpFactory,deps:[XHRBackend,RequestOptions]},BrowserXhr,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},XHRBackend,{provide:XSRFStrategy,useFactory:_createDefaultCookieXSRFStrategy}]}]}],HttpModule.ctorParameters=[],HttpModule}(),JsonpModule=function(){function JsonpModule(){}return JsonpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Jsonp,useFactory:jsonpFactory,deps:[JSONPBackend,RequestOptions]},BrowserJsonp,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},{provide:JSONPBackend,useClass:JSONPBackend_}]}]}],JsonpModule.ctorParameters=[],JsonpModule}();exports.BrowserXhr=BrowserXhr,exports.JSONPBackend=JSONPBackend,exports.JSONPConnection=JSONPConnection,exports.CookieXSRFStrategy=CookieXSRFStrategy,exports.XHRBackend=XHRBackend,exports.XHRConnection=XHRConnection,exports.BaseRequestOptions=BaseRequestOptions,exports.RequestOptions=RequestOptions,exports.BaseResponseOptions=BaseResponseOptions,exports.ResponseOptions=ResponseOptions,exports.Headers=Headers,exports.Http=Http,exports.Jsonp=Jsonp,exports.HttpModule=HttpModule,exports.JsonpModule=JsonpModule,exports.Connection=Connection,exports.ConnectionBackend=ConnectionBackend,exports.XSRFStrategy=XSRFStrategy,exports.Request=Request,exports.Response=Response,exports.QueryEncoder=QueryEncoder,exports.URLSearchParams=URLSearchParams});
var Headers=function(){function Headers(headers){var _this=this;if(this._headers=new Map,this._normalizedNames=new Map,headers)return headers instanceof Headers?void headers.forEach(function(values,name){values.forEach(function(value){return _this.append(name,value)})}):void Object.keys(headers).forEach(function(name){var values=Array.isArray(headers[name])?headers[name]:[headers[name]];_this.delete(name),values.forEach(function(value){return _this.append(name,value)})})}return Headers.fromResponseHeaderString=function(headersString){var headers=new Headers;return headersString.split("\n").forEach(function(line){var index=line.indexOf(":");if(index>0){var name_1=line.slice(0,index),value=line.slice(index+1).trim();headers.set(name_1,value)}}),headers},Headers.prototype.append=function(name,value){var values=this.getAll(name);null===values?this.set(name,value):values.push(value)},Headers.prototype.delete=function(name){var lcName=name.toLowerCase();this._normalizedNames.delete(lcName),this._headers.delete(lcName)},Headers.prototype.forEach=function(fn){var _this=this;this._headers.forEach(function(values,lcName){return fn(values,_this._normalizedNames.get(lcName),_this._headers)})},Headers.prototype.get=function(name){var values=this.getAll(name);return null===values?null:values.length>0?values[0]:null},Headers.prototype.has=function(name){return this._headers.has(name.toLowerCase())},Headers.prototype.keys=function(){return Array.from(this._normalizedNames.values())},Headers.prototype.set=function(name,value){Array.isArray(value)?value.length&&this._headers.set(name.toLowerCase(),[value.join(",")]):this._headers.set(name.toLowerCase(),[value]),this.mayBeSetNormalizedName(name)},Headers.prototype.values=function(){return Array.from(this._headers.values())},Headers.prototype.toJSON=function(){var _this=this,serialized={};return this._headers.forEach(function(values,name){var split=[];values.forEach(function(v){return split.push.apply(split,v.split(","))}),serialized[_this._normalizedNames.get(name)]=split}),serialized},Headers.prototype.getAll=function(name){return this.has(name)?this._headers.get(name.toLowerCase()):null},Headers.prototype.entries=function(){throw new Error('"entries" method is not implemented on Headers class')},Headers.prototype.mayBeSetNormalizedName=function(name){var lcName=name.toLowerCase();this._normalizedNames.has(lcName)||this._normalizedNames.set(lcName,name)},Headers}(),__extends$1=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},ResponseOptions=function(){function ResponseOptions(_a){var _b=void 0===_a?{}:_a,body=_b.body,status=_b.status,headers=_b.headers,statusText=_b.statusText,type=_b.type,url=_b.url;this.body=null!=body?body:null,this.status=null!=status?status:null,this.headers=null!=headers?headers:null,this.statusText=null!=statusText?statusText:null,this.type=null!=type?type:null,this.url=null!=url?url:null}return ResponseOptions.prototype.merge=function(options){return new ResponseOptions({body:options&&null!=options.body?options.body:this.body,status:options&&null!=options.status?options.status:this.status,headers:options&&null!=options.headers?options.headers:this.headers,statusText:options&&null!=options.statusText?options.statusText:this.statusText,type:options&&null!=options.type?options.type:this.type,url:options&&null!=options.url?options.url:this.url})},ResponseOptions}(),BaseResponseOptions=function(_super){function BaseResponseOptions(){_super.call(this,{status:200,statusText:"Ok",type:exports.ResponseType.Default,headers:new Headers})}return __extends$1(BaseResponseOptions,_super),BaseResponseOptions.decorators=[{type:_angular_core.Injectable}],BaseResponseOptions.ctorParameters=[],BaseResponseOptions}(ResponseOptions),ConnectionBackend=function(){function ConnectionBackend(){}return ConnectionBackend}(),Connection=function(){function Connection(){}return Connection}(),XSRFStrategy=function(){function XSRFStrategy(){}return XSRFStrategy}(),isSuccess=function(status){return status>=200&&status<300},QueryEncoder=function(){function QueryEncoder(){}return QueryEncoder.prototype.encodeKey=function(k){return standardEncoding(k)},QueryEncoder.prototype.encodeValue=function(v){return standardEncoding(v)},QueryEncoder}(),URLSearchParams=function(){function URLSearchParams(rawParams,queryEncoder){void 0===rawParams&&(rawParams=""),void 0===queryEncoder&&(queryEncoder=new QueryEncoder),this.rawParams=rawParams,this.queryEncoder=queryEncoder,this.paramsMap=paramParser(rawParams)}return URLSearchParams.prototype.clone=function(){var clone=new URLSearchParams("",this.queryEncoder);return clone.appendAll(this),clone},URLSearchParams.prototype.has=function(param){return this.paramsMap.has(param)},URLSearchParams.prototype.get=function(param){var storedParam=this.paramsMap.get(param);return Array.isArray(storedParam)?storedParam[0]:null},URLSearchParams.prototype.getAll=function(param){return this.paramsMap.get(param)||[]},URLSearchParams.prototype.set=function(param,val){if(void 0===val||null===val)return void this.delete(param);var list=this.paramsMap.get(param)||[];list.length=0,list.push(val),this.paramsMap.set(param,list)},URLSearchParams.prototype.setAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0,list.push(value[0]),_this.paramsMap.set(param,list)})},URLSearchParams.prototype.append=function(param,val){if(void 0!==val&&null!==val){var list=this.paramsMap.get(param)||[];list.push(val),this.paramsMap.set(param,list)}},URLSearchParams.prototype.appendAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){for(var list=_this.paramsMap.get(param)||[],i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.replaceAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0;for(var i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.toString=function(){var _this=this,paramsList=[];return this.paramsMap.forEach(function(values,k){values.forEach(function(v){return paramsList.push(_this.queryEncoder.encodeKey(k)+"="+_this.queryEncoder.encodeValue(v))})}),paramsList.join("&")},URLSearchParams.prototype.delete=function(param){this.paramsMap.delete(param)},URLSearchParams}(),Body=function(){function Body(){}return Body.prototype.json=function(){return"string"==typeof this._body?JSON.parse(this._body):this._body instanceof ArrayBuffer?JSON.parse(this.text()):this._body},Body.prototype.text=function(){return this._body instanceof URLSearchParams?this._body.toString():this._body instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(this._body)):null===this._body?"":"object"==typeof this._body?JSON.stringify(this._body,null,2):this._body.toString()},Body.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:stringToArrayBuffer(this.text())},Body.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},Body}(),__extends$2=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Response=function(_super){function Response(responseOptions){_super.call(this),this._body=responseOptions.body,this.status=responseOptions.status,this.ok=this.status>=200&&this.status<=299,this.statusText=responseOptions.statusText,this.headers=responseOptions.headers,this.type=responseOptions.type,this.url=responseOptions.url}return __extends$2(Response,_super),Response.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},Response}(Body),_nextRequestId=0,JSONP_HOME="__ng_jsonp__",_jsonpConnections=null,BrowserJsonp=function(){function BrowserJsonp(){}return BrowserJsonp.prototype.build=function(url){var node=document.createElement("script");return node.src=url,node},BrowserJsonp.prototype.nextRequestID=function(){return"__req"+_nextRequestId++},BrowserJsonp.prototype.requestCallback=function(id){return JSONP_HOME+"."+id+".finished"},BrowserJsonp.prototype.exposeConnection=function(id,connection){var connections=_getJsonpConnections();connections[id]=connection},BrowserJsonp.prototype.removeConnection=function(id){var connections=_getJsonpConnections();connections[id]=null},BrowserJsonp.prototype.send=function(node){document.body.appendChild(node)},BrowserJsonp.prototype.cleanup=function(node){node.parentNode&&node.parentNode.removeChild(node)},BrowserJsonp.decorators=[{type:_angular_core.Injectable}],BrowserJsonp.ctorParameters=[],BrowserJsonp}(),__extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},JSONP_ERR_NO_CALLBACK="JSONP injected script did not invoke callback.",JSONP_ERR_WRONG_METHOD="JSONP requests must use GET request method.",JSONPConnection=function(){function JSONPConnection(){}return JSONPConnection}(),JSONPConnection_=function(_super){function JSONPConnection_(req,_dom,baseResponseOptions){var _this=this;if(_super.call(this),this._dom=_dom,this.baseResponseOptions=baseResponseOptions,this._finished=!1,req.method!==exports.RequestMethod.Get)throw new TypeError(JSONP_ERR_WRONG_METHOD);this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){_this.readyState=exports.ReadyState.Loading;var id=_this._id=_dom.nextRequestID();_dom.exposeConnection(id,_this);var callback=_dom.requestCallback(_this._id),url=req.url;url.indexOf("=JSONP_CALLBACK&")>-1?url=url.replace("=JSONP_CALLBACK&","="+callback+"&"):url.lastIndexOf("=JSONP_CALLBACK")===url.length-"=JSONP_CALLBACK".length&&(url=url.substring(0,url.length-"=JSONP_CALLBACK".length)+("="+callback));var script=_this._script=_dom.build(url),onLoad=function(event){if(_this.readyState!==exports.ReadyState.Cancelled){if(_this.readyState=exports.ReadyState.Done,_dom.cleanup(script),!_this._finished){var responseOptions_1=new ResponseOptions({body:JSONP_ERR_NO_CALLBACK,type:exports.ResponseType.Error,url:url});return baseResponseOptions&&(responseOptions_1=baseResponseOptions.merge(responseOptions_1)),void responseObserver.error(new Response(responseOptions_1))}var responseOptions=new ResponseOptions({body:_this._responseData,url:url});_this.baseResponseOptions&&(responseOptions=_this.baseResponseOptions.merge(responseOptions)),responseObserver.next(new Response(responseOptions)),responseObserver.complete()}},onError=function(error){if(_this.readyState!==exports.ReadyState.Cancelled){_this.readyState=exports.ReadyState.Done,_dom.cleanup(script);var responseOptions=new ResponseOptions({body:error.message,type:exports.ResponseType.Error});baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))}};return script.addEventListener("load",onLoad),script.addEventListener("error",onError),_dom.send(script),function(){_this.readyState=exports.ReadyState.Cancelled,script.removeEventListener("load",onLoad),script.removeEventListener("error",onError),_this._dom.cleanup(script)}})}return __extends(JSONPConnection_,_super),JSONPConnection_.prototype.finished=function(data){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==exports.ReadyState.Cancelled&&(this._responseData=data)},JSONPConnection_}(JSONPConnection),JSONPBackend=function(_super){function JSONPBackend(){_super.apply(this,arguments)}return __extends(JSONPBackend,_super),JSONPBackend}(ConnectionBackend),JSONPBackend_=function(_super){function JSONPBackend_(_browserJSONP,_baseResponseOptions){_super.call(this),this._browserJSONP=_browserJSONP,this._baseResponseOptions=_baseResponseOptions}return __extends(JSONPBackend_,_super),JSONPBackend_.prototype.createConnection=function(request){return new JSONPConnection_(request,this._browserJSONP,this._baseResponseOptions)},JSONPBackend_.decorators=[{type:_angular_core.Injectable}],JSONPBackend_.ctorParameters=[{type:BrowserJsonp},{type:ResponseOptions}],JSONPBackend_}(JSONPBackend),XSSI_PREFIX=/^\)\]\}',?\n/,XHRConnection=function(){function XHRConnection(req,browserXHR,baseResponseOptions){var _this=this;this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){var _xhr=browserXHR.build();_xhr.open(exports.RequestMethod[req.method].toUpperCase(),req.url),null!=req.withCredentials&&(_xhr.withCredentials=req.withCredentials);var onLoad=function(){var status=1223===_xhr.status?204:_xhr.status,body=null;204!==status&&(body=null==_xhr.response?_xhr.responseText:_xhr.response,"string"==typeof body&&(body=body.replace(XSSI_PREFIX,""))),0===status&&(status=body?200:0);var headers=Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders()),url=getResponseURL(_xhr)||req.url,statusText=_xhr.statusText||"OK",responseOptions=new ResponseOptions({body:body,status:status,headers:headers,statusText:statusText,url:url});null!=baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions));var response=new Response(responseOptions);return response.ok=isSuccess(status),response.ok?(responseObserver.next(response),void responseObserver.complete()):void responseObserver.error(response)},onError=function(err){var responseOptions=new ResponseOptions({body:err,type:exports.ResponseType.Error,status:_xhr.status,statusText:_xhr.statusText});null!=baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))};if(_this.setDetectedContentType(req,_xhr),null!=req.headers&&req.headers.forEach(function(values,name){return _xhr.setRequestHeader(name,values.join(","))}),null!=req.responseType&&null!=_xhr.responseType)switch(req.responseType){case exports.ResponseContentType.ArrayBuffer:_xhr.responseType="arraybuffer";break;case exports.ResponseContentType.Json:_xhr.responseType="json";break;case exports.ResponseContentType.Text:_xhr.responseType="text";break;case exports.ResponseContentType.Blob:_xhr.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return _xhr.addEventListener("load",onLoad),_xhr.addEventListener("error",onError),_xhr.send(_this.request.getBody()),function(){_xhr.removeEventListener("load",onLoad),_xhr.removeEventListener("error",onError),_xhr.abort()}})}return XHRConnection.prototype.setDetectedContentType=function(req,_xhr){if(null==req.headers||null==req.headers.get("Content-Type"))switch(req.contentType){case ContentType.NONE:break;case ContentType.JSON:_xhr.setRequestHeader("content-type","application/json");break;case ContentType.FORM:_xhr.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case ContentType.TEXT:_xhr.setRequestHeader("content-type","text/plain");break;case ContentType.BLOB:var blob=req.blob();blob.type&&_xhr.setRequestHeader("content-type",blob.type)}},XHRConnection}(),CookieXSRFStrategy=function(){function CookieXSRFStrategy(_cookieName,_headerName){void 0===_cookieName&&(_cookieName="XSRF-TOKEN"),void 0===_headerName&&(_headerName="X-XSRF-TOKEN"),this._cookieName=_cookieName,this._headerName=_headerName}return CookieXSRFStrategy.prototype.configureRequest=function(req){var xsrfToken=_angular_platformBrowser.__platform_browser_private__.getDOM().getCookie(this._cookieName);xsrfToken&&req.headers.set(this._headerName,xsrfToken)},CookieXSRFStrategy}(),XHRBackend=function(){function XHRBackend(_browserXHR,_baseResponseOptions,_xsrfStrategy){this._browserXHR=_browserXHR,this._baseResponseOptions=_baseResponseOptions,this._xsrfStrategy=_xsrfStrategy}return XHRBackend.prototype.createConnection=function(request){return this._xsrfStrategy.configureRequest(request),new XHRConnection(request,this._browserXHR,this._baseResponseOptions)},XHRBackend.decorators=[{type:_angular_core.Injectable}],XHRBackend.ctorParameters=[{type:BrowserXhr},{type:ResponseOptions},{type:XSRFStrategy}],XHRBackend}(),__extends$3=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},RequestOptions=function(){function RequestOptions(_a){var _b=void 0===_a?{}:_a,method=_b.method,headers=_b.headers,body=_b.body,url=_b.url,search=_b.search,withCredentials=_b.withCredentials,responseType=_b.responseType;this.method=null!=method?normalizeMethodName(method):null,this.headers=null!=headers?headers:null,this.body=null!=body?body:null,this.url=null!=url?url:null,this.search=null!=search?"string"==typeof search?new URLSearchParams(search):search:null,this.withCredentials=null!=withCredentials?withCredentials:null,this.responseType=null!=responseType?responseType:null}return RequestOptions.prototype.merge=function(options){return new RequestOptions({method:options&&null!=options.method?options.method:this.method,headers:options&&null!=options.headers?options.headers:this.headers,body:options&&null!=options.body?options.body:this.body,url:options&&null!=options.url?options.url:this.url,search:options&&null!=options.search?"string"==typeof options.search?new URLSearchParams(options.search):options.search.clone():this.search,withCredentials:options&&null!=options.withCredentials?options.withCredentials:this.withCredentials,responseType:options&&null!=options.responseType?options.responseType:this.responseType})},RequestOptions}(),BaseRequestOptions=function(_super){function BaseRequestOptions(){_super.call(this,{method:exports.RequestMethod.Get,headers:new Headers})}return __extends$3(BaseRequestOptions,_super),BaseRequestOptions.decorators=[{type:_angular_core.Injectable}],BaseRequestOptions.ctorParameters=[],BaseRequestOptions}(RequestOptions),__extends$5=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Request=function(_super){function Request(requestOptions){_super.call(this);var url=requestOptions.url;if(this.url=requestOptions.url,requestOptions.search){var search=requestOptions.search.toString();if(search.length>0){var prefix="?";this.url.indexOf("?")!=-1&&(prefix="&"==this.url[this.url.length-1]?"":"&"),this.url=url+prefix+search}}this._body=requestOptions.body,this.method=normalizeMethodName(requestOptions.method),this.headers=new Headers(requestOptions.headers),this.contentType=this.detectContentType(),this.withCredentials=requestOptions.withCredentials,this.responseType=requestOptions.responseType}return __extends$5(Request,_super),Request.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return ContentType.JSON;case"application/x-www-form-urlencoded":return ContentType.FORM;case"multipart/form-data":return ContentType.FORM_DATA;case"text/plain":case"text/html":return ContentType.TEXT;case"application/octet-stream":return ContentType.BLOB;default:return this.detectContentTypeFromBody()}},Request.prototype.detectContentTypeFromBody=function(){return null==this._body?ContentType.NONE:this._body instanceof URLSearchParams?ContentType.FORM:this._body instanceof FormData?ContentType.FORM_DATA:this._body instanceof Blob$1?ContentType.BLOB:this._body instanceof ArrayBuffer$1?ContentType.ARRAY_BUFFER:this._body&&"object"==typeof this._body?ContentType.JSON:ContentType.TEXT},Request.prototype.getBody=function(){switch(this.contentType){case ContentType.JSON:return this.text();case ContentType.FORM:return this.text();case ContentType.FORM_DATA:return this._body;case ContentType.TEXT:return this.text();case ContentType.BLOB:return this.blob();case ContentType.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},Request}(Body),noop=function(){},w="object"==typeof window?window:noop,FormData=w.FormData||noop,Blob$1=w.Blob||noop,ArrayBuffer$1=w.ArrayBuffer||noop,__extends$4=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Http=function(){function Http(_backend,_defaultOptions){this._backend=_backend,this._defaultOptions=_defaultOptions}return Http.prototype.request=function(url,options){var responseObservable;if("string"==typeof url)responseObservable=httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url)));else{if(!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");responseObservable=httpRequest(this._backend,url)}return responseObservable},Http.prototype.get=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url)))},Http.prototype.post=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Post,url)))},Http.prototype.put=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Put,url)))},Http.prototype.delete=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Delete,url)))},Http.prototype.patch=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Patch,url)))},Http.prototype.head=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Head,url)))},Http.prototype.options=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Options,url)))},Http.decorators=[{type:_angular_core.Injectable}],Http.ctorParameters=[{type:ConnectionBackend},{type:RequestOptions}],Http}(),Jsonp=function(_super){function Jsonp(backend,defaultOptions){_super.call(this,backend,defaultOptions)}return __extends$4(Jsonp,_super),Jsonp.prototype.request=function(url,options){var responseObservable;if("string"==typeof url&&(url=new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url))),!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");if(url.method!==exports.RequestMethod.Get)throw new Error("JSONP requests must use GET request method.");return responseObservable=httpRequest(this._backend,url)},Jsonp.decorators=[{type:_angular_core.Injectable}],Jsonp.ctorParameters=[{type:ConnectionBackend},{type:RequestOptions}],Jsonp}(Http),HttpModule=function(){function HttpModule(){}return HttpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Http,useFactory:httpFactory,deps:[XHRBackend,RequestOptions]},BrowserXhr,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},XHRBackend,{provide:XSRFStrategy,useFactory:_createDefaultCookieXSRFStrategy}]}]}],HttpModule.ctorParameters=[],HttpModule}(),JsonpModule=function(){function JsonpModule(){}return JsonpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Jsonp,useFactory:jsonpFactory,deps:[JSONPBackend,RequestOptions]},BrowserJsonp,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},{provide:JSONPBackend,useClass:JSONPBackend_}]}]}],JsonpModule.ctorParameters=[],JsonpModule}();exports.BrowserXhr=BrowserXhr,exports.JSONPBackend=JSONPBackend,exports.JSONPConnection=JSONPConnection,exports.CookieXSRFStrategy=CookieXSRFStrategy,exports.XHRBackend=XHRBackend,exports.XHRConnection=XHRConnection,exports.BaseRequestOptions=BaseRequestOptions,exports.RequestOptions=RequestOptions,exports.BaseResponseOptions=BaseResponseOptions,exports.ResponseOptions=ResponseOptions,exports.Headers=Headers,exports.Http=Http,exports.Jsonp=Jsonp,exports.HttpModule=HttpModule,exports.JsonpModule=JsonpModule,exports.Connection=Connection,exports.ConnectionBackend=ConnectionBackend,exports.XSRFStrategy=XSRFStrategy,exports.Request=Request,exports.Response=Response,exports.QueryEncoder=QueryEncoder,exports.URLSearchParams=URLSearchParams});
{
"name": "@angular/http",
"version": "2.2.0",
"version": "2.2.1",
"description": "Angular - the http service",

@@ -12,4 +12,4 @@ "main": "bundles/http.umd.js",

"rxjs": "5.0.0-beta.12",
"@angular/core": "2.2.0",
"@angular/platform-browser": "2.2.0"
"@angular/core": "2.2.1",
"@angular/platform-browser": "2.2.1"
},

@@ -16,0 +16,0 @@ "repository": {

@@ -9,3 +9,2 @@ /**

import { Injectable } from '@angular/core';
import { global } from '../facade/lang';
var _nextRequestId = 0;

@@ -15,4 +14,5 @@ export var JSONP_HOME = '__ng_jsonp__';

function _getJsonpConnections() {
var w = typeof window == 'object' ? window : {};
if (_jsonpConnections === null) {
_jsonpConnections = global[JSONP_HOME] = {};
_jsonpConnections = w[JSONP_HOME] = {};
}

@@ -19,0 +19,0 @@ return _jsonpConnections;

@@ -17,3 +17,2 @@ /**

import { ReadyState, RequestMethod, ResponseType } from '../enums';
import { isPresent } from '../facade/lang';
import { ConnectionBackend } from '../interfaces';

@@ -68,3 +67,3 @@ import { Response } from '../static_response';

var responseOptions_1 = new ResponseOptions({ body: JSONP_ERR_NO_CALLBACK, type: ResponseType.Error, url: url });
if (isPresent(baseResponseOptions)) {
if (baseResponseOptions) {
responseOptions_1 = baseResponseOptions.merge(responseOptions_1);

@@ -76,3 +75,3 @@ }

var responseOptions = new ResponseOptions({ body: _this._responseData, url: url });
if (isPresent(_this.baseResponseOptions)) {
if (_this.baseResponseOptions) {
responseOptions = _this.baseResponseOptions.merge(responseOptions);

@@ -89,3 +88,3 @@ }

var responseOptions = new ResponseOptions({ body: error.message, type: ResponseType.Error });
if (isPresent(baseResponseOptions)) {
if (baseResponseOptions) {
responseOptions = baseResponseOptions.merge(responseOptions);

@@ -102,5 +101,3 @@ }

script.removeEventListener('error', onError);
if (isPresent(script)) {
_this._dom.cleanup(script);
}
_this._dom.cleanup(script);
};

@@ -107,0 +104,0 @@ });

@@ -13,3 +13,2 @@ /**

import { ContentType, RequestMethod, ResponseContentType, ResponseType } from '../enums';
import { isPresent } from '../facade/lang';
import { Headers } from '../headers';

@@ -38,3 +37,3 @@ import { getResponseURL, isSuccess } from '../http_utils';

_xhr.open(RequestMethod[req.method].toUpperCase(), req.url);
if (isPresent(req.withCredentials)) {
if (req.withCredentials != null) {
_xhr.withCredentials = req.withCredentials;

@@ -44,13 +43,16 @@ }

var onLoad = function () {
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
// response/responseType properties were introduced in ResourceLoader Level2 spec (supported
// by IE10)
var body = _xhr.response === undefined ? _xhr.responseText : _xhr.response;
// Implicitly strip a potential XSSI prefix.
if (typeof body === 'string')
body = body.replace(XSSI_PREFIX, '');
var headers = Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders());
var url = getResponseURL(_xhr);
// normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
var status = _xhr.status === 1223 ? 204 : _xhr.status;
var body = null;
// HTTP 204 means no content
if (status !== 204) {
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
// response/responseType properties were introduced in ResourceLoader Level2 spec
// (supported by IE10)
body = _xhr.response == null ? _xhr.responseText : _xhr.response;
// Implicitly strip a potential XSSI prefix.
if (typeof body === 'string') {
body = body.replace(XSSI_PREFIX, '');
}
}
// fix status code when it is 0 (0 status is undocumented).

@@ -62,5 +64,8 @@ // Occurs when accessing file resources or on Android 4.1 stock browser

}
var headers = Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders());
// IE 9 does not provide the way to get URL of response
var url = getResponseURL(_xhr) || req.url;
var statusText = _xhr.statusText || 'OK';
var responseOptions = new ResponseOptions({ body: body, status: status, headers: headers, statusText: statusText, url: url });
if (isPresent(baseResponseOptions)) {
if (baseResponseOptions != null) {
responseOptions = baseResponseOptions.merge(responseOptions);

@@ -86,3 +91,3 @@ }

});
if (isPresent(baseResponseOptions)) {
if (baseResponseOptions != null) {
responseOptions = baseResponseOptions.merge(responseOptions);

@@ -93,7 +98,7 @@ }

_this.setDetectedContentType(req, _xhr);
if (isPresent(req.headers)) {
if (req.headers != null) {
req.headers.forEach(function (values, name) { return _xhr.setRequestHeader(name, values.join(',')); });
}
// Select the correct buffer type to store the response
if (isPresent(req.responseType) && isPresent(_xhr.responseType)) {
if (req.responseType != null && _xhr.responseType != null) {
switch (req.responseType) {

@@ -126,5 +131,5 @@ case ResponseContentType.ArrayBuffer:

}
XHRConnection.prototype.setDetectedContentType = function (req /** TODO #9100 */, _xhr /** TODO #9100 */) {
XHRConnection.prototype.setDetectedContentType = function (req /** TODO Request */, _xhr /** XMLHttpRequest */) {
// Skip if a custom Content-Type header is provided
if (isPresent(req.headers) && isPresent(req.headers.get('Content-Type'))) {
if (req.headers != null && req.headers.get('Content-Type') != null) {
return;

@@ -131,0 +136,0 @@ }

@@ -14,3 +14,2 @@ /**

import { Injectable } from '@angular/core';
import { isPresent } from '../src/facade/lang';
import { RequestMethod } from './enums';

@@ -49,12 +48,10 @@ import { Headers } from './headers';

var _b = _a === void 0 ? {} : _a, method = _b.method, headers = _b.headers, body = _b.body, url = _b.url, search = _b.search, withCredentials = _b.withCredentials, responseType = _b.responseType;
this.method = isPresent(method) ? normalizeMethodName(method) : null;
this.headers = isPresent(headers) ? headers : null;
this.body = isPresent(body) ? body : null;
this.url = isPresent(url) ? url : null;
this.search = isPresent(search) ?
(typeof search === 'string' ? new URLSearchParams((search)) :
(search)) :
null;
this.withCredentials = isPresent(withCredentials) ? withCredentials : null;
this.responseType = isPresent(responseType) ? responseType : null;
this.method = method != null ? normalizeMethodName(method) : null;
this.headers = headers != null ? headers : null;
this.body = body != null ? body : null;
this.url = url != null ? url : null;
this.search =
search != null ? (typeof search === 'string' ? new URLSearchParams(search) : search) : null;
this.withCredentials = withCredentials != null ? withCredentials : null;
this.responseType = responseType != null ? responseType : null;
}

@@ -88,13 +85,13 @@ /**

return new RequestOptions({
method: options && isPresent(options.method) ? options.method : this.method,
headers: options && isPresent(options.headers) ? options.headers : this.headers,
body: options && isPresent(options.body) ? options.body : this.body,
url: options && isPresent(options.url) ? options.url : this.url,
search: options && isPresent(options.search) ?
method: options && options.method != null ? options.method : this.method,
headers: options && options.headers != null ? options.headers : this.headers,
body: options && options.body != null ? options.body : this.body,
url: options && options.url != null ? options.url : this.url,
search: options && options.search != null ?
(typeof options.search === 'string' ? new URLSearchParams(options.search) :
(options.search).clone()) :
options.search.clone()) :
this.search,
withCredentials: options && isPresent(options.withCredentials) ? options.withCredentials :
withCredentials: options && options.withCredentials != null ? options.withCredentials :
this.withCredentials,
responseType: options && isPresent(options.responseType) ? options.responseType :
responseType: options && options.responseType != null ? options.responseType :
this.responseType

@@ -101,0 +98,0 @@ });

@@ -14,3 +14,2 @@ /**

import { Injectable } from '@angular/core';
import { isPresent } from '../src/facade/lang';
import { ResponseType } from './enums';

@@ -49,8 +48,8 @@ import { Headers } from './headers';

var _b = _a === void 0 ? {} : _a, body = _b.body, status = _b.status, headers = _b.headers, statusText = _b.statusText, type = _b.type, url = _b.url;
this.body = isPresent(body) ? body : null;
this.status = isPresent(status) ? status : null;
this.headers = isPresent(headers) ? headers : null;
this.statusText = isPresent(statusText) ? statusText : null;
this.type = isPresent(type) ? type : null;
this.url = isPresent(url) ? url : null;
this.body = body != null ? body : null;
this.status = status != null ? status : null;
this.headers = headers != null ? headers : null;
this.statusText = statusText != null ? statusText : null;
this.type = type != null ? type : null;
this.url = url != null ? url : null;
}

@@ -84,9 +83,8 @@ /**

return new ResponseOptions({
body: isPresent(options) && isPresent(options.body) ? options.body : this.body,
status: isPresent(options) && isPresent(options.status) ? options.status : this.status,
headers: isPresent(options) && isPresent(options.headers) ? options.headers : this.headers,
statusText: isPresent(options) && isPresent(options.statusText) ? options.statusText :
this.statusText,
type: isPresent(options) && isPresent(options.type) ? options.type : this.type,
url: isPresent(options) && isPresent(options.url) ? options.url : this.url,
body: options && options.body != null ? options.body : this.body,
status: options && options.status != null ? options.status : this.status,
headers: options && options.headers != null ? options.headers : this.headers,
statusText: options && options.statusText != null ? options.statusText : this.statusText,
type: options && options.type != null ? options.type : this.type,
url: options && options.url != null ? options.url : this.url,
});

@@ -93,0 +91,0 @@ };

@@ -8,3 +8,3 @@ /**

*/
import { isJsObject, stringToArrayBuffer } from './http_utils';
import { stringToArrayBuffer } from './http_utils';
import { URLSearchParams } from './url_search_params';

@@ -43,3 +43,3 @@ /**

}
if (isJsObject(this._body)) {
if (typeof this._body === 'object') {
return JSON.stringify(this._body, null, 2);

@@ -46,0 +46,0 @@ }

@@ -13,2 +13,1 @@ /**

export declare function stringToArrayBuffer(input: String): ArrayBuffer;
export { isJsObject } from '../src/facade/lang';

@@ -47,3 +47,2 @@ /**

}
export { isJsObject } from '../src/facade/lang';
//# sourceMappingURL=http_utils.js.map

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"isSuccess":{"__symbolic":"error","message":"Function call not supported","line":32,"character":25}},"exports":[{"from":"../src/facade/lang","export":["isJsObject"]}]}
{"__symbolic":"module","version":1,"metadata":{"isSuccess":{"__symbolic":"error","message":"Function call not supported","line":32,"character":25}}}

@@ -14,3 +14,2 @@ /**

import { Injectable } from '@angular/core';
import { isPresent } from '../src/facade/lang';
import { RequestOptions } from './base_request_options';

@@ -25,3 +24,3 @@ import { RequestMethod } from './enums';

var newOptions = defaultOpts;
if (isPresent(providedOpts)) {
if (providedOpts) {
// Hack so Dart can used named parameters

@@ -38,8 +37,3 @@ return newOptions.merge(new RequestOptions({

}
if (isPresent(method)) {
return newOptions.merge(new RequestOptions({ method: method, url: url }));
}
else {
return newOptions.merge(new RequestOptions({ url: url }));
}
return newOptions.merge(new RequestOptions({ method: method, url: url }));
}

@@ -46,0 +40,0 @@ /**

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Body } from './body';

@@ -2,0 +9,0 @@ import { ContentType, RequestMethod, ResponseContentType } from './enums';

@@ -13,3 +13,2 @@ /**

};
import { isPresent } from '../src/facade/lang';
import { Body } from './body';

@@ -67,3 +66,3 @@ import { ContentType } from './enums';

this.url = requestOptions.url;
if (isPresent(requestOptions.search)) {
if (requestOptions.search) {
var search = requestOptions.search.toString();

@@ -83,3 +82,2 @@ if (search.length > 0) {

// Defaults to 'omit', consistent with browser
// TODO(jeffbcross): implement behavior
this.headers = new Headers(requestOptions.headers);

@@ -86,0 +84,0 @@ this.contentType = this.detectContentType();

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc