text: /**
  * @author Jason Dobry <jason.dobry@gmail.com>
  * @file js-data-http.min.js
  * @version 0.3.0 - Homepage <http://wwwjs-data.io/js-data-http>
  * @copyright (c) 2014 Jason Dobry
  * @license MIT <https://github.com/js-data/js-data-http/blob/master/LICENSE>
  *
  * @overview My Adapter.
  */
  !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.DSHttpAdapter=a()}}(function(){return 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);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){b.exports=a("./lib/axios")},{"./lib/axios":3}],2:[function(a,b){var c=a("./../buildUrl"),d=a("./../cookies"),e=a("./../defaults"),f=a("./../parseHeaders"),g=a("./../transformData"),h=a("./../urlIsSameOrigin"),i=a("./../utils");b.exports=function(a,b,j){var k=g(j.data,j.headers,j.transformRequest),l=i.merge(e.headers.common,e.headers[j.method]||{},j.headers||{}),m=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");m.open(j.method,c(j.url,j.params),!0),m.onreadystatechange=function(){if(m&&4===m.readyState){var c=f(m.getAllResponseHeaders()),d={data:g(m.responseText,c,j.transformResponse),status:m.status,headers:c,config:j};(m.status>=200&&m.status<300?a:b)(d),m=null}};var n=h(j.url)?d.read(j.xsrfCookieName||e.xsrfCookieName):void 0;if(n&&(l[j.xsrfHeaderName||e.xsrfHeaderName]=n),i.forEach(l,function(a,b){k||"content-type"!==b.toLowerCase()?m.setRequestHeader(b,a):delete l[b]}),j.withCredentials&&(m.withCredentials=!0),j.responseType)try{m.responseType=j.responseType}catch(o){if("json"!==m.responseType)throw o}m.send(k)}},{"./../buildUrl":4,"./../cookies":5,"./../defaults":6,"./../parseHeaders":7,"./../transformData":9,"./../urlIsSameOrigin":10,"./../utils":11}],3:[function(a,b){(function(c){function d(){h.forEach(arguments,function(a){j[a]=function(b,c){return j(h.merge(c||{},{method:a,url:b}))}})}function e(){h.forEach(arguments,function(a){j[a]=function(b,c,d){return j(h.merge(d||{},{method:a,url:b,data:c}))}})}var f=a("es6-promise").Promise,g=a("./defaults"),h=a("./utils"),i=a("./spread"),j=b.exports=function(b){b=h.merge({method:"get",transformRequest:g.transformRequest,transformResponse:g.transformResponse},b),b.withCredentials=b.withCredentials||g.withCredentials;var d=new f(function(d,e){try{"undefined"!=typeof window?a("./adapters/xhr")(d,e,b):"undefined"!=typeof c&&a("./adapters/http")(d,e,b)}catch(f){e(f)}});return d.success=function(a){return d.then(function(b){a(b.data,b.status,b.headers,b.config)}),d},d.error=function(a){return d.then(null,function(b){a(b.data,b.status,b.headers,b.config)}),d},d};j.defaults=g,j.all=function(a){return f.all(a)},j.spread=i,d("delete","get","head"),e("post","put","patch")}).call(this,a("_process"))},{"./adapters/http":2,"./adapters/xhr":2,"./defaults":6,"./spread":8,"./utils":11,_process:22,"es6-promise":12}],4:[function(a,b){"use strict";function c(a){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var d=a("./utils");b.exports=function(a,b){if(!b)return a;var e=[];return d.forEach(b,function(a,b){null!==a&&"undefined"!=typeof a&&(d.isArray(a)||(a=[a]),d.forEach(a,function(a){d.isDate(a)?a=a.toISOString():d.isObject(a)&&(a=JSON.stringify(a)),e.push(c(b)+"="+c(a))}))}),e.length>0&&(a+=(-1===a.indexOf("?")?"?":"&")+e.join("&")),a}},{"./utils":11}],5:[function(a,b){"use strict";var c=a("./utils");b.exports={write:function(a,b,d,e,f,g){var h=[];h.push(a+"="+encodeURIComponent(b)),c.isNumber(d)&&h.push("expires="+new Date(d).toGMTString()),c.isString(e)&&h.push("path="+e),c.isString(f)&&h.push("domain="+f),g===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(a){var b=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return b?decodeURIComponent(b[3]):null},remove:function(a){this.write(a,"",Date.now()-864e5)}}},{"./utils":11}],6:[function(a,b){"use strict";var c=a("./utils"),d=/^\s*(\[|\{[^\{])/,e=/[\}\]]\s*$/,f=/^\)\]\}',?\n/,g={"Content-Type":"application/json;charset=utf-8"};b.exports={transformRequest:[function(a){return!c.isObject(a)||c.isFile(a)||c.isBlob(a)?a:JSON.stringify(a)}],transformResponse:[function(a){return"string"==typeof a&&(a=a.replace(f,""),d.test(a)&&e.test(a)&&(a=JSON.parse(a))),a}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:c.merge(g),post:c.merge(g),put:c.merge(g)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},{"./utils":11}],7:[function(a,b){"use strict";var c=a("./utils");b.exports=function(a){var b,d,e,f={};return a?(c.forEach(a.split("\n"),function(a){e=a.indexOf(":"),b=c.trim(a.substr(0,e)).toLowerCase(),d=c.trim(a.substr(e+1)),b&&(f[b]=f[b]?f[b]+", "+d:d)}),f):f}},{"./utils":11}],8:[function(a,b){b.exports=function(a){return function(b){a.apply(null,b)}}},{}],9:[function(a,b){"use strict";var c=a("./utils");b.exports=function(a,b,d){return c.forEach(d,function(c){a=c(a,b)}),a}},{"./utils":11}],10:[function(a,b){"use strict";function c(a){var b=a;return d&&(f.setAttribute("href",b),b=f.href),f.setAttribute("href",b),{href:f.href,protocol:f.protocol?f.protocol.replace(/:$/,""):"",host:f.host,search:f.search?f.search.replace(/^\?/,""):"",hash:f.hash?f.hash.replace(/^#/,""):"",hostname:f.hostname,port:f.port,pathname:"/"===f.pathname.charAt(0)?f.pathname:"/"+f.pathname}}var d=/(msie|trident)/i.test(navigator.userAgent),e=a("./utils"),f=document.createElement("a"),g=c(window.location.href);b.exports=function(a){var b=e.isString(a)?c(a):a;return b.protocol===g.protocol&&b.host===g.host}},{"./utils":11}],11:[function(a,b){function c(a){return"[object Array]"===m.call(a)}function d(a){return"string"==typeof a}function e(a){return"number"==typeof a}function f(a){return null!==a&&"object"==typeof a}function g(a){return"[object Date]"===m.call(a)}function h(a){return"[object File]"===m.call(a)}function i(a){return"[object Blob]"===m.call(a)}function j(a){return a.replace(/^\s*/,"").replace(/\s*$/,"")}function k(a,b){if(null!==a&&"undefined"!=typeof a){var c=a.constructor===Array||"function"==typeof a.callee;if("object"==typeof a||c||(a=[a]),c)for(var d=0,e=a.length;e>d;d++)b.call(null,a[d],d,a);else for(var f in a)a.hasOwnProperty(f)&&b.call(null,a[f],f,a)}}function l(){var a={};return k(arguments,function(b){k(b,function(b,c){a[c]=b})}),a}var m=Object.prototype.toString;b.exports={isArray:c,isString:d,isNumber:e,isObject:f,isDate:g,isFile:h,isBlob:i,forEach:k,merge:l,trim:j}},{}],12:[function(a,b,c){"use strict";var d=a("./promise/promise").Promise,e=a("./promise/polyfill").polyfill;c.Promise=d,c.polyfill=e},{"./promise/polyfill":16,"./promise/promise":17}],13:[function(a,b,c){"use strict";function d(a){var b=this;if(!e(a))throw new TypeError("You must pass an array to all.");return new b(function(b,c){function d(a){return function(b){e(a,b)}}function e(a,c){h[a]=c,0===--i&&b(h)}var g,h=[],i=a.length;0===i&&b([]);for(var j=0;j<a.length;j++)g=a[j],g&&f(g.then)?g.then(d(j),c):e(j,g)})}var e=a("./utils").isArray,f=a("./utils").isFunction;c.all=d},{"./utils":21}],14:[function(a,b,c){(function(a,b){"use strict";function d(){return function(){a.nextTick(g)}}function e(){var a=0,b=new k(g),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function f(){return function(){l.setTimeout(g,1)}}function g(){for(var a=0;a<m.length;a++){var b=m[a],c=b[0],d=b[1];c(d)}m=[]}function h(a,b){var c=m.push([a,b]);1===c&&i()}var i,j="undefined"!=typeof window?window:{},k=j.MutationObserver||j.WebKitMutationObserver,l="undefined"!=typeof b?b:void 0===this?window:this,m=[];i="undefined"!=typeof a&&"[object process]"==={}.toString.call(a)?d():k?e():f(),c.asap=h}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:22}],15:[function(a,b,c){"use strict";function d(a,b){return 2!==arguments.length?e[a]:void(e[a]=b)}var e={instrument:!1};c.config=e,c.configure=d},{}],16:[function(a,b,c){(function(b){"use strict";function d(){var a;a="undefined"!=typeof b?b:"undefined"!=typeof window&&window.document?window:self;var c="Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var b;return new a.Promise(function(a){b=a}),f(b)}();c||(a.Promise=e)}var e=a("./promise").Promise,f=a("./utils").isFunction;c.polyfill=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./promise":17,"./utils":21}],17:[function(a,b,c){"use strict";function d(a){if(!q(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof d))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],e(a,this)}function e(a,b){function c(a){j(b,a)}function d(a){l(b,a)}try{a(c,d)}catch(e){d(e)}}function f(a,b,c,d){var e,f,g,h,k=q(c);if(k)try{e=c(d),g=!0}catch(m){h=!0,f=m}else e=d,g=!0;i(b,e)||(k&&g?j(b,e):h?l(b,f):a===y?j(b,e):a===z&&l(b,e))}function g(a,b,c,d){var e=a._subscribers,f=e.length;e[f]=b,e[f+y]=c,e[f+z]=d}function h(a,b){for(var c,d,e=a._subscribers,g=a._detail,h=0;h<e.length;h+=3)c=e[h],d=e[h+b],f(b,c,d,g);a._subscribers=null}function i(a,b){var c,d=null;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(p(b)&&(d=b.then,q(d)))return d.call(b,function(d){return c?!0:(c=!0,void(b!==d?j(a,d):k(a,d)))},function(b){return c?!0:(c=!0,void l(a,b))}),!0}catch(e){return c?!0:(l(a,e),!0)}return!1}function j(a,b){a===b?k(a,b):i(a,b)||k(a,b)}function k(a,b){a._state===w&&(a._state=x,a._detail=b,o.async(m,a))}function l(a,b){a._state===w&&(a._state=x,a._detail=b,o.async(n,a))}function m(a){h(a,a._state=y)}function n(a){h(a,a._state=z)}var o=a("./config").config,p=(a("./config").configure,a("./utils").objectOrFunction),q=a("./utils").isFunction,r=(a("./utils").now,a("./all").all),s=a("./race").race,t=a("./resolve").resolve,u=a("./reject").reject,v=a("./asap").asap;o.async=v;var w=void 0,x=0,y=1,z=2;d.prototype={constructor:d,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(a,b){var c=this,d=new this.constructor(function(){});if(this._state){var e=arguments;o.async(function(){f(c._state,d,e[c._state-1],c._detail)})}else g(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}},d.all=r,d.race=s,d.resolve=t,d.reject=u,c.Promise=d},{"./all":13,"./asap":14,"./config":15,"./race":18,"./reject":19,"./resolve":20,"./utils":21}],18:[function(a,b,c){"use strict";function d(a){var b=this;if(!e(a))throw new TypeError("You must pass an array to race.");return new b(function(b,c){for(var d,e=0;e<a.length;e++)d=a[e],d&&"function"==typeof d.then?d.then(b,c):b(d)})}var e=a("./utils").isArray;c.race=d},{"./utils":21}],19:[function(a,b,c){"use strict";function d(a){var b=this;return new b(function(b,c){c(a)})}c.reject=d},{}],20:[function(a,b,c){"use strict";function d(a){if(a&&"object"==typeof a&&a.constructor===this)return a;var b=this;return new b(function(b){b(a)})}c.resolve=d},{}],21:[function(a,b,c){"use strict";function d(a){return e(a)||"object"==typeof a&&null!==a}function e(a){return"function"==typeof a}function f(a){return"[object Array]"===Object.prototype.toString.call(a)}var g=Date.now||function(){return(new Date).getTime()};c.objectOrFunction=d,c.isFunction=e,c.isArray=f,c.now=g},{}],22:[function(a,b){function c(){}var d=b.exports={};d.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)}}(),d.title="browser",d.browser=!0,d.env={},d.argv=[],d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(){throw new Error("process.chdir is not supported")}},{}],23:[function(a,b){function c(){}function d(a){this.defaults=new c,g(this.defaults,a)}var e;e=!window&&"undefined"!=typeof b&&b.exports?a("js-data"):window.JSData;var f=e.DSUtils.makePath,g=e.DSUtils.deepMixIn,h=a("axios"),i=c.prototype;i.queryTransform=function(a,b){return b},i.httpConfig={},i.log=console?console.log:function(){},i.deserialize=function(a,b){return b&&"data"in b?b.data:b},i.serialize=function(a,b){return b};var j=d.prototype;j.HTTP=function(a){var b=this,c=(new Date).getTime();return a=g(a,this.defaults.httpConfig),h(a).then(function(a){if(b.defaults.log){var d=Array.prototype.slice.call(arguments);d.unshift(a.config.method+" request: "+a.config.url+" Time taken: "+((new Date).getTime()-c)+"ms"),b.defaults.log.apply(b.defaults.log,d)}return a})},j.GET=function(a,b){return b=b||{},"method"in b||(b.method="get"),this.HTTP(g(b,{url:a}))},j.POST=function(a,b,c){return c=c||{},"method"in c||(c.method="post"),this.HTTP(g(c,{url:a,data:b}))},j.PUT=function(a,b,c){return c=c||{},"method"in c||(c.method="put"),this.HTTP(g(c,{url:a,data:b||{}}))},j.DEL=function(a,b){return b=b||{},"method"in b||(b.method="delete"),this.HTTP(g(b,{url:a}))},j.find=function(a,b,c){var d=this;return c=c||{},d.GET(f(c.baseUrl||a.baseUrl,a.getEndpoint(b,c),b),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a.name,b)})},j.findAll=function(a,b,c){var d=this;return c=c||{},c.params=c.params||{},b&&(b=d.defaults.queryTransform(a.name,b),g(c.params,b)),d.GET(f(c.baseUrl||a.baseUrl,a.getEndpoint(null,c)),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a.name,b)})},j.create=function(a,b,c){var d=this;return c=c||{},d.POST(f(c.baseUrl||a.baseUrl,a.getEndpoint(b,c)),c.serialize?c.serialize(a.name,b):d.defaults.serialize(a.name,b),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a.name,b)})},j.update=function(a,b,c,d){var e=this;return d=d||{},e.PUT(f(d.baseUrl||a.baseUrl,a.getEndpoint(b,d),b),d.serialize?d.serialize(a.name,c):e.defaults.serialize(a.name,c),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a.name,b)})},j.updateAll=function(a,b,c,d){var e=this;return d=d||{},d.params=d.params||{},c&&(c=e.defaults.queryTransform(a.name,c),g(d.params,c)),this.PUT(f(d.baseUrl||a.baseUrl,a.getEndpoint(null,d)),d.serialize?d.serialize(a.name,b):e.defaults.serialize(a.name,b),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a.name,b)})},j.destroy=function(a,b,c){var d=this;return c=c||{},d.DEL(f(c.baseUrl||a.baseUrl,a.getEndpoint(b,c),b),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a.name,b)})},j.destroyAll=function(a,b,c){var d=this;return c=c||{},c.params=c.params||{},b&&(b=d.defaults.queryTransform(a.name,b),g(c.params,b)),this.DEL(f(c.baseUrl||a.baseUrl,a.getEndpoint(null,c)),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a.name,b)})},b.exports=d},{axios:1,"js-data":"js-data"}]},{},[23])(23)});