doipjs/dist/doip.min.js

2 lines
174 KiB
JavaScript
Raw Normal View History

2022-03-27 16:37:33 -06:00
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).doip=e()}}((function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};t[a][0].call(c.exports,(function(e){return i(t[a][1][e]||e)}),c,c.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){t.exports=e("./lib/axios")},{"./lib/axios":3}],2:[function(e,t,r){"use strict";var n=e("./../utils"),i=e("./../core/settle"),o=e("./../helpers/cookies"),a=e("./../helpers/buildURL"),s=e("../core/buildFullPath"),u=e("./../helpers/parseHeaders"),l=e("./../helpers/isURLSameOrigin"),c=e("../core/createError"),d=e("../defaults"),f=e("../cancel/Cancel");t.exports=function(e){return new Promise((function(t,r){var p,h=e.data,m=e.headers,g=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(h)&&delete m["Content-Type"];var b=new XMLHttpRequest;if(e.auth){var y=e.auth.username||"",S=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(y+":"+S)}var A=s(e.baseURL,e.url);function _(){if(b){var n="getAllResponseHeaders"in b?u(b.getAllResponseHeaders()):null,o={data:g&&"text"!==g&&"json"!==g?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:n,config:e,request:b};i((function(e){t(e),v()}),(function(e){r(e),v()}),o),b=null}}if(b.open(e.method.toUpperCase(),a(A,e.params,e.paramsSerializer),!0),b.timeout=e.timeout,"onloadend"in b?b.onloadend=_:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(_)},b.onabort=function(){b&&(r(c("Request aborted",e,"ECONNABORTED",b)),b=null)},b.onerror=function(){r(c("Network Error",e,null,b)),b=null},b.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||d.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(c(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},n.isStandardBrowserEnv()){var E=(e.withCredentials||l(A))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;E&&(m[e.xsrfHeaderName]=E)}"setRequestHeader"in b&&n.forEach(m,(function(e,t){void 0===h&&"content-type"===t.toLowerCase()?delete m[t]:b.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(b.withCredentials=!!e.withCredentials),g&&"json"!==g&&(b.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&b.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){b&&(r(!e||e&&e.type?new f("canceled"):e),b.abort(),b=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),h||(h=null),b.send(h)}))}},{"../cancel/Cancel":4,"../core/buildFullPath":9,"../core/createError":10,"../defaults":16,"./../core/settle":14,"./../helpers/buildURL":19,"./../helpers/cookies":21,"./../helpers/isURLSameOrigin":24,"./../helpers/parseHeaders":26,"./../utils":29}],3:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./helpers/bind"),o=e("./core/Axios"),a=e("./core/mergeConfig");var s=function e(t){var r=new o(t),s=i(o.prototype.request,r);return n.extend(s,o.prototype,r),n.extend(s,r),s.create=function(r){return e(a(t,r))},s}(e("./defaults"));s.Axios=o,s.Cancel=e("./cancel/Cancel"),s.CancelToken=e("./cancel/CancelToken"),s.isCancel=e("./cancel/isCancel"),s.VERSION=e("./env/data").version,s.all=function(e){return Promise.all(e)},s.spread=e("./helpers/spread"),s.isAxiosError=e("./helpers/isAxiosError"),t.exports=s,t.expor