UNPKG

cyl-hooks-tools

Version:

基于react上下文实现的权限管理

2 lines 20.4 kB
/*! For license information please see index.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("pullstate"),require("axios")):"function"==typeof define&&define.amd?define(["react","pullstate","axios"],e):"object"==typeof exports?exports.cylHooksTools=e(require("react"),require("pullstate"),require("axios")):t.cylHooksTools=e(t.react,t.pullstate,t.axios)}(self,((t,e,r)=>(()=>{"use strict";var n={240:(t,e,r)=>{r.d(e,{default:()=>u});var n=r(156);function o(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function a(t){setTimeout(t,0)}function c(t,e){var r,n,i=function(){},a=!1,c=t.apply(void 0,[function(){return r}].concat(o(e)));return function t(e,r,o){var u,l;try{if(e){var f=c.return();u=f.value,l=f.done}else if(r){var s=c.throw(r);u=s.value,l=s.done}else{var p=c.next(o);u=p.value,l=p.done}}catch(t){return void console.warn("Uncaught exception in useCo",t)}if(l)return a=!0,void(n=u);var h=!1;Promise.resolve(u).then((function(e){h||t(!1,void 0,e)})).catch((function(e){h||t(!1,e,void 0)})),i=function(){h||(h=!0,t(!0,void 0,void 0))}}(!1,void 0,void 0),function(){a?"function"==typeof n&&n():(r=!0,i())}}const u={useCoEffect:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("function"!=typeof t||"GeneratorFunction"!==(t.constructor.displayName||t.constructor.name))throw new Error("useCo only accepts generator function");(0,n.useEffect)((function(){var e=c(t,[]);return function(){return a((function(){return e()}))}}),e)},useCoCallback:function(t,e){if("function"!=typeof t||"GeneratorFunction"!==(t.constructor.displayName||t.constructor.name))throw new Error("useCoCallback only accepts generator function");var r=(0,n.useRef)((function(){}));return(0,n.useEffect)((function(){return function(){return a((function(){return r.current()}))}}),e),(0,n.useCallback)((function(){r.current();for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];r.current=c(t,n)}),e)}}},853:(t,e,r)=>{function n(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){u=!0,a=t},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e){var r,n={"Y+":e.getFullYear().toString(),"m+":(e.getMonth()+1).toString(),"d+":e.getDate().toString(),"H+":e.getHours().toString(),"M+":e.getMinutes().toString(),"S+":e.getSeconds().toString()};for(var o in n)(r=new RegExp("("+o+")").exec(t))&&(t=t.replace(r[1],1==r[1].length?n[o]:n[o].padStart(r[1].length,"0")));return t}r.d(e,{default:()=>u});const u={parseJsonGraceful:function(t){try{return JSON.parse(t)}catch(t){return null}},sleep:function(t){return new Promise((function(e){return setTimeout(e,t)}))},logger:{info:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"blue",n=new Date(e);console.info("%c".concat(c("YYYY-mm-dd HH:MM:SS",n)," INFO: "),"color: ".concat(r,";"),t)},error:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"red",n=new Date(e);console.error("%c".concat(c("YYYY-mm-dd HH:MM:SS",n)," ERROR: "),"color: ".concat(r,";"),t)},warn:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"black",n=new Date(e);console.warn("%c".concat(c("YYYY-mm-dd HH:MM:SS",n)," WARN: "),"color: ".concat(r,";"),t)},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),r=new Date(e);console.log("".concat(c("YYYY-mm-dd HH:MM:SS",r),": "),t)},success:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"green",n=new Date(e);console.log("%c".concat(c("YYYY-mm-dd HH:MM:SS",n)," SUCCESS: "),"color: ".concat(r,";"),t)}},makeFriendly:function(t){return t>=1e8?t=Math.round(t/1e7)/10+"亿":t>=1e4&&(t=Math.round(t/1e3)/10+"万"),t},formatSeconds:function(t){if("number"!=typeof t)throw new Error("value需要number类型");var e=parseInt(t),r=0,n=0;e>60&&(r=parseInt(e/60),e=parseInt(e%60),r>60&&(n=parseInt(r/60),r=parseInt(r%60)));var o=parseInt(e)+"秒";return r>0&&(o=parseInt(r)+"分"+o),n>0&&(o=parseInt(n)+"小时"+o),o},Uint8ArrayToString:function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},dataSourceSliceOfECharts:function(t,e){var r,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,c=arguments.length>3?arguments[3]:void 0,u=0,l=[],f=o(t);try{var s=function(){var t=i.value;if(null==t||!t.timeStamp)throw new Error("no timeStamp"+JSON.stringify(t));var o=Math.round(t.timeStamp/1e3);if(0===u){var a;l.push([1e3*o].concat(n(null===(a=e(t,u,o))||void 0===a?void 0:a.map((function(e){return t[e]})))))}else{for(var c,f=u+1;f<o;f++){var s;l.push([1e3*f].concat(n(null===(s=e(r,f,o))||void 0===s?void 0:s.map((function(e){return t[e]})))))}l.push([1e3*o].concat(n(null===(c=e(t,u,o))||void 0===c?void 0:c.map((function(e){return t[e]})))))}u=o,r=t};for(f.s();!(i=f.n()).done;)s()}catch(t){f.e(t)}finally{f.f()}if(l.length>a)l=l.slice(l.length-a),c&&c(l,l.length-a);else if(l.length<a)for(var p=l.length;p<a;p++)u+=1,l.push([1e3*u,null]);return l},ninePath:function(t,e){var r=t.scale||2;return{"border-image-slice":"".concat(t.top," ").concat(t.right," ").concat(t.bottom," ").concat(t.left," fill"),"border-image-width":"".concat(t.top/r,"px ").concat(t.right/r,"px ").concat(t.bottom/r,"px ").concat(t.left/r,"px"),"border-image-outset":"0px 0px 0px 0px","border-image-repeat":"stretch stretch","border-image-source":"url(".concat(t.source,")"),"border-width":"".concat(e.top/r,"px ").concat(e.right/r,"px ").concat(e.bottom/r,"px ").concat(e.left/r,"px"),"border-style":"solid","box-sizing":"border-box","min-width":"".concat((t.left+t.right)/r,"px"),"min-height":"".concat((t.top+t.bottom)/r,"px")}}}},300:t=>{t.exports=r},331:t=>{t.exports=e},156:e=>{e.exports=t}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a={};return(()=>{i.d(a,{default:()=>O});var t=i(156),e=i.n(t),r=i(853),n=i(331);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}var f=r.default.logger;function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function p(){p=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new A(o||[]);return n(a,"_invoke",{value:x(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function d(){}function y(){}function v(){}var g={};u(g,i,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(P([])));b&&b!==e&&r.call(b,i)&&(g=b);var w=v.prototype=d.prototype=Object.create(g);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(n,i,a,c){var u=f(t[n],t,i);if("throw"!==u.type){var l=u.arg,p=l.value;return p&&"object"==s(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(p).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=j(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=f(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function j(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=f(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return y.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:y,configurable:!0}),y.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(w),u(w,c,"Generator"),u(w,i,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var y=i(240).default.useCoEffect,v=e().createContext(null);var g=i(300);function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){w(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function w(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var S=i.n(g)().create();const O={useApi:function(){var e=(0,t.useContext)(v),r=(0,t.useMemo)((function(){return Object.create(e)}),[e]);return r.__api_loading=!1,r.__api_error=null,r},useApiState:function(e,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];var a=e,c=[void 0,!0,void 0],u=(0,t.useState)(c),l=h(u,2),f=l[0],s=l[1];return y(p().mark((function t(){var n;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,s((function(t){return[t[0],!0,void 0]})),t.next=4,r.apply(void 0,[e].concat(o));case 4:n=t.sent,s([n,!1,void 0]),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),s((function(e){return[e[0],!1,t.t0]}));case 11:case"end":return t.stop()}}),t,null,[[0,8]])})),[].concat(o)),!a.__api_loading&&f[1]&&(a.__api_loading=!0),!a.__api_error&&f[2]&&(a.__api_error=f[2]),f},useApiAnyError:function(t){return t.__api_error},useApiAnyLoading:function(t){return t.__api_loading},ApiProvider:function(r){var o=r.children,i=r.httpClient,a=r.initAuth,u=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=new n.Store((function(){return r instanceof Object&&"object"===l(r)?r:{}}));return e?Object.keys(e).includes("get")&&Object.keys(e).includes("post")&&Object.keys(e).includes("delete")&&Object.keys(e).includes("put")&&Object.keys(e).includes("request")&&"function"==typeof e.get&&"function"==typeof e.post&&"function"==typeof e.delete&&"function"==typeof e.put&&"function"==typeof e.request?(0,t.useMemo)((function(){return c(c({},e),{},{auth:o})}),[]):(f.error("get, post, delete,request and put in httpClient must be implemented and they must be functions"),0):(f.error("httpClient Not null or Type error"),0)}(i,void 0===a?{}:a);return e().createElement(v.Provider,{value:u},o)},createHttpClient:function(t){var e=t&&t instanceof Function&&"function"==typeof t&&t(S)||S;return{get:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.get(t,b({params:r},n))},post:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.post(t,r,b({},n))},delete:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.delete(t,b({params:r},n))},put:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.put(t,r,b({},n))},request:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.request(t)}}}}})(),a=a.default})()));