@itentialopensource/binding-schema
Version:
A schema extension for JSON schema that builds upon hyper schema to dynamically bind data into a JSON schema document.
2 lines (1 loc) • 39.5 kB
JavaScript
import t from"axios";function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,r){return t(r={exports:{}},r.exports),r.exports}var n=r(e((function(t){function r(t,r,e,n,o,u,i){try{var a=t[u](i),c=a.value}catch(t){return void e(t)}a.done?r(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,u){var i=t.apply(e,n);function a(t){r(i,o,u,a,c,"next",t)}function c(t){r(i,o,u,a,c,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0}))),o=e((function(t){var r=function(t){var r=Object.prototype,e=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function a(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{a({},"")}catch(t){a=function(t,r,e){return t[r]=e}}function c(t,r,e,n){var o=r&&r.prototype instanceof l?r:l,u=Object.create(o.prototype),i=new O(n||[]);return u._invoke=function(t,r,e){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return _()}for(e.method=o,e.arg=u;;){var i=e.delegate;if(i){var a=x(i,e);if(a){if(a===f)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var c=s(t,r,e);if("normal"===c.type){if(n=e.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n="completed",e.method="throw",e.arg=c.arg)}}}(t,e,i),u}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function h(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==r&&e.call(g,o)&&(d=g);var v=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(r){a(t,r,(function(t){return this._invoke(r,t)}))}))}function b(t,r){var n;this._invoke=function(o,u){function i(){return new r((function(n,i){!function n(o,u,i,a){var c=s(t[o],t,u);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&e.call(l,"__await")?r.resolve(l.__await).then((function(t){n("next",t,i,a)}),(function(t){n("throw",t,i,a)})):r.resolve(l).then((function(t){f.value=t,i(f)}),(function(t){return n("throw",t,i,a)}))}a(c.arg)}(o,u,n,i)}))}return n=n?n.then(i,i):i()}}function x(t,r){var e=t.iterator[r.method];if(void 0===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,x(t,r),"throw"===r.method))return f;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(e,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,f;var o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function w(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function j(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,u=function r(){for(;++n<t.length;)if(e.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return u.next=u}}return{next:_}}function _(){return{value:void 0,done:!0}}return p.prototype=v.constructor=h,h.constructor=p,p.displayName=a(h,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===p||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a(t,i,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},m(b.prototype),b.prototype[u]=function(){return this},t.AsyncIterator=b,t.async=function(r,e,n,o,u){void 0===u&&(u=Promise);var i=new b(c(r,e,n,o),u);return t.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},m(v),a(v,i,"Generator"),v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=S,O.prototype={constructor:O,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(j),!t)for(var r in this)"t"===r.charAt(0)&&e.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function n(e,n){return i.type="throw",i.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],i=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var a=e.call(u,"catchLoc"),c=e.call(u,"finallyLoc");if(a&&c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(t,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var u=o;break}}u&&("break"===t||"continue"===t)&&u.tryLoc<=r&&r<=u.finallyLoc&&(u=null);var i=u?u.completion:{};return i.type=t,i.arg=r,u?(this.method="next",this.next=u.finallyLoc,f):this.complete(i)},complete:function(t,r){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&&r&&(this.next=r),f},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),j(e),f}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;j(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:S(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}})),u=e((function(t){t.exports=function(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n},t.exports.default=t.exports,t.exports.__esModule=!0}));r(u);var i=e((function(t){t.exports=function(t){if(Array.isArray(t))return u(t)},t.exports.default=t.exports,t.exports.__esModule=!0}));r(i);var a=e((function(t){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0}));r(a);var c=e((function(t){t.exports=function(t,r){if(t){if("string"==typeof t)return u(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(t,r):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0}));r(c);var s=e((function(t){t.exports=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.")},t.exports.default=t.exports,t.exports.__esModule=!0}));r(s);var f=r(e((function(t){t.exports=function(t){return i(t)||a(t)||c(t)||s()},t.exports.default=t.exports,t.exports.__esModule=!0}))),l=e((function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0}));r(l);var p=e((function(t){t.exports=function(t,r){var e=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=e){var n,o,u=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(u.push(n.value),!r||u.length!==r);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw o}}return u}},t.exports.default=t.exports,t.exports.__esModule=!0}));r(p);var h=e((function(t){t.exports=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.")},t.exports.default=t.exports,t.exports.__esModule=!0}));r(h);var d=r(e((function(t){t.exports=function(t,r){return l(t)||p(t,r)||c(t,r)||h()},t.exports.default=t.exports,t.exports.__esModule=!0}))),y=r(e((function(t){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0}))),g=r(e((function(t){t.exports=function(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t},t.exports.default=t.exports,t.exports.__esModule=!0}))),v=e((function(t,r){function e(t){return"object"!=typeof t||"toString"in t?t:Object.prototype.toString.call(t).slice(8,-1)}Object.defineProperty(r,"__esModule",{value:!0});var n="object"==typeof process&&"production"===process.env.NODE_ENV;function o(t,r){if(!t){if(n)throw new Error("Invariant failed");throw new Error(r())}}r.invariant=o;var u=Object.prototype.hasOwnProperty,i=Array.prototype.splice,a=Object.prototype.toString;function c(t){return a.call(t).slice(8,-1)}var s=Object.assign||function(t,r){return f(r).forEach((function(e){u.call(r,e)&&(t[e]=r[e])})),t},f="function"==typeof Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.keys(t)};function l(t){return Array.isArray(t)?s(t.constructor(t.length),t):"Map"===c(t)?new Map(t):"Set"===c(t)?new Set(t):t&&"object"==typeof t?s(Object.create(Object.getPrototypeOf(t)),t):t}var p=function(){function t(){this.commands=s({},h),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(t,r){return t===r},this.update.newContext=function(){return(new t).update}}return Object.defineProperty(t.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(t){this.update.isEquals=t},enumerable:!0,configurable:!0}),t.prototype.extend=function(t,r){this.commands[t]=r},t.prototype.update=function(t,r){var e=this,n="function"==typeof r?{$apply:r}:r;Array.isArray(t)&&Array.isArray(n)||o(!Array.isArray(n),(function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."})),o("object"==typeof n&&null!==n,(function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the following commands: "+Object.keys(e.commands).join(", ")+"."}));var i=t;return f(n).forEach((function(r){if(u.call(e.commands,r)){var o=t===i;i=e.commands[r](n[r],i,n,t),o&&e.isEquals(i,t)&&(i=t)}else{var a="Map"===c(t)?e.update(t.get(r),n[r]):e.update(t[r],n[r]),s="Map"===c(i)?i.get(r):i[r];e.isEquals(a,s)&&(void 0!==a||u.call(t,r))||(i===t&&(i=l(t)),"Map"===c(i)?i.set(r,a):i[r]=a)}})),i},t}();r.Context=p;var h={$push:function(t,r,e){return y(r,e,"$push"),t.length?r.concat(t):r},$unshift:function(t,r,e){return y(r,e,"$unshift"),t.length?t.concat(r):r},$splice:function(t,r,n,u){return function(t,r){o(Array.isArray(t),(function(){return"Expected $splice target to be an array; got "+e(t)})),v(r.$splice)}(r,n),t.forEach((function(t){v(t),r===u&&t.length&&(r=l(u)),i.apply(r,t)})),r},$set:function(t,r,e){return function(t){o(1===Object.keys(t).length,(function(){return"Cannot have more than one key in an object with $set"}))}(e),t},$toggle:function(t,r){g(t,"$toggle");var e=t.length?l(r):r;return t.forEach((function(t){e[t]=!r[t]})),e},$unset:function(t,r,e,n){return g(t,"$unset"),t.forEach((function(t){Object.hasOwnProperty.call(r,t)&&(r===n&&(r=l(n)),delete r[t])})),r},$add:function(t,r,e,n){return m(r,"$add"),g(t,"$add"),"Map"===c(r)?t.forEach((function(t){var e=t[0],o=t[1];r===n&&r.get(e)!==o&&(r=l(n)),r.set(e,o)})):t.forEach((function(t){r!==n||r.has(t)||(r=l(n)),r.add(t)})),r},$remove:function(t,r,e,n){return m(r,"$remove"),g(t,"$remove"),t.forEach((function(t){r===n&&r.has(t)&&(r=l(n)),r.delete(t)})),r},$merge:function(t,r,n,u){var i,a;return i=r,o((a=t)&&"object"==typeof a,(function(){return"update(): $merge expects a spec of type 'object'; got "+e(a)})),o(i&&"object"==typeof i,(function(){return"update(): $merge expects a target of type 'object'; got "+e(i)})),f(t).forEach((function(e){t[e]!==r[e]&&(r===u&&(r=l(u)),r[e]=t[e])})),r},$apply:function(t,r){var n;return o("function"==typeof(n=t),(function(){return"update(): expected spec of $apply to be a function; got "+e(n)+"."})),t(r)}},d=new p;function y(t,r,n){o(Array.isArray(t),(function(){return"update(): expected target of "+e(n)+" to be an array; got "+e(t)+"."})),g(r[n],n)}function g(t,r){o(Array.isArray(t),(function(){return"update(): expected spec of "+e(r)+" to be an array; got "+e(t)+". Did you forget to wrap your parameter in an array?"}))}function v(t){o(Array.isArray(t),(function(){return"update(): expected spec of $splice to be an array of arrays; got "+e(t)+". Did you forget to wrap your parameters in an array?"}))}function m(t,r){var n=c(t);o("Map"===n||"Set"===n,(function(){return"update(): "+e(r)+" expects a target of type Set or Map; got "+e(n)}))}r.isEquals=d.update.isEquals,r.extend=d.extend,r.default=d.update,r.default.default=t.exports=s(r.default,r)})),m=r(v);v.invariant,v.Context,v.isEquals,v.extend;function b(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function x(t){return function r(e){return 0===arguments.length||b(e)?r:t.apply(this,arguments)}}function w(t){return function r(e,n){switch(arguments.length){case 0:return r;case 1:return b(e)?r:x((function(r){return t(e,r)}));default:return b(e)&&b(n)?r:b(e)?x((function(r){return t(r,n)})):b(n)?x((function(r){return t(e,r)})):t(e,n)}}}function j(t,r){switch(t){case 0:return function(){return r.apply(this,arguments)};case 1:return function(t){return r.apply(this,arguments)};case 2:return function(t,e){return r.apply(this,arguments)};case 3:return function(t,e,n){return r.apply(this,arguments)};case 4:return function(t,e,n,o){return r.apply(this,arguments)};case 5:return function(t,e,n,o,u){return r.apply(this,arguments)};case 6:return function(t,e,n,o,u,i){return r.apply(this,arguments)};case 7:return function(t,e,n,o,u,i,a){return r.apply(this,arguments)};case 8:return function(t,e,n,o,u,i,a,c){return r.apply(this,arguments)};case 9:return function(t,e,n,o,u,i,a,c,s){return r.apply(this,arguments)};case 10:return function(t,e,n,o,u,i,a,c,s,f){return r.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}var O=w((function(t,r){return 1===t?x(r):j(t,function t(r,e,n){return function(){for(var o=[],u=0,i=r,a=0;a<e.length||u<arguments.length;){var c;a<e.length&&(!b(e[a])||u>=arguments.length)?c=e[a]:(c=arguments[u],u+=1),o[a]=c,b(c)||(i-=1),a+=1}return i<=0?n.apply(this,o):j(i,t(r,o,n))}}(t,[],r))}));function S(t){return function r(e,n,o){switch(arguments.length){case 0:return r;case 1:return b(e)?r:w((function(r,n){return t(e,r,n)}));case 2:return b(e)&&b(n)?r:b(e)?w((function(r,e){return t(r,n,e)})):b(n)?w((function(r,n){return t(e,r,n)})):x((function(r){return t(e,n,r)}));default:return b(e)&&b(n)&&b(o)?r:b(e)&&b(n)?w((function(r,e){return t(r,e,o)})):b(e)&&b(o)?w((function(r,e){return t(r,n,e)})):b(n)&&b(o)?w((function(r,n){return t(e,r,n)})):b(e)?x((function(r){return t(r,n,o)})):b(n)?x((function(r){return t(e,r,o)})):b(o)?x((function(r){return t(e,n,r)})):t(e,n,o)}}}var _=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)};function E(t){return null!=t&&"function"==typeof t["@@transducer/step"]}function A(t,r,e){return function(){if(0===arguments.length)return e();var n=arguments[arguments.length-1];if(!_(n)){for(var o=0;o<t.length;){if("function"==typeof n[t[o]])return n[t[o]].apply(n,Array.prototype.slice.call(arguments,0,-1));o+=1}if(E(n)){var u=r.apply(null,Array.prototype.slice.call(arguments,0,-1));return u(n)}}return e.apply(this,arguments)}}function P(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var k={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function $(t,r){for(var e=0,n=r.length,o=Array(n);e<n;)o[e]=t(r[e]),e+=1;return o}function T(t){return"[object String]"===Object.prototype.toString.call(t)}var M=x((function(t){return!!_(t)||!!t&&("object"==typeof t&&(!T(t)&&(0===t.length||t.length>0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))})),L=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,r){return this.f(t,r)},t}();var q=w((function(t,r){return j(t.length,(function(){return t.apply(r,arguments)}))}));function N(t,r,e){for(var n=e.next();!n.done;){if((r=t["@@transducer/step"](r,n.value))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}n=e.next()}return t["@@transducer/result"](r)}function C(t,r,e,n){return t["@@transducer/result"](e[n](q(t["@@transducer/step"],t),r))}var I="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function F(t,r,e){if("function"==typeof t&&(t=function(t){return new L(t)}(t)),M(e))return function(t,r,e){for(var n=0,o=e.length;n<o;){if((r=t["@@transducer/step"](r,e[n]))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}n+=1}return t["@@transducer/result"](r)}(t,r,e);if("function"==typeof e["fantasy-land/reduce"])return C(t,r,e,"fantasy-land/reduce");if(null!=e[I])return N(t,r,e[I]());if("function"==typeof e.next)return N(t,r,e);if("function"==typeof e.reduce)return C(t,r,e,"reduce");throw new TypeError("reduce: list must be array or iterable")}var D=function(){function t(t,r){this.xf=r,this.f=t}return t.prototype["@@transducer/init"]=k.init,t.prototype["@@transducer/result"]=k.result,t.prototype["@@transducer/step"]=function(t,r){return this.xf["@@transducer/step"](t,this.f(r))},t}(),U=w((function(t,r){return new D(t,r)}));function G(t,r){return Object.prototype.hasOwnProperty.call(r,t)}var z=Object.prototype.toString,R=function(){return"[object Arguments]"===z.call(arguments)?function(t){return"[object Arguments]"===z.call(t)}:function(t){return G("callee",t)}}(),B=!{toString:null}.propertyIsEnumerable("toString"),Y=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],V=function(){return arguments.propertyIsEnumerable("length")}(),W=function(t,r){for(var e=0;e<t.length;){if(t[e]===r)return!0;e+=1}return!1},K="function"!=typeof Object.keys||V?x((function(t){if(Object(t)!==t)return[];var r,e,n=[],o=V&&R(t);for(r in t)!G(r,t)||o&&"length"===r||(n[n.length]=r);if(B)for(e=Y.length-1;e>=0;)G(r=Y[e],t)&&!W(n,r)&&(n[n.length]=r),e-=1;return n})):x((function(t){return Object(t)!==t?[]:Object.keys(t)})),H=w(A(["fantasy-land/map","map"],U,(function(t,r){switch(Object.prototype.toString.call(r)){case"[object Function]":return O(r.length,(function(){return t.call(this,r.apply(this,arguments))}));case"[object Object]":return F((function(e,n){return e[n]=t(r[n]),e}),{},K(r));default:return $(t,r)}}))),J=Number.isInteger||function(t){return t<<0===t},X=w((function(t,r){var e=t<0?r.length+t:t;return T(r)?r.charAt(e):r[e]})),Z=w((function(t,r){if(null!=r)return J(t)?X(t,r):r[t]})),Q=S(F);var tt=x((function(t){return null==t})),rt=S((function t(r,e,n){if(0===r.length)return e;var o=r[0];if(r.length>1){var u=!tt(n)&&G(o,n)?n[o]:J(r[1])?[]:{};e=t(Array.prototype.slice.call(r,1),e,u)}return function(t,r,e){if(J(t)&&_(e)){var n=[].concat(e);return n[t]=r,n}var o={};for(var u in e)o[u]=e[u];return o[t]=r,o}(o,e,n)}));function et(t){var r=Object.prototype.toString.call(t);return"[object Function]"===r||"[object AsyncFunction]"===r||"[object GeneratorFunction]"===r||"[object AsyncGeneratorFunction]"===r}var nt=function(t){var r=function(t){return{"@@transducer/init":k.init,"@@transducer/result":function(r){return t["@@transducer/result"](r)},"@@transducer/step":function(r,e){var n=t["@@transducer/step"](r,e);return n["@@transducer/reduced"]?{"@@transducer/value":n,"@@transducer/reduced":!0}:n}}}(t);return{"@@transducer/init":k.init,"@@transducer/result":function(t){return r["@@transducer/result"](t)},"@@transducer/step":function(t,e){return M(e)?F(r,t,e):F(r,t,[e])}}},ot=w(A(["fantasy-land/chain","chain"],w((function(t,r){return H(t,nt(r))})),(function(t,r){return"function"==typeof r?function(e){return t(r(e))(e)}:(e=!1,function t(r){for(var n,o,u,i=[],a=0,c=r.length;a<c;){if(M(r[a]))for(u=0,o=(n=e?t(r[a]):r[a]).length;u<o;)i[i.length]=n[u],u+=1;else i[i.length]=r[a];a+=1}return i})(H(t,r));var e})));var ut=x((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function it(t,r){return function(){return r.call(this,t.apply(this,arguments))}}function at(t,r){return function(){var e=arguments.length;if(0===e)return r();var n=arguments[e-1];return _(n)||"function"!=typeof n[t]?r.apply(this,arguments):n[t].apply(n,Array.prototype.slice.call(arguments,0,e-1))}}var ct=S(at("slice",(function(t,r,e){return Array.prototype.slice.call(e,t,r)}))),st=x(at("tail",ct(1,1/0)));function ft(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return j(arguments[0].length,Q(it,arguments[0],st(arguments)))}var lt=X(0);function pt(t){return t}var ht=x(pt);function dt(t){for(var r,e=[];!(r=t.next()).done;)e.push(r.value);return e}function yt(t,r,e){for(var n=0,o=e.length;n<o;){if(t(r,e[n]))return!0;n+=1}return!1}var gt="function"==typeof Object.is?Object.is:function(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r};function vt(t,r,e,n){var o=dt(t);function u(t,r){return mt(t,r,e.slice(),n.slice())}return!yt((function(t,r){return!yt(u,r,t)}),dt(r),o)}function mt(t,r,e,n){if(gt(t,r))return!0;var o,u,i=ut(t);if(i!==ut(r))return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof r["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](r)&&"function"==typeof r["fantasy-land/equals"]&&r["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof r.equals)return"function"==typeof t.equals&&t.equals(r)&&"function"==typeof r.equals&&r.equals(t);switch(i){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(o=t.constructor,null==(u=String(o).match(/^function (\w*)/))?"":u[1]))return t===r;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof r||!gt(t.valueOf(),r.valueOf()))return!1;break;case"Date":if(!gt(t.valueOf(),r.valueOf()))return!1;break;case"Error":return t.name===r.name&&t.message===r.message;case"RegExp":if(t.source!==r.source||t.global!==r.global||t.ignoreCase!==r.ignoreCase||t.multiline!==r.multiline||t.sticky!==r.sticky||t.unicode!==r.unicode)return!1}for(var a=e.length-1;a>=0;){if(e[a]===t)return n[a]===r;a-=1}switch(i){case"Map":return t.size===r.size&&vt(t.entries(),r.entries(),e.concat([t]),n.concat([r]));case"Set":return t.size===r.size&&vt(t.values(),r.values(),e.concat([t]),n.concat([r]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=K(t);if(c.length!==K(r).length)return!1;var s=e.concat([t]),f=n.concat([r]);for(a=c.length-1;a>=0;){var l=c[a];if(!G(l,r)||!mt(r[l],t[l],s,f))return!1;a-=1}return!0}var bt=w((function(t,r){return mt(t,r,[],[])}));function xt(t,r){return function(t,r,e){var n,o;if("function"==typeof t.indexOf)switch(typeof r){case"number":if(0===r){for(n=1/r;e<t.length;){if(0===(o=t[e])&&1/o===n)return e;e+=1}return-1}if(r!=r){for(;e<t.length;){if("number"==typeof(o=t[e])&&o!=o)return e;e+=1}return-1}return t.indexOf(r,e);case"string":case"boolean":case"function":case"undefined":return t.indexOf(r,e);case"object":if(null===r)return t.indexOf(r,e)}for(;e<t.length;){if(bt(t[e],r))return e;e+=1}return-1}(r,t,0)>=0}function wt(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var jt=function(t){return(t<10?"0":"")+t},Ot="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+jt(t.getUTCMonth()+1)+"-"+jt(t.getUTCDate())+"T"+jt(t.getUTCHours())+":"+jt(t.getUTCMinutes())+":"+jt(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function St(t){return"[object Object]"===Object.prototype.toString.call(t)}var _t=function(){function t(t,r){this.xf=r,this.f=t}return t.prototype["@@transducer/init"]=k.init,t.prototype["@@transducer/result"]=k.result,t.prototype["@@transducer/step"]=function(t,r){return this.f(r)?this.xf["@@transducer/step"](t,r):t},t}(),Et=w(A(["fantasy-land/filter","filter"],w((function(t,r){return new _t(t,r)})),(function(t,r){return St(r)?F((function(e,n){return t(r[n])&&(e[n]=r[n]),e}),{},K(r)):function(t,r){for(var e=0,n=r.length,o=[];e<n;)t(r[e])&&(o[o.length]=r[e]),e+=1;return o}(t,r)}))),At=w((function(t,r){return Et((e=t,function(){return!e.apply(this,arguments)}),r);var e}));var Pt=x((function(t){return function t(r,e){var n=function(n){var o=e.concat([r]);return xt(n,o)?"<Circular>":t(n,o)},o=function(t,r){return $((function(r){return wt(r)+": "+n(t[r])}),r.slice().sort())};switch(Object.prototype.toString.call(r)){case"[object Arguments]":return"(function() { return arguments; }("+$(n,r).join(", ")+"))";case"[object Array]":return"["+$(n,r).concat(o(r,At((function(t){return/^\d+$/.test(t)}),K(r)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof r?"new Boolean("+n(r.valueOf())+")":r.toString();case"[object Date]":return"new Date("+(isNaN(r.valueOf())?n(NaN):wt(Ot(r)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof r?"new Number("+n(r.valueOf())+")":1/r==-1/0?"-0":r.toString(10);case"[object String]":return"object"==typeof r?"new String("+n(r.valueOf())+")":wt(r);case"[object Undefined]":return"undefined";default:if("function"==typeof r.toString){var u=r.toString();if("[object Object]"!==u)return u}return"{"+o(r,K(r)).join(", ")+"}"}}(t,[])})),kt=w((function(t,r){if(_(t)){if(_(r))return t.concat(r);throw new TypeError(Pt(r)+" is not an array")}if(T(t)){if(T(r))return t+r;throw new TypeError(Pt(r)+" is not a string")}if(null!=t&&et(t["fantasy-land/concat"]))return t["fantasy-land/concat"](r);if(null!=t&&et(t.concat))return t.concat(r);throw new TypeError(Pt(t)+' does not have a method named "concat" or "fantasy-land/concat"')})),$t=function(){function t(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return t.prototype.add=function(t){return!Tt(t,!0,this)},t.prototype.has=function(t){return Tt(t,!1,this)},t}();function Tt(t,r,e){var n,o=typeof t;switch(o){case"string":case"number":return 0===t&&1/t==-1/0?!!e._items["-0"]||(r&&(e._items["-0"]=!0),!1):null!==e._nativeSet?r?(n=e._nativeSet.size,e._nativeSet.add(t),e._nativeSet.size===n):e._nativeSet.has(t):o in e._items?t in e._items[o]||(r&&(e._items[o][t]=!0),!1):(r&&(e._items[o]={},e._items[o][t]=!0),!1);case"boolean":if(o in e._items){var u=t?1:0;return!!e._items[o][u]||(r&&(e._items[o][u]=!0),!1)}return r&&(e._items[o]=t?[!1,!0]:[!0,!1]),!1;case"function":return null!==e._nativeSet?r?(n=e._nativeSet.size,e._nativeSet.add(t),e._nativeSet.size===n):e._nativeSet.has(t):o in e._items?!!xt(t,e._items[o])||(r&&e._items[o].push(t),!1):(r&&(e._items[o]=[t]),!1);case"undefined":return!!e._items[o]||(r&&(e._items[o]=!0),!1);case"object":if(null===t)return!!e._items.null||(r&&(e._items.null=!0),!1);default:return(o=Object.prototype.toString.call(t))in e._items?!!xt(t,e._items[o])||(r&&e._items[o].push(t),!1):(r&&(e._items[o]=[t]),!1)}}var Mt=function(){function t(t,r){this.xf=r,this.n=t,this.i=0}return t.prototype["@@transducer/init"]=k.init,t.prototype["@@transducer/result"]=k.result,t.prototype["@@transducer/step"]=function(t,r){this.i+=1;var e=0===this.n?t:this.xf["@@transducer/step"](t,r);return this.n>=0&&this.i>=this.n?P(e):e},t}(),Lt=w(A(["take"],w((function(t,r){return new Mt(t,r)})),(function(t,r){return ct(0,t<0?1/0:t,r)})));function qt(t,r){return Lt(t<r.length?r.length-t:0,r)}var Nt=function(){function t(t,r){this.xf=r,this.pos=0,this.full=!1,this.acc=new Array(t)}return t.prototype["@@transducer/init"]=k.init,t.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,r){return this.full&&(t=this.xf["@@transducer/step"](t,this.acc[this.pos])),this.store(r),t},t.prototype.store=function(t){this.acc[this.pos]=t,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},t}(),Ct=w(A([],w((function(t,r){return new Nt(t,r)})),qt)),It=X(-1),Ft=function(){function t(t,r){this.xf=r,this.f=t,this.found=!1}return t.prototype["@@transducer/init"]=k.init,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,r){return this.f(r)&&(this.found=!0,t=P(this.xf["@@transducer/step"](t,r))),t},t}(),Dt=w(A(["find"],w((function(t,r){return new Ft(t,r)})),(function(t,r){for(var e=0,n=r.length;e<n;){if(t(r[e]))return r[e];e+=1}}))),Ut=function(){function t(t,r){this.xf=r,this.f=t,this.idx=-1,this.found=!1}return t.prototype["@@transducer/init"]=k.init,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,-1)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,r){return this.idx+=1,this.f(r)&&(this.found=!0,t=P(this.xf["@@transducer/step"](t,this.idx))),t},t}(),Gt=w(A([],w((function(t,r){return new Ut(t,r)})),(function(t,r){for(var e=0,n=r.length;e<n;){if(t(r[e]))return e;e+=1}return-1}))),zt=x((function(t){for(var r={},e=0;e<t.length;)r[t[e][0]]=t[e][1],e+=1;return r})),Rt=w((function(t,r){if(0===t.length||tt(r))return!1;for(var e=r,n=0;n<t.length;){if(tt(e)||!G(t[n],e))return!1;e=e[t[n]],n+=1}return!0})),Bt=w((function(t,r){return Rt([t],r)})),Yt=function(){function t(t,r){this.xf=r,this.f=t,this.set=new $t}return t.prototype["@@transducer/init"]=k.init,t.prototype["@@transducer/result"]=k.result,t.prototype["@@transducer/step"]=function(t,r){return this.set.add(this.f(r))?this.xf["@@transducer/step"](t,r):t},t}(),Vt=w(A([],w((function(t,r){return new Yt(t,r)})),(function(t,r){for(var e,n,o=new $t,u=[],i=0;i<r.length;)e=t(n=r[i]),o.add(e)&&u.push(n),i+=1;return u})))(ht),Wt=w((function(t,r){return O(t+1,(function(){var e=arguments[t];if(null!=e&&et(e[r]))return e[r].apply(e,Array.prototype.slice.call(arguments,0,t));throw new TypeError(Pt(e)+' does not have a method named "'+r+'"')}))})),Kt=w((function(t,r){return function(e){return function(n){return H((function(t){return r(t,n)}),e(t(n)))}}})),Ht=w((function(t,r){return t.map((function(t){for(var e,n=r,o=0;o<t.length;){if(null==n)return;e=t[o],n=J(e)?X(e,n):n[e],o+=1}return n}))})),Jt=w((function(t,r){return Ht([t],r)[0]})),Xt=x((function(t){return Kt(Jt(t),rt(t))})),Zt=S((function(t,r,e){var n,o={};for(n in r)G(n,r)&&(o[n]=G(n,e)?t(n,r[n],e[n]):r[n]);for(n in e)G(n,e)&&!G(n,o)&&(o[n]=e[n]);return o})),Qt=S((function t(r,e,n){return Zt((function(e,n,o){return St(n)&&St(o)?t(r,n,o):r(e,n,o)}),e,n)})),tr=S((function(t,r,e){return bt(r,Z(t,e))})),rr=Wt(1,"split");var er=w((function(t,r){if(e=t,"[object RegExp]"!==Object.prototype.toString.call(e))throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received "+Pt(t));var e;return function(t){return new RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":""))}(t).test(r)})),nr=x((function(t){var r=[];for(var e in t)G(e,t)&&(r[r.length]=[e,t[e]]);return r})),or=function(t){return{value:t,"fantasy-land/map":function(){return this}}},ur=w((function(t,r){return t(or)(r).value})),ir=w((function(t,r){for(var e=[],n=0,o=Math.min(t.length,r.length);n<o;)e[n]=[t[n],r[n]],n+=1;return e})),ar={flattenObj:function(t){return zt(function t(r){return ot((function(r){var e=d(r,2),n=e[0],o=e[1];return"Object"===ut(o)||"Array"===ut(o)?H((function(t){var r=d(t,2),e=r[0],o=r[1];return["".concat(n,".").concat(e),o]}),t(o)):[[n,o]]}),nr(r))}(t))},pathSplit:ft(rr("/"),Et((function(t){return t.length>0}))),mapToPaths:function(t){return H((function(t){return t.split(".")}),K(t))},mapToLenses:function(t){return H((function(t){return Xt(t)}),t)},mapToViews:function(t,r){return H((function(t){return ur(t,r)}),t)},mergeDeepWithKeyAll:function(t,r){return Q((function(r,e){return Qt(t,r,e)}),{},r)}};function cr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function sr(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?cr(Object(e),!0).forEach((function(r){g(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):cr(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}var fr,lr=/^binding:.*/,pr=["anyOf","allOf","oneOf"],hr=[],dr=function(r){return function(){var e=n(o.mark((function e(n){var u,i,a,c,s,f,l,p;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r["binding:source"].transformation){e.next=8;break}return e.next=3,t.post("/transformations/".concat(r["binding:source"].transformation),Array.isArray(n)?{incoming:{root:n}}:{incoming:n}).catch((function(t){return t}));case 3:if(u=e.sent,Array.isArray(u.data)||"object"!==y(u.data)){e.next=7;break}return i=d(Object.entries(u.data)[0],2),a=i[1],e.abrupt("return",a);case 7:return e.abrupt("return",u.data);case 8:if(c=ar.pathSplit(r["binding:source"].propertyPointer),s=Xt(c),f=ur(s,n),!r["binding:target"]||"/enum"!==r["binding:target"].propertyPointer&&"/enumNames"!==r["binding:target"].propertyPointer||f||(f=[]),r["binding:source"].keyPointer&&"/"!==r["binding:source"].keyPointer){e.next=14;break}return e.abrupt("return",f);case 14:return l=ar.pathSplit(r["binding:source"].keyPointer),p=Xt(l),e.abrupt("return",H((function(t){return ur(p,t)}),f));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},yr={uniqPaths:ft(ar.flattenObj,ar.mapToPaths,(function(t){return Et((function(t){return Gt(er(lr))(t)>-1}),t)}),(function(t){return H((function(t){var r=Gt(er(lr))(t);return Ct(t.length-r,t)}),t)}),Vt),configs:function(t,r){return ar.mapToViews(ar.mapToLenses(t),r)},requests:function(t){return H((function(t){return e=(r=t)["binding:method"],n=r["binding:body"],o=r["binding:hyperSchema"],u=ar.pathSplit(r["binding:link"].$ref),i=ur(Xt(u),o),a=Dt(tr("rel",r["binding:link"].rel),i),sr(sr({method:e,timeout:r["binding:timeout"],baseURL:o.base,url:a.href},n&&{data:n}),{},{headers:{"Content-Type":a.targetMediaType}});var r,e,n,o,u,i,a}),t)},responses:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=r.filter((function(t){return!t.url.includes(":")}));return Promise.all(H((function(r){return t.request(r).then((function(t){return new Promise((function(r){r(t)}))})).catch((function(t){return new Promise((function(r){console.error("Error: ".concat(JSON.stringify(t))),r({type:"error",message:t.message})}))}))}),e))},sources:(fr=n(o.mark((function t(r,e,n){var u;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.length){t.next=2;break}return t.abrupt("return",[]);case 2:return(u=ir(r,e)).forEach((function(t,r){var e=lt(t);if(Bt("type",e)&&"error"===e.type){var o=rt([n[r]],e.message,{});hr.push(o)}})),u=Et((function(t){var r=lt(t);return!(Bt("type",r)&&"error"===r.type)||void 0!==r}),u),t.abrupt("return",Promise.all(H((function(t){var r=lt(t),e=It(t);return dr(e)(r.data)}),u)));case 7:case"end":return t.stop()}}),t)}))),function(t,r,e){return fr.apply(this,arguments)}),targetPaths:function(t,r){var e=ir(t,r);return H((function(t){var r=lt(t),e=It(t),n=ar.pathSplit(e["binding:target"].propertyPointer);return[].concat(f(r),f(n))}),e)},insertToSchema:function(t,r,e){var n={};t.forEach((function(t,r){var e="";t.forEach((function(r,n){var o=pr.includes(t[n-1]||"");(!Number(r)&&0!==Number(r)||o)&&(e+=r+(n!==t.length-1?",":""))})),Object.prototype.hasOwnProperty.call(n,e)&&n[e].targets?n[e].targets.push(r):n[e]={targets:[r],targetPath:e.split(",")}}));var o=Object.values(n).map((function(t){var e=t.targets.flatMap((function(t){return r&&r.length>0?r[t]:[]}));if(t.targets.length>1){var n=f(new Set(e));return rt(t.targetPath,{$set:n},{})}return rt(t.targetPath,{$set:e},{})})),u=ar.mergeDeepWithKeyAll(kt,o.filter((function(t){return null!=t})));return{boundSchema:m(e,u),errors:hr}}},gr={compose:function(t){var r=arguments;return n(o.mark((function e(){var n,u,i,a,c,s,f;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},u=yr.uniqPaths(t),i=yr.configs(u,t),a=yr.targetPaths(u,i),c=yr.requests(i),e.next=7,yr.responses(c);case 7:return s=e.sent,e.next=10,yr.sources(s,i,u);case 10:return f=e.sent,e.abrupt("return",yr.insertToSchema(a,f,n).boundSchema);case 12:case"end":return e.stop()}}),e)})))()},composeAll:function(t){var r=arguments;return n(o.mark((function e(){var n,u,i,a,c,s,f;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},u=yr.uniqPaths(t),i=yr.configs(u,t),a=yr.targetPaths(u,i),c=yr.requests(i),e.next=7,yr.responses(c);case 7:return s=e.sent,e.next=10,yr.sources(s,i,u);case 10:return f=e.sent,e.abrupt("return",yr.insertToSchema(a,f,n));case 12:case"end":return e.stop()}}),e)})))()}};export default gr;