yawp
Version:
YAWP! Framework
3 lines • 34.1 kB
JavaScript
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("yawp",[],n):"object"==typeof exports?exports.yawp=n():t.yawp=n()}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var o=e(1),u=r(o),i=e(77)(u.default);n.default=i,t.exports=n.default},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,n,e,r){4===t.readyState&&(200===t.status?e(n.raw?t:n.json?JSON.parse(t.responseText):t.responseText):r(t))}function u(t,n){n&&"omit"!==n&&(t.withCredentials=!0)}function i(t,n){n=n||{},(0,a.extend)(n,{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"});for(var e in n)n.hasOwnProperty(e)&&t.setRequestHeader(e,n[e])}Object.defineProperty(n,"__esModule",{value:!0});var c=e(2),f=r(c);n.default=function(t,n){return new f.default(function(e,r){var c=n.query;delete n.query;var f=new XMLHttpRequest;f.onreadystatechange=function(){o(f,n,e,r)},f.open(n.method,t+(c?"?"+(0,a.toUrlParam)(c):"")),i(f,n.headers),u(f,n.credentials),f.send(n.body)})};var a=e(72);t.exports=n.default},function(t,n,e){t.exports={default:e(3),__esModule:!0}},function(t,n,e){e(4),e(5),e(49),e(53),e(70),e(71),t.exports=e(13).Promise},function(t,n){},function(t,n,e){"use strict";var r=e(6)(!0);e(9)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,e=this._i;return e>=n.length?{value:void 0,done:!0}:(t=r(n,e),this._i+=t.length,{value:t,done:!1})})},function(t,n,e){var r=e(7),o=e(8);t.exports=function(t){return function(n,e){var u,i,c=String(o(n)),f=r(e),a=c.length;return f<0||f>=a?t?"":void 0:(u=c.charCodeAt(f),u<55296||u>56319||f+1===a||(i=c.charCodeAt(f+1))<56320||i>57343?t?c.charAt(f):u:t?c.slice(f,f+2):(u-55296<<10)+(i-56320)+65536)}}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){"use strict";var r=e(10),o=e(11),u=e(26),i=e(16),c=e(27),f=e(28),a=e(29),s=e(45),l=e(47),p=e(46)("iterator"),v=!([].keys&&"next"in[].keys()),d="@@iterator",h="keys",y="values",_=function(){return this};t.exports=function(t,n,e,m,b,x,g){a(e,n,m);var w,O,S,j=function(t){if(!v&&t in T)return T[t];switch(t){case h:return function(){return new e(this,t)};case y:return function(){return new e(this,t)}}return function(){return new e(this,t)}},P=n+" Iterator",k=b==y,M=!1,T=t.prototype,E=T[p]||T[d]||b&&T[b],L=E||j(b),R=b?k?j("entries"):L:void 0,A="Array"==n?T.entries||E:E;if(A&&(S=l(A.call(new t)),S!==Object.prototype&&S.next&&(s(S,P,!0),r||c(S,p)||i(S,p,_))),k&&E&&E.name!==y&&(M=!0,L=function(){return E.call(this)}),r&&!g||!v&&!M&&T[p]||i(T,p,L),f[n]=L,f[P]=_,b)if(w={values:k?L:j(y),keys:x?L:j(h),entries:R},g)for(O in w)O in T||u(T,O,w[O]);else o(o.P+o.F*(v||M),n,w);return w}},function(t,n){t.exports=!0},function(t,n,e){var r=e(12),o=e(13),u=e(14),i=e(16),c="prototype",f=function(t,n,e){var a,s,l,p=t&f.F,v=t&f.G,d=t&f.S,h=t&f.P,y=t&f.B,_=t&f.W,m=v?o:o[n]||(o[n]={}),b=m[c],x=v?r:d?r[n]:(r[n]||{})[c];v&&(e=n);for(a in e)s=!p&&x&&void 0!==x[a],s&&a in m||(l=s?x[a]:e[a],m[a]=v&&"function"!=typeof x[a]?e[a]:y&&s?u(l,r):_&&x[a]==l?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n[c]=t[c],n}(l):h&&"function"==typeof l?u(Function.call,l):l,h&&((m.virtual||(m.virtual={}))[a]=l,t&f.R&&b&&!b[a]&&i(b,a,l)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){var e=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=e)},function(t,n,e){var r=e(15);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(17),o=e(25);t.exports=e(21)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(18),o=e(20),u=e(24),i=Object.defineProperty;n.f=e(21)?Object.defineProperty:function(t,n,e){if(r(t),n=u(n,!0),r(e),o)try{return i(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(19);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){t.exports=!e(21)&&!e(22)(function(){return 7!=Object.defineProperty(e(23)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){t.exports=!e(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){var r=e(19),o=e(12).document,u=r(o)&&r(o.createElement);t.exports=function(t){return u?o.createElement(t):{}}},function(t,n,e){var r=e(19);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){t.exports=e(16)},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports={}},function(t,n,e){"use strict";var r=e(30),o=e(25),u=e(45),i={};e(16)(i,e(46)("iterator"),function(){return this}),t.exports=function(t,n,e){t.prototype=r(i,{next:o(1,e)}),u(t,n+" Iterator")}},function(t,n,e){var r=e(18),o=e(31),u=e(43),i=e(40)("IE_PROTO"),c=function(){},f="prototype",a=function(){var t,n=e(23)("iframe"),r=u.length,o="<",i=">";for(n.style.display="none",e(44).appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write(o+"script"+i+"document.F=Object"+o+"/script"+i),t.close(),a=t.F;r--;)delete a[f][u[r]];return a()};t.exports=Object.create||function(t,n){var e;return null!==t?(c[f]=r(t),e=new c,c[f]=null,e[i]=t):e=a(),void 0===n?e:o(e,n)}},function(t,n,e){var r=e(17),o=e(18),u=e(32);t.exports=e(21)?Object.defineProperties:function(t,n){o(t);for(var e,i=u(n),c=i.length,f=0;c>f;)r.f(t,e=i[f++],n[e]);return t}},function(t,n,e){var r=e(33),o=e(43);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n,e){var r=e(27),o=e(34),u=e(37)(!1),i=e(40)("IE_PROTO");t.exports=function(t,n){var e,c=o(t),f=0,a=[];for(e in c)e!=i&&r(c,e)&&a.push(e);for(;n.length>f;)r(c,e=n[f++])&&(~u(a,e)||a.push(e));return a}},function(t,n,e){var r=e(35),o=e(8);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(36);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){var r=e(34),o=e(38),u=e(39);t.exports=function(t){return function(n,e,i){var c,f=r(n),a=o(f.length),s=u(i,a);if(t&&e!=e){for(;a>s;)if(c=f[s++],c!=c)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===e)return t||s||0;return!t&&-1}}},function(t,n,e){var r=e(7),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(7),o=Math.max,u=Math.min;t.exports=function(t,n){return t=r(t),t<0?o(t+n,0):u(t,n)}},function(t,n,e){var r=e(41)("keys"),o=e(42);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n,e){var r=e(12),o="__core-js_shared__",u=r[o]||(r[o]={});t.exports=function(t){return u[t]||(u[t]={})}},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,e){var r=e(12).document;t.exports=r&&r.documentElement},function(t,n,e){var r=e(17).f,o=e(27),u=e(46)("toStringTag");t.exports=function(t,n,e){t&&!o(t=e?t:t.prototype,u)&&r(t,u,{configurable:!0,value:n})}},function(t,n,e){var r=e(41)("wks"),o=e(42),u=e(12).Symbol,i="function"==typeof u,c=t.exports=function(t){return r[t]||(r[t]=i&&u[t]||(i?u:o)("Symbol."+t))};c.store=r},function(t,n,e){var r=e(27),o=e(48),u=e(40)("IE_PROTO"),i=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,u)?t[u]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?i:null}},function(t,n,e){var r=e(8);t.exports=function(t){return Object(r(t))}},function(t,n,e){e(50);for(var r=e(12),o=e(16),u=e(28),i=e(46)("toStringTag"),c="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;f<c.length;f++){var a=c[f],s=r[a],l=s&&s.prototype;l&&!l[i]&&o(l,i,a),u[a]=u.Array}},function(t,n,e){"use strict";var r=e(51),o=e(52),u=e(28),i=e(34);t.exports=e(9)(Array,"Array",function(t,n){this._t=i(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,o(1)):"keys"==n?o(0,e):"values"==n?o(0,t[e]):o(0,[e,t[e]])},"values"),u.Arguments=u.Array,r("keys"),r("values"),r("entries")},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,e){"use strict";var r,o,u,i,c=e(10),f=e(12),a=e(14),s=e(54),l=e(11),p=e(19),v=e(15),d=e(55),h=e(56),y=e(60),_=e(61).set,m=e(63)(),b=e(64),x=e(65),g=e(66),w="Promise",O=f.TypeError,S=f.process,j=f[w],P="process"==s(S),k=function(){},M=o=b.f,T=!!function(){try{var t=j.resolve(1),n=(t.constructor={})[e(46)("species")]=function(t){t(k,k)};return(P||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof n}catch(t){}}(),E=function(t){var n;return!(!p(t)||"function"!=typeof(n=t.then))&&n},L=function(t,n){if(!t._n){t._n=!0;var e=t._c;m(function(){for(var r=t._v,o=1==t._s,u=0,i=function(n){var e,u,i=o?n.ok:n.fail,c=n.resolve,f=n.reject,a=n.domain;try{i?(o||(2==t._h&&F(t),t._h=1),i===!0?e=r:(a&&a.enter(),e=i(r),a&&a.exit()),e===n.promise?f(O("Promise-chain cycle")):(u=E(e))?u.call(e,c,f):c(e)):f(r)}catch(t){f(t)}};e.length>u;)i(e[u++]);t._c=[],t._n=!1,n&&!t._h&&R(t)})}},R=function(t){_.call(f,function(){var n,e,r,o=t._v,u=A(t);if(u&&(n=x(function(){P?S.emit("unhandledRejection",o,t):(e=f.onunhandledrejection)?e({promise:t,reason:o}):(r=f.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=P||A(t)?2:1),t._a=void 0,u&&n.e)throw n.v})},A=function(t){if(1==t._h)return!1;for(var n,e=t._a||t._c,r=0;e.length>r;)if(n=e[r++],n.fail||!A(n.promise))return!1;return!0},F=function(t){_.call(f,function(){var n;P?S.emit("rejectionHandled",t):(n=f.onrejectionhandled)&&n({promise:t,reason:t._v})})},N=function(t){var n=this;n._d||(n._d=!0,n=n._w||n,n._v=t,n._s=2,n._a||(n._a=n._c.slice()),L(n,!0))},C=function(t){var n,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw O("Promise can't be resolved itself");(n=E(t))?m(function(){var r={_w:e,_d:!1};try{n.call(t,a(C,r,1),a(N,r,1))}catch(t){N.call(r,t)}}):(e._v=t,e._s=1,L(e,!1))}catch(t){N.call({_w:e,_d:!1},t)}}};T||(j=function(t){d(this,j,w,"_h"),v(t),r.call(this);try{t(a(C,this,1),a(N,this,1))}catch(t){N.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=e(67)(j.prototype,{then:function(t,n){var e=M(y(this,j));return e.ok="function"!=typeof t||t,e.fail="function"==typeof n&&n,e.domain=P?S.domain:void 0,this._c.push(e),this._a&&this._a.push(e),this._s&&L(this,!1),e.promise},catch:function(t){return this.then(void 0,t)}}),u=function(){var t=new r;this.promise=t,this.resolve=a(C,t,1),this.reject=a(N,t,1)},b.f=M=function(t){return t===j||t===i?new u(t):o(t)}),l(l.G+l.W+l.F*!T,{Promise:j}),e(45)(j,w),e(68)(w),i=e(13)[w],l(l.S+l.F*!T,w,{reject:function(t){var n=M(this),e=n.reject;return e(t),n.promise}}),l(l.S+l.F*(c||!T),w,{resolve:function(t){return g(c&&this===i?j:this,t)}}),l(l.S+l.F*!(T&&e(69)(function(t){j.all(t).catch(k)})),w,{all:function(t){var n=this,e=M(n),r=e.resolve,o=e.reject,u=x(function(){var e=[],u=0,i=1;h(t,!1,function(t){var c=u++,f=!1;e.push(void 0),i++,n.resolve(t).then(function(t){f||(f=!0,e[c]=t,--i||r(e))},o)}),--i||r(e)});return u.e&&o(u.v),e.promise},race:function(t){var n=this,e=M(n),r=e.reject,o=x(function(){h(t,!1,function(t){n.resolve(t).then(e.resolve,r)})});return o.e&&r(o.v),e.promise}})},function(t,n,e){var r=e(36),o=e(46)("toStringTag"),u="Arguments"==r(function(){return arguments}()),i=function(t,n){try{return t[n]}catch(t){}};t.exports=function(t){var n,e,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=i(n=Object(t),o))?e:u?r(n):"Object"==(c=r(n))&&"function"==typeof n.callee?"Arguments":c}},function(t,n){t.exports=function(t,n,e,r){if(!(t instanceof n)||void 0!==r&&r in t)throw TypeError(e+": incorrect invocation!");return t}},function(t,n,e){var r=e(14),o=e(57),u=e(58),i=e(18),c=e(38),f=e(59),a={},s={},n=t.exports=function(t,n,e,l,p){var v,d,h,y,_=p?function(){return t}:f(t),m=r(e,l,n?2:1),b=0;if("function"!=typeof _)throw TypeError(t+" is not iterable!");if(u(_)){for(v=c(t.length);v>b;b++)if(y=n?m(i(d=t[b])[0],d[1]):m(t[b]),y===a||y===s)return y}else for(h=_.call(t);!(d=h.next()).done;)if(y=o(h,m,d.value,n),y===a||y===s)return y};n.BREAK=a,n.RETURN=s},function(t,n,e){var r=e(18);t.exports=function(t,n,e,o){try{return o?n(r(e)[0],e[1]):n(e)}catch(n){var u=t.return;throw void 0!==u&&r(u.call(t)),n}}},function(t,n,e){var r=e(28),o=e(46)("iterator"),u=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||u[o]===t)}},function(t,n,e){var r=e(54),o=e(46)("iterator"),u=e(28);t.exports=e(13).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||u[r(t)]}},function(t,n,e){var r=e(18),o=e(15),u=e(46)("species");t.exports=function(t,n){var e,i=r(t).constructor;return void 0===i||void 0==(e=r(i)[u])?n:o(e)}},function(t,n,e){var r,o,u,i=e(14),c=e(62),f=e(44),a=e(23),s=e(12),l=s.process,p=s.setImmediate,v=s.clearImmediate,d=s.MessageChannel,h=s.Dispatch,y=0,_={},m="onreadystatechange",b=function(){var t=+this;if(_.hasOwnProperty(t)){var n=_[t];delete _[t],n()}},x=function(t){b.call(t.data)};p&&v||(p=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return _[++y]=function(){c("function"==typeof t?t:Function(t),n)},r(y),y},v=function(t){delete _[t]},"process"==e(36)(l)?r=function(t){l.nextTick(i(b,t,1))}:h&&h.now?r=function(t){h.now(i(b,t,1))}:d?(o=new d,u=o.port2,o.port1.onmessage=x,r=i(u.postMessage,u,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(r=function(t){s.postMessage(t+"","*")},s.addEventListener("message",x,!1)):r=m in a("script")?function(t){f.appendChild(a("script"))[m]=function(){f.removeChild(this),b.call(t)}}:function(t){setTimeout(i(b,t,1),0)}),t.exports={set:p,clear:v}},function(t,n){t.exports=function(t,n,e){var r=void 0===e;switch(n.length){case 0:return r?t():t.call(e);case 1:return r?t(n[0]):t.call(e,n[0]);case 2:return r?t(n[0],n[1]):t.call(e,n[0],n[1]);case 3:return r?t(n[0],n[1],n[2]):t.call(e,n[0],n[1],n[2]);case 4:return r?t(n[0],n[1],n[2],n[3]):t.call(e,n[0],n[1],n[2],n[3])}return t.apply(e,n)}},function(t,n,e){var r=e(12),o=e(61).set,u=r.MutationObserver||r.WebKitMutationObserver,i=r.process,c=r.Promise,f="process"==e(36)(i);t.exports=function(){var t,n,e,a=function(){var r,o;for(f&&(r=i.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?e():n=void 0,r}}n=void 0,r&&r.enter()};if(f)e=function(){i.nextTick(a)};else if(u){var s=!0,l=document.createTextNode("");new u(a).observe(l,{characterData:!0}),e=function(){l.data=s=!s}}else if(c&&c.resolve){var p=c.resolve();e=function(){p.then(a)}}else e=function(){o.call(r,a)};return function(r){var o={fn:r,next:void 0};n&&(n.next=o),t||(t=o,e()),n=o}}},function(t,n,e){"use strict";function r(t){var n,e;this.promise=new t(function(t,r){if(void 0!==n||void 0!==e)throw TypeError("Bad Promise constructor");n=t,e=r}),this.resolve=o(n),this.reject=o(e)}var o=e(15);t.exports.f=function(t){return new r(t)}},function(t,n){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,n,e){var r=e(18),o=e(19),u=e(64);t.exports=function(t,n){if(r(t),o(n)&&n.constructor===t)return n;var e=u.f(t),i=e.resolve;return i(n),e.promise}},function(t,n,e){var r=e(16);t.exports=function(t,n,e){for(var o in n)e&&t[o]?t[o]=n[o]:r(t,o,n[o]);return t}},function(t,n,e){"use strict";var r=e(12),o=e(13),u=e(17),i=e(21),c=e(46)("species");t.exports=function(t){var n="function"==typeof o[t]?o[t]:r[t];i&&n&&!n[c]&&u.f(n,c,{configurable:!0,get:function(){return this}})}},function(t,n,e){var r=e(46)("iterator"),o=!1;try{var u=[7][r]();u.return=function(){o=!0},Array.from(u,function(){throw 2})}catch(t){}t.exports=function(t,n){if(!n&&!o)return!1;var e=!1;try{var u=[7],i=u[r]();i.next=function(){return{done:e=!0}},u[r]=function(){return i},t(u)}catch(t){}return e}},function(t,n,e){"use strict";var r=e(11),o=e(13),u=e(12),i=e(60),c=e(66);r(r.P+r.R,"Promise",{finally:function(t){var n=i(this,o.Promise||u.Promise),e="function"==typeof t;return this.then(e?function(e){return c(n,t()).then(function(){return e})}:t,e?function(e){return c(n,t()).then(function(){throw e})}:t)}})},function(t,n,e){"use strict";var r=e(11),o=e(64),u=e(65);r(r.S,"Promise",{try:function(t){var n=o.f(this),e=u(t);return(e.e?n.reject:n.resolve)(e.v),n.promise}})},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(){for(var t=arguments[0]||{},n=1,e=arguments.length;n<e;n++){var r=arguments[n];for(var o in r)t[o]=r[o]}return t}function u(t){return(0,c.default)(t).map(function(n){return encodeURIComponent(n)+"="+encodeURIComponent(t[n])}).join("&")}Object.defineProperty(n,"__esModule",{value:!0});var i=e(73),c=r(i);n.extend=o,n.toUrlParam=u},function(t,n,e){t.exports={default:e(74),__esModule:!0}},function(t,n,e){e(75),t.exports=e(13).Object.keys},function(t,n,e){var r=e(48),o=e(32);e(76)("keys",function(){return function(t){return o(r(t))}})},function(t,n,e){var r=e(11),o=e(13),u=e(22);t.exports=function(t,n){var e=(o.Object||{})[t]||Object[t],i={};i[t]=n(e),r(r.S+r.F*u(function(){e(1)}),"Object",i)}},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return t?t instanceof Object?i(t):t:""}function u(t){return t.id}function i(t){if(u(t))return t.id;throw"use yawp(id) if your endpoint does not have a @Id field called id"}Object.defineProperty(n,"__esModule",{value:!0});var c=e(78),f=r(c),a=e(83),s=r(a),l=e(86),p=r(l),v=e(103),d=r(v),h=e(111),y=r(h),_=e(115),m=r(_),b=e(73),x=r(b),g=e(2),w=r(g),O=e(117),S=r(O),j=e(118),P=r(j),k=e(72),M="/api",T={},E=void 0,L=void 0,R=void 0;n.default=function(t){function n(e){var r={},c={},a=function(){function a(t){(0,S.default)(this,a),t&&(0,k.extend)(this,t)}return(0,P.default)(a,[{key:"save",value:function(t){var n=this.createOrUpdate();return t?n.then(t):n}},{key:"createOrUpdate",value:function(){var t=this,n=void 0;return u(this)?(r.url=this.id,n=this.constructor.update(this)):n=this.constructor.create(this).then(function(n){return t.id=n.id,n}),n}},{key:"destroy",value:function(t){var n=this.constructor.destroy(this);return t?n.then(t):n}},{key:"get",value:function(t){return r.url=i(this),this.constructor.get(t)}},{key:"put",value:function(t){return r.url=i(this),this.constructor.put(t)}},{key:"_patch",value:function(t){return r.url=i(this),this.constructor._patch(t)}},{key:"post",value:function(t){return r.url=i(this),this.constructor.post(t)}},{key:"_delete",value:function(t){return r.url=i(this),this.constructor._delete(t)}}],[{key:"clear",value:function(){r={url:o(e)},c={}}},{key:"prepareRequestOptions",value:function(){var t=(0,k.extend)({},r);return this.clear(),t}},{key:"baseRequest",value:function(n){var e=this.prepareRequestOptions(),r=M+e.url;delete e.url,e.method=n,e.json=!0,(0,k.extend)(e,T);var o=w.default.resolve(E?E(e):e);return o.then(function(t){return t||e}).then(function(n){var e=t(r,n);return L&&(e=e.then(L)),R&&(e=e.catch(R)),e})}},{key:"wrapInstance",value:function(t){return new this(t)}},{key:"wrapArray",value:function(t){var n=this;return t.map(function(t){return n.wrapInstance(t)})}},{key:"wrappedRequest",value:function(t){var n=this;return this.baseRequest(t).then(function(t){return Array===t.constructor?n.wrapArray(t):n.wrapInstance(t)})}},{key:"from",value:function(t){var n=o(t);return r.url=n+r.url,this}},{key:"transform",value:function(t){return this.param("t",t),this}},{key:"where",value:function(t){return 1===arguments.length?c.where=t:c.where=[].slice.call(arguments),this}},{key:"order",value:function(t){return c.order=t,this}},{key:"sort",value:function(t){return c.sort=t,this}},{key:"limit",value:function(t){return c.limit=t,this}},{key:"fetch",value:function(t){var n="function"==typeof t?t:void 0;t&&!n&&(r.url+="/"+t);var e=this.wrappedRequest("GET");return n?e.then(n):e}},{key:"setupQuery",value:function(){(0,x.default)(c).length>0&&this.param("q",(0,m.default)(c))}},{key:"list",value:function(t){this.setupQuery();var n=this.wrappedRequest("GET");return t?n.then(t):n}},{key:"first",value:function(t){return this.limit(1),this.list(function(n){var e=0===n.length?null:n[0];return t?t(e):e})}},{key:"only",value:function(t){return this.list(function(n){if(1!==n.length)throw"called only but got "+n.length+" results";var e=n[0];return t?t(e):e})}},{key:"create",value:function(t){return r.body=(0,m.default)(t),this.wrappedRequest("POST")}},{key:"update",value:function(t){return r.url=t.id,r.body=(0,m.default)(t),this.wrappedRequest("PUT")}},{key:"patch",value:function(t){return r.url=t.id,r.body=(0,m.default)(t),this.wrappedRequest("PATCH")}},{key:"destroy",value:function(t){return t&&(r.url=i(t)),this.baseRequest("DELETE")}},{key:"json",value:function(t){return r.body=(0,m.default)(t),this}},{key:"params",value:function(t){return r.query=(0,k.extend)(r.query,t),this}},{key:"param",value:function(t,n){r.query||(r.query={}),r.query[t]=n}},{key:"action",value:function(t,n){return r.url+="/"+n,this.baseRequest(t)}},{key:"get",value:function(t){return this.action("GET",t)}},{key:"put",value:function(t){return this.action("PUT",t)}},{key:"_patch",value:function(t){return this.action("PATCH",t)}},{key:"post",value:function(t){return this.action("POST",t)}},{key:"_delete",value:function(t){return this.action("DELETE",t)}},{key:"subclass",value:function(t){var r=n(e),o=this,u=function(n){function e(){(0,S.default)(this,e);var n=(0,p.default)(this,(e.__proto__||(0,s.default)(e)).call(this));return o.bindBaseMethods(n,r),t?t.apply(n,arguments):(0,y.default)(e.prototype.__proto__||(0,s.default)(e.prototype),"constructor",n).apply(n,arguments),n}return(0,d.default)(e,n),e}(r);return u.super=r,u}},{key:"bindBaseMethods",value:function(t,n){t.super=function(){};for(var e=(0,f.default)(n.prototype),r=0,o=e.length;r<o;r++){var u=e[r];t.super[u]=n.prototype[u].bind(t)}}}]),a}();return a.clear(),a}function e(t){customFetchOptionsFn=t}function r(t){var n={baseUrl:function(t){M=t},defaultFetchOptions:function(t){T=t},before:function(t){E=t},then:function(t){L=t},catch:function(t){R=t}};t(n)}function c(t){var e=i(t);return n(e).update(t)}function a(t){var e=i(t);return n(e).patch(t)}function l(t){var e=i(t);return n(e).destroy(t)}var v={config:r,customFetchOptions:e,update:c,patch:a,destroy:l};return(0,k.extend)(n,v)},t.exports=n.default},function(t,n,e){t.exports={default:e(79),__esModule:!0}},function(t,n,e){e(80);var r=e(13).Object;t.exports=function(t){return r.getOwnPropertyNames(t)}},function(t,n,e){e(76)("getOwnPropertyNames",function(){return e(81).f})},function(t,n,e){var r=e(34),o=e(82).f,u={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return o(t)}catch(t){return i.slice()}};t.exports.f=function(t){return i&&"[object Window]"==u.call(t)?c(t):o(r(t))}},function(t,n,e){var r=e(33),o=e(43).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,n,e){t.exports={default:e(84),__esModule:!0}},function(t,n,e){e(85),t.exports=e(13).Object.getPrototypeOf},function(t,n,e){var r=e(48),o=e(47);e(76)("getPrototypeOf",function(){return function(t){return o(r(t))}})},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var o=e(87),u=r(o);n.default=function(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!==("undefined"==typeof n?"undefined":(0,u.default)(n))&&"function"!=typeof n?t:n}},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var o=e(88),u=r(o),i=e(91),c=r(i),f="function"==typeof c.default&&"symbol"==typeof u.default?function(t){return typeof t}:function(t){return t&&"function"==typeof c.default&&t.constructor===c.default&&t!==c.default.prototype?"symbol":typeof t};n.default="function"==typeof c.default&&"symbol"===f(u.default)?function(t){return"undefined"==typeof t?"undefined":f(t)}:function(t){return t&&"function"==typeof c.default&&t.constructor===c.default&&t!==c.default.prototype?"symbol":"undefined"==typeof t?"undefined":f(t)}},function(t,n,e){t.exports={default:e(89),__esModule:!0}},function(t,n,e){e(5),e(49),t.exports=e(90).f("iterator")},function(t,n,e){n.f=e(46)},function(t,n,e){t.exports={default:e(92),__esModule:!0}},function(t,n,e){e(93),e(4),e(101),e(102),t.exports=e(13).Symbol},function(t,n,e){"use strict";var r=e(12),o=e(27),u=e(21),i=e(11),c=e(26),f=e(94).KEY,a=e(22),s=e(41),l=e(45),p=e(42),v=e(46),d=e(90),h=e(95),y=e(96),_=e(99),m=e(18),b=e(34),x=e(24),g=e(25),w=e(30),O=e(81),S=e(100),j=e(17),P=e(32),k=S.f,M=j.f,T=O.f,E=r.Symbol,L=r.JSON,R=L&&L.stringify,A="prototype",F=v("_hidden"),N=v("toPrimitive"),C={}.propertyIsEnumerable,q=s("symbol-registry"),I=s("symbols"),D=s("op-symbols"),U=Object[A],G="function"==typeof E,H=r.QObject,J=!H||!H[A]||!H[A].findChild,W=u&&a(function(){return 7!=w(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(t,n,e){var r=k(U,n);r&&delete U[n],M(t,n,e),r&&t!==U&&M(U,n,r)}:M,B=function(t){var n=I[t]=w(E[A]);return n._k=t,n},V=G&&"symbol"==typeof E.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof E},K=function(t,n,e){return t===U&&K(D,n,e),m(t),n=x(n,!0),m(e),o(I,n)?(e.enumerable?(o(t,F)&&t[F][n]&&(t[F][n]=!1),e=w(e,{enumerable:g(0,!1)})):(o(t,F)||M(t,F,g(1,{})),t[F][n]=!0),W(t,n,e)):M(t,n,e)},Q=function(t,n){m(t);for(var e,r=y(n=b(n)),o=0,u=r.length;u>o;)K(t,e=r[o++],n[e]);return t},z=function(t,n){return void 0===n?w(t):Q(w(t),n)},Y=function(t){var n=C.call(this,t=x(t,!0));return!(this===U&&o(I,t)&&!o(D,t))&&(!(n||!o(this,t)||!o(I,t)||o(this,F)&&this[F][t])||n)},X=function(t,n){if(t=b(t),n=x(n,!0),t!==U||!o(I,n)||o(D,n)){var e=k(t,n);return!e||!o(I,n)||o(t,F)&&t[F][n]||(e.enumerable=!0),e}},Z=function(t){for(var n,e=T(b(t)),r=[],u=0;e.length>u;)o(I,n=e[u++])||n==F||n==f||r.push(n);return r},$=function(t){for(var n,e=t===U,r=T(e?D:b(t)),u=[],i=0;r.length>i;)!o(I,n=r[i++])||e&&!o(U,n)||u.push(I[n]);return u};G||(E=function(){if(this instanceof E)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),n=function(e){this===U&&n.call(D,e),o(this,F)&&o(this[F],t)&&(this[F][t]=!1),W(this,t,g(1,e))};return u&&J&&W(U,t,{configurable:!0,set:n}),B(t)},c(E[A],"toString",function(){return this._k}),S.f=X,j.f=K,e(82).f=O.f=Z,e(98).f=Y,e(97).f=$,u&&!e(10)&&c(U,"propertyIsEnumerable",Y,!0),d.f=function(t){return B(v(t))}),i(i.G+i.W+i.F*!G,{Symbol:E});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;tt.length>nt;)v(tt[nt++]);for(var et=P(v.store),rt=0;et.length>rt;)h(et[rt++]);i(i.S+i.F*!G,"Symbol",{for:function(t){return o(q,t+="")?q[t]:q[t]=E(t)},keyFor:function(t){if(!V(t))throw TypeError(t+" is not a symbol!");for(var n in q)if(q[n]===t)return n},useSetter:function(){J=!0},useSimple:function(){J=!1}}),i(i.S+i.F*!G,"Object",{create:z,defineProperty:K,defineProperties:Q,getOwnPropertyDescriptor:X,getOwnPropertyNames:Z,getOwnPropertySymbols:$}),L&&i(i.S+i.F*(!G||a(function(){var t=E();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!V(t)){for(var n,e,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);return n=r[1],"function"==typeof n&&(e=n),!e&&_(n)||(n=function(t,n){if(e&&(n=e.call(this,t,n)),!V(n))return n}),r[1]=n,R.apply(L,r)}}}),E[A][N]||e(16)(E[A],N,E[A].valueOf),l(E,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,n,e){var r=e(42)("meta"),o=e(19),u=e(27),i=e(17).f,c=0,f=Object.isExtensible||function(){return!0},a=!e(22)(function(){return f(Object.preventExtensions({}))}),s=function(t){i(t,r,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!u(t,r)){if(!f(t))return"F";if(!n)return"E";s(t)}return t[r].i},p=function(t,n){if(!u(t,r)){if(!f(t))return!0;if(!n)return!1;s(t)}return t[r].w},v=function(t){return a&&d.NEED&&f(t)&&!u(t,r)&&s(t),t},d=t.exports={KEY:r,NEED:!1,fastKey:l,getWeak:p,onFreeze:v}},function(t,n,e){var r=e(12),o=e(13),u=e(10),i=e(90),c=e(17).f;t.exports=function(t){var n=o.Symbol||(o.Symbol=u?{}:r.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:i.f(t)})}},function(t,n,e){var r=e(32),o=e(97),u=e(98);t.exports=function(t){var n=r(t),e=o.f;if(e)for(var i,c=e(t),f=u.f,a=0;c.length>a;)f.call(t,i=c[a++])&&n.push(i);return n}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){var r=e(36);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,n,e){var r=e(98),o=e(25),u=e(34),i=e(24),c=e(27),f=e(20),a=Object.getOwnPropertyDescriptor;n.f=e(21)?a:function(t,n){if(t=u(t),n=i(n,!0),f)try{return a(t,n)}catch(t){}if(c(t,n))return o(!r.f.call(t,n),t[n])}},function(t,n,e){e(95)("asyncIterator")},function(t,n,e){e(95)("observable")},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var o=e(104),u=r(o),i=e(108),c=r(i),f=e(87),a=r(f);n.default=function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof n?"undefined":(0,a.default)(n)));t.prototype=(0,c.default)(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(u.default?(0,u.default)(t,n):t.__proto__=n)}},function(t,n,e){t.exports={default:e(105),__esModule:!0}},function(t,n,e){e(106),t.exports=e(13).Object.setPrototypeOf},function(t,n,e){var r=e(11);r(r.S,"Object",{setPrototypeOf:e(107).set})},function(t,n,e){var r=e(19),o=e(18),u=function(t,n){if(o(t),!r(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,r){
try{r=e(14)(Function.call,e(100).f(Object.prototype,"__proto__").set,2),r(t,[]),n=!(t instanceof Array)}catch(t){n=!0}return function(t,e){return u(t,e),n?t.__proto__=e:r(t,e),t}}({},!1):void 0),check:u}},function(t,n,e){t.exports={default:e(109),__esModule:!0}},function(t,n,e){e(110);var r=e(13).Object;t.exports=function(t,n){return r.create(t,n)}},function(t,n,e){var r=e(11);r(r.S,"Object",{create:e(30)})},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var o=e(83),u=r(o),i=e(112),c=r(i);n.default=function t(n,e,r){null===n&&(n=Function.prototype);var o=(0,c.default)(n,e);if(void 0===o){var i=(0,u.default)(n);return null===i?void 0:t(i,e,r)}if("value"in o)return o.value;var f=o.get;if(void 0!==f)return f.call(r)}},function(t,n,e){t.exports={default:e(113),__esModule:!0}},function(t,n,e){e(114);var r=e(13).Object;t.exports=function(t,n){return r.getOwnPropertyDescriptor(t,n)}},function(t,n,e){var r=e(34),o=e(100).f;e(76)("getOwnPropertyDescriptor",function(){return function(t,n){return o(r(t),n)}})},function(t,n,e){t.exports={default:e(116),__esModule:!0}},function(t,n,e){var r=e(13),o=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return o.stringify.apply(o,arguments)}},function(t,n){"use strict";n.__esModule=!0,n.default=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var o=e(119),u=r(o);n.default=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,u.default)(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}()},function(t,n,e){t.exports={default:e(120),__esModule:!0}},function(t,n,e){e(121);var r=e(13).Object;t.exports=function(t,n,e){return r.defineProperty(t,n,e)}},function(t,n,e){var r=e(11);r(r.S+r.F*!e(21),"Object",{defineProperty:e(17).f})}])});
//# sourceMappingURL=yawp.min.js.map